aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-05-01 22:27:56 +0000
committerMax Horn2006-05-01 22:27:56 +0000
commit84b2a4f76fed5848b8a4ff49fd2fcfd9604a0c92 (patch)
tree1b78cfc1ea03c9ad8ac00c6a21a6b2454d320105
parentdbe1c50bc9ce6e54115b7784585310ebb5433985 (diff)
downloadscummvm-rg350-84b2a4f76fed5848b8a4ff49fd2fcfd9604a0c92.tar.gz
scummvm-rg350-84b2a4f76fed5848b8a4ff49fd2fcfd9604a0c92.tar.bz2
scummvm-rg350-84b2a4f76fed5848b8a4ff49fd2fcfd9604a0c92.zip
It's wrong to assume a given file is located in gameDataPath, so do not use that to print out warnings that pretend otherwise
svn-id: r22272
-rw-r--r--engines/lure/disk.cpp13
-rw-r--r--engines/lure/disk.h3
-rw-r--r--engines/lure/lure.cpp2
-rw-r--r--engines/sky/disk.cpp6
-rw-r--r--engines/sky/disk.h2
-rw-r--r--engines/sky/sky.cpp2
6 files changed, 13 insertions, 15 deletions
diff --git a/engines/lure/disk.cpp b/engines/lure/disk.cpp
index 9638957443..33f1679c6e 100644
--- a/engines/lure/disk.cpp
+++ b/engines/lure/disk.cpp
@@ -37,8 +37,7 @@ Disk &Disk::getReference() {
return *int_disk;
}
-Disk::Disk(const Common::String &gameDataPath) {
- _gameDataPath = gameDataPath;
+Disk::Disk() {
_fileNum = 0xff;
_fileHandle = NULL;
int_disk = this;
@@ -63,7 +62,7 @@ uint8 Disk::indexOf(uint16 id, bool suppressError) {
}
if (suppressError) return 0xff;
- error("Could not find entry Id #%d in file %sdisk%d.vga", id, _gameDataPath.c_str(), _fileNum);
+ error("Could not find entry Id #%d in file disk%d.vga", id, _fileNum);
}
void Disk::openFile(uint8 fileNum) {
@@ -89,7 +88,7 @@ void Disk::openFile(uint8 fileNum) {
_fileHandle->open(sFilename);
if (!_fileHandle->isOpen())
- error("Could not open %s%s", _gameDataPath.c_str(), sFilename);
+ error("Could not open %s", sFilename);
// Validate the header
char buffer[7];
@@ -98,16 +97,16 @@ void Disk::openFile(uint8 fileNum) {
bytesRead = _fileHandle->read(buffer, 6);
buffer[6] = '\0';
if (strcmp(buffer, HEADER_IDENT_STRING) != 0)
- error("The file %s%s was not a valid VGA file", _gameDataPath.c_str(), sFilename);
+ error("The file %s was not a valid VGA file", sFilename);
uint16 fileFileNum = _fileHandle->readUint16BE();
if (fileFileNum != _fileNum)
- error("The file %s%s was not the correct file number", _gameDataPath.c_str(), sFilename);
+ error("The file %s was not the correct file number", sFilename);
// Read in the header entries
uint32 headerSize = sizeof(FileEntry) * NUM_ENTRIES_IN_HEADER;
if (_fileHandle->read(_entries, headerSize) != headerSize)
- error("The file %s%s had a corrupted header", _gameDataPath.c_str(), sFilename);
+ error("The file %s had a corrupted header", sFilename);
#ifdef SCUMM_BIG_ENDIAN
// Process the read in header list to convert to big endian
diff --git a/engines/lure/disk.h b/engines/lure/disk.h
index 9ce1c977ae..b7504a2b52 100644
--- a/engines/lure/disk.h
+++ b/engines/lure/disk.h
@@ -41,14 +41,13 @@ namespace Lure {
class Disk {
private:
- Common::String _gameDataPath;
uint8 _fileNum;
Common::File *_fileHandle;
FileEntry _entries[NUM_ENTRIES_IN_HEADER];
uint8 indexOf(uint16 id, bool suppressError = false);
public:
- Disk(const Common::String &gameDataPath);
+ Disk();
~Disk();
static Disk &getReference();
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index dab02a5ca3..d60bf8b978 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -262,7 +262,7 @@ int LureEngine::init() {
detectGame();
_sys = new System(_system);
- _disk = new Disk(_gameDataPath);
+ _disk = new Disk();
_resources = new Resources();
_strings = new StringData();
_screen = new Screen(*_system);
diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp
index 0a543ecb3b..8e0779ef55 100644
--- a/engines/sky/disk.cpp
+++ b/engines/sky/disk.cpp
@@ -35,13 +35,13 @@ namespace Sky {
static const char *dataFilename = "sky.dsk";
static const char *dinnerFilename = "sky.dnr";
-Disk::Disk(const Common::String &gameDataPath) {
+Disk::Disk() {
_dataDiskHandle = new Common::File();
_dnrHandle = new Common::File();
_dnrHandle->open(dinnerFilename);
if (!_dnrHandle->isOpen())
- error("Could not open %s%s", gameDataPath.c_str(), dinnerFilename);
+ error("Could not open %s", dinnerFilename);
if (!(_dinnerTableEntries = _dnrHandle->readUint32LE()))
error("Error reading from sky.dnr"); //even though it was opened correctly?!
@@ -54,7 +54,7 @@ Disk::Disk(const Common::String &gameDataPath) {
_dataDiskHandle->open(dataFilename);
if (!_dataDiskHandle->isOpen())
- error("Error opening %s%s", gameDataPath.c_str(), dataFilename);
+ error("Error opening %s", dataFilename);
printf("Found BASS version v0.0%d (%d dnr entries)\n", determineGameVersion(), _dinnerTableEntries);
diff --git a/engines/sky/disk.h b/engines/sky/disk.h
index 4d2fe4c294..91d69c49d8 100644
--- a/engines/sky/disk.h
+++ b/engines/sky/disk.h
@@ -38,7 +38,7 @@ namespace Sky {
class Disk {
public:
- Disk(const Common::String &gameDataPath);
+ Disk();
~Disk(void);
uint8 *loadFile(uint16 fileNr);
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 941f9df017..7c260445c5 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -323,7 +323,7 @@ int SkyEngine::init() {
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_floppyIntro = ConfMan.getBool("alt_intro");
- _skyDisk = new Disk(_gameDataPath);
+ _skyDisk = new Disk();
_skySound = new Sound(_mixer, _skyDisk, ConfMan.getInt("sfx_volume"));
_systemVars.gameVersion = _skyDisk->determineGameVersion();