[Scummvm-cvs-logs] SF.net SVN: scummvm: [25010] scummvm/trunk/engines/touche

cyx at users.sourceforge.net cyx at users.sourceforge.net
Fri Jan 5 23:45:30 CET 2007


Revision: 25010
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25010&view=rev
Author:   cyx
Date:     2007-01-05 14:45:29 -0800 (Fri, 05 Jan 2007)

Log Message:
-----------
got rid of an assertion triggered when trying to play a speech file after switching from silent mode to talk mode. Minor cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/touche/opcodes.cpp
    scummvm/trunk/engines/touche/resource.cpp
    scummvm/trunk/engines/touche/touche.h

Modified: scummvm/trunk/engines/touche/opcodes.cpp
===================================================================
--- scummvm/trunk/engines/touche/opcodes.cpp	2007-01-05 21:56:35 UTC (rev 25009)
+++ scummvm/trunk/engines/touche/opcodes.cpp	2007-01-05 22:45:29 UTC (rev 25010)
@@ -382,7 +382,7 @@
 	debugC(9, kDebugOpcodes, "ToucheEngine::op_endConversation()");
 	_script.quitFlag = 1;
 	_conversationEnded = true;
-	_disabledInputCounter = false;
+	_disabledInputCounter = 0;
 }
 
 void ToucheEngine::op_stopScript() {

Modified: scummvm/trunk/engines/touche/resource.cpp
===================================================================
--- scummvm/trunk/engines/touche/resource.cpp	2007-01-05 21:56:35 UTC (rev 25009)
+++ scummvm/trunk/engines/touche/resource.cpp	2007-01-05 22:45:29 UTC (rev 25010)
@@ -115,7 +115,7 @@
 		}
 	}
 
-	_programData = (uint8 *)malloc(61440);
+	_programData = (uint8 *)malloc(kMaxProgramDataSize);
 	if (!_programData) {
 		error("Unable to allocate memory for program data");
 	}
@@ -240,6 +240,7 @@
 	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_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;

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2007-01-05 21:56:35 UTC (rev 25009)
+++ scummvm/trunk/engines/touche/touche.h	2007-01-05 22:45:29 UTC (rev 25010)
@@ -322,7 +322,8 @@
 	kIconWidth = 58,
 	kIconHeight = 42,
 	kCursorWidth = 58,
-	kCursorHeight = 42
+	kCursorHeight = 42,
+	kMaxProgramDataSize = 61440
 };
 
 class MidiPlayer;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list