[Scummvm-cvs-logs] CVS: scummvm/queen talk.h,1.25,1.26 talk.cpp,1.65,1.66 xref.txt,1.51,1.52

Gregory Montoir cyx at users.sourceforge.net
Fri Jan 2 12:06:05 CET 2004


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

Modified Files:
	talk.h talk.cpp xref.txt 
Log Message:
- added missing MOVE_SPEAK code (only CHEF.DOG seems to use that)
- clear Talk::_dialogueTree[0] to avoid problems when accessing oldLevel / level 0


Index: talk.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- talk.h	29 Dec 2003 13:18:24 -0000	1.25
+++ talk.h	2 Jan 2004 20:05:18 -0000	1.26
@@ -194,7 +194,7 @@
 	bool speak(const char *sentence, Person *person, const char *voiceFilePrefix);
 
 	//! Convert command in sentence to command code
-	int getSpeakCommand(const char *sentence, unsigned &index);
+	int getSpeakCommand(const Person *person, const char *sentence, unsigned &index);
 
 	//! Speak a part of a sentence
 	void speakSegment(

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- talk.cpp	30 Dec 2003 21:06:22 -0000	1.65
+++ talk.cpp	2 Jan 2004 20:05:18 -0000	1.66
@@ -30,6 +30,7 @@
 #include "queen/resource.h"
 #include "queen/sound.h"
 #include "queen/state.h"
+#include "queen/walk.h"
 
 #include "common/file.h"
 
@@ -261,7 +262,6 @@
 		// Check selected person to see if any Gamestates need setting
 
 		int16 index = _dialogueTree[level][0].gameStateIndex;
-
 		if (index > 0)
 			_vm->logic()->gameState(index, _dialogueTree[level][0].gameStateValue);
 
@@ -462,6 +462,7 @@
 
 	ptr = dataPtr;
 
+	memset(&_dialogueTree[0], 0, sizeof(_dialogueTree[0]));
 	for (i = 1; i <= _levelMax; i++)
 		for (int j = 0; j <= 5; j++) {
 			ptr += 2;
@@ -521,10 +522,13 @@
 
 }
 
-int Talk::getSpeakCommand(const char *sentence, unsigned &index) {
+int Talk::getSpeakCommand(const Person *person, const char *sentence, unsigned &index) {
 	// Lines 1299-1362 in talk.c
 	int commandCode = SPEAK_DEFAULT;
 
+	// cyx: what about something like:
+	// uint16 id = (sentence[index] << 8) | sentence[index + 1];
+	// switch(id) { case 'AO': ... }
 	switch (sentence[index]) {
 		case 'A':
 			if (sentence[index + 1] == 'O')
@@ -581,10 +585,13 @@
 				commandCode = atoi(sentence + index + 2);
 				int x = atoi(sentence + index + 5);
 				int y = atoi(sentence + index + 9);
-				debug(6, "Calling MOVE_SPEAK(person, %i, %i)",x, y);
-				// XXX MOVE_SPEAK(person, x, y)
+				if (0 == strcmp(person->name, "JOE"))
+					_vm->walk()->moveJoe(0, x, y, _vm->input()->cutawayRunning());
+				else
+					_vm->walk()->movePerson(person, x, y, _vm->logic()->numFrames(), 0);
 				index += 11;
-				/// XXX personWalking = true;
+				// if(JOEWALK==3) CUTQUIT=0;
+				// XXX personWalking = true;
 			}
 			else
 				warning("Unknown command string: '%2s'", sentence + index);
@@ -657,7 +664,7 @@
 			int segmentLength = i - segmentStart;
 
 			i++;
-			int command = getSpeakCommand(sentence, i);
+			int command = getSpeakCommand(person, sentence, i);
 
 			if (SPEAK_NONE != command) {
 				speakSegment(

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/xref.txt,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- xref.txt	29 Dec 2003 20:18:31 -0000	1.51
+++ xref.txt	2 Jan 2004 20:05:18 -0000	1.52
@@ -356,7 +356,7 @@
 TALK
 ====
 FIND_SACTION()				Talk::findSpeechParameters
-MOVE_SPEAK()
+MOVE_SPEAK()				*included in Talk::getSpeakCommand*
 SPEAK()						Talk::speak
 SPEAK_SUB()					Talk::speakSegment
 talk()						Talk::talk





More information about the Scummvm-git-logs mailing list