aboutsummaryrefslogtreecommitdiff
path: root/engines/sword1
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-06-20 18:08:03 +0000
committerTorbjörn Andersson2006-06-20 18:08:03 +0000
commit1569d5fadc511780cd24bd835fc8983a76a714ba (patch)
treef2696fa56025c7efab6b5d2b7c288cc1ee9aafe3 /engines/sword1
parenta7908a01bf75254c4c430457cf6647e68d8aa1c1 (diff)
downloadscummvm-rg350-1569d5fadc511780cd24bd835fc8983a76a714ba.tar.gz
scummvm-rg350-1569d5fadc511780cd24bd835fc8983a76a714ba.tar.bz2
scummvm-rg350-1569d5fadc511780cd24bd835fc8983a76a714ba.zip
Cleanup.
svn-id: r23194
Diffstat (limited to 'engines/sword1')
-rw-r--r--engines/sword1/control.cpp5
-rw-r--r--engines/sword1/sword1.cpp7
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
}