diff options
-rw-r--r-- | queen/bankman.cpp | 2 | ||||
-rw-r--r-- | queen/cutaway.cpp | 4 | ||||
-rw-r--r-- | queen/defs.h | 3 | ||||
-rw-r--r-- | queen/graphics.cpp | 6 | ||||
-rw-r--r-- | queen/logic.cpp | 72 | ||||
-rw-r--r-- | queen/logic.h | 4 | ||||
-rw-r--r-- | queen/talk.cpp | 4 | ||||
-rw-r--r-- | queen/walk.cpp | 14 |
8 files changed, 54 insertions, 55 deletions
diff --git a/queen/bankman.cpp b/queen/bankman.cpp index 45e31699d7..28793e5446 100644 --- a/queen/bankman.cpp +++ b/queen/bankman.cpp @@ -137,7 +137,7 @@ void BankManager::eraseFrame(uint32 index) { void BankManager::eraseFrames(bool joe) { uint32 i = 0; if (!joe) { - i = FRAMES_JOE + FRAMES_JOE_XTRA; + i = FRAMES_JOE; } while (i < MAX_FRAMES_NUMBER) { eraseFrame(i); diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index fffc781f61..266ceb5b58 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -481,7 +481,7 @@ const byte *Cutaway::getCutawayAnim(const byte *ptr, int header, CutawayAnim &an if (0 == header) { anim.object = 0; - anim.originalFrame = 29 + FRAMES_JOE_XTRA; + anim.originalFrame = 31; } else { anim.object = _vm->logic()->findBob(header); @@ -649,7 +649,7 @@ const byte *Cutaway::handleAnimation(const byte *ptr, CutawayObject &object) { } if (objAnim[i].object < 4) - bob->frameNum = 29 + objAnim[i].object + FRAMES_JOE_XTRA; + bob->frameNum = 31 + objAnim[i].object; if (objAnim[i].unpackFrame == 0) { // Turn off the bob diff --git a/queen/defs.h b/queen/defs.h index aed9ce9e09..4e5069a428 100644 --- a/queen/defs.h +++ b/queen/defs.h @@ -42,8 +42,7 @@ enum { enum { - FRAMES_JOE = 36, - FRAMES_JOE_XTRA = 2, + FRAMES_JOE = 38, FRAMES_JOURNAL = 40 }; diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 3b81b130cc..5d3ac63db2 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -583,7 +583,7 @@ void Graphics::setupNewRoom(const char *room, uint16 roomNum, int16 *furniture, sprintf(filename, "%s.BBK", room); _vm->bankMan()->load(filename, 15); - _numFrames = 37 + FRAMES_JOE_XTRA; + _numFrames = FRAMES_JOE + 1; setupRoomFurniture(furniture, furnitureCount); setupRoomObjects(); @@ -858,7 +858,7 @@ uint16 Graphics::refreshObject(uint16 obj) { void Graphics::setupRoomFurniture(int16 *furniture, uint16 furnitureCount) { uint16 i; - uint16 curImage = 36 + FRAMES_JOE_XTRA; + uint16 curImage = FRAMES_JOE; // unpack the static bobs _numFurnitureStatic = 0; @@ -924,7 +924,7 @@ void Graphics::setupRoomObjects() { uint16 i; // furniture frames are reserved in ::setupRoomFurniture(), we append objects // frames after the furniture ones. - uint16 curImage = 36 + FRAMES_JOE_XTRA + _numFurnitureStatic + _numFurnitureAnimatedLen; + uint16 curImage = FRAMES_JOE + _numFurnitureStatic + _numFurnitureAnimatedLen; uint16 firstRoomObj = _vm->logic()->currentRoomData() + 1; uint16 lastRoomObj = _vm->logic()->roomData(_vm->logic()->currentRoom() + 1); uint16 numObjectStatic = 0; diff --git a/queen/logic.cpp b/queen/logic.cpp index 7a02278d96..5051d813bd 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -256,7 +256,7 @@ ObjectData* Logic::objectData(int index) const { return &_objectData[index]; } -uint16 Logic::findBob(uint16 obj) { +uint16 Logic::findBob(uint16 obj) const { assert(obj <= _numObjects); uint16 room = _objectData[obj].room; @@ -330,7 +330,7 @@ uint16 Logic::findBob(uint16 obj) { return bobnum; } -uint16 Logic::findFrame(uint16 obj) { +uint16 Logic::findFrame(uint16 obj) const { uint16 i; uint16 framenum = 0; @@ -339,14 +339,14 @@ uint16 Logic::findFrame(uint16 obj) { if(img == -3 || img == -4) { uint16 bobnum = findPersonNumber(obj, room); if(bobnum <= 3) { - framenum = 29 + FRAMES_JOE_XTRA + bobnum; + framenum = 31 + bobnum; } } else { uint16 idx = 0; for(i = _roomData[room] + 1; i < obj; ++i) { img = _objectData[i].image; if(img <= -10) { - GraphicData* pgd = &_graphicData[-(img + 10)]; + const GraphicData* pgd = &_graphicData[-(img + 10)]; if(pgd->lastFrame != 0) { // skip all the frames of the animation idx += ABS(pgd->lastFrame) - pgd->firstFrame + 1; @@ -360,7 +360,7 @@ uint16 Logic::findFrame(uint16 obj) { if(img > 5000) { img -= 5000; } - GraphicData* pgd = &_graphicData[img]; + const GraphicData* pgd = &_graphicData[img]; uint16 lastFrame = ABS(pgd->lastFrame); if(pgd->firstFrame < 0) { idx += lastFrame; @@ -374,7 +374,7 @@ uint16 Logic::findFrame(uint16 obj) { img = _objectData[obj].image; if(img <= -10) { - GraphicData* pgd = &_graphicData[-(img + 10)]; + const GraphicData* pgd = &_graphicData[-(img + 10)]; if(pgd->lastFrame != 0) { idx += ABS(pgd->lastFrame) - pgd->firstFrame + 1; } else { @@ -386,7 +386,7 @@ uint16 Logic::findFrame(uint16 obj) { // calculate only if there are person frames if(idx > 0) { - framenum = 36 + FRAMES_JOE_XTRA + _vm->graphics()->numFurnitureFrames() + idx; + framenum = FRAMES_JOE + _vm->graphics()->numFurnitureFrames() + idx; } } return framenum; @@ -570,7 +570,7 @@ bool Logic::initPerson(uint16 noun, const char *actorName, bool loadBank, Person // if there is no valid actor file (ie pad->file is 0), the person // data is already loaded as it is included in objects room bank (.bbk) } - pp->bobFrame = 29 + FRAMES_JOE_XTRA + pp->actor->bobNum; + pp->bobFrame = 31 + pp->actor->bobNum; } return pad != NULL; } @@ -590,15 +590,15 @@ uint16 Logic::findPersonNumber(uint16 obj, uint16 room) const { void Logic::loadJoeBanks(const char *animBank, const char *standBank) { int i; _vm->bankMan()->load(animBank, 13); - for (i = 11; i <= 28 + FRAMES_JOE_XTRA; ++i) { + for (i = 11; i < 31; ++i) { _vm->bankMan()->unpack(i - 10, i, 13); } _vm->bankMan()->close(13); _vm->bankMan()->load(standBank, 7); - _vm->bankMan()->unpack(1, 33 + FRAMES_JOE_XTRA, 7); - _vm->bankMan()->unpack(3, 34 + FRAMES_JOE_XTRA, 7); - _vm->bankMan()->unpack(5, 35 + FRAMES_JOE_XTRA, 7); + _vm->bankMan()->unpack(1, 35, 7); + _vm->bankMan()->unpack(3, 36, 7); + _vm->bankMan()->unpack(5, 37, 7); } void Logic::setupJoe() { @@ -676,7 +676,7 @@ void Logic::setupJoeInRoom(bool autoPosition, uint16 scale) { if (_currentRoom == 108) { _vm->graphics()->putCameraOnBob(-1); _vm->bankMan()->load("joe_e.act", 7); - _vm->bankMan()->unpack(2, 29 + FRAMES_JOE_XTRA, 7); + _vm->bankMan()->unpack(2, 31, 7); _vm->display()->horizontalScroll(320); @@ -687,7 +687,7 @@ void Logic::setupJoeInRoom(bool autoPosition, uint16 scale) { joeFace(); pbs->curPos(oldx, oldy); - pbs->frameNum = 29 + FRAMES_JOE_XTRA; + pbs->frameNum = 31; } uint16 Logic::joeFace() { @@ -697,42 +697,42 @@ uint16 Logic::joeFace() { if (_currentRoom == 108) { frame = 1; } else { - frame = 33; + frame = 35; if (joeFacing() == DIR_FRONT) { if (joePrevFacing() == DIR_BACK) { - pbs->frameNum = 33 + FRAMES_JOE_XTRA; + pbs->frameNum = 35; _vm->update(); } - frame = 34; + frame = 36; } else if (joeFacing() == DIR_BACK) { if (joePrevFacing() == DIR_FRONT) { - pbs->frameNum = 33 + FRAMES_JOE_XTRA; + pbs->frameNum = 35; _vm->update(); } - frame = 35; + frame = 37; } else if ((joeFacing() == DIR_LEFT && joePrevFacing() == DIR_RIGHT) || (joeFacing() == DIR_RIGHT && joePrevFacing() == DIR_LEFT)) { - pbs->frameNum = 34 + FRAMES_JOE_XTRA; + pbs->frameNum = 36; _vm->update(); } - pbs->frameNum = frame + FRAMES_JOE_XTRA; + pbs->frameNum = frame; pbs->scale = joeScale(); pbs->xflip = (joeFacing() == DIR_LEFT); _vm->update(); joePrevFacing(joeFacing()); switch (frame) { - case 33: + case 35: frame = 1; break; - case 34: + case 36: frame = 3; break; - case 35: + case 37: frame = 5; break; } } - pbs->frameNum = 29 + FRAMES_JOE_XTRA; + pbs->frameNum = 31; _vm->bankMan()->unpack(frame, pbs->frameNum, 7); return frame; } @@ -765,12 +765,12 @@ void Logic::joeGrab(int16 grabState) { case STATE_GRAB_UP: // turn back - _vm->bankMan()->unpack(5, 29 + FRAMES_JOE_XTRA, 7); + _vm->bankMan()->unpack(5, 31, 7); bobJoe->xflip = (joeFacing() == DIR_LEFT); bobJoe->scale = joeScale(); _vm->update(); // grab up - _vm->bankMan()->unpack(7, 29 + FRAMES_JOE_XTRA, 7); + _vm->bankMan()->unpack(7, 31, 7); bobJoe->xflip = (joeFacing() == DIR_LEFT); bobJoe->scale = joeScale(); _vm->update(); @@ -780,7 +780,7 @@ void Logic::joeGrab(int16 grabState) { } if (frame != 0) { - _vm->bankMan()->unpack(frame, 29 + FRAMES_JOE_XTRA, 7); + _vm->bankMan()->unpack(frame, 31, 7); bobJoe->xflip = (joeFacing() == DIR_LEFT); bobJoe->scale = joeScale(); _vm->update(); @@ -1193,7 +1193,7 @@ void Logic::handlePinnacleRoom() { _vm->display()->horizontalScroll(_vm->input()->mousePosX()); joe->x = piton->x = 3 * _vm->input()->mousePosX() / 4 + 200; - joe->frameNum = _vm->input()->mousePosX() / 36 + 43 + FRAMES_JOE_XTRA; + joe->frameNum = _vm->input()->mousePosX() / 36 + 45; // bobs have been unpacked from animating objects, we don't need them // to animate anymore ; so turn animating off @@ -1217,7 +1217,7 @@ void Logic::handlePinnacleRoom() { // update bobs position / frame joe->x = piton->x = 3 * mx / 4 + 200; - joe->frameNum = mx / 36 + 43 + FRAMES_JOE_XTRA; + joe->frameNum = mx / 36 + 45; _vm->display()->clearTexts(5, 5); @@ -1381,16 +1381,16 @@ void Logic::setupRestoredGame() { joeCutFacing(joeFacing()); switch (joeFacing()) { case DIR_FRONT: - pbs->frameNum = 34 + FRAMES_JOE_XTRA; - _vm->bankMan()->unpack(3, 29 + FRAMES_JOE_XTRA, 7); + pbs->frameNum = 36; + _vm->bankMan()->unpack(3, 31, 7); break; case DIR_BACK: - pbs->frameNum = 35 + FRAMES_JOE_XTRA; - _vm->bankMan()->unpack(5, 29 + FRAMES_JOE_XTRA, 7); + pbs->frameNum = 37; + _vm->bankMan()->unpack(5, 31, 7); break; default: - pbs->frameNum = 33 + FRAMES_JOE_XTRA; - _vm->bankMan()->unpack(1, 29 + FRAMES_JOE_XTRA, 7); + pbs->frameNum = 35; + _vm->bankMan()->unpack(1, 31, 7); break; } diff --git a/queen/logic.h b/queen/logic.h index b61d06d6cd..af9527d609 100644 --- a/queen/logic.h +++ b/queen/logic.h @@ -80,8 +80,8 @@ public: ItemData *itemData(int index) const { return &_itemData[index]; } uint16 itemDataCount() const { return _numItems; } - uint16 findBob(uint16 obj); - uint16 findFrame(uint16 obj); + uint16 findBob(uint16 obj) const; + uint16 findFrame(uint16 obj) const; uint16 objectForPerson(uint16 bobnum) const; WalkOffData *walkOffPointForObject(int16 obj) const; diff --git a/queen/talk.cpp b/queen/talk.cpp index 92f0256b9c..5b24f9c798 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -850,7 +850,7 @@ void Talk::speakSegment( } else { bob->animating = false; - bob->frameNum = 29 + bobNum + FRAMES_JOE_XTRA; + bob->frameNum = 31 + bobNum; } } @@ -913,7 +913,7 @@ void Talk::speakSegment( else parameters = findSpeechParameters(person->name, command, 0); - startFrame = 29 + bobNum + FRAMES_JOE_XTRA; + startFrame = 31 + bobNum; int faceDirection = 0; if (isJoe && _vm->logic()->joeFacing() == DIR_LEFT) diff --git a/queen/walk.cpp b/queen/walk.cpp index 686d028510..f36c367180 100644 --- a/queen/walk.cpp +++ b/queen/walk.cpp @@ -67,9 +67,9 @@ void Walk::animateJoePrepare() { WalkData *pwd = &_walkData[i]; if (pwd->dx < 0) { - pwd->anim.set(11, 16 + FRAMES_JOE_XTRA, DIR_LEFT); + pwd->anim.set(11, 18, DIR_LEFT); } else { - pwd->anim.set(11, 16 + FRAMES_JOE_XTRA, DIR_RIGHT); + pwd->anim.set(11, 18, DIR_RIGHT); } int16 k = ABS(pwd->dy); @@ -81,15 +81,15 @@ void Walk::animateJoePrepare() { if (ABS(pwd->dx) < k) { if (pwd->dy < 0) { if (ds < 0) { - pwd->anim.set(17 + FRAMES_JOE_XTRA, 22 + FRAMES_JOE_XTRA, DIR_FRONT); + pwd->anim.set(19, 24, DIR_FRONT); } else { - pwd->anim.set(23 + FRAMES_JOE_XTRA, 28 + FRAMES_JOE_XTRA, DIR_BACK); + pwd->anim.set(25, 30, DIR_BACK); } } else if (pwd->dy > 0) { if (ds < 0) { - pwd->anim.set(23 + FRAMES_JOE_XTRA, 28 + FRAMES_JOE_XTRA, DIR_BACK); + pwd->anim.set(25, 30, DIR_BACK); } else { - pwd->anim.set(17 + FRAMES_JOE_XTRA, 22 + FRAMES_JOE_XTRA, DIR_FRONT); + pwd->anim.set(19, 24, DIR_FRONT); } } } @@ -340,7 +340,7 @@ int16 Walk::movePerson(const Person *pp, int16 endx, int16 endy, uint16 curImage can = -1; } - uint16 standingFrame = 29 + FRAMES_JOE_XTRA + bobNum; + uint16 standingFrame = 31 + bobNum; // make other person face the right direction BobSlot *pbs = _vm->graphics()->bob(bobNum); |