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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Oct 22 22:08:33 CEST 2006


Revision: 24461
          http://svn.sourceforge.net/scummvm/?rev=24461&view=rev
Author:   lordhoto
Date:     2006-10-22 13:08:23 -0700 (Sun, 22 Oct 2006)

Log Message:
-----------
Some AMIGA resource loading code (of course it's still not supported).

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

Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp	2006-10-22 20:06:52 UTC (rev 24460)
+++ scummvm/trunk/engines/kyra/plugin.cpp	2006-10-22 20:08:23 UTC (rev 24461)
@@ -316,6 +316,11 @@
 	// because of limitations of the current detector code
 	if (Common::parsePlatform(ConfMan.get("platform")) == Common::kPlatformMacintosh) {
 		_flags.platform = Common::kPlatformMacintosh;
+	} else if (Common::parsePlatform(ConfMan.get("platform")) == Common::kPlatformAmiga) {
+		// it is possible to detect if the game is an amiga version, but since it's
+		// horrible broken at the time of adding this, we just set the amiga platform
+		// if the user want's to crash it's ScummVM
+		_flags.platform = Common::kPlatformAmiga;
 	}
 
 	return 0;

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2006-10-22 20:06:52 UTC (rev 24460)
+++ scummvm/trunk/engines/kyra/resource.cpp	2006-10-22 20:08:23 UTC (rev 24461)
@@ -40,7 +40,7 @@
 
 	if (_engine->game() == GI_KYRA1) {
 		// we're loading KYRA.DAT here too (but just for Kyrandia 1)
-		if (!loadPakFile("KYRA.DAT") || !StaticResource::checkKyraDat()) {
+		if (!loadPakFile("KYRA.DAT", true) || !StaticResource::checkKyraDat()) {
 			GUI::MessageDialog errorMsg("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website");
 			errorMsg.runModal();
 			error("You're missing the 'KYRA.DAT' file or it got corrupted, (re)get it from the ScummVM website");
@@ -102,7 +102,7 @@
 	}
 }
 
-bool Resource::loadPakFile(const Common::String &filename) {
+bool Resource::loadPakFile(const Common::String &filename, const bool forcePC) {
 	Common::List<ResourceFile*>::iterator start = _pakfiles.begin();
 	uint hash = Common::hashit_lower(filename.c_str());
 	for (;start != _pakfiles.end(); ++start) {
@@ -122,7 +122,7 @@
 
 	PAKFile *file = 0;
 
-	file = new PAKFile(filename.c_str(), handle.name(), handle, (_engine->gameFlags().platform == Common::kPlatformAmiga));
+	file = new PAKFile(filename.c_str(), handle.name(), handle, (_engine->gameFlags().platform == Common::kPlatformAmiga) && !forcePC);
 	handle.close();
 
 	if (!file)

Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h	2006-10-22 20:06:52 UTC (rev 24460)
+++ scummvm/trunk/engines/kyra/resource.h	2006-10-22 20:08:23 UTC (rev 24461)
@@ -105,7 +105,7 @@
 	Resource(KyraEngine *engine);
 	~Resource();
 	
-	bool loadPakFile(const Common::String &filename);
+	bool loadPakFile(const Common::String &filename, const bool forcePC = false);
 	void unloadPakFile(const Common::String &filename);
 	bool isInPakList(const Common::String &filename);
 


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