mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 21:35:12 +00:00
generic cache system
This commit is contained in:
@@ -7,8 +7,10 @@
|
||||
|
||||
#include "Model/ModelAnimations.hpp"
|
||||
|
||||
RAY::Cache<::ModelAnimation> RAY::ModelAnimations::_animationsCache(LoadModelAnimations, UnloadModelAnimations);
|
||||
|
||||
RAY::ModelAnimations::ModelAnimations(const std::string &filePath):
|
||||
_animationsPtr(LoadModelAnimations(filePath.c_str(), &this->_animationCount))
|
||||
_animationsPtr(_animationsCache.fetch(filePath, &this->_animationCount))
|
||||
{
|
||||
::ModelAnimation *ptr = this->_animationsPtr.get();
|
||||
|
||||
@@ -16,11 +18,6 @@ RAY::ModelAnimations::ModelAnimations(const std::string &filePath):
|
||||
this->_animations.push_back(RAY::ModelAnimation(ptr[i]));
|
||||
}
|
||||
|
||||
RAY::ModelAnimations::~ModelAnimations()
|
||||
{
|
||||
UnloadModelAnimations(this->_animationsPtr.release(), this->_animationCount);
|
||||
}
|
||||
|
||||
RAY::ModelAnimation &RAY::ModelAnimations::operator[](int index)
|
||||
{
|
||||
return this->_animations[index];
|
||||
|
||||
Reference in New Issue
Block a user