[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.68,1.69 game.cpp,1.46,1.47 input.cpp,1.28,1.29 interface.cpp,1.47,1.48 interface.h,1.17,1.18 ite_introproc.cpp,1.43,1.44 rscfile.cpp,1.17,1.18 saga.cpp,1.77,1.78 saga.h,1.62,1.63 script.h,1.43,1.44 sfuncs.cpp,1.64,1.65

Eugene Sandulenko sev at users.sourceforge.net
Sun Jan 2 12:30:10 CET 2005


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

Modified Files:
	actor.cpp game.cpp input.cpp interface.cpp interface.h 
	ite_introproc.cpp rscfile.cpp saga.cpp saga.h script.h 
	sfuncs.cpp 
Log Message:
o Started putting all panels stuff in order. Still incomplete
o Proper detection for Mac Wyrmkeep CD
o Support for wyrmkeep logos


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- actor.cpp	2 Jan 2005 14:51:59 -0000	1.68
+++ actor.cpp	2 Jan 2005 20:29:27 -0000	1.69
@@ -446,8 +446,11 @@
 		
 		//todo: dragon stuff
 
+		if (actor->index == 2)
+			debug(9, "Action: %d Flags: %x", actor->currentAction, actor->flags);
+
 		switch(actor->currentAction) {
-			case kActionWait: {
+			case kActionWait:
 				if (!setup && (actor->flags & kFollower)) {
 					followProtagonist(actor);
 					if (actor->currentAction != kActionWait)
@@ -484,9 +487,10 @@
 					}
 				}
 				actor->actionCycle++;
-			} break;
+				break;
+
 			case kActionWalkToPoint:
-			case kActionWalkToLink: {
+			case kActionWalkToLink:
 				// tiled stuff
 				if (_vm->_scene->getMode() == SCENE_MODE_ISO) {
 					//todo: it
@@ -568,12 +572,14 @@
 				}
 
 				actor->frameNumber = frameRange->frameIndex + actor->actionCycle;
-			} break;
-			case kActionWalkDir: {
+				break;
+
+			case kActionWalkDir:
 				debug(9,"kActionWalkDir not implemented");
 				//todo: do it
-			} break;
-			case kActionSpeak: {
+				break;
+
+			case kActionSpeak:
 				actor->actionCycle++;
 				actor->cycleWrap(64);
 
@@ -594,14 +600,14 @@
 				}
 
 				actor->frameNumber = frameRange->frameIndex + state;
-			} break;
+				break;
 
 			case kActionAccept:
 			case kActionStoop:
 				break;
 
 			case kActionCycleFrames:
-			case kActionPongFrames: {
+			case kActionPongFrames:
 				if (actor->cycleTimeCount > 0) {
 					actor->cycleTimeCount--;
 					break;
@@ -647,17 +653,19 @@
 				} else {
 					actor->frameNumber = frameRange->frameIndex + state;
 				}
-			} break;
-			case kActionFall: {
+				break;
+
+			case kActionFall:
 				debug(9,"kActionFall not implemented");
 
 				//todo: do it
-			} break;
-			case kActionClimb: {
+				break;
+
+			case kActionClimb:
 				debug(9,"kActionClimb not implemented");
 
 				//todo: do it
-			} break;
+				break;
 		}
 	}
 
@@ -705,6 +713,9 @@
 		actor->screenPosition.x = (actor->location.x / ACTOR_LMULT);
 		actor->screenPosition.y = (actor->location.y / ACTOR_LMULT) - actor->location.z;
 	}
