mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 13:25:10 +00:00
first pr fixes from reviews
This commit is contained in:
@@ -60,15 +60,17 @@ namespace RAY {
|
||||
{};
|
||||
std::shared_ptr<::ModelAnimation> fetch(const std::string &path, int *counter)
|
||||
{
|
||||
if (this->_cache.find(path) != this->_cache.end())
|
||||
return this->_cache[path];
|
||||
|
||||
::ModelAnimation *animations = this->_dataLoader(path.c_str(), counter);
|
||||
unsigned int animCount = *counter;
|
||||
|
||||
if (this->_cache.find(path) == this->_cache.end())
|
||||
this->_cache.emplace(path, std::shared_ptr<::ModelAnimation>(
|
||||
animations, [this, animCount](::ModelAnimation *p) {
|
||||
this->_dataUnloader(p, animCount);
|
||||
}));
|
||||
return _cache[path];
|
||||
this->_cache.emplace(path, std::shared_ptr<::ModelAnimation>(
|
||||
animations, [this, animCount](::ModelAnimation *p) {
|
||||
this->_dataUnloader(p, animCount);
|
||||
}));
|
||||
return this->_cache[path];
|
||||
};
|
||||
private:
|
||||
//! @brief function to call to load data
|
||||
|
||||
Reference in New Issue
Block a user