[Scummvm-cvs-logs] SF.net SVN: scummvm: [23194] scummvm/trunk/engines/sword1

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Tue Jun 20 20:08:19 CEST 2006


Revision: 23194
Author:   eriktorbjorn
Date:     2006-06-20 11:08:03 -0700 (Tue, 20 Jun 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23194&view=rev

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/sword1/control.cpp
    scummvm/trunk/engines/sword1/sword1.cpp
Modified: scummvm/trunk/engines/sword1/control.cpp
===================================================================
--- scummvm/trunk/engines/sword1/control.cpp	2006-06-20 18:03:43 UTC (rev 23193)
+++ scummvm/trunk/engines/sword1/control.cpp	2006-06-20 18:08:03 UTC (rev 23194)
@@ -193,7 +193,6 @@
 	_system->setPalette(palOut, 0, 256);
 	free(palOut);
 
-	Common::File test;
 	char fName[10];
 	uint8 textA[50];
 	sprintf(fName, "cd%d.id", SwordEngine::_systemVars.currentCD);
@@ -209,15 +208,13 @@
 		}
 		delay(300);
 		if (_keyPressed) {
-			test.open(fName);
-			if (!test.isOpen()) {
+			if (!Common::File::exists(fName)) {
 				memset(_screenBuf, 0, 640 * 480);
 				renderText(_lStrings[STR_INCORRECT_CD], 320, 230, TEXT_CENTER);
 				_system->copyRectToScreen(_screenBuf, 640, 0, 0, 640, 480);
 				delay(2000);
 				refreshText = true;
 			} else {
-				test.close();
 				notAccepted = false;
 			}
 		}

Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp	2006-06-20 18:03:43 UTC (rev 23193)
+++ scummvm/trunk/engines/sword1/sword1.cpp	2006-06-20 18:08:03 UTC (rev 23194)
@@ -352,7 +352,6 @@
 }
 
 void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or what...
-	Common::File test;
 	bool fileExists[30];
 	bool isFullVersion = false; // default to demo version
 	bool missingTypes[8] = { false, false, false, false, false, false, false, false };
@@ -363,8 +362,7 @@
 
 	// check all files and look out if we can find a file that wouldn't exist if this was the demo version
 	for (int fcnt = 0; fcnt < ARRAYSIZE(_cdFileList); fcnt++) {
-		if (test.open(_cdFileList[fcnt].name)) {
-			test.close();
+		if (Common::File::exists(_cdFileList[fcnt].name)) {
 			fileExists[fcnt] = true;
 			flagsToBool(foundTypes, _cdFileList[fcnt].flags);
 			if (!(_cdFileList[fcnt].flags & FLAG_DEMO))
@@ -442,9 +440,8 @@
 	_systemVars.isDemo = (_features & GF_DEMO) != 0;
 	_systemVars.cutscenePackVersion = 0;
 #ifdef USE_MPEG2
-	if (test.open("intro.snd")) {
+	if (Common::File::exists("intro.snd")) {
 		_systemVars.cutscenePackVersion = 1;
-		test.close();
 	}
 #endif
 }


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