From 1569d5fadc511780cd24bd835fc8983a76a714ba Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 20 Jun 2006 18:08:03 +0000 Subject: Cleanup. svn-id: r23194 --- engines/sword1/control.cpp | 5 +---- engines/sword1/sword1.cpp | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index c5cb0ec4cd..b8d89ab3d2 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -193,7 +193,6 @@ void Control::askForCd(void) { _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 @@ void Control::askForCd(void) { } 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; } } diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index e57cadcff3..11053ad4e3 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -352,7 +352,6 @@ void SwordEngine::showFileErrorMsg(uint8 type, bool *fileExists) { } 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 @@ void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or // 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 @@ void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or _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 } -- cgit v1.2.3