[Scummvm-cvs-logs] SF.net SVN: scummvm: [22272] scummvm/trunk/engines/sky

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon May 1 15:29:01 CEST 2006


Revision: 22272
Author:   fingolfin
Date:     2006-05-01 15:27:56 -0700 (Mon, 01 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22272&view=rev

Log Message:
-----------
It's wrong to assume a given file is located in gameDataPath, so do not use that to print out warnings that pretend otherwise

Modified Paths:
--------------
    scummvm/trunk/engines/lure/disk.cpp
    scummvm/trunk/engines/lure/disk.h
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/sky/disk.cpp
    scummvm/trunk/engines/sky/disk.h
    scummvm/trunk/engines/sky/sky.cpp
Modified: scummvm/trunk/engines/lure/disk.cpp
===================================================================
--- scummvm/trunk/engines/lure/disk.cpp	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/lure/disk.cpp	2006-05-01 22:27:56 UTC (rev 22272)
@@ -37,8 +37,7 @@
 	return *int_disk;
 }
 
-Disk::Disk(const Common::String &gameDataPath) {
-	_gameDataPath = gameDataPath;
+Disk::Disk() {
 	_fileNum = 0xff;
 	_fileHandle = NULL;
 	int_disk = this;
@@ -63,7 +62,7 @@
 	}
 	
 	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 @@
 
 	_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 @@
 	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

Modified: scummvm/trunk/engines/lure/disk.h
===================================================================
--- scummvm/trunk/engines/lure/disk.h	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/lure/disk.h	2006-05-01 22:27:56 UTC (rev 22272)
@@ -41,14 +41,13 @@
 
 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();
 

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/lure/lure.cpp	2006-05-01 22:27:56 UTC (rev 22272)
@@ -262,7 +262,7 @@
 	detectGame();
 
 	_sys = new System(_system);
-	_disk = new Disk(_gameDataPath);
+	_disk = new Disk();
 	_resources = new Resources();
 	_strings = new StringData();
 	_screen = new Screen(*_system);

Modified: scummvm/trunk/engines/sky/disk.cpp
===================================================================
--- scummvm/trunk/engines/sky/disk.cpp	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/sky/disk.cpp	2006-05-01 22:27:56 UTC (rev 22272)
@@ -35,13 +35,13 @@
 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 @@
 
 	_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);
 

Modified: scummvm/trunk/engines/sky/disk.h
===================================================================
--- scummvm/trunk/engines/sky/disk.h	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/sky/disk.h	2006-05-01 22:27:56 UTC (rev 22272)
@@ -38,7 +38,7 @@
 
 class Disk {
 public:
-	Disk(const Common::String &gameDataPath);
+	Disk();
 	~Disk(void);
 
 	uint8 *loadFile(uint16 fileNr);

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2006-05-01 22:18:14 UTC (rev 22271)
+++ scummvm/trunk/engines/sky/sky.cpp	2006-05-01 22:27:56 UTC (rev 22272)
@@ -323,7 +323,7 @@
 	 _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();


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