[Scummvm-cvs-logs] CVS: scummvm/saga events.cpp,1.39,1.40 events.h,1.13,1.14 ihnm_introproc.cpp,1.35,1.36

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Jan 2 06:37:06 CET 2005


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

Modified Files:
	events.cpp events.h ihnm_introproc.cpp 
Log Message:
Fixed a few things in the IHNM intro. Most noticeably I've added an event
for starting animations, which I use to prevent the first animation frame
from being drawn too early.


Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- events.cpp	1 Jan 2005 16:18:36 -0000	1.39
+++ events.cpp	2 Jan 2005 14:36:00 -0000	1.40
@@ -326,6 +326,9 @@
 		break;
 	case ANIM_EVENT:
 		switch (event->op) {
+		case EVENT_PLAY:
+			_vm->_anim->play(event->param, event->time, true);
+			break;
 		case EVENT_FRAME:
 			_vm->_anim->play(event->param, event->time, false);
 			break;

Index: events.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- events.h	1 Jan 2005 16:18:36 -0000	1.13
+++ events.h	2 Jan 2005 14:36:00 -0000	1.14
@@ -64,9 +64,10 @@
 	// BG events
 	EVENT_DISPLAY = 1,
 	// ANIM events
-	EVENT_FRAME = 1,
-	EVENT_SETFLAG = 2,
-	EVENT_CLEARFLAG = 3,
+	// EVENT_PLAY = 1, // reused
+	EVENT_FRAME = 2,
+	EVENT_SETFLAG = 3,
+	EVENT_CLEARFLAG = 4,
 	// MUISC & SOUND events
 	EVENT_PLAY = 1,
 	EVENT_STOP = 2,

Index: ihnm_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ihnm_introproc.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ihnm_introproc.cpp	1 Jan 2005 16:18:36 -0000	1.35
+++ ihnm_introproc.cpp	2 Jan 2005 14:36:00 -0000	1.36
@@ -124,6 +124,7 @@
 
 int Scene::IHNMIntroMovieProc1(int param, SCENE_INFO *scene_info) {
 	EVENT event;
+	EVENT *q_event;
 
 	switch (param) {
 	case SCENE_BEGIN:
@@ -134,7 +135,9 @@
 		event.op = EVENT_DISPLAY;
 		event.param = SET_PALETTE;
 		event.time = 0;
-		_vm->_events->queue(&event);
+
+		q_event = _vm->_events->queue(&event);
+
 		_vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME);
 		_vm->_anim->setFlag(0, ANIM_ENDSCENE);
 		_vm->_anim->play(0, 0);
@@ -156,8 +159,8 @@
 	PALENTRY *pal;
 
 	static PALENTRY current_pal[PAL_ENTRIES];
-	switch (param) {
 
+	switch (param) {
 	case SCENE_BEGIN:
 		// Fade to black out of the intro CyberDreams logo anim
 		_vm->_gfx->getCurrentPal(current_pal);
@@ -181,6 +184,24 @@
 
 		q_event = _vm->_events->chain(q_event, &event);
 
+		_vm->_anim->setCycles(0, -1);
+
+		// The "Dreamer's Guild" animation has to be started by an
+		// event, or the first frame will be drawn before the palette
+		// fades down.
+		//
+		// Unlike the original, we keep the logo spinning during the
+		// palette fades. We don't have to, but I think it looks better
+		// that way.
+
+		event.type = ONESHOT_EVENT;
+		event.code = ANIM_EVENT;
+		event.op = EVENT_PLAY;
+		event.param = 0;
+		event.time = 0;
+
+		q_event = _vm->_events->chain(q_event, &event);
+
 		// Fade in from black to the scene background palette
 		_vm->_scene->getBGPal(&pal);
 
@@ -193,14 +214,21 @@
 
 		q_event = _vm->_events->chain(q_event, &event);
 
-		_vm->_anim->setCycles(0, -1);
-		_vm->_anim->play(0, IHNM_PALFADE_TIME * 2);
+		// Fade to black after looping animation for a while
+		event.type = CONTINUOUS_EVENT;
+		event.code = PAL_EVENT;
+		event.op = EVENT_PALTOBLACK;
+		event.time = IHNM_DGLOGO_TIME;
+		event.duration = IHNM_PALFADE_TIME;
+		event.data = pal;
 
-		// Queue end of scene after looping animation for a while
+		q_event = _vm->_events->chain(q_event, &event);
+
+		// Queue end of scene
 		event.type = ONESHOT_EVENT;
 		event.code = SCENE_EVENT;
 		event.op = EVENT_END;
-		event.time = IHNM_DGLOGO_TIME;
+		event.time = 0;
 
 		q_event = _vm->_events->chain(q_event, &event);
 		break;
@@ -302,7 +330,17 @@
 	switch (param) {
 	case SCENE_BEGIN:
 		_vm->_anim->setCycles(0, -1);
-		_vm->_anim->play(0, 0);
+
+		// The "hate" animation also needs to be started from an event,
+		// or the first frame will be drawn too early.
+
+		event.type = ONESHOT_EVENT;
+		event.code = ANIM_EVENT;
+		event.op = EVENT_PLAY;
+		event.param = 0;
+		event.time = 0;
+
+		q_event = _vm->_events->queue(&event);
 
 		// More music
 		event.type = ONESHOT_EVENT;
@@ -312,7 +350,7 @@
 		event.op = EVENT_PLAY;
 		event.time = 0;
 
-		q_event = _vm->_events->queue(&event);
+		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
@@ -322,7 +360,7 @@
 		event.param = SET_PALETTE;
 		event.time = 0;
 
-		q_event = _vm->_events->queue(&event);
+		q_event = _vm->_events->chain(q_event, &event);
 
 		// Play voice
 		event.type = ONESHOT_EVENT;
@@ -331,7 +369,7 @@
 		event.param = 0;
 		event.time = 0;
 
-		q_event = _vm->_events->queue(&event);
+		q_event = _vm->_events->chain(q_event, &event);
 
 		// Background sound
 		event.type = ONESHOT_EVENT;
@@ -342,7 +380,7 @@
 		event.param3 = SOUND_LOOP;
 		event.time = 0;
 
-		q_event = _vm->_events->queue(&event);
+		q_event = _vm->_events->chain(q_event, &event);
 
 		// End background sound after the voice has finished
 		event.type = ONESHOT_EVENT;





More information about the Scummvm-git-logs mailing list