aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/rooms.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-10-13 11:38:41 +0000
committerTravis Howell2006-10-13 11:38:41 +0000
commitf46fb07f277cef1828c3807a38230db604df58d6 (patch)
tree5b72eea95a7b30092850f428b6dda23b98233143 /engines/agos/rooms.cpp
parent0385a4d2bbcde1fac41452f5f75f091c3e84e533 (diff)
downloadscummvm-rg350-f46fb07f277cef1828c3807a38230db604df58d6.tar.gz
scummvm-rg350-f46fb07f277cef1828c3807a38230db604df58d6.tar.bz2
scummvm-rg350-f46fb07f277cef1828c3807a38230db604df58d6.zip
Add differences in opcode table for Elvira 2 and cleanup
svn-id: r24294
Diffstat (limited to 'engines/agos/rooms.cpp')
-rw-r--r--engines/agos/rooms.cpp109
1 files changed, 56 insertions, 53 deletions
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 2a305d7b4f..2c2ad348cd 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -43,22 +43,6 @@ uint16 AGOSEngine::getBackExit(int n) {
return 0;
}
-uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
- SubGenExit *g;
- Item *x;
-
- g = (SubGenExit *)findChildOfType(i, 4);
- if (g == NULL)
- return 0;
-
- x = derefItem(g->dest[d]);
- if (x == NULL)
- return 0;
- if (isRoom(x))
- return 0;
- return itemPtrToID(x);
-}
-
uint16 AGOSEngine::getDoorState(Item *item, uint16 d) {
uint16 mask = 3;
uint16 n;
@@ -75,24 +59,6 @@ uint16 AGOSEngine::getDoorState(Item *item, uint16 d) {
return n;
}
-uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
- SubGenExit *g;
- Item *x;
-
- g = (SubGenExit *)findChildOfType(item, 4);
- if (g == NULL)
- return 0;
-
- x = derefItem(g->dest[d]);
- if (x == NULL)
- return 0;
- if (isRoom(x))
- return itemPtrToID(x);
- if (x->state != 0)
- return 0;
- return x->parent;
-}
-
uint16 AGOSEngine::getExitOf(Item *item, uint16 d) {
SubRoom *subRoom;
uint16 x;
@@ -110,25 +76,6 @@ uint16 AGOSEngine::getExitOf(Item *item, uint16 d) {
return subRoom->roomExit[d];
}
-uint16 AGOSEngine::getExitState(Item *i, uint16 x, uint16 d) {
- SubSuperRoom *sr;
- uint16 mask = 3;
- uint16 n;
- uint16 *c;
-
- sr = (SubSuperRoom *)findChildOfType(i, 4);
- if (sr == NULL)
- return 0;
-
- c = sr->roomExitStates;
- c += x - 1;
- d <<= 1;
- mask <<= d;
- n = *c & mask;
- n >>= d;
- return n;
-}
-
void AGOSEngine::changeDoorState(SubRoom *r, uint16 d, uint16 n) {
uint16 mask=3;
d <<= 1;
@@ -176,6 +123,41 @@ void AGOSEngine::setDoorState(Item *i, uint16 d, uint16 n) {
changeDoorState(r1, d, n);
}
+// Elvira 1 specific
+uint16 AGOSEngine::getDoorOf(Item *i, uint16 d) {
+ SubGenExit *g;
+ Item *x;
+
+ g = (SubGenExit *)findChildOfType(i, 4);
+ if (g == NULL)
+ return 0;
+
+ x = derefItem(g->dest[d]);
+ if (x == NULL)
+ return 0;
+ if (isRoom(x))
+ return 0;
+ return itemPtrToID(x);
+}
+
+uint16 AGOSEngine::getExitOf_e1(Item *item, uint16 d) {
+ SubGenExit *g;
+ Item *x;
+
+ g = (SubGenExit *)findChildOfType(item, 4);
+ if (g == NULL)
+ return 0;
+
+ x = derefItem(g->dest[d]);
+ if (x == NULL)
+ return 0;
+ if (isRoom(x))
+ return itemPtrToID(x);
+ if (x->state != 0)
+ return 0;
+ return x->parent;
+}
+
void AGOSEngine::moveDirn_e1(Item *i, uint x) {
Item *d, *p;
uint16 n;
@@ -208,6 +190,26 @@ void AGOSEngine::moveDirn_e1(Item *i, uint x) {
showMessageFormat("You can't go that way.\n");
}
+// Elvira 2 specific
+uint16 AGOSEngine::getExitState(Item *i, uint16 x, uint16 d) {
+ SubSuperRoom *sr;
+ uint16 mask = 3;
+ uint16 n;
+ uint16 *c;
+
+ sr = (SubSuperRoom *)findChildOfType(i, 4);
+ if (sr == NULL)
+ return 0;
+
+ c = sr->roomExitStates;
+ c += x - 1;
+ d <<= 1;
+ mask <<= d;
+ n = *c & mask;
+ n >>= d;
+ return n;
+}
+
void AGOSEngine::moveDirn_e2(Item *i, uint x) {
SubSuperRoom *sr;
Item *d, *p;
@@ -251,6 +253,7 @@ void AGOSEngine::moveDirn_e2(Item *i, uint x) {
}
}
+// Waxworks specific
void AGOSEngine::moveDirn_ww(Item *i, uint x) {
Item *d;
uint16 n;