diff options
author | Vincent Hamm | 2002-04-21 21:20:32 +0000 |
---|---|---|
committer | Vincent Hamm | 2002-04-21 21:20:32 +0000 |
commit | 7c95649ba565bce18496f5c0f54145bda9f09940 (patch) | |
tree | 7f49494c401eeb206fd7406a74f6e4d1bc4699b7 | |
parent | 1b1d5795a88cd00ac06c335fab34598a9aad2674 (diff) | |
download | scummvm-rg350-7c95649ba565bce18496f5c0f54145bda9f09940.tar.gz scummvm-rg350-7c95649ba565bce18496f5c0f54145bda9f09940.tar.bz2 scummvm-rg350-7c95649ba565bce18496f5c0f54145bda9f09940.zip |
Some code cleanup in the blast object code for implementation of futur features
svn-id: r4039
-rw-r--r-- | gfx.h | 3 | ||||
-rw-r--r-- | object.cpp | 45 | ||||
-rw-r--r-- | script_v2.cpp | 4 | ||||
-rw-r--r-- | scumm.h | 12 | ||||
-rw-r--r-- | scummvm.cpp | 4 |
5 files changed, 35 insertions, 33 deletions
@@ -73,11 +73,12 @@ struct ColorCycle { /* Palette cycles */ byte end; }; -struct EnqueuedObject { /* Objects to draw */ +struct BlastObject { /* BlastObjects to draw */ uint16 a,b,c,d,e; int16 x,y; uint16 width,height; uint16 j,k,l; + uint16 mode; }; struct BompHeader { /* Bomp header */ diff --git a/object.cpp b/object.cpp index c389cfaacf..172d9a30a6 100644 --- a/object.cpp +++ b/object.cpp @@ -1151,54 +1151,55 @@ void Scumm::nukeFlObjects(int min, int max) } } -void Scumm::enqueueObject(int a, int b, int c, int d, int e, int f, int g, - int h, int mode) +void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, int objectHeight, int f, int g, + int image, int mode) { - EnqueuedObject *eo; + BlastObject *eo; ObjectData *od; if (_enqueuePos == sizeof(_enqueuedObjects) / sizeof(_enqueuedObjects[0])) error("enqueueObject: overflow"); eo = &_enqueuedObjects[_enqueuePos++]; - eo->a = a; + eo->a = objectNumber; eo->b = _enqueue_b; eo->c = _enqueue_c; eo->d = _enqueue_d; eo->e = _enqueue_e; - eo->x = b; - eo->y = c; - if (d == 0) { - od = &_objs[getObjectIndex(a)]; + eo->x = objectX; + eo->y = objectY; + if (objectWidth == 0) { + od = &_objs[getObjectIndex(objectNumber)]; eo->width = od->width; } else { - eo->width = d; + eo->width = objectWidth; } - if (e == 0) { - od = &_objs[getObjectIndex(a)]; + if (objectHeight == 0) { + od = &_objs[getObjectIndex(objectNumber)]; eo->height = od->height; } else { - eo->height = e; + eo->height = objectHeight; } eo->j = f; eo->k = g; - eo->l = h; + eo->l = image; + eo->mode = mode; } -void Scumm::drawEnqueuedObjects() +void Scumm::drawBlastObjects() { - EnqueuedObject *eo; + BlastObject *eo; int i; eo = _enqueuedObjects; for (i = 0; i < _enqueuePos; i++, eo++) { - drawEnqueuedObject(eo); + drawBlastObject(eo); } } -void Scumm::drawEnqueuedObject(EnqueuedObject * eo) +void Scumm::drawBlastObject(BlastObject * eo) { VirtScreen *vs; byte *roomptr, *bomp; @@ -1232,7 +1233,7 @@ void Scumm::drawEnqueuedObject(EnqueuedObject * eo) assert(ptr); ptr = findResource(IMxx_tags[eo->l], ptr); -// assert(ptr); + if (!ptr) /* FIXME: Sam and Max highway subgame */ return; bomp = findResourceData(MKID('BOMP'), ptr); @@ -1257,20 +1258,20 @@ void Scumm::drawEnqueuedObject(EnqueuedObject * eo) } } -void Scumm::removeEnqueuedObjects() +void Scumm::removeBlastObjects() { - EnqueuedObject *eo; + BlastObject *eo; int i; eo = _enqueuedObjects; for (i = 0; i < _enqueuePos; i++, eo++) { - removeEnqueuedObject(eo); + removeBlastObject(eo); } clearEnqueue(); } -void Scumm::removeEnqueuedObject(EnqueuedObject * eo) +void Scumm::removeBlastObject(BlastObject * eo) { restoreBG(eo->x, eo->y, eo->x + eo->width, eo->y + eo->height); } diff --git a/script_v2.cpp b/script_v2.cpp index f4800536c8..51fc7e96a0 100644 --- a/script_v2.cpp +++ b/script_v2.cpp @@ -153,7 +153,7 @@ void Scumm::setupOpcodes2() &Scumm::o6_setObjectXY, &Scumm::o6_drawBlastObject, /* 64 */ - &Scumm::o6_bompWindow, + &Scumm::o6_setBlastObjectWindow, &Scumm::o6_stopObjectCode, &Scumm::o6_stopObjectCode, &Scumm::o6_endCutscene, @@ -675,7 +675,7 @@ void Scumm::setupOpcodes2() _opcodes = opcode_list; _opcodes_lookup = opcode_lookup; } -void Scumm::o6_bompWindow() +void Scumm::o6_setBlastObjectWindow() { // Set BOMP processing window int a, b, c, d; @@ -1217,14 +1217,14 @@ public: int _screenLeft, _screenTop; uint16 _enqueue_b,_enqueue_c,_enqueue_d,_enqueue_e; int _enqueuePos; - EnqueuedObject _enqueuedObjects[32]; + BlastObject _enqueuedObjects[32]; void enqueueObject(int a, int b, int c, int d, int e, int f, int g, int h, int mode); void clearEnqueue() { _enqueuePos = 0; } - void drawEnqueuedObjects(); - void drawEnqueuedObject(EnqueuedObject *eo); - void removeEnqueuedObjects(); - void removeEnqueuedObject(EnqueuedObject *eo); + void drawBlastObjects(); + void drawBlastObject(BlastObject *eo); + void removeBlastObjects(); + void removeBlastObject(BlastObject *eo); int _drawObjectQueNr; byte _drawObjectQue[200]; @@ -1444,7 +1444,7 @@ public: void setStringVars(int i); void unkMiscOp9(); - void o6_bompWindow(); + void o6_setBlastObjectWindow(); void o6_pushByte(); void o6_pushWord(); void o6_pushByteVar(); diff --git a/scummvm.cpp b/scummvm.cpp index 067d64a3d6..618680d5c6 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -353,9 +353,9 @@ int Scumm::scummLoop(int delta) verbMouseOver(checkMouseOver(mouse.x, mouse.y)); } - drawEnqueuedObjects(); + drawBlastObjects(); drawDirtyScreenParts(); - removeEnqueuedObjects(); + removeBlastObjects(); if (!(_features & GF_AFTER_V6)) playActorSounds(); |