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 | |
parent | 9e755afa031f39172292aa82d3df42c1eaa01b03 (diff) | |
download | manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.gz manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.bz2 manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.xz manaverse-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.zip |
Fix arrow images load.
-rw-r--r-- | data/graphics/sprites/CMakeLists.txt | 8 | ||||
-rw-r--r-- | data/graphics/sprites/Makefile.am | 8 | ||||
-rw-r--r-- | data/graphics/sprites/arrow_down.gif | bin | 152 -> 0 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_down.png | bin | 0 -> 410 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_left.gif | bin | 148 -> 0 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_left.png | bin | 0 -> 412 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_right.gif | bin | 145 -> 0 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_right.png | bin | 0 -> 432 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_up.gif | bin | 139 -> 0 bytes | |||
-rw-r--r-- | data/graphics/sprites/arrow_up.png | bin | 0 -> 402 bytes | |||
-rw-r--r-- | src/maplayer.cpp | 8 | ||||
-rw-r--r-- | src/resources/imagehelper.cpp | 7 | ||||
-rw-r--r-- | src/test/testlauncher.cpp | 8 |
13 files changed, 21 insertions, 18 deletions
diff --git a/data/graphics/sprites/CMakeLists.txt b/data/graphics/sprites/CMakeLists.txt index eb3802d13..d8b3c4ea9 100644 --- a/data/graphics/sprites/CMakeLists.txt +++ b/data/graphics/sprites/CMakeLists.txt @@ -1,8 +1,8 @@ SET(FILES - arrow_up.gif - arrow_down.gif - arrow_left.gif - arrow_right.gif + arrow_up.png + arrow_down.png + arrow_left.png + arrow_right.png error.png error.xml manaplus_emotions.png diff --git a/data/graphics/sprites/Makefile.am b/data/graphics/sprites/Makefile.am index 8cf8cfb49..eeb13f915 100644 --- a/data/graphics/sprites/Makefile.am +++ b/data/graphics/sprites/Makefile.am @@ -1,10 +1,10 @@ spritesdir = $(pkgdatadir)/data/graphics/sprites sprites_DATA = \ - arrow_down.gif \ - arrow_left.gif \ - arrow_right.gif \ - arrow_up.gif \ + arrow_down.png \ + arrow_left.png \ + arrow_right.png \ + arrow_up.png \ error.png \ error.xml \ manaplus_emotions.png\ diff --git a/data/graphics/sprites/arrow_down.gif b/data/graphics/sprites/arrow_down.gif Binary files differdeleted file mode 100644 index e371b0892..000000000 --- a/data/graphics/sprites/arrow_down.gif +++ /dev/null diff --git a/data/graphics/sprites/arrow_down.png b/data/graphics/sprites/arrow_down.png Binary files differnew file mode 100644 index 000000000..ef820401a --- /dev/null +++ b/data/graphics/sprites/arrow_down.png diff --git a/data/graphics/sprites/arrow_left.gif b/data/graphics/sprites/arrow_left.gif Binary files differdeleted file mode 100644 index 29ea8bcd9..000000000 --- a/data/graphics/sprites/arrow_left.gif +++ /dev/null diff --git a/data/graphics/sprites/arrow_left.png b/data/graphics/sprites/arrow_left.png Binary files differnew file mode 100644 index 000000000..5b1e7d024 --- /dev/null +++ b/data/graphics/sprites/arrow_left.png diff --git a/data/graphics/sprites/arrow_right.gif b/data/graphics/sprites/arrow_right.gif Binary files differdeleted file mode 100644 index e5c7d3038..000000000 --- a/data/graphics/sprites/arrow_right.gif +++ /dev/null diff --git a/data/graphics/sprites/arrow_right.png b/data/graphics/sprites/arrow_right.png Binary files differnew file mode 100644 index 000000000..508dc2ff0 --- /dev/null +++ b/data/graphics/sprites/arrow_right.png diff --git a/data/graphics/sprites/arrow_up.gif b/data/graphics/sprites/arrow_up.gif Binary files differdeleted file mode 100644 index 655e5bf40..000000000 --- a/data/graphics/sprites/arrow_up.gif +++ /dev/null diff --git a/data/graphics/sprites/arrow_up.png b/data/graphics/sprites/arrow_up.png Binary files differnew file mode 100644 index 000000000..ca96b3000 --- /dev/null +++ b/data/graphics/sprites/arrow_up.png 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(); |