[Scummvm-cvs-logs] CVS: scummvm/saga ihnm_introproc.cpp,1.53,1.54 saga.cpp,1.130,1.131 sfuncs.cpp,1.153,1.154 sthread.cpp,1.103,1.104

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Aug 26 05:09:24 CEST 2005


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

Modified Files:
	ihnm_introproc.cpp saga.cpp sfuncs.cpp sthread.cpp 
Log Message:
Allowed IHNM to use the opSpeak opcode. Aborting that code path early meant
that the instruction wasn't fully read, so the next opcode would be wrong.
This is what caused it to crash.

To keep the game from hanging, I also allowed the engine to call the
_actors->direct() function for IHNM. This allows AM's intro speech to be
played in its entirety.

Since this includes the "hate" speech, I've removed that part from the
hard-coded intro. To get the right music playing, I've enabled the
sfPlayMusic() function for IHNM. This is pure guesswork, though. Once the
scene changes, the wrong music plays again. However, this is scene music,
i.e. not scripted.

It doesn't play the background sound. Looks like _fxTable[] isn't generated
for IHNM. More noticeably, until the scene changes it doesn't show any
graphics apart from the subtitles, which are drawn in the wrong colour and
(I believe) the wrong font.


Index: ihnm_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ihnm_introproc.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- ihnm_introproc.cpp	10 Aug 2005 15:31:15 -0000	1.53
+++ ihnm_introproc.cpp	26 Aug 2005 12:07:31 -0000	1.54
@@ -83,7 +83,6 @@
 	{0, kLoadByDescription, &IHNM_IntroMovie1Desc, Scene::SC_IHNMIntroMovieProc1, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
 	{0, kLoadByDescription, &IHNM_IntroMovie2Desc, Scene::SC_IHNMIntroMovieProc2, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
 	{0, kLoadByDescription, &IHNM_IntroMovie3Desc, Scene::SC_IHNMIntroMovieProc3, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
-	{0, kLoadByDescription, &IHNM_IntroMovie4Desc, Scene::SC_IHNMHateProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE}
 };
 
 int Scene::IHNMStartProc() {
@@ -322,88 +321,4 @@
 	return 0;
 }
 
-int Scene::SC_IHNMHateProc(int param, void *refCon) {
-	return ((Scene *)refCon)->IHNMHateProc(param);
-}
-
-int Scene::IHNMHateProc(int param) {
-	Event event;
-	Event *q_event;
-
-	switch (param) {
-	case SCENE_BEGIN:
-		_vm->_anim->setCycles(0, -1);
-
-		// Start "hate" animation
-		event.type = kEvTOneshot;
-		event.code = kAnimEvent;
-		event.op = kEventPlay;
-		event.param = 0;
-		event.time = 0;
-
-		q_event = _vm->_events->queue(&event);
-
-		// More music
-		event.type = kEvTOneshot;
-		event.code = kMusicEvent;
-		event.param = 32;
-		event.param2 = MUSIC_LOOP;
-		event.op = kEventPlay;
-		event.time = 0;
-
-		q_event = _vm->_events->chain(q_event, &event);
-
-		// Background for intro scene is the first frame of the
-		// intro animation; display it and set the palette
-		event.type = kEvTOneshot;
-		event.code = kBgEvent;
-		event.op = kEventDisplay;
-		event.param = kEvPSetPalette;
-		event.time = 0;
-
-		q_event = _vm->_events->chain(q_event, &event);
-
-		// Play voice
-		event.type = kEvTOneshot;
-		event.code = kVoiceEvent;
-		event.op = kEventPlay;
-		event.param = 0;
-		event.time = 0;
-
-		q_event = _vm->_events->chain(q_event, &event);
-
-		// Background sound
-		event.type = kEvTOneshot;
-		event.code = kSoundEvent;
-		event.op = kEventPlay;
-		event.param = 260;
-		event.param2 = 255;	// FIXME: Verify volume
-		event.param3 = SOUND_LOOP;
-		event.time = 0;
-
-		q_event = _vm->_events->chain(q_event, &event);
-
-		// End background sound after the voice has finished
-		event.type = kEvTOneshot;
-		event.code = kSoundEvent;
-		event.op = kEventStop;
-		event.time = _vm->_sndRes->getVoiceLength(0);
-
-		q_event = _vm->_events->chain(q_event, &event);
-
-		// End scene after the voice has finished
-		event.type = kEvTOneshot;
-		event.code = kSceneEvent;
-		event.op = kEventEnd;
-		event.time = 0;
-
-		q_event = _vm->_events->chain(q_event, &event);
-		break;
-	default:
-		break;
-	}
-
-	return 0;
-}
-
 } // End of namespace Saga

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- saga.cpp	16 Aug 2005 19:04:51 -0000	1.130
+++ saga.cpp	26 Aug 2005 12:07:31 -0000	1.131
@@ -314,7 +314,7 @@
 			// Since Puzzle is actorless, we do it here
 			if (_puzzle->isActive()) {
 				_actor->handleSpeech(msec);
-			} else if (!_scene->isInIntro() && getGameType() == GType_ITE) {
+			} else if (!_scene->isInIntro()) {
 				if (_interface->getMode() == kPanelMain ||
 						 _interface->getMode() == kPanelConverse ||
 						 _interface->getMode() == kPanelNull)

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- sfuncs.cpp	16 Aug 2005 17:59:49 -0000	1.153
+++ sfuncs.cpp	26 Aug 2005 12:07:31 -0000	1.154
@@ -1640,12 +1640,12 @@
 			_vm->_music->stop();
 		}
 	} else {
-		int16 param1 = thread->pop();
+		// TODO: Verify this
+		int16 param1 = thread->pop() + 32;
 		int16 param2 = thread->pop();
 
-		debug(0, "STUB: sfPlayMusic(%d, %d)", param1, param2);
+		_vm->_music->play(param1, param2 ? MUSIC_LOOP: MUSIC_NORMAL);
 	}
-
 }
 
 // Script function #64 (0x40)
@@ -1738,6 +1738,10 @@
 	int16 param = thread->pop();
 	int res;
 
+	// TODO: This doesn't work for IHNM yet. As a point of reference, when
+	//       'param' is 11, during the "hate" speech, it should probably
+	//       play sound resource 260. Probably quite loudly.
+
 	if (param >= 0 && param < _vm->_sndRes->_fxTableLen) {
 		res = _vm->_sndRes->_fxTable[param].res;
 		if (_vm->getFeatures() & GF_CD_FX)

Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- sthread.cpp	11 Aug 2005 14:00:26 -0000	1.103
+++ sthread.cpp	26 Aug 2005 12:07:31 -0000	1.104
@@ -615,16 +615,13 @@
 				int16 first;
 				const char *strings[ACTOR_SPEECH_STRING_MAX];
 
-				if (_vm->getGameType() == GType_IHNM)
-					break;
-
 				if (_vm->_actor->isSpeaking()) {
 					thread->wait(kWaitTypeSpeech);
 					return false;
 				}
 
 				stringsCount = scriptS.readByte();
-				actorId =  scriptS.readUint16LE();
+				actorId = scriptS.readUint16LE();
 				speechFlags = scriptS.readByte();
 				scriptS.readUint16LE(); // x,y skip
 





More information about the Scummvm-git-logs mailing list