mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
Zak/Loom/Indy3 object flags fix. Only translates CLASS_TOUCHABLE at the moment.
svn-id: r3849
This commit is contained in:
parent
60c0e580ab
commit
f896193a83
13
object.cpp
13
object.cpp
@ -26,10 +26,18 @@
|
||||
bool Scumm::getClass(int obj, int cls) {
|
||||
checkRange(_numGlobalObjects-1, 0, obj, "Object %d out of range in getClass");
|
||||
|
||||
cls &= 0x7F;
|
||||
|
||||
checkRange(32,1,cls,"Class %d out of range in getClass");
|
||||
if (_features && GF_SMALL_HEADER) {
|
||||
byte *oldClass = (byte*)&_classData[obj];
|
||||
if (cls == 32) // CLASS_TOUCHABLE
|
||||
cls = 23;
|
||||
|
||||
return (_classData[obj] & (1<<(cls-1))) != 0;
|
||||
return (oldClass[cls/8] & bit_table[cls&0x07]) != 0;
|
||||
} else {
|
||||
cls &= 0x7F;
|
||||
return (_classData[obj] & (1<<(cls-1))) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Scumm::putClass(int obj, int cls, bool set) {
|
||||
@ -874,7 +882,6 @@ void Scumm::SamInventoryHack(int obj) { // FIXME: Sam and Max hack
|
||||
if (value == obj) return;
|
||||
if (value == 0) {
|
||||
_vars[179]++;
|
||||
printf("Adding item %d to slot %d\n", obj, base);
|
||||
writeArray(178, 0, base, obj);
|
||||
return;
|
||||
}
|
||||
|
@ -805,10 +805,6 @@ FixRoom:
|
||||
}
|
||||
}
|
||||
|
||||
const int bit_table[16] =
|
||||
{1,2,4,8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000};
|
||||
|
||||
|
||||
void Scumm::o5_actorSetClass() {
|
||||
int act = getVarOrDirectWord(0x80);
|
||||
int newClass;
|
||||
@ -1505,8 +1501,8 @@ void Scumm::o5_loadRoomWithEgo() {
|
||||
|
||||
void Scumm::o5_matrixOps() {
|
||||
int a,b;
|
||||
printf("o5_matrixOps\n");
|
||||
if(_features & GF_OLD256) { /* FIXME: missing function call*/
|
||||
warning("o5_matrixOps - unimplemented on GF_OLD256");
|
||||
a=getVarOrDirectByte(0x80);
|
||||
b=fetchScriptByte();
|
||||
return;
|
||||
|
1
scumm.h
1
scumm.h
@ -60,6 +60,7 @@ enum {
|
||||
|
||||
const uint16 many_direction_tab[18] = {4, 8, 71, 109, 251, 530, 0, 0, 0, 0, 22, 72, 107, 157, 202, 252, 287, 337};
|
||||
const int16 many_direction_tab_2[16] = {0, 90, 180, 270, -1, -1, -1, -1, 0, 45, 90, 135, 180, 225, 270, 315};
|
||||
const int bit_table[16] = {1,2,4,8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000};
|
||||
|
||||
struct ScummPoint {
|
||||
int x,y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user