svn-id: r12327
This commit is contained in:
Max Horn 2004-01-11 21:48:31 +00:00
parent 7237b6a2ec
commit c1f34030f9
3 changed files with 25 additions and 17 deletions

View File

@ -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;

View File

@ -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() {

View File

@ -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);