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

svn-id: r42523
This commit is contained in:
Filippos Karapetis 2009-07-16 08:13:08 +00:00
parent b04e3e7940
commit 00dbbedbad
5 changed files with 22 additions and 6 deletions

View file

@ -2203,6 +2203,15 @@ static const struct SciGameDescription SciGameDescriptions[] = {
},
#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", {

View file

@ -340,7 +340,7 @@ gfxr_pic_t *GfxResManager::getPic(int num, int maps, int flags, int default_pale
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

View file

@ -270,8 +270,7 @@ public:
/**
* 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 @@ public:
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;

View file

@ -189,7 +189,7 @@ struct gfx_pixmap_t {
* 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;
/* @} */

View file

@ -1712,8 +1712,11 @@ static int _gfxop_set_pic(GfxState *state) {
// 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 .)
// 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)