diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-08-24 00:25:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 00:25:31 +0100 |
commit | a326354ea6fccf76665a4212bf14daeba0f52ec8 (patch) | |
tree | 18cd2deb0c30b38d8ca7c5305735d2323259e020 /src/texturecache.cpp | |
parent | 0a49874288f92c120d7e165550eb6dbbe1ef7307 (diff) | |
parent | 5403490b941f7c031bf1aafdb91b1098f69edbf2 (diff) | |
download | YAGE-0.1.0.tar.gz YAGE-0.1.0.zip |
Merge pull request #3 from ymherklotz/developv0.1.0
Merge develop to master
Diffstat (limited to 'src/texturecache.cpp')
-rw-r--r-- | src/texturecache.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/texturecache.cpp b/src/texturecache.cpp index 6d10b209..5ce89dc1 100644 --- a/src/texturecache.cpp +++ b/src/texturecache.cpp @@ -6,27 +6,25 @@ * ---------------------------------------------------------------------------- */ -#include "imageloader.hpp" #include "texturecache.hpp" +#include "imageloader.hpp" namespace yage { -TextureCache::TextureCache() -{} +TextureCache::TextureCache() = default; Texture TextureCache::getTexture(const std::string &texture_path) { - auto itr = texture_map_.find(texture_path); + auto itr = texture_map_.find(texture_path); - if(itr == texture_map_.end()) - { - Texture new_texture = ImageLoader::loadPng(texture_path); - texture_map_.insert(make_pair(texture_path, new_texture)); - return new_texture; - } + if (itr == texture_map_.end()) { + Texture new_texture = ImageLoader::loadPng(texture_path); + texture_map_.insert(make_pair(texture_path, new_texture)); + return new_texture; + } - return itr->second; + return itr->second; } - + } // yage |