summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-06-03 16:13:20 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-06-03 16:13:20 +0000
commit9b53cd51fdf193c8748909479ec6c356fa7a1731 (patch)
tree103da86a175cd1a7848a1fa594c4c6b508203e1f
parent448f04aff1e2b96287f37755ef1b12d9339ea135 (diff)
downloadmana-9b53cd51fdf193c8748909479ec6c356fa7a1731.tar.gz
mana-9b53cd51fdf193c8748909479ec6c356fa7a1731.tar.bz2
mana-9b53cd51fdf193c8748909479ec6c356fa7a1731.tar.xz
mana-9b53cd51fdf193c8748909479ec6c356fa7a1731.zip
Fixed image loading in software mode to not assume all images are 32-bit.
-rw-r--r--ChangeLog2
-rw-r--r--src/resources/image.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7d32cc24..c71110de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
files to be included with the release.
* src/utils/fastsqrt.h: Fixed warning about strict-aliasing rules.
* src/Makefile.am: Don't die on warnings by default.
+ * src/resources/image.cpp: Fixed image loading in software mode to not
+ assume all images are 32-bit.
2007-06-02 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index e2220088..393c443c 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -192,7 +192,7 @@ Image* Image::load(void *buffer, unsigned int bufferSize,
{
Uint8 r, g, b, a;
SDL_GetRGBA(
- ((Uint32*) tmpImage->pixels)[i],
+ ((char*) tmpImage->pixels)[i * tmpImage->format->BitsPerPixel],
tmpImage->format,
&r, &g, &b, &a);