diff options
author | Max Horn | 2003-01-13 14:04:41 +0000 |
---|---|---|
committer | Max Horn | 2003-01-13 14:04:41 +0000 |
commit | 020a1c3e2d7dee95c9b6135a7f16ab23c688e22b (patch) | |
tree | 8c0340a0aa006e57b145e9cebc02ea896262d4af | |
parent | e704837f5c987a840c6ef690807c319425b85ea5 (diff) | |
download | scummvm-rg350-020a1c3e2d7dee95c9b6135a7f16ab23c688e22b.tar.gz scummvm-rg350-020a1c3e2d7dee95c9b6135a7f16ab23c688e22b.tar.bz2 scummvm-rg350-020a1c3e2d7dee95c9b6135a7f16ab23c688e22b.zip |
fixed COMI actor scaling, again
svn-id: r6443
-rw-r--r-- | scumm/actor.cpp | 13 | ||||
-rw-r--r-- | scumm/boxes.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 5 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
4 files changed, 16 insertions, 10 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 2066f01500..fc51f7c177 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -368,6 +368,13 @@ void Actor::setupActorScale() return; scale = _vm->getScale(walkbox, x, y); + if (_vm->_features & GF_AFTER_V8) { + // At least in COMI, scale values are clipped to range 1-255 + if (scale < 1) + scale = 1; + else if (scale > 255) + scale = 255; + } // FIXME - Hack for The Dig 'Tomb' (room 88) // Otherwise walking to the far-left door causes the actor @@ -393,12 +400,6 @@ void Actor::setupActorScale() } if (scale > 255) { - if (_vm->_features & GF_AFTER_V8) { - // In COMI, the scale values often are bigger than 255; - // however, the original engine seems to just cap them at 255, - // hence we do the same (the result looks correct, too); - scale = 255; - } else warning("Actor %d at %d, scale %d out of range", number, y, scale); } scalex = (byte)scale; diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index 088ce91173..07765a1e31 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -128,6 +128,12 @@ void Scumm::setBoxScale(int box, int scale) b->old.scale = TO_LE_16(scale); } +void Scumm::setBoxScaleSlot(int box, int slot) +{ + Box *b = getBoxBaseAddr(box); + b->v8.scaleSlot = TO_LE_32(slot); +} + int Scumm::getScale(int box, int x, int y) { Box *ptr = getBoxBaseAddr(box); diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index b0fcb34ac3..32265fd233 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1373,11 +1373,10 @@ void Scumm_v8::o8_kernelSetFunctions() case 15: // setVideoFrameRate // not used anymore (was smush frame rate) break; - case 20: // setBoxScale - setBoxScale(args[1], args[2]); + case 20: // setBoxScaleSlot + setBoxScaleSlot(args[1], args[2]); break; case 21: // setScaleSlot - warning("o8_kernelSetFunctions: setScaleSlot(%d, %d, %d, %d, %d, %d, %d)", args[1], args[2], args[3], args[4], args[5], args[6], args[7]); setScaleSlot(args[1], args[2], args[3], args[4], args[5], args[6], args[7]); break; case 22: // setBannerColors diff --git a/scumm/scumm.h b/scumm/scumm.h index 7c32b8ff99..ab791d0f95 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -864,7 +864,7 @@ public: }; ScaleSlot _scaleSlots[20]; // FIXME - not sure if this limit is right, but based on my observations it is void setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2); - + void setBoxScaleSlot(int box, int slot); byte getNumBoxes(); byte *getBoxMatrixBaseAddr(); |