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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Jul 16 10:13:08 CEST 2009


Revision: 42523
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42523&view=rev
Author:   thebluegr
Date:     2009-07-16 08:13:08 +0000 (Thu, 16 Jul 2009)

Log Message:
-----------
Added a detection entry for Pepper's Adventures in Time, and fixed an issue with _gfxop_set_pic(), which was causing crashes in that game

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
    scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
    scummvm/trunk/engines/sci/gfx/gfx_system.h
    scummvm/trunk/engines/sci/gfx/operations.cpp

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2009-07-16 04:06:35 UTC (rev 42522)
+++ scummvm/trunk/engines/sci/detection.cpp	2009-07-16 08:13:08 UTC (rev 42523)
@@ -2203,6 +2203,15 @@
 	},
 #endif // ENABLE_SCI32
 
+	{{"pepper", "", {
+		{"resource.map", 0, "72726dc81c1b4c1110c486be77369bc8", 5179},
+		{"resource.000", 0, "670d0c53622429f4b11275caf7f8d292", 5459574},
+		{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH},
+		0,
+		SCI_VERSION_AUTODETECT,
+		SCI_VERSION_1_1
+	},
+
 	// Pepper - English DOS Non-Interactive Demo
 	// Executable scanning reports "1.001.060", VERSION file reports "1.000"
 	{{"pepper", "Demo", {

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-16 04:06:35 UTC (rev 42522)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.cpp	2009-07-16 08:13:08 UTC (rev 42523)
@@ -340,7 +340,7 @@
 	res = resMap.contains(num) ? resMap[num] : NULL;
 
 	if (!res || res->mode != hash) {
-		gfxr_pic_t *pic;
+		gfxr_pic_t *pic = NULL;
 		gfxr_pic_t *unscaled_pic = NULL;
 
 #ifdef CUSTOM_GRAPHICS_OPTIONS

Modified: scummvm/trunk/engines/sci/gfx/gfx_resmgr.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_resmgr.h	2009-07-16 04:06:35 UTC (rev 42522)
+++ scummvm/trunk/engines/sci/gfx/gfx_resmgr.h	2009-07-16 08:13:08 UTC (rev 42523)
@@ -270,8 +270,7 @@
 	/**
 	 * Retrieves a color from the static palette
 	 */
-	const PaletteEntry &getColor(int color)
-	{
+	const PaletteEntry &getColor(int color) {
 		return _staticPalette->getColor(color);
 	}
 
@@ -313,6 +312,11 @@
 		return _staticPalette ? _staticPalette->size() : 0;
 	}
 
+	/**
+	 * Returns the resource version that the resource manager is using
+	 */
+	int getVersion() { return _version; }
+
 private:
 	int _version;
 	gfx_options_t *_options;

Modified: scummvm/trunk/engines/sci/gfx/gfx_system.h
===================================================================
--- scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-07-16 04:06:35 UTC (rev 42522)
+++ scummvm/trunk/engines/sci/gfx/gfx_system.h	2009-07-16 08:13:08 UTC (rev 42523)
@@ -189,7 +189,7 @@
 	 * As a special exception, 256 colors are allowed for background pictures
 	 * (which do not use transparency)
 	 */
-	int colors_nr() const { return palette ? palette->size() : 0; }
+	int colors_nr() const { return palette ? MIN<int>(palette->size(), 256) : 0; }
 
 	uint32 flags;
 	/* @} */

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-07-16 04:06:35 UTC (rev 42522)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-07-16 08:13:08 UTC (rev 42523)
@@ -1712,8 +1712,11 @@
 	// FIXME: The _gfxop_install_pixmap call below updates the OSystem palette.
 	// This is too soon, since it causes brief palette corruption until the
 	// screen is updated too. (Possibly related: EngineState::pic_not_valid .)
-	state->pic->visual_map->palette->forceInto(state->driver->getMode()->palette);
-	_gfxop_install_pixmap(state->driver, state->pic->visual_map);
+	// SCI1.1 games don't use per-picture palettes
+	if (state->gfxResMan->getVersion() < SCI_VERSION_1_1) {
+		state->pic->visual_map->palette->forceInto(state->driver->getMode()->palette);
+		_gfxop_install_pixmap(state->driver, state->pic->visual_map);
+	}
 
 #ifdef CUSTOM_GRAPHICS_OPTIONS
 	if (state->options->pic0_unscaled)


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