[Scummvm-cvs-logs] SF.net SVN: scummvm: [22869] scummvm/trunk/engines/simon/animation.cpp

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sat Jun 3 15:25:04 CEST 2006


Revision: 22869
Author:   kirben
Date:     2006-06-03 06:24:59 -0700 (Sat, 03 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22869&view=rev

Log Message:
-----------
Add work around for bug in a German Windows 2CD version of FF. Trigger error if video file not found, since they are required by several part of FF

Modified Paths:
--------------
    scummvm/trunk/engines/simon/animation.cpp
Modified: scummvm/trunk/engines/simon/animation.cpp
===================================================================
--- scummvm/trunk/engines/simon/animation.cpp	2006-06-03 11:40:31 UTC (rev 22868)
+++ scummvm/trunk/engines/simon/animation.cpp	2006-06-03 13:24:59 UTC (rev 22869)
@@ -73,7 +73,7 @@
 }
 
 bool MoviePlayer::load(const char *filename) {
-	char filename2[100];
+	char videoName[20];
 	uint32 tag;
 	int32 frameRate;
 	uint i;
@@ -83,16 +83,28 @@
 	memcpy(baseName, filename, baseLen);
 
 	// Change file extension to dxa
-	strcpy(filename2, filename);
-	filename2[baseLen + 1] = 'd';
-	filename2[baseLen + 2] = 'x';
-	filename2[baseLen + 3] = 'a';
+	sprintf(videoName, "%s.dxa", baseName);
 	
-	if (_fd.open(filename2) == false) {
-		warning("Failed to load video file %s", filename2);
-		return false;
-	} 
-	debug(0, "Playing video %s", filename2);
+	if (_fd.open(videoName) == false) {
+		// Check short filename to work around
+		// bug in a German Windows 2CD version.
+		if (baseLen >= 8) {
+			char shortName[20];
+			memset(shortName, 0, sizeof(shortName));
+			memcpy(shortName, filename, 6);
+			sprintf(shortName, "%s~1.dxa", shortName);
+	
+			if (_fd.open(shortName) == false) {
+				error("Failed to load video file %s or %s", videoName, shortName);
+			} else {
+				debug(0, "Playing video %s", shortName);
+			}
+		} else {
+			error("Failed to load video file %s", videoName);
+		}
+	} else {
+		debug(0, "Playing video %s", videoName);
+	}
 
 	CursorMan.showMouse(false);
 
@@ -100,7 +112,7 @@
 		_vm->_language != Common::EN_ANY) {
 		_sequenceNum = 0;
 		for (i = 0; i < 90; i++) {
-			if (!scumm_stricmp(filename2, _sequenceList[i]))
+			if (!scumm_stricmp(videoName, _sequenceList[i]))
 				_sequenceNum = i;
 		}
 	}
@@ -155,7 +167,7 @@
 }
 
 void MoviePlayer::play() {
-	if (_vm->getBitFlag(40)) {
+	if (_vm->getPlatform() == Common::kPlatformWindows && _vm->getBitFlag(40)) {
 		playOmniTV();
 		return;
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list