diff options
author | Strangerke | 2016-04-21 22:36:39 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-10 09:54:21 +0200 |
commit | c30810c933111857a914fc904e71051e861ec125 (patch) | |
tree | d618642a03154acf595c37ba07547084999802a8 | |
parent | 4f4c25534c3e7597c67ced3c5d790380b8a1d787 (diff) | |
download | scummvm-rg350-c30810c933111857a914fc904e71051e861ec125.tar.gz scummvm-rg350-c30810c933111857a914fc904e71051e861ec125.tar.bz2 scummvm-rg350-c30810c933111857a914fc904e71051e861ec125.zip |
GNAP: Refactor scene 15
-rw-r--r-- | engines/gnap/gnap.h | 10 | ||||
-rw-r--r-- | engines/gnap/scenes/scene15.cpp | 251 | ||||
-rw-r--r-- | engines/gnap/scenes/scene15.h | 56 | ||||
-rw-r--r-- | engines/gnap/scenes/scenecore.cpp | 9 |
4 files changed, 192 insertions, 134 deletions
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h index 258bba4e15..137275befd 100644 --- a/engines/gnap/gnap.h +++ b/engines/gnap/gnap.h @@ -603,16 +603,6 @@ public: void sceneXX_playRandomSound(int timerIndex); void playSequences(int fullScreenSpriteId, int sequenceId1, int sequenceId2, int sequenceId3); - // Scene 15 - int _s15_nextRecordSequenceId, _s15_currRecordSequenceId; - int _s15_nextSlotSequenceId, _s15_currSlotSequenceId; - int _s15_nextUpperButtonSequenceId, _s15_currUpperButtonSequenceId; - int _s15_nextLowerButtonSequenceId, _s15_currLowerButtonSequenceId; - int scene15_init(); - void scene15_updateHotspots(); - void scene15_run(); - void scene15_updateAnimations(); - // Scene 16 void scene16_initCutscene(); diff --git a/engines/gnap/scenes/scene15.cpp b/engines/gnap/scenes/scene15.cpp index 7bdfc8174d..1052d573f4 100644 --- a/engines/gnap/scenes/scene15.cpp +++ b/engines/gnap/scenes/scene15.cpp @@ -23,6 +23,7 @@ #include "gnap/gnap.h" #include "gnap/gamesys.h" #include "gnap/resource.h" +#include "gnap/scenes/scene15.h" namespace Gnap { @@ -46,33 +47,43 @@ enum { kHSDevice = 16 }; -int GnapEngine::scene15_init() { +Scene15::Scene15(GnapEngine *vm) : Scene(vm) { + _s15_nextRecordSequenceId = -1; + _s15_currRecordSequenceId = -1; + _s15_nextSlotSequenceId = -1; + _s15_currSlotSequenceId = -1; + _s15_nextUpperButtonSequenceId = -1; + _s15_currUpperButtonSequenceId = -1; + _s15_nextLowerButtonSequenceId = -1; + _s15_currLowerButtonSequenceId = -1; +} + +int Scene15::init() { return 0xDD; } -void GnapEngine::scene15_updateHotspots() { - setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_DISABLED); - setHotspot(kHSExit, 50, 590, 750, 599, SF_EXIT_D_CURSOR); - setHotspot(kHSButton1, 210, 425, 260, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButton2, 280, 425, 325, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButton3, 340, 425, 385, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButton4, 400, 425, 445, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButton5, 460, 425, 510, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButton6, 520, 425, 560, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonA, 205, 480, 250, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonB, 270, 480, 320, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonC, 335, 480, 380, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonD, 395, 480, 445, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonE, 460, 480, 505, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSButtonF, 515, 480, 560, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSCoinSlot, 585, 475, 620, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setHotspot(kHSPlayButton, 622, 431, 650, 482, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); - setDeviceHotspot(kHSDevice, -1, -1, -1, -1); - _hotspotsCount = 17; +void Scene15::updateHotspots() { + _vm->setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_DISABLED); + _vm->setHotspot(kHSExit, 50, 590, 750, 599, SF_EXIT_D_CURSOR); + _vm->setHotspot(kHSButton1, 210, 425, 260, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButton2, 280, 425, 325, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButton3, 340, 425, 385, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButton4, 400, 425, 445, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButton5, 460, 425, 510, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButton6, 520, 425, 560, 475, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonA, 205, 480, 250, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonB, 270, 480, 320, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonC, 335, 480, 380, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonD, 395, 480, 445, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonE, 460, 480, 505, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSButtonF, 515, 480, 560, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSCoinSlot, 585, 475, 620, 535, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setHotspot(kHSPlayButton, 622, 431, 650, 482, SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR); + _vm->setDeviceHotspot(kHSDevice, -1, -1, -1, -1); + _vm->_hotspotsCount = 17; } -void GnapEngine::scene15_run() { - +void Scene15::run() { _s15_currSlotSequenceId = -1; _s15_currUpperButtonSequenceId = -1; _s15_currLowerButtonSequenceId = -1; @@ -82,84 +93,83 @@ void GnapEngine::scene15_run() { _s15_currRecordSequenceId = 0xD5; _s15_nextRecordSequenceId = -1; - _gameSys->setAnimation(0xD5, 1, 0); - _gameSys->insertSequence(_s15_currRecordSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); - - queueInsertDeviceIcon(); + _vm->_gameSys->setAnimation(0xD5, 1, 0); + _vm->_gameSys->insertSequence(_s15_currRecordSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); - endSceneInit(); + _vm->queueInsertDeviceIcon(); - while (!_sceneDone) { + _vm->endSceneInit(); - updateMouseCursor(); - updateCursorByHotspot(); + while (!_vm->_sceneDone) { + _vm->updateMouseCursor(); + _vm->updateCursorByHotspot(); - _hotspots[kHSPlatypus]._x1 = 0; - _hotspots[kHSPlatypus]._y1 = 0; - _hotspots[kHSPlatypus]._x2 = 0; - _hotspots[kHSPlatypus]._y2 = 0; + _vm->_hotspots[kHSPlatypus]._x1 = 0; + _vm->_hotspots[kHSPlatypus]._y1 = 0; + _vm->_hotspots[kHSPlatypus]._x2 = 0; + _vm->_hotspots[kHSPlatypus]._y2 = 0; - _sceneClickedHotspot = getClickedHotspotId(); - updateGrabCursorSprite(0, 0); + _vm->_sceneClickedHotspot = _vm->getClickedHotspotId(); + _vm->updateGrabCursorSprite(0, 0); - switch (_sceneClickedHotspot) { + switch (_vm->_sceneClickedHotspot) { case kHSDevice: - if (_gnapActionStatus < 0) { - runMenu(); - scene15_updateHotspots(); + if (_vm->_gnapActionStatus < 0) { + _vm->runMenu(); + updateHotspots(); } break; case kHSExit: - _newSceneNum = 12; - _isLeavingScene = true; + _vm->_newSceneNum = 12; + _vm->_isLeavingScene = true; break; case kHSCoinSlot: - if (_grabCursorSpriteIndex == kItemQuarter || _grabCursorSpriteIndex == kItemQuarterWithHole) { + if (_vm->_grabCursorSpriteIndex == kItemQuarter || _vm->_grabCursorSpriteIndex == kItemQuarterWithHole) { _s15_nextSlotSequenceId = 0xDC; // Insert coin - } else if (_grabCursorSpriteIndex == kItemDiceQuarterHole) { + } else if (_vm->_grabCursorSpriteIndex == kItemDiceQuarterHole) { _s15_nextSlotSequenceId = 0xDB; - } else if (_grabCursorSpriteIndex >= 0) { - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + } else if (_vm->_grabCursorSpriteIndex >= 0) { + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); } else { - switch (_verbCursor) { + switch (_vm->_verbCursor) { case LOOK_CURSOR: case GRAB_CURSOR: - playSound(0x108E9, false); + _vm->playSound(0x108E9, false); break; case TALK_CURSOR: - playSound((getRandom(5) + 0x8D5) | 0x10000, false); + _vm->playSound((_vm->getRandom(5) + 0x8D5) | 0x10000, false); break; case PLAT_CURSOR: - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); break; } } break; case kHSPlayButton: - if (_grabCursorSpriteIndex >= 0) { - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + if (_vm->_grabCursorSpriteIndex >= 0) { + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); } else { - switch (_verbCursor) { + switch (_vm->_verbCursor) { case LOOK_CURSOR: - if (isFlag(kGFGnapControlsToyUFO) || isFlag(kGFUnk13)) - playSound(0x108E9, false); + if (_vm->isFlag(kGFGnapControlsToyUFO) || _vm->isFlag(kGFUnk13)) + _vm->playSound(0x108E9, false); else _s15_nextSlotSequenceId = 0xDA; break; case GRAB_CURSOR: - if (isFlag(kGFGnapControlsToyUFO) || isFlag(kGFUnk13)) + if (_vm->isFlag(kGFGnapControlsToyUFO) || _vm->isFlag(kGFUnk13)) _s15_nextSlotSequenceId = 0xD9; else _s15_nextSlotSequenceId = 0xDA; break; case TALK_CURSOR: - playSound((getRandom(5) + 0x8D5) | 0x10000, false); + _vm->playSound((_vm->getRandom(5) + 0x8D5) | 0x10000, false); break; case PLAT_CURSOR: - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); break; } } @@ -171,21 +181,21 @@ void GnapEngine::scene15_run() { case kHSButton4: case kHSButton5: case kHSButton6: - if (_grabCursorSpriteIndex >= 0) { - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + if (_vm->_grabCursorSpriteIndex >= 0) { + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); } else { - switch (_verbCursor) { + switch (_vm->_verbCursor) { case LOOK_CURSOR: - playSound(0x108E9, false); + _vm->playSound(0x108E9, false); break; case GRAB_CURSOR: - _s15_nextUpperButtonSequenceId = _sceneClickedHotspot + 0xC5; + _s15_nextUpperButtonSequenceId = _vm->_sceneClickedHotspot + 0xC5; break; case TALK_CURSOR: - playSound((getRandom(5) + 0x8D5) | 0x10000, false); + _vm->playSound((_vm->getRandom(5) + 0x8D5) | 0x10000, false); break; case PLAT_CURSOR: - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); break; } } @@ -197,132 +207,131 @@ void GnapEngine::scene15_run() { case kHSButtonD: case kHSButtonE: case kHSButtonF: - if (_grabCursorSpriteIndex >= 0) { - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + if (_vm->_grabCursorSpriteIndex >= 0) { + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); } else { - switch (_verbCursor) { + switch (_vm->_verbCursor) { case LOOK_CURSOR: - playSound(0x108E9, false); + _vm->playSound(0x108E9, false); break; case GRAB_CURSOR: - _s15_nextLowerButtonSequenceId = _sceneClickedHotspot + 0xC5; + _s15_nextLowerButtonSequenceId = _vm->_sceneClickedHotspot + 0xC5; break; case TALK_CURSOR: - playSound((getRandom(5) + 0x8D5) | 0x10000, false); + _vm->playSound((_vm->getRandom(5) + 0x8D5) | 0x10000, false); break; case PLAT_CURSOR: - _gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _gnapGridX, 576 - _gnapGridY); + _vm->_gameSys->insertSequence(0x107A8, 1, 0, 0, kSeqNone, 0, 900 - _vm->_gnapGridX, 576 - _vm->_gnapGridY); break; } } break; default: - _mouseClickState._left = false; + _vm->_mouseClickState._left = false; break; } - scene15_updateAnimations(); - - checkGameKeys(); + updateAnimations(); + _vm->checkGameKeys(); - if (isKeyStatus1(8)) { - clearKeyStatus1(8); - runMenu(); - scene15_updateHotspots(); + if (_vm->isKeyStatus1(8)) { + _vm->clearKeyStatus1(8); + _vm->runMenu(); + updateHotspots(); } - gameUpdateTick(); + _vm->gameUpdateTick(); } } -void GnapEngine::scene15_updateAnimations() { - if (_gameSys->getAnimationStatus(0) == 2) { - if (_isLeavingScene) { - _sceneDone = true; +void Scene15::updateAnimations() { + if (_vm->_gameSys->getAnimationStatus(0) == 2) { + if (_vm->_isLeavingScene) { + _vm->_sceneDone = true; } else if (_s15_nextSlotSequenceId != -1) { - _gameSys->setAnimation(_s15_nextSlotSequenceId, 1, 0); - _gameSys->insertSequence(_s15_nextSlotSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); + _vm->_gameSys->setAnimation(_s15_nextSlotSequenceId, 1, 0); + _vm->_gameSys->insertSequence(_s15_nextSlotSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); _s15_currSlotSequenceId = _s15_nextSlotSequenceId; _s15_nextSlotSequenceId = -1; switch (_s15_currSlotSequenceId) { case 0xDC: - if (_grabCursorSpriteIndex == kItemQuarter) { - invRemove(kItemQuarter); + if (_vm->_grabCursorSpriteIndex == kItemQuarter) { + _vm->invRemove(kItemQuarter); } else { - invRemove(kItemQuarterWithHole); - setFlag(kGFUnk13); + _vm->invRemove(kItemQuarterWithHole); + _vm->setFlag(kGFUnk13); } - setGrabCursorSprite(-1); + _vm->setGrabCursorSprite(-1); break; case 0xDB: - setFlag(kGFUnk14); - setGrabCursorSprite(-1); + _vm->setFlag(kGFUnk14); + _vm->setGrabCursorSprite(-1); _s15_nextSlotSequenceId = 0xD8; break; case 0xD9: - if (isFlag(kGFGnapControlsToyUFO)) { - clearFlag(kGFGnapControlsToyUFO); - invAdd(kItemQuarter); - _newGrabCursorSpriteIndex = kItemQuarter; - } else if (isFlag(kGFUnk13)) { - clearFlag(kGFUnk13); - invAdd(kItemQuarterWithHole); - _newGrabCursorSpriteIndex = kItemQuarterWithHole; + if (_vm->isFlag(kGFGnapControlsToyUFO)) { + _vm->clearFlag(kGFGnapControlsToyUFO); + _vm->invAdd(kItemQuarter); + _vm->_newGrabCursorSpriteIndex = kItemQuarter; + } else if (_vm->isFlag(kGFUnk13)) { + _vm->clearFlag(kGFUnk13); + _vm->invAdd(kItemQuarterWithHole); + _vm->_newGrabCursorSpriteIndex = kItemQuarterWithHole; } - _newSceneNum = 12; - _isLeavingScene = true; + _vm->_newSceneNum = 12; + _vm->_isLeavingScene = true; break; case 0xD8: case 0xDA: if (_s15_currUpperButtonSequenceId != -1) { - _gameSys->removeSequence(_s15_currUpperButtonSequenceId, 1, true); + _vm->_gameSys->removeSequence(_s15_currUpperButtonSequenceId, 1, true); _s15_currUpperButtonSequenceId = -1; } if (_s15_currLowerButtonSequenceId != -1) { - _gameSys->removeSequence(_s15_currLowerButtonSequenceId, 1, true); + _vm->_gameSys->removeSequence(_s15_currLowerButtonSequenceId, 1, true); _s15_currLowerButtonSequenceId = -1; } break; } } else if (_s15_nextRecordSequenceId != -1) { - _gameSys->setAnimation(_s15_nextRecordSequenceId, 1, 0); - _gameSys->insertSequence(_s15_nextRecordSequenceId, 1, _s15_currRecordSequenceId, 1, kSeqSyncWait, 0, 0, 0); + _vm->_gameSys->setAnimation(_s15_nextRecordSequenceId, 1, 0); + _vm->_gameSys->insertSequence(_s15_nextRecordSequenceId, 1, _s15_currRecordSequenceId, 1, kSeqSyncWait, 0, 0, 0); _s15_currRecordSequenceId = _s15_nextRecordSequenceId; _s15_nextRecordSequenceId = -1; if (_s15_currRecordSequenceId == 0xD3) { - invRemove(kItemDiceQuarterHole); - _newSceneNum = 16; - _isLeavingScene = true; + _vm->invRemove(kItemDiceQuarterHole); + _vm->_newSceneNum = 16; + _vm->_isLeavingScene = true; } - _gameSys->removeSequence(_s15_currUpperButtonSequenceId, 1, true); + _vm->_gameSys->removeSequence(_s15_currUpperButtonSequenceId, 1, true); _s15_currUpperButtonSequenceId = -1; - _gameSys->removeSequence(_s15_currLowerButtonSequenceId, 1, true); + _vm->_gameSys->removeSequence(_s15_currLowerButtonSequenceId, 1, true); _s15_currLowerButtonSequenceId = -1; } else if (_s15_nextUpperButtonSequenceId != -1) { - _gameSys->setAnimation(_s15_nextUpperButtonSequenceId, 1, 0); + _vm->_gameSys->setAnimation(_s15_nextUpperButtonSequenceId, 1, 0); if (_s15_currUpperButtonSequenceId == -1) - _gameSys->insertSequence(_s15_nextUpperButtonSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); + _vm->_gameSys->insertSequence(_s15_nextUpperButtonSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); else - _gameSys->insertSequence(_s15_nextUpperButtonSequenceId, 1, _s15_currUpperButtonSequenceId, 1, kSeqSyncWait, 0, 0, 0); + _vm->_gameSys->insertSequence(_s15_nextUpperButtonSequenceId, 1, _s15_currUpperButtonSequenceId, 1, kSeqSyncWait, 0, 0, 0); _s15_currUpperButtonSequenceId = _s15_nextUpperButtonSequenceId; _s15_nextUpperButtonSequenceId = -1; - if (_s15_currLowerButtonSequenceId != -1 && isFlag(kGFUnk14)) { + if (_s15_currLowerButtonSequenceId != -1 && _vm->isFlag(kGFUnk14)) { if (_s15_currUpperButtonSequenceId == 0xCC && _s15_currLowerButtonSequenceId == 0xCE) _s15_nextRecordSequenceId = 0xD3; else _s15_nextRecordSequenceId = 0xD4; } } else if (_s15_nextLowerButtonSequenceId != -1) { - _gameSys->setAnimation(_s15_nextLowerButtonSequenceId, 1, 0); + _vm->_gameSys->setAnimation(_s15_nextLowerButtonSequenceId, 1, 0); if (_s15_currLowerButtonSequenceId == -1) - _gameSys->insertSequence(_s15_nextLowerButtonSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); + _vm->_gameSys->insertSequence(_s15_nextLowerButtonSequenceId, 1, 0, 0, kSeqNone, 0, 0, 0); else - _gameSys->insertSequence(_s15_nextLowerButtonSequenceId, 1, _s15_currLowerButtonSequenceId, 1, kSeqSyncWait, 0, 0, 0); + _vm->_gameSys->insertSequence(_s15_nextLowerButtonSequenceId, 1, _s15_currLowerButtonSequenceId, 1, kSeqSyncWait, 0, 0, 0); _s15_currLowerButtonSequenceId = _s15_nextLowerButtonSequenceId; _s15_nextLowerButtonSequenceId = -1; - if (_s15_currUpperButtonSequenceId != -1 && isFlag(kGFUnk14)) { + if (_s15_currUpperButtonSequenceId != -1 && _vm->isFlag(kGFUnk14)) { if (_s15_currUpperButtonSequenceId == 0xCC && _s15_currLowerButtonSequenceId == 0xCE) _s15_nextRecordSequenceId = 0xD3; else diff --git a/engines/gnap/scenes/scene15.h b/engines/gnap/scenes/scene15.h new file mode 100644 index 0000000000..584efbb106 --- /dev/null +++ b/engines/gnap/scenes/scene15.h @@ -0,0 +1,56 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef GNAP_SCENE15_H +#define GNAP_SCENE15_H + +#include "gnap/debugger.h" +#include "gnap/scenes/scenecore.h" + +namespace Gnap { + +class GnapEngine; + +class Scene15: public Scene { +public: + Scene15(GnapEngine *vm); + ~Scene15() {} + + virtual int init(); + virtual void updateHotspots(); + virtual void run(); + virtual void updateAnimations(); + virtual void updateAnimationsCb() {}; + +private: + int _s15_nextRecordSequenceId; + int _s15_currRecordSequenceId; + int _s15_nextSlotSequenceId; + int _s15_currSlotSequenceId; + int _s15_nextUpperButtonSequenceId; + int _s15_currUpperButtonSequenceId; + int _s15_nextLowerButtonSequenceId; + int _s15_currLowerButtonSequenceId; +}; + +} // End of namespace Gnap +#endif // GNAP_SCENE15_H diff --git a/engines/gnap/scenes/scenecore.cpp b/engines/gnap/scenes/scenecore.cpp index 9016d8a7c0..6d54e4babb 100644 --- a/engines/gnap/scenes/scenecore.cpp +++ b/engines/gnap/scenes/scenecore.cpp @@ -40,6 +40,7 @@ #include "gnap/scenes/scene12.h" #include "gnap/scenes/scene13.h" #include "gnap/scenes/scene14.h" +#include "gnap/scenes/scene15.h" namespace Gnap { @@ -150,8 +151,9 @@ int GnapEngine::initSceneLogic() { _gameSys->setScaleValues(0, 500, 1, 1000); break; case 15: - backgroundId = scene15_init(); - scene15_updateHotspots(); + _scene = new Scene15(this); + backgroundId = _scene->init(); + _scene->updateHotspots(); _gameSys->setScaleValues(0, 500, 1, 1000); break; case 16: @@ -470,7 +472,8 @@ void GnapEngine::runSceneLogic() { _newSceneNum = 13; break; case 15: - scene15_run(); + _scene->run(); + delete _scene; if (_newSceneNum == 55) _newSceneNum = 12; break; |