[Scummvm-cvs-logs] SF.net SVN: scummvm:[42219] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Jul 7 15:39:24 CEST 2009


Revision: 42219
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42219&view=rev
Author:   thebluegr
Date:     2009-07-07 13:39:24 +0000 (Tue, 07 Jul 2009)

Log Message:
-----------
Removed the weird checks for a maximum resource number (the sci_max_resource_nr array), as it doesn't serve any real purpose and leads to strange errors: if a resource is found which is bigger than the maximum number, it will be remapped to an incorrect number from this check. This makes KQ5CD work properly again (resources would be remapped to incorrect resource numbers from this code as a result of not updating this array with the latest SCI version merges).

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/resource.h

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-07-07 13:16:23 UTC (rev 42218)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-07-07 13:39:24 UTC (rev 42219)
@@ -95,7 +95,7 @@
 	font_nr = -1;
 	do {
 		resource = s->resmgr->testResource(ResourceId(kResourceTypeFont, ++font_nr));
-	} while ((!resource) && (font_nr < sci_max_resource_nr[s->resmgr->_sciVersion]));
+	} while ((!resource) && (font_nr < 65536));
 
 	if (!resource) {
 		debug(2, "No text font was found.");

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-07-07 13:16:23 UTC (rev 42218)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-07-07 13:39:24 UTC (rev 42219)
@@ -42,8 +42,6 @@
 
 //#define SCI_VERBOSE_RESMGR 1
 
-const int sci_max_resource_nr[] = {65536, 1000, 2048, 2048, 2048, 65536, 65536, 65536};
-
 static const char *sci_error_types[] = {
 	"No error",
 	"I/O error",
@@ -649,17 +647,8 @@
 }
 
 Resource *ResourceManager::findResource(ResourceId id, bool lock) {
-	Resource *retval;
+	Resource *retval = testResource(id);
 
-	if (id.number >= sci_max_resource_nr[_sciVersion]) {
-		ResourceId moddedId = ResourceId(id.type, id.number % sci_max_resource_nr[_sciVersion], id.tuple);
-		warning("[resmgr] Requested invalid resource %s, mapped to %s",
-		          id.toString().c_str(), moddedId.toString().c_str());
-		id = moddedId;
-	}
-
-	retval = testResource(id);
-
 	if (!retval)
 		return NULL;
 

Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h	2009-07-07 13:16:23 UTC (rev 42218)
+++ scummvm/trunk/engines/sci/resource.h	2009-07-07 13:39:24 UTC (rev 42219)
@@ -82,8 +82,6 @@
 #define SCI1_RESMAP_ENTRIES_SIZE 6
 #define SCI11_RESMAP_ENTRIES_SIZE 5
 
-extern const int sci_max_resource_nr[]; /**< Highest possible resource numbers */
-
 enum ResourceType {
 	kResourceTypeView = 0,
 	kResourceTypePic,


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