diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-01 03:25:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-01 03:25:45 +0300 |
commit | 5a35288a7524c6b5cb9a4e8e3aa93d756b016743 (patch) | |
tree | b07dacc245cd0e8c900dc9b72ebc82aceccaf082 /src | |
parent | 9e755afa031f39172292aa82d3df42c1eaa01b03 (diff) | |
download | manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.gz manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.bz2 manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.xz manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.zip |
Fix arrow images load.
Diffstat (limited to 'src')
-rw-r--r-- | src/maplayer.cpp | 8 | ||||
-rw-r--r-- | src/resources/imagehelper.cpp | 7 | ||||
-rw-r--r-- | src/test/testlauncher.cpp | 8 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/maplayer.cpp b/src/maplayer.cpp index 96633215c..b6e259106 100644 --- a/src/maplayer.cpp +++ b/src/maplayer.cpp @@ -730,16 +730,16 @@ void MapItem::setType(const int type) switch (type) { case ARROW_UP: - name = "graphics/sprites/arrow_up.gif"; + name = "graphics/sprites/arrow_up.png"; break; case ARROW_DOWN: - name = "graphics/sprites/arrow_down.gif"; + name = "graphics/sprites/arrow_down.png"; break; case ARROW_LEFT: - name = "graphics/sprites/arrow_left.gif"; + name = "graphics/sprites/arrow_left.png"; break; case ARROW_RIGHT: - name = "graphics/sprites/arrow_right.gif"; + name = "graphics/sprites/arrow_right.png"; break; default: break; diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index eea15d29c..b0e02b75f 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -117,9 +117,12 @@ void ImageHelper::dumpSurfaceFormat(const SDL_Surface *const image) const SDL_Surface *ImageHelper::loadPng(SDL_RWops *const rw) { - if (!rw || !IMG_isPNG(rw)) + if (!rw) + return nullptr; + + if (!IMG_isPNG(rw)) { - logger->log("Error, image missing or not png"); + logger->log("Error, image is not png"); return nullptr; } SDL_Surface *const tmpImage = IMG_LoadPNG_RW(rw); diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 917b8eedb..215793243 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -82,7 +82,7 @@ int TestLauncher::exec() int TestLauncher::testBackend() const { const Image *const img = Theme::getImageFromTheme( - "graphics/sprites/arrow_up.gif"); + "graphics/sprites/arrow_up.png"); if (!img) return 1; const int cnt = 100; @@ -129,7 +129,7 @@ int TestLauncher::testFps() Wallpaper::getWallpaper(800, 600); Image *img[5]; - img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_up.gif"); + img[0] = Theme::getImageFromTheme("graphics/sprites/arrow_up.png"); img[1] = Theme::getImageFromTheme( "graphics/gui/target-cursor-normal-l.png"); img[2] = Theme::getImageFromTheme("themes/wood/window.png"); @@ -190,8 +190,8 @@ int TestLauncher::testInternal() "graphics/sprites/manaplus_emotions.png"); img[1] = Theme::getImageFromTheme( "graphics/sprites/manaplus_emotions.png"); - img[2] = Theme::getImageFromTheme("graphics/sprites/arrow_left.gif"); - img[3] = Theme::getImageFromTheme("graphics/sprites/arrow_right.gif"); + img[2] = Theme::getImageFromTheme("graphics/sprites/arrow_left.png"); + img[3] = Theme::getImageFromTheme("graphics/sprites/arrow_right.png"); int idx = 0; const int mem = mainGraphics->getMemoryUsage(); |