Very very nasty hack to get the FT fuel-tower scene working correctly.

Someone -please- fix this properly :)

svn-id: r5071
This commit is contained in:
James Brown 2002-10-02 09:14:59 +00:00
parent e10366ec3d
commit 39a5160985

View File

@ -1337,7 +1337,16 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
}
akos = _vm->getResourceAddress(rtCostume, costume);
if (!akos) {
warning("Can't remap actor %d, costume %d not found", number, costume);
return;
}
akpl = findResource(MKID('AKPL'), akos);
if (!akpl) {
warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", number, costume);
return;
}
//get num palette entries
akpl_size = RES_SIZE(akpl) - 8;
@ -1354,6 +1363,17 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
// skip resource header
rgbs = RES_DATA(rgbs);
// FIXME!!! - Ender's hack to workaround a crash in Full Throttle.
// After touching the ladder at the Fuel Tower, memory
// gets trashed when the police fly down to the tower.
// This seems to happen with an akpl 256 supposidly 256
// bytes long, but which in reality is less than 65 bytes?!?
// Someone -please- fix this properly.
if (akpl_size > 255) {
warning("Actor palette for actor %d/costume %d is %d bytes - too big!", number, costume, akpl_size);
return;
}
for (i = 0; i < akpl_size; i++) {
r = *rgbs++;
g = *rgbs++;