diff options
author | Strangerke | 2013-03-17 23:33:56 +0100 |
---|---|---|
committer | Strangerke | 2013-03-17 23:33:56 +0100 |
commit | 551b3e5f9536bb8fcb85ecaed0971b83b69cb3ab (patch) | |
tree | 265446e014aca6b49f6292fd6dffe36bf62091e2 /engines/hopkins | |
parent | 7351d5272ce004290904f260400f2a94d3107198 (diff) | |
download | scummvm-rg350-551b3e5f9536bb8fcb85ecaed0971b83b69cb3ab.tar.gz scummvm-rg350-551b3e5f9536bb8fcb85ecaed0971b83b69cb3ab.tar.bz2 scummvm-rg350-551b3e5f9536bb8fcb85ecaed0971b83b69cb3ab.zip |
HOPKINS: End rework on ScriptManager
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/script.cpp | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 1bef607e4a..c1adb1767b 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -1842,19 +1842,26 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.setBobAnimation(4); _vm->_soundManager.loadWav("SOUND69.WAV", 1); - int v42 = 0; - do { + bool playFl = false; + for (;;) { if (_vm->shouldQuit()) return -1; // Exiting game - if (_vm->_objectsManager.getBobAnimDataIdx(4) == 10 && !v42) { - _vm->_soundManager.playWav(1); - v42 = 1; + switch (_vm->_objectsManager.getBobAnimDataIdx(4)) { + case 10: + if (!playFl) { + _vm->_soundManager.playWav(1); + playFl = true; + } + break; + case 11: + playFl = false; + break; } - if (_vm->_objectsManager.getBobAnimDataIdx(4) == 11) - v42 = 0; _vm->_eventsManager.refreshScreenAndEvents(); - } while (_vm->_objectsManager.getBobAnimDataIdx(4) != 24); + if (_vm->_objectsManager.getBobAnimDataIdx(4) == 24) + break; + } _vm->_objectsManager.stopBobAnimation(4); _vm->_objectsManager.animateSprite(0); break; @@ -2012,14 +2019,14 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.refreshScreenAndEvents(); } while (_vm->_linesManager._route != (RouteItem *)g_PTRNUL); _vm->_objectsManager.removeSprite(0); - int v45 = 0; + bool playFl = false; _vm->_objectsManager.setBobAnimation(7); do { if (_vm->shouldQuit()) return -1; // Exiting game - if (_vm->_objectsManager.getBobAnimDataIdx(7) == 9 && !v45) { - v45 = 1; + if (_vm->_objectsManager.getBobAnimDataIdx(7) == 9 && !playFl) { + playFl = true; _vm->_soundManager.playSoundFile("SOUND81.WAV"); } _vm->_eventsManager.refreshScreenAndEvents(); @@ -2064,14 +2071,14 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals.disableHiding(); _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.setBobAnimation(11); - int v46 = 0; + bool playFl = false; do { if (_vm->shouldQuit()) return -1; // Exiting game _vm->_eventsManager.refreshScreenAndEvents(); - if (_vm->_objectsManager.getBobAnimDataIdx(11) == 10 && !v46) - v46 = 1; + if (_vm->_objectsManager.getBobAnimDataIdx(11) == 10 && !playFl) + playFl = true; } while (_vm->_objectsManager.getBobAnimDataIdx(11) != 13); _vm->_objectsManager.stopBobAnimation(11); _vm->_globals.enableHiding(); @@ -2242,11 +2249,11 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.refreshScreenAndEvents(); } - CharacterLocation *v51 = &_vm->_globals._saveData->_realHopkins; - v51->_pos.x = _vm->_objectsManager.getSpriteX(0); - v51->_pos.y = _vm->_objectsManager.getSpriteY(0); - v51->_startSpriteIndex = 57; - v51->_location = 97; + CharacterLocation *realHopkins = &_vm->_globals._saveData->_realHopkins; + realHopkins->_pos.x = _vm->_objectsManager.getSpriteX(0); + realHopkins->_pos.y = _vm->_objectsManager.getSpriteY(0); + realHopkins->_startSpriteIndex = 57; + realHopkins->_location = 97; _vm->_globals._saveData->_data[svHopkinsCloneFl] = 1; _vm->_globals._saveData->_data[svField352] = 1; _vm->_globals._saveData->_data[svField353] = 1; |