diff options
author | Max Horn | 2004-01-11 21:48:31 +0000 |
---|---|---|
committer | Max Horn | 2004-01-11 21:48:31 +0000 |
commit | c1f34030f9a0ded0ad4a7848121a73f82a69f333 (patch) | |
tree | 77fea07a98767fa797c3b8978a1cae1e6a9a5612 /scumm | |
parent | 7237b6a2ec6a83d2a421d8c990848dbadaa947f9 (diff) | |
download | scummvm-rg350-c1f34030f9a0ded0ad4a7848121a73f82a69f333.tar.gz scummvm-rg350-c1f34030f9a0ded0ad4a7848121a73f82a69f333.tar.bz2 scummvm-rg350-c1f34030f9a0ded0ad4a7848121a73f82a69f333.zip |
cleanup
svn-id: r12327
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/object.cpp | 21 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 14 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 7 |
3 files changed, 25 insertions, 17 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp index d7ea606902..56e4b49eaf 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -413,6 +413,7 @@ void ScummEngine::drawObject(int obj, int arg) { width = od.width / 8; height = od.height &= 0xFFFFFFF8; // Mask out last 3 bits + // Short circuit for objects which aren't visible at all. if (width == 0 || xpos > _screenEndStrip || xpos + width < _screenStartStrip) return; @@ -809,6 +810,16 @@ void ScummEngine::processDrawQue() { _drawObjectQueNr = 0; } +void ScummEngine::addObjectToDrawQue(int object) { + if ((unsigned int)_drawObjectQueNr >= ARRAYSIZE(_drawObjectQue)) + error("Draw Object Que overflow"); + _drawObjectQue[_drawObjectQueNr++] = object; +} + +void ScummEngine::clearDrawObjectQueue() { + _drawObjectQueNr = 0; +} + void ScummEngine::clearOwnerOf(int obj) { int i, j; uint16 *a; @@ -873,16 +884,6 @@ void ScummEngine::markObjectRectAsDirty(int obj) { } } -void ScummEngine::addObjectToDrawQue(int object) { - _drawObjectQue[_drawObjectQueNr++] = object; - if ((unsigned int)_drawObjectQueNr > ARRAYSIZE(_drawObjectQue)) - error("Draw Object Que overflow"); -} - -void ScummEngine::clearDrawObjectQueue() { - _drawObjectQueNr = 0; -} - const byte *ScummEngine::getObjOrActorName(int obj) { byte *objptr; int i; diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 3a7b28e4e2..2f86774fa0 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -749,13 +749,17 @@ void ScummEngine_v6::o6_startObjectQuick() { } void ScummEngine_v6::o6_drawObject() { - int a = pop(); - int b = pop(); + int state = pop(); + int obj = pop(); - if (a == 0) - a = 1; + // FIXME: Why is the following here? Is it based on disassembly, or was + // it simply added to work around a bug (in ScummVM or scripts) ? + // In either case, the answer should be put into a comment (replacing this + // one, of course :-) + if (state == 0) + state = 1; - setObjectState(b, a, -1, -1); + setObjectState(obj, state, -1, -1); } void ScummEngine_v6::o6_drawObjectAt() { diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 7afb48fa32..9abaff196c 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1565,7 +1565,11 @@ void ScummEngine_v8::o8_getStringWidth() { } void ScummEngine_v8::o8_drawObject() { - int state = pop(), y = pop(), x = pop(), obj = pop(), objnum = getObjectIndex(obj); + int state = pop(); + int y = pop(); + int x = pop(); + int obj = pop(); + int objnum = getObjectIndex(obj); ObjectData *od; if (!objnum) @@ -1575,7 +1579,6 @@ void ScummEngine_v8::o8_drawObject() { if (x != 0x7FFFFFFF) { od->x_pos = x; od->y_pos = y; - debug(1, "setting position: 0x%X b 0x%X", x, y); } addObjectToDrawQue(objnum); |