[Scummvm-cvs-logs] CVS: scummvm/saga animation.cpp,1.22,1.23 animation.h,1.9,1.10 events.cpp,1.22,1.23 events.h,1.4,1.5 ite_introproc.cpp,1.20,1.21 ite_introproc.h,1.5,1.6 saga.h,1.35,1.36 transitions.cpp,1.7,1.8 xref.txt,1.1,1.2

Eugene Sandulenko sev at users.sourceforge.net
Tue Aug 10 16:06:18 CEST 2004


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

Modified Files:
	animation.cpp animation.h events.cpp events.h 
	ite_introproc.cpp ite_introproc.h saga.h transitions.cpp 
	xref.txt 
Log Message:
Improved intro. Now it correctly shows game title.


Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- animation.cpp	10 Aug 2004 19:00:30 -0000	1.22
+++ animation.cpp	10 Aug 2004 23:04:51 -0000	1.23
@@ -193,6 +193,9 @@
 		return R_FAILURE;
 	}
 
+	if (anim->flags & ANIM_PAUSE)
+		return R_SUCCESS;
+
 	if (anim->play_flag) {
 		frame = anim->current_frame;
 		if (GAME_GetGameType() == R_GAMETYPE_ITE) {
@@ -304,6 +307,23 @@
 	return R_SUCCESS;
 }
 
+int Anim::clearFlag(uint16 anim_id, uint16 flag) {
+	R_ANIMATION *anim;
+
+	if (anim_id > _anim_count) {
+		return R_FAILURE;
+	}
+
+	anim = _anim_tbl[anim_id];
+	if (anim == NULL) {
+		return R_FAILURE;
+	}
+
+	anim->flags &= ~flag;
+
+	return R_SUCCESS;
+}
+
 int Anim::setFrameTime(uint16 anim_id, int time) {
 	R_ANIMATION *anim;
 

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- animation.h	1 Aug 2004 13:34:20 -0000	1.9
+++ animation.h	10 Aug 2004 23:04:52 -0000	1.10
@@ -88,6 +88,7 @@
 
 enum ANIM_FLAGS {
 	ANIM_LOOP = 0x01,
+	ANIM_PAUSE = 0x02,
 	ANIM_ENDSCENE = 0x80	// When animation ends, dispatch scene end event
 };
 
@@ -101,6 +102,7 @@
 	int play(uint16 anim_id, int vector_time);
 	int link(uint16 anim_id1, uint16 anim_id2);
 	int setFlag(uint16 anim_id, uint16 flag);
+	int clearFlag(uint16 anim_id, uint16 flag);
 	int setFrameTime(uint16 anim_id, int time);
 	int reset(void);
 	void animInfo(int argc, char *argv[]);

Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- events.cpp	10 Aug 2004 19:20:33 -0000	1.22
+++ events.cpp	10 Aug 2004 23:04:52 -0000	1.23
@@ -174,7 +174,21 @@
 			_vm->_render->getBufferInfo(&buf_info);
 			_vm->_scene->getBGInfo(&bg_info);
 			TRANSITION_Dissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w, buf_info.r_bg_buf_h,
-								buf_info.r_bg_buf_w, bg_info.bg_buf, bg_info.bg_p, 0, event_pc);
+								buf_info.r_bg_buf_w, bg_info.bg_buf, bg_info.bg_w, 
+								bg_info.bg_h, bg_info.bg_p, 0, 0, 0, event_pc);
+			break;
+		case EVENT_DISSOLVE_BGMASK:
+			// we dissolve it centered.
+			// set flag of Dissolve to 1. It is a hack to simulate zero masking.
+			int w, h;
+			byte *mask_buf;
+			size_t len;
+
+			_vm->_render->getBufferInfo(&buf_info);
+			_vm->_scene->getBGMaskInfo(&w, &h, &mask_buf, &len);
+			TRANSITION_Dissolve(buf_info.r_bg_buf, buf_info.r_bg_buf_w, buf_info.r_bg_buf_h,
+								buf_info.r_bg_buf_w, mask_buf, w, h, 0, 1, (320 - w) / 2,
+								(200 - h) / 2, event_pc);
 			break;
 		default:
 			break;
@@ -269,6 +283,12 @@
 		case EVENT_FRAME:
 			_vm->_anim->play(event->param, event->time);
 			break;
+		case EVENT_SETFLAG:
+			_vm->_anim->setFlag(event->param, event->param2);
+			break;
+		case EVENT_CLEARFLAG:
+			_vm->_anim->clearFlag(event->param, event->param2);
+			break;
 		default:
 			break;
 		}

Index: events.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- events.h	10 Aug 2004 19:00:30 -0000	1.4
+++ events.h	10 Aug 2004 23:04:52 -0000	1.5
@@ -60,6 +60,8 @@
 	EVENT_DISPLAY = 1,
 	// ANIM events
 	EVENT_FRAME = 1,
