AGOS: Adapt to setPalette RGBA->RGB change.

I only (minimally) tested this change with Simon 1 + 2 DOS CD.
This commit is contained in:
Johannes Schickel 2011-02-15 23:22:30 +01:00
parent 2078024ee4
commit 2b62f6bec3
12 changed files with 50 additions and 65 deletions

View file

@ -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];