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 {
|
do {
|
||||||
for (i = 0; i != state->draw_width; i++)
|
for (i = 0; i != state->draw_width; i++)
|
||||||
if ((state->flags & kDFNonTrans) || src[i])
|
if ((state->flags & kDFNonTrans) || src[i])
|
||||||
dst[i] = src[i];
|
dst[i] = src[i] + state->paletteMod;
|
||||||
dst += _screenWidth;
|
dst += _screenWidth;
|
||||||
src += state->width * 16;
|
src += state->width * 16;
|
||||||
} while (--h);
|
} while (--h);
|
||||||
|
@ -726,6 +726,10 @@ void AGOSEngine_Simon1::drawImage(VC10_state *state) {
|
||||||
state->surf_addr += xoffs + yoffs * state->surf_pitch;
|
state->surf_addr += xoffs + yoffs * state->surf_pitch;
|
||||||
state->surf2_addr += xoffs + yoffs * state->surf2_pitch;
|
state->surf2_addr += xoffs + yoffs * state->surf2_pitch;
|
||||||
|
|
||||||
|
if ((getFeatures() & GF_32COLOR) && !_window3Flag && yoffs > 133) {
|
||||||
|
state->paletteMod = 208;
|
||||||
|
}
|
||||||
|
|
||||||
if (_backFlag == 1) {
|
if (_backFlag == 1) {
|
||||||
drawBackGroundImage(state);
|
drawBackGroundImage(state);
|
||||||
} else if (state->flags & kDFMasked) {
|
} 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) {
|
if (getPlatform() == Common::kPlatformAmiga) {
|
||||||
src = _iconFilePtr;
|
src = _iconFilePtr;
|
||||||
src += READ_BE_UINT32(src + icon * 4);
|
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);
|
decompressIconPlanar(dst, src, 24, 12, color, _dxSurfacePitch);
|
||||||
} else {
|
} else {
|
||||||
src = _iconFilePtr;
|
src = _iconFilePtr;
|
||||||
|
|
|
@ -584,13 +584,23 @@ void AGOSEngine::setVerb(HitArea *ha) {
|
||||||
if (getGameType() == GType_SIMON1) {
|
if (getGameType() == GType_SIMON1) {
|
||||||
if (tmp != NULL) {
|
if (tmp != NULL) {
|
||||||
tmp->flags |= kBFInvertTouch;
|
tmp->flags |= kBFInvertTouch;
|
||||||
invertBox(tmp, 213, 208, 213, 10);
|
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) {
|
||||||
invertBox(ha, 218, 213, 213, 5);
|
if (getFeatures() & GF_32COLOR)
|
||||||
else
|
invertBox(ha, 216, 212, 212, 4);
|
||||||
invertBox(ha, 223, 218, 218, 10);
|
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);
|
ha->flags &= ~(kBFBoxSelected + kBFInvertTouch);
|
||||||
} else {
|
} else {
|
||||||
|
@ -610,7 +620,10 @@ void AGOSEngine::hitarea_leave(HitArea *ha, bool state) {
|
||||||
if (getGameType() == GType_SIMON2) {
|
if (getGameType() == GType_SIMON2) {
|
||||||
invertBox(ha, 231, 229, 230, 1);
|
invertBox(ha, 231, 229, 230, 1);
|
||||||
} else {
|
} else {
|
||||||
invertBox(ha, 223, 213, 218, 5);
|
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;
|
_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() {
|
void AGOSEngine::vc22_setPaletteNew() {
|
||||||
byte *offs, *palptr = 0, *src;
|
byte *offs, *palptr = 0, *src;
|
||||||
uint16 a = 0, b, num, palSize = 0;
|
uint16 a = 0, b, num, palSize = 0;
|
||||||
|
@ -93,6 +128,19 @@ void AGOSEngine::vc22_setPaletteNew() {
|
||||||
src += 3;
|
src += 3;
|
||||||
} while (--num);
|
} 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;
|
_paletteFlag = 2;
|
||||||
_vgaSpriteChanged++;
|
_vgaSpriteChanged++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ void AGOSEngine::setTextColor(uint color) {
|
||||||
if (window->fill_color == 17)
|
if (window->fill_color == 17)
|
||||||
color = 25;
|
color = 25;
|
||||||
else
|
else
|
||||||
color = 12;
|
color = 220;
|
||||||
}
|
}
|
||||||
|
|
||||||
window->text_color = color;
|
window->text_color = color;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue