diff options
author | Willem Jan Palenstijn | 2013-02-18 23:52:55 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-02-18 23:54:18 +0100 |
commit | 81bb4d43743c538c0e37e484e1f6f05e97222c9c (patch) | |
tree | 3824cbddbdc3d5d4d41c1802f8be032be5f9f1d7 /engines/hopkins/script.cpp | |
parent | 6df59334b8998e25abdc46a2dfc718635f5a24df (diff) | |
parent | 7428af9a4c612b59cee7f55d867a00464b3dae64 (diff) | |
download | scummvm-rg350-81bb4d43743c538c0e37e484e1f6f05e97222c9c.tar.gz scummvm-rg350-81bb4d43743c538c0e37e484e1f6f05e97222c9c.tar.bz2 scummvm-rg350-81bb4d43743c538c0e37e484e1f6f05e97222c9c.zip |
HOPKINS: Merge 'remotes/dreammaster/hopkins' into hopkins
Conflicts:
engines/hopkins/lines.cpp
engines/hopkins/lines.h
engines/hopkins/objects.cpp
Diffstat (limited to 'engines/hopkins/script.cpp')
-rw-r--r-- | engines/hopkins/script.cpp | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 33876f8293..64f5fe2a57 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -54,7 +54,7 @@ int ScriptManager::handleOpcode(byte *dataP) { switch (signature24) { case MKTAG24('T', 'X', 'T'): { vbobFrameIndex = dataP[6]; - int mesgId = (int16)READ_LE_UINT16(dataP + 13); + int mesgId = READ_LE_INT16(dataP + 13); opcodeType = 1; if (!TRAVAILOBJET) { if (_vm->_globals._saveData->_data[svField356] == 1) { @@ -133,8 +133,8 @@ int ScriptManager::handleOpcode(byte *dataP) { } while (_vm->_soundManager._soundFl); } if (!_vm->_soundManager._textOffFl) { - int textPosX = (int16)READ_LE_UINT16(dataP + 9); - int textPosY = (int16)READ_LE_UINT16(dataP + 11); + int textPosX = READ_LE_INT16(dataP + 9); + int textPosY = READ_LE_INT16(dataP + 11); _vm->_fontManager.initTextBuffers(9, mesgId, _vm->_globals.FICH_TEXTE, 2 * textPosX, 2 * textPosY + 40, 6, dataP[7], 253); if (!_vm->_soundManager._textOffFl) _vm->_fontManager.showText(9); @@ -149,7 +149,7 @@ int ScriptManager::handleOpcode(byte *dataP) { if (!_vm->_soundManager._voiceOffFl) _vm->_soundManager.mixVoice(635, 4); } else { - int textPosX = (int16)READ_LE_UINT16(dataP + 9); + int textPosX = READ_LE_INT16(dataP + 9); if (_vm->_globals._language == LANG_FR && !_vm->_soundManager._textOffFl) _vm->_fontManager.initTextBuffers(9, mesgId, "OBJET1.TXT", 2 * textPosX, 60, 6, dataP[7], 253); else if (_vm->_globals._language == LANG_EN && !_vm->_soundManager._textOffFl) @@ -172,10 +172,10 @@ int ScriptManager::handleOpcode(byte *dataP) { int vbobIdx = dataP[5]; vbobFrameIndex = dataP[6]; int v4 = dataP[7]; - int vbobPosX = (int16)READ_LE_UINT16(dataP + 8); - int vbobPosY = (int16)READ_LE_UINT16(dataP + 10); + int vbobPosX = READ_LE_INT16(dataP + 8); + int vbobPosY = READ_LE_INT16(dataP + 10); if (vbobIdx == 52) { - _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, vbobPosX, (int16)READ_LE_UINT16(dataP + 10), vbobFrameIndex); + _vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, vbobPosX, READ_LE_INT16(dataP + 10), vbobFrameIndex); } else if (vbobIdx == 51) { _vm->_objectsManager.BOB_VIVANT(vbobFrameIndex); } else if (vbobIdx != 50) { @@ -198,8 +198,8 @@ int ScriptManager::handleOpcode(byte *dataP) { case MKTAG24('S', 'T', 'P'): if (!_vm->_objectsManager._disableFl) { _vm->_objectsManager._twoCharactersFl = false; - _vm->_objectsManager._characterPos.x = (int16)READ_LE_UINT16(dataP + 6); - _vm->_objectsManager._characterPos.y = (int16)READ_LE_UINT16(dataP + 8); + _vm->_objectsManager._characterPos.x = READ_LE_INT16(dataP + 6); + _vm->_objectsManager._characterPos.y = READ_LE_INT16(dataP + 8); _vm->_objectsManager._startSpriteIndex = dataP[5]; if (_vm->_objectsManager._changeHeadFl) { if (_vm->_globals._saveData->_data[svField354] == 1 @@ -266,183 +266,183 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case MKTAG24('B', 'O', 'F'): if (!_vm->_objectsManager._disableFl) - _vm->_objectsManager.VBOB_OFF((int16)READ_LE_UINT16(dataP + 5)); + _vm->_objectsManager.VBOB_OFF(READ_LE_INT16(dataP + 5)); opcodeType = 1; break; case MKTAG24('P', 'E', 'R'): { - int specialOpcode = (int16)READ_LE_UINT16(dataP + 5); + int specialOpcode = READ_LE_INT16(dataP + 5); if (!_vm->_globals._saveData->_data[svField122] && !_vm->_globals._saveData->_data[svField356]) { vbobFrameIndex = 0; switch (specialOpcode) { case 1: case 14: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(4); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(4); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(4); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(4); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(4); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(4); break; case 2: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(7); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(7); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(7); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(7); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(7); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(7); - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(8); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(8); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(8); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(8); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(8); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(8); break; case 19: case 4: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(1); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(1); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(1); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(1); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(1); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(1); break; case 5: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(5); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(5); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(5); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(5); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(5); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(5); - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(6); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(6); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(6); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(6); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(6); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(6); break; case 17: case 7: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(2); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(2); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(2); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(2); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(2); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(2); break; case 18: case 8: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(3); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(3); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(3); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(3); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(3); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(3); break; case 9: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(5); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(5); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(5); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(5); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(5); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(5); break; case 10: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(6); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(6); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(6); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(6); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(6); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(6); break; case 15: case 11: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(7); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(7); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(7); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(7); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(7); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(7); break; case 16: case 12: - if (_vm->_globals._actionDirection == 1) + if (_vm->_globals._actionDirection == DIR_UP) _vm->_objectsManager.doActionBack(8); - if (_vm->_globals._actionDirection == 3) + if (_vm->_globals._actionDirection == DIR_RIGHT) _vm->_objectsManager.doActionRight(8); - if (_vm->_globals._actionDirection == 2) + if (_vm->_globals._actionDirection == DIR_UP_RIGHT) _vm->_objectsManager.doActionDiagRight(8); - if (_vm->_globals._actionDirection == 5) + if (_vm->_globals._actionDirection == DIR_DOWN) _vm->_objectsManager.doActionFront(8); - if (_vm->_globals._actionDirection == 8) + if (_vm->_globals._actionDirection == DIR_UP_LEFT) _vm->_objectsManager.doActionDiagLeft(8); - if (_vm->_globals._actionDirection == 7) + if (_vm->_globals._actionDirection == DIR_LEFT) _vm->_objectsManager.doActionLeft(8); break; } @@ -468,36 +468,36 @@ int ScriptManager::handleOpcode(byte *dataP) { } case MKTAG24('O', 'B', 'P'): opcodeType = 1; - _vm->_objectsManager.addObject((int16)READ_LE_UINT16(dataP + 5)); + _vm->_objectsManager.addObject(READ_LE_INT16(dataP + 5)); break; case MKTAG24('O', 'B', 'M'): opcodeType = 1; - _vm->_objectsManager.removeObject((int16)READ_LE_UINT16(dataP + 5)); + _vm->_objectsManager.removeObject(READ_LE_INT16(dataP + 5)); break; case MKTAG24('G', 'O', 'T'): opcodeType = 2; break; case MKTAG24('Z', 'O', 'N'): - _vm->_linesManager.enableZone((int16)READ_LE_UINT16(dataP + 5)); + _vm->_linesManager.enableZone(READ_LE_INT16(dataP + 5)); opcodeType = 1; break; case MKTAG24('Z', 'O', 'F'): - _vm->_linesManager.disableZone((int16)READ_LE_UINT16(dataP + 5)); + _vm->_linesManager.disableZone(READ_LE_INT16(dataP + 5)); opcodeType = 1; break; case MKTAG24('E', 'X', 'I'): opcodeType = 5; break; case MKTAG24('S', 'O', 'R'): - _vm->_globals._exitId = (int16)READ_LE_UINT16(dataP + 5); + _vm->_globals._exitId = READ_LE_INT16(dataP + 5); opcodeType = 5; break; case MKTAG24('B', 'C', 'A'): - _vm->_globals.B_CACHE_OFF((int16)READ_LE_UINT16(dataP + 5)); + _vm->_globals.B_CACHE_OFF(READ_LE_INT16(dataP + 5)); opcodeType = 1; break; case MKTAG24('A', 'N', 'I'): { - int animId = (int16)READ_LE_UINT16(dataP + 5); + int animId = READ_LE_INT16(dataP + 5); if (animId <= 100) _vm->_objectsManager.setBobAnimation(animId); else @@ -506,7 +506,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; } case MKTAG24('S', 'P', 'E'): - switch ((int16)READ_LE_UINT16(dataP + 5)) { + switch (READ_LE_INT16(dataP + 5)) { case 6: _vm->_objectsManager.removeSprite(0); _vm->_objectsManager.OPTI_ONE(20, 0, 14, 4); @@ -955,7 +955,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 59: { _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 445, 332); @@ -1055,7 +1055,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 81: { _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; _vm->_linesManager._route = _vm->_linesManager.PARCOURS2(_vm->_objectsManager.getSpriteX(0), _vm->_objectsManager.getSpriteY(0), 119, 268); @@ -1372,7 +1372,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 105: _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; if (_vm->_globals._saveData->_data[svField253] == 1) { @@ -1619,7 +1619,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals._introSpeechOffFl = false; _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_globals.NOT_VERIF = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; @@ -1647,7 +1647,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals._introSpeechOffFl = false; _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_globals.NOT_VERIF = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; @@ -1949,7 +1949,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_globals.CACHE_ON(); _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); - _vm->_globals._oldDirection = -1; + _vm->_globals._oldDirection = DIR_NONE; _vm->_globals.Compteur = 0; _vm->_globals.NOT_VERIF = true; _vm->_linesManager._route = (RouteItem *)g_PTRNUL; @@ -2373,34 +2373,34 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case MKTAG24('V', 'A', 'L'): { opcodeType = 1; - int idx = (int16)READ_LE_UINT16(dataP + 5); + int idx = READ_LE_INT16(dataP + 5); assert(idx >= 0 && idx < 2050); _vm->_globals._saveData->_data[idx] = dataP[7]; break; } case MKTAG24('A', 'D', 'D'): opcodeType = 1; - _vm->_globals._saveData->_data[(int16)READ_LE_UINT16(dataP + 5)] += dataP[7]; + _vm->_globals._saveData->_data[READ_LE_INT16(dataP + 5)] += dataP[7]; break; case MKTAG24('B', 'O', 'S'): opcodeType = 1; - _vm->_objectsManager.BOB_OFFSET((int16)READ_LE_UINT16(dataP + 5), (int16)READ_LE_UINT16(dataP + 7)); + _vm->_objectsManager.BOB_OFFSET(READ_LE_INT16(dataP + 5), READ_LE_INT16(dataP + 7)); break; case MKTAG24('V', 'O', 'N'): - _vm->_objectsManager.enableVerb((int16)READ_LE_UINT16(dataP + 5), (int16)READ_LE_UINT16(dataP + 7)); + _vm->_objectsManager.enableVerb(READ_LE_INT16(dataP + 5), READ_LE_INT16(dataP + 7)); opcodeType = 1; break; case MKTAG24('Z', 'C', 'H'): - _vm->_linesManager.ZONEP[(int16)READ_LE_UINT16(dataP + 5)].field12 = (int16)READ_LE_UINT16(dataP + 7); + _vm->_linesManager.ZONEP[READ_LE_INT16(dataP + 5)].field12 = READ_LE_INT16(dataP + 7); opcodeType = 1; break; case MKTAG24('J', 'U', 'M'): - _vm->_objectsManager._jumpZone = (int16)READ_LE_UINT16(dataP + 5); - _vm->_objectsManager._jumpVerb = (int16)READ_LE_UINT16(dataP + 7); + _vm->_objectsManager._jumpZone = READ_LE_INT16(dataP + 5); + _vm->_objectsManager._jumpVerb = READ_LE_INT16(dataP + 7); opcodeType = 6; break; case MKTAG24('S', 'O', 'U'): { - int soundNum = (int16)READ_LE_UINT16(dataP + 5); + int soundNum = READ_LE_INT16(dataP + 5); Common::String file = Common::String::format("SOUND%d.WAV", soundNum); _vm->_soundManager.playSound(file); @@ -2408,7 +2408,7 @@ int ScriptManager::handleOpcode(byte *dataP) { break; } case MKTAG24('V', 'O', 'F'): - _vm->_objectsManager.disableVerb((int16)READ_LE_UINT16(dataP + 5), (int16)READ_LE_UINT16(dataP + 7)); + _vm->_objectsManager.disableVerb(READ_LE_INT16(dataP + 5), READ_LE_INT16(dataP + 7)); opcodeType = 1; break; case MKTAG24('I', 'I', 'F'): @@ -2424,7 +2424,7 @@ int ScriptManager::handleOpcode(byte *dataP) { int ScriptManager::handleGoto(const byte *dataP) { - return (int16)READ_LE_UINT16(dataP + 5); + return READ_LE_INT16(dataP + 5); } int ScriptManager::handleIf(const byte *dataP, int a2) { @@ -2468,8 +2468,8 @@ int ScriptManager::handleIf(const byte *dataP, int a2) { byte oper = buf[13]; byte oper2 = buf[14]; byte operType = buf[15]; - int saveDataIdx1 = (int16)READ_LE_UINT16(buf + 5); - int compVal1 = (int16)READ_LE_UINT16(buf + 7); + int saveDataIdx1 = READ_LE_INT16(buf + 5); + int compVal1 = READ_LE_INT16(buf + 7); bool check1Fl = false; if ((oper == 1 && _vm->_globals._saveData->_data[saveDataIdx1] == compVal1) || (oper == 2 && _vm->_globals._saveData->_data[saveDataIdx1] != compVal1) || @@ -2481,8 +2481,8 @@ int ScriptManager::handleIf(const byte *dataP, int a2) { bool check2Fl = false; if (operType != 3) { - int saveDataIdx2 = (int16)READ_LE_UINT16(buf + 9); - int compVal2 = (int16)READ_LE_UINT16(buf + 11); + int saveDataIdx2 = READ_LE_INT16(buf + 9); + int compVal2 = READ_LE_INT16(buf + 11); if ((oper2 == 1 && compVal2 == _vm->_globals._saveData->_data[saveDataIdx2]) || (oper2 == 2 && compVal2 != _vm->_globals._saveData->_data[saveDataIdx2]) || (oper2 == 3 && compVal2 >= _vm->_globals._saveData->_data[saveDataIdx2]) || |