[Scummvm-cvs-logs] CVS: scummvm/queen display.cpp,1.73,1.74 sound.h,1.23,1.24 talk.cpp,1.108,1.109

Gregory Montoir cyx at users.sourceforge.net
Mon Nov 22 14:18:00 CET 2004


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8971/queen

Modified Files:
	display.cpp sound.h talk.cpp 
Log Message:
possible fix for 'bug' #1034715

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- display.cpp	9 Nov 2004 10:26:32 -0000	1.73
+++ display.cpp	22 Nov 2004 22:16:42 -0000	1.74
@@ -648,7 +648,7 @@
 
 void Display::setupPanel() {
 	uint32 size;
-	const uint8 *pcxBuf = _vm->resource()->loadFile("panel.pcx", 0, &size);
+	uint8 *pcxBuf = _vm->resource()->loadFile("panel.pcx", 0, &size);
 	uint8 *dst = _panelBuf + PANEL_W * 10;
 	readPCX(dst, PANEL_W, pcxBuf + 128, PANEL_W, PANEL_H - 10);
 	const uint8 *pal = pcxBuf + size - 768 + 144 * 3;
@@ -663,7 +663,7 @@
 	uint32 size;
 	char filename[20];
 	sprintf(filename, "%s.PCX", name);
-	const uint8 *pcxBuf = _vm->resource()->loadFile(filename, 0, &size);
+	uint8 *pcxBuf = _vm->resource()->loadFile(filename, 0, &size);
 	_bdWidth  = READ_LE_UINT16(pcxBuf + 12);
 	_bdHeight = READ_LE_UINT16(pcxBuf + 14);
 	readPCX(_backdropBuf, BACKDROP_W, pcxBuf + 128, _bdWidth, _bdHeight);

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/sound.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- sound.h	26 Sep 2004 18:55:11 -0000	1.23
+++ sound.h	22 Nov 2004 22:16:50 -0000	1.24
@@ -62,18 +62,21 @@
 	void stopSpeech()		{ _mixer->stopHandle(_speechHandle); }
 	void stopSfx()			{ _mixer->stopHandle(_sfxHandle); }
 	
-	bool sfxOn() const		{ return _sfxToggle; }
+	bool sfxOn() const			{ return _sfxToggle; }
 	void sfxToggle(bool val)	{ _sfxToggle = val; }
-	void toggleSfx()		{ _sfxToggle ^= true; }
+	void toggleSfx()			{ _sfxToggle ^= true; }
 
 	bool speechOn()	const		{ return _speechToggle; }
 	void speechToggle(bool val)	{ _speechToggle = val; }
-	void toggleSpeech()		{ _speechToggle ^= true; }
+	void toggleSpeech()			{ _speechToggle ^= true; }
 	
 	bool musicOn() const		{ return _musicToggle; }
 	void musicToggle(bool val)	{ _musicToggle = val; }
-	void toggleMusic()		{ _musicToggle ^= true; }
+	void toggleMusic()			{ _musicToggle ^= true; }
 
+	bool isSpeechActive() const	{ return _speechHandle.isActive(); }
+	bool isSfxActive() const 	{ return _sfxHandle.isActive(); }
+	
 	int16 lastOverride() const	{ return _lastOverride; }
 
 	void saveState(byte *&ptr);

Index: talk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/talk.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- talk.cpp	8 Oct 2004 18:43:24 -0000	1.108
+++ talk.cpp	22 Nov 2004 22:16:50 -0000	1.109
@@ -613,7 +613,7 @@
 void Talk::headStringAnimation(const SpeechParameters *parameters, int bobNum, int bankNum) {
 	// talk.c lines 1612-1635
 	BobSlot *bob2 = _vm->graphics()->bob(2);
-	
+
 	if (parameters->animation[0] == 'E') {
 		int offset = 1;
 	
@@ -702,11 +702,8 @@
 		// Why on earth would someone name a variable qzx?
 		short qzx = 0;
 
-		int spaces = countSpaces(segment);
-
-		int i;
-		for (i = 0; i < (spaces + 1) /* || sfxflag == 0*/; i++) {
-
+		int len = countSpaces(segment);
+		while (1) {
 			if (parameters != NULL) {
 
 				int bf;
@@ -743,7 +740,7 @@
 
 			if (_vm->input()->talkQuit())
 				break;
-			
+						
 			if (_vm->logic()->joeWalk() == JWM_SPEAK) {
 				_vm->update();
 			} else {
@@ -759,6 +756,19 @@
 				_vm->sound()->stopSpeech();
 				break;
 			}
+			
+			if (_vm->sound()->speechOn()) {
+				// sfx is finished, stop the speak animation
+				if (!_vm->sound()->isSpeechActive()) {
+					break;
+				}
+			} else {
+				// no sfx, stop the animation when speak segment 'length' is 0
+				--len;
+				if (len <= 0) {
+					break;
+				}
+			}
 		}
 	}
 
@@ -840,33 +850,16 @@
 
 	if (_talkHead) {
 		// talk.c lines 1491-1533
-		if (isJoe) {
-			switch (_vm->logic()->currentRoom()) {
-			case FAYE_HEAD:
-			case AZURA_HEAD:
-				textX = 15;
-				break;
-
-			default:
-				textX = 150;
-				break;
-			}
-			textY = 30;
-		} else {
-			// XXX spaces = (spaces * 5) / 2;
-			switch (_vm->logic()->currentRoom()) {
-			case FAYE_HEAD:
-			case AZURA_HEAD:
-				textX = 15;
-				textY = 60;
-				break;
-
-			default: 			// Frank
-				textX = 150;
-				textY = 60;
-				break;
-			}
+		switch (_vm->logic()->currentRoom()) {
+		case FAYE_HEAD:
+		case AZURA_HEAD:
+			textX = 15;
+			break;
+		default: // FRANK_HEAD
+			textX = 150;
+			break;
 		}
+		textY = isJoe ? 30 : 60;
 	} else {
 		textX = bob->x;
 		textY = bob->y;





More information about the Scummvm-git-logs mailing list