+	EVENT_SETFLAG = 2,
+	EVENT_CLEARFLAG = 3,
 	// MUISC & SOUND events
 	EVENT_PLAY = 1,
 	EVENT_STOP = 2,
@@ -82,7 +84,8 @@
 	EVENT_PALTOBLACK = 1,
 	EVENT_BLACKTOPAL = 2,
 	// TRANSITION events
-	EVENT_DISSOLVE = 1
+	EVENT_DISSOLVE = 1,
+	EVENT_DISSOLVE_BGMASK = 2
 };
 
 enum R_EVENT_PARAMS {

Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- ite_introproc.cpp	10 Aug 2004 19:20:33 -0000	1.20
+++ ite_introproc.cpp	10 Aug 2004 23:04:52 -0000	1.21
@@ -124,12 +124,13 @@
 };
 
 R_SCENE_QUEUE ITE_IntroList[] = {
+	{ITE_VALLEY_SCENE, NULL, BY_RESOURCE, ITE_IntroValleyProc, 0}, // HACK
 	{ITE_INTRO_ANIM_SCENE, NULL, BY_RESOURCE, ITE_IntroAnimProc, 0},
 	{ITE_CAVE_SCENE_1, NULL, BY_RESOURCE, ITE_IntroCave1Proc, 1},
 	{ITE_CAVE_SCENE_2, NULL, BY_RESOURCE, ITE_IntroCave2Proc, 0},
 	{ITE_CAVE_SCENE_3, NULL, BY_RESOURCE, ITE_IntroCave3Proc, 0},
 	{ITE_CAVE_SCENE_4, NULL, BY_RESOURCE, ITE_IntroCave4Proc, 0},
-	{ITE_VALLEY_SCENE, NULL, BY_RESOURCE, ITE_IntroValleyProc, 0},
+	//	{ITE_VALLEY_SCENE, NULL, BY_RESOURCE, ITE_IntroValleyProc, 0},
 	{ITE_TREEHOUSE_SCENE, NULL, BY_RESOURCE, ITE_IntroTreeHouseProc, 0},
 	{ITE_FAIREPATH_SCENE, NULL, BY_RESOURCE, ITE_IntroFairePathProc, 0},
 	{ITE_FAIRETENT_SCENE, NULL, BY_RESOURCE, ITE_IntroFaireTentProc, 0}
@@ -680,12 +681,6 @@
 
 		q_event = _vm->_events->queue(&event);
 
-		debug(0, "Beginning animation playback.");
-
-		// Begin title screen background animation 
-		_vm->_anim->setFlag(0, ANIM_LOOP);
-		_vm->_anim->play(0, 0);
-
 		// Begin ITE title theme music
 		_vm->_music->stop();
 
@@ -696,6 +691,58 @@
 		event.time = 0;
 
 		q_event = _vm->_events->chain(q_event, &event);
+		
+		// Pause animation before logo
+		event.type = R_ONESHOT_EVENT;
+		event.code = R_ANIM_EVENT;
+		event.op = EVENT_SETFLAG;
+		event.param = 0;
+		event.param2 = ANIM_PAUSE;
+		event.time = 3000;
+
+		q_event = _vm->_events->queue(&event);
+
+		// Display logo
+		event.type = R_CONTINUOUS_EVENT;
+		event.code = R_TRANSITION_EVENT;
+		event.op = EVENT_DISSOLVE_BGMASK;
+		event.time = 3000;
+		event.duration = LOGO_DISSOLVE_DURATION;
+
+		q_event = _vm->_events->queue(&event);
+
+		// Remove logo
+		event.type = R_CONTINUOUS_EVENT;
+		event.code = R_TRANSITION_EVENT;
+		event.op = EVENT_DISSOLVE;
+		event.time = 6000;
+		event.duration = LOGO_DISSOLVE_DURATION;
+
+		q_event = _vm->_events->queue(&event);
+
+		// Unpause animation before logo
+		event.type = R_ONESHOT_EVENT;
+		event.code = R_ANIM_EVENT;
+		event.op = EVENT_CLEARFLAG;
+		event.param = 0;
+		event.param2 = ANIM_PAUSE;
+		event.time = 6000 + LOGO_DISSOLVE_DURATION;
+
+		q_event = _vm->_events->queue(&event);
+
+		event.type = R_ONESHOT_EVENT;
+		event.code = R_ANIM_EVENT;
+		event.op = EVENT_FRAME;
+		event.param = 0;
+		event.time = 6000 + LOGO_DISSOLVE_DURATION;
+
+		q_event = _vm->_events->queue(&event);
+
+		debug(0, "Beginning animation playback.");
+
+		// Begin title screen background animation 
+		_vm->_anim->setFlag(0, ANIM_LOOP);
+		_vm->_anim->play(0, 0);
 
 		// Queue game credits list
 		text_entry.color = 255;

Index: ite_introproc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ite_introproc.h	4 Aug 2004 20:28:57 -0000	1.5
+++ ite_introproc.h	10 Aug 2004 23:04:52 -0000	1.6
@@ -38,6 +38,7 @@
 
 #define PALETTE_FADE_DURATION 1000
 #define DISSOLVE_DURATION 3000
+#define LOGO_DISSOLVE_DURATION 1000
 
 #define CREDIT_DURATION1 4000
 

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- saga.h	10 Aug 2004 19:20:33 -0000	1.35
+++ saga.h	10 Aug 2004 23:04:52 -0000	1.36
@@ -80,8 +80,9 @@
 	GID_IHNM
 };
 
