aboutsummaryrefslogtreecommitdiffstats
path: root/src/texturecache.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-08-24 00:25:31 +0100
committerGitHub <noreply@github.com>2017-08-24 00:25:31 +0100
commita326354ea6fccf76665a4212bf14daeba0f52ec8 (patch)
tree18cd2deb0c30b38d8ca7c5305735d2323259e020 /src/texturecache.cpp
parent0a49874288f92c120d7e165550eb6dbbe1ef7307 (diff)
parent5403490b941f7c031bf1aafdb91b1098f69edbf2 (diff)
downloadYAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.tar.gz
YAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.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.cpp22
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