aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/debug.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-15 23:22:30 +0100
committerJohannes Schickel2011-02-15 23:22:30 +0100
commit2b62f6bec3639ab816f6f841218d4b19f70b201e (patch)
tree5b59c5e06a506ca45af266fd945b035a012ebe61 /engines/agos/debug.cpp
parent2078024ee41b83f87732d9d4cdceadaba8c79609 (diff)
downloadscummvm-rg350-2b62f6bec3639ab816f6f841218d4b19f70b201e.tar.gz
scummvm-rg350-2b62f6bec3639ab816f6f841218d4b19f70b201e.tar.bz2
scummvm-rg350-2b62f6bec3639ab816f6f841218d4b19f70b201e.zip
AGOS: Adapt to setPalette RGBA->RGB change.
I only (minimally) tested this change with Simon 1 + 2 DOS CD.
Diffstat (limited to 'engines/agos/debug.cpp')
-rw-r--r--engines/agos/debug.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index cb11d65218..d0dc8cc42e 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -436,7 +436,7 @@ static const byte bmp_hdr[] = {
0x00, 0x01, 0x00, 0x00,
};
-void dumpBMP(const char *filename, int16 w, int16 h, const byte *bytes, const uint32 *palette) {
+void dumpBMP(const char *filename, int16 w, int16 h, const byte *bytes, const byte *palette) {
Common::DumpFile out;
byte my_hdr[sizeof(bmp_hdr)];
int i;
@@ -454,11 +454,11 @@ void dumpBMP(const char *filename, int16 w, int16 h, const byte *bytes, const ui
out.write(my_hdr, sizeof(my_hdr));
- for (i = 0; i != 256; i++, palette++) {
+ for (i = 0; i != 256; i++, palette += 3) {
byte color[4];
- color[0] = (byte)(*palette >> 16);
- color[1] = (byte)(*palette >> 8);
- color[2] = (byte)(*palette);
+ color[0] = palette[2];
+ color[1] = palette[1];
+ color[2] = palette[0];
color[3] = 0;
out.write(color, 4);
}
@@ -565,7 +565,7 @@ void AGOSEngine::dumpBitmap(const char *filename, const byte *offs, uint16 w, ui
}
}
- dumpBMP(filename, w, h, imageBuffer, (const uint32 *)palette);
+ dumpBMP(filename, w, h, imageBuffer, palette);
free(imageBuffer);
}
@@ -594,7 +594,7 @@ void AGOSEngine::palLoad(byte *pal, const byte *vga1, int a, int b) {
}
if (getGameType() == GType_PN && (getFeatures() & GF_EGA)) {
- memcpy(palptr, _displayPalette, 64);
+ memcpy(palptr, _displayPalette, 3 * 16);
} else if (getGameType() == GType_PN || getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
src = vga1 + READ_BE_UINT16(vga1 + 6) + b * 32;
@@ -603,9 +603,8 @@ void AGOSEngine::palLoad(byte *pal, const byte *vga1, int a, int b) {
palptr[0] = ((color & 0xf00) >> 8) * 32;
palptr[1] = ((color & 0x0f0) >> 4) * 32;
palptr[2] = ((color & 0x00f) >> 0) * 32;
- palptr[3] = 0;
- palptr += 4;
+ palptr += 3;
src += 2;
} while (--num);
} else {
@@ -615,9 +614,8 @@ void AGOSEngine::palLoad(byte *pal, const byte *vga1, int a, int b) {
palptr[0] = src[0] << 2;
palptr[1] = src[1] << 2;
palptr[2] = src[2] << 2;
- palptr[3] = 0;
- palptr += 4;
+ palptr += 3;
src += 3;
} while (--num);
}
@@ -627,7 +625,7 @@ void AGOSEngine::dumpVgaBitmaps(uint16 zoneNum) {
uint16 width, height, flags;
uint32 offs, curOffs = 0;
const byte *p2;
- byte pal[1024];
+ byte pal[768];
uint16 zone = (getGameType() == GType_PN) ? 0 : zoneNum;
VgaPointersEntry *vpe = &_vgaBufferPointers[zone];