-int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h,
-	int dst_p, const byte *src_img, int src_p, int flags, double percent);
+int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h, int dst_p, const byte *src_img,
+						int src_w, int src_h, int src_p, int flags, int x, int y, 
+						double percent);
 
 int SYSINPUT_ProcessInput(void);
 R_POINT SYSINPUT_GetMousePos();

Index: transitions.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/transitions.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- transitions.cpp	2 Aug 2004 16:20:35 -0000	1.7
+++ transitions.cpp	10 Aug 2004 23:04:52 -0000	1.8
@@ -26,13 +26,20 @@
 
 namespace Saga {
 
+/*! @brief dissolve one image with another
+
+    @param flag if set to 1, do zero masking
+*/
 int TRANSITION_Dissolve(byte *dst_img, int dst_w, int dst_h, int dst_p, const byte *src_img,
-						int src_p, int flags, double percent) {
+						int src_w, int src_h, int src_p, int flags, int x, int y, 
+						double percent) {
 #define XOR_MASK 0xB400;
 	int pixelcount = dst_w * dst_h;
 	int seqlimit = (int)(65535 * percent);
 	int seq = 1;
-	int i;
+	int i, x1, y1;
+	Common::Rect clip(x, y, x+src_w, y+src_h);
+	byte color;
 
 	for (i = 0; i < seqlimit; i++) {
 		if (seq & 1) {
@@ -48,7 +55,14 @@
 		if (seq >= pixelcount) {
 			continue;
 		} else {
-			dst_img[seq] = src_img[seq];
+			x1 = seq % dst_w;
+			y1 = seq / dst_w;
+			
+			if (clip.contains(x1, y1)) {
+				color = src_img[(x1-x)+src_w*(y1-y)];
+				if (flags == 0 || color)
+					dst_img[seq] = color;
+			}
 		}
 	}
 

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/xref.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xref.txt	31 Jul 2004 13:44:23 -0000	1.1
+++ xref.txt	10 Aug 2004 23:04:52 -0000	1.2
@@ -4,3 +4,37 @@
 the ScummVM implementation.
 
 
+Sceneres.h
+==========
+ LOADREQ_FIGURE                
+ LOADREQ_OBJECT
+ LOADREQ_BACKGROUND        SAGA_BG_IMAGE
+ LOADREQ_ZBUF              SAGA_BG_MASK
+ LOADREQ_SCENE_SCRIPT
+ LOADREQ_STRINGS           SAGA_OBJECT_NAME_LIST
+ LOADREQ_HITZONES          SAGA_OBJECT_MAP
+ LOADREQ_STEPZONES         SAGA_ACTION_MAP
+ LOADREQ_TILE_IMAGES       SAGA_ISO_TILESET
+ LOADREQ_TILE_MAP          SAGA_ISO_METAMAP
+ LOADREQ_TILE_PLATFORMS    SAGA_ISO_METATILESET
+ LOADREQ_TILE_METATILES
+ LOADREQ_ENTRY
+ LOADREQ_FRAMELIST
+
+ LOADREQ_ANIM_0            SAGA_ANIM_1
+ LOADREQ_ANIM_1            SAGA_ANIM_2
+ LOADREQ_ANIM_2            SAGA_ANIM_3
+ LOADREQ_ANIM_3            SAGA_ANIM_4
+ LOADREQ_ANIM_4            SAGA_ANIM_5
+ LOADREQ_ANIM_5            SAGA_ANIM_6
+ LOADREQ_ANIM_6            SAGA_ANIM_7
+ LOADREQ_ANIM_7
+
+ LOADREQ_TILE_MULTI
+ LOADREQ_CYCLES            SAGA_PAL_ANIM
+ LOADREQ_FACES             
+ LOADREQ_PALETTE
+
+Scene.c
+=======
+ ResToImage()              _vm->decodeBGImage()





More information about the Scummvm-git-logs mailing list