summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-08 22:06:08 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-08 22:06:08 +0300
commit907a1cfc8a5fe0ee58bdd18582fddb31f08af3b4 (patch)
tree328d10370b815beaf3222b4f832ead056ed59e32 /src
parentfd3223578c0a0789627a92cc63235c24e75f87c3 (diff)
downloadmanaverse-907a1cfc8a5fe0ee58bdd18582fddb31f08af3b4.tar.gz
manaverse-907a1cfc8a5fe0ee58bdd18582fddb31f08af3b4.tar.bz2
manaverse-907a1cfc8a5fe0ee58bdd18582fddb31f08af3b4.tar.xz
manaverse-907a1cfc8a5fe0ee58bdd18582fddb31f08af3b4.zip
Use unique keys for different resource types in cache.
Diffstat (limited to 'src')
-rw-r--r--src/resources/loaders/musicloader.cpp2
-rw-r--r--src/resources/loaders/soundloader.cpp2
-rw-r--r--src/resources/loaders/spritedefloader.cpp1
-rw-r--r--src/resources/loaders/walklayerloader.cpp2
-rw-r--r--src/resources/loaders/xmlloader.cpp2
5 files changed, 5 insertions, 4 deletions
diff --git a/src/resources/loaders/musicloader.cpp b/src/resources/loaders/musicloader.cpp
index 0d482b8a6..1e5ceaff7 100644
--- a/src/resources/loaders/musicloader.cpp
+++ b/src/resources/loaders/musicloader.cpp
@@ -79,5 +79,5 @@ SDLMusic *Loader::getMusic(const std::string &idPath)
{
ResourceLoader rl = { idPath };
return static_cast<SDLMusic*>(ResourceManager::get(
- idPath, ResourceLoader::load, &rl));
+ "music_" + idPath, ResourceLoader::load, &rl));
}
diff --git a/src/resources/loaders/soundloader.cpp b/src/resources/loaders/soundloader.cpp
index bff769755..819e3d140 100644
--- a/src/resources/loaders/soundloader.cpp
+++ b/src/resources/loaders/soundloader.cpp
@@ -74,5 +74,5 @@ SoundEffect *Loader::getSoundEffect(const std::string &idPath)
{
ResourceLoader rl = { idPath };
return static_cast<SoundEffect*>(ResourceManager::get(
- idPath, ResourceLoader::load, &rl));
+ "sound_" + idPath, ResourceLoader::load, &rl));
}
diff --git a/src/resources/loaders/spritedefloader.cpp b/src/resources/loaders/spritedefloader.cpp
index bdc0c40f0..cb535ca7a 100644
--- a/src/resources/loaders/spritedefloader.cpp
+++ b/src/resources/loaders/spritedefloader.cpp
@@ -59,6 +59,7 @@ SpriteDef *Loader::getSprite(const std::string &path,
{
SpriteDefLoader rl = { path, variant};
const std::string str = std::string(
+ "sprite_").append(
path).append(
"[").append(toString(
variant).append(
diff --git a/src/resources/loaders/walklayerloader.cpp b/src/resources/loaders/walklayerloader.cpp
index 99d7a251f..bfbee82ab 100644
--- a/src/resources/loaders/walklayerloader.cpp
+++ b/src/resources/loaders/walklayerloader.cpp
@@ -58,7 +58,7 @@ WalkLayer *Loader::getWalkLayer(const std::string &name,
Map *const map)
{
WalkLayerLoader rl = {name, map};
- return static_cast<WalkLayer*>(ResourceManager::get("map_" + name,
+ return static_cast<WalkLayer*>(ResourceManager::get("walklayer_" + name,
WalkLayerLoader::load, &rl));
}
#else // DYECMD
diff --git a/src/resources/loaders/xmlloader.cpp b/src/resources/loaders/xmlloader.cpp
index 74dd46ef9..776dbcf76 100644
--- a/src/resources/loaders/xmlloader.cpp
+++ b/src/resources/loaders/xmlloader.cpp
@@ -59,6 +59,6 @@ XML::Document *Loader::getXml(const std::string &idPath,
{
ResourceLoader rl = { idPath, useResman, skipError };
return static_cast<XML::Document*>(ResourceManager::get(
- idPath, ResourceLoader::load, &rl));
+ "xml_" + idPath, ResourceLoader::load, &rl));
}