+
+	if (actor->index == 2)
+		debug(9, "act: %d. x: %d y: %d", actor->index, actor->screenPosition.x, actor->screenPosition.y);
 }
 
 void Actor::createDrawOrderList() {
@@ -946,7 +957,7 @@
 	bool extraEndNode;
 
 	actor = getActor(actorId);
-	
+
 	if (actor == _protagonist) {
 		_vm->_scene->setDoorState(2, 0xff);
 		_vm->_scene->setDoorState(3, 0);

Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- game.cpp	2 Jan 2005 14:52:00 -0000	1.46
+++ game.cpp	2 Jan 2005 20:29:27 -0000	1.47
@@ -199,93 +199,94 @@
 	GAME_IDS id;
 	const char *md5;
 	const char *filename;
+	bool caseSensitive;
 };
 
 #define FILE_MD5_BYTES 5000
 
 static GAME_MD5 game_md5[] = {
-	{ GID_ITE_DISK_G,   "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" },
-	{ GID_ITE_DISK_G,   "516f7330f8410057b834424ea719d1ef", "scripts.rsc" },
-	{ GID_ITE_DISK_G,   "c46e4392fcd2e89bc91e5567db33b62d", "voices.rsc" },
+	{ GID_ITE_DISK_G,   "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false },
+	{ GID_ITE_DISK_G,   "516f7330f8410057b834424ea719d1ef", "scripts.rsc", false },
+	{ GID_ITE_DISK_G,   "c46e4392fcd2e89bc91e5567db33b62d", "voices.rsc", false },
 
-	{ GID_ITE_CD_G,     "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" },
-	{ GID_ITE_CD_G,     "50a0d2d7003c926a3832d503c8534e90", "scripts.rsc" },
-	{ GID_ITE_CD_G,     "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" },
-	{ GID_ITE_CD_G,     "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" },
+	{ GID_ITE_CD_G,     "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false },
+	{ GID_ITE_CD_G,     "50a0d2d7003c926a3832d503c8534e90", "scripts.rsc", false },
+	{ GID_ITE_CD_G,     "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false },
+	{ GID_ITE_CD_G,     "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false },
 
-	{ GID_ITE_CD,       "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" },
-	{ GID_ITE_CD,       "a891405405edefc69c9d6c420c868b84", "scripts.rsc" },
-	{ GID_ITE_CD,       "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" },
-	{ GID_ITE_CD,       "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" },
+	{ GID_ITE_CD,       "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false },
+	{ GID_ITE_CD,       "a891405405edefc69c9d6c420c868b84", "scripts.rsc", false },
+	{ GID_ITE_CD,       "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false },
+	{ GID_ITE_CD,       "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false },
 
-	{ GID_ITE_DEMO_G,   "986c79c4d2939dbe555576529fd37932", "ite.rsc" },
-	{ GID_ITE_DEMO_G,   "d5697dd3240a3ceaddaa986c47e1a2d7", "scripts.rsc" },
-	{ GID_ITE_DEMO_G,   "c58e67c506af4ffa03fd0aac2079deb0", "voices.rsc" },
-	{ GID_ITE_DEMO_G,   "0b9a70eb4e120b6f00579b46c8cae29e", "ite.dmo" },
+	{ GID_ITE_DEMO_G,   "986c79c4d2939dbe555576529fd37932", "ite.rsc", false },
+	{ GID_ITE_DEMO_G,   "d5697dd3240a3ceaddaa986c47e1a2d7", "scripts.rsc", false },
+	{ GID_ITE_DEMO_G,   "c58e67c506af4ffa03fd0aac2079deb0", "voices.rsc", false },
+	{ GID_ITE_DEMO_G,   "0b9a70eb4e120b6f00579b46c8cae29e", "ite.dmo", false },
 
-	{ GID_ITE_MACCD,    "4f7fa11c5175980ed593392838523060", "ite.rsc" },
-	{ GID_ITE_MACCD,    "adf1f46c1d0589083996a7060c798ad0", "scripts.rsc" },
-	{ GID_ITE_MACCD,    "1a91cd60169f367ecb6c6e058d899b2f", "music.rsc" },
-	{ GID_ITE_MACCD,    "95863b89a0916941f6c5e1789843ba14", "sounds.rsc" },
-	{ GID_ITE_MACCD,    "c14c4c995e7a0d3828e3812a494301b7", "Inherit the Earth Voices" },
+	{ GID_ITE_MACCD,    "4f7fa11c5175980ed593392838523060", "ite.rsc", false },
+	{ GID_ITE_MACCD,    "adf1f46c1d0589083996a7060c798ad0", "scripts.rsc", false },
+	{ GID_ITE_MACCD,    "1a91cd60169f367ecb6c6e058d899b2f", "music.rsc", false },
+	{ GID_ITE_MACCD,    "95863b89a0916941f6c5e1789843ba14", "sounds.rsc", false },
+	{ GID_ITE_MACCD,    "c14c4c995e7a0d3828e3812a494301b7", "Inherit the Earth Voices", true },
 
-	{ GID_ITE_LINCD,    "8f4315a9bb10ec839253108a032c8b54", "ite.rsc" },
-	{ GID_ITE_LINCD,    "a891405405edefc69c9d6c420c868b84", "scripts.rsc" },
-	{ GID_ITE_LINCD,    "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc" },
-	{ GID_ITE_LINCD,    "41bb6b95d792dde5196bdb78740895a6", "voices.rsc" },
-	{ GID_ITE_LINCD,    "d6454756517f042f01210458abe8edd4", "music.rsc" },
+	{ GID_ITE_LINCD,    "8f4315a9bb10ec839253108a032c8b54", "ite.rsc", false },
+	{ GID_ITE_LINCD,    "a891405405edefc69c9d6c420c868b84", "scripts.rsc", false },
+	{ GID_ITE_LINCD,    "e2ccb61c325d6d1ead3be0e731fe29fe", "sounds.rsc", false },
+	{ GID_ITE_LINCD,    "41bb6b95d792dde5196bdb78740895a6", "voices.rsc", false },
+	{ GID_ITE_LINCD,    "d6454756517f042f01210458abe8edd4", "music.rsc", false },
 
-	{ GID_ITE_DISK_DE,  "869fc23c8f38f575979ec67152914fee", "ite.rsc" },
-	{ GID_ITE_DISK_DE,  "516f7330f8410057b834424ea719d1ef", "scripts.rsc" },
-	{ GID_ITE_DISK_DE,  "0c9113e630f97ef0996b8c3114badb08", "voices.rsc" },
+	{ GID_ITE_DISK_DE,  "869fc23c8f38f575979ec67152914fee", "ite.rsc", false },
+	{ GID_ITE_DISK_DE,  "516f7330f8410057b834424ea719d1ef", "scripts.rsc", false },
+	{ GID_ITE_DISK_DE,  "0c9113e630f97ef0996b8c3114badb08", "voices.rsc", false },
 
-	{ GID_ITE_WINDEMO2, "3a450852cbf3c80773984d565647e6ac", "ited.rsc" },
-	{ GID_ITE_WINDEMO2, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" },
-	{ GID_ITE_WINDEMO2, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc" },
-	{ GID_ITE_WINDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" },
+	{ GID_ITE_WINDEMO2, "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false },
+	{ GID_ITE_WINDEMO2, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false },
+	{ GID_ITE_WINDEMO2, "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc", false },
+	{ GID_ITE_WINDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false },
 
-	{ GID_ITE_LINDEMO,  "3a450852cbf3c80773984d565647e6ac", "ited.rsc" },
-	{ GID_ITE_LINDEMO,  "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" },
-	{ GID_ITE_LINDEMO,  "d6454756517f042f01210458abe8edd4", "musicd.rsc" },
-	{ GID_ITE_LINDEMO,  "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc" },
-	{ GID_ITE_LINDEMO,  "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" },
+	{ GID_ITE_LINDEMO,  "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false },
+	{ GID_ITE_LINDEMO,  "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false },
+	{ GID_ITE_LINDEMO,  "d6454756517f042f01210458abe8edd4", "musicd.rsc", false },
+	{ GID_ITE_LINDEMO,  "95a6c148e22e99a8c243f2978223583c", "soundsd.rsc", false },
+	{ GID_ITE_LINDEMO,  "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false },
 
-	{ GID_ITE_MACDEMO2, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc" },
-	{ GID_ITE_MACDEMO2, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc" },
-	{ GID_ITE_MACDEMO2, "495bdde51fd9f4bea2b9c911091b1ab2", "musicd.rsc" },
-	{ GID_ITE_MACDEMO2, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc" },
-	{ GID_ITE_MACDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" },
+	{ GID_ITE_MACDEMO2, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc", false },
+	{ GID_ITE_MACDEMO2, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc", false },
+	{ GID_ITE_MACDEMO2, "495bdde51fd9f4bea2b9c911091b1ab2", "musicd.rsc", false },
+	{ GID_ITE_MACDEMO2, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc", false },
+	{ GID_ITE_MACDEMO2, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false },
 
-	{ GID_ITE_WINDEMO1, "3a450852cbf3c80773984d565647e6ac", "ited.rsc" },
-	{ GID_ITE_WINDEMO1, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc" },
-	{ GID_ITE_WINDEMO1, "a741139dd7365a13f463cd896ff9969a", "soundsd.rsc" },
-	{ GID_ITE_WINDEMO1, "0759eaf5b64ae19fd429920a70151ad3", "voicesd.rsc" },
+	{ GID_ITE_WINDEMO1, "3a450852cbf3c80773984d565647e6ac", "ited.rsc", false },
+	{ GID_ITE_WINDEMO1, "3f12b67fa93e56e1a6be39d2921d80bb", "scriptsd.rsc", false },
+	{ GID_ITE_WINDEMO1, "a741139dd7365a13f463cd896ff9969a", "soundsd.rsc", false },
+	{ GID_ITE_WINDEMO1, "0759eaf5b64ae19fd429920a70151ad3", "voicesd.rsc", false },
 
-	{ GID_ITE_MACDEMO1, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc" },
-	{ GID_ITE_MACDEMO1, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc" },
-	{ GID_ITE_MACDEMO1, "1a91cd60169f367ecb6c6e058d899b2f", "musicd.rsc" },
-	{ GID_ITE_MACDEMO1, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc" },
-	{ GID_ITE_MACDEMO1, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc" },
+	{ GID_ITE_MACDEMO1, "addfc9d82bc2fa1f4cab23743c652c08", "ited.rsc", false },
+	{ GID_ITE_MACDEMO1, "fded5c59b8b7c5976229f960d21e6b0b", "scriptsd.rsc", false },
+	{ GID_ITE_MACDEMO1, "1a91cd60169f367ecb6c6e058d899b2f", "musicd.rsc", false },
+	{ GID_ITE_MACDEMO1, "b3a831fbed337d1f1300fee1dd474f6c", "soundsd.rsc", false },
+	{ GID_ITE_MACDEMO1, "e139d86bab2ee8ba3157337f894a92d4", "voicesd.rsc", false },
 
 	// My CD also has a file called 'patch.re_'. I assume it contains
 	// bugfixes, but let's ignore it for now.
-	{ GID_IHNM_CD, "0439083e3dfdc51b486071d45872ae52", "musicfm.res" },
-	{ GID_IHNM_CD, "80f875a1fb384160d1f4b27166eef583", "musicgm.res" },
-	{ GID_IHNM_CD, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res" },
-	{ GID_IHNM_CD, "be38bbc5a26be809dbf39f13befebd01", "scripts.res" },
-	{ GID_IHNM_CD, "1c610d543f32ec8b525e3f652536f269", "sfx.res" },
-	{ GID_IHNM_CD, "fc6440b38025f4b2cc3ff55c3da5c3eb", "voices1.res" },
-	{ GID_IHNM_CD, "b37f10fd1696ade7d58704ccaaebceeb", "voices2.res" },
-	{ GID_IHNM_CD, "3bbc16a8f741dbb511da506c660a0b54", "voices3.res" },
-	{ GID_IHNM_CD, "ebfa160122d2247a676ca39920e5d481", "voices4.res" },
-	{ GID_IHNM_CD, "1f501ce4b72392bdd1d9ec38f6eec6da", "voices5.res" },
-	{ GID_IHNM_CD, "f580ed7568c7d6ef34e934ba20adf834", "voices6.res" },
-	{ GID_IHNM_CD, "54b1f2013a075338ceb0e258d97808bd", "voicess.res" },
+	{ GID_IHNM_CD, "0439083e3dfdc51b486071d45872ae52", "musicfm.res", false },
+	{ GID_IHNM_CD, "80f875a1fb384160d1f4b27166eef583", "musicgm.res", false },
+	{ GID_IHNM_CD, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res", false },
+	{ GID_IHNM_CD, "be38bbc5a26be809dbf39f13befebd01", "scripts.res", false },
+	{ GID_IHNM_CD, "1c610d543f32ec8b525e3f652536f269", "sfx.res", false },
+	{ GID_IHNM_CD, "fc6440b38025f4b2cc3ff55c3da5c3eb", "voices1.res", false },
+	{ GID_IHNM_CD, "b37f10fd1696ade7d58704ccaaebceeb", "voices2.res", false },
+	{ GID_IHNM_CD, "3bbc16a8f741dbb511da506c660a0b54", "voices3.res", false },
+	{ GID_IHNM_CD, "ebfa160122d2247a676ca39920e5d481", "voices4.res", false },
+	{ GID_IHNM_CD, "1f501ce4b72392bdd1d9ec38f6eec6da", "voices5.res", false },
+	{ GID_IHNM_CD, "f580ed7568c7d6ef34e934ba20adf834", "voices6.res", false },
+	{ GID_IHNM_CD, "54b1f2013a075338ceb0e258d97808bd", "voicess.res", false },
 
-	{ GID_IHNM_DEMO, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res" },
-	{ GID_IHNM_DEMO, "9626bda8978094ff9b29198bc1ed5f9a", "scripts.res" },
-	{ GID_IHNM_DEMO, "1c610d543f32ec8b525e3f652536f269", "sfx.res" },
-	{ GID_IHNM_DEMO, "3bbc16a8f741dbb511da506c660a0b54", "voicesd.res" },
+	{ GID_IHNM_DEMO, "46bbdc65d164ba7e89836a0935eec8e6", "scream.res", false },
+	{ GID_IHNM_DEMO, "9626bda8978094ff9b29198bc1ed5f9a", "scripts.res", false },
+	{ GID_IHNM_DEMO, "1c610d543f32ec8b525e3f652536f269", "sfx.res", false },
+	{ GID_IHNM_DEMO, "3bbc16a8f741dbb511da506c660a0b54", "voicesd.res", false },
 };
 
 static GAMEDESC GameDescs[] = {
@@ -358,7 +359,7 @@
 		ARRAYSIZE(ITEMACDEMO_GameFonts),
 		ITEMACDEMO_GameFonts,
 		&ITECD_GameSound,
-		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES
+		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_WYRMKEEP
 	},
 
 	// Inherit the earth - Linux Demo version
@@ -377,7 +378,7 @@
 		ARRAYSIZE(ITECD_GameFonts),
 		ITECD_GameFonts,
 		&ITECD_GameSound,
-		GF_VOX_VOICES
+		GF_VOX_VOICES | GF_WYRMKEEP
 	},
 	
 	// Inherit the earth - Linux Demo version
@@ -395,7 +396,7 @@
 		ARRAYSIZE(ITECD_GameFonts),
 		ITECD_GameFonts,
 		&ITECD_GameSound,
-		GF_VOX_VOICES
+		GF_VOX_VOICES | GF_WYRMKEEP
 	},
 	
 	// Inherit the earth - Win32 Demo version
@@ -413,7 +414,7 @@
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
 		ITEWINDEMO_GameFonts,
 		&ITECD_GameSound,
-		GF_VOX_VOICES
+		GF_VOX_VOICES | GF_WYRMKEEP
 	},
 	
 	// Inherit the earth - Wyrmkeep Linux CD version
@@ -432,7 +433,7 @@
 		ARRAYSIZE(ITECD_GameFonts),
 		ITECD_GameFonts,
 		&ITECD_GameSound,
-		0
+		GF_WYRMKEEP
 	},
 
 	// Inherit the earth - DOS CD version
@@ -639,7 +640,7 @@
 	File test_file;
 	bool file_missing;
 
-	Common::String tstr;
+	Common::String tstr, tstr1;
 	char md5str[32+1];
 	uint8 md5sum[16];
 
@@ -647,7 +648,11 @@
 	for (int i = 0; i < ARRAYSIZE(game_md5); i++) {
 		tstr = Common::String(game_md5[i].filename);
 		tstr.toLowercase();
-		filesList[tstr] = true;
+
+		if (game_md5[i].caseSensitive && !mode)
+			filesList[Common::String(game_md5[i].filename)] = true;
+		else
+			filesList[tstr] = true;
 	}
 
 	if (mode) {
@@ -655,14 +660,18 @@
 		for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
 			if (!file->isDirectory()) {
 				tstr = file->displayName();
+				// FIXME: there is a bug in String class. tstr1 = tstr; tstr.toLowercase()
+				// makes tstr1 lowercase as well
+				tstr1 = Common::String(file->displayName().c_str());
 				tstr.toLowercase();
 				
-				if (filesList.contains(tstr)) {
+				if (filesList.contains(tstr) || filesList.contains(tstr1)) {
 					if (md5_file(file->path().c_str(), md5sum, NULL, FILE_MD5_BYTES)) {
 						for (int j = 0; j < 16; j++) {
 							sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
 						}
 						filesMD5[tstr] = Common::String(md5str);
+						filesMD5[tstr1] = Common::String(md5str);
 					}
 				}
 			}
@@ -690,7 +699,6 @@
 		// Try to open all files for this game
 		for (file_n = 0; file_n < file_count; file_n++) {
 			tstr = GameDescs[game_n].gd_filedescs[file_n].gf_fname;
-			tstr.toLowercase();
 
 			if (!filesMD5.contains(tstr)) {
 				file_missing = true;
@@ -710,7 +718,6 @@
 			for (int i = 0; i < ARRAYSIZE(game_md5); i++) {
 				if (game_md5[i].id == GameDescs[game_n].gd_game_id) {
 					tstr = game_md5[i].filename;
-					tstr.toLowercase();
 
 					if (strcmp(game_md5[i].md5, filesMD5[tstr].c_str())) {
 						match = false;

Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/input.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- input.cpp	1 Jan 2005 16:18:36 -0000	1.28
+++ input.cpp	2 Jan 2005 20:29:27 -0000	1.29
@@ -81,7 +81,7 @@
 				break;
 			case 27: // Esc
 				// Skip to next scene skip target
-				if (!_interface->getMode() == kPanelNone) // FIXME: hack
+				if (!_interface->getMode() == kPanelNull) // FIXME: hack
 					_actor->abortAllSpeeches();
 				else
 					_scene->skipScene();

Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- interface.cpp	1 Jan 2005 16:18:36 -0000	1.47
+++ interface.cpp	2 Jan 2005 20:29:27 -0000	1.48
@@ -238,7 +238,7 @@
 	_activeVerb = I_VERB_WALKTO;
 
 	_active = 0;
-	_panelMode = kPanelNone;
+	_panelMode = _savedMode = kPanelNull;
 	*_statusText = 0;
 
 	_inventoryCount = 0;
@@ -331,7 +331,7 @@
 	drawStatusBar(back_buf);
 
 	// Draw command panel background
-	if (_panelMode == kPanelCommand) {
+	if (_panelMode == kPanelMain) {
 		xbase = _cPanel.x;
 		ybase = _cPanel.y;
 
@@ -357,7 +357,7 @@
 
 	_vm->_sprite->draw(back_buf, _defPortraits, _leftPortrait, lportrait, 256);
 
-	if (_panelMode == kPanelDialogue && _iDesc.rportrait_x >= 0) {
+	if (_panelMode == kPanelConverse && _iDesc.rportrait_x >= 0) {
 		rportrait.x = xbase + _iDesc.rportrait_x;
 		rportrait.y = ybase + _iDesc.rportrait_y;
 
@@ -388,7 +388,7 @@
 	// Get game display info
 	_vm->getDisplayInfo(&g_di);
 
-	if (_panelMode == kPanelCommand) {
+	if (_panelMode == kPanelMain) {
 		// Update playfield space ( only if cursor is inside )
 		if (imouse_y < g_di.scene_h) {
 			// Mouse is in playfield space
@@ -691,7 +691,7 @@
 }
 
 void Interface::drawInventory() {
-	if (_panelMode != kPanelCommand)
+	if (_panelMode != kPanelMain)
 		return;
 
 	SURFACE *back_buf = _vm->_gfx->getBackBuffer();

Index: interface.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- interface.h	1 Jan 2005 16:18:36 -0000	1.17
+++ interface.h	2 Jan 2005 20:29:27 -0000	1.18
@@ -102,9 +102,17 @@
 #define IHNM_INVENTORY_YSPACING 0
 
 enum PANEL_MODES {
-	kPanelNone,
-	kPanelCommand,
-	kPanelDialogue
+	kPanelNull,
+	kPanelMain,
+	kPanelOption,
+	kPanelTextBox,
+	kPanelQuit,
+	kPanelError,
+	kPanelLoad,
+	kPanelConverse,
+	kPanelProtect,
+	kPanelPlacard,
+	kPanelMap
 };
 
 enum BUTTON_FLAGS {
@@ -201,6 +209,8 @@
 	int deactivate();
 	int setMode(int mode);
 	int getMode(void) { return _panelMode; }
+	void rememberMode() { _savedMode = _panelMode; }
+	void restoreMode() { _panelMode = _savedMode; }
 	int setStatusText(const char *new_txt);
 	int loadScenePortraits(int res);
 	int setLeftPortrait(int portrait);
@@ -212,6 +222,7 @@
 	void removeFromInventory(int sprite);
 	void drawInventory();
 	int inventoryTest(const Point& imousePt, int *ibutton);
+
 private:
 	int hitTest(const Point& imousePt, int *ibutton);
 	int drawStatusBar(SURFACE *ds);
@@ -228,6 +239,7 @@
 	RSCFILE_CONTEXT *_interfaceContext;
 	INTERFACE_DESC _iDesc;
 	int _panelMode;
+	int _savedMode;
 	INTERFACE_PANEL _cPanel;
 	INTERFACE_PANEL _dPanel;
 	char _statusText[STATUS_TEXT_LEN];

Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- ite_introproc.cpp	2 Jan 2005 15:59:01 -0000	1.43
+++ ite_introproc.cpp	2 Jan 2005 20:29:27 -0000	1.44
@@ -195,21 +195,29 @@
 
 		// Link this scene's animation resources for continuous
 		// playback
-		_vm->_anim->link(0, 1);
-		_vm->_anim->link(1, 2);
-		_vm->_anim->link(2, 3);
-		_vm->_anim->link(3, 4);
-
-		if (_vm->_features & GF_MAC_RESOURCES)
-			_vm->_anim->setFlag(4, ANIM_ENDSCENE);
-		else {
-			_vm->_anim->link(4, 5);
-			_vm->_anim->link(5, 6);
+		int lastAnim;
 
-			// Scene should end on display of last animation frame
-			_vm->_anim->setFlag(6, ANIM_ENDSCENE);
+		if (_vm->_features & GF_WYRMKEEP) {
+			if (_vm->_features & GF_MAC_RESOURCES) {
+				lastAnim = 3;
+			} else {
+				lastAnim = 2;
+			}
+		} else {
+			if (_vm->_features & GF_MAC_RESOURCES) {
+				lastAnim = 4;
+			} else {
+				lastAnim = 5;
+			}
 		}
 
+		for (int i = 0; i < lastAnim; i++)
+			_vm->_anim->link(i, i+1);
+
+		_vm->_anim->setFlag(lastAnim, ANIM_ENDSCENE);
+
+		debug(0, "Beginning animation playback.");
+
 		// Begin the animation
 		event.type = ONESHOT_EVENT;
 		event.code = ANIM_EVENT;

Index: rscfile.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/rscfile.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- rscfile.cpp	2 Jan 2005 14:52:02 -0000	1.17
+++ rscfile.cpp	2 Jan 2005 20:29:27 -0000	1.18
@@ -30,6 +30,20 @@
 
 namespace Saga {
 
+static struct Substitutes {
+	uint32 id;
+	const char *fname;
+} substitutes[] = {
+	{ 1529, "wyrm.pak" },
+	{ 1530, "wyrm1.dlt" },
+	{ 1531, "wyrm2.dlt" },
+	{ 1532, "wyrm3.dlt" },
+	{ 1533, "wyrm4.dlt" },
+	{ 1796, "credit3n.dlt" },
+	{ 1797, "credit4n.dlt" }
+};
+	
+
 RSCFILE_CONTEXT *RSC_CreateContext() {
 	RSCFILE_CONTEXT empty_context;
 	empty_context.rc_file_fspec = NULL;
@@ -220,8 +234,9 @@
 
 int RSC_LoadResource(RSCFILE_CONTEXT *rsc, uint32 res_num, byte **res_p, size_t *res_size_p) {
 	uint32 res_offset;
-	size_t res_size;
-	byte *res_buf;
+	size_t res_size = 0;
+	byte *res_buf = NULL;
+	int substnum = -1;
 
 	if ((rsc == NULL) || (res_p == NULL)) {
 		return FAILURE;
@@ -231,19 +246,42 @@
 		return FAILURE;
 	}
 
-	res_offset = rsc->rc_res_table[res_num].res_offset;
-	res_size = rsc->rc_res_table[res_num].res_size;
+	debug(8, "LoadResource %d", res_num);
+	for (int i = 0; i < ARRAYSIZE(substitutes); i++)
+		if (substitutes[i].id == res_num) {
+			substnum = i;
+			break;
+		}
 
-	rsc->rc_file->seek((long)res_offset, SEEK_SET);
+	if (substnum != -1) {
+		File in;
 
-	res_buf = (byte *)malloc(res_size);
-	if (res_buf == NULL) {
-		return MEM;
+		if (in.open(substitutes[substnum].fname)) {
+			res_size = in.size();
+			if ((res_buf = (byte *)malloc(res_size)) == NULL)
+				return MEM;
+
+			in.read(res_buf, res_size);
+			in.close();
+			debug(8, "LoadResource: substituted resource by %s", substitutes[substnum].fname);
+		} else {
+			substnum = -1;
+		}
 	}
 
-	if (rsc->rc_file->read(res_buf, res_size) != res_size) {
-		free(res_buf);
-		return FAILURE;
+	if (substnum == -1) {
+		res_offset = rsc->rc_res_table[res_num].res_offset;
+		res_size = rsc->rc_res_table[res_num].res_size;
+
+		if ((res_buf = (byte *)malloc(res_size)) == NULL)
+			return MEM;
+
+		rsc->rc_file->seek((long)res_offset, SEEK_SET);
+
+		if (rsc->rc_file->read(res_buf, res_size) != res_size) {
+			free(res_buf);
+			return FAILURE;
+		}
 	}
 
 	*res_p = res_buf;

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- saga.cpp	1 Jan 2005 16:18:36 -0000	1.77
+++ saga.cpp	2 Jan 2005 20:29:27 -0000	1.78
@@ -102,6 +102,9 @@
 	File::addDefaultDirectory(_gameDataPath + "music/");
 	File::addDefaultDirectory(_gameDataPath + "sound/");
 
+	// Mac CD Wyrmkeep
+	File::addDefaultDirectory(_gameDataPath + "patch/");
+
 	// Setup mixer
 	if (!_mixer->isReady()) {
 		warning("Sound initialization failed.");

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- saga.h	1 Jan 2005 16:18:36 -0000	1.62
+++ saga.h	2 Jan 2005 20:29:27 -0000	1.63
@@ -180,7 +180,8 @@
 	GF_VOX_VOICES = 1,
 	GF_BIG_ENDIAN_DATA = 2,
 	GF_MAC_RESOURCES = 4,
-	GF_LANG_DE = 8
+	GF_LANG_DE = 8,
+	GF_WYRMKEEP = 16
 };
 
 struct GAME_DISPLAYINFO {

Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- script.h	1 Jan 2005 16:18:36 -0000	1.43
+++ script.h	2 Jan 2005 20:29:27 -0000	1.44
@@ -309,7 +309,7 @@
 	int sfWait(SCRIPTFUNC_PARAMS);
 	int SF_takeObject(SCRIPTFUNC_PARAMS);
 	int SF_objectIsCarried(SCRIPTFUNC_PARAMS);
-	int SF_setStatusText(SCRIPTFUNC_PARAMS);
+	int sfStatusBar(SCRIPTFUNC_PARAMS);
 	int SF_commandMode(SCRIPTFUNC_PARAMS);
 	int sfScriptWalkTo(SCRIPTFUNC_PARAMS);
 	int SF_doAction(SCRIPTFUNC_PARAMS);

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- sfuncs.cpp	1 Jan 2005 16:18:36 -0000	1.64
+++ sfuncs.cpp	2 Jan 2005 20:29:27 -0000	1.65
@@ -51,7 +51,7 @@
 		OPCODE(sfWait),
 		OPCODE(SF_takeObject),
 		OPCODE(SF_objectIsCarried),
-		OPCODE(SF_setStatusText),
+		OPCODE(sfStatusBar),
 		OPCODE(SF_commandMode),
 		OPCODE(sfScriptWalkTo),
 		OPCODE(SF_doAction),
@@ -185,7 +185,7 @@
 // Script function #4 (0x04) nonblocking
 // Set the command display to the specified text string
 // Param1: dialogue index of string
-int Script::SF_setStatusText(SCRIPTFUNC_PARAMS) {
+int Script::sfStatusBar(SCRIPTFUNC_PARAMS) {
 	ScriptDataWord param = thread->pop();
 
 	return _vm->_interface->setStatusText(getString(param));
@@ -193,7 +193,7 @@
 
 // Script function #5 (0x05)
 int Script::SF_commandMode(SCRIPTFUNC_PARAMS) {
-	return _vm->_interface->setMode(kPanelCommand);
+	return _vm->_interface->setMode(kPanelMain);
 }
 
 // Script function #6 (0x06) blocking
@@ -295,7 +295,7 @@
 // Script function #12 (0x0C)
 // Disables mouse input, etc.
 int Script::SF_dialogMode(SCRIPTFUNC_PARAMS) {
-	return _vm->_interface->setMode(kPanelDialogue);
+	return _vm->_interface->setMode(kPanelConverse);
 }
 
 // Script function #13 (0x0D)
@@ -848,7 +848,10 @@
 	actorDirection =  getSWord(thread->pop());
 	frameType =  getSWord(thread->pop());
 	frameOffset =  getSWord(thread->pop());
-	
+
+	debug(1, "sfPlaceActor(%d, %d, %d, %d, %d, %d)", actorId, actorLocation.x, 
+		  actorLocation.y, actorDirection, frameType, frameOffset);
+
 	actor = _vm->_actor->getActor(actorId);
 	actor->location.x = actorLocation.x;
 	actor->location.y = actorLocation.y;
@@ -950,6 +953,9 @@
 	_vm->_scene->getBGPal(&pal);
 	_vm->_gfx->blackToPalWait(back_buf, pal, kNormalFadeDuration);
 
+	_vm->_interface->rememberMode();
+	_vm->_interface->setMode(kPanelPlacard);
+
 	return SUCCESS;
 }
 
@@ -973,6 +979,8 @@
 	_vm->_gfx->showCursor(true);
 	_vm->_gfx->blackToPalWait(back_buf, pal, kNormalFadeDuration);
 
+	_vm->_interface->restoreMode();
+
 	return SUCCESS;
 }
 





More information about the Scummvm-git-logs mailing list