aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2011-02-20 06:12:21 +0000
committerD G Turner2011-02-20 06:12:21 +0000
commita92528636193220d29dcc75e5b4899a1e80cfa5f (patch)
tree46f857b3f3defa30b69bef7c5a664bd8dfa24ccd
parent5091f846a78c82d619b41530ff670de04bc05387 (diff)
downloadscummvm-rg350-a92528636193220d29dcc75e5b4899a1e80cfa5f.tar.gz
scummvm-rg350-a92528636193220d29dcc75e5b4899a1e80cfa5f.tar.bz2
scummvm-rg350-a92528636193220d29dcc75e5b4899a1e80cfa5f.zip
COMMON: Correct NE Resource Loader for Osystem RGBA->RGB Palette Change.
-rw-r--r--common/ne_exe.cpp12
-rw-r--r--common/ne_exe.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/common/ne_exe.cpp b/common/ne_exe.cpp
index a216ef6446..34bb551b06 100644
--- a/common/ne_exe.cpp
+++ b/common/ne_exe.cpp
@@ -38,7 +38,7 @@ NECursor::NECursor() {
_hotspotX = 0;
_hotspotY = 0;
_surface = 0;
- memset(_palette, 0, 256 * 4);
+ memset(_palette, 0, 256 * 3);
}
NECursor::~NECursor() {
@@ -121,16 +121,16 @@ bool NECursor::readCursor(SeekableReadStream &stream, uint32 count) {
height /= 2;
// Standard palette: transparent, black, white
+ _palette[6] = 0xff;
+ _palette[7] = 0xff;
_palette[8] = 0xff;
- _palette[9] = 0xff;
- _palette[10] = 0xff;
// Reading the palette
bitmap->seek(40);
for (uint32 i = 0 ; i < numColors; i++) {
- _palette[(i + 1) * 4 + 2] = bitmap->readByte();
- _palette[(i + 1) * 4 + 1] = bitmap->readByte();
- _palette[(i + 1) * 4 + 0] = bitmap->readByte();
+ _palette[(i + 1) * 3 + 2] = bitmap->readByte();
+ _palette[(i + 1) * 3 + 1] = bitmap->readByte();
+ _palette[(i + 1) * 3 + 0] = bitmap->readByte();
bitmap->readByte();
}
diff --git a/common/ne_exe.h b/common/ne_exe.h
index ac080d8a7c..545c8e5eff 100644
--- a/common/ne_exe.h
+++ b/common/ne_exe.h
@@ -63,7 +63,7 @@ public:
private:
byte *_surface;
- byte _palette[256 * 4];
+ byte _palette[256 * 3];
uint16 _width; ///< The cursor's width.
uint16 _height; ///< The cursor's height.