aboutsummaryrefslogtreecommitdiff
path: root/engines/touche/resource.cpp
diff options
context:
space:
mode:
authorGregory Montoir2007-01-05 22:45:29 +0000
committerGregory Montoir2007-01-05 22:45:29 +0000
commitd1ecb0122c0647dcafc75dbf8ba699ee9c071b79 (patch)
tree30def28da2efac8d499e74dfd987dbda0c69ea7d /engines/touche/resource.cpp
parentb30c615165e7885df3e34e71db8d65b45558deb7 (diff)
downloadscummvm-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/touche/resource.cpp')
-rw-r--r--engines/touche/resource.cpp5
1 files changed, 3 insertions, 2 deletions
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;