aboutsummaryrefslogtreecommitdiff
path: root/script_v1.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-12 22:04:24 +0000
committerMax Horn2002-07-12 22:04:24 +0000
commitefae95935e65dd7ce99847c1613ce8f3587d5c53 (patch)
tree33fd7d84658de54c6868707611d7b75f59b0729f /script_v1.cpp
parent494c095c253d4171d62c2c923a13c5025c920f8d (diff)
downloadscummvm-rg350-efae95935e65dd7ce99847c1613ce8f3587d5c53.tar.gz
scummvm-rg350-efae95935e65dd7ce99847c1613ce8f3587d5c53.tar.bz2
scummvm-rg350-efae95935e65dd7ce99847c1613ce8f3587d5c53.zip
this fix by MadMoose fixes the forest 'labyrinth' in monkeyvga
svn-id: r4524
Diffstat (limited to 'script_v1.cpp')
-rw-r--r--script_v1.cpp61
1 files changed, 16 insertions, 45 deletions
diff --git a/script_v1.cpp b/script_v1.cpp
index 510ab2b46a..2813504092 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -1076,57 +1076,28 @@ void Scumm::o5_drawObject()
obj = getVarOrDirectWord(0x80);
if (_features & GF_SMALL_HEADER) {
- int temp = getVarOrDirectWord(0x40);
- int temp2 = getVarOrDirectWord(0x20); // Room
-
- idx = getObjectIndex(obj);
- if (idx == -1)
- return;
- od = &_objs[idx];
- xpos = ypos = 255;
- if (temp != 0xFF) {
-
- od->x_pos = temp << 3;
-
- od->y_pos = temp2 << 3;
+ xpos = getVarOrDirectWord(0x40);
+ ypos = getVarOrDirectWord(0x20);
+ } else {
+ switch ((_opcode = fetchScriptByte()) & 0x1F) {
+ case 1: /* draw at */
+ xpos = getVarOrDirectWord(0x80);
+ ypos = getVarOrDirectWord(0x40);
+ break;
+ case 2: /* set state */
+ state = getVarOrDirectWord(0x80);
+ break;
+ case 0x1F: /* neither */
+ break;
+ default:
+ error("o5_drawObject: default case");
}
-
-
-
- addObjectToDrawQue(idx);
-
- x = od->x_pos;
- y = od->y_pos;
- w = od->width;
- h = od->height;
-
- i = _numObjectsInRoom;
- do {
- if (_objs[i].x_pos == x && _objs[i].y_pos == y && _objs[i].width == w && _objs[i].height == h)
- putState(_objs[i].obj_nr, 0);
- } while (--i);
-
- putState(obj, state);
- return;
- }
-
- switch ((_opcode = fetchScriptByte()) & 0x1F) {
- case 1: /* draw at */
- xpos = getVarOrDirectWord(0x80);
- ypos = getVarOrDirectWord(0x40);
- break;
- case 2: /* set state */
- state = getVarOrDirectWord(0x80);
- break;
- case 0x1F: /* neither */
- break;
- default:
- error("o5_drawObject: default case");
}
idx = getObjectIndex(obj);
if (idx == -1)
return;
+
od = &_objs[idx];
if (xpos != 0xFF) {
od->walk_x += (xpos << 3) - od->x_pos;