aboutsummaryrefslogtreecommitdiffstats
path: root/yage/core/texturecache.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-12-31 18:00:01 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-12-31 18:00:01 +0000
commit34908f108ad7c2ee6cff96491a0bc40381477424 (patch)
treef58c6bdde485d07a7136f78055240bab923bd4a6 /yage/core/texturecache.cpp
parent943e3a5bc98ebcc2aa1b1d576700f7c4010c143c (diff)
downloadYAGE-34908f108ad7c2ee6cff96491a0bc40381477424.tar.gz
YAGE-34908f108ad7c2ee6cff96491a0bc40381477424.zip
[Test] Benchmarking the engine and trying to optimize.
Diffstat (limited to 'yage/core/texturecache.cpp')
-rw-r--r--yage/core/texturecache.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/yage/core/texturecache.cpp b/yage/core/texturecache.cpp
index 447051b7..66251de5 100644
--- a/yage/core/texturecache.cpp
+++ b/yage/core/texturecache.cpp
@@ -7,19 +7,21 @@
*/
#include "texturecache.h"
-#include "imageloader.h"
#include "../data/texture.h"
+#include "imageloader.h"
namespace yage
{
-Texture TextureCache::getTexture(const std::string &texture_path)
+Texture TextureCache::getTexture(const std::string &texture_path, int x, int y)
{
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));
+ new_texture.x = x;
+ new_texture.y = y;
return new_texture;
}