[Scummvm-cvs-logs] CVS: scummvm/queen logic.h,1.70,1.71 logic.cpp,1.106,1.107 cutaway.cpp,1.72,1.73 command.cpp,1.25,1.26

Gregory Montoir cyx at users.sourceforge.net
Wed Nov 26 13:47:09 CET 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv7027

Modified Files:
	logic.h logic.cpp cutaway.cpp command.cpp 
Log Message:
add a wrapper for Talk::speak in Logic that clears current command

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- logic.h	26 Nov 2003 13:53:17 -0000	1.70
+++ logic.h	26 Nov 2003 21:46:27 -0000	1.71
@@ -254,6 +254,7 @@
 
 	void joeSpeak(uint16 descNum, bool objectType = false);
 
+	void makePersonSpeak(const char *sentence, Person *person, const char *voiceFilePrefix);
 	void dialogue(const char *dlgFile, int personInRoom, char *cutaway);
 	void playCutaway(const char *cutFile, char *next = NULL);
 

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- logic.cpp	26 Nov 2003 21:08:36 -0000	1.106
+++ logic.cpp	26 Nov 2003 21:46:28 -0000	1.107
@@ -1851,6 +1851,13 @@
 }
 
 
+void Logic::makePersonSpeak(const char *sentence, Person *person, const char *voiceFilePrefix) {
+
+	_cmd->clear(false);
+	Talk::speak(sentence, person, voiceFilePrefix, _graphics, _input, this, _resource, _sound);
+}
+
+
 void Logic::dialogue(const char *dlgFile, int personInRoom, char *cutaway) {
 
 	char cutawayFile[20];
@@ -1881,10 +1888,9 @@
 	if (objectType) {
 		descNum += JOE_RESPONSE_MAX;
 	}
-	_cmd->clear(false);
 	char descFilePrefix[10];
 	sprintf(descFilePrefix, "JOE%04i", descNum);
-	Talk::speak(text, NULL, descFilePrefix, _graphics, _input, this, _resource, _sound);
+	makePersonSpeak(text, NULL, descFilePrefix);
 }
 
 
@@ -2552,7 +2558,7 @@
 void Logic::useJournal() {
 
 	if (_resource->isDemo()) {
-		Talk::speak("This is a demo, so I can't load or save games*14", NULL, "", _graphics, _input, this, _resource, _sound);
+		makePersonSpeak("This is a demo, so I can't load or save games*14", NULL, "");
 	}
 	else {
 

Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- cutaway.cpp	26 Nov 2003 20:40:43 -0000	1.72
+++ cutaway.cpp	26 Nov 2003 21:46:29 -0000	1.73
@@ -1180,10 +1180,8 @@
 			}
 
 			char voiceFilePrefix[MAX_STRING_SIZE];
-			findCdCut(_basename, index, voiceFilePrefix);
-			
-			Talk::speak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix,
-				_graphics, _input, _logic, _resource, _sound);
+			findCdCut(_basename, index, voiceFilePrefix);			
+			_logic->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix);
 		}
 
 	}

Index: command.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/command.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- command.cpp	26 Nov 2003 21:08:36 -0000	1.25
+++ command.cpp	26 Nov 2003 21:46:29 -0000	1.26
@@ -843,11 +843,10 @@
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".cut") == 0) {
 
+		_graphics->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+
 		char nextCutaway[20];
 		memset(nextCutaway, 0, sizeof(nextCutaway));
-
-		clear(true); // clear as Talk::speak() can be called in a Cutaway
-
 		_logic->playCutaway(description, nextCutaway);
 		while (nextCutaway[0] != '\0') {
 			_logic->playCutaway(nextCutaway, nextCutaway);
@@ -863,12 +862,11 @@
 	if (strlen(description) > 4 && 
 		scumm_stricmp(description + strlen(description) - 4, ".dog") == 0) {
 
+		_graphics->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+
 		char cutaway[20];
 		memset(cutaway, 0, sizeof(cutaway));
-
-		int person = _selCmd.noun;
-		clear(true);
-		_logic->dialogue(description, person, cutaway);
+		_logic->dialogue(description, _selCmd.noun, cutaway);
 
 		while (cutaway[0] != '\0') {
 			char currentCutaway[20];





More information about the Scummvm-git-logs mailing list