diff options
author | Strangerke | 2013-03-02 00:33:08 +0100 |
---|---|---|
committer | Strangerke | 2013-03-02 00:33:08 +0100 |
commit | 06a839165a9b921eb87889679fb4639c78a99f14 (patch) | |
tree | a62c7deba73b6dac3590679c670a7be7f154bcdf /engines/hopkins/script.cpp | |
parent | 167aa598d86b5fa6990b92175c43f68ed95e6385 (diff) | |
download | scummvm-rg350-06a839165a9b921eb87889679fb4639c78a99f14.tar.gz scummvm-rg350-06a839165a9b921eb87889679fb4639c78a99f14.tar.bz2 scummvm-rg350-06a839165a9b921eb87889679fb4639c78a99f14.zip |
HOPKINS: Rework two opcodes
Diffstat (limited to 'engines/hopkins/script.cpp')
-rw-r--r-- | engines/hopkins/script.cpp | 80 |
1 files changed, 48 insertions, 32 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 563ce94c2d..83eaef566b 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -2082,29 +2082,38 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 237: { - char v48 = _vm->_globals._saveData->_data[svField341]; - if (v48) { - if (v48 == 2) - vbobFrameIndex = 5; - if (v48 == 3) - vbobFrameIndex = 4; - if (v48 == 1) - vbobFrameIndex = 6; + switch (_vm->_globals._saveData->_data[svField341]) { + case 1: + vbobFrameIndex = 6; + break; + case 2: + vbobFrameIndex = 5; + break; + case 3: + vbobFrameIndex = 4; + break; + } + + if (_vm->_globals._saveData->_data[svField341]) { _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(vbobFrameIndex, 26, 50, 0); - if (_vm->_globals._saveData->_data[svField341] == 1) + + switch (_vm->_globals._saveData->_data[svField341]) { + case 1: _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); - if (_vm->_globals._saveData->_data[svField341] == 2) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); - if (_vm->_globals._saveData->_data[svField341] == 3) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); - if (_vm->_globals._saveData->_data[svField341] == 1) _vm->_globals._saveData->_data[svField338] = 0; - if (_vm->_globals._saveData->_data[svField341] == 2) + break; + case 2: + _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); _vm->_globals._saveData->_data[svField339] = 0; - if (_vm->_globals._saveData->_data[svField341] == 3) + break; + case 3: + _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); _vm->_globals._saveData->_data[svField340] = 0; + break; + } } + _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(5, 0, 23, 0); _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 3); @@ -2112,28 +2121,35 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 238: { - char v49 = _vm->_globals._saveData->_data[svField341]; - if (v49) { - if (v49 == 2) - vbobFrameIndex = 5; - else if (v49 == 3) - vbobFrameIndex = 4; - else if (v49 == 1) - vbobFrameIndex = 6; + switch (_vm->_globals._saveData->_data[svField341]) { + case 1: + vbobFrameIndex = 6; + break; + case 2: + vbobFrameIndex = 5; + break; + case 3: + vbobFrameIndex = 4; + break; + } + + if (_vm->_globals._saveData->_data[svField341]) { _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(vbobFrameIndex, 26, 50, 0); - if (_vm->_globals._saveData->_data[svField341] == 1) + switch (_vm->_globals._saveData->_data[svField341]) { + case 1: _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 27, 117, 0); - if (_vm->_globals._saveData->_data[svField341] == 2) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); - if (_vm->_globals._saveData->_data[svField341] == 3) - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); - if (_vm->_globals._saveData->_data[svField341] == 1) _vm->_globals._saveData->_data[svField338] = 0; - if (_vm->_globals._saveData->_data[svField341] == 2) + break; + case 2: + _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 145, 166, 2); _vm->_globals._saveData->_data[svField339] = 0; - if (_vm->_globals._saveData->_data[svField341] == 3) + break; + case 3: + _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 296, 212, 4); _vm->_globals._saveData->_data[svField340] = 0; + break; + } } _vm->_soundManager.playSoundFile("SOUND83.WAV"); _vm->_objectsManager.OPTI_ONE(4, 0, 23, 0); |