[Scummvm-cvs-logs] SF.net SVN: scummvm: [30200] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Jan 3 15:53:19 CET 2008


Revision: 30200
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30200&view=rev
Author:   lordhoto
Date:     2008-01-03 06:53:18 -0800 (Thu, 03 Jan 2008)

Log Message:
-----------
- got rid of hardcoding "KYRA.DAT" in all places, where it's used
- now using "kyra.dat" rather than "KYRA.DAT"

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.cpp
    scummvm/trunk/engines/kyra/resource.h
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2008-01-03 14:51:50 UTC (rev 30199)
+++ scummvm/trunk/engines/kyra/resource.cpp	2008-01-03 14:53:18 UTC (rev 30200)
@@ -69,10 +69,11 @@
 
 	if (_vm->game() == GI_KYRA1) {
 		// we're loading KYRA.DAT here too (but just for Kyrandia 1)
-		if (!loadPakFile("KYRA.DAT") || !StaticResource::checkKyraDat()) {
-			GUI::MessageDialog errorMsg("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website");
+		if (!loadPakFile(StaticResource::_staticDataFile) || !StaticResource::checkKyraDat()) {
+			Common::String errorMessage = "You're missing the '" + StaticResource::_staticDataFile + "' file or it got corrupted, (re)get it from the ScummVM website";
+			GUI::MessageDialog errorMsg(errorMessage);
 			errorMsg.runModal();
-			error("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website");
+			error(errorMessage.c_str());
 		}
 
 		// We only need kyra.dat for the demo.
@@ -144,7 +145,7 @@
 		return true;
 	}
 
-	const bool isKyraDat = filename.equalsIgnoreCase("KYRA.DAT");
+	const bool isKyraDat = filename.equalsIgnoreCase(StaticResource::_staticDataFile);
 	uint32 size = 0;
 
 	Common::File handle;

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2008-01-03 14:51:50 UTC (rev 30199)
+++ scummvm/trunk/engines/kyra/resource.h	2008-01-03 14:53:18 UTC (rev 30200)
@@ -226,6 +226,8 @@
 
 class StaticResource {
 public:
+	static const Common::String _staticDataFile;
+
 	StaticResource(KyraEngine *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {}
 	~StaticResource() { deinit(); }
 

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-01-03 14:51:50 UTC (rev 30199)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-01-03 14:53:18 UTC (rev 30200)
@@ -39,7 +39,7 @@
 
 bool StaticResource::checkKyraDat() {
 	Common::File kyraDat;
-	if (!kyraDat.open("KYRA.DAT"))
+	if (!kyraDat.open(StaticResource::_staticDataFile))
 		return false;
 
 	uint32 size = kyraDat.size() - 16;
@@ -50,7 +50,7 @@
 	kyraDat.close();
 
 	uint8 digestCalc[16];
-	if (!Common::md5_file("KYRA.DAT", digestCalc, size))
+	if (!Common::md5_file(StaticResource::_staticDataFile.c_str(), digestCalc, size))
 		return false;
 
 	for (int i = 0; i < 16; ++i)
@@ -854,6 +854,8 @@
 	_screen->copyRegion(0, 0, 0, 0, 320, 200, page, 0);
 }
 
+const Common::String StaticResource::_staticDataFile = "kyra.dat";
+
 const ScreenDim Screen::_screenDimTable[] = {
 	{ 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 },
 	{ 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 },


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