summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-30 01:00:44 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-30 01:00:44 +0300
commit9d3285e5720f1722f9a925eb8046070a24305189 (patch)
tree5d87a27c9a77729ba3e3224980ce5cdf5ccdff65 /src/resources
parent63bed529c78ca05d3e32a0b6ec3bcfd6152e53de (diff)
downloadmanaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.gz
manaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.bz2
manaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.xz
manaverse-9d3285e5720f1722f9a925eb8046070a24305189.zip
Use resource manager for rescaled SDL images in ambient layer.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/ambientlayer.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp
index a0f3803eb..caa4d46bf 100644
--- a/src/resources/ambientlayer.cpp
+++ b/src/resources/ambientlayer.cpp
@@ -46,24 +46,16 @@ AmbientLayer::AmbientLayer(Image *img, float parallax,
{
// Rescale the overlay to keep the ratio as if we were on
// the default resolution...
- Image *rescaledOverlay = mImage->SDLgetScaledImage(
- static_cast<int>(mImage->getWidth()) / defaultScreenWidth
- * graphics->getWidth(), static_cast<int>(mImage->getHeight())
- / defaultScreenHeight * graphics->getHeight());
+ Image *rescaledOverlay = ResourceManager::getInstance()->
+ getRescaled(mImage, static_cast<int>(mImage->getWidth())
+ / defaultScreenWidth * graphics->getWidth(),
+ static_cast<int>(mImage->getHeight())
+ / defaultScreenHeight * graphics->getHeight());
if (rescaledOverlay)
- {
- // Replace the resource with the new one...
- std::string idPath = mImage->getIdPath() + "_rescaled";
- ResourceManager::getInstance()->addResource(
- idPath, rescaledOverlay);
mImage = rescaledOverlay;
- rescaledOverlay->incRef();
- }
else
- {
mImage->incRef();
- }
}
else
{