diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-30 01:00:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-30 01:00:44 +0300 |
commit | 9d3285e5720f1722f9a925eb8046070a24305189 (patch) | |
tree | 5d87a27c9a77729ba3e3224980ce5cdf5ccdff65 | |
parent | 63bed529c78ca05d3e32a0b6ec3bcfd6152e53de (diff) | |
download | manaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.gz manaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.bz2 manaverse-9d3285e5720f1722f9a925eb8046070a24305189.tar.xz manaverse-9d3285e5720f1722f9a925eb8046070a24305189.zip |
Use resource manager for rescaled SDL images in ambient layer.
-rw-r--r-- | src/resources/ambientlayer.cpp | 18 |
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 { |