diff options
author | Nicolas Bacca | 2004-03-23 20:34:19 +0000 |
---|---|---|
committer | Nicolas Bacca | 2004-03-23 20:34:19 +0000 |
commit | 52642e41234d703c4fa8ffcb459ed72403fa327b (patch) | |
tree | 0adcef84345bc11a71d7e4c830eec28afdd6c589 /queen/talk.cpp | |
parent | e1a1f291aaab2632dc12f9a72024d22c38de6779 (diff) | |
download | scummvm-rg350-52642e41234d703c4fa8ffcb459ed72403fa327b.tar.gz scummvm-rg350-52642e41234d703c4fa8ffcb459ed72403fa327b.tar.bz2 scummvm-rg350-52642e41234d703c4fa8ffcb459ed72403fa327b.zip |
Fix #922003 - FOTAQ crash on PocketPC
svn-id: r13372
Diffstat (limited to 'queen/talk.cpp')
-rw-r--r-- | queen/talk.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/queen/talk.cpp b/queen/talk.cpp index 41ebbdf09c..8bc748ef25 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -300,8 +300,8 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) { uint8 *ptr = _cutawayPtr; - int16 cutawayGameState = (int16)READ_BE_UINT16(ptr); ptr += 2; - int16 cutawayTestValue = (int16)READ_BE_UINT16(ptr); ptr += 2; + int16 cutawayGameState = (int16)READ_BE_INT16(ptr); ptr += 2; + int16 cutawayTestValue = (int16)READ_BE_INT16(ptr); ptr += 2; if (_vm->logic()->gameState(cutawayGameState) == cutawayTestValue) { getString(ptr, cutawayFilename, 20); @@ -360,7 +360,7 @@ void Talk::findDialogueString(byte *ptr, int16 id, int16 max, char *str) { for (int i = 1; i <= max; i++) { ptr += 2; - int16 currentId = (int16)READ_BE_UINT16(ptr); ptr += 2; + int16 currentId = (int16)READ_BE_INT16(ptr); ptr += 2; if (id == currentId) { ptr = getString(ptr, str, MAX_STRING_LENGTH, 4); //debug(6, "Found string with ID %i: '%s'", id, str); @@ -409,7 +409,7 @@ void Talk::load(const char *filename) { // Load talk header // - _levelMax = (int16)READ_BE_UINT16(ptr); ptr += 2; + _levelMax = (int16)READ_BE_INT16(ptr); ptr += 2; //debug(6, "levelMax = %i", _levelMax); @@ -420,15 +420,15 @@ void Talk::load(const char *filename) { else canQuit = true; - _uniqueKey = (int16)READ_BE_UINT16(ptr); ptr += 2; - _talkKey = (int16)READ_BE_UINT16(ptr); ptr += 2; - _jMax = (int16)READ_BE_UINT16(ptr); ptr += 2; - _pMax = (int16)READ_BE_UINT16(ptr); ptr += 2; + _uniqueKey = (int16)READ_BE_INT16(ptr); ptr += 2; + _talkKey = (int16)READ_BE_INT16(ptr); ptr += 2; + _jMax = (int16)READ_BE_INT16(ptr); ptr += 2; + _pMax = (int16)READ_BE_INT16(ptr); ptr += 2; for (i = 0; i < 2; i++) { - _gameState [i] = (int16)READ_BE_UINT16(ptr); ptr += 2; - _testValue [i] = (int16)READ_BE_UINT16(ptr); ptr += 2; - _itemNumber[i] = (int16)READ_BE_UINT16(ptr); ptr += 2; + _gameState [i] = (int16)READ_BE_INT16(ptr); ptr += 2; + _testValue [i] = (int16)READ_BE_INT16(ptr); ptr += 2; + _itemNumber[i] = (int16)READ_BE_INT16(ptr); ptr += 2; } //debug(6, "uniqueKey = %i", _uniqueKey); @@ -454,13 +454,13 @@ void Talk::load(const char *filename) { for (i = 1; i <= _levelMax; i++) for (int j = 0; j <= 5; j++) { ptr += 2; - _dialogueTree[i][j].head = (int16)READ_BE_UINT16(ptr); ptr += 2; + _dialogueTree[i][j].head = (int16)READ_BE_INT16(ptr); ptr += 2; ptr += 2; - _dialogueTree[i][j].dialogueNodeValue1 = (int16)READ_BE_UINT16(ptr); ptr += 2; + _dialogueTree[i][j].dialogueNodeValue1 = (int16)READ_BE_INT16(ptr); ptr += 2; ptr += 2; - _dialogueTree[i][j].gameStateIndex = (int16)READ_BE_UINT16(ptr); ptr += 2; + _dialogueTree[i][j].gameStateIndex = (int16)READ_BE_INT16(ptr); ptr += 2; ptr += 2; - _dialogueTree[i][j].gameStateValue = (int16)READ_BE_UINT16(ptr); ptr += 2; + _dialogueTree[i][j].gameStateValue = (int16)READ_BE_INT16(ptr); ptr += 2; } } |