summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-07-24 22:59:13 +0200
committerBertram <bertram@cegetel.net>2009-07-24 22:59:13 +0200
commit8195e73cb801d56240beb966554a864729d9f20c (patch)
treef2a00036d15eaf70cb9abe4930b4199b1e5eae05 /src/resources/resourcemanager.cpp
parentea6f492198a03cffc3be47df000fa16dfc3b262f (diff)
downloadmana-client-8195e73cb801d56240beb966554a864729d9f20c.tar.gz
mana-client-8195e73cb801d56240beb966554a864729d9f20c.tar.bz2
mana-client-8195e73cb801d56240beb966554a864729d9f20c.tar.xz
mana-client-8195e73cb801d56240beb966554a864729d9f20c.zip
Made the wallpaper be rescaled when necessary under SDL and OpenGL.
The SDL methods to rescale the wallpaper has been optimized to permit rescaling at load time while OpenGL draws directly rescaled. Does someone know how to smooth the rescaled image under OpenGL?
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 0b8d6c35..bc3267da 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -214,6 +214,19 @@ std::string ResourceManager::getPath(const std::string &file)
return path;
}
+bool ResourceManager::addResource(const std::string &idPath,
+ Resource* resource)
+{
+ if (resource)
+ {
+ resource->incRef();
+ resource->mIdPath = idPath;
+ mResources[idPath] = resource;
+ return true;
+ }
+ return false;
+}
+
Resource *ResourceManager::get(const std::string &idPath, generator fun,
void *data)
{