diff options
author | Max Horn | 2003-10-02 22:42:03 +0000 |
---|---|---|
committer | Max Horn | 2003-10-02 22:42:03 +0000 |
commit | 3f55f2669d560489ee017d64f5bdd0f785cf796e (patch) | |
tree | bd8b3bc560b347a0ef58c7b23431e92142aeea50 /scumm | |
parent | 68810ac106ba538e7fb697e0f7fa6eb699a4c927 (diff) | |
download | scummvm-rg350-3f55f2669d560489ee017d64f5bdd0f785cf796e.tar.gz scummvm-rg350-3f55f2669d560489ee017d64f5bdd0f785cf796e.tar.bz2 scummvm-rg350-3f55f2669d560489ee017d64f5bdd0f785cf796e.zip |
renamed class Scumm to ScummEngine (consisten with other engine names; also makes room for a potential 'Scumm' namespace)
svn-id: r10549
Diffstat (limited to 'scumm')
57 files changed, 1016 insertions, 1016 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index e8b82103de..e733324805 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -33,9 +33,9 @@ #include "usage_bits.h" byte Actor::kInvalidBox = 0; -Scumm *Actor::_vm = 0; +ScummEngine *Actor::_vm = 0; -void Actor::initActorClass(Scumm *scumm) { +void Actor::initActorClass(ScummEngine *scumm) { _vm = scumm; if (_vm->_features & GF_SMALL_HEADER) { kInvalidBox = 255; @@ -141,7 +141,7 @@ void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) { } } -int Scumm::getAngleFromPos(int x, int y) const { +int ScummEngine::getAngleFromPos(int x, int y) const { if (_gameId == GID_DIG || _gameId == GID_CMI) { double temp = atan2((double)x, (double)-y); return normalizeAngle((int)(temp * 180 / 3.1415926535)); @@ -783,7 +783,7 @@ void Actor::showActor() { needRedraw = true; } -void Scumm::showActors() { +void ScummEngine::showActors() { int i; for (i = 1; i < _numActors; i++) { @@ -792,7 +792,7 @@ void Scumm::showActors() { } } -void Scumm::walkActors() { +void ScummEngine::walkActors() { int i; for (i = 1; i < _numActors; i++) { @@ -805,7 +805,7 @@ void Scumm::walkActors() { } /* Used in Scumm v5 only. Play sounds associated with actors */ -void Scumm::playActorSounds() { +void ScummEngine::playActorSounds() { int i; for (i = 1; i < _numActors; i++) { @@ -820,7 +820,7 @@ void Scumm::playActorSounds() { } } -Actor *Scumm::derefActor(int id, const char *errmsg) const { +Actor *ScummEngine::derefActor(int id, const char *errmsg) const { if (id == 0) debug(3, "derefActor(0, \"%s\") in script %d, opcode 0x%x", errmsg, vm.slot[_curExecScript].number, _opcode); if (id < 0 || id >= _numActors || _actors[id].number != id) { @@ -832,7 +832,7 @@ Actor *Scumm::derefActor(int id, const char *errmsg) const { return &_actors[id]; } -Actor *Scumm::derefActorSafe(int id, const char *errmsg) const { +Actor *ScummEngine::derefActorSafe(int id, const char *errmsg) const { if (id == 0) debug(3, "derefActorSafe(0, \"%s\") in script %d, opcode 0x%x", errmsg, vm.slot[_curExecScript].number, _opcode); if (id < 0 || id >= _numActors || _actors[id].number != id) { @@ -871,7 +871,7 @@ static int compareDrawOrder(const void* a, const void* b) return actor1->number - actor2->number; } -void Scumm::processActors() { +void ScummEngine::processActors() { int numactors = 0; // TODO : put this actors as a member array. It never has to grow or shrink @@ -912,7 +912,7 @@ void Scumm::processActors() { // Used in Scumm v8, to allow the verb coin to be drawn over the inventory // chest. I'm assuming that draw order won't matter here. -void Scumm::processUpperActors() { +void ScummEngine::processUpperActors() { int i; for (i = 1; i < _numActors; i++) { @@ -1069,7 +1069,7 @@ void Actor::animateLimb(int limb, int f) { } } -void Scumm::setActorRedrawFlags() { +void ScummEngine::setActorRedrawFlags() { int i, j; if (_fullRedraw) { @@ -1090,7 +1090,7 @@ void Scumm::setActorRedrawFlags() { } } -void Scumm::resetActorBgs() { +void ScummEngine::resetActorBgs() { int i, j; for (i = 0; i < gdi._numStrips; i++) { @@ -1112,7 +1112,7 @@ void Scumm::resetActorBgs() { } } -int Scumm::getActorFromPos(int x, int y) { +int ScummEngine::getActorFromPos(int x, int y) { int i; if (!testGfxAnyUsageBits(x >> 3)) @@ -1127,7 +1127,7 @@ int Scumm::getActorFromPos(int x, int y) { return 0; } -void Scumm::actorTalk() { +void ScummEngine::actorTalk() { Actor *a; _msgPtrToAdd = _charsetBuffer; @@ -1179,7 +1179,7 @@ void Scumm::actorTalk() { CHARSET_1(); } -void Scumm::stopTalk() { +void ScummEngine::stopTalk() { int act; _sound->stopTalkSound(); @@ -1200,7 +1200,7 @@ void Scumm::stopTalk() { restoreCharsetBg(); } -void Scumm::clearMsgQueue() { +void ScummEngine::clearMsgQueue() { _messagePtr = (const byte *)" "; stopTalk(); } diff --git a/scumm/actor.h b/scumm/actor.h index 23e1cf862b..c95bd3d108 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -79,7 +79,7 @@ class Actor { public: static byte kInvalidBox; - static void initActorClass(Scumm *scumm); + static void initActorClass(ScummEngine *scumm); public: Common::Point _pos; @@ -119,7 +119,7 @@ protected: ActorWalkData walkdata; int16 animVariable[16]; - static Scumm *_vm; + static ScummEngine *_vm; public: diff --git a/scumm/akos.cpp b/scumm/akos.cpp index c79f285d74..3af16b7bfd 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -112,7 +112,7 @@ static bool akos_compare(int a, int b, byte cmd) { } } -bool Scumm::akos_hasManyDirections(Actor *a) { +bool ScummEngine::akos_hasManyDirections(Actor *a) { byte *akos; const AkosHeader *akhd; @@ -123,14 +123,14 @@ bool Scumm::akos_hasManyDirections(Actor *a) { return (akhd->flags & 2) != 0; } -int Scumm::akos_frameToAnim(Actor *a, int frame) { +int ScummEngine::akos_frameToAnim(Actor *a, int frame) { if (akos_hasManyDirections(a)) return toSimpleDir(1, a->getFacing()) + frame * 8; else return newDirToOldDir(a->getFacing()) + frame * 4; } -void Scumm::akos_decodeData(Actor *a, int frame, uint usemask) { +void ScummEngine::akos_decodeData(Actor *a, int frame, uint usemask) { uint anim; const byte *akos, *r; const AkosHeader *akhd; @@ -1057,7 +1057,7 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { return 0; } -bool Scumm::akos_increaseAnims(const byte *akos, Actor *a) { +bool ScummEngine::akos_increaseAnims(const byte *akos, Actor *a) { const byte *aksq, *akfo; int i; uint size; @@ -1080,7 +1080,7 @@ bool Scumm::akos_increaseAnims(const byte *akos, Actor *a) { #define GUW(o) READ_LE_UINT16(aksq+curpos+(o)) #define GB(o) aksq[curpos+(o)] -bool Scumm::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const uint16 *akfo, int numakfo) { +bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const uint16 *akfo, int numakfo) { byte active; uint old_curpos, curpos, end; uint code; @@ -1313,7 +1313,7 @@ bool Scumm::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const uint16 return curpos != old_curpos; } -void Scumm::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) { +void ScummEngine::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) { switch (cmd) { case 1: a->putActor(0, 0, 0); diff --git a/scumm/akos.h b/scumm/akos.h index a7d81df81e..d693cad814 100644 --- a/scumm/akos.h +++ b/scumm/akos.h @@ -63,7 +63,7 @@ protected: } akos16; public: - AkosRenderer(Scumm *scumm) : BaseCostumeRenderer(scumm) { + AkosRenderer(ScummEngine *scumm) : BaseCostumeRenderer(scumm) { akos = 0; akhd = 0; akpl = 0; diff --git a/scumm/base-costume.h b/scumm/base-costume.h index bd20a07767..001637ba33 100644 --- a/scumm/base-costume.h +++ b/scumm/base-costume.h @@ -41,7 +41,7 @@ struct CostumeInfo { #endif class Actor; -class Scumm; +class ScummEngine; /** * Base class for both CostumeRenderer and AkosRenderer. @@ -64,7 +64,7 @@ public: uint _outwidth, _outheight; protected: - Scumm *_vm; + ScummEngine *_vm; int32 _numStrips; // Source pointer @@ -95,7 +95,7 @@ protected: } v1; public: - BaseCostumeRenderer(Scumm *scumm) { + BaseCostumeRenderer(ScummEngine *scumm) { _dirty_id = 0; _shadow_mode = 0; _shadow_table = 0; diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp index 3798a32333..2a51f61ec5 100644 --- a/scumm/bomp.cpp +++ b/scumm/bomp.cpp @@ -192,7 +192,7 @@ void bompScaleFuncX(byte *line_buffer, byte *scaling_x_ptr, byte skip, int32 siz } } -void Scumm::drawBomp(const BompDrawData &bd, bool mirror) { +void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) { const byte *src; byte *dst; byte maskbit; diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index b4b50613d8..2f9e47ccc2 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -80,7 +80,7 @@ static bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3); static Common::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); -byte Scumm::getMaskFromBox(int box) { +byte ScummEngine::getMaskFromBox(int box) { // Fix for bug #740244 and #755863. This appears to have been a // long standing bug in the original engine? if (_version <= 3 && box == 255) @@ -98,7 +98,7 @@ byte Scumm::getMaskFromBox(int box) { return ptr->old.mask; } -void Scumm::setBoxFlags(int box, int val) { +void ScummEngine::setBoxFlags(int box, int val) { debug(2, "setBoxFlags(%d, 0x%02x)", box, val); /* FULL_THROTTLE stuff */ @@ -117,7 +117,7 @@ void Scumm::setBoxFlags(int box, int val) { } } -byte Scumm::getBoxFlags(int box) { +byte ScummEngine::getBoxFlags(int box) { Box *ptr = getBoxBaseAddr(box); if (!ptr) return 0; @@ -129,7 +129,7 @@ byte Scumm::getBoxFlags(int box) { return ptr->old.flags; } -void Scumm::setBoxScale(int box, int scale) { +void ScummEngine::setBoxScale(int box, int scale) { Box *ptr = getBoxBaseAddr(box); assert(ptr); if (_version == 8) @@ -140,13 +140,13 @@ void Scumm::setBoxScale(int box, int scale) { ptr->old.scale = TO_LE_16(scale); } -void Scumm::setBoxScaleSlot(int box, int slot) { +void ScummEngine::setBoxScaleSlot(int box, int slot) { Box *ptr = getBoxBaseAddr(box); assert(ptr); ptr->v8.scaleSlot = TO_LE_32(slot); } -int Scumm::getScale(int box, int x, int y) { +int ScummEngine::getScale(int box, int x, int y) { if (_features & GF_NO_SCALING) return 255; @@ -207,7 +207,7 @@ int Scumm::getScale(int box, int x, int y) { return scale; } -int Scumm::getBoxScale(int box) { +int ScummEngine::getBoxScale(int box) { if (_features & GF_NO_SCALING) return 255; Box *ptr = getBoxBaseAddr(box); @@ -233,7 +233,7 @@ int Scumm::getBoxScale(int box) { * To accomodate old savegames, we attempt here to convert rtScaleTable * resources to scale slots. */ -void Scumm::convertScaleTableToScaleSlot(int slot) { +void ScummEngine::convertScaleTableToScaleSlot(int slot) { assert(1 <= slot && slot <= ARRAYSIZE(_scaleSlots)); byte *resptr = getResourceAddress(rtScaleTable, slot); @@ -333,7 +333,7 @@ void Scumm::convertScaleTableToScaleSlot(int slot) { warning("scale item %d, variance %f exceeds 1 (room %d)\n", slot, variance, _currentRoom); } -void Scumm::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2) { +void ScummEngine::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2) { assert(1 <= slot && slot <= ARRAYSIZE(_scaleSlots)); ScaleSlot &s = _scaleSlots[slot-1]; s.x2 = x2; @@ -344,7 +344,7 @@ void Scumm::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, i s.scale1 = scale1; } -byte Scumm::getNumBoxes() { +byte ScummEngine::getNumBoxes() { byte *ptr = getResourceAddress(rtMatrix, 2); if (!ptr) return 0; @@ -354,7 +354,7 @@ byte Scumm::getNumBoxes() { return ptr[0]; } -Box *Scumm::getBoxBaseAddr(int box) { +Box *ScummEngine::getBoxBaseAddr(int box) { byte *ptr = getResourceAddress(rtMatrix, 2); if (!ptr || box == 255) return NULL; @@ -391,7 +391,7 @@ Box *Scumm::getBoxBaseAddr(int box) { return (Box *)(ptr + box * SIZEOF_BOX + 2); } -int Scumm::getSpecialBox(int x, int y) { +int ScummEngine::getSpecialBox(int x, int y) { int i; int numOfBoxes; byte flag; @@ -411,7 +411,7 @@ int Scumm::getSpecialBox(int x, int y) { return (-1); } -bool Scumm::checkXYInBoxBounds(int b, int x, int y) { +bool ScummEngine::checkXYInBoxBounds(int b, int x, int y) { BoxCoords box; if (b < 0 || b == Actor::kInvalidBox) @@ -455,7 +455,7 @@ bool Scumm::checkXYInBoxBounds(int b, int x, int y) { return true; } -void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) { +void ScummEngine::getBoxCoordinates(int boxnum, BoxCoords *box) { Box *bp = getBoxBaseAddr(boxnum); assert(bp); @@ -514,7 +514,7 @@ void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) { } } -uint Scumm::distanceFromPt(int x, int y, int ptx, int pty) { +uint ScummEngine::distanceFromPt(int x, int y, int ptx, int pty) { int diffx, diffy; diffx = abs(ptx - x); @@ -615,7 +615,7 @@ Common::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) return pt; } -bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) { +bool ScummEngine::inBoxQuickReject(int b, int x, int y, int threshold) { int t; BoxCoords box; @@ -640,7 +640,7 @@ bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) { return false; } -int Scumm::getClosestPtOnBox(int b, int x, int y, int16& outX, int16& outY) { +int ScummEngine::getClosestPtOnBox(int b, int x, int y, int16& outX, int16& outY) { Common::Point pt; uint dist; uint bestdist = 0xFFFFFF; @@ -683,7 +683,7 @@ int Scumm::getClosestPtOnBox(int b, int x, int y, int16& outX, int16& outY) { return bestdist; } -byte *Scumm::getBoxMatrixBaseAddr() { +byte *ScummEngine::getBoxMatrixBaseAddr() { byte *ptr = getResourceAddress(rtMatrix, 1); assert(ptr); if (*ptr == 0xFF) @@ -697,7 +697,7 @@ byte *Scumm::getBoxMatrixBaseAddr() { * way to 'to' (this can be 'to' itself or a third box). * If there is no connection -1 is return. */ -int Scumm::getPathToDestBox(byte from, byte to) { +int ScummEngine::getPathToDestBox(byte from, byte to) { const byte *boxm; byte i; const int numOfBoxes = getNumBoxes(); @@ -936,7 +936,7 @@ static void printMatrix2(byte *matrix, int num) { } #endif -void Scumm::createBoxMatrix() { +void ScummEngine::createBoxMatrix() { int num, i, j, k; byte *adjacentMatrix, *itineraryMatrix; @@ -1033,7 +1033,7 @@ void Scumm::createBoxMatrix() { } /** Check if two boxes are neighbours. */ -bool Scumm::areBoxesNeighbours(int box1nr, int box2nr) { +bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) { int j, k, m, n; int tmp_x, tmp_y; bool result; @@ -1183,7 +1183,7 @@ void Actor::findPathTowardsOld(byte trap1, byte trap2, byte final_trap, Common:: * This way the lines bound a 'corridor' between the two boxes, through which * the actor has to walk to get from trap1 to trap2. */ -void Scumm::getGates(int trap1, int trap2, Common::Point gateA[2], Common::Point gateB[2]) { +void ScummEngine::getGates(int trap1, int trap2, Common::Point gateA[2], Common::Point gateB[2]) { int i, j; int dist[8]; int minDist[3]; diff --git a/scumm/camera.cpp b/scumm/camera.cpp index ffa5a20389..50990528fc 100644 --- a/scumm/camera.cpp +++ b/scumm/camera.cpp @@ -25,7 +25,7 @@ #include "actor.h" #include "charset.h" -void Scumm::setCameraAtEx(int at) { +void ScummEngine::setCameraAtEx(int at) { if (!(_features & GF_NEW_CAMERA)) { camera._mode = CM_NORMAL; camera._cur.x = at; @@ -34,7 +34,7 @@ void Scumm::setCameraAtEx(int at) { } } -void Scumm::setCameraAt(int pos_x, int pos_y) { +void ScummEngine::setCameraAt(int pos_x, int pos_y) { if (camera._mode != CM_FOLLOW_ACTOR || abs(pos_x - camera._cur.x) > (_screenWidth / 2)) { camera._cur.x = pos_x; } @@ -59,7 +59,7 @@ void Scumm::setCameraAt(int pos_x, int pos_y) { stopTalk(); } -void Scumm_v7::setCameraAt(int pos_x, int pos_y) { +void ScummEngine_v7::setCameraAt(int pos_x, int pos_y) { Common::Point old; old = camera._cur; @@ -83,7 +83,7 @@ void Scumm_v7::setCameraAt(int pos_x, int pos_y) { } } -void Scumm::setCameraFollows(Actor *a) { +void ScummEngine::setCameraFollows(Actor *a) { int t, i; @@ -109,7 +109,7 @@ void Scumm::setCameraFollows(Actor *a) { runInventoryScript(0); } -void Scumm_v7::setCameraFollows(Actor *a) { +void ScummEngine_v7::setCameraFollows(Actor *a) { byte oldfollow = camera._follows; int ax, ay; @@ -133,7 +133,7 @@ void Scumm_v7::setCameraFollows(Actor *a) { } -void Scumm::clampCameraPos(Common::Point *pt) { +void ScummEngine::clampCameraPos(Common::Point *pt) { if (pt->x < VAR(VAR_CAMERA_MIN_X)) pt->x = (short) VAR(VAR_CAMERA_MIN_X); @@ -147,7 +147,7 @@ void Scumm::clampCameraPos(Common::Point *pt) { pt->y = (short) VAR(VAR_CAMERA_MAX_Y); } -void Scumm::moveCamera() { +void ScummEngine::moveCamera() { int pos = camera._cur.x; int actorx, t; Actor *a = NULL; @@ -225,7 +225,7 @@ void Scumm::moveCamera() { } } -void Scumm_v7::moveCamera() { +void ScummEngine_v7::moveCamera() { Common::Point old = camera._cur; Actor *a = NULL; @@ -310,7 +310,7 @@ void Scumm_v7::moveCamera() { } -void Scumm::cameraMoved() { +void ScummEngine::cameraMoved() { if (_features & GF_NEW_CAMERA) { assert(camera._cur.x >= (_screenWidth / 2) && camera._cur.y >= (_screenHeight / 2)); } else { @@ -349,19 +349,19 @@ void Scumm::cameraMoved() { } } -void Scumm::panCameraTo(int x, int y) { +void ScummEngine::panCameraTo(int x, int y) { camera._dest.x = x; camera._mode = CM_PANNING; camera._movingToActor = false; } -void Scumm_v7::panCameraTo(int x, int y) { +void ScummEngine_v7::panCameraTo(int x, int y) { VAR(VAR_CAMERA_FOLLOWED_ACTOR) = camera._follows = 0; VAR(VAR_CAMERA_DEST_X) = camera._dest.x = x; VAR(VAR_CAMERA_DEST_Y) = camera._dest.y = y; } -void Scumm::actorFollowCamera(int act) { +void ScummEngine::actorFollowCamera(int act) { if (!(_features & GF_NEW_CAMERA)) { int old; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index f2dd44d28f..36362f0ea8 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -24,7 +24,7 @@ #include "nut_renderer.h" #include "base/gameDetector.h" -CharsetRenderer::CharsetRenderer(Scumm *vm) { +CharsetRenderer::CharsetRenderer(ScummEngine *vm) { _nextLeft = 0; _nextTop = 0; @@ -1219,7 +1219,7 @@ void CharsetRendererCommon::drawBits1(VirtScreen *vs, byte *dst, const byte *src } } -CharsetRendererNut::CharsetRendererNut(Scumm *vm) +CharsetRendererNut::CharsetRendererNut(ScummEngine *vm) : CharsetRenderer(vm) { _current = 0; diff --git a/scumm/charset.h b/scumm/charset.h index dd0375c01c..09e662b634 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -24,7 +24,7 @@ #include "common/rect.h" #include "common/scummsys.h" -class Scumm; +class ScummEngine; class NutRenderer; struct VirtScreen; @@ -51,13 +51,13 @@ public: bool _disableOffsX; protected: - Scumm *_vm; + ScummEngine *_vm; byte _curId; virtual int getCharWidth(byte chr) = 0; public: - CharsetRenderer(Scumm *vm); + CharsetRenderer(ScummEngine *vm); virtual ~CharsetRenderer() {} virtual void printChar(int chr) = 0; @@ -80,7 +80,7 @@ protected: void drawBits1(VirtScreen *vs, byte *dst, const byte *src, byte *mask, int drawTop, int width, int height); public: - CharsetRendererCommon(Scumm *vm) : CharsetRenderer(vm) {} + CharsetRendererCommon(ScummEngine *vm) : CharsetRenderer(vm) {} void setCurID(byte id); @@ -94,7 +94,7 @@ protected: void drawBitsN(VirtScreen *vs, byte *dst, const byte *src, byte *mask, byte bpp, int drawTop, int width, int height); public: - CharsetRendererClassic(Scumm *vm) : CharsetRendererCommon(vm) {} + CharsetRendererClassic(ScummEngine *vm) : CharsetRendererCommon(vm) {} void printChar(int chr); }; @@ -107,7 +107,7 @@ protected: int getCharWidth(byte chr); public: - CharsetRendererV3(Scumm *vm) : CharsetRendererCommon(vm) {} + CharsetRendererV3(ScummEngine *vm) : CharsetRendererCommon(vm) {} void printChar(int chr); void setCurID(byte id); @@ -120,7 +120,7 @@ protected: int getCharWidth(byte chr) { return 8; } public: - CharsetRendererV2(Scumm *vm) : CharsetRendererV3(vm) {} + CharsetRendererV2(ScummEngine *vm) : CharsetRendererV3(vm) {} void setCurID(byte id); }; @@ -133,7 +133,7 @@ protected: NutRenderer *_current; public: - CharsetRendererNut(Scumm *vm); + CharsetRendererNut(ScummEngine *vm); ~CharsetRendererNut(); void printChar(int chr); diff --git a/scumm/costume.cpp b/scumm/costume.cpp index cdc77fa2fe..9d04d34895 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -666,11 +666,11 @@ byte CostumeRenderer::drawLimb(const CostumeData &cost, int limb) { } -int Scumm::cost_frameToAnim(Actor *a, int frame) { +int ScummEngine::cost_frameToAnim(Actor *a, int frame) { return newDirToOldDir(a->getFacing()) + frame * 4; } -void Scumm::cost_decodeData(Actor *a, int frame, uint usemask) { +void ScummEngine::cost_decodeData(Actor *a, int frame, uint usemask) { const byte *r; uint mask, j; int i; @@ -842,7 +842,7 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) { } while (1); } -bool Scumm::isCostumeInUse(int cost) const { +bool ScummEngine::isCostumeInUse(int cost) const { int i; Actor *a; diff --git a/scumm/costume.h b/scumm/costume.h index e43320e08f..2038b42839 100644 --- a/scumm/costume.h +++ b/scumm/costume.h @@ -25,7 +25,7 @@ class LoadedCostume { protected: - Scumm *_vm; + ScummEngine *_vm; public: int _id; @@ -39,7 +39,7 @@ public: byte _format; bool _mirror; - LoadedCostume(Scumm *vm) : + LoadedCostume(ScummEngine *vm) : _vm(vm), _id(-1), _baseptr(0), _animCmds(0), _dataOffsets(0), _palette(0), _frameOffsets(0), _numColors(0), _numAnim(0), _format(0), _mirror(false) {} @@ -60,7 +60,7 @@ protected: byte _palette[32]; public: - CostumeRenderer(Scumm *vm) : BaseCostumeRenderer(vm), _loaded(vm) {} + CostumeRenderer(ScummEngine *vm) : BaseCostumeRenderer(vm), _loaded(vm) {} void setPalette(byte *palette); void setFacing(Actor *a); diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 62c5200493..3eacb7734f 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -55,7 +55,7 @@ ScummDebugger::ScummDebugger() { } // Initialisation Functions -void ScummDebugger::attach(Scumm *s, char *entry) { +void ScummDebugger::attach(ScummEngine *s, char *entry) { #ifdef _WIN32_WCE force_keyboard(true); @@ -850,7 +850,7 @@ void ScummDebugger::printBox(int box) { static int gfxPrimitivesCompareInt(const void *a, const void *b); -static void hlineColor(Scumm *scumm, int x1, int x2, int y, byte color) +static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) { VirtScreen *vs = &scumm->virtscr[0]; byte *ptr; @@ -884,7 +884,7 @@ static int gfxPrimitivesCompareInt(const void *a, const void *b) return (*(const int *)a) - (*(const int *)b); } -static void fillQuad(Scumm *scumm, int16 vx[4], int16 vy[4], int color) +static void fillQuad(ScummEngine *scumm, int16 vx[4], int16 vy[4], int color) { const int N = 4; int i; diff --git a/scumm/debugger.h b/scumm/debugger.h index 078db8a383..31c786799b 100644 --- a/scumm/debugger.h +++ b/scumm/debugger.h @@ -24,7 +24,7 @@ // Choose between text console or ScummConsole #define USE_CONSOLE 1 -class Scumm; +class ScummEngine; class ScummDebugger; typedef bool (ScummDebugger::*DebugProc)(int argc, const char **argv); @@ -52,10 +52,10 @@ public: ScummDebugger(); void on_frame(); - void attach(Scumm *s, char *entry); + void attach(ScummEngine *s, char *entry); protected: - Scumm *_s; + ScummEngine *_s; int _frame_countdown, _dvar_count, _dcmd_count; DVar _dvars[256]; DCmd _dcmds[256]; diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index 63866b06df..8f022b2526 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -227,7 +227,7 @@ enum { kQuitCmd = 'QUIT' }; -SaveLoadDialog::SaveLoadDialog(NewGui *gui, Scumm *scumm) +SaveLoadDialog::SaveLoadDialog(NewGui *gui, ScummEngine *scumm) : ScummDialog(gui, scumm, 20, 8, 280, 184) { const int x = _w - kButtonWidth - 8; int y = 20; @@ -423,10 +423,10 @@ enum { }; #ifndef _WIN32_WCE -OptionsDialog::OptionsDialog(NewGui *gui, Scumm *scumm) +OptionsDialog::OptionsDialog(NewGui *gui, ScummEngine *scumm) : ScummDialog(gui, scumm, 40, 30, 240, 124) { #else -OptionsDialog::OptionsDialog(NewGui *gui, Scumm *scumm) +OptionsDialog::OptionsDialog(NewGui *gui, ScummEngine *scumm) : ScummDialog(gui, scumm, 40, 30, 240, 124 + kButtonHeight + 4) { #endif // @@ -580,7 +580,7 @@ enum { kPrevCmd = 'PREV' }; -HelpDialog::HelpDialog(NewGui *gui, Scumm *scumm) +HelpDialog::HelpDialog(NewGui *gui, ScummEngine *scumm) : ScummDialog(gui, scumm, 5, 5, 310, 190) { _page = 1; @@ -650,12 +650,12 @@ void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { #pragma mark - -InfoDialog::InfoDialog(NewGui *gui, Scumm *scumm, int res) +InfoDialog::InfoDialog(NewGui *gui, ScummEngine *scumm, int res) : ScummDialog(gui, scumm, 0, 80, 0, 16) { // dummy x and w setInfoText(queryResString (res)); } -InfoDialog::InfoDialog(NewGui *gui, Scumm *scumm, const String& message) +InfoDialog::InfoDialog(NewGui *gui, ScummEngine *scumm, const String& message) : ScummDialog(gui, scumm, 0, 80, 0, 16) { // dummy x and w setInfoText(message); } @@ -671,11 +671,11 @@ void InfoDialog::setInfoText(const String& message) { #pragma mark - -PauseDialog::PauseDialog(NewGui *gui, Scumm *scumm) +PauseDialog::PauseDialog(NewGui *gui, ScummEngine *scumm) : InfoDialog(gui, scumm, 10) { } -ConfirmExitDialog::ConfirmExitDialog(NewGui *gui, Scumm *scumm) +ConfirmExitDialog::ConfirmExitDialog(NewGui *gui, ScummEngine *scumm) : InfoDialog(gui, scumm, "Do you really want to quit (y/n)?") { } @@ -699,7 +699,7 @@ enum { }; -KeysDialog::KeysDialog(NewGui *gui, Scumm *scumm) +KeysDialog::KeysDialog(NewGui *gui, ScummEngine *scumm) : ScummDialog(gui, scumm, 30, 20, 260, 160) { addButton(160, 20, queryCustomString(24), kMapCmd, 'M'); // Map addButton(160, 40, "OK", kOKCmd, 'O'); // OK diff --git a/scumm/dialogs.h b/scumm/dialogs.h index eb0e2eb14a..9b6aa359b9 100644 --- a/scumm/dialogs.h +++ b/scumm/dialogs.h @@ -30,17 +30,17 @@ #endif class ListWidget; -class Scumm; +class ScummEngine; class ScummDialog : public Dialog { public: - ScummDialog(NewGui *gui, Scumm *scumm, int x, int y, int w, int h) + ScummDialog(NewGui *gui, ScummEngine *scumm, int x, int y, int w, int h) : Dialog(gui, x, y, w, h), _scumm(scumm) {} protected: typedef Common::String String; - Scumm *_scumm; + ScummEngine *_scumm; void addResText(int x, int y, int w, int h, int resID); @@ -54,7 +54,7 @@ protected: class SaveLoadDialog : public ScummDialog { public: - SaveLoadDialog(NewGui *gui, Scumm *scumm); + SaveLoadDialog(NewGui *gui, ScummEngine *scumm); ~SaveLoadDialog(); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); virtual void open(); @@ -84,7 +84,7 @@ protected: class HelpDialog : public ScummDialog { public: - HelpDialog(NewGui *gui, Scumm *scumm); + HelpDialog(NewGui *gui, ScummEngine *scumm); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); protected: @@ -112,7 +112,7 @@ protected: #endif public: - OptionsDialog(NewGui *gui, Scumm *scumm); + OptionsDialog(NewGui *gui, ScummEngine *scumm); ~OptionsDialog(); virtual void open(); @@ -139,9 +139,9 @@ protected: class InfoDialog : public ScummDialog { public: // arbitrary message - InfoDialog(NewGui *gui, Scumm *scumm, const String& message); + InfoDialog(NewGui *gui, ScummEngine *scumm, const String& message); // from resources - InfoDialog(NewGui *gui, Scumm *scumm, int res); + InfoDialog(NewGui *gui, ScummEngine *scumm, int res); virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); @@ -157,7 +157,7 @@ protected: class PauseDialog : public InfoDialog { public: - PauseDialog(NewGui *gui, Scumm *scumm); + PauseDialog(NewGui *gui, ScummEngine *scumm); virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers) { if (ascii == ' ') // Close pause dialog if space key is pressed @@ -169,7 +169,7 @@ public: class ConfirmExitDialog : public InfoDialog { public: - ConfirmExitDialog(NewGui *gui, Scumm *scumm); + ConfirmExitDialog(NewGui *gui, ScummEngine *scumm); virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); }; @@ -177,7 +177,7 @@ public: class KeysDialog : public ScummDialog { public: - KeysDialog(NewGui *gui, Scumm *scumm); + KeysDialog(NewGui *gui, ScummEngine *scumm); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index c0f8452e49..3f52ed8a7d 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -193,7 +193,7 @@ static inline uint colorWeight(int red, int green, int blue) { return 3 * red * red + 6 * green * green + 2 * blue * blue; } -void Scumm::getGraphicsPerformance() { +void ScummEngine::getGraphicsPerformance() { int i; for (i = 10; i != 0; i--) { @@ -217,7 +217,7 @@ void Scumm::getGraphicsPerformance() { initScreens(0, 16, _screenWidth, 144); } -void Scumm::initScreens(int a, int b, int w, int h) { +void ScummEngine::initScreens(int a, int b, int w, int h) { int i; for (i = 0; i < 3; i++) { @@ -241,7 +241,7 @@ void Scumm::initScreens(int a, int b, int w, int h) { } -void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, +void ScummEngine::initVirtScreen(int slot, int number, int top, int width, int height, bool twobufs, bool scrollable) { VirtScreen *vs = &virtscr[slot]; int size; @@ -286,7 +286,7 @@ void Scumm::initVirtScreen(int slot, int number, int top, int width, int height, } } -VirtScreen *Scumm::findVirtScreen(int y) { +VirtScreen *ScummEngine::findVirtScreen(int y) { VirtScreen *vs = virtscr; int i; @@ -298,7 +298,7 @@ VirtScreen *Scumm::findVirtScreen(int y) { return NULL; } -void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit) { +void ScummEngine::updateDirtyRect(int virt, int left, int right, int top, int bottom, int dirtybit) { VirtScreen *vs = &virtscr[virt]; int lp, rp; @@ -353,7 +353,7 @@ void Scumm::updateDirtyRect(int virt, int left, int right, int top, int bottom, } } -void Scumm::drawDirtyScreenParts() { +void ScummEngine::drawDirtyScreenParts() { int i; VirtScreen *vs; byte *src; @@ -386,7 +386,7 @@ void Scumm::drawDirtyScreenParts() { } } -void Scumm::updateDirtyScreen(int slot) { +void ScummEngine::updateDirtyScreen(int slot) { gdi.updateDirtyScreen(&virtscr[slot]); } @@ -501,7 +501,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) { } } -void Scumm::blit(byte *dst, const byte *src, int w, int h) { +void ScummEngine::blit(byte *dst, const byte *src, int w, int h) { assert(h > 0); assert(src != NULL); assert(dst != NULL); @@ -518,7 +518,7 @@ void Scumm::blit(byte *dst, const byte *src, int w, int h) { } } -void Scumm::drawBox(int x, int y, int x2, int y2, int color) { +void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) { int width, height; VirtScreen *vs; byte *backbuff, *bgbuff; @@ -581,7 +581,7 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color) { #pragma mark - -void Scumm::initBGBuffers(int height) { +void ScummEngine::initBGBuffers(int height) { const byte *ptr; int size, itemsize, i; byte *room; @@ -635,7 +635,7 @@ void Scumm::initBGBuffers(int height) { } } -void Scumm::drawFlashlight() { +void ScummEngine::drawFlashlight() { int i, j, offset, x, y; // Remove the flash light first if it was previously drawn @@ -723,7 +723,7 @@ void Scumm::drawFlashlight() { * Redraw background as needed, i.e. the left/right sides if scrolling took place etc. * Note that this only updated the virtual screen, not the actual display. */ -void Scumm::redrawBGAreas() { +void ScummEngine::redrawBGAreas() { int i; int val; int diff; @@ -773,7 +773,7 @@ void Scumm::redrawBGAreas() { _BgNeedsRedraw = false; } -void Scumm::redrawBGStrip(int start, int num) { +void ScummEngine::redrawBGStrip(int start, int num) { int s = _screenStartStrip + start; assert(s >= 0 && (size_t) s < sizeof(gfxUsageBits) / (3 * sizeof(gfxUsageBits[0]))); @@ -788,7 +788,7 @@ void Scumm::redrawBGStrip(int start, int num) { &virtscr[0], s, 0, _roomWidth, virtscr[0].height, s, num, 0, _roomStrips); } -void Scumm::restoreCharsetBg() { +void ScummEngine::restoreCharsetBg() { if (_charset->_hasMask) { restoreBG(gdi._mask); _charset->_hasMask = false; @@ -802,7 +802,7 @@ void Scumm::restoreCharsetBg() { _charset->_nextTop = _string[0].ypos; } -void Scumm::restoreBG(Common::Rect rect, byte backColor) { +void ScummEngine::restoreBG(Common::Rect rect, byte backColor) { VirtScreen *vs; int topline, height, width; byte *backbuff, *bgbak; @@ -872,13 +872,13 @@ void Scumm::restoreBG(Common::Rect rect, byte backColor) { } } -bool Scumm::hasCharsetMask(int left, int top, int right, int bottom) { +bool ScummEngine::hasCharsetMask(int left, int top, int right, int bottom) { Common::Rect rect(left, top, right, bottom); return _charset->_hasMask && rect.intersects(gdi._mask); } -byte *Scumm::getMaskBuffer(int x, int y, int z) { +byte *ScummEngine::getMaskBuffer(int x, int y, int z) { return getResourceAddress(rtBuffer, 9) + _screenStartStrip + (x / 8) + y * gdi._numStrips + gdi._imgBufOffs[z]; } @@ -2172,7 +2172,7 @@ void Gdi::unkDecode11(byte *dst, const byte *src, int height) { #pragma mark --- Transition effects --- #pragma mark - -void Scumm::fadeIn(int effect) { +void ScummEngine::fadeIn(int effect) { updatePalette(); switch (effect) { @@ -2216,7 +2216,7 @@ void Scumm::fadeIn(int effect) { _screenEffectFlag = true; } -void Scumm::fadeOut(int effect) { +void ScummEngine::fadeOut(int effect) { VirtScreen *vs = &virtscr[0]; vs->setDirtyRange(0, 0); @@ -2274,7 +2274,7 @@ void Scumm::fadeOut(int effect) { * in a certain order; the exact order determines how the effect appears to the user. * @param a the transition effect to perform */ -void Scumm::transitionEffect(int a) { +void ScummEngine::transitionEffect(int a) { int delta[16]; // Offset applied during each iteration int tab_2[16]; int i, j; @@ -2335,7 +2335,7 @@ void Scumm::transitionEffect(int a) { * dissolveEffect(8, 8) produces a square-by-square dissolve * dissolveEffect(virtsrc[0].width, 1) produces a line-by-line dissolve */ -void Scumm::dissolveEffect(int width, int height) { +void ScummEngine::dissolveEffect(int width, int height) { VirtScreen *vs = &virtscr[0]; int *offsets; int blits_before_refresh, blits; @@ -2441,7 +2441,7 @@ void Scumm::dissolveEffect(int width, int height) { } } -void Scumm::scrollEffect(int dir) { +void ScummEngine::scrollEffect(int dir) { VirtScreen *vs = &virtscr[0]; int x, y; @@ -2518,7 +2518,7 @@ void Scumm::scrollEffect(int dir) { } } -void Scumm::unkScreenEffect6() { +void ScummEngine::unkScreenEffect6() { // CD Loom (but not EGA Loom!) uses a more fine-grained dissolve if (_gameId == GID_LOOM256) dissolveEffect(1, 1); @@ -2526,7 +2526,7 @@ void Scumm::unkScreenEffect6() { dissolveEffect(8, 4); } -void Scumm::unkScreenEffect5(int a) { +void ScummEngine::unkScreenEffect5(int a) { // unkScreenEffect5(0), which is used by FOA during the opening // cutscene when Indy opens the small statue, has been replaced by // dissolveEffect(1, 1). @@ -2537,7 +2537,7 @@ void Scumm::unkScreenEffect5(int a) { warning("stub unkScreenEffect(%d)", a); } -void Scumm::setShake(int mode) { +void ScummEngine::setShake(int mode) { if (_shakeEnabled != (mode != 0)) _fullRedraw = true; @@ -2550,7 +2550,7 @@ void Scumm::setShake(int mode) { #pragma mark --- Palette --- #pragma mark - -void Scumm::setupAmigaPalette() { +void ScummEngine::setupAmigaPalette() { setPalColor( 0, 0, 0, 0); setPalColor( 1, 0, 0, 187); setPalColor( 2, 0, 187, 0); @@ -2569,7 +2569,7 @@ void Scumm::setupAmigaPalette() { setPalColor(15, 255, 255, 255); } -void Scumm::setupEGAPalette() { +void ScummEngine::setupEGAPalette() { setPalColor( 0, 0, 0, 0); setPalColor( 1, 0, 0, 168); setPalColor( 2, 0, 168, 0); @@ -2588,7 +2588,7 @@ void Scumm::setupEGAPalette() { setPalColor(15, 252, 252, 252); } -void Scumm::setupV1ManiacPalette() { +void ScummEngine::setupV1ManiacPalette() { setPalColor( 0, 0, 0, 0); setPalColor( 1, 252, 252, 252); setPalColor( 2, 168, 0, 0); @@ -2607,7 +2607,7 @@ void Scumm::setupV1ManiacPalette() { setPalColor(15, 84, 84, 84); } -void Scumm::setupV1ZakPalette() { +void ScummEngine::setupV1ZakPalette() { setPalColor( 0, 0, 0, 0); setPalColor( 1, 252, 252, 252); setPalColor( 2, 168, 0, 0); @@ -2626,7 +2626,7 @@ void Scumm::setupV1ZakPalette() { setPalColor(15, 168, 168, 168); } -void Scumm::setPaletteFromPtr(const byte *ptr) { +void ScummEngine::setPaletteFromPtr(const byte *ptr) { int i; byte *dest, r, g, b; int numcolor; @@ -2668,20 +2668,20 @@ void Scumm::setPaletteFromPtr(const byte *ptr) { setDirtyColors(0, numcolor - 1); } -void Scumm::setPaletteFromRes() { +void ScummEngine::setPaletteFromRes() { byte *ptr; ptr = getResourceAddress(rtRoom, _roomResource) + _CLUT_offs; setPaletteFromPtr(ptr); } -void Scumm::setDirtyColors(int min, int max) { +void ScummEngine::setDirtyColors(int min, int max) { if (_palDirtyMin > min) _palDirtyMin = min; if (_palDirtyMax < max) _palDirtyMax = max; } -void Scumm::initCycl(const byte *ptr) { +void ScummEngine::initCycl(const byte *ptr) { int j; ColorCycle *cycl; @@ -2724,7 +2724,7 @@ void Scumm::initCycl(const byte *ptr) { } } -void Scumm::stopCycle(int i) { +void ScummEngine::stopCycle(int i) { ColorCycle *cycl; checkRange(16, 0, i, "Stop Cycle %d Out Of Range"); @@ -2782,7 +2782,7 @@ static void cycleIndirectPalette(byte *palette, int cycleStart, int cycleEnd, bo } -void Scumm::cyclePalette() { +void ScummEngine::cyclePalette() { ColorCycle *cycl; int valueToAdd; int i, j; @@ -2834,7 +2834,7 @@ void Scumm::cyclePalette() { * Perform color cycling on the palManipulate data, too, otherwise * color cycling will be disturbed by the palette fade. */ -void Scumm::moveMemInPalRes(int start, int end, byte direction) { +void ScummEngine::moveMemInPalRes(int start, int end, byte direction) { if (!_palManipCounter) return; @@ -2842,7 +2842,7 @@ void Scumm::moveMemInPalRes(int start, int end, byte direction) { ::cyclePalette(_palManipIntermediatePal, start, end, 6, !direction); } -void Scumm::palManipulateInit(int start, int end, int string_id, int time) { +void ScummEngine::palManipulateInit(int start, int end, int string_id, int time) { byte *pal, *target, *between; byte *string1, *string2, *string3; int i; @@ -2888,7 +2888,7 @@ void Scumm::palManipulateInit(int start, int end, int string_id, int time) { _palManipCounter = time; } -void Scumm::palManipulate() { +void ScummEngine::palManipulate() { byte *target, *pal, *between; int i, j; @@ -2914,7 +2914,7 @@ void Scumm::palManipulate() { _palManipCounter--; } -void Scumm::setupShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor) { +void ScummEngine::setupShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor) { byte *table; int i; byte *curpal; @@ -2940,7 +2940,7 @@ void Scumm::setupShadowPalette(int slot, int redScale, int greenScale, int blueS } } -void Scumm::setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { +void ScummEngine::setupShadowPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { const byte *basepal = getPalettePtr(); const byte *pal = basepal; const byte *compareptr; @@ -3014,7 +3014,7 @@ void Scumm::setupShadowPalette(int redScale, int greenScale, int blueScale, int } /** This function create the specialPalette used for semi-transparency in SamnMax */ -void Scumm::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 greenScale, int16 blueScale, +void ScummEngine::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 greenScale, int16 blueScale, int16 startColor, int16 endColor) { const byte *palPtr, *curPtr; const byte *searchPtr; @@ -3065,7 +3065,7 @@ void Scumm::createSpecialPalette(int16 from, int16 to, int16 redScale, int16 gre } } -void Scumm::darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { +void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int startColor, int endColor) { if (_roomResource == 0) // FIXME - HACK to get COMI demo working return; @@ -3121,7 +3121,7 @@ static int value(int n1, int n2, int hue) { * components of the palette colors. It's used in CMI when Guybrush * walks from the beach towards the swamp. */ -void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor) { +void ScummEngine::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor) { if (startColor <= endColor) { const byte *cptr; @@ -3195,7 +3195,7 @@ void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int st } -int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) { +int ScummEngine::remapPaletteColor(int r, int g, int b, uint threshold) { int i; int ar, ag, ab; uint sum, bestsum, bestitem = 0; @@ -3244,7 +3244,7 @@ int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) { return bestitem; } -void Scumm::swapPalColors(int a, int b) { +void ScummEngine::swapPalColors(int a, int b) { byte *ap, *bp; byte t; @@ -3268,7 +3268,7 @@ void Scumm::swapPalColors(int a, int b) { setDirtyColors(b, b); } -void Scumm::copyPalColor(int dst, int src) { +void ScummEngine::copyPalColor(int dst, int src) { byte *dp, *sp; if ((uint) dst >= 256 || (uint) src >= 256) @@ -3284,14 +3284,14 @@ void Scumm::copyPalColor(int dst, int src) { setDirtyColors(dst, dst); } -void Scumm::setPalColor(int idx, int r, int g, int b) { +void ScummEngine::setPalColor(int idx, int r, int g, int b) { _currentPalette[idx * 3 + 0] = r; _currentPalette[idx * 3 + 1] = g; _currentPalette[idx * 3 + 2] = b; setDirtyColors(idx, idx); } -void Scumm::setPalette(int palindex) { +void ScummEngine::setPalette(int palindex) { const byte *pals; _curPalIndex = palindex; @@ -3299,7 +3299,7 @@ void Scumm::setPalette(int palindex) { setPaletteFromPtr(pals); } -const byte *Scumm::findPalInPals(const byte *pal, int idx) { +const byte *ScummEngine::findPalInPals(const byte *pal, int idx) { const byte *offs; uint32 size; @@ -3319,7 +3319,7 @@ const byte *Scumm::findPalInPals(const byte *pal, int idx) { return offs + READ_LE_UINT32(offs + idx * sizeof(uint32)); } -const byte *Scumm::getPalettePtr() { +const byte *ScummEngine::getPalettePtr() { const byte *cptr; cptr = getResourceAddress(rtRoom, _roomResource); @@ -3333,7 +3333,7 @@ const byte *Scumm::getPalettePtr() { return cptr; } -void Scumm::updatePalette() { +void ScummEngine::updatePalette() { if (_palDirtyMax == -1) return; @@ -3388,7 +3388,7 @@ void Scumm::updatePalette() { #pragma mark --- Cursor --- #pragma mark - -void Scumm::setupCursor() { +void ScummEngine::setupCursor() { _cursor.animate = 1; if (_gameId == GID_TENTACLE && res.roomno[rtRoom][60]) { // HACK: For DOTT we manually set the default cursor. See also bug #786994 @@ -3397,7 +3397,7 @@ void Scumm::setupCursor() { } } -void Scumm::grabCursor(int x, int y, int w, int h) { +void ScummEngine::grabCursor(int x, int y, int w, int h) { VirtScreen *vs = findVirtScreen(y); if (vs == NULL) { @@ -3409,7 +3409,7 @@ void Scumm::grabCursor(int x, int y, int w, int h) { } -void Scumm::grabCursor(byte *ptr, int width, int height) { +void ScummEngine::grabCursor(byte *ptr, int width, int height) { uint size; byte *dst; @@ -3431,7 +3431,7 @@ void Scumm::grabCursor(byte *ptr, int width, int height) { updateCursor(); } -void Scumm::useIm01Cursor(const byte *im, int w, int h) { +void ScummEngine::useIm01Cursor(const byte *im, int w, int h) { VirtScreen *vs = &virtscr[0]; byte *buf, *dst; const byte *src; @@ -3471,14 +3471,14 @@ void Scumm::useIm01Cursor(const byte *im, int w, int h) { free(buf); } -void Scumm::setCursor(int cursor) { +void ScummEngine::setCursor(int cursor) { if (cursor >= 0 && cursor <= 3) _currentCursor = cursor; else warning("setCursor(%d)", cursor); } -void Scumm::setCursorHotspot(int x, int y) { +void ScummEngine::setCursorHotspot(int x, int y) { _cursor.hotspotX = x; _cursor.hotspotY = y; // FIXME this hacks around offset cursor in the humongous games @@ -3488,12 +3488,12 @@ void Scumm::setCursorHotspot(int x, int y) { } } -void Scumm::updateCursor() { +void ScummEngine::updateCursor() { _system->set_mouse_cursor(_grabbedCursor, _cursor.width, _cursor.height, _cursor.hotspotX, _cursor.hotspotY); } -void Scumm::animateCursor() { +void ScummEngine::animateCursor() { if (_cursor.animate) { if (!(_cursor.animateIndex & 0x1)) { decompressDefaultCursor((_cursor.animateIndex >> 1) & 3); @@ -3502,7 +3502,7 @@ void Scumm::animateCursor() { } } -void Scumm::useBompCursor(const byte *im, int width, int height) { +void ScummEngine::useBompCursor(const byte *im, int width, int height) { uint size; width <<= 3; @@ -3527,7 +3527,7 @@ void Scumm::useBompCursor(const byte *im, int width, int height) { updateCursor(); } -void Scumm::decompressDefaultCursor(int idx) { +void ScummEngine::decompressDefaultCursor(int idx) { int i, j; byte color; @@ -3620,7 +3620,7 @@ void Scumm::decompressDefaultCursor(int idx) { updateCursor(); } -void Scumm::makeCursorColorTransparent(int a) { +void ScummEngine::makeCursorColorTransparent(int a) { int i, size; size = _cursor.width * _cursor.height; diff --git a/scumm/gfx.h b/scumm/gfx.h index ebc40fde90..066fc9d183 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -25,7 +25,7 @@ #include "common/rect.h" -class Scumm; +class ScummEngine; enum { /** Camera modes */ CM_NORMAL = 1, @@ -81,7 +81,7 @@ struct BlastObject { /** BlastObjects to draw */ uint16 mode; }; -/** Bomp graphics data, used as parameter to Scumm::drawBomp. */ +/** Bomp graphics data, used as parameter to ScummEngine::drawBomp. */ struct BompDrawData { byte *out; int outwidth, outheight; @@ -107,9 +107,9 @@ struct StripTable { }; class Gdi { - friend class Scumm; // Mostly for the code in saveload.cpp ... + friend class ScummEngine; // Mostly for the code in saveload.cpp ... public: - Scumm *_vm; + ScummEngine *_vm; int _numZBuffer; int _imgBufOffs[8]; diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index facc28ffb7..6b5b78523f 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -1298,7 +1298,7 @@ void *IMuseInternal::loadReference(void *me_ref, byte type, int ref) { } } -int IMuseInternal::save_or_load(Serializer *ser, Scumm *scumm) { +int IMuseInternal::save_or_load(Serializer *ser, ScummEngine *scumm) { const SaveLoadEntry mainEntries[] = { MKLINE(IMuseInternal, _queue_end, sleUint8, VER(8)), MKLINE(IMuseInternal, _queue_pos, sleUint8, VER(8)), @@ -1415,7 +1415,7 @@ void IMuseInternal::fix_parts_after_load() { // Only call this routine from the main thread, // since it uses getResourceAddress -void IMuseInternal::fix_players_after_load(Scumm *scumm) { +void IMuseInternal::fix_players_after_load(ScummEngine *scumm) { Player *player = _players; int i; @@ -1757,7 +1757,7 @@ inline void IMuse::out() const { _system->unlock_mutex(_mutex); } void IMuse::on_timer(MidiDriver *midi) { in(); _target->on_timer(midi); out(); } void IMuse::pause(bool paused) { in(); _target->pause(paused); out(); } -int IMuse::save_or_load(Serializer *ser, Scumm *scumm) { in(); int ret = _target->save_or_load(ser, scumm); out(); return ret; } +int IMuse::save_or_load(Serializer *ser, ScummEngine *scumm) { in(); int ret = _target->save_or_load(ser, scumm); out(); return ret; } int IMuse::set_music_volume(uint vol) { in(); int ret = _target->set_music_volume(vol); out(); return ret; } int IMuse::get_music_volume() { in(); int ret = _target->get_music_volume(); out(); return ret; } void IMuse::setMasterVolume(int vol) { in(); _target->setMasterVolume(vol); out(); } diff --git a/scumm/imuse.h b/scumm/imuse.h index 62012de460..9bb039a3ef 100644 --- a/scumm/imuse.h +++ b/scumm/imuse.h @@ -30,7 +30,7 @@ class IMuseInternal; class MidiDriver; class OSystem; -class Scumm; +class ScummEngine; class Serializer; class SoundMixer; @@ -58,7 +58,7 @@ public: void on_timer(MidiDriver *midi); void pause(bool paused); - int save_or_load(Serializer *ser, Scumm *scumm); + int save_or_load(Serializer *ser, ScummEngine *scumm); int set_music_volume(uint vol); int get_music_volume(); void setMasterVolume(int vol); diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 7fb38a7b92..0ff02e51f9 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -694,7 +694,7 @@ void IMuseDigital::timer_handler(void *refCon) { imuseDigital->musicTimer(); } -IMuseDigital::IMuseDigital(Scumm *scumm) +IMuseDigital::IMuseDigital(ScummEngine *scumm) : _scumm(scumm) { memset(_channel, 0, sizeof(Channel) * MAX_DIGITAL_CHANNELS); for (int l = 0; l < MAX_DIGITAL_CHANNELS; l++) { diff --git a/scumm/imuse_digi.h b/scumm/imuse_digi.h index 21f685f5a6..1892c9b256 100644 --- a/scumm/imuse_digi.h +++ b/scumm/imuse_digi.h @@ -31,7 +31,7 @@ #define MAX_IMUSE_JUMPS 1 #define MAX_IMUSE_REGIONS 3 -class Scumm; +class ScummEngine; class IMuseDigital : public MusicEngine { private: @@ -60,14 +60,14 @@ private: Channel _channel[MAX_DIGITAL_CHANNELS]; - Scumm *_scumm; + ScummEngine *_scumm; bool _pause; static void timer_handler(void *engine); void musicTimer(); public: - IMuseDigital(Scumm *scumm); + IMuseDigital(ScummEngine *scumm); ~IMuseDigital(); void setMasterVolume(int vol) {} diff --git a/scumm/imuse_internal.h b/scumm/imuse_internal.h index 4af03f669e..3ff39541f7 100644 --- a/scumm/imuse_internal.h +++ b/scumm/imuse_internal.h @@ -43,7 +43,7 @@ class IMuseInternal; // Some entities also referenced class MidiParser; -class Scumm; +class ScummEngine; class OSystem; class SoundMixer; @@ -429,7 +429,7 @@ protected: int set_volchan(int sound, int volchan); void fix_parts_after_load(); - void fix_players_after_load(Scumm *scumm); + void fix_players_after_load(ScummEngine *scumm); static int saveReference(void *me_ref, byte type, void *ref); static void *loadReference(void *me_ref, byte type, int ref); @@ -451,7 +451,7 @@ public: void pause(bool paused); int terminate1(); int terminate2(); - int save_or_load(Serializer *ser, Scumm *scumm); + int save_or_load(Serializer *ser, ScummEngine *scumm); int set_music_volume(uint vol); int get_music_volume(); int setMasterVolume(uint vol); diff --git a/scumm/intern.h b/scumm/intern.h index 51c594e336..8725615c7f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -26,9 +26,9 @@ #include "scumm.h" class NutRenderer; // V8 Font Renderer -class Scumm_v5 : public Scumm { +class ScummEngine_v5 : public ScummEngine { protected: - typedef void (Scumm_v5::*OpcodeProcV5)(); + typedef void (ScummEngine_v5::*OpcodeProcV5)(); struct OpcodeEntryV5 { OpcodeProcV5 proc; const char *desc; @@ -37,7 +37,7 @@ protected: const OpcodeEntryV5 *_opcodesV5; public: - Scumm_v5(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) {} + ScummEngine_v5(GameDetector *detector, OSystem *syst) : ScummEngine(detector, syst) {} protected: virtual void setupOpcodes(); @@ -165,9 +165,9 @@ protected: // FIXME - maybe we should move the opcodes from v5 to v3, and change the inheritance // accordingly - that would be more logical I guess. However, if you do so, take care // of preserving the right readIndexFile / loadCharset !!! -class Scumm_v3 : public Scumm_v5 { +class ScummEngine_v3 : public ScummEngine_v5 { public: - Scumm_v3(GameDetector *detector, OSystem *syst) : Scumm_v5(detector, syst) {} + ScummEngine_v3(GameDetector *detector, OSystem *syst) : ScummEngine_v5(detector, syst) {} protected: void readIndexFile(); @@ -177,7 +177,7 @@ protected: void readGlobalObjects(); }; -class Scumm_v2 : public Scumm_v3 { +class ScummEngine_v2 : public ScummEngine_v3 { protected: void readIndexFile(); void readClassicIndexFile(); // V1 @@ -185,7 +185,7 @@ protected: void loadCharset(int no); void readMAXS(); - typedef void (Scumm_v2::*OpcodeProcV2)(); + typedef void (ScummEngine_v2::*OpcodeProcV2)(); struct OpcodeEntryV2 { OpcodeProcV2 proc; const char *desc; @@ -194,7 +194,7 @@ protected: const OpcodeEntryV2 *_opcodesV2; public: - Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} + ScummEngine_v2(GameDetector *detector, OSystem *syst) : ScummEngine_v3(detector, syst) {} protected: virtual void setupOpcodes(); @@ -300,17 +300,17 @@ protected: byte VAR_BACKUP_VERB; }; -class Scumm_v4 : public Scumm_v3 { +class ScummEngine_v4 : public ScummEngine_v3 { public: - Scumm_v4(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} + ScummEngine_v4(GameDetector *detector, OSystem *syst) : ScummEngine_v3(detector, syst) {} protected: void loadCharset(int no); }; -class Scumm_v6 : public Scumm { +class ScummEngine_v6 : public ScummEngine { protected: - typedef void (Scumm_v6::*OpcodeProcV6)(); + typedef void (ScummEngine_v6::*OpcodeProcV6)(); struct OpcodeEntryV6 { OpcodeProcV6 proc; const char *desc; @@ -321,7 +321,7 @@ protected: File _hFileTable[17]; public: - Scumm_v6(GameDetector *detector, OSystem *syst) : Scumm(detector, syst) + ScummEngine_v6(GameDetector *detector, OSystem *syst) : ScummEngine(detector, syst) { VAR_VIDEONAME = 0xFF; @@ -530,9 +530,9 @@ protected: byte VAR_TIMEDATE_SECOND; }; -class Scumm_v7 : public Scumm_v6 { +class ScummEngine_v7 : public ScummEngine_v6 { public: - Scumm_v7(GameDetector *detector, OSystem *syst) : Scumm_v6(detector, syst) {} + ScummEngine_v7(GameDetector *detector, OSystem *syst) : ScummEngine_v6(detector, syst) {} protected: virtual void setupScummVars(); @@ -543,9 +543,9 @@ protected: virtual void panCameraTo(int x, int y); }; -class Scumm_v8 : public Scumm_v7 { +class ScummEngine_v8 : public ScummEngine_v7 { protected: - typedef void (Scumm_v8::*OpcodeProcV8)(); + typedef void (ScummEngine_v8::*OpcodeProcV8)(); struct OpcodeEntryV8 { OpcodeProcV8 proc; const char *desc; @@ -554,7 +554,7 @@ protected: const OpcodeEntryV8 *_opcodesV8; public: - Scumm_v8(GameDetector *detector, OSystem *syst) : Scumm_v7(detector, syst) {} + ScummEngine_v8(GameDetector *detector, OSystem *syst) : ScummEngine_v7(detector, syst) {} protected: virtual void setupOpcodes(); diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index a193e6a0b7..bae21dfbb4 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -24,7 +24,7 @@ #include "bomp.h" -NutRenderer::NutRenderer(Scumm *vm) : +NutRenderer::NutRenderer(ScummEngine *vm) : _vm(vm), _initialized(false), _loaded(false), diff --git a/scumm/nut_renderer.h b/scumm/nut_renderer.h index 175f516ed9..4aa835c842 100644 --- a/scumm/nut_renderer.h +++ b/scumm/nut_renderer.h @@ -23,11 +23,11 @@ #include "common/file.h" -class Scumm; +class ScummEngine; class NutRenderer { protected: - Scumm *_vm; + ScummEngine *_vm; bool _initialized; bool _loaded; int _nbChars; @@ -45,7 +45,7 @@ protected: void draw2byte(byte *dst, byte *mask, int c, int x, int y, byte color); public: - NutRenderer(Scumm *vm); + NutRenderer(ScummEngine *vm); virtual ~NutRenderer(); int getNbChars() { return _nbChars; } diff --git a/scumm/object.cpp b/scumm/object.cpp index 5e1c5b737e..359df5abe5 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -50,7 +50,7 @@ struct BompHeader { /* Bomp header */ #endif -bool Scumm::getClass(int obj, int cls) const { +bool ScummEngine::getClass(int obj, int cls) const { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getClass"); cls &= 0x7F; checkRange(32, 1, cls, "Class %d out of range in getClass"); @@ -77,7 +77,7 @@ bool Scumm::getClass(int obj, int cls) const { return (_classData[obj] & (1 << (cls - 1))) != 0; } -void Scumm::putClass(int obj, int cls, bool set) { +void ScummEngine::putClass(int obj, int cls, bool set) { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putClass"); cls &= 0x7F; checkRange(32, 1, cls, "Class %d out of range in putClass"); @@ -111,12 +111,12 @@ void Scumm::putClass(int obj, int cls, bool set) { } } -int Scumm::getOwner(int obj) const { +int ScummEngine::getOwner(int obj) const { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getOwner"); return _objectOwnerTable[obj]; } -void Scumm::putOwner(int obj, int owner) { +void ScummEngine::putOwner(int obj, int owner) { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putOwner"); checkRange(0xFF, 0, owner, "Owner %d out of range in putOwner"); _objectOwnerTable[obj] = owner; @@ -126,7 +126,7 @@ void Scumm::putOwner(int obj, int owner) { #define BYPASS_COPY_PROT #endif -int Scumm::getState(int obj) { +int ScummEngine::getState(int obj) { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getState"); #if defined(BYPASS_COPY_PROT) @@ -146,18 +146,18 @@ int Scumm::getState(int obj) { return _objectStateTable[obj]; } -void Scumm::putState(int obj, int state) { +void ScummEngine::putState(int obj, int state) { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in putState"); checkRange(0xFF, 0, state, "State %d out of range in putState"); _objectStateTable[obj] = state; } -int Scumm::getObjectRoom(int obj) const { +int ScummEngine::getObjectRoom(int obj) const { checkRange(_numGlobalObjects - 1, 0, obj, "Object %d out of range in getObjectRoom"); return _objectRoomTable[obj]; } -int Scumm::getObjectIndex(int object) const { +int ScummEngine::getObjectIndex(int object) const { int i; if (object < 1) @@ -170,7 +170,7 @@ int Scumm::getObjectIndex(int object) const { return -1; } -int Scumm::whereIsObject(int object) const { +int ScummEngine::whereIsObject(int object) const { int i; if (object >= _numGlobalObjects) @@ -196,7 +196,7 @@ int Scumm::whereIsObject(int object) const { return WIO_NOT_FOUND; } -int Scumm::getObjectOrActorXY(int object, int &x, int &y) { +int ScummEngine::getObjectOrActorXY(int object, int &x, int &y) { if (object < _numActors) { Actor *act = derefActorSafe(object, "getObjectOrActorXY"); if (act) @@ -222,7 +222,7 @@ int Scumm::getObjectOrActorXY(int object, int &x, int &y) { * Return the position of an object. * Returns X, Y and direction in angles */ -void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) { +void ScummEngine::getObjectXYPos(int object, int &x, int &y, int &dir) { int idx = getObjectIndex(object); assert(idx >= 0); ObjectData &od = _objs[idx]; @@ -271,7 +271,7 @@ static int getDist(int x, int y, int x2, int y2) { return MAX(a, b); } -int Scumm::getObjActToObjActDist(int a, int b) { +int ScummEngine::getObjActToObjActDist(int a, int b) { int x, y, x2, y2, dist; Actor *acta = NULL; Actor *actb = NULL; @@ -312,7 +312,7 @@ int Scumm::getObjActToObjActDist(int a, int b) { return dist; } -int Scumm::findObject(int x, int y) { +int ScummEngine::findObject(int x, int y) { int i, b; byte a; const int mask = (_version <= 2) ? 0x8 : 0xF; @@ -337,7 +337,7 @@ int Scumm::findObject(int x, int y) { return 0; } -void Scumm::drawRoomObject(int i, int arg) { +void ScummEngine::drawRoomObject(int i, int arg) { ObjectData *od; byte a; const int mask = (_version <= 2) ? 0x8 : 0xF; @@ -356,7 +356,7 @@ void Scumm::drawRoomObject(int i, int arg) { } while ((od->state & mask) == a); } -void Scumm::drawRoomObjects(int arg) { +void ScummEngine::drawRoomObjects(int arg) { int i; const int mask = (_version <= 2) ? 0x8 : 0xF; @@ -391,7 +391,7 @@ static const uint32 IMxx_tags[] = { MKID('IM0F') }; -void Scumm::drawObject(int obj, int arg) { +void ScummEngine::drawObject(int obj, int arg) { ObjectData &od = _objs[obj]; int xpos, ypos, height, width; const byte *ptr; @@ -455,7 +455,7 @@ void Scumm::drawObject(int obj, int arg) { } } -void Scumm::clearRoomObjects() { +void ScummEngine::clearRoomObjects() { int i; if (_features & GF_SMALL_HEADER) { @@ -483,7 +483,7 @@ void Scumm::clearRoomObjects() { } } -void Scumm::loadRoomObjects() { +void ScummEngine::loadRoomObjects() { int i, j; ObjectData *od; const byte *ptr; @@ -575,7 +575,7 @@ void Scumm::loadRoomObjects() { CHECK_HEAP } -void Scumm::loadRoomObjectsOldBundle() { +void ScummEngine::loadRoomObjectsOldBundle() { int i; ObjectData *od; const byte *room, *ptr; @@ -615,7 +615,7 @@ void Scumm::loadRoomObjectsOldBundle() { CHECK_HEAP } -void Scumm::loadRoomObjectsSmall() { +void ScummEngine::loadRoomObjectsSmall() { int i, j; ObjectData *od; const byte *ptr; @@ -675,7 +675,7 @@ void Scumm::loadRoomObjectsSmall() { CHECK_HEAP } -void Scumm::setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr) { +void ScummEngine::setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr) { const CodeHeader *cdhd = NULL; const ImageHeader *imhd = NULL; @@ -789,7 +789,7 @@ void Scumm::setupRoomObject(ObjectData *od, const byte *room, const byte *search od->fl_object_index = 0; } -void Scumm::fixObjectFlags() { +void ScummEngine::fixObjectFlags() { int i; ObjectData *od = &_objs[1]; for (i = 1; i < _numLocalObjects; i++, od++) { @@ -798,7 +798,7 @@ void Scumm::fixObjectFlags() { } } -void Scumm::processDrawQue() { +void ScummEngine::processDrawQue() { int i, j; for (i = 0; i < _drawObjectQueNr; i++) { j = _drawObjectQue[i]; @@ -808,7 +808,7 @@ void Scumm::processDrawQue() { _drawObjectQueNr = 0; } -void Scumm::clearOwnerOf(int obj) { +void ScummEngine::clearOwnerOf(int obj) { int i, j; uint16 *a; @@ -849,7 +849,7 @@ void Scumm::clearOwnerOf(int obj) { } } -void Scumm::removeObjectFromRoom(int obj) { +void ScummEngine::removeObjectFromRoom(int obj) { int i, j, strip; for (i = 1; i < _numLocalObjects; i++) { @@ -873,17 +873,17 @@ void Scumm::removeObjectFromRoom(int obj) { } } -void Scumm::addObjectToDrawQue(int object) { +void ScummEngine::addObjectToDrawQue(int object) { _drawObjectQue[_drawObjectQueNr++] = object; if ((unsigned int)_drawObjectQueNr > ARRAYSIZE(_drawObjectQue)) error("Draw Object Que overflow"); } -void Scumm::clearDrawObjectQueue() { +void ScummEngine::clearDrawObjectQueue() { _drawObjectQueNr = 0; } -const byte *Scumm::getObjOrActorName(int obj) { +const byte *ScummEngine::getObjOrActorName(int obj) { byte *objptr; int i; @@ -920,7 +920,7 @@ const byte *Scumm::getObjOrActorName(int obj) { return findResourceData(MKID('OBNA'), objptr); } -uint32 Scumm::getOBCDOffs(int object) const { +uint32 ScummEngine::getOBCDOffs(int object) const { int i; if (_objectOwnerTable[object] != OF_OWNER_ROOM) @@ -935,7 +935,7 @@ uint32 Scumm::getOBCDOffs(int object) const { return 0; } -byte *Scumm::getOBCDFromObject(int obj) { +byte *ScummEngine::getOBCDFromObject(int obj) { int i; byte *ptr; @@ -962,7 +962,7 @@ byte *Scumm::getOBCDFromObject(int obj) { return 0; } -const byte *Scumm::getOBIMFromObject(const ObjectData &od) { +const byte *ScummEngine::getOBIMFromObject(const ObjectData &od) { const byte *ptr; if (od.fl_object_index) { @@ -976,7 +976,7 @@ const byte *Scumm::getOBIMFromObject(const ObjectData &od) { return ptr; } -const byte *Scumm::getObjectImage(const byte *ptr, int state) { +const byte *ScummEngine::getObjectImage(const byte *ptr, int state) { assert(ptr); if (_features & GF_OLD_BUNDLE) ptr += 0; @@ -1007,7 +1007,7 @@ const byte *Scumm::getObjectImage(const byte *ptr, int state) { return ptr; } -void Scumm::addObjectToInventory(uint obj, uint room) { +void ScummEngine::addObjectToInventory(uint obj, uint room) { int idx, slot; uint32 size; const byte *ptr; @@ -1042,7 +1042,7 @@ void Scumm::addObjectToInventory(uint obj, uint room) { CHECK_HEAP } -void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) { +void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint room) { const CodeHeader *cdhd; int i, numobj; @@ -1177,7 +1177,7 @@ void Scumm::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id, uint } } -int Scumm::getInventorySlot() { +int ScummEngine::getInventorySlot() { int i; for (i = 1; i <= _maxInventoryItems; i++) { if (_inventory[i] == 0) @@ -1187,7 +1187,7 @@ int Scumm::getInventorySlot() { return -1; } -void Scumm::SamInventoryHack(int obj) { +void ScummEngine::SamInventoryHack(int obj) { // FIXME: Sam and Max hack int base = 6; @@ -1204,7 +1204,7 @@ void Scumm::SamInventoryHack(int obj) { } } -void Scumm::setOwnerOf(int obj, int owner) { +void ScummEngine::setOwnerOf(int obj, int owner) { ScriptSlot *ss; if (owner == 0) { clearOwnerOf(obj); @@ -1223,7 +1223,7 @@ void Scumm::setOwnerOf(int obj, int owner) { runInventoryScript(0); } -int Scumm::getObjX(int obj) { +int ScummEngine::getObjX(int obj) { if (obj < _numActors) { if (obj < 1) return 0; /* fix for indy4's map */ @@ -1237,7 +1237,7 @@ int Scumm::getObjX(int obj) { } } -int Scumm::getObjY(int obj) { +int ScummEngine::getObjY(int obj) { if (obj < _numActors) { if (obj < 1) return 0; /* fix for indy4's map */ @@ -1251,11 +1251,11 @@ int Scumm::getObjY(int obj) { } } -int Scumm::getObjOldDir(int obj) { +int ScummEngine::getObjOldDir(int obj) { return newDirToOldDir(getObjNewDir(obj)); } -int Scumm::getObjNewDir(int obj) { +int ScummEngine::getObjNewDir(int obj) { int dir; if (obj < _numActors) { dir = derefActor(obj, "getObjNewDir")->getFacing(); @@ -1266,7 +1266,7 @@ int Scumm::getObjNewDir(int obj) { return dir; } -int Scumm::findInventory(int owner, int idx) { +int ScummEngine::findInventory(int owner, int idx) { int count = 1, i, obj; for (i = 0; i != _maxInventoryItems; i++) { obj = _inventory[i]; @@ -1276,7 +1276,7 @@ int Scumm::findInventory(int owner, int idx) { return 0; } -int Scumm::getInventoryCount(int owner) { +int ScummEngine::getInventoryCount(int owner) { int i, obj; int count = 0; for (i = 0; i != _maxInventoryItems; i++) { @@ -1287,7 +1287,7 @@ int Scumm::getInventoryCount(int owner) { return count; } -void Scumm::setObjectState(int obj, int state, int x, int y) { +void ScummEngine::setObjectState(int obj, int state, int x, int y) { int i; i = getObjectIndex(obj); @@ -1305,7 +1305,7 @@ void Scumm::setObjectState(int obj, int state, int x, int y) { putState(obj, state); } -int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f) { +int ScummEngine::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, int f) { int i, j; int x, y; int x2, y2; @@ -1335,7 +1335,7 @@ int Scumm::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2, int e, return getDist(x, y, x2, y2) * 0xFF / ((i + j) >> 1); } -void Scumm::setCursorImg(uint img, uint room, uint imgindex) { +void ScummEngine::setCursorImg(uint img, uint room, uint imgindex) { int w, h; const byte *dataptr, *bomp; uint32 size; @@ -1382,7 +1382,7 @@ void Scumm::setCursorImg(uint img, uint room, uint imgindex) { } -void Scumm::nukeFlObjects(int min, int max) { +void ScummEngine::nukeFlObjects(int min, int max) { ObjectData *od; int i; @@ -1396,7 +1396,7 @@ void Scumm::nukeFlObjects(int min, int max) { } } -void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, +void ScummEngine::enqueueObject(int objectNumber, int objectX, int objectY, int objectWidth, int objectHeight, int scaleX, int scaleY, int image, int mode) { BlastObject *eo; ObjectData *od; @@ -1433,7 +1433,7 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object eo->mode = mode; } -void Scumm::drawBlastObjects() { +void ScummEngine::drawBlastObjects() { BlastObject *eo; int i; @@ -1443,7 +1443,7 @@ void Scumm::drawBlastObjects() { } } -void Scumm::drawBlastObject(BlastObject *eo) { +void ScummEngine::drawBlastObject(BlastObject *eo) { VirtScreen *vs; const byte *bomp, *ptr; int objnum; @@ -1517,7 +1517,7 @@ void Scumm::drawBlastObject(BlastObject *eo) { updateDirtyRect(vs->number, bdd.x, bdd.x + bdd.srcwidth, bdd.y, bdd.y + bdd.srcheight, 0); } -void Scumm::removeBlastObjects() { +void ScummEngine::removeBlastObjects() { BlastObject *eo; int i; @@ -1529,7 +1529,7 @@ void Scumm::removeBlastObjects() { clearEnqueue(); } -void Scumm::removeBlastObject(BlastObject *eo) { +void ScummEngine::removeBlastObject(BlastObject *eo) { VirtScreen *vs = &virtscr[0]; int top, bottom, left, right; @@ -1571,7 +1571,7 @@ void Scumm::removeBlastObject(BlastObject *eo) { updateDirtyRect(0, left, right, top, bottom, USAGE_BIT_RESTORED); } -int Scumm::findLocalObjectSlot() { +int ScummEngine::findLocalObjectSlot() { int i; for (i = 1; i < _numLocalObjects; i++) { @@ -1582,7 +1582,7 @@ int Scumm::findLocalObjectSlot() { return -1; } -int Scumm::findFlObjectSlot() { +int ScummEngine::findFlObjectSlot() { int i; for (i = 1; i < _maxFLObject; i++) { if (_baseFLObject[i] == NULL) @@ -1592,7 +1592,7 @@ int Scumm::findFlObjectSlot() { return -1; } -void Scumm::loadFlObject(uint object, uint room) { +void ScummEngine::loadFlObject(uint object, uint room) { FindObjectInRoom foir; int slot, objslot; ObjectData *od; diff --git a/scumm/player_mod.cpp b/scumm/player_mod.cpp index c541ab19d1..d0928a54ed 100644 --- a/scumm/player_mod.cpp +++ b/scumm/player_mod.cpp @@ -28,7 +28,7 @@ // //////////////////////////////////////// -Player_MOD::Player_MOD(Scumm *scumm) { +Player_MOD::Player_MOD(ScummEngine *scumm) { int i; _mixer = scumm->_mixer; _samplerate = scumm->_system->property(OSystem::PROP_GET_SAMPLE_RATE, 0); diff --git a/scumm/player_mod.h b/scumm/player_mod.h index ffb1aab5a7..d815d9cfc4 100644 --- a/scumm/player_mod.h +++ b/scumm/player_mod.h @@ -32,7 +32,7 @@ class Player_MOD { public: - Player_MOD(Scumm *scumm); + Player_MOD(ScummEngine *scumm); virtual ~Player_MOD(); virtual void setMasterVolume(int vol); diff --git a/scumm/player_v1.cpp b/scumm/player_v1.cpp index 549742aab3..95e2fc48af 100644 --- a/scumm/player_v1.cpp +++ b/scumm/player_v1.cpp @@ -35,7 +35,7 @@ //////////////////////////////////////// -Player_V1::Player_V1(Scumm *scumm) : Player_V2(scumm) { +Player_V1::Player_V1(ScummEngine *scumm) : Player_V2(scumm) { // Initialize channel code for (int i = 0; i < 4; ++i) clear_channel(i); diff --git a/scumm/player_v1.h b/scumm/player_v1.h index 2bab13a217..27d23aafbf 100644 --- a/scumm/player_v1.h +++ b/scumm/player_v1.h @@ -44,7 +44,7 @@ struct channel_data_v1 { class Player_V1 : public Player_V2 { public: - Player_V1(Scumm *scumm); + Player_V1(ScummEngine *scumm); ~Player_V1(); void startSound(int nr); diff --git a/scumm/player_v2.cpp b/scumm/player_v2.cpp index 4bb7373053..929cce1468 100644 --- a/scumm/player_v2.cpp +++ b/scumm/player_v2.cpp @@ -345,7 +345,7 @@ static const uint16 pcjr_freq_table[12] = { //////////////////////////////////////// -Player_V2::Player_V2(Scumm *scumm) { +Player_V2::Player_V2(ScummEngine *scumm) { int i; // This simulates the pc speaker sound, which is driven diff --git a/scumm/player_v2.h b/scumm/player_v2.h index 55b054608d..c3608b5e1c 100644 --- a/scumm/player_v2.h +++ b/scumm/player_v2.h @@ -67,13 +67,13 @@ union ChannelInfo { }; -class Scumm; +class ScummEngine; class SoundMixer; class Player_V2 : public MusicEngine { public: - Player_V2(Scumm *scumm); + Player_V2(ScummEngine *scumm); virtual ~Player_V2(); virtual void setMasterVolume(int vol); @@ -88,7 +88,7 @@ protected: bool _isV3Game; SoundMixer *_mixer; OSystem *_system; - Scumm *_scumm; + ScummEngine *_scumm; bool _pcjr; int _header_len; diff --git a/scumm/player_v2a.cpp b/scumm/player_v2a.cpp index b1ac814886..37c1b4f817 100644 --- a/scumm/player_v2a.cpp +++ b/scumm/player_v2a.cpp @@ -1111,7 +1111,7 @@ static V2A_Sound *findSound (unsigned long crc) { return NULL; } -Player_V2A::Player_V2A(Scumm *scumm) { +Player_V2A::Player_V2A(ScummEngine *scumm) { int i; _scumm = scumm; _system = scumm->_system; diff --git a/scumm/player_v2a.h b/scumm/player_v2a.h index 128899683b..fb18d5cd54 100644 --- a/scumm/player_v2a.h +++ b/scumm/player_v2a.h @@ -30,14 +30,14 @@ #define V2A_MAXSLOTS 8 -class Scumm; +class ScummEngine; class SoundMixer; class V2A_Sound; class Player_V2A : public MusicEngine { public: - Player_V2A(Scumm *scumm); + Player_V2A(ScummEngine *scumm); virtual ~Player_V2A(); virtual void setMasterVolume(int vol); @@ -49,7 +49,7 @@ public: private: OSystem *_system; - Scumm *_scumm; + ScummEngine *_scumm; Player_MOD *_mod; struct soundSlot diff --git a/scumm/player_v3a.cpp b/scumm/player_v3a.cpp index bebc98cf6b..3c7d6766a9 100644 --- a/scumm/player_v3a.cpp +++ b/scumm/player_v3a.cpp @@ -38,7 +38,7 @@ static const uint16 note_freqs[4][12] = { // //////////////////////////////////////// -Player_V3A::Player_V3A(Scumm *scumm) { +Player_V3A::Player_V3A(ScummEngine *scumm) { int i; _scumm = scumm; _system = scumm->_system; diff --git a/scumm/player_v3a.h b/scumm/player_v3a.h index 020036a2c0..874057bb9c 100644 --- a/scumm/player_v3a.h +++ b/scumm/player_v3a.h @@ -31,12 +31,12 @@ #define V3A_MAXMUS 8 #define V3A_MAXSFX 8 -class Scumm; +class ScummEngine; class SoundMixer; class Player_V3A : public MusicEngine { public: - Player_V3A(Scumm *scumm); + Player_V3A(ScummEngine *scumm); virtual ~Player_V3A(); virtual void setMasterVolume(int vol); @@ -48,7 +48,7 @@ public: private: OSystem *_system; - Scumm *_scumm; + ScummEngine *_scumm; Player_MOD *_mod; struct musChan diff --git a/scumm/resource.cpp b/scumm/resource.cpp index ca7155ad7b..acaff01404 100644 --- a/scumm/resource.cpp +++ b/scumm/resource.cpp @@ -38,7 +38,7 @@ static uint16 newTag2Old(uint32 oldTag); static const char *resTypeFromId(int id); /* Open a room */ -void Scumm::openRoom(int room) { +void ScummEngine::openRoom(int room) { int room_offs, roomlimit; bool result; char buf[128]; @@ -147,7 +147,7 @@ void Scumm::openRoom(int room) { _fileOffset = 0; // start of file } -void Scumm::closeRoom() { +void ScummEngine::closeRoom() { if (_lastLoadedRoom != -1) { _lastLoadedRoom = -1; deleteRoomOffsets(); @@ -156,7 +156,7 @@ void Scumm::closeRoom() { } /** Delete the currently loaded room offsets. */ -void Scumm::deleteRoomOffsets() { +void ScummEngine::deleteRoomOffsets() { if (!(_features & GF_SMALL_HEADER) && !_dynamicRoomOffsets) return; @@ -167,7 +167,7 @@ void Scumm::deleteRoomOffsets() { } /** Read room offsets */ -void Scumm::readRoomsOffsets() { +void ScummEngine::readRoomsOffsets() { int num, room, i; byte *ptr; @@ -207,7 +207,7 @@ void Scumm::readRoomsOffsets() { } } -bool Scumm::openResourceFile(const char *filename, byte encByte) { +bool ScummEngine::openResourceFile(const char *filename, byte encByte) { debug(9, "openResourceFile(%s)", filename); if (_fileHandle.isOpen()) { @@ -219,7 +219,7 @@ bool Scumm::openResourceFile(const char *filename, byte encByte) { return _fileHandle.isOpen(); } -void Scumm::askForDisk(const char *filename, int disknum) { +void ScummEngine::askForDisk(const char *filename, int disknum) { char buf[128]; if (_version == 8) { @@ -245,7 +245,7 @@ void Scumm::askForDisk(const char *filename, int disknum) { } } -void Scumm::readIndexFile() { +void ScummEngine::readIndexFile() { uint32 blocktype, itemsize; int numblock = 0; int num, i; @@ -439,7 +439,7 @@ void Scumm::readIndexFile() { closeRoom(); } -void Scumm::readArrayFromIndexFile() { +void ScummEngine::readArrayFromIndexFile() { int num; int a, b, c; @@ -472,7 +472,7 @@ void Scumm::readArrayFromIndexFile() { } } -void Scumm::readResTypeList(int id, uint32 tag, const char *name) { +void ScummEngine::readResTypeList(int id, uint32 tag, const char *name) { int num; int i; @@ -528,7 +528,7 @@ void Scumm::readResTypeList(int id, uint32 tag, const char *name) { } } -void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, int mode) { +void ScummEngine::allocResTypeData(int id, uint32 tag, int num, const char *name, int mode) { debug(9, "allocResTypeData(%s/%s,%x,%d,%d)", resTypeFromId(id), name, FROM_LE_32(tag), num, mode); assert(id >= 0 && id < (int)(ARRAYSIZE(res.mode))); @@ -549,7 +549,7 @@ void Scumm::allocResTypeData(int id, uint32 tag, int num, const char *name, int } } -void Scumm::loadCharset(int no) { +void ScummEngine::loadCharset(int no) { int i; byte *ptr; @@ -572,12 +572,12 @@ void Scumm::loadCharset(int no) { } } -void Scumm::nukeCharset(int i) { +void ScummEngine::nukeCharset(int i) { checkRange(_maxCharsets - 1, 1, i, "Nuking illegal charset %d"); nukeResource(rtCharset, i); } -void Scumm::ensureResourceLoaded(int type, int i) { +void ScummEngine::ensureResourceLoaded(int type, int i) { void *addr = NULL; debug(9, "ensureResourceLoaded(%s,%d)", resTypeFromId(type), i); @@ -613,7 +613,7 @@ void Scumm::ensureResourceLoaded(int type, int i) { VAR(VAR_ROOM_FLAG) = 1; } -int Scumm::loadResource(int type, int idx) { +int ScummEngine::loadResource(int type, int idx) { int roomNr; uint32 fileOffs; uint32 size, tag; @@ -696,7 +696,7 @@ int Scumm::loadResource(int type, int idx) { error("Cannot read resource"); } -int Scumm::readSoundResource(int type, int idx) { +int ScummEngine::readSoundResource(int type, int idx) { uint32 pos, total_size, size, tag, basetag, max_total_size; int pri, best_pri; uint32 best_size = 0, best_offs = 0; @@ -911,7 +911,7 @@ static const uint16 num_steps_table[] = { 240, 276, 340, 460, 600, 860, 1200, 1600 }; -int Scumm::convert_extraflags(byte * ptr, byte * src_ptr) { +int ScummEngine::convert_extraflags(byte * ptr, byte * src_ptr) { int flags = src_ptr[0]; int t1, t2, t3, t4, time; @@ -1039,7 +1039,7 @@ static inline byte Mac0ToGMInstrument(uint32 type) { } } -void Scumm::convertMac0Resource(int type, int idx, byte *src_ptr, int size) { +void ScummEngine::convertMac0Resource(int type, int idx, byte *src_ptr, int size) { /* From Markus Magnuson (superqult) we got this information: Mac0 @@ -1176,7 +1176,7 @@ void Scumm::convertMac0Resource(int type, int idx, byte *src_ptr, int size) { #endif } -void Scumm::convertADResource(int type, int idx, byte *src_ptr, int size) { +void ScummEngine::convertADResource(int type, int idx, byte *src_ptr, int size) { // We will ignore the PPQN in the original resource, because // it's invalid anyway. We use a constant PPQN of 480. @@ -1565,7 +1565,7 @@ void Scumm::convertADResource(int type, int idx, byte *src_ptr, int size) { } -int Scumm::readSoundResourceSmallHeader(int type, int idx) { +int ScummEngine::readSoundResourceSmallHeader(int type, int idx) { uint32 pos, total_size, size, tag; uint32 ad_size = 0, ad_offs = 0; uint32 ro_size = 0, ro_offs = 0; @@ -1683,20 +1683,20 @@ int Scumm::readSoundResourceSmallHeader(int type, int idx) { } -int Scumm::getResourceRoomNr(int type, int idx) { +int ScummEngine::getResourceRoomNr(int type, int idx) { if (type == rtRoom) return idx; return res.roomno[type][idx]; } -int Scumm::getResourceSize(int type, int idx) { +int ScummEngine::getResourceSize(int type, int idx) { byte *ptr = getResourceAddress(type, idx); MemBlkHeader *hdr = (MemBlkHeader *)(ptr - sizeof(MemBlkHeader)); return hdr->size; } -byte *Scumm::getResourceAddress(int type, int idx) { +byte *ScummEngine::getResourceAddress(int type, int idx) { byte *ptr; CHECK_HEAP @@ -1723,7 +1723,7 @@ byte *Scumm::getResourceAddress(int type, int idx) { return ptr + sizeof(MemBlkHeader); } -byte *Scumm::getStringAddress(int i) { +byte *ScummEngine::getStringAddress(int i) { byte *b = getResourceAddress(rtString, i); if (!b) return NULL; @@ -1733,7 +1733,7 @@ byte *Scumm::getStringAddress(int i) { return b; } -byte *Scumm::getStringAddressVar(int i) { +byte *ScummEngine::getStringAddressVar(int i) { byte *addr; addr = getResourceAddress(rtString, _scummVars[i]); @@ -1749,7 +1749,7 @@ byte *Scumm::getStringAddressVar(int i) { return (addr); } -void Scumm::setResourceCounter(int type, int idx, byte flag) { +void ScummEngine::setResourceCounter(int type, int idx, byte flag) { res.flags[type][idx] &= ~RF_USAGE; res.flags[type][idx] |= flag; } @@ -1757,7 +1757,7 @@ void Scumm::setResourceCounter(int type, int idx, byte flag) { /* 2 bytes safety area to make "precaching" of bytes in the gdi drawer easier */ #define SAFETY_AREA 2 -byte *Scumm::createResource(int type, int idx, uint32 size) { +byte *ScummEngine::createResource(int type, int idx, uint32 size) { byte *ptr; CHECK_HEAP @@ -1783,7 +1783,7 @@ byte *Scumm::createResource(int type, int idx, uint32 size) { return ptr + sizeof(MemBlkHeader); /* skip header */ } -bool Scumm::validateResource(const char *str, int type, int idx) const { +bool ScummEngine::validateResource(const char *str, int type, int idx) const { if (type < rtFirst || type > rtLast || (uint) idx >= (uint) res.num[type]) { warning("%s Illegal Glob type %s (%d) num %d", str, resTypeFromId(type), type, idx); return false; @@ -1791,7 +1791,7 @@ bool Scumm::validateResource(const char *str, int type, int idx) const { return true; } -void Scumm::nukeResource(int type, int idx) { +void ScummEngine::nukeResource(int type, int idx) { byte *ptr; CHECK_HEAP @@ -1816,7 +1816,7 @@ void Scumm::nukeResource(int type, int idx) { } } -const byte *Scumm::findResourceData(uint32 tag, const byte *ptr) { +const byte *ScummEngine::findResourceData(uint32 tag, const byte *ptr) { if (_features & GF_OLD_BUNDLE) error("findResourceData must not be used in GF_OLD_BUNDLE games"); else if (_features & GF_SMALL_HEADER) @@ -1829,7 +1829,7 @@ const byte *Scumm::findResourceData(uint32 tag, const byte *ptr) { return ptr + _resourceHeaderSize; } -int Scumm::getResourceDataSize(const byte *ptr) const { +int ScummEngine::getResourceDataSize(const byte *ptr) const { if (ptr == NULL) return 0; @@ -1841,7 +1841,7 @@ int Scumm::getResourceDataSize(const byte *ptr) const { return READ_BE_UINT32(ptr - 4) - 8; } -void Scumm::lock(int type, int i) { +void ScummEngine::lock(int type, int i) { if (!validateResource("Locking", type, i)) return; res.flags[type][i] |= RF_LOCK; @@ -1849,7 +1849,7 @@ void Scumm::lock(int type, int i) { // debug(1, "locking %d,%d", type, i); } -void Scumm::unlock(int type, int i) { +void ScummEngine::unlock(int type, int i) { if (!validateResource("Unlocking", type, i)) return; res.flags[type][i] &= ~RF_LOCK; @@ -1857,7 +1857,7 @@ void Scumm::unlock(int type, int i) { // debug(1, "unlocking %d,%d", type, i); } -bool Scumm::isResourceInUse(int type, int i) const { +bool ScummEngine::isResourceInUse(int type, int i) const { if (!validateResource("isResourceInUse", type, i)) return false; switch (type) { @@ -1876,7 +1876,7 @@ bool Scumm::isResourceInUse(int type, int i) const { } } -void Scumm::increaseResourceCounter() { +void ScummEngine::increaseResourceCounter() { int i, j; byte counter; @@ -1890,7 +1890,7 @@ void Scumm::increaseResourceCounter() { } } -void Scumm::expireResources(uint32 size) { +void ScummEngine::expireResources(uint32 size) { int i, j; byte flag; byte best_counter; @@ -1935,7 +1935,7 @@ void Scumm::expireResources(uint32 size) { debug(5, "Expired resources, mem %d -> %d", oldAllocatedSize, _allocatedSize); } -void Scumm::freeResources() { +void ScummEngine::freeResources() { int i, j; for (i = rtFirst; i <= rtLast; i++) { for (j = res.num[i]; --j >= 0;) { @@ -1949,7 +1949,7 @@ void Scumm::freeResources() { } } -void Scumm::loadPtrToResource(int type, int resindex, const byte *source) { +void ScummEngine::loadPtrToResource(int type, int resindex, const byte *source) { byte *alloced; int i, len; @@ -1972,13 +1972,13 @@ void Scumm::loadPtrToResource(int type, int resindex, const byte *source) { } } -bool Scumm::isResourceLoaded(int type, int idx) const { +bool ScummEngine::isResourceLoaded(int type, int idx) const { if (!validateResource("isLoaded", type, idx)) return false; return res.address[type][idx] != NULL; } -void Scumm::resourceStats() { +void ScummEngine::resourceStats() { int i, j; uint32 lockedSize = 0, lockedNum = 0; byte flag; @@ -1995,7 +1995,7 @@ void Scumm::resourceStats() { debug(1, "Total allocated size=%d, locked=%d(%d)", _allocatedSize, lockedSize, lockedNum); } -void Scumm::readMAXS() { +void ScummEngine::readMAXS() { if (_version == 8) { // CMI _fileHandle.seek(50 + 50, SEEK_CUR); // 176 - 8 _numVariables = _fileHandle.readUint32LE(); // 1500 @@ -2115,7 +2115,7 @@ void Scumm::readMAXS() { _dynamicRoomOffsets = true; } -void Scumm::allocateArrays() { +void ScummEngine::allocateArrays() { // Note: Buffers are now allocated in scummMain to allow for // early GUI init. @@ -2150,14 +2150,14 @@ void Scumm::allocateArrays() { } -bool Scumm::isGlobInMemory(int type, int idx) const{ +bool ScummEngine::isGlobInMemory(int type, int idx) const{ if (!validateResource("isGlobInMemory", type, idx)) return false; return res.address[type][idx] != NULL; } -void Scumm::dumpResource(const char *tag, int idx, const byte *ptr, int length) { +void ScummEngine::dumpResource(const char *tag, int idx, const byte *ptr, int length) { char buf[256]; File out; diff --git a/scumm/resource_v2.cpp b/scumm/resource_v2.cpp index 7738fc39e8..2e4d3f2884 100644 --- a/scumm/resource_v2.cpp +++ b/scumm/resource_v2.cpp @@ -27,7 +27,7 @@ #include "resource.h" #include "sound/mididrv.h" -void Scumm_v2::readClassicIndexFile() { +void ScummEngine_v2::readClassicIndexFile() { int i; if (_gameId == GID_MANIAC) { @@ -104,7 +104,7 @@ void Scumm_v2::readClassicIndexFile() { } } -void Scumm_v2::readEnhancedIndexFile() { +void ScummEngine_v2::readEnhancedIndexFile() { if (!(_features & GF_AMIGA)) _musicEngine = _playerV2 = new Player_V2(this); @@ -143,7 +143,7 @@ void Scumm_v2::readEnhancedIndexFile() { readResTypeList(rtSound, MKID('SOUN'), "sound"); } -void Scumm_v2::readIndexFile() { +void ScummEngine_v2::readIndexFile() { int magic = 0; debug(9, "readIndexFile()"); @@ -177,7 +177,7 @@ void Scumm_v2::readIndexFile() { closeRoom(); } -void Scumm_v2::readMAXS() { +void ScummEngine_v2::readMAXS() { // FIXME - I'm not sure for those values yet, they will have to be rechecked _numVariables = 800; // 800 @@ -199,6 +199,6 @@ void Scumm_v2::readMAXS() { allocateArrays(); } -void Scumm_v2::loadCharset(int num) { +void ScummEngine_v2::loadCharset(int num) { // Stub, V2 font resources are hardcoded into the engine. } diff --git a/scumm/resource_v3.cpp b/scumm/resource_v3.cpp index bb1c5ccd21..1404845885 100644 --- a/scumm/resource_v3.cpp +++ b/scumm/resource_v3.cpp @@ -26,7 +26,7 @@ #include "resource.h" -void Scumm_v3::readIndexFile() { +void ScummEngine_v3::readIndexFile() { if (_features & GF_OLD_BUNDLE) { int magic = 0; debug(9, "readIndexFile()"); @@ -163,7 +163,7 @@ void Scumm_v3::readIndexFile() { } } -void Scumm_v3::loadCharset(int no) { +void ScummEngine_v3::loadCharset(int no) { uint32 size; memset(_charsetData, 0, sizeof(_charsetData)); @@ -190,7 +190,7 @@ void Scumm_v3::loadCharset(int no) { file.close(); } -void Scumm_v3::readMAXS() { +void ScummEngine_v3::readMAXS() { // FIXME - I'm not sure for those values yet, they will have to be rechecked _numVariables = 800; // 800 @@ -212,7 +212,7 @@ void Scumm_v3::readMAXS() { allocateArrays(); } -void Scumm_v3::readGlobalObjects() { +void ScummEngine_v3::readGlobalObjects() { int num = _fileHandle.readUint16LE(); assert(num == _numGlobalObjects); for (int i = 0; i != num; i++) { diff --git a/scumm/resource_v4.cpp b/scumm/resource_v4.cpp index d11aa2355b..425954f455 100644 --- a/scumm/resource_v4.cpp +++ b/scumm/resource_v4.cpp @@ -24,7 +24,7 @@ #include "scumm.h" #include "intern.h" -void Scumm_v4::loadCharset(int no) { +void ScummEngine_v4::loadCharset(int no) { uint32 size; memset(_charsetData, 0, sizeof(_charsetData)); diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 49f08f1e18..1c99d298b8 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -46,20 +46,20 @@ struct SaveGameHeader { }; -void Scumm::requestSave(int slot, const char *name) { +void ScummEngine::requestSave(int slot, const char *name) { _saveLoadSlot = slot; _saveLoadCompatible = false; _saveLoadFlag = 1; // 1 for save strcpy(_saveLoadName, name); } -void Scumm::requestLoad(int slot) { +void ScummEngine::requestLoad(int slot) { _saveLoadSlot = slot; _saveLoadCompatible = false; _saveLoadFlag = 2; // 2 for load } -bool Scumm::saveState(int slot, bool compat, SaveFileManager *mgr) { +bool ScummEngine::saveState(int slot, bool compat, SaveFileManager *mgr) { char filename[256]; SaveFile *out; SaveGameHeader hdr; @@ -84,7 +84,7 @@ bool Scumm::saveState(int slot, bool compat, SaveFileManager *mgr) { return true; } -bool Scumm::loadState(int slot, bool compat, SaveFileManager *mgr) { +bool ScummEngine::loadState(int slot, bool compat, SaveFileManager *mgr) { char filename[256]; SaveFile *out; int i, j; @@ -225,18 +225,18 @@ bool Scumm::loadState(int slot, bool compat, SaveFileManager *mgr) { return true; } -void Scumm::makeSavegameName(char *out, int slot, bool compatible) { +void ScummEngine::makeSavegameName(char *out, int slot, bool compatible) { sprintf(out, "%s.%c%.2d", _game_name, compatible ? 'c' : 's', slot); } -void Scumm::listSavegames(bool *marks, int num, SaveFileManager *mgr) { +void ScummEngine::listSavegames(bool *marks, int num, SaveFileManager *mgr) { char prefix[256]; makeSavegameName(prefix, 99, false); prefix[strlen(prefix)-2] = 0; mgr->list_savefiles(prefix, getSavePath(), marks, num); } -bool Scumm::getSavegameName(int slot, char *desc, SaveFileManager *mgr) { +bool ScummEngine::getSavegameName(int slot, char *desc, SaveFileManager *mgr) { char filename[256]; SaveFile *out; SaveGameHeader hdr; @@ -267,7 +267,7 @@ bool Scumm::getSavegameName(int slot, char *desc, SaveFileManager *mgr) { return true; } -void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { +void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) { const SaveLoadEntry objectEntries[] = { MKLINE(ObjectData, OBIMoffset, sleUint32, VER(8)), MKLINE(ObjectData, OBCDoffset, sleUint32, VER(8)), @@ -317,154 +317,154 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { }; const SaveLoadEntry mainEntries[] = { - MKLINE(Scumm, _roomWidth, sleUint16, VER(8)), - MKLINE(Scumm, _roomHeight, sleUint16, VER(8)), - MKLINE(Scumm, _ENCD_offs, sleUint32, VER(8)), - MKLINE(Scumm, _EXCD_offs, sleUint32, VER(8)), - MKLINE(Scumm, _IM00_offs, sleUint32, VER(8)), - MKLINE(Scumm, _CLUT_offs, sleUint32, VER(8)), - MK_OBSOLETE(Scumm, _EPAL_offs, sleUint32, VER(8), VER(9)), - MKLINE(Scumm, _PALS_offs, sleUint32, VER(8)), - MKLINE(Scumm, _curPalIndex, sleByte, VER(8)), - MKLINE(Scumm, _currentRoom, sleByte, VER(8)), - MKLINE(Scumm, _roomResource, sleByte, VER(8)), - MKLINE(Scumm, _numObjectsInRoom, sleByte, VER(8)), - MKLINE(Scumm, _currentScript, sleByte, VER(8)), - MKARRAY(Scumm, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT, VER(8)), + MKLINE(ScummEngine, _roomWidth, sleUint16, VER(8)), + MKLINE(ScummEngine, _roomHeight, sleUint16, VER(8)), + MKLINE(ScummEngine, _ENCD_offs, sleUint32, VER(8)), + MKLINE(ScummEngine, _EXCD_offs, sleUint32, VER(8)), + MKLINE(ScummEngine, _IM00_offs, sleUint32, VER(8)), + MKLINE(ScummEngine, _CLUT_offs, sleUint32, VER(8)), + MK_OBSOLETE(ScummEngine, _EPAL_offs, sleUint32, VER(8), VER(9)), + MKLINE(ScummEngine, _PALS_offs, sleUint32, VER(8)), + MKLINE(ScummEngine, _curPalIndex, sleByte, VER(8)), + MKLINE(ScummEngine, _currentRoom, sleByte, VER(8)), + MKLINE(ScummEngine, _roomResource, sleByte, VER(8)), + MKLINE(ScummEngine, _numObjectsInRoom, sleByte, VER(8)), + MKLINE(ScummEngine, _currentScript, sleByte, VER(8)), + MKARRAY(ScummEngine, _localScriptList[0], sleUint32, NUM_LOCALSCRIPT, VER(8)), // vm.localvar grew from 25 to 40 script entries and then from // 16 to 32 bit variables (but that wasn't reflect here)... and // THEN from 16 to 25 variables. - MKARRAY2_OLD(Scumm, vm.localvar[0][0], sleUint16, 17, 25, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(8), VER(8)), - MKARRAY2_OLD(Scumm, vm.localvar[0][0], sleUint16, 17, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(9), VER(14)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 25, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(8), VER(8)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 17, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(9), VER(14)), // We used to save 25 * 40 = 1000 blocks; but actually, each 'row consisted of 26 entry, // i.e. 26 * 40 = 1040. Thus the last 40 blocks of localvar where not saved at all. To be // able to load this screwed format, we use a trick: We load 26 * 38 = 988 blocks. // Then, we mark the followin 12 blocks (24 bytes) as obsolete. - MKARRAY2_OLD(Scumm, vm.localvar[0][0], sleUint16, 26, 38, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(15), VER(17)), - MK_OBSOLETE_ARRAY(Scumm, vm.localvar[39][0], sleUint16, 12, VER(15), VER(17)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint16, 26, 38, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(15), VER(17)), + MK_OBSOLETE_ARRAY(ScummEngine, vm.localvar[39][0], sleUint16, 12, VER(15), VER(17)), // This was the first proper multi dimensional version of the localvars, with 32 bit values - MKARRAY2_OLD(Scumm, vm.localvar[0][0], sleUint32, 26, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(18), VER(19)), + MKARRAY2_OLD(ScummEngine, vm.localvar[0][0], sleUint32, 26, 40, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(18), VER(19)), // Then we doubled the script slots again, from 40 to 80 - MKARRAY2(Scumm, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(20)), + MKARRAY2(ScummEngine, vm.localvar[0][0], sleUint32, 26, NUM_SCRIPT_SLOT, (byte*)vm.localvar[1] - (byte*)vm.localvar[0], VER(20)), - MKARRAY(Scumm, _resourceMapper[0], sleByte, 128, VER(8)), - MKARRAY(Scumm, _charsetColorMap[0], sleByte, 16, VER(8)), + MKARRAY(ScummEngine, _resourceMapper[0], sleByte, 128, VER(8)), + MKARRAY(ScummEngine, _charsetColorMap[0], sleByte, 16, VER(8)), // _charsetData grew from 10*16 to 15*16 bytes - MKARRAY_OLD(Scumm, _charsetData[0][0], sleByte, 10 * 16, VER(8), VER(9)), - MKARRAY(Scumm, _charsetData[0][0], sleByte, 15 * 16, VER(10)), - - MKLINE(Scumm, _curExecScript, sleUint16, VER(8)), - - MKLINE(Scumm, camera._dest.x, sleInt16, VER(8)), - MKLINE(Scumm, camera._dest.y, sleInt16, VER(8)), - MKLINE(Scumm, camera._cur.x, sleInt16, VER(8)), - MKLINE(Scumm, camera._cur.y, sleInt16, VER(8)), - MKLINE(Scumm, camera._last.x, sleInt16, VER(8)), - MKLINE(Scumm, camera._last.y, sleInt16, VER(8)), - MKLINE(Scumm, camera._accel.x, sleInt16, VER(8)), - MKLINE(Scumm, camera._accel.y, sleInt16, VER(8)), - MKLINE(Scumm, _screenStartStrip, sleInt16, VER(8)), - MKLINE(Scumm, _screenEndStrip, sleInt16, VER(8)), - MKLINE(Scumm, camera._mode, sleByte, VER(8)), - MKLINE(Scumm, camera._follows, sleByte, VER(8)), - MKLINE(Scumm, camera._leftTrigger, sleInt16, VER(8)), - MKLINE(Scumm, camera._rightTrigger, sleInt16, VER(8)), - MKLINE(Scumm, camera._movingToActor, sleUint16, VER(8)), - - MKLINE(Scumm, _actorToPrintStrFor, sleByte, VER(8)), - MKLINE(Scumm, _charsetColor, sleByte, VER(8)), + MKARRAY_OLD(ScummEngine, _charsetData[0][0], sleByte, 10 * 16, VER(8), VER(9)), + MKARRAY(ScummEngine, _charsetData[0][0], sleByte, 15 * 16, VER(10)), + + MKLINE(ScummEngine, _curExecScript, sleUint16, VER(8)), + + MKLINE(ScummEngine, camera._dest.x, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._dest.y, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._cur.x, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._cur.y, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._last.x, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._last.y, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._accel.x, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._accel.y, sleInt16, VER(8)), + MKLINE(ScummEngine, _screenStartStrip, sleInt16, VER(8)), + MKLINE(ScummEngine, _screenEndStrip, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._mode, sleByte, VER(8)), + MKLINE(ScummEngine, camera._follows, sleByte, VER(8)), + MKLINE(ScummEngine, camera._leftTrigger, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._rightTrigger, sleInt16, VER(8)), + MKLINE(ScummEngine, camera._movingToActor, sleUint16, VER(8)), + + MKLINE(ScummEngine, _actorToPrintStrFor, sleByte, VER(8)), + MKLINE(ScummEngine, _charsetColor, sleByte, VER(8)), // _charsetBufPos was changed from byte to int - MKLINE_OLD(Scumm, _charsetBufPos, sleByte, VER(8), VER(9)), - MKLINE(Scumm, _charsetBufPos, sleInt16, VER(10)), - - MKLINE(Scumm, _haveMsg, sleByte, VER(8)), - MKLINE(Scumm, _useTalkAnims, sleByte, VER(8)), - - MKLINE(Scumm, _talkDelay, sleInt16, VER(8)), - MKLINE(Scumm, _defaultTalkDelay, sleInt16, VER(8)), - MKLINE(Scumm, _numInMsgStack, sleInt16, VER(8)), - MKLINE(Scumm, _sentenceNum, sleByte, VER(8)), - - MKLINE(Scumm, vm.cutSceneStackPointer, sleByte, VER(8)), - MKARRAY(Scumm, vm.cutScenePtr[0], sleUint32, 5, VER(8)), - MKARRAY(Scumm, vm.cutSceneScript[0], sleByte, 5, VER(8)), - MKARRAY(Scumm, vm.cutSceneData[0], sleInt16, 5, VER(8)), - MKLINE(Scumm, vm.cutSceneScriptIndex, sleInt16, VER(8)), - - MKLINE(Scumm, vm.numNestedScripts, sleByte, VER(8)), - MKLINE(Scumm, _userPut, sleByte, VER(8)), - MKLINE(Scumm, _userState, sleUint16, VER(17)), - MKLINE(Scumm, _cursor.state, sleByte, VER(8)), - MK_OBSOLETE(Scumm, gdi._cursorActive, sleByte, VER(8), VER(20)), - MKLINE(Scumm, _currentCursor, sleByte, VER(8)), - MKARRAY(Scumm, _grabbedCursor[0], sleByte, 8192, VER(20)), - MKLINE(Scumm, _cursor.width, sleInt16, VER(20)), - MKLINE(Scumm, _cursor.height, sleInt16, VER(20)), - MKLINE(Scumm, _cursor.hotspotX, sleInt16, VER(20)), - MKLINE(Scumm, _cursor.hotspotY, sleInt16, VER(20)), - MKLINE(Scumm, _cursor.animate, sleByte, VER(20)), - MKLINE(Scumm, _cursor.animateIndex, sleByte, VER(20)), - MKLINE(Scumm, _mouse.x, sleInt16, VER(20)), - MKLINE(Scumm, _mouse.y, sleInt16, VER(20)), - - MKLINE(Scumm, _doEffect, sleByte, VER(8)), - MKLINE(Scumm, _switchRoomEffect, sleByte, VER(8)), - MKLINE(Scumm, _newEffect, sleByte, VER(8)), - MKLINE(Scumm, _switchRoomEffect2, sleByte, VER(8)), - MKLINE(Scumm, _BgNeedsRedraw, sleByte, VER(8)), + MKLINE_OLD(ScummEngine, _charsetBufPos, sleByte, VER(8), VER(9)), + MKLINE(ScummEngine, _charsetBufPos, sleInt16, VER(10)), + + MKLINE(ScummEngine, _haveMsg, sleByte, VER(8)), + MKLINE(ScummEngine, _useTalkAnims, sleByte, VER(8)), + + MKLINE(ScummEngine, _talkDelay, sleInt16, VER(8)), + MKLINE(ScummEngine, _defaultTalkDelay, sleInt16, VER(8)), + MKLINE(ScummEngine, _numInMsgStack, sleInt16, VER(8)), + MKLINE(ScummEngine, _sentenceNum, sleByte, VER(8)), + + MKLINE(ScummEngine, vm.cutSceneStackPointer, sleByte, VER(8)), + MKARRAY(ScummEngine, vm.cutScenePtr[0], sleUint32, 5, VER(8)), + MKARRAY(ScummEngine, vm.cutSceneScript[0], sleByte, 5, VER(8)), + MKARRAY(ScummEngine, vm.cutSceneData[0], sleInt16, 5, VER(8)), + MKLINE(ScummEngine, vm.cutSceneScriptIndex, sleInt16, VER(8)), + + MKLINE(ScummEngine, vm.numNestedScripts, sleByte, VER(8)), + MKLINE(ScummEngine, _userPut, sleByte, VER(8)), + MKLINE(ScummEngine, _userState, sleUint16, VER(17)), + MKLINE(ScummEngine, _cursor.state, sleByte, VER(8)), + MK_OBSOLETE(ScummEngine, gdi._cursorActive, sleByte, VER(8), VER(20)), + MKLINE(ScummEngine, _currentCursor, sleByte, VER(8)), + MKARRAY(ScummEngine, _grabbedCursor[0], sleByte, 8192, VER(20)), + MKLINE(ScummEngine, _cursor.width, sleInt16, VER(20)), + MKLINE(ScummEngine, _cursor.height, sleInt16, VER(20)), + MKLINE(ScummEngine, _cursor.hotspotX, sleInt16, VER(20)), + MKLINE(ScummEngine, _cursor.hotspotY, sleInt16, VER(20)), + MKLINE(ScummEngine, _cursor.animate, sleByte, VER(20)), + MKLINE(ScummEngine, _cursor.animateIndex, sleByte, VER(20)), + MKLINE(ScummEngine, _mouse.x, sleInt16, VER(20)), + MKLINE(ScummEngine, _mouse.y, sleInt16, VER(20)), + + MKLINE(ScummEngine, _doEffect, sleByte, VER(8)), + MKLINE(ScummEngine, _switchRoomEffect, sleByte, VER(8)), + MKLINE(ScummEngine, _newEffect, sleByte, VER(8)), + MKLINE(ScummEngine, _switchRoomEffect2, sleByte, VER(8)), + MKLINE(ScummEngine, _BgNeedsRedraw, sleByte, VER(8)), // The state of palManipulate is stored only since V10 - MKLINE(Scumm, _palManipStart, sleByte, VER(10)), - MKLINE(Scumm, _palManipEnd, sleByte, VER(10)), - MKLINE(Scumm, _palManipCounter, sleUint16, VER(10)), + MKLINE(ScummEngine, _palManipStart, sleByte, VER(10)), + MKLINE(ScummEngine, _palManipEnd, sleByte, VER(10)), + MKLINE(ScummEngine, _palManipCounter, sleUint16, VER(10)), // gfxUsageBits grew from 200 to 410 entries. Then 3 * 410 entries: - MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 200, VER(8), VER(9)), - MKARRAY_OLD(Scumm, gfxUsageBits[0], sleUint32, 410, VER(10), VER(13)), - MKARRAY(Scumm, gfxUsageBits[0], sleUint32, 3 * 410, VER(14)), + MKARRAY_OLD(ScummEngine, gfxUsageBits[0], sleUint32, 200, VER(8), VER(9)), + MKARRAY_OLD(ScummEngine, gfxUsageBits[0], sleUint32, 410, VER(10), VER(13)), + MKARRAY(ScummEngine, gfxUsageBits[0], sleUint32, 3 * 410, VER(14)), - MKLINE(Scumm, gdi._transparentColor, sleByte, VER(8)), - MKARRAY(Scumm, _currentPalette[0], sleByte, 768, VER(8)), + MKLINE(ScummEngine, gdi._transparentColor, sleByte, VER(8)), + MKARRAY(ScummEngine, _currentPalette[0], sleByte, 768, VER(8)), - MKARRAY(Scumm, _proc_special_palette[0], sleByte, 256, VER(8)), + MKARRAY(ScummEngine, _proc_special_palette[0], sleByte, 256, VER(8)), - MKARRAY(Scumm, _charsetBuffer[0], sleByte, 256, VER(8)), + MKARRAY(ScummEngine, _charsetBuffer[0], sleByte, 256, VER(8)), - MKLINE(Scumm, _egoPositioned, sleByte, VER(8)), + MKLINE(ScummEngine, _egoPositioned, sleByte, VER(8)), // gdi._imgBufOffs grew from 4 to 5 entries : - MKARRAY_OLD(Scumm, gdi._imgBufOffs[0], sleUint16, 4, VER(8), VER(9)), - MKARRAY(Scumm, gdi._imgBufOffs[0], sleUint16, 5, VER(10)), + MKARRAY_OLD(ScummEngine, gdi._imgBufOffs[0], sleUint16, 4, VER(8), VER(9)), + MKARRAY(ScummEngine, gdi._imgBufOffs[0], sleUint16, 5, VER(10)), - MKLINE(Scumm, gdi._numZBuffer, sleByte, VER(8)), + MKLINE(ScummEngine, gdi._numZBuffer, sleByte, VER(8)), - MKLINE(Scumm, _screenEffectFlag, sleByte, VER(8)), + MKLINE(ScummEngine, _screenEffectFlag, sleByte, VER(8)), - MK_OBSOLETE(Scumm, _randSeed1, sleUint32, VER(8), VER(9)), - MK_OBSOLETE(Scumm, _randSeed2, sleUint32, VER(8), VER(9)), + MK_OBSOLETE(ScummEngine, _randSeed1, sleUint32, VER(8), VER(9)), + MK_OBSOLETE(ScummEngine, _randSeed2, sleUint32, VER(8), VER(9)), // Converted _shakeEnabled to boolean and added a _shakeFrame field. - MKLINE_OLD(Scumm, _shakeEnabled, sleInt16, VER(8), VER(9)), - MKLINE(Scumm, _shakeEnabled, sleByte, VER(10)), - MKLINE(Scumm, _shakeFrame, sleUint32, VER(10)), + MKLINE_OLD(ScummEngine, _shakeEnabled, sleInt16, VER(8), VER(9)), + MKLINE(ScummEngine, _shakeEnabled, sleByte, VER(10)), + MKLINE(ScummEngine, _shakeFrame, sleUint32, VER(10)), - MKLINE(Scumm, _keepText, sleByte, VER(8)), + MKLINE(ScummEngine, _keepText, sleByte, VER(8)), - MKLINE(Scumm, _screenB, sleUint16, VER(8)), - MKLINE(Scumm, _screenH, sleUint16, VER(8)), + MKLINE(ScummEngine, _screenB, sleUint16, VER(8)), + MKLINE(ScummEngine, _screenH, sleUint16, VER(8)), - MK_OBSOLETE(Scumm, _cd_track, sleInt16, VER(9), VER(9)), - MK_OBSOLETE(Scumm, _cd_loops, sleInt16, VER(9), VER(9)), - MK_OBSOLETE(Scumm, _cd_frame, sleInt16, VER(9), VER(9)), - MK_OBSOLETE(Scumm, _cd_end, sleInt16, VER(9), VER(9)), + MK_OBSOLETE(ScummEngine, _cd_track, sleInt16, VER(9), VER(9)), + MK_OBSOLETE(ScummEngine, _cd_loops, sleInt16, VER(9), VER(9)), + MK_OBSOLETE(ScummEngine, _cd_frame, sleInt16, VER(9), VER(9)), + MK_OBSOLETE(ScummEngine, _cd_end, sleInt16, VER(9), VER(9)), MKEND() }; @@ -679,7 +679,7 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) { } } -void Scumm::saveLoadResource(Serializer *ser, int type, int idx) { +void ScummEngine::saveLoadResource(Serializer *ser, int type, int idx) { byte *ptr; uint32 size; diff --git a/scumm/script.cpp b/scumm/script.cpp index 29c94efd21..e4b966952e 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -30,7 +30,7 @@ #include "scumm/scumm.h" /* Start executing script 'script' with the given parameters */ -void Scumm::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr) { +void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr) { ScriptSlot *s; byte *scriptPtr; uint32 scriptOffs; @@ -71,7 +71,7 @@ void Scumm::runScript(int script, bool freezeResistant, bool recursive, int *lva runScriptNested(slot); } -void Scumm::runObjectScript(int object, int entry, bool freezeResistant, bool recursive, int *vars, int slot) { +void ScummEngine::runObjectScript(int object, int entry, bool freezeResistant, bool recursive, int *vars, int slot) { ScriptSlot *s; uint32 obcd; int where, offs; @@ -118,7 +118,7 @@ void Scumm::runObjectScript(int object, int entry, bool freezeResistant, bool re #define BYPASS_COPY_PROT #endif -void Scumm::initializeLocals(int slot, int *vars) { +void ScummEngine::initializeLocals(int slot, int *vars) { int i; if (!vars) { for (i = 0; i < 16; i++) @@ -129,7 +129,7 @@ void Scumm::initializeLocals(int slot, int *vars) { } } -int Scumm::getVerbEntrypoint(int obj, int entry) { +int ScummEngine::getVerbEntrypoint(int obj, int entry) { const byte *objptr, *verbptr; int verboffs; @@ -194,7 +194,7 @@ int Scumm::getVerbEntrypoint(int obj, int entry) { } /* Stop script 'script' */ -void Scumm::stopScript(int script) { +void ScummEngine::stopScript(int script) { ScriptSlot *ss; NestedScript *nest; int i, num; @@ -231,7 +231,7 @@ void Scumm::stopScript(int script) { } /* Stop an object script 'script'*/ -void Scumm::stopObjectScript(int script) { +void ScummEngine::stopObjectScript(int script) { ScriptSlot *ss; NestedScript *nest; int i, num; @@ -268,7 +268,7 @@ void Scumm::stopObjectScript(int script) { } /* Return a free script slot */ -int Scumm::getScriptSlot() { +int ScummEngine::getScriptSlot() { ScriptSlot *ss; int i; @@ -282,7 +282,7 @@ int Scumm::getScriptSlot() { } /* Run script 'script' nested - eg, within the parent script.*/ -void Scumm::runScriptNested(int script) { +void ScummEngine::runScriptNested(int script) { NestedScript *nest; ScriptSlot *slot; @@ -329,7 +329,7 @@ void Scumm::runScriptNested(int script) { _currentScript = 0xFF; } -void Scumm::updateScriptPtr() { +void ScummEngine::updateScriptPtr() { if (_currentScript == 0xFF) return; @@ -337,7 +337,7 @@ void Scumm::updateScriptPtr() { } /* Get the code pointer to a script */ -void Scumm::getScriptBaseAddress() { +void ScummEngine::getScriptBaseAddress() { ScriptSlot *ss; int idx; @@ -386,14 +386,14 @@ void Scumm::getScriptBaseAddress() { } -void Scumm::getScriptEntryPoint() { +void ScummEngine::getScriptEntryPoint() { if (_currentScript == 0xFF) return; _scriptPointer = _scriptOrgPointer + vm.slot[_currentScript].offs; } /* Execute a script - Read opcode, and execute it from the table */ -void Scumm::executeScript() { +void ScummEngine::executeScript() { int c; while (_currentScript != 0xFF) { @@ -422,7 +422,7 @@ void Scumm::executeScript() { CHECK_HEAP; } -byte Scumm::fetchScriptByte() { +byte ScummEngine::fetchScriptByte() { if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { uint32 oldoffs = _scriptPointer - _scriptOrgPointer; getScriptBaseAddress(); @@ -431,7 +431,7 @@ byte Scumm::fetchScriptByte() { return *_scriptPointer++; } -uint Scumm::fetchScriptWord() { +uint ScummEngine::fetchScriptWord() { int a; if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { uint32 oldoffs = _scriptPointer - _scriptOrgPointer; @@ -443,11 +443,11 @@ uint Scumm::fetchScriptWord() { return a; } -int Scumm::fetchScriptWordSigned() { +int ScummEngine::fetchScriptWordSigned() { return (int16)fetchScriptWord(); } -int Scumm::readVar(uint var) { +int ScummEngine::readVar(uint var) { int a; #if defined(BYPASS_COPY_PROT) static byte copyprotbypassed = false; @@ -529,7 +529,7 @@ int Scumm::readVar(uint var) { return -1; } -void Scumm::writeVar(uint var, int value) { +void ScummEngine::writeVar(uint var, int value) { if (!(var & 0xF000)) { checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)"); @@ -592,7 +592,7 @@ void Scumm::writeVar(uint var, int value) { error("Illegal varbits (w)"); } -void Scumm::getResultPos() { +void ScummEngine::getResultPos() { int a; _resultVarNumber = fetchScriptWord(); @@ -607,16 +607,16 @@ void Scumm::getResultPos() { } } -void Scumm::setResult(int value) { +void ScummEngine::setResult(int value) { writeVar(_resultVarNumber, value); } -void Scumm::push(int a) { +void ScummEngine::push(int a) { assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_scummStack)); _scummStack[_scummStackPos++] = a; } -int Scumm::pop() { +int ScummEngine::pop() { if (_scummStackPos < 1 || _scummStackPos > ARRAYSIZE(_scummStack)) { error("No items on stack to pop() for %s (0x%X) at [%d-%d]", getOpcodeDesc(_opcode), _opcode, _roomResource, vm.slot[_currentScript].number); } @@ -624,7 +624,7 @@ int Scumm::pop() { return _scummStack[--_scummStackPos]; } -void Scumm::stopObjectCode() { +void ScummEngine::stopObjectCode() { ScriptSlot *ss; ss = &vm.slot[_currentScript]; @@ -649,7 +649,7 @@ void Scumm::stopObjectCode() { _currentScript = 0xFF; } -void Scumm::runInventoryScript(int i) { +void ScummEngine::runInventoryScript(int i) { if (_version <= 2) { redrawV2Inventory(); } else { @@ -661,7 +661,7 @@ void Scumm::runInventoryScript(int i) { } } -void Scumm::freezeScripts(int flag) { +void ScummEngine::freezeScripts(int flag) { int i; if (_version <= 2) { @@ -690,7 +690,7 @@ void Scumm::freezeScripts(int flag) { } } -void Scumm::unfreezeScripts() { +void ScummEngine::unfreezeScripts() { int i; if (_version <= 2) { @@ -716,7 +716,7 @@ void Scumm::unfreezeScripts() { } -void Scumm::runAllScripts() { +void ScummEngine::runAllScripts() { int i; for (i = 0; i < NUM_SCRIPT_SLOT; i++) @@ -737,7 +737,7 @@ void Scumm::runAllScripts() { } } -void Scumm::runExitScript() { +void ScummEngine::runExitScript() { if (_version > 2 && VAR(VAR_EXIT_SCRIPT)) runScript(VAR(VAR_EXIT_SCRIPT), 0, 0, 0); if (_EXCD_offs) { @@ -770,7 +770,7 @@ void Scumm::runExitScript() { runScript(VAR(VAR_EXIT_SCRIPT2), 0, 0, 0); } -void Scumm::runEntryScript() { +void ScummEngine::runEntryScript() { if (_version > 2 && VAR(VAR_ENTRY_SCRIPT)) runScript(VAR(VAR_ENTRY_SCRIPT), 0, 0, 0); if (_ENCD_offs) { @@ -789,7 +789,7 @@ void Scumm::runEntryScript() { runScript(VAR(VAR_ENTRY_SCRIPT2), 0, 0, 0); } -void Scumm::killScriptsAndResources() { +void ScummEngine::killScriptsAndResources() { ScriptSlot *ss; int i; @@ -823,14 +823,14 @@ void Scumm::killScriptsAndResources() { } } -void Scumm::killAllScriptsExceptCurrent() { +void ScummEngine::killAllScriptsExceptCurrent() { for (int i = 0; i < NUM_SCRIPT_SLOT; i++) { if (i != _currentScript) vm.slot[i].status = ssDead; } } -void Scumm::doSentence(int verb, int objectA, int objectB) { +void ScummEngine::doSentence(int verb, int objectA, int objectB) { SentenceTab *st; if (_version >= 7) { @@ -858,7 +858,7 @@ void Scumm::doSentence(int verb, int objectA, int objectB) { st->freezeCount = 0; } -void Scumm::checkAndRunSentenceScript() { +void ScummEngine::checkAndRunSentenceScript() { int i; int localParamList[16]; const ScriptSlot *ss; @@ -900,7 +900,7 @@ void Scumm::checkAndRunSentenceScript() { runScript(sentenceScript, 0, 0, localParamList); } -void Scumm::runInputScript(int a, int cmd, int mode) { +void ScummEngine::runInputScript(int a, int cmd, int mode) { int args[16]; int verbScript; @@ -927,7 +927,7 @@ void Scumm::runInputScript(int a, int cmd, int mode) { runScript(verbScript, 0, 0, args); } -void Scumm::decreaseScriptDelay(int amount) { +void ScummEngine::decreaseScriptDelay(int amount) { ScriptSlot *ss = vm.slot; int i; for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { @@ -941,7 +941,7 @@ void Scumm::decreaseScriptDelay(int amount) { } } -bool Scumm::isScriptInUse(int script) const { +bool ScummEngine::isScriptInUse(int script) const { int i; const ScriptSlot *ss = vm.slot; for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) @@ -950,7 +950,7 @@ bool Scumm::isScriptInUse(int script) const { return false; } -bool Scumm::isScriptRunning(int script) const { +bool ScummEngine::isScriptRunning(int script) const { int i; const ScriptSlot *ss = vm.slot; for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) @@ -959,7 +959,7 @@ bool Scumm::isScriptRunning(int script) const { return false; } -bool Scumm::isRoomScriptRunning(int script) const { +bool ScummEngine::isRoomScriptRunning(int script) const { int i; const ScriptSlot *ss = vm.slot; for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) @@ -968,7 +968,7 @@ bool Scumm::isRoomScriptRunning(int script) const { return false; } -int Scumm::defineArray(int array, int type, int dim2, int dim1) { +int ScummEngine::defineArray(int array, int type, int dim2, int dim1) { int id; int size; ArrayHeader *ah; @@ -1015,7 +1015,7 @@ int Scumm::defineArray(int array, int type, int dim2, int dim1) { return id; } -void Scumm::nukeArray(int a) { +void ScummEngine::nukeArray(int a) { int data; data = readVar(a); @@ -1026,7 +1026,7 @@ void Scumm::nukeArray(int a) { writeVar(a, 0); } -int Scumm::getArrayId() { +int ScummEngine::getArrayId() { byte **addr = _baseArrays; int i; @@ -1038,7 +1038,7 @@ int Scumm::getArrayId() { return -1; } -void Scumm::copyScriptString(byte *dst) { +void ScummEngine::copyScriptString(byte *dst) { int len = resStrLen(_scriptPointer) + 1; while (len--) *dst++ = fetchScriptByte(); @@ -1050,7 +1050,7 @@ void Scumm::copyScriptString(byte *dst) { // special characters embedded into the string. The reason for this function is that // sometimes this embedded data contains zero bytes, thus we can't just use strlen. // -int Scumm::resStrLen(const byte *src) const { +int ScummEngine::resStrLen(const byte *src) const { int num = 0; byte chr; if (src == NULL) @@ -1075,7 +1075,7 @@ int Scumm::resStrLen(const byte *src) const { return num; } -void Scumm::beginCutscene(int *args) { +void ScummEngine::beginCutscene(int *args) { int scr = _currentScript; vm.slot[scr].cutsceneOverride++; @@ -1092,7 +1092,7 @@ void Scumm::beginCutscene(int *args) { vm.cutSceneScriptIndex = 0xFF; } -void Scumm::endCutscene() { +void ScummEngine::endCutscene() { ScriptSlot *ss = &vm.slot[_currentScript]; int args[16]; @@ -1115,7 +1115,7 @@ void Scumm::endCutscene() { runScript(VAR(VAR_CUTSCENE_END_SCRIPT), 0, 0, args); } -void Scumm::abortCutscene() { +void ScummEngine::abortCutscene() { uint32 offs = vm.cutScenePtr[vm.cutSceneStackPointer]; if (offs) { ScriptSlot *ss = &vm.slot[vm.cutSceneScript[vm.cutSceneStackPointer]]; @@ -1131,7 +1131,7 @@ void Scumm::abortCutscene() { } } -void Scumm::beginOverride() { +void ScummEngine::beginOverride() { int idx; idx = vm.cutSceneStackPointer; @@ -1150,7 +1150,7 @@ void Scumm::beginOverride() { VAR(VAR_OVERRIDE) = 0; } -void Scumm::endOverride() { +void ScummEngine::endOverride() { int idx; idx = vm.cutSceneStackPointer; diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 34e08be9bc..6d262b1d0d 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -29,9 +29,9 @@ #include "scumm/sound.h" #include "scumm/verbs.h" -#define OPCODE(x) { &Scumm_v2::x, #x } +#define OPCODE(x) { &ScummEngine_v2::x, #x } -void Scumm_v2::setupOpcodes() { +void ScummEngine_v2::setupOpcodes() { static const OpcodeEntryV2 opcodes[256] = { /* 00 */ OPCODE(o5_stopObjectCode), @@ -360,22 +360,22 @@ void Scumm_v2::setupOpcodes() { #define SENTENCE_SCRIPT 2 -void Scumm_v2::executeOpcode(byte i) { +void ScummEngine_v2::executeOpcode(byte i) { OpcodeProcV2 op = _opcodesV2[i].proc; (this->*op) (); } -const char *Scumm_v2::getOpcodeDesc(byte i) { +const char *ScummEngine_v2::getOpcodeDesc(byte i) { return _opcodesV2[i].desc; } -int Scumm_v2::getVar() { +int ScummEngine_v2::getVar() { return readVar(fetchScriptByte()); } int v1_mm_actor_speech_color[] = {1, 7, 2, 14, 8, 1, 3, 7, 7, 12, 1, 13, 1, 4, 5, 5, 4, 3, 1, 5, 1, 1, 1, 7, 7, 0}; -void Scumm_v2::decodeParseString() { +void ScummEngine_v2::decodeParseString() { byte buffer[512]; byte *ptr = buffer; byte c; @@ -442,7 +442,7 @@ void Scumm_v2::decodeParseString() { } } -int Scumm_v2::readVar(uint var) { +int ScummEngine_v2::readVar(uint var) { if (var >= 14 && var <= 16) var = _scummVars[var]; @@ -451,79 +451,79 @@ int Scumm_v2::readVar(uint var) { return _scummVars[var]; } -void Scumm_v2::writeVar(uint var, int value) { +void ScummEngine_v2::writeVar(uint var, int value) { checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); debug(6, "writeVar(%d) = %d", var, value); _scummVars[var] = value; } -void Scumm_v2::getResultPosIndirect() { +void ScummEngine_v2::getResultPosIndirect() { _resultVarNumber = _scummVars[fetchScriptByte()]; } -void Scumm_v2::getResultPos() { +void ScummEngine_v2::getResultPos() { _resultVarNumber = fetchScriptByte(); } -void Scumm_v2::setStateCommon(byte type) { +void ScummEngine_v2::setStateCommon(byte type) { int obj = getVarOrDirectWord(0x80); putState(obj, getState(obj) | type); } -void Scumm_v2::clearStateCommon(byte type) { +void ScummEngine_v2::clearStateCommon(byte type) { int obj = getVarOrDirectWord(0x80); putState(obj, getState(obj) & ~type); } -void Scumm_v2::o2_setState08() { +void ScummEngine_v2::o2_setState08() { int obj = getVarOrDirectWord(0x80); putState(obj, getState(obj) | 0x08); removeObjectFromRoom(obj); clearDrawObjectQueue(); } -void Scumm_v2::o2_clearState08() { +void ScummEngine_v2::o2_clearState08() { int obj = getVarOrDirectWord(0x80); putState(obj, getState(obj) & ~0x08); removeObjectFromRoom(obj); clearDrawObjectQueue(); } -void Scumm_v2::o2_setState04() { +void ScummEngine_v2::o2_setState04() { setStateCommon(0x04); } -void Scumm_v2::o2_clearState04() { +void ScummEngine_v2::o2_clearState04() { clearStateCommon(0x04); } -void Scumm_v2::o2_setState02() { +void ScummEngine_v2::o2_setState02() { setStateCommon(0x02); } -void Scumm_v2::o2_clearState02() { +void ScummEngine_v2::o2_clearState02() { clearStateCommon(0x02); } -void Scumm_v2::o2_setState01() { +void ScummEngine_v2::o2_setState01() { setStateCommon(0x01); } -void Scumm_v2::o2_clearState01() { +void ScummEngine_v2::o2_clearState01() { clearStateCommon(0x01); } -void Scumm_v2::o2_assignVarWordIndirect() { +void ScummEngine_v2::o2_assignVarWordIndirect() { getResultPosIndirect(); setResult(getVarOrDirectWord(0x80)); } -void Scumm_v2::o2_assignVarByte() { +void ScummEngine_v2::o2_assignVarByte() { getResultPos(); setResult(fetchScriptByte()); } -void Scumm_v2::o2_setObjPreposition() { +void ScummEngine_v2::o2_setObjPreposition() { int obj = getVarOrDirectWord(0x80); int unk = fetchScriptByte(); @@ -535,7 +535,7 @@ void Scumm_v2::o2_setObjPreposition() { } } -void Scumm_v2::o2_getObjPreposition() { +void ScummEngine_v2::o2_getObjPreposition() { getResultPos(); int obj = getVarOrDirectWord(0x80); @@ -547,7 +547,7 @@ void Scumm_v2::o2_getObjPreposition() { } } -void Scumm_v2::o2_setBitVar() { +void ScummEngine_v2::o2_setBitVar() { int var = fetchScriptWord(); byte a = getVarOrDirectByte(0x80); @@ -562,7 +562,7 @@ void Scumm_v2::o2_setBitVar() { } -void Scumm_v2::o2_getBitVar() { +void ScummEngine_v2::o2_getBitVar() { getResultPos(); int var = fetchScriptWord(); byte a = getVarOrDirectByte(0x80); @@ -574,7 +574,7 @@ void Scumm_v2::o2_getBitVar() { setResult((_scummVars[bit_var] & (1 << bit_offset)) ? 1 : 0); } -void Scumm_v2::ifStateCommon(byte type) { +void ScummEngine_v2::ifStateCommon(byte type) { int obj = getVarOrDirectWord(0x80); if ((getState(obj) & type) == 0) @@ -583,7 +583,7 @@ void Scumm_v2::ifStateCommon(byte type) { ignoreScriptWord(); } -void Scumm_v2::ifNotStateCommon(byte type) { +void ScummEngine_v2::ifNotStateCommon(byte type) { int obj = getVarOrDirectWord(0x80); if ((getState(obj) & type) != 0) @@ -592,67 +592,67 @@ void Scumm_v2::ifNotStateCommon(byte type) { ignoreScriptWord(); } -void Scumm_v2::o2_ifState08() { +void ScummEngine_v2::o2_ifState08() { ifStateCommon(0x08); } -void Scumm_v2::o2_ifNotState08() { +void ScummEngine_v2::o2_ifNotState08() { ifNotStateCommon(0x08); } -void Scumm_v2::o2_ifState04() { +void ScummEngine_v2::o2_ifState04() { ifStateCommon(0x04); } -void Scumm_v2::o2_ifNotState04() { +void ScummEngine_v2::o2_ifNotState04() { ifNotStateCommon(0x04); } -void Scumm_v2::o2_ifState02() { +void ScummEngine_v2::o2_ifState02() { ifStateCommon(0x02); } -void Scumm_v2::o2_ifNotState02() { +void ScummEngine_v2::o2_ifNotState02() { ifNotStateCommon(0x02); } -void Scumm_v2::o2_ifState01() { +void ScummEngine_v2::o2_ifState01() { ifStateCommon(0x01); } -void Scumm_v2::o2_ifNotState01() { +void ScummEngine_v2::o2_ifNotState01() { ifNotStateCommon(0x01); } -void Scumm_v2::o2_addIndirect() { +void ScummEngine_v2::o2_addIndirect() { int a; getResultPosIndirect(); a = getVarOrDirectWord(0x80); _scummVars[_resultVarNumber] += a; } -void Scumm_v2::o2_subIndirect() { +void ScummEngine_v2::o2_subIndirect() { int a; getResultPosIndirect(); a = getVarOrDirectWord(0x80); _scummVars[_resultVarNumber] -= a; } -void Scumm_v2::o2_add() { +void ScummEngine_v2::o2_add() { int a; getResultPos(); a = getVarOrDirectWord(0x80); _scummVars[_resultVarNumber] += a; } -void Scumm_v2::o2_subtract() { +void ScummEngine_v2::o2_subtract() { int a; getResultPos(); a = getVarOrDirectWord(0x80); _scummVars[_resultVarNumber] -= a; } -void Scumm_v2::o2_waitForActor() { +void ScummEngine_v2::o2_waitForActor() { Actor *a = derefActor(getVarOrDirectByte(0x80), "o2_waitForActor"); if (a->moving) { _scriptPointer -= 2; @@ -660,7 +660,7 @@ void Scumm_v2::o2_waitForActor() { } } -void Scumm_v2::o2_waitForMessage() { +void ScummEngine_v2::o2_waitForMessage() { if (VAR(VAR_HAVE_MSG)) { _scriptPointer--; @@ -668,7 +668,7 @@ void Scumm_v2::o2_waitForMessage() { } } -void Scumm_v2::o2_waitForSentence() { +void ScummEngine_v2::o2_waitForSentence() { if (!_sentenceNum && !isScriptInUse(SENTENCE_SCRIPT)) return; @@ -676,7 +676,7 @@ void Scumm_v2::o2_waitForSentence() { o5_breakHere(); } -void Scumm_v2::o2_actorSet() { +void ScummEngine_v2::o2_actorSet() { int act = getVarOrDirectByte(0x80); int arg = getVarOrDirectByte(0x40); Actor *a; @@ -721,11 +721,11 @@ void Scumm_v2::o2_actorSet() { } } -void Scumm_v2::o2_restart() { +void ScummEngine_v2::o2_restart() { restart(); } -void Scumm_v2::o2_drawObject() { +void ScummEngine_v2::o2_drawObject() { int obj, idx, i; ObjectData *od; uint16 x, y, w, h; @@ -762,7 +762,7 @@ void Scumm_v2::o2_drawObject() { putState(obj, getState(od->obj_nr) | 0x08); } -void Scumm_v2::o2_resourceRoutines() { +void ScummEngine_v2::o2_resourceRoutines() { const ResTypes resTypes[] = { rtNumTypes, // Invalid rtNumTypes, // Invalid @@ -792,7 +792,7 @@ void Scumm_v2::o2_resourceRoutines() { } } -void Scumm_v2::o2_verbOps() { +void ScummEngine_v2::o2_verbOps() { int verb = fetchScriptByte(); int slot, state; @@ -880,7 +880,7 @@ void Scumm_v2::o2_verbOps() { verbMouseOver(0); } -void Scumm_v2::o2_doSentence() { +void ScummEngine_v2::o2_doSentence() { int a; SentenceTab *st; @@ -914,7 +914,7 @@ void Scumm_v2::o2_doSentence() { _sentenceNum--; if (st->verb == 254) { - Scumm::stopObjectScript(st->objectA); + ScummEngine::stopObjectScript(st->objectA); } else { bool isBackgroundScript; bool isSpecialVerb; @@ -970,7 +970,7 @@ void Scumm_v2::o2_doSentence() { } } -void Scumm_v2::o2_drawSentence() { +void ScummEngine_v2::o2_drawSentence() { Common::Rect sentenceline; static char sentence[256]; const byte *temp; @@ -1065,7 +1065,7 @@ void Scumm_v2::o2_drawSentence() { drawString(2); } -void Scumm_v2::o2_ifClassOfIs() { +void ScummEngine_v2::o2_ifClassOfIs() { int obj = getVarOrDirectWord(0x80); int clsop = getVarOrDirectByte(0x40); byte *obcd = getOBCDFromObject(obj); @@ -1083,7 +1083,7 @@ void Scumm_v2::o2_ifClassOfIs() { ignoreScriptWord(); } -void Scumm_v2::o2_walkActorTo() { +void ScummEngine_v2::o2_walkActorTo() { int x, y; Actor *a; a = derefActor(getVarOrDirectByte(0x80), "o2_walkActorTo"); @@ -1094,7 +1094,7 @@ void Scumm_v2::o2_walkActorTo() { a->startWalkActor(x, y, -1); } -void Scumm_v2::o2_putActor() { +void ScummEngine_v2::o2_putActor() { int act = getVarOrDirectByte(0x80); int x, y; Actor *a; @@ -1107,16 +1107,16 @@ void Scumm_v2::o2_putActor() { a->putActor(x, y, a->room); } -void Scumm_v2::o2_startScript() { +void ScummEngine_v2::o2_startScript() { int script = getVarOrDirectByte(0x80); runScript(script, 0, 0, 0); } -void Scumm_v2::o2_panCameraTo() { +void ScummEngine_v2::o2_panCameraTo() { panCameraTo(getVarOrDirectByte(0x80) * 8, 0); } -void Scumm_v2::o2_walkActorToObject() { +void ScummEngine_v2::o2_walkActorToObject() { int obj; Actor *a; @@ -1129,7 +1129,7 @@ void Scumm_v2::o2_walkActorToObject() { } } -void Scumm_v2::o2_putActorAtObject() { +void ScummEngine_v2::o2_putActorAtObject() { int obj, x, y; Actor *a; @@ -1146,14 +1146,14 @@ void Scumm_v2::o2_putActorAtObject() { a->putActor(x, y, a->room); } -void Scumm_v2::o2_getActorElevation() { +void ScummEngine_v2::o2_getActorElevation() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o2_getActorElevation"); setResult(a->elevation / 2); } -void Scumm_v2::o2_setActorElevation() { +void ScummEngine_v2::o2_setActorElevation() { int act = getVarOrDirectByte(0x80); int elevation = (int8)getVarOrDirectByte(0x40); @@ -1161,7 +1161,7 @@ void Scumm_v2::o2_setActorElevation() { a->elevation = elevation * 2; } -void Scumm_v2::o2_animateActor() { +void ScummEngine_v2::o2_animateActor() { int act = getVarOrDirectByte(0x80); int anim = getVarOrDirectByte(0x40); @@ -1169,7 +1169,7 @@ void Scumm_v2::o2_animateActor() { a->animateActor(anim); } -void Scumm_v2::o2_actorFromPos() { +void ScummEngine_v2::o2_actorFromPos() { int x, y; getResultPos(); x = getVarOrDirectByte(0x80) * 8; @@ -1177,14 +1177,14 @@ void Scumm_v2::o2_actorFromPos() { setResult(getActorFromPos(x, y)); } -void Scumm_v2::o2_findObject() { +void ScummEngine_v2::o2_findObject() { getResultPos(); int x = getVarOrDirectByte(0x80) * 8; int y = getVarOrDirectByte(0x40) * 2; setResult(findObject(x, y)); } -void Scumm_v2::o2_getActorX() { +void ScummEngine_v2::o2_getActorX() { int a; getResultPos(); @@ -1192,7 +1192,7 @@ void Scumm_v2::o2_getActorX() { setResult(getObjX(a) / 8); } -void Scumm_v2::o2_getActorY() { +void ScummEngine_v2::o2_getActorY() { int a; getResultPos(); @@ -1200,7 +1200,7 @@ void Scumm_v2::o2_getActorY() { setResult(getObjY(a) / 2); } -void Scumm_v2::o2_isGreater() { +void ScummEngine_v2::o2_isGreater() { uint16 a = getVar(); uint16 b = getVarOrDirectWord(0x80); if (b > a) @@ -1209,7 +1209,7 @@ void Scumm_v2::o2_isGreater() { o5_jumpRelative(); } -void Scumm_v2::o2_isGreaterEqual() { +void ScummEngine_v2::o2_isGreaterEqual() { uint16 a = getVar(); uint16 b = getVarOrDirectWord(0x80); if (b >= a) @@ -1218,7 +1218,7 @@ void Scumm_v2::o2_isGreaterEqual() { o5_jumpRelative(); } -void Scumm_v2::o2_isLess() { +void ScummEngine_v2::o2_isLess() { uint16 a = getVar(); uint16 b = getVarOrDirectWord(0x80); @@ -1228,7 +1228,7 @@ void Scumm_v2::o2_isLess() { o5_jumpRelative(); } -void Scumm_v2::o2_isLessEqual() { +void ScummEngine_v2::o2_isLessEqual() { uint16 a = getVar(); uint16 b = getVarOrDirectWord(0x80); if (b <= a) @@ -1237,7 +1237,7 @@ void Scumm_v2::o2_isLessEqual() { o5_jumpRelative(); } -void Scumm_v2::o2_lights() { +void ScummEngine_v2::o2_lights() { int a, b, c; a = getVarOrDirectByte(0x80); @@ -1266,7 +1266,7 @@ void Scumm_v2::o2_lights() { _fullRedraw = 1; } -void Scumm_v2::o2_loadRoomWithEgo() { +void ScummEngine_v2::o2_loadRoomWithEgo() { Actor *a; int obj, room, x, y, x2, y2, dir; @@ -1301,7 +1301,7 @@ void Scumm_v2::o2_loadRoomWithEgo() { runScript(5, 0, 0, 0); } -void Scumm_v2::o2_setOwnerOf() { +void ScummEngine_v2::o2_setOwnerOf() { int obj, owner; obj = getVarOrDirectWord(0x80); @@ -1310,7 +1310,7 @@ void Scumm_v2::o2_setOwnerOf() { setOwnerOf(obj, owner); } -void Scumm_v2::o2_delay() { +void ScummEngine_v2::o2_delay() { int delay = fetchScriptByte(); delay |= fetchScriptByte() << 8; delay |= fetchScriptByte() << 16; @@ -1321,7 +1321,7 @@ void Scumm_v2::o2_delay() { o5_breakHere(); } -void Scumm_v2::o2_setBoxFlags() { +void ScummEngine_v2::o2_setBoxFlags() { int a, b; a = getVarOrDirectByte(0x80); @@ -1329,11 +1329,11 @@ void Scumm_v2::o2_setBoxFlags() { setBoxFlags(a, b); } -void Scumm_v2::o2_setCameraAt() { +void ScummEngine_v2::o2_setCameraAt() { setCameraAtEx(getVarOrDirectByte(0x80) * 8); } -void Scumm_v2::o2_roomOps() { +void ScummEngine_v2::o2_roomOps() { int a = getVarOrDirectByte(0x80); int b = getVarOrDirectByte(0x40); @@ -1367,7 +1367,7 @@ void Scumm_v2::o2_roomOps() { } } -void Scumm_v2::o2_cutscene() { +void ScummEngine_v2::o2_cutscene() { //warning("TODO o2_cutscene()"); vm.cutSceneData[0] = _userState | (_userPut ? 16 : 0); @@ -1391,7 +1391,7 @@ void Scumm_v2::o2_cutscene() { vm.cutScenePtr[0] = 0; } -void Scumm_v2::o2_endCutscene() { +void ScummEngine_v2::o2_endCutscene() { //warning("TODO o2_endCutscene()"); vm.cutSceneStackPointer = 0; @@ -1417,7 +1417,7 @@ void Scumm_v2::o2_endCutscene() { } } -void Scumm_v2::o2_beginOverride() { +void ScummEngine_v2::o2_beginOverride() { vm.cutScenePtr[0] = _scriptPointer - _scriptOrgPointer; vm.cutSceneScript[0] = _currentScript; @@ -1426,14 +1426,14 @@ void Scumm_v2::o2_beginOverride() { fetchScriptWord(); } -void Scumm_v2::o2_chainScript() { +void ScummEngine_v2::o2_chainScript() { int data = getVarOrDirectByte(0x80); stopScript(vm.slot[_currentScript].number); _currentScript = 0xFF; runScript(data, 0, 0, 0); } -void Scumm_v2::o2_pickupObject() { +void ScummEngine_v2::o2_pickupObject() { int obj = getVarOrDirectWord(0x80); if (obj < 1) { @@ -1455,7 +1455,7 @@ void Scumm_v2::o2_pickupObject() { runInventoryScript(1); } -void Scumm_v2::o2_setObjectName() { +void ScummEngine_v2::o2_setObjectName() { int obj = getVarOrDirectWord(0x80); int size = 0; int a; @@ -1503,7 +1503,7 @@ void Scumm_v2::o2_setObjectName() { runInventoryScript(0); } -void Scumm_v2::o2_cursorCommand() { // TODO: Define the magic numbers +void ScummEngine_v2::o2_cursorCommand() { // TODO: Define the magic numbers uint16 cmd = getVarOrDirectWord(0x80); byte state = cmd >> 8; @@ -1514,7 +1514,7 @@ void Scumm_v2::o2_cursorCommand() { // TODO: Define the magic numbers setUserState(state); } -void Scumm_v2::setUserState(byte state) { +void ScummEngine_v2::setUserState(byte state) { if (state & 4) { // Userface _userState = state & (32 | 64 | 128); } @@ -1549,20 +1549,20 @@ void Scumm_v2::setUserState(byte state) { runInventoryScript(1); } -void Scumm_v2::o2_getActorWalkBox() { +void ScummEngine_v2::o2_getActorWalkBox() { Actor *a; getResultPos(); a = derefActor(getVarOrDirectByte(0x80), "o2_getActorWalkbox"); setResult(a->walkbox); } -void Scumm_v2::o2_dummy() { +void ScummEngine_v2::o2_dummy() { // Opcode 238 is used in Zak but has no purpose if (!(_gameId == GID_ZAK && _opcode == 238)) warning("o2_dummy invoked (opcode %d)", _opcode); } -void Scumm_v2::o2_switchCostumeSet() { +void ScummEngine_v2::o2_switchCostumeSet() { // NES version of maniac uses this to switch between the two // groups of costumes it has if (_features & GF_NES) { @@ -1572,7 +1572,7 @@ void Scumm_v2::o2_switchCostumeSet() { o2_dummy(); } -void Scumm_v2::resetSentence() { +void ScummEngine_v2::resetSentence() { VAR(VAR_SENTENCE_VERB) = VAR(VAR_BACKUP_VERB); VAR(VAR_SENTENCE_OBJECT1) = 0; VAR(VAR_SENTENCE_OBJECT2) = 0; diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index abe0111fd8..6d695c7864 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -29,9 +29,9 @@ #include "scumm/sound.h" #include "scumm/verbs.h" -#define OPCODE(x) { &Scumm_v5::x, #x } +#define OPCODE(x) { &ScummEngine_v5::x, #x } -void Scumm_v5::setupOpcodes() { +void ScummEngine_v5::setupOpcodes() { static const OpcodeEntryV5 opcodes[256] = { /* 00 */ OPCODE(o5_stopObjectCode), @@ -358,36 +358,36 @@ void Scumm_v5::setupOpcodes() { _opcodesV5 = opcodes; } -void Scumm_v5::executeOpcode(byte i) { +void ScummEngine_v5::executeOpcode(byte i) { OpcodeProcV5 op = _opcodesV5[i].proc; (this->*op) (); } -const char *Scumm_v5::getOpcodeDesc(byte i) { +const char *ScummEngine_v5::getOpcodeDesc(byte i) { return _opcodesV5[i].desc; } -int Scumm_v5::getVar() { +int ScummEngine_v5::getVar() { return readVar(fetchScriptWord()); } -int Scumm_v5::getVarOrDirectByte(byte mask) { +int ScummEngine_v5::getVarOrDirectByte(byte mask) { if (_opcode & mask) return getVar(); return fetchScriptByte(); } -int Scumm_v5::getVarOrDirectWord(byte mask) { +int ScummEngine_v5::getVarOrDirectWord(byte mask) { if (_opcode & mask) return getVar(); return (int16)fetchScriptWord(); } -void Scumm_v5::o5_actorFollowCamera() { +void ScummEngine_v5::o5_actorFollowCamera() { actorFollowCamera(getVarOrDirectByte(0x80)); } -void Scumm_v5::o5_actorFromPos() { +void ScummEngine_v5::o5_actorFromPos() { int x, y; getResultPos(); x = getVarOrDirectWord(0x80); @@ -395,7 +395,7 @@ void Scumm_v5::o5_actorFromPos() { setResult(getActorFromPos(x, y)); } -void Scumm_v5::o5_actorSet() { +void ScummEngine_v5::o5_actorSet() { static const byte convertTable[20] = { 1, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20 }; int act = getVarOrDirectByte(0x80); @@ -527,7 +527,7 @@ void Scumm_v5::o5_actorSet() { } } -void Scumm_v5::o5_setClass() { +void ScummEngine_v5::o5_setClass() { int obj = getVarOrDirectWord(0x80); int newClass; @@ -546,7 +546,7 @@ void Scumm_v5::o5_setClass() { } } -void Scumm_v5::o5_add() { +void ScummEngine_v5::o5_add() { int a; getResultPos(); a = getVarOrDirectWord(0x80); @@ -583,26 +583,26 @@ void Scumm_v5::o5_add() { setResult(readVar(_resultVarNumber) + a); } -void Scumm_v5::o5_and() { +void ScummEngine_v5::o5_and() { int a; getResultPos(); a = getVarOrDirectWord(0x80); setResult(readVar(_resultVarNumber) & a); } -void Scumm_v5::o5_animateActor() { +void ScummEngine_v5::o5_animateActor() { int act = getVarOrDirectByte(0x80); int anim = getVarOrDirectByte(0x40); Actor *a = derefActor(act, "o5_animateActor"); a->animateActor(anim); } -void Scumm_v5::o5_breakHere() { +void ScummEngine_v5::o5_breakHere() { updateScriptPtr(); _currentScript = 0xFF; } -void Scumm_v5::o5_chainScript() { +void ScummEngine_v5::o5_chainScript() { int vars[16]; int script; int cur; @@ -630,7 +630,7 @@ void Scumm_v5::o5_chainScript() { runScript(script, vm.slot[cur].freezeResistant, vm.slot[cur].recursive, vars); } -void Scumm_v5::o5_cursorCommand() { +void ScummEngine_v5::o5_cursorCommand() { int i, j, k; int table[16]; switch ((_opcode = fetchScriptByte()) & 0x1F) { @@ -707,27 +707,27 @@ void Scumm_v5::o5_cursorCommand() { } } -void Scumm_v5::o5_cutscene() { +void ScummEngine_v5::o5_cutscene() { int args[16]; getWordVararg(args); beginCutscene(args); } -void Scumm_v5::o5_endCutscene() { +void ScummEngine_v5::o5_endCutscene() { endCutscene(); } -void Scumm_v5::o5_debug() { +void ScummEngine_v5::o5_debug() { int a = getVarOrDirectWord(0x80); debug(1, "o5_debug(%d)", a); } -void Scumm_v5::o5_decrement() { +void ScummEngine_v5::o5_decrement() { getResultPos(); setResult(readVar(_resultVarNumber) - 1); } -void Scumm_v5::o5_delay() { +void ScummEngine_v5::o5_delay() { int delay = fetchScriptByte(); delay |= fetchScriptByte() << 8; delay |= fetchScriptByte() << 16; @@ -736,13 +736,13 @@ void Scumm_v5::o5_delay() { o5_breakHere(); } -void Scumm_v5::o5_delayVariable() { +void ScummEngine_v5::o5_delayVariable() { vm.slot[_currentScript].delay = getVar(); vm.slot[_currentScript].status = ssPaused; o5_breakHere(); } -void Scumm_v5::o5_divide() { +void ScummEngine_v5::o5_divide() { int a; getResultPos(); a = getVarOrDirectWord(0x80); @@ -753,7 +753,7 @@ void Scumm_v5::o5_divide() { setResult(readVar(_resultVarNumber) / a); } -void Scumm_v5::o5_doSentence() { +void ScummEngine_v5::o5_doSentence() { int verb; SentenceTab *st; @@ -774,7 +774,7 @@ void Scumm_v5::o5_doSentence() { st->freezeCount = 0; } -void Scumm_v5::o5_drawBox() { +void ScummEngine_v5::o5_drawBox() { int x, y, x2, y2, color; x = getVarOrDirectWord(0x80); @@ -788,7 +788,7 @@ void Scumm_v5::o5_drawBox() { drawBox(x, y, x2, y2, color); } -void Scumm_v5::o5_drawObject() { +void ScummEngine_v5::o5_drawObject() { int state, obj, idx, i; ObjectData *od; uint16 x, y, w, h; @@ -845,7 +845,7 @@ void Scumm_v5::o5_drawObject() { putState(obj, state); } -void Scumm_v5::o5_getStringWidth() { +void ScummEngine_v5::o5_getStringWidth() { // TODO - not sure if this is correct... needs testing int string, width = 0; byte *ptr; @@ -861,7 +861,7 @@ void Scumm_v5::o5_getStringWidth() { warning("o5_getStringWidth, result %d", width); } -void Scumm_v5::o5_saveLoadVars() { +void ScummEngine_v5::o5_saveLoadVars() { // TODO if (fetchScriptByte() == 1) saveVars(); @@ -869,7 +869,7 @@ void Scumm_v5::o5_saveLoadVars() { loadVars(); } -void Scumm_v5::saveVars() { +void ScummEngine_v5::saveVars() { int a, b; while ((_opcode = fetchScriptByte()) != 0) { @@ -902,7 +902,7 @@ void Scumm_v5::saveVars() { } } -void Scumm_v5::loadVars() { +void ScummEngine_v5::loadVars() { int a, b; hexdump(_scriptPointer, 64); @@ -936,7 +936,7 @@ void Scumm_v5::loadVars() { } } -void Scumm_v5::o5_expression() { +void ScummEngine_v5::o5_expression() { int dst, i; _scummStackPos = 0; @@ -978,28 +978,28 @@ void Scumm_v5::o5_expression() { setResult(pop()); } -void Scumm_v5::o5_faceActor() { +void ScummEngine_v5::o5_faceActor() { int act = getVarOrDirectByte(0x80); int obj = getVarOrDirectWord(0x40); Actor *a = derefActor(act, "o5_faceActor"); a->faceToObject(obj); } -void Scumm_v5::o5_findInventory() { +void ScummEngine_v5::o5_findInventory() { getResultPos(); int x = getVarOrDirectByte(0x80); int y = getVarOrDirectByte(0x40); setResult(findInventory(x, y)); } -void Scumm_v5::o5_findObject() { +void ScummEngine_v5::o5_findObject() { getResultPos(); int x = getVarOrDirectByte(0x80); int y = getVarOrDirectByte(0x40); setResult(findObject(x, y)); } -void Scumm_v5::o5_freezeScripts() { +void ScummEngine_v5::o5_freezeScripts() { int scr = getVarOrDirectByte(0x80); if (scr != 0) @@ -1008,35 +1008,35 @@ void Scumm_v5::o5_freezeScripts() { unfreezeScripts(); } -void Scumm_v5::o5_getActorCostume() { +void ScummEngine_v5::o5_getActorCostume() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorCostume"); setResult(a->costume); } -void Scumm_v5::o5_getActorElevation() { +void ScummEngine_v5::o5_getActorElevation() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorElevation"); setResult(a->elevation); } -void Scumm_v5::o5_getActorFacing() { +void ScummEngine_v5::o5_getActorFacing() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorFacing"); setResult(newDirToOldDir(a->getFacing())); } -void Scumm_v5::o5_getActorMoving() { +void ScummEngine_v5::o5_getActorMoving() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorMoving"); setResult(a->moving); } -void Scumm_v5::o5_getActorRoom() { +void ScummEngine_v5::o5_getActorRoom() { getResultPos(); int act = getVarOrDirectByte(0x80); // WORKAROUND bug #746349. This is a really odd bug in either the script @@ -1051,7 +1051,7 @@ void Scumm_v5::o5_getActorRoom() { setResult(a->room); } -void Scumm_v5::o5_getActorScale() { +void ScummEngine_v5::o5_getActorScale() { Actor *a; // dummy opcode in the loom @@ -1075,21 +1075,21 @@ void Scumm_v5::o5_getActorScale() { setResult(a->scalex); } -void Scumm_v5::o5_getActorWalkBox() { +void ScummEngine_v5::o5_getActorWalkBox() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorWalkBox"); setResult(a->walkbox); } -void Scumm_v5::o5_getActorWidth() { +void ScummEngine_v5::o5_getActorWidth() { getResultPos(); int act = getVarOrDirectByte(0x80); Actor *a = derefActor(act, "o5_getActorWidth"); setResult(a->width); } -void Scumm_v5::o5_getActorX() { +void ScummEngine_v5::o5_getActorX() { int a; getResultPos(); @@ -1101,7 +1101,7 @@ void Scumm_v5::o5_getActorX() { setResult(getObjX(a)); } -void Scumm_v5::o5_getActorY() { +void ScummEngine_v5::o5_getActorY() { int a; getResultPos(); @@ -1119,7 +1119,7 @@ void Scumm_v5::o5_getActorY() { setResult(getObjY(a)); } -void Scumm_v5::o5_saveLoadGame() { +void ScummEngine_v5::o5_saveLoadGame() { getResultPos(); byte a = getVarOrDirectByte(0x80); byte slot = (a & 0x1F) + 1; @@ -1173,7 +1173,7 @@ void Scumm_v5::o5_saveLoadGame() { setResult(result); } -void Scumm_v5::o5_getAnimCounter() { +void ScummEngine_v5::o5_getAnimCounter() { if (_version == 3) { o5_saveLoadGame(); return; @@ -1186,7 +1186,7 @@ void Scumm_v5::o5_getAnimCounter() { setResult(a->cost.animCounter); } -void Scumm_v5::o5_getClosestObjActor() { +void ScummEngine_v5::o5_getClosestObjActor() { int obj; int act; int dist; @@ -1217,7 +1217,7 @@ void Scumm_v5::o5_getClosestObjActor() { setResult(closest_obj); } -void Scumm_v5::o5_getDist() { +void ScummEngine_v5::o5_getDist() { int o1, o2; int r; getResultPos(); @@ -1232,17 +1232,17 @@ void Scumm_v5::o5_getDist() { setResult(r); } -void Scumm_v5::o5_getInventoryCount() { +void ScummEngine_v5::o5_getInventoryCount() { getResultPos(); setResult(getInventoryCount(getVarOrDirectByte(0x80))); } -void Scumm_v5::o5_getObjectOwner() { +void ScummEngine_v5::o5_getObjectOwner() { getResultPos(); setResult(getOwner(getVarOrDirectWord(0x80))); } -void Scumm_v5::o5_getObjectState() { +void ScummEngine_v5::o5_getObjectState() { if (_features & GF_SMALL_HEADER) { o5_ifState(); } else { @@ -1251,7 +1251,7 @@ void Scumm_v5::o5_getObjectState() { } } -void Scumm_v5::o5_ifState() { +void ScummEngine_v5::o5_ifState() { int a = getVarOrDirectWord(0x80); int b = getVarOrDirectByte(0x40); @@ -1261,7 +1261,7 @@ void Scumm_v5::o5_ifState() { ignoreScriptWord(); } -void Scumm_v5::o5_ifNotState() { +void ScummEngine_v5::o5_ifNotState() { int a = getVarOrDirectWord(0x80); int b = getVarOrDirectByte(0x40); @@ -1271,17 +1271,17 @@ void Scumm_v5::o5_ifNotState() { ignoreScriptWord(); } -void Scumm_v5::o5_getRandomNr() { +void ScummEngine_v5::o5_getRandomNr() { getResultPos(); setResult(_rnd.getRandomNumber(getVarOrDirectByte(0x80))); } -void Scumm_v5::o5_isScriptRunning() { +void ScummEngine_v5::o5_isScriptRunning() { getResultPos(); setResult(isScriptRunning(getVarOrDirectByte(0x80))); } -void Scumm_v5::o5_getVerbEntrypoint() { +void ScummEngine_v5::o5_getVerbEntrypoint() { int a, b; getResultPos(); a = getVarOrDirectWord(0x80); @@ -1290,7 +1290,7 @@ void Scumm_v5::o5_getVerbEntrypoint() { setResult(getVerbEntrypoint(a, b)); } -void Scumm_v5::o5_ifClassOfIs() { +void ScummEngine_v5::o5_ifClassOfIs() { int act, cls, b = 0; bool cond = true; @@ -1313,12 +1313,12 @@ void Scumm_v5::o5_ifClassOfIs() { o5_jumpRelative(); } -void Scumm_v5::o5_increment() { +void ScummEngine_v5::o5_increment() { getResultPos(); setResult(readVar(_resultVarNumber) + 1); } -void Scumm_v5::o5_isActorInBox() { +void ScummEngine_v5::o5_isActorInBox() { int act = getVarOrDirectByte(0x80); int box = getVarOrDirectByte(0x40); Actor *a = derefActor(act, "o5_isActorInBox"); @@ -1329,7 +1329,7 @@ void Scumm_v5::o5_isActorInBox() { ignoreScriptWord(); } -void Scumm_v5::o5_isEqual() { +void ScummEngine_v5::o5_isEqual() { int16 a, b; int var; @@ -1355,7 +1355,7 @@ void Scumm_v5::o5_isEqual() { } -void Scumm_v5::o5_isGreater() { +void ScummEngine_v5::o5_isGreater() { int16 a = getVar(); int16 b = getVarOrDirectWord(0x80); if (b > a) @@ -1364,7 +1364,7 @@ void Scumm_v5::o5_isGreater() { o5_jumpRelative(); } -void Scumm_v5::o5_isGreaterEqual() { +void ScummEngine_v5::o5_isGreaterEqual() { int16 a = getVar(); int16 b = getVarOrDirectWord(0x80); if (b >= a) @@ -1373,7 +1373,7 @@ void Scumm_v5::o5_isGreaterEqual() { o5_jumpRelative(); } -void Scumm_v5::o5_isLess() { +void ScummEngine_v5::o5_isLess() { int16 a = getVar(); int16 b = getVarOrDirectWord(0x80); @@ -1383,7 +1383,7 @@ void Scumm_v5::o5_isLess() { o5_jumpRelative(); } -void Scumm_v5::o5_lessOrEqual() { +void ScummEngine_v5::o5_lessOrEqual() { int16 a = getVar(); int16 b = getVarOrDirectWord(0x80); if (b <= a) @@ -1392,7 +1392,7 @@ void Scumm_v5::o5_lessOrEqual() { o5_jumpRelative(); } -void Scumm_v5::o5_isNotEqual() { +void ScummEngine_v5::o5_isNotEqual() { int16 a = getVar(); int16 b = getVarOrDirectWord(0x80); if (b != a) @@ -1401,7 +1401,7 @@ void Scumm_v5::o5_isNotEqual() { o5_jumpRelative(); } -void Scumm_v5::o5_notEqualZero() { +void ScummEngine_v5::o5_notEqualZero() { int a = getVar(); if (a != 0) ignoreScriptWord(); @@ -1409,7 +1409,7 @@ void Scumm_v5::o5_notEqualZero() { o5_jumpRelative(); } -void Scumm_v5::o5_equalZero() { +void ScummEngine_v5::o5_equalZero() { int a = getVar(); if (a == 0) ignoreScriptWord(); @@ -1417,11 +1417,11 @@ void Scumm_v5::o5_equalZero() { o5_jumpRelative(); } -void Scumm_v5::o5_jumpRelative() { +void ScummEngine_v5::o5_jumpRelative() { _scriptPointer += (int16)fetchScriptWord(); } -void Scumm_v5::o5_lights() { +void ScummEngine_v5::o5_lights() { int a, b, c; a = getVarOrDirectByte(0x80); @@ -1437,7 +1437,7 @@ void Scumm_v5::o5_lights() { _fullRedraw = 1; } -void Scumm_v5::o5_loadRoom() { +void ScummEngine_v5::o5_loadRoom() { int room; room = getVarOrDirectByte(0x80); @@ -1451,7 +1451,7 @@ void Scumm_v5::o5_loadRoom() { _fullRedraw = 1; } -void Scumm_v5::o5_loadRoomWithEgo() { +void ScummEngine_v5::o5_loadRoomWithEgo() { Actor *a; int obj, room, x, y; int x2, y2, dir, oldDir; @@ -1497,7 +1497,7 @@ void Scumm_v5::o5_loadRoomWithEgo() { } } -void Scumm_v5::o5_matrixOps() { +void ScummEngine_v5::o5_matrixOps() { int a, b; if (_version == 3) { @@ -1530,37 +1530,37 @@ void Scumm_v5::o5_matrixOps() { } } -void Scumm_v5::o5_move() { +void ScummEngine_v5::o5_move() { getResultPos(); setResult(getVarOrDirectWord(0x80)); } -void Scumm_v5::o5_multiply() { +void ScummEngine_v5::o5_multiply() { int a; getResultPos(); a = getVarOrDirectWord(0x80); setResult(readVar(_resultVarNumber) * a); } -void Scumm_v5::o5_or() { +void ScummEngine_v5::o5_or() { int a; getResultPos(); a = getVarOrDirectWord(0x80); setResult(readVar(_resultVarNumber) | a); } -void Scumm_v5::o5_beginOverride() { +void ScummEngine_v5::o5_beginOverride() { if (fetchScriptByte() != 0) beginOverride(); else endOverride(); } -void Scumm_v5::o5_panCameraTo() { +void ScummEngine_v5::o5_panCameraTo() { panCameraTo(getVarOrDirectWord(0x80), 0); } -void Scumm_v5::o5_pickupObject() { +void ScummEngine_v5::o5_pickupObject() { int obj, room; if (_version == 3 || _version == 4) { o5_drawObject(); @@ -1580,17 +1580,17 @@ void Scumm_v5::o5_pickupObject() { runInventoryScript(1); } -void Scumm_v5::o5_print() { +void ScummEngine_v5::o5_print() { _actorToPrintStrFor = getVarOrDirectByte(0x80); decodeParseString(); } -void Scumm_v5::o5_printEgo() { +void ScummEngine_v5::o5_printEgo() { _actorToPrintStrFor = (byte)VAR(VAR_EGO); decodeParseString(); } -void Scumm_v5::o5_pseudoRoom() { +void ScummEngine_v5::o5_pseudoRoom() { int i = fetchScriptByte(), j; while ((j = fetchScriptByte()) != 0) { if (j >= 0x80) { @@ -1599,7 +1599,7 @@ void Scumm_v5::o5_pseudoRoom() { } } -void Scumm_v5::o5_putActor() { +void ScummEngine_v5::o5_putActor() { int x, y; Actor *a; @@ -1609,7 +1609,7 @@ void Scumm_v5::o5_putActor() { a->putActor(x, y, a->room); } -void Scumm_v5::o5_putActorAtObject() { +void ScummEngine_v5::o5_putActorAtObject() { int obj, x, y; Actor *a; @@ -1624,7 +1624,7 @@ void Scumm_v5::o5_putActorAtObject() { a->putActor(x, y, a->room); } -void Scumm_v5::o5_putActorInRoom() { +void ScummEngine_v5::o5_putActorInRoom() { Actor *a; int act = getVarOrDirectByte(0x80); int room = getVarOrDirectByte(0x40); @@ -1655,7 +1655,7 @@ void Scumm_v5::o5_putActorInRoom() { a->putActor(0, 0, 0); } -void Scumm_v5::o5_quitPauseRestart() { +void ScummEngine_v5::o5_quitPauseRestart() { byte subOp = fetchScriptByte(); switch (subOp) { case 1: // Restart @@ -1672,7 +1672,7 @@ void Scumm_v5::o5_quitPauseRestart() { } } -void Scumm_v5::o5_resourceRoutines() { +void ScummEngine_v5::o5_resourceRoutines() { const ResTypes resType[4] = { rtScript, rtSound, rtCostume, rtRoom }; int resid = 0; int foo, bar; @@ -1799,7 +1799,7 @@ void Scumm_v5::o5_resourceRoutines() { } } -void Scumm_v5::o5_roomOps() { +void ScummEngine_v5::o5_roomOps() { int a = 0, b = 0, c, d, e; if (_version == 3) { @@ -2004,7 +2004,7 @@ void Scumm_v5::o5_roomOps() { } } -void Scumm_v5::o5_saveRestoreVerbs() { +void ScummEngine_v5::o5_saveRestoreVerbs() { int a, b, c, slot, slot2; _opcode = fetchScriptByte(); @@ -2053,11 +2053,11 @@ void Scumm_v5::o5_saveRestoreVerbs() { } } -void Scumm_v5::o5_setCameraAt() { +void ScummEngine_v5::o5_setCameraAt() { setCameraAtEx(getVarOrDirectWord(0x80)); } -void Scumm_v5::o5_setObjectName() { +void ScummEngine_v5::o5_setObjectName() { int obj = getVarOrDirectWord(0x80); int size; int a; @@ -2165,7 +2165,7 @@ void Scumm_v5::o5_setObjectName() { runInventoryScript(0); } -void Scumm_v5::o5_setOwnerOf() { +void ScummEngine_v5::o5_setOwnerOf() { int obj, owner; obj = getVarOrDirectWord(0x80); @@ -2174,7 +2174,7 @@ void Scumm_v5::o5_setOwnerOf() { setOwnerOf(obj, owner); } -void Scumm_v5::o5_setState() { +void ScummEngine_v5::o5_setState() { int obj, state; obj = getVarOrDirectWord(0x80); state = getVarOrDirectByte(0x40); @@ -2184,7 +2184,7 @@ void Scumm_v5::o5_setState() { clearDrawObjectQueue(); } -void Scumm_v5::o5_setVarRange() { +void ScummEngine_v5::o5_setVarRange() { int a, b; getResultPos(); @@ -2200,7 +2200,7 @@ void Scumm_v5::o5_setVarRange() { } while (--a); } -void Scumm_v5::o5_startMusic() { +void ScummEngine_v5::o5_startMusic() { if (_features & GF_FMTOWNS) { // In FM Towns games this is some kind of Audio CD status query function. // See also bug #762589 (thanks to Hibernatus for providing the information). @@ -2236,20 +2236,20 @@ void Scumm_v5::o5_startMusic() { } } -void Scumm_v5::o5_startSound() { +void ScummEngine_v5::o5_startSound() { VAR(VAR_MUSIC_TIMER) = 0; _sound->addSoundToQueue(getVarOrDirectByte(0x80)); } -void Scumm_v5::o5_stopMusic() { +void ScummEngine_v5::o5_stopMusic() { _sound->stopAllSounds(); } -void Scumm_v5::o5_stopSound() { +void ScummEngine_v5::o5_stopSound() { _sound->stopSound(getVarOrDirectByte(0x80)); } -void Scumm_v5::o5_isSoundRunning() { +void ScummEngine_v5::o5_isSoundRunning() { int snd; getResultPos(); snd = getVarOrDirectByte(0x80); @@ -2258,7 +2258,7 @@ void Scumm_v5::o5_isSoundRunning() { setResult(snd); } -void Scumm_v5::o5_soundKludge() { +void ScummEngine_v5::o5_soundKludge() { int items[16]; int i; @@ -2282,7 +2282,7 @@ void Scumm_v5::o5_soundKludge() { _sound->soundKludge(items, num); } -void Scumm_v5::o5_startObject() { +void ScummEngine_v5::o5_startObject() { int obj, script; int data[16]; @@ -2293,7 +2293,7 @@ void Scumm_v5::o5_startObject() { runObjectScript(obj, script, 0, 0, data); } -void Scumm_v5::o5_startScript() { +void ScummEngine_v5::o5_startScript() { int op, script; int data[16]; @@ -2305,15 +2305,15 @@ void Scumm_v5::o5_startScript() { runScript(script, (op & 0x20) != 0, (op & 0x40) != 0, data); } -void Scumm_v5::o5_stopObjectCode() { +void ScummEngine_v5::o5_stopObjectCode() { stopObjectCode(); } -void Scumm_v5::o5_stopObjectScript() { +void ScummEngine_v5::o5_stopObjectScript() { stopObjectScript(getVarOrDirectWord(0x80)); } -void Scumm_v5::o5_stopScript() { +void ScummEngine_v5::o5_stopScript() { int script; script = getVarOrDirectByte(0x80); @@ -2332,7 +2332,7 @@ void Scumm_v5::o5_stopScript() { stopScript(script); } -void Scumm_v5::o5_stringOps() { +void ScummEngine_v5::o5_stringOps() { int a, b, c, i; byte *ptr; @@ -2387,14 +2387,14 @@ void Scumm_v5::o5_stringOps() { } } -void Scumm_v5::o5_subtract() { +void ScummEngine_v5::o5_subtract() { int a; getResultPos(); a = getVarOrDirectWord(0x80); setResult(readVar(_resultVarNumber) - a); } -void Scumm_v5::o5_verbOps() { +void ScummEngine_v5::o5_verbOps() { int verb, slot; VerbSlot *vs; int a, b; @@ -2565,7 +2565,7 @@ void Scumm_v5::o5_verbOps() { verbMouseOver(0); } -void Scumm_v5::o5_wait() { +void ScummEngine_v5::o5_wait() { const byte *oldaddr = _scriptPointer - 1; if ((_gameId == GID_INDY3) && !(_features & GF_MACINTOSH)) { @@ -2606,7 +2606,7 @@ void Scumm_v5::o5_wait() { o5_breakHere(); } -void Scumm_v5::o5_walkActorTo() { +void ScummEngine_v5::o5_walkActorTo() { int x, y; Actor *a; @@ -2616,7 +2616,7 @@ void Scumm_v5::o5_walkActorTo() { a->startWalkActor(x, y, -1); } -void Scumm_v5::o5_walkActorToActor() { +void ScummEngine_v5::o5_walkActorToActor() { int x, y; Actor *a, *a2; int nr = getVarOrDirectByte(0x80); @@ -2677,7 +2677,7 @@ void Scumm_v5::o5_walkActorToActor() { a->startWalkActor(x, y, -1); } -void Scumm_v5::o5_walkActorToObject() { +void ScummEngine_v5::o5_walkActorToObject() { int obj; Actor *a; @@ -2690,7 +2690,7 @@ void Scumm_v5::o5_walkActorToObject() { } } -int Scumm_v5::getWordVararg(int *ptr) { +int ScummEngine_v5::getWordVararg(int *ptr) { int i; for (i = 0; i < 16; i++) @@ -2703,7 +2703,7 @@ int Scumm_v5::getWordVararg(int *ptr) { return i; } -void Scumm_v5::decodeParseString() { +void ScummEngine_v5::decodeParseString() { int textSlot; switch (_actorToPrintStrFor) { @@ -2739,7 +2739,7 @@ void Scumm_v5::decodeParseString() { { int a = getVarOrDirectWord(0x80); int b = getVarOrDirectWord(0x40); - warning("Scumm_v5::decodeParseString: Unhandled case 3: %d, %d", a, b); + warning("ScummEngine_v5::decodeParseString: Unhandled case 3: %d, %d", a, b); } break; case 4: /* center */ @@ -2821,7 +2821,7 @@ void Scumm_v5::decodeParseString() { _scriptPointer = _messagePtr; return; default: - warning("Scumm_v5::decodeParseString: Unhandled case %d", _opcode & 0xF); + warning("ScummEngine_v5::decodeParseString: Unhandled case %d", _opcode & 0xF); return; } } @@ -2835,7 +2835,7 @@ void Scumm_v5::decodeParseString() { _string[textSlot].t_charset = _string[textSlot].charset; } -void Scumm_v5::o5_oldRoomEffect() { +void ScummEngine_v5::o5_oldRoomEffect() { int a; _opcode = fetchScriptByte(); @@ -2907,7 +2907,7 @@ printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a); } } -void Scumm_v5::o5_pickupObjectOld() { +void ScummEngine_v5::o5_pickupObjectOld() { int obj = getVarOrDirectWord(0x80); if (obj < 1) { diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 6dc24eee59..8ea37363e7 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -40,9 +40,9 @@ #include "scumm/dialogs.h" // FIXME: This is just for the FT-INSANE warning. // Remove when INSANE is implemented -#define OPCODE(x) { &Scumm_v6::x, #x } +#define OPCODE(x) { &ScummEngine_v6::x, #x } -void Scumm_v6::setupOpcodes() { +void ScummEngine_v6::setupOpcodes() { static const OpcodeEntryV6 opcodes[256] = { /* 00 */ OPCODE(o6_pushByte), @@ -369,16 +369,16 @@ void Scumm_v6::setupOpcodes() { _opcodesV6 = opcodes; } -void Scumm_v6::executeOpcode(byte i) { +void ScummEngine_v6::executeOpcode(byte i) { OpcodeProcV6 op = _opcodesV6[i].proc; (this->*op) (); } -const char *Scumm_v6::getOpcodeDesc(byte i) { +const char *ScummEngine_v6::getOpcodeDesc(byte i) { return _opcodesV6[i].desc; } -int Scumm_v6::popRoomAndObj(int *room) { +int ScummEngine_v6::popRoomAndObj(int *room) { int obj; if (_version >= 7) { @@ -393,7 +393,7 @@ int Scumm_v6::popRoomAndObj(int *room) { } -int Scumm::readArray(int array, int idx, int base) { +int ScummEngine::readArray(int array, int idx, int base) { ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); if (ah == NULL || ah->data == NULL) { @@ -418,7 +418,7 @@ int Scumm::readArray(int array, int idx, int base) { } } -void Scumm::writeArray(int array, int idx, int base, int value) { +void ScummEngine::writeArray(int array, int idx, int base, int value) { ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array)); if (!ah) return; @@ -445,7 +445,7 @@ void Scumm::writeArray(int array, int idx, int base, int value) { } } -int Scumm_v6::getStackList(int *args, uint maxnum) { +int ScummEngine_v6::getStackList(int *args, uint maxnum) { uint num, i; for (i = 0; i < maxnum; i++) @@ -464,225 +464,225 @@ int Scumm_v6::getStackList(int *args, uint maxnum) { return num; } -void Scumm_v6::o6_pushByte() { +void ScummEngine_v6::o6_pushByte() { push(fetchScriptByte()); } -void Scumm_v6::o6_pushWord() { +void ScummEngine_v6::o6_pushWord() { push(fetchScriptWordSigned()); } -void Scumm_v6::o6_pushByteVar() { +void ScummEngine_v6::o6_pushByteVar() { push(readVar(fetchScriptByte())); } -void Scumm_v6::o6_pushWordVar() { +void ScummEngine_v6::o6_pushWordVar() { push(readVar(fetchScriptWord())); } -void Scumm_v6::o6_invalid() { +void ScummEngine_v6::o6_invalid() { error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer); } -void Scumm_v6::o6_byteArrayRead() { +void ScummEngine_v6::o6_byteArrayRead() { int base = pop(); push(readArray(fetchScriptByte(), 0, base)); } -void Scumm_v6::o6_wordArrayRead() { +void ScummEngine_v6::o6_wordArrayRead() { int base = pop(); push(readArray(fetchScriptWord(), 0, base)); } -void Scumm_v6::o6_byteArrayIndexedRead() { +void ScummEngine_v6::o6_byteArrayIndexedRead() { int base = pop(); int idx = pop(); push(readArray(fetchScriptByte(), idx, base)); } -void Scumm_v6::o6_wordArrayIndexedRead() { +void ScummEngine_v6::o6_wordArrayIndexedRead() { int base = pop(); int idx = pop(); push(readArray(fetchScriptWord(), idx, base)); } -void Scumm_v6::o6_dup() { +void ScummEngine_v6::o6_dup() { int a = pop(); push(a); push(a); } -void Scumm_v6::o6_not() { +void ScummEngine_v6::o6_not() { push(pop() == 0); } -void Scumm_v6::o6_eq() { +void ScummEngine_v6::o6_eq() { push(pop() == pop()); } -void Scumm_v6::o6_neq() { +void ScummEngine_v6::o6_neq() { push(pop() != pop()); } -void Scumm_v6::o6_gt() { +void ScummEngine_v6::o6_gt() { int a = pop(); push(pop() > a); } -void Scumm_v6::o6_lt() { +void ScummEngine_v6::o6_lt() { int a = pop(); push(pop() < a); } -void Scumm_v6::o6_le() { +void ScummEngine_v6::o6_le() { int a = pop(); push(pop() <= a); } -void Scumm_v6::o6_ge() { +void ScummEngine_v6::o6_ge() { int a = pop(); push(pop() >= a); } -void Scumm_v6::o6_add() { +void ScummEngine_v6::o6_add() { int a = pop(); push(pop() + a); } -void Scumm_v6::o6_sub() { +void ScummEngine_v6::o6_sub() { int a = pop(); push(pop() - a); } -void Scumm_v6::o6_mul() { +void ScummEngine_v6::o6_mul() { int a = pop(); push(pop() * a); } -void Scumm_v6::o6_div() { +void ScummEngine_v6::o6_div() { int a = pop(); if (a == 0) error("division by zero"); push(pop() / a); } -void Scumm_v6::o6_land() { +void ScummEngine_v6::o6_land() { int a = pop(); push(pop() && a); } -void Scumm_v6::o6_lor() { +void ScummEngine_v6::o6_lor() { int a = pop(); push(pop() || a); } -void Scumm_v6::o6_bor() { +void ScummEngine_v6::o6_bor() { int a = pop(); push(pop() | a); } -void Scumm_v6::o6_band() { +void ScummEngine_v6::o6_band() { int a = pop(); push(pop() & a); } -void Scumm_v6::o6_pop() { +void ScummEngine_v6::o6_pop() { pop(); } -void Scumm_v6::o6_writeByteVar() { +void ScummEngine_v6::o6_writeByteVar() { writeVar(fetchScriptByte(), pop()); } -void Scumm_v6::o6_writeWordVar() { +void ScummEngine_v6::o6_writeWordVar() { writeVar(fetchScriptWord(), pop()); } -void Scumm_v6::o6_byteArrayWrite() { +void ScummEngine_v6::o6_byteArrayWrite() { int a = pop(); writeArray(fetchScriptByte(), 0, pop(), a); } -void Scumm_v6::o6_wordArrayWrite() { +void ScummEngine_v6::o6_wordArrayWrite() { int a = pop(); writeArray(fetchScriptWord(), 0, pop(), a); } -void Scumm_v6::o6_byteArrayIndexedWrite() { +void ScummEngine_v6::o6_byteArrayIndexedWrite() { int val = pop(); int base = pop(); writeArray(fetchScriptByte(), pop(), base, val); } -void Scumm_v6::o6_wordArrayIndexedWrite() { +void ScummEngine_v6::o6_wordArrayIndexedWrite() { int val = pop(); int base = pop(); writeArray(fetchScriptWord(), pop(), base, val); } -void Scumm_v6::o6_byteVarInc() { +void ScummEngine_v6::o6_byteVarInc() { int var = fetchScriptByte(); writeVar(var, readVar(var) + 1); } -void Scumm_v6::o6_wordVarInc() { +void ScummEngine_v6::o6_wordVarInc() { int var = fetchScriptWord(); writeVar(var, readVar(var) + 1); } -void Scumm_v6::o6_byteArrayInc() { +void ScummEngine_v6::o6_byteArrayInc() { int var = fetchScriptByte(); int base = pop(); writeArray(var, 0, base, readArray(var, 0, base) + 1); } -void Scumm_v6::o6_wordArrayInc() { +void ScummEngine_v6::o6_wordArrayInc() { int var = fetchScriptWord(); int base = pop(); writeArray(var, 0, base, readArray(var, 0, base) + 1); } -void Scumm_v6::o6_byteVarDec() { +void ScummEngine_v6::o6_byteVarDec() { int var = fetchScriptByte(); writeVar(var, readVar(var) - 1); } -void Scumm_v6::o6_wordVarDec() { +void ScummEngine_v6::o6_wordVarDec() { int var = fetchScriptWord(); writeVar(var, readVar(var) - 1); } -void Scumm_v6::o6_byteArrayDec() { +void ScummEngine_v6::o6_byteArrayDec() { int var = fetchScriptByte(); int base = pop(); writeArray(var, 0, base, readArray(var, 0, base) - 1); } -void Scumm_v6::o6_wordArrayDec() { +void ScummEngine_v6::o6_wordArrayDec() { int var = fetchScriptWord(); int base = pop(); writeArray(var, 0, base, readArray(var, 0, base) - 1); } -void Scumm_v6::o6_jumpTrue() { +void ScummEngine_v6::o6_jumpTrue() { if (pop()) o6_jump(); else fetchScriptWord(); } -void Scumm_v6::o6_jumpFalse() { +void ScummEngine_v6::o6_jumpFalse() { if (!pop()) o6_jump(); else fetchScriptWord(); } -void Scumm_v6::o6_jump() { +void ScummEngine_v6::o6_jump() { _scriptPointer += fetchScriptWordSigned(); } -void Scumm_v6::o6_startScriptEx() { +void ScummEngine_v6::o6_startScriptEx() { int args[16]; int script, flags; @@ -692,7 +692,7 @@ void Scumm_v6::o6_startScriptEx() { runScript(script, (flags & 1) != 0, (flags & 2) != 0, args); } -void Scumm_v6::o6_jumpToScript() { +void ScummEngine_v6::o6_jumpToScript() { int args[16]; int script, flags; @@ -703,7 +703,7 @@ void Scumm_v6::o6_jumpToScript() { runScript(script, (flags & 1) != 0, (flags & 2) != 0, args); } -void Scumm_v6::o6_startScript() { +void ScummEngine_v6::o6_startScript() { int args[16]; int script; getStackList(args, ARRAYSIZE(args)); @@ -711,7 +711,7 @@ void Scumm_v6::o6_startScript() { runScript(script, 0, 0, args); } -void Scumm_v6::o6_startScriptQuick() { +void ScummEngine_v6::o6_startScriptQuick() { int args[16]; int script; getStackList(args, ARRAYSIZE(args)); @@ -719,7 +719,7 @@ void Scumm_v6::o6_startScriptQuick() { runScript(script, 0, 1, args); } -void Scumm_v6::o6_startObjectEx() { +void ScummEngine_v6::o6_startObjectEx() { int args[16]; int script, entryp; int flags; @@ -730,7 +730,7 @@ void Scumm_v6::o6_startObjectEx() { runObjectScript(script, entryp, (flags & 1) != 0, (flags & 2) != 0, args); } -void Scumm_v6::o6_startObjectQuick() { +void ScummEngine_v6::o6_startObjectQuick() { int args[16]; int script, entryp; getStackList(args, ARRAYSIZE(args)); @@ -739,7 +739,7 @@ void Scumm_v6::o6_startObjectQuick() { runObjectScript(script, entryp, 0, 1, args); } -void Scumm_v6::o6_setObjectState() { +void ScummEngine_v6::o6_setObjectState() { int a = pop(); int b = pop(); if (a == 0) @@ -749,7 +749,7 @@ void Scumm_v6::o6_setObjectState() { setObjectState(b, a, -1, -1); } -void Scumm_v6::o6_setObjectXY() { +void ScummEngine_v6::o6_setObjectXY() { int y = pop(); int x = pop(); int obj = pop(); @@ -757,25 +757,25 @@ void Scumm_v6::o6_setObjectXY() { setObjectState(obj, 1, x, y); } -void Scumm_v6::o6_stopObjectCode() { +void ScummEngine_v6::o6_stopObjectCode() { stopObjectCode(); } -void Scumm_v6::o6_endCutscene() { +void ScummEngine_v6::o6_endCutscene() { endCutscene(); } -void Scumm_v6::o6_cutscene() { +void ScummEngine_v6::o6_cutscene() { int args[16]; getStackList(args, ARRAYSIZE(args)); beginCutscene(args); } -void Scumm_v6::o6_stopMusic() { +void ScummEngine_v6::o6_stopMusic() { _sound->stopAllSounds(); } -void Scumm_v6::o6_freezeUnfreeze() { +void ScummEngine_v6::o6_freezeUnfreeze() { int a = pop(); if (a) freezeScripts(a); @@ -783,7 +783,7 @@ void Scumm_v6::o6_freezeUnfreeze() { unfreezeScripts(); } -void Scumm_v6::o6_cursorCommand() { +void ScummEngine_v6::o6_cursorCommand() { int a, i; int args[16]; int op = fetchScriptByte(); @@ -851,12 +851,12 @@ void Scumm_v6::o6_cursorCommand() { VAR(VAR_USERPUT) = _userPut; } -void Scumm_v6::o6_breakHere() { +void ScummEngine_v6::o6_breakHere() { updateScriptPtr(); _currentScript = 0xFF; } -void Scumm_v6::o6_ifClassOfIs() { +void ScummEngine_v6::o6_ifClassOfIs() { int args[16]; int num, obj, cls; bool b; @@ -874,7 +874,7 @@ void Scumm_v6::o6_ifClassOfIs() { push(cond); } -void Scumm_v6::o6_setClass() { +void ScummEngine_v6::o6_setClass() { int args[16]; int num, obj, cls; @@ -892,11 +892,11 @@ void Scumm_v6::o6_setClass() { } } -void Scumm_v6::o6_getState() { +void ScummEngine_v6::o6_getState() { push(getState(pop())); } -void Scumm_v6::o6_setState() { +void ScummEngine_v6::o6_setState() { int state = pop(); int obj = pop(); @@ -913,36 +913,36 @@ void Scumm_v6::o6_setState() { clearDrawObjectQueue(); } -void Scumm_v6::o6_setOwner() { +void ScummEngine_v6::o6_setOwner() { int owner = pop(); int obj = pop(); setOwnerOf(obj, owner); } -void Scumm_v6::o6_getOwner() { +void ScummEngine_v6::o6_getOwner() { push(getOwner(pop())); } -void Scumm_v6::o6_startSound() { +void ScummEngine_v6::o6_startSound() { if ((_features & GF_HUMONGOUS) && (_gameId != GID_PUTTDEMO)) pop(); // offset which seems to always be zero _sound->addSoundToQueue(pop()); } -void Scumm_v6::o6_stopSound() { +void ScummEngine_v6::o6_stopSound() { _sound->stopSound(pop()); } -void Scumm_v6::o6_startMusic() { +void ScummEngine_v6::o6_startMusic() { _sound->addSoundToQueue(pop()); } -void Scumm_v6::o6_stopObjectScript() { +void ScummEngine_v6::o6_stopObjectScript() { stopObjectScript(pop()); } -void Scumm_v6::o6_panCameraTo() { +void ScummEngine_v6::o6_panCameraTo() { if (_version >= 7) { int y = pop(); int x = pop(); @@ -952,14 +952,14 @@ void Scumm_v6::o6_panCameraTo() { } } -void Scumm_v6::o6_actorFollowCamera() { +void ScummEngine_v6::o6_actorFollowCamera() { if (_version >= 7) setCameraFollows(derefActor(pop(), "actorFollowCamera")); else actorFollowCamera(pop()); } -void Scumm_v6::o6_setCameraAt() { +void ScummEngine_v6::o6_setCameraAt() { if (_version >= 7) { int x, y; @@ -975,13 +975,13 @@ void Scumm_v6::o6_setCameraAt() { } } -void Scumm_v6::o6_loadRoom() { +void ScummEngine_v6::o6_loadRoom() { int room = pop(); startScene(room, 0, 0); _fullRedraw = 1; } -void Scumm_v6::o6_stopScript() { +void ScummEngine_v6::o6_stopScript() { int script = pop(); if (script == 0) stopObjectCode(); @@ -989,7 +989,7 @@ void Scumm_v6::o6_stopScript() { stopScript(script); } -void Scumm_v6::o6_walkActorToObj() { +void ScummEngine_v6::o6_walkActorToObj() { int act, obj, dist; Actor *a, *a2; int x, y; @@ -1033,7 +1033,7 @@ void Scumm_v6::o6_walkActorToObj() { } } -void Scumm_v6::o6_walkActorTo() { +void ScummEngine_v6::o6_walkActorTo() { int x, y; y = pop(); x = pop(); @@ -1041,7 +1041,7 @@ void Scumm_v6::o6_walkActorTo() { a->startWalkActor(x, y, -1); } -void Scumm_v6::o6_putActorInRoom() { +void ScummEngine_v6::o6_putActorInRoom() { int room, x, y, act; Actor *a; @@ -1064,7 +1064,7 @@ void Scumm_v6::o6_putActorInRoom() { } -void Scumm_v6::o6_putActorAtObject() { +void ScummEngine_v6::o6_putActorAtObject() { int room, obj, x, y; Actor *a; @@ -1082,13 +1082,13 @@ void Scumm_v6::o6_putActorAtObject() { a->putActor(x, y, room); } -void Scumm_v6::o6_faceActor() { +void ScummEngine_v6::o6_faceActor() { int obj = pop(); Actor *a = derefActor(pop(), "o6_faceActor"); a->faceToObject(obj); } -void Scumm_v6::o6_animateActor() { +void ScummEngine_v6::o6_animateActor() { int anim = pop(); int act = pop(); if (_gameId == GID_TENTACLE && _roomResource == 57 && @@ -1104,7 +1104,7 @@ void Scumm_v6::o6_animateActor() { a->animateActor(anim); } -void Scumm_v6::o6_doSentence() { +void ScummEngine_v6::o6_doSentence() { int verb, objectA, objectB, dummy = 0; objectB = pop(); @@ -1116,7 +1116,7 @@ void Scumm_v6::o6_doSentence() { doSentence(verb, objectA, objectB); } -void Scumm_v6::o6_pickupObject() { +void ScummEngine_v6::o6_pickupObject() { int obj, room; int i; @@ -1141,7 +1141,7 @@ void Scumm_v6::o6_pickupObject() { runInventoryScript(obj); /* Difference */ } -void Scumm_v6::o6_loadRoomWithEgo() { +void ScummEngine_v6::o6_loadRoomWithEgo() { Actor *a; int obj, room, x, y; @@ -1172,7 +1172,7 @@ void Scumm_v6::o6_loadRoomWithEgo() { } } -void Scumm_v6::o6_getRandomNumber() { +void ScummEngine_v6::o6_getRandomNumber() { int rnd; rnd = _rnd.getRandomNumber(pop()); if (VAR_V6_RANDOM_NR != 0xFF) @@ -1180,7 +1180,7 @@ void Scumm_v6::o6_getRandomNumber() { push(rnd); } -void Scumm_v6::o6_getRandomNumberRange() { +void ScummEngine_v6::o6_getRandomNumberRange() { int max = pop(); int min = pop(); int rnd = _rnd.getRandomNumberRng(min, max); @@ -1189,20 +1189,20 @@ void Scumm_v6::o6_getRandomNumberRange() { push(rnd); } -void Scumm_v6::o6_isScriptRunning() { +void ScummEngine_v6::o6_isScriptRunning() { push(isScriptRunning(pop())); } -void Scumm_v6::o6_isRoomScriptRunning() { +void ScummEngine_v6::o6_isRoomScriptRunning() { push(isRoomScriptRunning(pop())); } -void Scumm_v6::o6_getActorMoving() { +void ScummEngine_v6::o6_getActorMoving() { Actor *a = derefActor(pop(), "o6_getActorMoving"); push(a->moving); } -void Scumm_v6::o6_getActorRoom() { +void ScummEngine_v6::o6_getActorRoom() { int act = pop(); if (act == 0) { @@ -1228,80 +1228,80 @@ void Scumm_v6::o6_getActorRoom() { push(a->room); } -void Scumm_v6::o6_getActorWalkBox() { +void ScummEngine_v6::o6_getActorWalkBox() { Actor *a = derefActor(pop(), "o6_getActorWalkBox"); push(a->ignoreBoxes ? 0 : a->walkbox); } -void Scumm_v6::o6_getActorCostume() { +void ScummEngine_v6::o6_getActorCostume() { Actor *a = derefActor(pop(), "o6_getActorCostume"); push(a->costume); } -void Scumm_v6::o6_getActorElevation() { +void ScummEngine_v6::o6_getActorElevation() { Actor *a = derefActor(pop(), "o6_getActorElevation"); push(a->elevation); } -void Scumm_v6::o6_getActorWidth() { +void ScummEngine_v6::o6_getActorWidth() { Actor *a = derefActor(pop(), "o6_getActorWidth"); push(a->width); } -void Scumm_v6::o6_getActorScaleX() { +void ScummEngine_v6::o6_getActorScaleX() { Actor *a = derefActor(pop(), "o6_getActorScale"); push(a->scalex); } -void Scumm_v6::o6_getActorAnimCounter1() { +void ScummEngine_v6::o6_getActorAnimCounter1() { Actor *a = derefActor(pop(), "o6_getActorAnimCounter"); push(a->cost.animCounter); } -void Scumm_v6::o6_getAnimateVariable() { +void ScummEngine_v6::o6_getAnimateVariable() { int var = pop(); Actor *a = derefActor(pop(), "o6_getAnimateVariable"); push(a->getAnimVar(var)); } -void Scumm_v6::o6_isActorInBox() { +void ScummEngine_v6::o6_isActorInBox() { int box = pop(); Actor *a = derefActor(pop(), "o6_isActorInBox"); push(checkXYInBoxBounds(box, a->_pos.x, a->_pos.y)); } -void Scumm_v6::o6_getActorLayer() { +void ScummEngine_v6::o6_getActorLayer() { Actor *a = derefActor(pop(), "getActorLayer"); push(a->layer); } -void Scumm_v6::o6_getObjectX() { +void ScummEngine_v6::o6_getObjectX() { push(getObjX(pop())); } -void Scumm_v6::o6_getObjectY() { +void ScummEngine_v6::o6_getObjectY() { push(getObjY(pop())); } -void Scumm_v6::o6_getObjectOldDir() { +void ScummEngine_v6::o6_getObjectOldDir() { push(getObjOldDir(pop())); } -void Scumm_v6::o6_getObjectNewDir() { +void ScummEngine_v6::o6_getObjectNewDir() { push(getObjNewDir(pop())); } -void Scumm_v6::o6_findInventory() { +void ScummEngine_v6::o6_findInventory() { int idx = pop(); int owner = pop(); push(findInventory(owner, idx)); } -void Scumm_v6::o6_getInventoryCount() { +void ScummEngine_v6::o6_getInventoryCount() { push(getInventoryCount(pop())); } -void Scumm_v6::o6_getVerbFromXY() { +void ScummEngine_v6::o6_getVerbFromXY() { int y = pop(); int x = pop(); int over = checkMouseOver(x, y); @@ -1310,15 +1310,15 @@ void Scumm_v6::o6_getVerbFromXY() { push(over); } -void Scumm_v6::o6_beginOverride() { +void ScummEngine_v6::o6_beginOverride() { beginOverride(); } -void Scumm_v6::o6_endOverride() { +void ScummEngine_v6::o6_endOverride() { endOverride(); } -void Scumm_v6::o6_setObjectName() { +void ScummEngine_v6::o6_setObjectName() { int obj = pop(); int i; @@ -1348,7 +1348,7 @@ void Scumm_v6::o6_setObjectName() { error("New name of %d overflows name table (max = %d)", obj, 50); } -void Scumm_v6::o6_isSoundRunning() { +void ScummEngine_v6::o6_isSoundRunning() { int snd = pop(); if (snd) @@ -1357,7 +1357,7 @@ void Scumm_v6::o6_isSoundRunning() { push(snd); } -void Scumm_v6::o6_setBoxFlags() { +void ScummEngine_v6::o6_setBoxFlags() { int table[65]; int num, value; @@ -1369,11 +1369,11 @@ void Scumm_v6::o6_setBoxFlags() { } } -void Scumm_v6::o6_createBoxMatrix() { +void ScummEngine_v6::o6_createBoxMatrix() { createBoxMatrix(); } -void Scumm_v6::o6_resourceRoutines() { +void ScummEngine_v6::o6_resourceRoutines() { int resid, op; op = fetchScriptByte(); @@ -1486,7 +1486,7 @@ void Scumm_v6::o6_resourceRoutines() { } -void Scumm_v6::o6_roomOps() { +void ScummEngine_v6::o6_roomOps() { int a, b, c, d, e; byte op; @@ -1615,7 +1615,7 @@ void Scumm_v6::o6_roomOps() { } } -void Scumm_v6::o6_actorOps() { +void ScummEngine_v6::o6_actorOps() { Actor *a; int i, j, k; int args[8]; @@ -1803,7 +1803,7 @@ void Scumm_v6::o6_actorOps() { } } -void Scumm_v6::o6_verbOps() { +void ScummEngine_v6::o6_verbOps() { int slot, a, b; VerbSlot *vs; byte op; @@ -1926,20 +1926,20 @@ void Scumm_v6::o6_verbOps() { } } -void Scumm_v6::o6_getActorFromXY() { +void ScummEngine_v6::o6_getActorFromXY() { int y = pop(); int x = pop(); push(getActorFromPos(x, y)); } -void Scumm_v6::o6_findObject() { +void ScummEngine_v6::o6_findObject() { int y = pop(); int x = pop(); int r = findObject(x, y); push(r); } -void Scumm_v6::o6_pseudoRoom() { +void ScummEngine_v6::o6_pseudoRoom() { int list[100]; int num, a, value; @@ -1953,13 +1953,13 @@ void Scumm_v6::o6_pseudoRoom() { } } -void Scumm_v6::o6_getVerbEntrypoint() { +void ScummEngine_v6::o6_getVerbEntrypoint() { int e = pop(); int v = pop(); push(getVerbEntrypoint(v, e)); } -void Scumm_v6::o6_arrayOps() { +void ScummEngine_v6::o6_arrayOps() { byte subOp = fetchScriptByte(); int array = fetchScriptWord(); int b, c, d, len; @@ -2001,7 +2001,7 @@ void Scumm_v6::o6_arrayOps() { } } -void Scumm_v6::o6_saveRestoreVerbs() { +void ScummEngine_v6::o6_saveRestoreVerbs() { int a, b, c; int slot, slot2; @@ -2054,7 +2054,7 @@ void Scumm_v6::o6_saveRestoreVerbs() { } } -void Scumm_v6::o6_drawBox() { +void ScummEngine_v6::o6_drawBox() { int x, y, x2, y2, color; color = pop(); y2 = pop(); @@ -2064,7 +2064,7 @@ void Scumm_v6::o6_drawBox() { drawBox(x, y, x2, y2, color); } -void Scumm_v6::o6_wait() { +void ScummEngine_v6::o6_wait() { int actnum; int offs = -2; Actor *a; @@ -2136,14 +2136,14 @@ void Scumm_v6::o6_wait() { o6_breakHere(); } -void Scumm_v6::o6_soundKludge() { +void ScummEngine_v6::o6_soundKludge() { int list[16]; int num = getStackList(list, ARRAYSIZE(list)); _sound->soundKludge(list, num); } -void Scumm_v6::o6_isAnyOf() { +void ScummEngine_v6::o6_isAnyOf() { int list[100]; int num; int16 val; @@ -2161,7 +2161,7 @@ void Scumm_v6::o6_isAnyOf() { return; } -void Scumm_v6::o6_quitPauseRestart() { +void ScummEngine_v6::o6_quitPauseRestart() { byte subOp = fetchScriptByte(); switch (subOp) { case 158: // Restart @@ -2178,7 +2178,7 @@ void Scumm_v6::o6_quitPauseRestart() { } } -void Scumm_v6::o6_delay() { +void ScummEngine_v6::o6_delay() { // FIXME - what exactly are we measuring here? In order for the other two // delay functions to be right, it should be 1/60th of a second. But for // CMI it would seem this should delay for 1/10th of a second... @@ -2188,7 +2188,7 @@ void Scumm_v6::o6_delay() { o6_breakHere(); } -void Scumm_v6::o6_delaySeconds() { +void ScummEngine_v6::o6_delaySeconds() { uint32 delay = (uint32)pop(); if (_gameId != GID_CMI) // FIXME - are we really measuring minutes here? @@ -2203,7 +2203,7 @@ void Scumm_v6::o6_delaySeconds() { o6_breakHere(); } -void Scumm_v6::o6_delayMinutes() { +void ScummEngine_v6::o6_delayMinutes() { // FIXME - are we really measuring minutes here? uint32 delay = (uint16)pop() * 3600; vm.slot[_currentScript].delay = delay; @@ -2211,39 +2211,39 @@ void Scumm_v6::o6_delayMinutes() { o6_breakHere(); } -void Scumm_v6::o6_stopSentence() { +void ScummEngine_v6::o6_stopSentence() { _sentenceNum = 0; stopScript(VAR(VAR_SENTENCE_SCRIPT)); clearClickedStatus(); } -void Scumm_v6::o6_printLine() { +void ScummEngine_v6::o6_printLine() { _actorToPrintStrFor = 0xFF; decodeParseString(0, 0); } -void Scumm_v6::o6_printCursor() { +void ScummEngine_v6::o6_printCursor() { decodeParseString(1, 0); } -void Scumm_v6::o6_printDebug() { +void ScummEngine_v6::o6_printDebug() { decodeParseString(2, 0); } -void Scumm_v6::o6_printSystem() { +void ScummEngine_v6::o6_printSystem() { decodeParseString(3, 0); } -void Scumm_v6::o6_printActor() { +void ScummEngine_v6::o6_printActor() { decodeParseString(0, 1); } -void Scumm_v6::o6_printEgo() { +void ScummEngine_v6::o6_printEgo() { push(VAR(VAR_EGO)); decodeParseString(0, 1); } -void Scumm_v6::o6_talkActor() { +void ScummEngine_v6::o6_talkActor() { _actorToPrintStrFor = pop(); _messagePtr = translateTextAndPlaySpeech(_scriptPointer); @@ -2253,12 +2253,12 @@ void Scumm_v6::o6_talkActor() { actorTalk(); } -void Scumm_v6::o6_talkEgo() { +void ScummEngine_v6::o6_talkEgo() { push(VAR(VAR_EGO)); o6_talkActor(); } -void Scumm_v6::o6_dim() { +void ScummEngine_v6::o6_dim() { int data; switch (fetchScriptByte()) { @@ -2287,13 +2287,13 @@ void Scumm_v6::o6_dim() { defineArray(fetchScriptWord(), data, 0, pop()); } -void Scumm_v6::o6_dummy() { +void ScummEngine_v6::o6_dummy() { /* nothing */ if (_features & GF_HUMONGOUS) stopObjectCode(); } -void Scumm_v6::o6_dim2() { +void ScummEngine_v6::o6_dim2() { int a, b, data; switch (fetchScriptByte()) { case 199: @@ -2320,19 +2320,19 @@ void Scumm_v6::o6_dim2() { defineArray(fetchScriptWord(), data, a, b); } -void Scumm_v6::o6_abs() { +void ScummEngine_v6::o6_abs() { int a = pop(); // palmos: prevent multi pop if we use an abs function defined as : #define abs(a) ((a) < 0 ? -(a) : (a)) push(abs(a)); } -void Scumm_v6::o6_distObjectObject() { +void ScummEngine_v6::o6_distObjectObject() { int a, b; b = pop(); a = pop(); push(getDistanceBetween(true, a, 0, true, b, 0)); } -void Scumm_v6::o6_distObjectPt() { +void ScummEngine_v6::o6_distObjectPt() { int a, b, c; c = pop(); b = pop(); @@ -2340,7 +2340,7 @@ void Scumm_v6::o6_distObjectPt() { push(getDistanceBetween(true, a, 0, false, b, c)); } -void Scumm_v6::o6_distPtPt() { +void ScummEngine_v6::o6_distPtPt() { int a, b, c, d; d = pop(); c = pop(); @@ -2349,7 +2349,7 @@ void Scumm_v6::o6_distPtPt() { push(getDistanceBetween(false, a, b, false, c, d)); } -void Scumm_v6::o6_drawBlastObject() { +void ScummEngine_v6::o6_drawBlastObject() { int args[16]; int a, b, c, d, e; @@ -2363,7 +2363,7 @@ void Scumm_v6::o6_drawBlastObject() { } // Set BOMP processing window -void Scumm_v6::o6_setBlastObjectWindow() { +void ScummEngine_v6::o6_setBlastObjectWindow() { // TODO - implement this int a, b, c, d; @@ -2375,7 +2375,7 @@ void Scumm_v6::o6_setBlastObjectWindow() { warning("o6_setBlastObjectWindow(%d, %d, %d, %d)", a, b, c, d); } -void Scumm_v6::o6_kernelSetFunctions() { +void ScummEngine_v6::o6_kernelSetFunctions() { int args[30]; int num; Actor *a; @@ -2656,7 +2656,7 @@ void Scumm_v6::o6_kernelSetFunctions() { } } -void Scumm_v6::o6_kernelGetFunctions() { +void ScummEngine_v6::o6_kernelGetFunctions() { int args[30]; int i; Actor *a; @@ -2755,7 +2755,7 @@ void Scumm_v6::o6_kernelGetFunctions() { } } -void Scumm_v6::o6_delayFrames() { +void ScummEngine_v6::o6_delayFrames() { ScriptSlot *ss = &vm.slot[_currentScript]; if (ss->delayFrameCount == 0) { ss->delayFrameCount = pop(); @@ -2768,7 +2768,7 @@ void Scumm_v6::o6_delayFrames() { } } -void Scumm_v6::o6_pickOneOf() { +void ScummEngine_v6::o6_pickOneOf() { int args[100]; int i, num; @@ -2779,7 +2779,7 @@ void Scumm_v6::o6_pickOneOf() { push(args[i]); } -void Scumm_v6::o6_pickOneOfDefault() { +void ScummEngine_v6::o6_pickOneOfDefault() { int args[100]; int i, num, def; @@ -2793,7 +2793,7 @@ void Scumm_v6::o6_pickOneOfDefault() { push(i); } -void Scumm_v6::o6_stampObject() { +void ScummEngine_v6::o6_stampObject() { int object, x, y, state; // V6 version @@ -2846,11 +2846,11 @@ void Scumm_v6::o6_stampObject() { } } -void Scumm_v6::o6_stopTalking() { +void ScummEngine_v6::o6_stopTalking() { stopTalk(); } -void Scumm_v6::o6_openFile() { +void ScummEngine_v6::o6_openFile() { int mode, len, slot, l, r; byte filename[100]; @@ -2888,13 +2888,13 @@ void Scumm_v6::o6_openFile() { push(slot); } -void Scumm_v6::o6_closeFile() { +void ScummEngine_v6::o6_closeFile() { int slot = pop(); _hFileTable[slot].close(); warning("o6_closeFile(%d)", slot); } -void Scumm_v6::o6_deleteFile() { +void ScummEngine_v6::o6_deleteFile() { int len, r; byte filename[100]; @@ -2913,7 +2913,7 @@ void Scumm_v6::o6_deleteFile() { warning("stub o6_deleteFile(\"%s\")", filename + r); } -int Scumm_v6::readFileToArray(int slot, int32 size) { +int ScummEngine_v6::readFileToArray(int slot, int32 size) { if (size == 0) size = _hFileTable[slot].size() - _hFileTable[slot].pos(); writeVar(0, 0); @@ -2923,7 +2923,7 @@ int Scumm_v6::readFileToArray(int slot, int32 size) { return readVar(0); } -void Scumm_v6::o6_readFile() { +void ScummEngine_v6::o6_readFile() { int32 size = pop(); int slot = pop(); @@ -2937,14 +2937,14 @@ void Scumm_v6::o6_readFile() { warning("o6_readFile(%d, %d)", slot, size); } -void Scumm_v6::writeFileFromArray(int slot, int resID) { +void ScummEngine_v6::writeFileFromArray(int slot, int resID) { byte *ptr = getResourceAddress(rtString, resID); // FIXME: hack for proper size: / 2 - 5 int32 size = getResourceSize(rtString, resID) / 2 - 5; _hFileTable[slot].write(ptr, size); } -void Scumm_v6::o6_writeFile() { +void ScummEngine_v6::o6_writeFile() { int32 size = pop(); int16 resID = pop(); int slot = pop(); @@ -2959,7 +2959,7 @@ void Scumm_v6::o6_writeFile() { warning("o6_writeFile(%d, %d)", slot, resID); } -void Scumm_v6::o6_findAllObjects() { +void ScummEngine_v6::o6_findAllObjects() { // FIXME is this even remotely correct? // see http://users.bigpond.net.au/tgray2/findallobjects.txt // for asm @@ -2981,7 +2981,7 @@ void Scumm_v6::o6_findAllObjects() { push(readVar(0)); } -void Scumm_v6::shuffleArray(int num, int minIdx, int maxIdx) { +void ScummEngine_v6::shuffleArray(int num, int minIdx, int maxIdx) { int range = maxIdx - minIdx; int count = range * 2; @@ -2999,11 +2999,11 @@ void Scumm_v6::shuffleArray(int num, int minIdx, int maxIdx) { } } -void Scumm_v6::o6_shuffle() { +void ScummEngine_v6::o6_shuffle() { shuffleArray(fetchScriptWord(), pop(), pop()); } -void Scumm_v6::o6_pickVarRandom() { +void ScummEngine_v6::o6_pickVarRandom() { int num; int args[100]; int var_C, var_A; @@ -3051,7 +3051,7 @@ void Scumm_v6::o6_pickVarRandom() { push(readArray(value, 0, num)); } -void Scumm_v6::o6_getDateTime() { +void ScummEngine_v6::o6_getDateTime() { struct tm *t; time_t now = time(NULL); @@ -3067,7 +3067,7 @@ void Scumm_v6::o6_getDateTime() { VAR(VAR_TIMEDATE_SECOND) = t->tm_sec; } -void Scumm_v6::o6_unknownE1() { +void ScummEngine_v6::o6_unknownE1() { // this opcode check ground area in minigame "Asteroid Lander" in the dig int y = pop(); int x = pop(); @@ -3099,7 +3099,7 @@ void Scumm_v6::o6_unknownE1() { push(area); } -void Scumm_v6::o6_unknownE0() { +void ScummEngine_v6::o6_unknownE0() { int a = fetchScriptByte(); a -= 222; if (a != 0) { @@ -3112,11 +3112,11 @@ void Scumm_v6::o6_unknownE0() { } } -void Scumm_v6::o6_unknownE4() { +void ScummEngine_v6::o6_unknownE4() { warning("o6_unknownE4(%d) stub", pop()); } -void Scumm_v6::o6_unknownFA() { +void ScummEngine_v6::o6_unknownFA() { int len, a = fetchScriptByte(); len = resStrLen(_scriptPointer); @@ -3124,7 +3124,7 @@ void Scumm_v6::o6_unknownFA() { _scriptPointer += len + 1; } -void Scumm_v6::o6_unknownEA() { +void ScummEngine_v6::o6_unknownEA() { int edi, esi, eax; edi = pop(); esi = pop(); @@ -3148,11 +3148,11 @@ void Scumm_v6::o6_unknownEA() { } } -void Scumm_v6::unknownEA_func(int a, int b, int c, int d, int e) { +void ScummEngine_v6::unknownEA_func(int a, int b, int c, int d, int e) { warning("unknownEA_func(%d, %d, %d, %d, %d) stub", a, b, c, d, e); } -void Scumm_v6::o6_readINI() { +void ScummEngine_v6::o6_readINI() { int len; len = resStrLen(_scriptPointer); @@ -3163,11 +3163,11 @@ void Scumm_v6::o6_readINI() { } -void Scumm_v6::o6_localizeArray() { +void ScummEngine_v6::o6_localizeArray() { warning("stub localizeArray(%d)", pop()); } -void Scumm_v6::decodeParseString(int m, int n) { +void ScummEngine_v6::decodeParseString(int m, int n) { byte b; b = fetchScriptByte(); diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 82a4763306..1bfb99aa96 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -33,9 +33,9 @@ #include "sound/mixer.h" -#define OPCODE(x) { &Scumm_v8::x, #x } +#define OPCODE(x) { &ScummEngine_v8::x, #x } -void Scumm_v8::setupOpcodes() { +void ScummEngine_v8::setupOpcodes() { static const OpcodeEntryV8 opcodes[256] = { /* 00 */ OPCODE(o6_invalid), @@ -362,17 +362,17 @@ void Scumm_v8::setupOpcodes() { _opcodesV8 = opcodes; } -void Scumm_v8::executeOpcode(byte i) { +void ScummEngine_v8::executeOpcode(byte i) { OpcodeProcV8 op = _opcodesV8[i].proc; (this->*op) (); } -const char *Scumm_v8::getOpcodeDesc(byte i) { +const char *ScummEngine_v8::getOpcodeDesc(byte i) { return _opcodesV8[i].desc; } // In V8, the word size is 4 byte, not 2 bytes as in V6/V7 games -uint Scumm_v8::fetchScriptWord() { +uint ScummEngine_v8::fetchScriptWord() { int a; if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) { uint32 oldoffs = _scriptPointer - _scriptOrgPointer; @@ -384,11 +384,11 @@ uint Scumm_v8::fetchScriptWord() { return a; } -int Scumm_v8::fetchScriptWordSigned() { +int ScummEngine_v8::fetchScriptWordSigned() { return (int32)fetchScriptWord(); } -int Scumm_v8::readVar(uint var) { +int ScummEngine_v8::readVar(uint var) { debug(9, "readvar(%d)", var); if (!(var & 0xF0000000)) { @@ -412,7 +412,7 @@ int Scumm_v8::readVar(uint var) { return -1; } -void Scumm_v8::writeVar(uint var, int value) { +void ScummEngine_v8::writeVar(uint var, int value) { debug(9, "writeVar(%d, %d)", var, value); if (!(var & 0xF0000000)) { @@ -450,7 +450,7 @@ void Scumm_v8::writeVar(uint var, int value) { error("Illegal varbits (w)"); } -void Scumm_v8::decodeParseString(int m, int n) { +void ScummEngine_v8::decodeParseString(int m, int n) { byte b; b = fetchScriptByte(); @@ -531,12 +531,12 @@ void Scumm_v8::decodeParseString(int m, int n) { } } -void Scumm_v8::o8_mod() { +void ScummEngine_v8::o8_mod() { int a = pop(); push(pop() % a); } -void Scumm_v8::o8_wait() { +void ScummEngine_v8::o8_wait() { int actnum; int offs = -2; Actor *a; @@ -589,7 +589,7 @@ void Scumm_v8::o8_wait() { o6_breakHere(); } -void Scumm_v8::o8_dim() { +void ScummEngine_v8::o8_dim() { byte subOp = fetchScriptByte(); int array = fetchScriptWord(); @@ -608,7 +608,7 @@ void Scumm_v8::o8_dim() { } } -void Scumm_v8::o8_dim2() { +void ScummEngine_v8::o8_dim2() { byte subOp = fetchScriptByte(); int array = fetchScriptWord(), a, b; @@ -631,7 +631,7 @@ void Scumm_v8::o8_dim2() { } } -void Scumm_v8::o8_arrayOps() { +void ScummEngine_v8::o8_arrayOps() { byte subOp = fetchScriptByte(); int array = fetchScriptWord(); int b, c, d, len; @@ -673,12 +673,12 @@ void Scumm_v8::o8_arrayOps() { } } -void Scumm_v8::o8_blastText() { +void ScummEngine_v8::o8_blastText() { // FIXME decodeParseString(5, 0); } -void Scumm_v8::o8_cursorCommand() { +void ScummEngine_v8::o8_cursorCommand() { byte subOp = fetchScriptByte(); int a, i; int args[16]; @@ -757,7 +757,7 @@ void Scumm_v8::o8_cursorCommand() { VAR(VAR_USERPUT) = _userPut; } -void Scumm_v8::o8_createBoxMatrix() { +void ScummEngine_v8::o8_createBoxMatrix() { int i; Actor *a; @@ -770,7 +770,7 @@ void Scumm_v8::o8_createBoxMatrix() { } } -void Scumm_v8::o8_resourceRoutines() { +void ScummEngine_v8::o8_resourceRoutines() { byte subOp = fetchScriptByte(); int resid = pop(); @@ -838,7 +838,7 @@ void Scumm_v8::o8_resourceRoutines() { } } -void Scumm_v8::o8_roomOps() { +void ScummEngine_v8::o8_roomOps() { byte subOp = fetchScriptByte(); int a, b, c, d, e; @@ -912,7 +912,7 @@ void Scumm_v8::o8_roomOps() { } } -void Scumm_v8::o8_actorOps() { +void ScummEngine_v8::o8_actorOps() { byte subOp = fetchScriptByte(); Actor *a; int i, j; @@ -1085,7 +1085,7 @@ void Scumm_v8::o8_actorOps() { } } -void Scumm_v8::o8_cameraOps() { +void ScummEngine_v8::o8_cameraOps() { // TODO byte subOp = fetchScriptByte(); switch (subOp) { @@ -1100,7 +1100,7 @@ void Scumm_v8::o8_cameraOps() { } } -void Scumm_v8::o8_verbOps() { +void ScummEngine_v8::o8_verbOps() { byte subOp = fetchScriptByte(); VerbSlot *vs = NULL; int slot, a, b; @@ -1218,7 +1218,7 @@ void Scumm_v8::o8_verbOps() { } } -void Scumm_v8::o8_system() { +void ScummEngine_v8::o8_system() { byte subOp = fetchScriptByte(); switch (subOp) { case 0x28: // SO_SYSTEM_RESTART Restart game @@ -1233,7 +1233,7 @@ void Scumm_v8::o8_system() { } -void Scumm_v8::o8_startVideo() { +void ScummEngine_v8::o8_startVideo() { int len = resStrLen(_scriptPointer); debug(4, "o8_startVideo(%s/%s)", getGameDataPath(), (const char*)_scriptPointer); @@ -1245,7 +1245,7 @@ void Scumm_v8::o8_startVideo() { _scriptPointer += len + 1; } -void Scumm_v8::o8_kernelSetFunctions() { +void ScummEngine_v8::o8_kernelSetFunctions() { // TODO Actor *a; int args[30]; @@ -1387,7 +1387,7 @@ void Scumm_v8::o8_kernelSetFunctions() { } } -void Scumm_v8::o8_kernelGetFunctions() { +void ScummEngine_v8::o8_kernelGetFunctions() { // TODO int args[30]; int len = getStackList(args, ARRAYSIZE(args)); @@ -1510,7 +1510,7 @@ void Scumm_v8::o8_kernelGetFunctions() { } -void Scumm_v8::o8_getActorChore() { +void ScummEngine_v8::o8_getActorChore() { int actnum = pop(); Actor *a = derefActor(actnum, "o8_getActorChore"); @@ -1524,7 +1524,7 @@ void Scumm_v8::o8_getActorChore() { push(a->frame); } -void Scumm_v8::o8_getActorZPlane() { +void ScummEngine_v8::o8_getActorZPlane() { int actnum = pop(); Actor *a = derefActor(actnum, "o8_getActorZPlane"); @@ -1539,27 +1539,27 @@ void Scumm_v8::o8_getActorZPlane() { } -void Scumm_v8::o8_getObjectImageX() { +void ScummEngine_v8::o8_getObjectImageX() { int i = getObjectIndex(pop()); push(_objs[i].x_pos); } -void Scumm_v8::o8_getObjectImageY() { +void ScummEngine_v8::o8_getObjectImageY() { int i = getObjectIndex(pop()); push(_objs[i].y_pos); } -void Scumm_v8::o8_getObjectImageWidth() { +void ScummEngine_v8::o8_getObjectImageWidth() { int i = getObjectIndex(pop()); push(_objs[i].width); } -void Scumm_v8::o8_getObjectImageHeight() { +void ScummEngine_v8::o8_getObjectImageHeight() { int i = getObjectIndex(pop()); push(_objs[i].height); } -void Scumm_v8::o8_getStringWidth() { +void ScummEngine_v8::o8_getStringWidth() { int charset = pop(); int oldID = _charset->getCurID(); int width; @@ -1584,7 +1584,7 @@ void Scumm_v8::o8_getStringWidth() { push(width); } -void Scumm_v8::o8_drawObject() { +void ScummEngine_v8::o8_drawObject() { int state = pop(), y = pop(), x = pop(), obj = pop(), objnum = getObjectIndex(obj); ObjectData *od; diff --git a/scumm/scumm.h b/scumm/scumm.h index 47d91fd9ed..4dc98f37dc 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -45,7 +45,7 @@ class NewGui; class Player_V2; class Player_V2A; class Player_V3A; -class Scumm; +class ScummEngine; class ScummDebugger; class Serializer; class Sound; @@ -57,7 +57,7 @@ struct FindObjectInRoom; typedef Common::Map<Common::String, int> ObjectIDMap; // Use g_scumm from error() ONLY -extern Scumm *g_scumm; +extern ScummEngine *g_scumm; /* System Wide Constants */ enum { @@ -250,7 +250,7 @@ struct LangIndexNode { int32 offset; }; -class Scumm : public Engine { +class ScummEngine : public Engine { friend class ScummDebugger; friend class SmushPlayer; void errorString(const char *buf_input, char *buf_output); @@ -291,8 +291,8 @@ protected: public: // Constructor / Destructor - Scumm(GameDetector *detector, OSystem *syst); - virtual ~Scumm(); + ScummEngine(GameDetector *detector, OSystem *syst); + virtual ~ScummEngine(); // Init functions void scummInit(); @@ -715,7 +715,7 @@ protected: void setVerbObject(uint room, uint object, uint verb); - // TODO: This should be moved into Scumm_v2 if possible + // TODO: This should be moved into ScummEngine_v2 if possible V2MouseoverBox v2_mouseover_boxes[7]; int8 v2_mouseover_box; diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index e87fc556b5..b143bbd11b 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -69,7 +69,7 @@ enum MouseButtonStatus { }; // Use g_scumm from error() ONLY -Scumm *g_scumm = 0; +ScummEngine *g_scumm = 0; ScummDebugger *g_debugger; extern NewGui *g_gui; @@ -292,25 +292,25 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { switch (detector->_game.version) { case 1: case 2: - engine = new Scumm_v2(detector, syst); + engine = new ScummEngine_v2(detector, syst); break; case 3: - engine = new Scumm_v3(detector, syst); + engine = new ScummEngine_v3(detector, syst); break; case 4: - engine = new Scumm_v4(detector, syst); + engine = new ScummEngine_v4(detector, syst); break; case 5: - engine = new Scumm_v5(detector, syst); + engine = new ScummEngine_v5(detector, syst); break; case 6: - engine = new Scumm_v6(detector, syst); + engine = new ScummEngine_v6(detector, syst); break; case 7: - engine = new Scumm_v7(detector, syst); + engine = new ScummEngine_v7(detector, syst); break; case 8: - engine = new Scumm_v8(detector, syst); + engine = new ScummEngine_v8(detector, syst); break; default: error("Engine_SCUMM_create(): Unknown version of game engine"); @@ -321,7 +321,7 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { REGISTER_PLUGIN("Scumm Engine", Engine_SCUMM_targetList, Engine_SCUMM_create); -Scumm::Scumm (GameDetector *detector, OSystem *syst) +ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) : Engine(detector, syst), _pauseDialog(0), _optionsDialog(0), _saveLoadDialog(0) { OSystem::Property prop; @@ -824,7 +824,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) _audioNames = NULL; } -Scumm::~Scumm () { +ScummEngine::~ScummEngine() { delete [] _actors; delete _2byteFontPtr; @@ -868,7 +868,7 @@ Scumm::~Scumm () { delete g_debugger; } -void Scumm::go() { +void ScummEngine::go() { launch(); mainRun(); } @@ -877,7 +877,7 @@ void Scumm::go() { #pragma mark --- Initialization --- #pragma mark - -void Scumm::launch() { +void ScummEngine::launch() { gdi._vm = this; #ifdef __PALM_OS__ @@ -961,7 +961,7 @@ void Scumm::launch() { _saveLoadFlag = 0; } -void Scumm::setFeatures (uint32 newFeatures) { +void ScummEngine::setFeatures (uint32 newFeatures) { bool newCostumes = (_features & GF_NEW_COSTUMES) != 0; bool newNewCostumes = (newFeatures & GF_NEW_COSTUMES) != 0; bool amigaPalette = (_features & GF_AMIGA) != 0; @@ -985,7 +985,7 @@ void Scumm::setFeatures (uint32 newFeatures) { } } -void Scumm::scummInit() { +void ScummEngine::scummInit() { int i; tempMusic = 0; @@ -1152,7 +1152,7 @@ void Scumm::scummInit() { } -void Scumm::initScummVars() { +void ScummEngine::initScummVars() { // FIXME if (_version <= 2) { @@ -1237,7 +1237,7 @@ void Scumm::initScummVars() { #pragma mark --- Main loop --- #pragma mark - -void Scumm::mainRun() { +void ScummEngine::mainRun() { int delta = 0; int diff = _system->get_msecs(); @@ -1261,7 +1261,7 @@ void Scumm::mainRun() { } } -void Scumm::waitForTimer(int msec_delay) { +void ScummEngine::waitForTimer(int msec_delay) { uint32 start_time; if (_fastMode & 2) @@ -1281,7 +1281,7 @@ void Scumm::waitForTimer(int msec_delay) { } } -int Scumm::scummLoop(int delta) { +int ScummEngine::scummLoop(int delta) { if (_debugger) _debugger->on_frame(); @@ -1571,7 +1571,7 @@ load_game: #pragma mark --- Events / Input --- #pragma mark - -void Scumm::parseEvents() { +void ScummEngine::parseEvents() { OSystem::Event event; while (_system->poll_event(&event)) { @@ -1671,14 +1671,14 @@ void Scumm::parseEvents() { } } -void Scumm::clearClickedStatus() { +void ScummEngine::clearClickedStatus() { _keyPressed = 0; _mouseButStat = 0; _leftBtnPressed &= ~msClicked; _rightBtnPressed &= ~msClicked; } -void Scumm::processKbd() { +void ScummEngine::processKbd() { int saveloadkey; _lastKeyHit = _keyPressed; @@ -1907,7 +1907,7 @@ void Scumm::processKbd() { * Start a 'scene' by loading the specified room with the given main actor. * The actor is placed next to the object indicated by objectNr. */ -void Scumm::startScene(int room, Actor *a, int objectNr) { +void ScummEngine::startScene(int room, Actor *a, int objectNr) { int i, where; CHECK_HEAP; @@ -2082,7 +2082,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) { CHECK_HEAP; } -void Scumm::initRoomSubBlocks() { +void ScummEngine::initRoomSubBlocks() { int i; const byte *ptr; byte *roomptr, *searchptr, *roomResPtr; @@ -2430,15 +2430,15 @@ void Scumm::initRoomSubBlocks() { initBGBuffers(_roomHeight); } -void Scumm::pauseGame() { +void ScummEngine::pauseGame() { pauseDialog(); } -void Scumm::shutDown() { +void ScummEngine::shutDown() { _quit = true; } -void Scumm::restart() { +void ScummEngine::restart() { // TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect // this leaks memory like a sieve @@ -2470,7 +2470,7 @@ void Scumm::restart() { runScript(1, 0, 0, &_bootParam); } -void Scumm::startManiac() { +void ScummEngine::startManiac() { warning("stub startManiac()"); } @@ -2478,7 +2478,7 @@ void Scumm::startManiac() { #pragma mark --- GUI --- #pragma mark - -int Scumm::runDialog(Dialog &dialog) { +int ScummEngine::runDialog(Dialog &dialog) { // Pause sound put bool old_soundsPaused = _sound->_soundsPaused; _sound->pauseSounds(true); @@ -2503,25 +2503,25 @@ int Scumm::runDialog(Dialog &dialog) { return result; } -void Scumm::pauseDialog() { +void ScummEngine::pauseDialog() { if (!_pauseDialog) _pauseDialog = new PauseDialog(_newgui, this); runDialog(*_pauseDialog); } -void Scumm::saveloadDialog() { +void ScummEngine::saveloadDialog() { if (!_saveLoadDialog) _saveLoadDialog = new SaveLoadDialog(_newgui, this); runDialog(*_saveLoadDialog); } -void Scumm::optionsDialog() { +void ScummEngine::optionsDialog() { if (!_optionsDialog) _optionsDialog = new OptionsDialog(_newgui, this); runDialog(*_optionsDialog); } -void Scumm::confirmexitDialog() { +void ScummEngine::confirmexitDialog() { if (!_confirmExitDialog) _confirmExitDialog = new ConfirmExitDialog(_newgui, this); @@ -2530,7 +2530,7 @@ void Scumm::confirmexitDialog() { } } -char Scumm::displayError(bool showCancel, const char *message, ...) { +char ScummEngine::displayError(bool showCancel, const char *message, ...) { #ifdef __PALM_OS__ char buf[256]; // 1024 is too big overflow the stack #else @@ -2550,7 +2550,7 @@ char Scumm::displayError(bool showCancel, const char *message, ...) { #pragma mark --- Miscellaneous --- #pragma mark - -byte *Scumm::get2byteCharPtr(int idx) { +byte *ScummEngine::get2byteCharPtr(int idx) { /* switch(language) case korean: @@ -2565,7 +2565,7 @@ byte *Scumm::get2byteCharPtr(int idx) { } -const char *Scumm::getGameDataPath() const { +const char *ScummEngine::getGameDataPath() const { #ifdef MACOSX if (_version == 8 && !memcmp(_gameDataPath, "/Volumes/MONKEY3_", 17)) { // Special case for COMI on Mac OS X. The mount points on OS X depend @@ -2594,7 +2594,7 @@ const char *Scumm::getGameDataPath() const { return _gameDataPath; } -void Scumm::errorString(const char *buf1, char *buf2) { +void ScummEngine::errorString(const char *buf1, char *buf2) { if (_currentScript != 0xFF) { ScriptSlot *ss = &vm.slot[_currentScript]; sprintf(buf2, "(%d:%d:0x%X): %s", _roomResource, diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 549cafb539..0b23287cfe 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -196,7 +196,7 @@ static StringResource *getStrings(const char *file, const char *directory, bool SmushPlayer *player; void SmushPlayer::timerCallback(void *refCon) { - Scumm *scumm = (Scumm *)refCon; + ScummEngine *scumm = (ScummEngine *)refCon; if (!scumm->_smushPlay) return; @@ -205,7 +205,7 @@ void SmushPlayer::timerCallback(void *refCon) { player->_smushProcessFrame = false; } -SmushPlayer::SmushPlayer(Scumm *scumm, int speed, bool subtitles) { +SmushPlayer::SmushPlayer(ScummEngine *scumm, int speed, bool subtitles) { player = this; _scumm = scumm; diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index 0289394d71..42275bfa90 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -34,7 +34,7 @@ class StringResource; class SmushPlayer { private: - Scumm *_scumm; + ScummEngine *_scumm; int _version; int32 _nbframes; SmushMixer *_smixer; @@ -68,7 +68,7 @@ private: volatile bool _smushProcessFrame; public: - SmushPlayer(Scumm *, int, bool); + SmushPlayer(ScummEngine *, int, bool); ~SmushPlayer(); void play(const char *filename, const char *directory); diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 0668402844..7e91ba76bf 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -90,7 +90,7 @@ public: -Sound::Sound(Scumm *parent) { +Sound::Sound(ScummEngine *parent) { memset(this,0,sizeof(Sound)); // palmos _scumm = parent; @@ -640,7 +640,7 @@ int Sound::isSoundRunning(int sound) const { /** * Check whether the sound resource with the specified ID is still - * used. This is invoked by Scumm::isResourceInUse, to determine + * used. This is invoked by ScummEngine::isResourceInUse, to determine * which resources can be expired from memory. * Technically, this works very similar to isSoundRunning, however it * calls IMuse::get_sound_active() instead of IMuse::getSoundStatus(). @@ -1060,7 +1060,7 @@ void Sound::stopBundleMusic() { _musicBundleToBeRemoved = true; } -void Sound::bundleMusicHandler(Scumm *scumm) { +void Sound::bundleMusicHandler(ScummEngine *scumm) { byte *ptr; int32 l, num = _numberSamplesBundleMusic, length, k; int32 rate = 22050; @@ -1399,7 +1399,7 @@ void Sound::playSfxSound_Vorbis(File *file, uint32 size, PlayingSoundHandle *han // necessary for games like Loom CD. static void cd_timer_handler(void *refCon) { - Scumm *scumm = (Scumm *)refCon; + ScummEngine *scumm = (ScummEngine *)refCon; // FIXME: Turn off the timer when it's no longer needed. In theory, it // should be possible to check with pollCD(), but since CD sound isn't diff --git a/scumm/sound.h b/scumm/sound.h index 0d745dedfb..45e117872b 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -27,7 +27,7 @@ class Bundle; class DigitalTrackInfo; class File; -class Scumm; +class ScummEngine; struct MP3OffsetTable; @@ -93,7 +93,7 @@ protected: DigitalTrackInfo *_track_info[CACHE_TRACKS]; int _current_cache; - Scumm *_scumm; + ScummEngine *_scumm; public: int32 _bundleMusicPosition; @@ -106,10 +106,10 @@ public: // update iMuse/iMuseDigi/Player_v2/SoundMIxer, too int16 _sound_volume_master, _sound_volume_music, _sound_volume_sfx; - Bundle *_bundle; // FIXME: should be protected but is used by Scumm::askForDisk + Bundle *_bundle; // FIXME: should be protected but is used by ScummEngine::askForDisk public: - Sound(Scumm *parent); + Sound(ScummEngine *parent); ~Sound(); void addSoundToQueue(int sound); void addSoundToQueue2(int sound); @@ -131,7 +131,7 @@ public: void playBundleMusic(const char *song); void pauseBundleMusic(bool state); - void bundleMusicHandler(Scumm *scumm); + void bundleMusicHandler(ScummEngine *scumm); void stopBundleMusic(); void playBundleSound(char *sound, PlayingSoundHandle *handle); diff --git a/scumm/string.cpp b/scumm/string.cpp index 903c9dd4e2..c9183e938a 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -28,7 +28,7 @@ #include "verbs.h" #include "scumm/sound.h" -void Scumm::setStringVars(int slot) { +void ScummEngine::setStringVars(int slot) { StringTab *st = &_string[slot]; st->xpos = st->t_xpos; st->ypos = st->t_ypos; @@ -40,7 +40,7 @@ void Scumm::setStringVars(int slot) { st->charset = st->t_charset; } -void Scumm::unkMessage1() { +void ScummEngine::unkMessage1() { byte buffer[100]; _msgPtrToAdd = buffer; _messagePtr = addMessageToStack(_messagePtr); @@ -66,7 +66,7 @@ void Scumm::unkMessage1() { } } -void Scumm::unkMessage2() { +void ScummEngine::unkMessage2() { byte buf[100]; const byte *tmp; @@ -84,7 +84,7 @@ void Scumm::unkMessage2() { _messagePtr = tmp; } -void Scumm::CHARSET_1() { +void ScummEngine::CHARSET_1() { uint32 talk_sound_a = 0; uint32 talk_sound_b = 0; int s, i, t, c; @@ -344,7 +344,7 @@ void Scumm::CHARSET_1() { gdi._mask = _charset->_str; } -void Scumm::drawString(int a) { +void ScummEngine::drawString(int a) { byte buf[256]; byte *space; int i, c; @@ -460,7 +460,7 @@ void Scumm::drawString(int a) { } } -const byte *Scumm::addMessageToStack(const byte *msg) { +const byte *ScummEngine::addMessageToStack(const byte *msg) { int num, numorg; unsigned char *ptr, chr; @@ -580,14 +580,14 @@ const byte *Scumm::addMessageToStack(const byte *msg) { return msg; } -void Scumm::addIntToStack(int var) { +void ScummEngine::addIntToStack(int var) { int num; num = readVar(var); _msgPtrToAdd += sprintf((char *)_msgPtrToAdd, "%d", num); } -void Scumm::addVerbToStack(int var) +void ScummEngine::addVerbToStack(int var) { int num, k; @@ -606,7 +606,7 @@ void Scumm::addVerbToStack(int var) } } -void Scumm::addNameToStack(int var) +void ScummEngine::addNameToStack(int var) { int num; const byte *ptr = 0; @@ -626,7 +626,7 @@ void Scumm::addNameToStack(int var) } } -void Scumm::addStringToStack(int var) { +void ScummEngine::addStringToStack(int var) { const byte *ptr; if (_version == 3 || _version >= 6) @@ -646,7 +646,7 @@ void Scumm::addStringToStack(int var) { addMessageToStack((const byte *)""); } -void Scumm::initCharset(int charsetno) { +void ScummEngine::initCharset(int charsetno) { int i; if (!getResourceAddress(rtCharset, charsetno)) @@ -659,7 +659,7 @@ void Scumm::initCharset(int charsetno) { _charsetColorMap[i] = _charsetData[charsetno][i]; } -void Scumm::enqueueText(const byte *text, int x, int y, byte color, byte charset, bool center) { +void ScummEngine::enqueueText(const byte *text, int x, int y, byte color, byte charset, bool center) { // The Dig will keep enqueueing texts long after they've scrolled off // the screen, eventually overflowing the blast text queue if left // unchecked. @@ -688,7 +688,7 @@ void Scumm::enqueueText(const byte *text, int x, int y, byte color, byte charset bt.center = center; } -void Scumm::drawBlastTexts() { +void ScummEngine::drawBlastTexts() { byte *buf; int c; int i; @@ -733,7 +733,7 @@ void Scumm::drawBlastTexts() { _charset->_ignoreCharsetMask = false; } -void Scumm::removeBlastTexts() { +void ScummEngine::removeBlastTexts() { int i; for (i = 0; i < _blastTextQueuePos; i++) { @@ -749,7 +749,7 @@ int indexCompare(const void *p1, const void *p2) { return strcmp(i1->tag, i2->tag); } -void Scumm::loadLanguageBundle() { +void ScummEngine::loadLanguageBundle() { File file; int32 size; @@ -883,7 +883,7 @@ void Scumm::loadLanguageBundle() { qsort(_languageIndex, _languageIndexSize, sizeof(LangIndexNode), indexCompare); } -const byte *Scumm::translateTextAndPlaySpeech(const byte *ptr) { +const byte *ScummEngine::translateTextAndPlaySpeech(const byte *ptr) { if ((_gameId == GID_DIG || _gameId == GID_CMI) && (ptr[0] == '/')) { char pointer[20]; int i, j; @@ -903,7 +903,7 @@ const byte *Scumm::translateTextAndPlaySpeech(const byte *ptr) { return ptr; } -void Scumm::translateText(const byte *text, byte *trans_buff) { +void ScummEngine::translateText(const byte *text, byte *trans_buff) { int l; if ((text[0] == '/') && _existLanguageFile) { diff --git a/scumm/usage_bits.cpp b/scumm/usage_bits.cpp index 6c6f34421d..3e09f0f98e 100644 --- a/scumm/usage_bits.cpp +++ b/scumm/usage_bits.cpp @@ -20,7 +20,7 @@ #include "scumm.h" #include "usage_bits.h" -void Scumm::upgradeGfxUsageBits() { +void ScummEngine::upgradeGfxUsageBits() { int i; for (i = 409; i >= 0; i--) { @@ -35,25 +35,25 @@ void Scumm::upgradeGfxUsageBits() { } } -void Scumm::setGfxUsageBit(int strip, int bit) { +void ScummEngine::setGfxUsageBit(int strip, int bit) { assert(1 <= bit && bit <= 96); bit--; gfxUsageBits[3 * strip + bit / 32] |= (1 << (bit % 32)); } -void Scumm::clearGfxUsageBit(int strip, int bit) { +void ScummEngine::clearGfxUsageBit(int strip, int bit) { assert(1 <= bit && bit <= 96); bit--; gfxUsageBits[3 * strip + bit / 32] &= ~(1 << (bit % 32)); } -bool Scumm::testGfxUsageBit(int strip, int bit) { +bool ScummEngine::testGfxUsageBit(int strip, int bit) { assert(1 <= bit && bit <= 96); bit--; return (gfxUsageBits[3 * strip + bit / 32] & (1 << (bit % 32))) != 0; } -bool Scumm::testGfxAnyUsageBits(int strip) { +bool ScummEngine::testGfxAnyUsageBits(int strip) { // Exclude the DIRTY and RESTORED bits from the test uint32 bitmask[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x3FFFFFFF }; int i; @@ -65,7 +65,7 @@ bool Scumm::testGfxAnyUsageBits(int strip) { return false; } -bool Scumm::testGfxOtherUsageBits(int strip, int bit) { +bool ScummEngine::testGfxOtherUsageBits(int strip, int bit) { // Don't exclude the DIRTY and RESTORED bits from the test uint32 bitmask[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; int i; diff --git a/scumm/vars.cpp b/scumm/vars.cpp index 41280447be..834951d561 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -25,7 +25,7 @@ #include "scumm.h" #include "intern.h" -void Scumm::setupScummVars() { +void ScummEngine::setupScummVars() { VAR_KEYPRESS = 0; VAR_EGO = 1; VAR_CAMERA_POS_X = 2; @@ -99,7 +99,7 @@ void Scumm::setupScummVars() { VAR_VERSION = 75; } -void Scumm_v2::setupScummVars() { +void ScummEngine_v2::setupScummVars() { VAR_EGO = 0; VAR_CAMERA_POS_X = 2; VAR_HAVE_MSG = 3; @@ -136,9 +136,9 @@ void Scumm_v2::setupScummVars() { VAR_TALK_ACTOR = 41; } -void Scumm_v6::setupScummVars() { +void ScummEngine_v6::setupScummVars() { // Many vars are the same as in V5 games, so just call the inherited method first - Scumm::setupScummVars(); + ScummEngine::setupScummVars(); VAR_V6_SCREEN_WIDTH = 41; VAR_V6_SCREEN_HEIGHT = 54; @@ -154,7 +154,7 @@ void Scumm_v6::setupScummVars() { VAR_TIMEDATE_MINUTE = 126; } -void Scumm_v7::setupScummVars() { +void ScummEngine_v7::setupScummVars() { VAR_MOUSE_X = 1; VAR_MOUSE_Y = 2; VAR_VIRT_MOUSE_X = 3; @@ -238,7 +238,7 @@ void Scumm_v7::setupScummVars() { VAR_STRING2DRAW = 130; } -void Scumm_v8::setupScummVars() { +void ScummEngine_v8::setupScummVars() { // VAR_ROOM_HEIGHT = 1; // VAR_ROOM_WIDTH = 2; diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index 992b3e5817..42bf9befa8 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -33,7 +33,7 @@ enum { kSentenceLine = 6 }; -void Scumm::initV2MouseOver() { +void ScummEngine::initV2MouseOver() { int i; int arrow_color, color, hi_color; @@ -99,7 +99,7 @@ void Scumm::initV2MouseOver() { v2_mouseover_boxes[kSentenceLine].hicolor = hi_color; } -void Scumm::checkV2MouseOver(Common::Point pos) { +void ScummEngine::checkV2MouseOver(Common::Point pos) { VirtScreen *vs = &virtscr[2]; Common::Rect rect; byte *ptr, *dst; @@ -159,7 +159,7 @@ void Scumm::checkV2MouseOver(Common::Point pos) { } } -void Scumm::checkV2Inventory(int x, int y) { +void ScummEngine::checkV2Inventory(int x, int y) { int object = 0; y -= virtscr[2].topline; @@ -194,7 +194,7 @@ void Scumm::checkV2Inventory(int x, int y) { } } -void Scumm::redrawV2Inventory() { +void ScummEngine::redrawV2Inventory() { int i; int max_inv; Common::Rect inventoryBox; @@ -259,7 +259,7 @@ void Scumm::redrawV2Inventory() { } } -void Scumm::redrawVerbs() { +void ScummEngine::redrawVerbs() { if (_version <= 2 && !(_userState & 128)) // Don't draw verbs unless active return; @@ -274,7 +274,7 @@ void Scumm::redrawVerbs() { _verbMouseOver = verb; } -void Scumm::checkExecVerbs() { +void ScummEngine::checkExecVerbs() { int i, over; VerbSlot *vs; @@ -317,7 +317,7 @@ void Scumm::checkExecVerbs() { } } -void Scumm::verbMouseOver(int verb) { +void ScummEngine::verbMouseOver(int verb) { // Don't do anything unless verbs are active if (_version <= 2 && !(_userState & 128)) return; @@ -336,7 +336,7 @@ void Scumm::verbMouseOver(int verb) { } } -int Scumm::checkMouseOver(int x, int y) const { +int ScummEngine::checkMouseOver(int x, int y) const { VerbSlot *vs; int i = _maxVerbs - 1; @@ -358,7 +358,7 @@ int Scumm::checkMouseOver(int x, int y) const { return 0; } -void Scumm::drawVerb(int verb, int mode) { +void ScummEngine::drawVerb(int verb, int mode) { VerbSlot *vs; bool tmp; @@ -418,7 +418,7 @@ void Scumm::drawVerb(int verb, int mode) { } } -void Scumm::restoreVerbBG(int verb) { +void ScummEngine::restoreVerbBG(int verb) { VerbSlot *vs; vs = &_verbs[verb]; @@ -429,7 +429,7 @@ void Scumm::restoreVerbBG(int verb) { } } -void Scumm::drawVerbBitmap(int verb, int x, int y) { +void ScummEngine::drawVerbBitmap(int verb, int x, int y) { VirtScreen *vs; VerbSlot *vst; byte twobufs; @@ -499,7 +499,7 @@ void Scumm::drawVerbBitmap(int verb, int x, int y) { vs->alloctwobuffers = twobufs; } -int Scumm::getVerbSlot(int id, int mode) const { +int ScummEngine::getVerbSlot(int id, int mode) const { int i; for (i = 1; i < _maxVerbs; i++) { if (_verbs[i].verbid == id && _verbs[i].saveid == mode) { @@ -509,7 +509,7 @@ int Scumm::getVerbSlot(int id, int mode) const { return 0; } -void Scumm::killVerb(int slot) { +void ScummEngine::killVerb(int slot) { VerbSlot *vs; if (slot == 0) @@ -528,7 +528,7 @@ void Scumm::killVerb(int slot) { vs->saveid = 0; } -void Scumm::setVerbObject(uint room, uint object, uint verb) { +void ScummEngine::setVerbObject(uint room, uint object, uint verb) { const byte *obimptr; const byte *obcdptr; uint32 size, size2; |