diff options
author | Filippos Karapetis | 2009-07-16 08:13:08 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-16 08:13:08 +0000 |
commit | 00dbbedbad2c3d58f972733a4f0d46935c32887a (patch) | |
tree | 497fb4ed0ee0b63b4e2d5d608f48429ae94af3b1 /engines | |
parent | b04e3e79406031001cd80b40fb21b8f2ca0c5af8 (diff) | |
download | scummvm-rg350-00dbbedbad2c3d58f972733a4f0d46935c32887a.tar.gz scummvm-rg350-00dbbedbad2c3d58f972733a4f0d46935c32887a.tar.bz2 scummvm-rg350-00dbbedbad2c3d58f972733a4f0d46935c32887a.zip |
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
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/detection.cpp | 9 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_resmgr.h | 8 | ||||
-rw-r--r-- | engines/sci/gfx/gfx_system.h | 2 | ||||
-rw-r--r-- | engines/sci/gfx/operations.cpp | 7 |
5 files changed, 22 insertions, 6 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 566d82405a..ad62181458 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -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", { diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index 4a3c79feef..bf1c88b4d6 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -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 diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h index fc4e0b3d6f..5cd5d018cc 100644 --- a/engines/sci/gfx/gfx_resmgr.h +++ b/engines/sci/gfx/gfx_resmgr.h @@ -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; diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h index 855f9b196e..20c92efa2d 100644 --- a/engines/sci/gfx/gfx_system.h +++ b/engines/sci/gfx/gfx_system.h @@ -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; /* @} */ diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 2c536912b3..9b2c3dc7f5 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -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 .) - 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) |