Fix palette glitches in Amiga OCS version of Simon the Sorcerer 1.
svn-id: r31233
This commit is contained in:
parent
1bb41bf225
commit
48fac2f9dc
5 changed files with 74 additions and 9 deletions
|
@ -629,7 +629,7 @@ void AGOSEngine_Simon1::draw32ColorImage(VC10_state *state) {
|
|||
do {
|
||||
for (i = 0; i != state->draw_width; i++)
|
||||
if ((state->flags & kDFNonTrans) || src[i])
|
||||
dst[i] = src[i];
|
||||
dst[i] = src[i] + state->paletteMod;
|
||||
dst += _screenWidth;
|
||||
src += state->width * 16;
|
||||
} while (--h);
|
||||
|
@ -726,6 +726,10 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) {
|
|||
state->surf_addr += xoffs + yoffs * state->surf_pitch;
|
||||
state->surf2_addr += xoffs + yoffs * state->surf2_pitch;
|
||||
|
||||
if ((getFeatures() & GF_32COLOR) && !_window3Flag && yoffs > 133) {
|
||||
state->paletteMod = 208;
|
||||
}
|
||||
|
||||
if (_backFlag == 1) {
|
||||
drawBackGroundImage(state);
|
||||
} else if (state->flags & kDFMasked) {
|
||||
|
|
|
@ -233,7 +233,7 @@ void AGOSEngine_Simon1::drawIcon(WindowBlock *window, uint icon, uint x, uint y)
|
|||
if (getPlatform() == Common::kPlatformAmiga) {
|
||||
src = _iconFilePtr;
|
||||
src += READ_BE_UINT32(src + icon * 4);
|
||||
uint8 color = (getFeatures() & GF_32COLOR) ? 16 : 240;
|
||||
uint8 color = (getFeatures() & GF_32COLOR) ? 224 : 240;
|
||||
decompressIconPlanar(dst, src, 24, 12, color, _dxSurfacePitch);
|
||||
} else {
|
||||
src = _iconFilePtr;
|
||||
|
|
|
@ -584,13 +584,23 @@ void AGOSEngine::setVerb(HitArea *ha) {
|
|||
if (getGameType() == GType_SIMON1) {
|
||||
if (tmp != NULL) {
|
||||
tmp->flags |= kBFInvertTouch;
|
||||
if (getFeatures() & GF_32COLOR)
|
||||
invertBox(tmp, 212, 208, 212, 8);
|
||||
else
|
||||
invertBox(tmp, 213, 208, 213, 10);
|
||||
}
|
||||
|
||||
if (ha->flags & kBFBoxSelected)
|
||||
if (ha->flags & kBFBoxSelected) {
|
||||
if (getFeatures() & GF_32COLOR)
|
||||
invertBox(ha, 216, 212, 212, 4);
|
||||
else
|
||||
invertBox(ha, 218, 213, 213, 5);
|
||||
} else {
|
||||
if (getFeatures() & GF_32COLOR)
|
||||
invertBox(ha, 220, 216, 216, 8);
|
||||
else
|
||||
invertBox(ha, 223, 218, 218, 10);
|
||||
}
|
||||
|
||||
ha->flags &= ~(kBFBoxSelected + kBFInvertTouch);
|
||||
} else {
|
||||
|
@ -610,6 +620,9 @@ void AGOSEngine::hitarea_leave(HitArea *ha, bool state) {
|
|||
if (getGameType() == GType_SIMON2) {
|
||||
invertBox(ha, 231, 229, 230, 1);
|
||||
} else {
|
||||
if (getFeatures() & GF_32COLOR)
|
||||
invertBox(ha, 220, 212, 216, 4);
|
||||
else
|
||||
invertBox(ha, 223, 213, 218, 5);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,6 +61,41 @@ void AGOSEngine::vc17_setPathfinderItem() {
|
|||
_vcPtr += 2;
|
||||
}
|
||||
|
||||
static const uint8 customPalette[96] = {
|
||||
0x00, 0x00, 0x00,
|
||||
0x99, 0x22, 0xFF,
|
||||
0x66, 0xCC, 0xFF,
|
||||
0xFF, 0x99, 0xFF,
|
||||
0xFF, 0xFF, 0xFF,
|
||||
0x66, 0x44, 0xBB,
|
||||
0x77, 0x55, 0xCC,
|
||||
0x88, 0x77, 0xCC,
|
||||
0xCC, 0xAA, 0xDD,
|
||||
0x33, 0x00, 0x09,
|
||||
0x66, 0x44, 0xCC,
|
||||
0x88, 0x55, 0xCC,
|
||||
0xAA, 0x77, 0xEE,
|
||||
0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xFF,
|
||||
0x33, 0x00, 0x00,
|
||||
0xCC, 0xCC, 0xDD,
|
||||
0x88, 0x99, 0xBB,
|
||||
0x44, 0x77, 0xAA,
|
||||
0x44, 0x44, 0x66,
|
||||
0x44, 0x44, 0x00,
|
||||
0x44, 0x66, 0x00,
|
||||
0x88, 0x99, 0x00,
|
||||
0x99, 0x44, 0x00,
|
||||
0xBB, 0x44, 0x22,
|
||||
0xFF, 0x55, 0x33,
|
||||
0xFF, 0x88, 0x88,
|
||||
0xFF, 0xBB, 0x33,
|
||||
0xFF, 0xFF, 0x77,
|
||||
};
|
||||
|
||||
void AGOSEngine::vc22_setPaletteNew() {
|
||||
byte *offs, *palptr = 0, *src;
|
||||
uint16 a = 0, b, num, palSize = 0;
|
||||
|
@ -93,6 +128,19 @@ void AGOSEngine::vc22_setPaletteNew() {
|
|||
src += 3;
|
||||
} while (--num);
|
||||
|
||||
if (getFeatures() & GF_32COLOR) {
|
||||
// Custom palette used for verb area
|
||||
palptr = &_displayPalette[(13 * 64)];
|
||||
for (uint8 c = 0; c < 32; c++) {
|
||||
palptr[0] = customPalette[c * 3 + 0];
|
||||
palptr[1] = customPalette[c * 3 + 1];
|
||||
palptr[2] = customPalette[c * 3 + 2];
|
||||
palptr[3] = 0;
|
||||
|
||||
palptr += 4;
|
||||
};
|
||||
}
|
||||
|
||||
_paletteFlag = 2;
|
||||
_vgaSpriteChanged++;
|
||||
}
|
||||
|
|
|
@ -259,7 +259,7 @@ void AGOSEngine::setTextColor(uint color) {
|
|||
if (window->fill_color == 17)
|
||||
color = 25;
|
||||
else
|
||||
color = 12;
|
||||
color = 220;
|
||||
}
|
||||
|
||||
window->text_color = color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue