summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-01 03:25:45 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-01 03:25:45 +0300
commit5a35288a7524c6b5cb9a4e8e3aa93d756b016743 (patch)
treeb07dacc245cd0e8c900dc9b72ebc82aceccaf082
parent9e755afa031f39172292aa82d3df42c1eaa01b03 (diff)
downloadmv-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.gz
mv-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.bz2
mv-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.tar.xz
mv-5a35288a7524c6b5cb9a4e8e3aa93d756b016743.zip
Fix arrow images load.
-rw-r--r--data/graphics/sprites/CMakeLists.txt8
-rw-r--r--data/graphics/sprites/Makefile.am8
-rw-r--r--data/graphics/sprites/arrow_down.gifbin152 -> 0 bytes
-rw-r--r--data/graphics/sprites/arrow_down.pngbin0 -> 410 bytes
-rw-r--r--data/graphics/sprites/arrow_left.gifbin148 -> 0 bytes
-rw-r--r--data/graphics/sprites/arrow_left.pngbin0 -> 412 bytes
-rw-r--r--data/graphics/sprites/arrow_right.gifbin145 -> 0 bytes
-rw-r--r--data/graphics/sprites/arrow_right.pngbin0 -> 432 bytes
-rw-r--r--data/graphics/sprites/arrow_up.gifbin139 -> 0 bytes
-rw-r--r--data/graphics/sprites/arrow_up.pngbin0 -> 402 bytes
-rw-r--r--src/maplayer.cpp8
-rw-r--r--src/resources/imagehelper.cpp7
-rw-r--r--src/test/testlauncher.cpp8
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
deleted file mode 100644
index e371b0892..000000000
--- a/data/graphics/sprites/arrow_down.gif
+++ /dev/null
Binary files differ
diff --git a/data/graphics/sprites/arrow_down.png b/data/graphics/sprites/arrow_down.png
new file mode 100644
index 000000000..ef820401a
--- /dev/null
+++ b/data/graphics/sprites/arrow_down.png
Binary files differ
diff --git a/data/graphics/sprites/arrow_left.gif b/data/graphics/sprites/arrow_left.gif
deleted file mode 100644
index 29ea8bcd9..000000000
--- a/data/graphics/sprites/arrow_left.gif
+++ /dev/null
Binary files differ
diff --git a/data/graphics/sprites/arrow_left.png b/data/graphics/sprites/arrow_left.png
new file mode 100644
index 000000000..5b1e7d024
--- /dev/null
+++ b/data/graphics/sprites/arrow_left.png
Binary files differ
diff --git a/data/graphics/sprites/arrow_right.gif b/data/graphics/sprites/arrow_right.gif
deleted file mode 100644
index e5c7d3038..000000000
--- a/data/graphics/sprites/arrow_right.gif
+++ /dev/null
Binary files differ
diff --git a/data/graphics/sprites/arrow_right.png b/data/graphics/sprites/arrow_right.png
new file mode 100644
index 000000000..508dc2ff0
--- /dev/null
+++ b/data/graphics/sprites/arrow_right.png
Binary files differ
diff --git a/data/graphics/sprites/arrow_up.gif b/data/graphics/sprites/arrow_up.gif
deleted file mode 100644
index 655e5bf40..000000000
--- a/data/graphics/sprites/arrow_up.gif
+++ /dev/null
Binary files differ
diff --git a/data/graphics/sprites/arrow_up.png b/data/graphics/sprites/arrow_up.png
new file mode 100644
index 000000000..ca96b3000
--- /dev/null
+++ b/data/graphics/sprites/arrow_up.png
Binary files differ
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();