[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.156,1.157 actor.h,1.84,1.85 puzzle.cpp,1.11,1.12 puzzle.h,1.4,1.5 sfuncs.cpp,1.138,1.139

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Jul 15 08:27:06 CEST 2005


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

Modified Files:
	actor.cpp actor.h puzzle.cpp puzzle.h sfuncs.cpp 
Log Message:
Added the puzzle voices from the CD version. I don't know if this breaks
the floppy version, and it's still not flawless. But it's a start.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- actor.cpp	14 Jul 2005 17:46:01 -0000	1.156
+++ actor.cpp	15 Jul 2005 15:23:18 -0000	1.157
@@ -1886,7 +1886,7 @@
 	}	
 }
 
-void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int speechFlags) {
+void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int sampleResourceId, int speechFlags) {
 	int i;
 	
 	_vm->_script->wakeUpThreads(kWaitTypeSpeech);
@@ -1898,7 +1898,7 @@
 	_activeSpeech.speechFlags = speechFlags;
 	_activeSpeech.actorsCount = 1;
 	_activeSpeech.actorIds[0] = 0;
-	_activeSpeech.sampleResourceId = -1;
+	_activeSpeech.sampleResourceId = sampleResourceId;
 	_activeSpeech.playing = false;
 	_activeSpeech.slowModeCharIndex = 0;
 	_activeSpeech.speechBox = box;

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.h,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- actor.h	14 Jul 2005 17:46:01 -0000	1.84
+++ actor.h	15 Jul 2005 15:23:19 -0000	1.85
@@ -554,7 +554,7 @@
 
 //	speech 
 	void actorSpeech(uint16 actorId, const char **strings, int stringsCount, int sampleResourceId, int speechFlags);
-	void nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int speechFlags);
+	void nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int sampleResourceId, int speechFlags);
 	void simulSpeech(const char *string, uint16 *actorIds, int actorIdsCount, int speechFlags, int sampleResourceId);
 	void setSpeechColor(int speechColor, int outlineColor) {
 		_activeSpeech.speechColor[0] = speechColor;

Index: puzzle.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/puzzle.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- puzzle.cpp	14 Jul 2005 17:46:20 -0000	1.11
+++ puzzle.cpp	15 Jul 2005 15:23:19 -0000	1.12
@@ -484,13 +484,14 @@
 		if (_hintOffer >= NUM_SOLICIT_REPLIES)
 			_hintOffer = 0;
 
-		_vm->_actor->nonActorSpeech(_hintBox, &solicitStr[_lang][i], 1, 0);
-
 		//	Determine which of the journeymen will offer then
 		//	hint, and then show that character's portrait.
 		_hintGiver = portraitList[i];
+		_hintSpeaker = _hintGiver - RID_ITE_JFERRET_SERIOUS;
 		_vm->_interface->setRightPortrait(_hintGiver);
 
+		_vm->_actor->nonActorSpeech(_hintBox, &solicitStr[_lang][i], 1, PUZZLE_SOLICIT_SOUNDS + i * 3 + _hintSpeaker, 0);
+
 		//	Add Rif's reply to the list.
 		clearHint();
 
@@ -507,7 +508,7 @@
 
 	case kRQHintRequested:
 		i = _vm->_rnd.getRandomNumber(NUM_SAKKA - 1);
-		_vm->_actor->nonActorSpeech(_hintBox, &sakkaStr[_lang][i], 1, 0);
+		_vm->_actor->nonActorSpeech(_hintBox, &sakkaStr[_lang][i], 1, PUZZLE_SAKKA_SOUNDS + i, 0);
 
 		_vm->_interface->setRightPortrait(RID_ITE_SAKKA_APPRAISING);
 
@@ -524,7 +525,7 @@
 	case kRQHintRequestedStage2:
 		if (_vm->_rnd.getRandomNumber(1)) {			//	Skip Reply part
 			i = _vm->_rnd.getRandomNumber(NUM_WHINES - 1);
-			_vm->_actor->nonActorSpeech(_hintBox, &whineStr[_lang][i], 1, 0);
+			_vm->_actor->nonActorSpeech(_hintBox, &whineStr[_lang][i], 1, PUZZLE_WHINE_SOUNDS + i * 3 + _hintSpeaker, 0);
 		}
 
 		_vm->_interface->setRightPortrait(_hintGiver);
@@ -592,7 +593,7 @@
 	_vm->_actor->setSpeechColor(1, kITEColorBlack);
 
 	if (_hintCount < 3) {
-		_vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][_hintCount], 1, 0 );
+		_vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][_hintCount], 1, PUZZLE_HINT_SOUNDS + _hintCount * 3 + _hintSpeaker, 0);
 	} else {
 		int piece = 0;
 
@@ -611,11 +612,11 @@
 			const char *hintPtr = hintBuf;
 			sprintf(hintBuf, optionsStr[_lang][kROHint], pieceNames[piece]);
 
-			_vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, 0);
+			_vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, PUZZLE_TOOL_SOUNDS + _hintSpeaker + piece, 0);
 		}
 		else {
 				//	If no pieces are in the wrong place
-			_vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][3], 1, 0);
+			_vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][3], 1, PUZZLE_HINT_SOUNDS + 3 * 3 + _hintSpeaker, 0);
 		}
 	}
 	_hintCount++;

Index: puzzle.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/puzzle.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- puzzle.h	14 Jul 2005 17:46:20 -0000	1.4
+++ puzzle.h	15 Jul 2005 15:23:19 -0000	1.5
@@ -26,6 +26,13 @@
 
 #define PUZZLE_PIECES 15
 
+#define PUZZLE_SOUNDS         3622
+#define PUZZLE_TOOL_SOUNDS    (PUZZLE_SOUNDS + 0)
+#define PUZZLE_HINT_SOUNDS    (PUZZLE_SOUNDS + 45)
+#define PUZZLE_SOLICIT_SOUNDS (PUZZLE_SOUNDS + 57)
+#define PUZZLE_WHINE_SOUNDS   (PUZZLE_SOUNDS + 72)
+#define PUZZLE_SAKKA_SOUNDS   (PUZZLE_SOUNDS + 87)
+
 class Puzzle {
 private:
 	enum kRQStates {
@@ -45,6 +52,7 @@
 
 	kRQStates _hintRqState;
 	int _hintGiver;
+	int _hintSpeaker;
 	int _hintOffer;
 	int _hintCount;
 	int _helpCount;

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- sfuncs.cpp	14 Jul 2005 17:46:21 -0000	1.138
+++ sfuncs.cpp	15 Jul 2005 15:23:19 -0000	1.139
@@ -1538,7 +1538,7 @@
 	rect.setWidth(width);
 
 	_vm->_actor->setSpeechColor(color, kITEColorBlack);
-	_vm->_actor->nonActorSpeech(rect, &text, 1, flags);
+	_vm->_actor->nonActorSpeech(rect, &text, 1, -1, flags);
 }
 
 // Script function #60 (0x3C)





More information about the Scummvm-git-logs mailing list