summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-03-08 22:16:21 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-03-08 22:16:21 +0100
commite8ae429ac0d4f12ecdad6088605d81de6cf67cce (patch)
treeae96695b6a2c3f7ee52db8a6b8a9075163b6613b /src/AssetManager.cpp
parentMinor RendererSectionData parsing memory optimization (diff)
downloadAltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar.gz
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar.bz2
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar.lz
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar.xz
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.tar.zst
AltCraft-e8ae429ac0d4f12ecdad6088605d81de6cf67cce.zip
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r--src/AssetManager.cpp7
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};
}