diff options
author | Strangerke | 2013-03-21 00:04:30 +0100 |
---|---|---|
committer | Strangerke | 2013-03-21 00:05:01 +0100 |
commit | faebcaf3c1990884a1558aa7c5f80405a8f821ed (patch) | |
tree | 07d257b79a48482f5a75739e594a98ce218ac50e | |
parent | 6d988c18535958b432147f77b484c9284899e143 (diff) | |
download | scummvm-rg350-faebcaf3c1990884a1558aa7c5f80405a8f821ed.tar.gz scummvm-rg350-faebcaf3c1990884a1558aa7c5f80405a8f821ed.tar.bz2 scummvm-rg350-faebcaf3c1990884a1558aa7c5f80405a8f821ed.zip |
HOPKINS: Rename on more variable, some little refactoring in ScriptManager
-rw-r--r-- | engines/hopkins/script.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index ab4dcbcb11..3bc153a865 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -176,7 +176,7 @@ int ScriptManager::handleOpcode(byte *dataP) { if (!_vm->_objectsManager->_disableFl) { int vbobIdx = dataP[5]; vbobFrameIndex = dataP[6]; - int v4 = dataP[7]; + int moveChange = dataP[7]; int vbobPosX = READ_LE_INT16(dataP + 8); int vbobPosY = READ_LE_INT16(dataP + 10); if (vbobIdx == 52) { @@ -185,16 +185,16 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_objectsManager->BOB_VIVANT(vbobFrameIndex); } else if (vbobIdx != 50) { _vm->_objectsManager->VBOB(_vm->_globals->SPRITE_ECRAN, vbobIdx, vbobPosX, vbobPosY, vbobFrameIndex); - if (v4) - v4 /= _vm->_globals->_speed; - if (v4 > 1) { + if (moveChange) + moveChange /= _vm->_globals->_speed; + if (moveChange > 1) { do { if (_vm->shouldQuit()) return -1; // Exiting game - --v4; + --moveChange; _vm->_eventsManager->refreshScreenAndEvents(); - } while (v4); + } while (moveChange); } } } @@ -2097,28 +2097,35 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 236: { - char v47 = _vm->_globals->_saveData->_data[svField341]; - if (v47) { - if (v47 == 2) + if (_vm->_globals->_saveData->_data[svField341]) { + switch (_vm->_globals->_saveData->_data[svField341]) { + case 1: + vbobFrameIndex = 6; + break; + case 2: vbobFrameIndex = 5; - else if (v47 == 3) + break; + case 3: vbobFrameIndex = 4; - else if (v47 == 1) - vbobFrameIndex = 6; + break; + } _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(6, 0, 23, 0); |