mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-29 08:52:06 +00:00
when a resource is not found, an exceptions is thrown
This commit is contained in:
@@ -7,7 +7,13 @@
|
||||
|
||||
#include "Model/ModelAnimations.hpp"
|
||||
|
||||
RAY::Cache<::ModelAnimation> RAY::ModelAnimations::_animationsCache(LoadModelAnimations, UnloadModelAnimations);
|
||||
RAY::Cache<::ModelAnimation> RAY::ModelAnimations::_animationsCache([] (const char *str, int *counter) {
|
||||
::ModelAnimation *modelanimations = LoadModelAnimations(str, counter);
|
||||
|
||||
if (modelanimations == nullptr)
|
||||
throw Exception::ResourceNotFound(std::string(str));
|
||||
return modelanimations;
|
||||
}, UnloadModelAnimations);
|
||||
|
||||
RAY::ModelAnimations::ModelAnimations(const std::string &filePath):
|
||||
_animationsPtr(_animationsCache.fetch(filePath, &this->_animationCount)),
|
||||
|
||||
Reference in New Issue
Block a user