aboutsummaryrefslogtreecommitdiff
path: root/scumm/resource.cpp
diff options
context:
space:
mode:
authorPaweł Kołodziejski2002-09-15 19:28:34 +0000
committerPaweł Kołodziejski2002-09-15 19:28:34 +0000
commitf7ff5c67fada77c23dd870f4da4ef7dae3b47e94 (patch)
tree2d2311161f22a9f9694ca1ac2a0cef6739a9d19f /scumm/resource.cpp
parent37d7a52c47e59f7c348154c88d5a2410c0e84aab (diff)
downloadscummvm-rg350-f7ff5c67fada77c23dd870f4da4ef7dae3b47e94.tar.gz
scummvm-rg350-f7ff5c67fada77c23dd870f4da4ef7dae3b47e94.tar.bz2
scummvm-rg350-f7ff5c67fada77c23dd870f4da4ef7dae3b47e94.zip
improved open function in File class
svn-id: r4945
Diffstat (limited to 'scumm/resource.cpp')
-rw-r--r--scumm/resource.cpp33
1 files changed, 7 insertions, 26 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 1792e90121..cfbf4e7283 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -73,16 +73,16 @@ void Scumm::openRoom(int room)
if (!(_features & GF_SMALL_HEADER)) {
if (_features & GF_AFTER_V7)
- sprintf(buf, "%s%s.la%d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ sprintf(buf, "%s.la%d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
else if (_features & GF_HUMONGOUS)
- sprintf(buf, "%s%s.he%.1d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ sprintf(buf, "%s.he%.1d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
else
- sprintf(buf, "%s%s.%.3d", _gameDataPath, _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
+ sprintf(buf, "%s.%.3d", _exe_name, room == 0 ? 0 : res.roomno[rtRoom][room]);
_encbyte = (_features & GF_USE_KEY) ? 0x69 : 0;
} else if (!(_features & GF_SMALL_NAMES)) {
if (room == 0 || room >= 900) {
- sprintf(buf, "%s%.3d.lfl", _gameDataPath, room);
+ sprintf(buf, "%.3d.lfl", room);
_encbyte = 0;
if (openResourceFile(buf)) {
return;
@@ -90,11 +90,11 @@ void Scumm::openRoom(int room)
askForDisk(buf);
} else {
- sprintf(buf, "%sdisk%.2d.lec", _gameDataPath, res.roomno[rtRoom][room]);
+ sprintf(buf, "disk%.2d.lec", res.roomno[rtRoom][room]);
_encbyte = 0x69;
}
} else {
- sprintf(buf, "%s%.2d.lfl", _gameDataPath, room);
+ sprintf(buf, "%.2d.lfl", room);
if (_features & GF_OLD_BUNDLE)
_encbyte = 0xFF;
else
@@ -186,26 +186,7 @@ bool Scumm::openResourceFile(const char *filename)
}
strcpy(buf, filename);
- _fileHandle.open(buf, 1, _encbyte);
- if (_fileHandle.isOpen() == false) {
- char *e = strrchr(buf, '/');
- if (!e)
- e = buf;
- do
- *e = tolower(*e);
- while (*e++);
- _fileHandle.open(buf, 1, _encbyte);
- }
-
- if (_fileHandle.isOpen() == false) {
- char *e = strrchr(buf, '/');
- if (!e)
- e = buf;
- do
- *e = toupper(*e);
- while (*e++);
- _fileHandle.open(buf, 1, _encbyte);
- }
+ _fileHandle.open(buf, getGameDataPath(), 1, _encbyte);
return _fileHandle.isOpen();
}