aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-04-03 15:45:32 +0000
committerJames Brown2002-04-03 15:45:32 +0000
commitf896193a83e23596cecfed4d58494d1ccda29449 (patch)
tree8026556d9d8709bff18760d685a170d523f00b6a
parent60c0e580ab06dc0adcbf20cc5bae8dc31a672a9a (diff)
downloadscummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.tar.gz
scummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.tar.bz2
scummvm-rg350-f896193a83e23596cecfed4d58494d1ccda29449.zip
Zak/Loom/Indy3 object flags fix. Only translates CLASS_TOUCHABLE at the moment.
svn-id: r3849
-rw-r--r--object.cpp13
-rw-r--r--script_v1.cpp6
-rw-r--r--scumm.h1
3 files changed, 12 insertions, 8 deletions
diff --git a/object.cpp b/object.cpp
index c7d2869a6e..3f291cf8f1 100644
--- a/object.cpp
+++ b/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;
}
diff --git a/script_v1.cpp b/script_v1.cpp
index 5142a3049b..6082084667 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -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;
diff --git a/scumm.h b/scumm.h
index 7517e56cd3..b18cefc8b5 100644
--- a/scumm.h
+++ b/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;