diff options
author | Gregory Montoir | 2007-01-05 22:45:29 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-01-05 22:45:29 +0000 |
commit | d1ecb0122c0647dcafc75dbf8ba699ee9c071b79 (patch) | |
tree | 30def28da2efac8d499e74dfd987dbda0c69ea7d /engines | |
parent | b30c615165e7885df3e34e71db8d65b45558deb7 (diff) | |
download | scummvm-rg350-d1ecb0122c0647dcafc75dbf8ba699ee9c071b79.tar.gz scummvm-rg350-d1ecb0122c0647dcafc75dbf8ba699ee9c071b79.tar.bz2 scummvm-rg350-d1ecb0122c0647dcafc75dbf8ba699ee9c071b79.zip |
got rid of an assertion triggered when trying to play a speech file after switching from silent mode to talk mode. Minor cleanup.
svn-id: r25010
Diffstat (limited to 'engines')
-rw-r--r-- | engines/touche/opcodes.cpp | 2 | ||||
-rw-r--r-- | engines/touche/resource.cpp | 5 | ||||
-rw-r--r-- | engines/touche/touche.h | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/engines/touche/opcodes.cpp b/engines/touche/opcodes.cpp index e545d9d404..2011384348 100644 --- a/engines/touche/opcodes.cpp +++ b/engines/touche/opcodes.cpp @@ -382,7 +382,7 @@ void ToucheEngine::op_endConversation() { debugC(9, kDebugOpcodes, "ToucheEngine::op_endConversation()"); _script.quitFlag = 1; _conversationEnded = true; - _disabledInputCounter = false; + _disabledInputCounter = 0; } void ToucheEngine::op_stopScript() { diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index f047cd8bd7..bd96793259 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -115,7 +115,7 @@ void ToucheEngine::res_allocateTables() { } } - _programData = (uint8 *)malloc(61440); + _programData = (uint8 *)malloc(kMaxProgramDataSize); if (!_programData) { error("Unable to allocate memory for program data"); } @@ -240,6 +240,7 @@ void ToucheEngine::res_loadProgram(int num) { debugC(9, kDebugResource, "ToucheEngine::res_loadProgram() num=%d", num); const uint32 offs = res_getDataOffset(kResourceTypeProgram, num, &_programDataSize); _fData.seek(offs); + assert(_programDataSize < kMaxProgramDataSize); _fData.read(_programData, _programDataSize); } @@ -622,7 +623,7 @@ void ToucheEngine::res_loadSpeech(int num) { void ToucheEngine::res_loadSpeechSegment(int num) { debugC(9, kDebugResource, "ToucheEngine::res_loadSpeechSegment() num=%d", num); - if (_talkTextMode != kTalkModeTextOnly) { + if (_talkTextMode != kTalkModeTextOnly && _flagsTable[617] != 0) { Audio::AudioStream *stream = 0; if (_compressedSpeechData < 0) { // uncompressed speech data int i = 0; diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 33f2faa266..546c5286b0 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -322,7 +322,8 @@ enum { kIconWidth = 58, kIconHeight = 42, kCursorWidth = 58, - kCursorHeight = 42 + kCursorHeight = 42, + kMaxProgramDataSize = 61440 }; class MidiPlayer; |