diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/anim.cpp | 8 | ||||
-rw-r--r-- | engines/hopkins/font.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/globals.cpp | 8 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 8 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 12 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 92 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 66 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 118 |
9 files changed, 159 insertions, 157 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index 2186967922..38f02c3fda 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -532,10 +532,10 @@ int AnimationManager::loadSpriteBank(int idx, const Common::String &filename) { byte *ofsData = _vm->_fileManager.loadFile(ofsFilename); byte *curOfsData = ofsData; for (int objIdx = 0; objIdx < _vm->_globals.Bank[idx]._objDataIdx; ++objIdx, curOfsData += 8) { - int x1 = (int16)READ_LE_UINT16(curOfsData); - int y1 = (int16)READ_LE_UINT16(curOfsData + 2); - int x2 = (int16)READ_LE_UINT16(curOfsData + 4); - int y2 = (int16)READ_LE_UINT16(curOfsData + 6); + int x1 = READ_LE_INT16(curOfsData); + int y1 = READ_LE_INT16(curOfsData + 2); + int x2 = READ_LE_INT16(curOfsData + 4); + int y2 = READ_LE_INT16(curOfsData + 6); _vm->_objectsManager.setOffsetXY(_vm->_globals.Bank[idx]._data, objIdx, x1, y1, 0); if (_vm->_globals.Bank[idx]._fileHeader == 2) diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 3343c2fd10..844bcb930d 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -210,7 +210,7 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in _tempText = _vm->_globals.allocMemory(110); Common::fill(&_tempText[0], &_tempText[110], 0); memcpy(_tempText, _vm->_globals.BUF_ZONE + _index[messageId], 96); - WRITE_LE_UINT16((uint16 *)_tempText + 48, (int16)READ_LE_UINT16(_vm->_globals.BUF_ZONE + _index[messageId] + 96)); + WRITE_LE_UINT16((uint16 *)_tempText + 48, READ_LE_INT16(_vm->_globals.BUF_ZONE + _index[messageId] + 96)); } byte *curTempTextPtr = _tempText; for (int i = 0; i < bufSize; i++) { diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index ac903ddd00..633f222092 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -412,10 +412,10 @@ void Globals::loadCache(const Common::String &file) { CACHE_BANQUE[1] = spriteData; int curBufIdx = 60; for (int i = 0; i <= 21; i++) { - Cache[i]._spriteIndex = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx); - Cache[i]._x = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 1); - Cache[i]._y = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 2); - Cache[i].field14 = (int16)READ_LE_UINT16((uint16 *)ptr + curBufIdx + 4); + Cache[i]._spriteIndex = READ_LE_INT16((uint16 *)ptr + curBufIdx); + Cache[i]._x = READ_LE_INT16((uint16 *)ptr + curBufIdx + 1); + Cache[i]._y = READ_LE_INT16((uint16 *)ptr + curBufIdx + 2); + Cache[i].field14 = READ_LE_INT16((uint16 *)ptr + curBufIdx + 4); if (spriteData == g_PTRNUL) { Cache[i]._useCount = 0; } else { diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 61af620769..0e2df5e04a 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1246,9 +1246,9 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp spriteStartP += READ_LE_UINT32(spriteStartP) + 16; const byte *spriteSizeP = spriteStartP + 4; - int spriteWidth = (int16)READ_LE_UINT16(spriteSizeP); + int spriteWidth = READ_LE_INT16(spriteSizeP); spriteSizeP += 2; - int spriteHeight2 = (int16)READ_LE_UINT16(spriteSizeP); + int spriteHeight2 = READ_LE_INT16(spriteSizeP); int spriteHeight1 = spriteHeight2; const byte *spritePixelsP = spriteSizeP + 10; _posXClipped = 0; @@ -1639,9 +1639,9 @@ void GraphicsManager::displayFont(byte *surface, const byte *spriteData, int xp, int spriteWidth = 0; int spriteHeight = 0; const byte *spriteSizeP = spriteDataP + 4; - spriteWidth = (int16)READ_LE_UINT16(spriteSizeP); + spriteWidth = READ_LE_INT16(spriteSizeP); spriteSizeP += 2; - spriteHeight = (int16)READ_LE_UINT16(spriteSizeP); + spriteHeight = READ_LE_INT16(spriteSizeP); const byte *spritePixelsP = spriteSizeP + 10; byte *destP = surface + xp + _lineNbr2 * yp; _width = spriteWidth; diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index fe14b23a9a..0fd683375f 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -82,6 +82,8 @@ enum { */ #define MKTAG24(a0,a1,a2) ((uint32)((a2) | (a1) << 8 | ((a0) << 16))) +#define READ_LE_INT16(x) (int16) READ_LE_UINT16(x) + struct HopkinsGameDescription; class HopkinsEngine : public Engine { diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index c4441e0da7..4cb2dd3d09 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -90,13 +90,13 @@ void LinesManager::loadLines(const Common::String &file) { _linesNumb = 0; _lastLine = 0; byte *ptr = _vm->_fileManager.loadFile(file); - for (int idx = 0; (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)) != -1; idx++) { + for (int idx = 0; READ_LE_INT16((uint16 *)ptr + (idx * 5)) != -1; idx++) { addLine(idx, - (Directions)(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)), - (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 1), - (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 2), - (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 3), - (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 4)); + (Directions)READ_LE_INT16((uint16 *)ptr + (idx * 5)), + READ_LE_INT16((uint16 *)ptr + (idx * 5) + 1), + READ_LE_INT16((uint16 *)ptr + (idx * 5) + 2), + READ_LE_INT16((uint16 *)ptr + (idx * 5) + 3), + READ_LE_INT16((uint16 *)ptr + (idx * 5) + 4)); } initRoute(); _vm->_globals.freeMemory(ptr); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 7c39d271c4..ce2fae8f79 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -193,9 +193,9 @@ int ObjectsManager::getOffsetX(const byte *spriteData, int spriteIndex, bool isS v3 += READ_LE_UINT32(v3) + 16; const byte *v5 = v3 + 8; - int result = (int16)READ_LE_UINT16(v5); + int result = READ_LE_INT16(v5); if (isSize) - result = (int16)READ_LE_UINT16(v5 + 4); + result = READ_LE_INT16(v5 + 4); return result; } @@ -206,9 +206,9 @@ int ObjectsManager::getOffsetY(const byte *spriteData, int spriteIndex, bool isS v3 += READ_LE_UINT32(v3) + 16; const byte *v5 = v3 + 10; - int result = (int16)READ_LE_UINT16(v5); + int result = READ_LE_INT16(v5); if (isSize) - result = (int16)READ_LE_UINT16(v5 + 4); + result = READ_LE_INT16(v5 + 4); return result; } @@ -221,7 +221,7 @@ int ObjectsManager::getWidth(const byte *objectData, int idx) { for (int i = idx; i; --i) rectP += READ_LE_UINT32(rectP) + 16; - return (int16)READ_LE_UINT16(rectP + 4); + return READ_LE_INT16(rectP + 4); } /** @@ -232,7 +232,7 @@ int ObjectsManager::getHeight(const byte *objectData, int idx) { for (int i = idx; i; --i) rectP += READ_LE_UINT32(rectP) + 16; - return (int16)READ_LE_UINT16(rectP + 6); + return READ_LE_INT16(rectP + 6); } void ObjectsManager::sprite_alone(const byte *objectData, byte *sprite, int objIndex) { @@ -242,7 +242,7 @@ void ObjectsManager::sprite_alone(const byte *objectData, byte *sprite, int objI } objP += 4; - int result = (int16)READ_LE_UINT16(objP) * (int16)READ_LE_UINT16(objP + 2); + int result = READ_LE_INT16(objP) * READ_LE_INT16(objP + 2); memcpy(sprite + 3, objP - 4, result + 16); } @@ -254,7 +254,7 @@ void ObjectsManager::capture_mem_sprite(const byte *objectData, byte *sprite, in } objP += 4; - int result = (int16)READ_LE_UINT16(objP) * (int16)READ_LE_UINT16(objP + 2); + int result = READ_LE_INT16(objP) * READ_LE_INT16(objP + 2); memcpy(sprite, objP + 12, result); } @@ -582,17 +582,17 @@ void ObjectsManager::BOB_VISU(int idx) { resetBob(idx); const byte *data = _vm->_globals.Bqe_Anim[idx]._data; - int bankIdx = (int16)READ_LE_UINT16(data); + int bankIdx = READ_LE_INT16(data); if (!bankIdx) return; if ((!_vm->_globals.Bank[bankIdx]._loadedFl) || (!READ_LE_UINT16(data + 24))) return; - int16 v9 = (int16)READ_LE_UINT16(data + 2); - int16 v8 = (int16)READ_LE_UINT16(data + 4); - int16 offsetY = (int16)READ_LE_UINT16(data + 6); - int16 v6 = (int16)READ_LE_UINT16(data + 8); + int16 v9 = READ_LE_INT16(data + 2); + int16 v8 = READ_LE_INT16(data + 4); + int16 offsetY = READ_LE_INT16(data + 6); + int16 v6 = READ_LE_INT16(data + 8); if (!v9) v9 = 1; @@ -949,15 +949,15 @@ void ObjectsManager::displayBobAnim() { byte *dataPtr = _bob[idx]._animData + 20; int dataIdx = _bob[idx]._animDataIdx; - _bob[idx]._xp = (int16)READ_LE_UINT16(dataPtr + 2 * dataIdx); + _bob[idx]._xp = READ_LE_INT16(dataPtr + 2 * dataIdx); if (_vm->_globals._lockedAnims[idx]._enableFl) _bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX; if ( PERSO_ON && idx > 20 ) _bob[idx]._xp += _vm->_eventsManager._startPos.x; - _bob[idx]._yp = (int16)READ_LE_UINT16(dataPtr + 2 * dataIdx + 2); - _bob[idx].field12 = (int16)READ_LE_UINT16(dataPtr + 2 * dataIdx + 4); - _bob[idx]._zoomFactor = (int16)READ_LE_UINT16(dataPtr + 2 * dataIdx + 6); + _bob[idx]._yp = READ_LE_INT16(dataPtr + 2 * dataIdx + 2); + _bob[idx].field12 = READ_LE_INT16(dataPtr + 2 * dataIdx + 4); + _bob[idx]._zoomFactor = READ_LE_INT16(dataPtr + 2 * dataIdx + 6); _bob[idx]._frameIndex = dataPtr[2 * dataIdx + 8]; _bob[idx]._flipFl = (dataPtr[2 * dataIdx + 9] != 0); _bob[idx]._animDataIdx += 5; @@ -983,16 +983,16 @@ void ObjectsManager::displayBobAnim() { } else { _bob[idx]._animDataIdx = 0; byte *v21 = _bob[idx]._animData + 20; - _bob[idx]._xp = (int16)READ_LE_UINT16(v21); + _bob[idx]._xp = READ_LE_INT16(v21); if (_vm->_globals._lockedAnims[idx]._enableFl) _bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX; if (PERSO_ON && idx > 20) _bob[idx]._xp += _vm->_eventsManager._startPos.x; - _bob[idx]._yp = (int16)READ_LE_UINT16(v21 + 2); - _bob[idx].field12 = (int16)READ_LE_UINT16(v21 + 4); - _bob[idx]._zoomFactor = (int16)READ_LE_UINT16(v21 + 6); + _bob[idx]._yp = READ_LE_INT16(v21 + 2); + _bob[idx].field12 = READ_LE_INT16(v21 + 4); + _bob[idx]._zoomFactor = READ_LE_INT16(v21 + 6); _bob[idx]._frameIndex = v21[8]; _bob[idx]._flipFl = (v21[9] != 0); _bob[idx]._animDataIdx += 5; @@ -1684,7 +1684,7 @@ void ObjectsManager::loadZone(const Common::String &file) { int zoneLineIdx = 0; int bobZoneIdx; do { - bobZoneIdx = (int16)READ_LE_UINT16((uint16 *)ptr + bufId); + bobZoneIdx = READ_LE_INT16((uint16 *)ptr + bufId); if (bobZoneIdx != -1) { _vm->_linesManager.addZoneLine( zoneLineIdx, @@ -1700,9 +1700,9 @@ void ObjectsManager::loadZone(const Common::String &file) { } while (bobZoneIdx != -1); for (int i = 1; i <= 100; i++) { - _vm->_linesManager.ZONEP[i]._destX = (int16)READ_LE_UINT16((uint16 *)ptr + bufId); - _vm->_linesManager.ZONEP[i]._destY = (int16)READ_LE_UINT16((uint16 *)ptr + bufId + 1); - _vm->_linesManager.ZONEP[i]._spriteIndex = (int16)READ_LE_UINT16((uint16 *)ptr + bufId + 2); + _vm->_linesManager.ZONEP[i]._destX = READ_LE_INT16((uint16 *)ptr + bufId); + _vm->_linesManager.ZONEP[i]._destY = READ_LE_INT16((uint16 *)ptr + bufId + 1); + _vm->_linesManager.ZONEP[i]._spriteIndex = READ_LE_INT16((uint16 *)ptr + bufId + 2); bufId += 3; } @@ -2710,8 +2710,8 @@ void ObjectsManager::BOB_VIVANT(int idx) { if (!READ_LE_UINT16(_vm->_talkManager._characterAnim + startPos + 4)) return; - int xp = (int16)READ_LE_UINT16(_vm->_talkManager._characterAnim + startPos); - int yp = (int16)READ_LE_UINT16(_vm->_talkManager._characterAnim + startPos + 2); + int xp = READ_LE_INT16(_vm->_talkManager._characterAnim + startPos); + int yp = READ_LE_INT16(_vm->_talkManager._characterAnim + startPos + 2); int spriteIndex = _vm->_talkManager._characterAnim[startPos + 8]; _vm->_graphicsManager.fastDisplay(_vm->_talkManager._characterSprite, xp, yp, spriteIndex); @@ -3069,7 +3069,7 @@ void ObjectsManager::INILINK(const Common::String &file) { } if (!OBSSEUL) { for (int idx = 0; idx < 500; ++idx) - _vm->_globals._spriteSize[idx] = (int16)READ_LE_UINT16((uint16 *)ptr + idx); + _vm->_globals._spriteSize[idx] = READ_LE_INT16((uint16 *)ptr + idx); _vm->_globals.resetCache(); @@ -3086,11 +3086,11 @@ void ObjectsManager::INILINK(const Common::String &file) { int curDataCacheId = 60; byte *curDataPtr = ptr + 1000; for (int cacheIdx = 0; cacheIdx <= 21; cacheIdx++) { - int curSpriteId = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataCacheId); + int curSpriteId = READ_LE_INT16(curDataPtr + 2 * curDataCacheId); _vm->_globals.Cache[cacheIdx]._spriteIndex = curSpriteId; - _vm->_globals.Cache[cacheIdx]._x = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataCacheId + 2); - _vm->_globals.Cache[cacheIdx]._y = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataCacheId + 4); - _vm->_globals.Cache[cacheIdx].field14 = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataCacheId + 8); + _vm->_globals.Cache[cacheIdx]._x = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 2); + _vm->_globals.Cache[cacheIdx]._y = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 4); + _vm->_globals.Cache[cacheIdx].field14 = READ_LE_INT16(curDataPtr + 2 * curDataCacheId + 8); if (!_vm->_globals.CACHE_BANQUE[1]) { _vm->_globals.Cache[cacheIdx]._useCount = 0; @@ -3119,15 +3119,15 @@ void ObjectsManager::INILINK(const Common::String &file) { _vm->_linesManager.resetLinesNumb(); Directions curDirection; do { - curDirection = (Directions)(int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx); + curDirection = (Directions)READ_LE_INT16(curDataPtr + 2 * lineDataIdx); if (curDirection != DIR_NONE) { _vm->_linesManager.addLine( curLineIdx, curDirection, - (int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx + 2), - (int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx + 4), - (int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx + 6), - (int16)READ_LE_UINT16(curDataPtr + 2 * lineDataIdx + 8)); + READ_LE_INT16(curDataPtr + 2 * lineDataIdx + 2), + READ_LE_INT16(curDataPtr + 2 * lineDataIdx + 4), + READ_LE_INT16(curDataPtr + 2 * lineDataIdx + 6), + READ_LE_INT16(curDataPtr + 2 * lineDataIdx + 8)); } lineDataIdx += 5; ++curLineIdx; @@ -3161,14 +3161,14 @@ void ObjectsManager::INILINK(const Common::String &file) { int curLineIdx = 0; int v28; do { - v28 = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx); + v28 = READ_LE_INT16(curDataPtr + 2 * curDataIdx); if (v28 != -1) { _vm->_linesManager.addZoneLine( curLineIdx, - (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 2), - (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 4), - (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 6), - (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 8), + READ_LE_INT16(curDataPtr + 2 * curDataIdx + 2), + READ_LE_INT16(curDataPtr + 2 * curDataIdx + 4), + READ_LE_INT16(curDataPtr + 2 * curDataIdx + 6), + READ_LE_INT16(curDataPtr + 2 * curDataIdx + 8), v28); _vm->_linesManager.ZONEP[v28]._enabledFl = true; } @@ -3176,9 +3176,9 @@ void ObjectsManager::INILINK(const Common::String &file) { ++curLineIdx; } while (v28 != -1); for (int i = 1; i <= 100; i++) { - _vm->_linesManager.ZONEP[i]._destX = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx); - _vm->_linesManager.ZONEP[i]._destY = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 2); - _vm->_linesManager.ZONEP[i]._spriteIndex = (int16)READ_LE_UINT16(curDataPtr + 2 * curDataIdx + 4); + _vm->_linesManager.ZONEP[i]._destX = READ_LE_INT16(curDataPtr + 2 * curDataIdx); + _vm->_linesManager.ZONEP[i]._destY = READ_LE_INT16(curDataPtr + 2 * curDataIdx + 2); + _vm->_linesManager.ZONEP[i]._spriteIndex = READ_LE_INT16(curDataPtr + 2 * curDataIdx + 4); curDataIdx += 3; } @@ -3198,7 +3198,7 @@ void ObjectsManager::INILINK(const Common::String &file) { } int dep = 1010; for (int i = 1; i <= 100; i++) { - _vm->_linesManager.ZONEP[i].field12 = (int16)READ_LE_UINT16(v22 + dep); + _vm->_linesManager.ZONEP[i].field12 = READ_LE_INT16(v22 + dep); dep += 2; } _vm->_linesManager.CARRE_ZONE(); diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index 80383aaf6e..03d0718501 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,11 +266,11 @@ 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; @@ -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); @@ -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]) || diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 61ea1b6438..f22aa679e1 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -75,8 +75,8 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { } else if (_vm->_globals._language == LANG_SP) { _answersFilename = _questionsFilename = "RUEES.TXT"; } - _dialogueMesgId1 = (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 40); - _paletteBufferIdx = 20 * (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) + 110; + _dialogueMesgId1 = READ_LE_INT16((uint16 *)_characterBuffer + 40); + _paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110; _characterSprite = _vm->_fileManager.searchCat(spriteFilename, 7); if (_characterSprite) { _characterSprite = _vm->_objectsManager.loadSprite(spriteFilename); @@ -182,8 +182,8 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { break; } - _dialogueMesgId1 = (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 40); - _paletteBufferIdx = 20 * (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) + 110; + _dialogueMesgId1 = READ_LE_INT16((uint16 *)_characterBuffer + 40); + _paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110; searchCharacterPalette(_paletteBufferIdx, false); _dialogueMesgId2 = _dialogueMesgId1 + 1; _dialogueMesgId3 = _dialogueMesgId1 + 2; @@ -228,17 +228,17 @@ void TalkManager::getStringFromBuffer(int srcStart, Common::String &dest, const int TalkManager::dialogQuestion(bool animatedFl) { if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 48; - int curVal = (int16)READ_LE_UINT16(bufPtr); + int curVal = READ_LE_INT16(bufPtr); if (curVal != 0) _vm->_objectsManager.setBobAnimation(curVal); if (curVal != 1) - _vm->_objectsManager.setBobAnimation((int16)READ_LE_UINT16(bufPtr + 1)); + _vm->_objectsManager.setBobAnimation(READ_LE_INT16(bufPtr + 1)); if (curVal != 2) - _vm->_objectsManager.setBobAnimation((int16)READ_LE_UINT16(bufPtr + 2)); + _vm->_objectsManager.setBobAnimation(READ_LE_INT16(bufPtr + 2)); if (curVal != 3) - _vm->_objectsManager.setBobAnimation((int16)READ_LE_UINT16(bufPtr + 3)); + _vm->_objectsManager.setBobAnimation(READ_LE_INT16(bufPtr + 3)); if (curVal != 4) - _vm->_objectsManager.setBobAnimation((int16)READ_LE_UINT16(bufPtr + 4)); + _vm->_objectsManager.setBobAnimation(READ_LE_INT16(bufPtr + 4)); } else { dialogWait(); } @@ -299,23 +299,23 @@ int TalkManager::dialogQuestion(bool animatedFl) { if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 48; - int curVal = (int16)READ_LE_UINT16(bufPtr); + int curVal = READ_LE_INT16(bufPtr); if (curVal != 0) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 1); + curVal = READ_LE_INT16(bufPtr + 1); if (curVal != 1) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 2); + curVal = READ_LE_INT16(bufPtr + 2); if (curVal != 2) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 3); + curVal = READ_LE_INT16(bufPtr + 3); if (curVal != 3) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 4); + curVal = READ_LE_INT16(bufPtr + 4); if (curVal != 4) _vm->_objectsManager.stopBobAnimation(curVal); } else { @@ -329,21 +329,21 @@ int TalkManager::dialogQuestion(bool animatedFl) { int TalkManager::dialogAnswer(int idx, bool animatedFl) { int charIdx; byte *charBuf; - for (charBuf = _characterBuffer + 110, charIdx = 0; (int16)READ_LE_UINT16(charBuf) != idx; charBuf += 20) { + for (charBuf = _characterBuffer + 110, charIdx = 0; READ_LE_INT16(charBuf) != idx; charBuf += 20) { ++charIdx; - if ((int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) < charIdx) + if (READ_LE_INT16((uint16 *)_characterBuffer + 42) < charIdx) return -1; } - int mesgId = (int16)READ_LE_UINT16((uint16 *)charBuf + 1); - int mesgPosX = (int16)READ_LE_UINT16((uint16 *)charBuf + 2); - int mesgPosY = (int16)READ_LE_UINT16((uint16 *)charBuf + 3); - int mesgLength = (int16)READ_LE_UINT16((uint16 *)charBuf + 4); - _dialogueMesgId1 = (int16)READ_LE_UINT16((uint16 *)charBuf + 5); - _dialogueMesgId2 = (int16)READ_LE_UINT16((uint16 *)charBuf + 6); - _dialogueMesgId3 = (int16)READ_LE_UINT16((uint16 *)charBuf + 7); - int v6 = (int16)READ_LE_UINT16((uint16 *)charBuf + 8); - int v7 = (int16)READ_LE_UINT16((uint16 *)charBuf + 9); + int mesgId = READ_LE_INT16((uint16 *)charBuf + 1); + int mesgPosX = READ_LE_INT16((uint16 *)charBuf + 2); + int mesgPosY = READ_LE_INT16((uint16 *)charBuf + 3); + int mesgLength = READ_LE_INT16((uint16 *)charBuf + 4); + _dialogueMesgId1 = READ_LE_INT16((uint16 *)charBuf + 5); + _dialogueMesgId2 = READ_LE_INT16((uint16 *)charBuf + 6); + _dialogueMesgId3 = READ_LE_INT16((uint16 *)charBuf + 7); + int v6 = READ_LE_INT16((uint16 *)charBuf + 8); + int v7 = READ_LE_INT16((uint16 *)charBuf + 9); if (v7) _vm->_globals._saveData->_data[svField4] = v7; @@ -352,23 +352,23 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { v6 = 10; if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 43; - int curVal = (int16)READ_LE_UINT16(bufPtr); + int curVal = READ_LE_INT16(bufPtr); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 1); + curVal = READ_LE_INT16(bufPtr + 1); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 2); + curVal = READ_LE_INT16(bufPtr + 2); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 3); + curVal = READ_LE_INT16(bufPtr + 3); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 4); + curVal = READ_LE_INT16(bufPtr + 4); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); } else { @@ -402,23 +402,23 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { _vm->_fontManager.hideText(9); if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 43; - int curVal = (int16)READ_LE_UINT16(bufPtr); + int curVal = READ_LE_INT16(bufPtr); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 1); + curVal = READ_LE_INT16(bufPtr + 1); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 2); + curVal = READ_LE_INT16(bufPtr + 2); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 3); + curVal = READ_LE_INT16(bufPtr + 3); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); - curVal = (int16)READ_LE_UINT16(bufPtr + 4); + curVal = READ_LE_INT16(bufPtr + 4); if (curVal) _vm->_objectsManager.stopBobAnimation(curVal); } else { @@ -600,10 +600,10 @@ void TalkManager::BOB_VISU_PARLE(int idx) { if (!_vm->_objectsManager._bob[idx].field0) { _vm->_objectsManager.resetBob(idx); byte *v5 = _vm->_globals.Bqe_Anim[idx]._data; - int v4 = (int16)READ_LE_UINT16(v5 + 2); + int v4 = READ_LE_INT16(v5 + 2); if (!v4) v4 = 1; - if ((int16)READ_LE_UINT16(v5 + 24)) { + if (READ_LE_INT16(v5 + 24)) { _vm->_objectsManager._bob[idx]._isSpriteFl = true; _vm->_objectsManager._bob[idx]._zoomFactor = 0; _vm->_objectsManager._bob[idx]._flipFl = false; @@ -636,10 +636,10 @@ void TalkManager::startCharacterAnim0(int startIdx, bool readOnlyFl) { int idx = 0; int v7; do { - v7 = (int16)READ_LE_UINT16(&_characterAnim[2 * idx + 4]); + v7 = READ_LE_INT16(&_characterAnim[2 * idx + 4]); if (v7 && _vm->_globals._speed != 501) - _vm->_graphicsManager.fastDisplay(_characterSprite, _vm->_eventsManager._startPos.x + (int16)READ_LE_UINT16(&_characterAnim[2 * idx]), - (int16)READ_LE_UINT16(&_characterAnim[2 * idx + 2]), _characterAnim[2 * idx + 8]); + _vm->_graphicsManager.fastDisplay(_characterSprite, _vm->_eventsManager._startPos.x + READ_LE_INT16(&_characterAnim[2 * idx]), + READ_LE_INT16(&_characterAnim[2 * idx + 2]), _characterAnim[2 * idx + 8]); idx += 5; } while (_vm->_globals._speed != 501 && v7); } @@ -651,43 +651,43 @@ void TalkManager::startCharacterAnim0(int startIdx, bool readOnlyFl) { void TalkManager::initCharacterAnim() { uint16 *bufPtr = (uint16 *)_characterBuffer + 43; byte *animPtr = _characterBuffer + 110; - int curVal = (int16)READ_LE_UINT16(bufPtr); + int curVal = READ_LE_INT16(bufPtr); if (curVal) searchCharacterAnim(21, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 1); + curVal = READ_LE_INT16(bufPtr + 1); if (curVal) searchCharacterAnim(22, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 2); + curVal = READ_LE_INT16(bufPtr + 2); if (curVal) searchCharacterAnim(23, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 3); + curVal = READ_LE_INT16(bufPtr + 3); if (curVal) searchCharacterAnim(24, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 4); + curVal = READ_LE_INT16(bufPtr + 4); if (curVal) searchCharacterAnim(25, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 5); + curVal = READ_LE_INT16(bufPtr + 5); if (curVal) searchCharacterAnim(26, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 6); + curVal = READ_LE_INT16(bufPtr + 6); if (curVal) searchCharacterAnim(27, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 7); + curVal = READ_LE_INT16(bufPtr + 7); if (curVal) searchCharacterAnim(28, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 8); + curVal = READ_LE_INT16(bufPtr + 8); if (curVal) searchCharacterAnim(29, animPtr, curVal, _characterSize); - curVal = (int16)READ_LE_UINT16(bufPtr + 9); + curVal = READ_LE_INT16(bufPtr + 9); if (curVal) searchCharacterAnim(30, animPtr, curVal, _characterSize); } @@ -723,11 +723,11 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId, _vm->_globals.Bqe_Anim[idx]._data = _vm->_globals.allocMemory(animLength + 50); _vm->_globals.Bqe_Anim[idx]._enabledFl = true; memcpy(_vm->_globals.Bqe_Anim[idx]._data, (const byte *)(bufPerso + bufPos + 5), 20); - int v23 = (int16)READ_LE_UINT16(bufPos + bufPerso + 29); - WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 20, (int16)READ_LE_UINT16(bufPos + bufPerso + 25)); - WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 22, (int16)READ_LE_UINT16(bufPos + bufPerso + 27)); + int v23 = READ_LE_INT16(bufPos + bufPerso + 29); + WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 20, READ_LE_INT16(bufPos + bufPerso + 25)); + WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 22, READ_LE_INT16(bufPos + bufPerso + 27)); WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 24, v23); - WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 26, (int16)READ_LE_UINT16(bufPos + bufPerso + 31)); + WRITE_LE_UINT16(_vm->_globals.Bqe_Anim[idx]._data + 26, READ_LE_INT16(bufPos + bufPerso + 31)); _vm->_globals.Bqe_Anim[idx]._data[28] = bufPerso[bufPos + 33]; _vm->_globals.Bqe_Anim[idx]._data[29] = bufPerso[bufPos + 34]; byte *bqeCurData = _vm->_globals.Bqe_Anim[idx]._data + 20; @@ -737,11 +737,11 @@ bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int animId, curBufPerso += 10; if (!v23) break; - v23 = (int16)READ_LE_UINT16(curBufPerso + 4); - WRITE_LE_UINT16(bqeCurData, (int16)READ_LE_UINT16(curBufPerso)); - WRITE_LE_UINT16(bqeCurData + 2, (int16)READ_LE_UINT16(curBufPerso + 2)); + v23 = READ_LE_INT16(curBufPerso + 4); + WRITE_LE_UINT16(bqeCurData, READ_LE_INT16(curBufPerso)); + WRITE_LE_UINT16(bqeCurData + 2, READ_LE_INT16(curBufPerso + 2)); WRITE_LE_UINT16(bqeCurData + 4, v23); - WRITE_LE_UINT16(bqeCurData + 6, (int16)READ_LE_UINT16(curBufPerso + 6)); + WRITE_LE_UINT16(bqeCurData + 6, READ_LE_INT16(curBufPerso + 6)); bqeCurData[8] = curBufPerso[8]; bqeCurData[9] = curBufPerso[9]; } @@ -1004,7 +1004,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { if (!_vm->_graphicsManager._lineNbr) _vm->_graphicsManager._scrollOffset = 0; _vm->_graphicsManager.NB_SCREEN(true); - _paletteBufferIdx = 20 * (int16)READ_LE_UINT16((uint16 *)_characterBuffer + 42) + 110; + _paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110; _vm->_graphicsManager.NB_SCREEN(true); _vm->_objectsManager.PERSO_ON = true; searchCharacterPalette(_paletteBufferIdx, true); |