diff options
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r-- | src/AssetManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 0561992..8403700 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -69,9 +69,10 @@ void AssetManager::LoadTextureResources() { LOG(INFO) << "Texture atlas id is " << textureAtlas->texture; } -TextureCoordinates AssetManager::GetTextureByAssetName(std::string AssetName) { - if (assetTextures.find(AssetName) != assetTextures.end()) - return assetTextures[AssetName]; +TextureCoordinates AssetManager::GetTextureByAssetName(const std::string &AssetName) { + auto it = assetTextures.find(AssetName); + if (it != assetTextures.end()) + return it->second; else return TextureCoordinates{-1, -1, -1, -1}; } |