diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/decompressor.h | 1 | ||||
-rw-r--r-- | engines/sci/detection.cpp | 29 | ||||
-rw-r--r-- | engines/sci/detection_tables.h | 9 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 5 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 2 | ||||
-rw-r--r-- | engines/sci/parser/said.cpp | 1 | ||||
-rw-r--r-- | engines/sci/sound/drivers/cms.cpp | 1 |
10 files changed, 27 insertions, 31 deletions
diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h index 37a5b5d7cb..5753026709 100644 --- a/engines/sci/decompressor.h +++ b/engines/sci/decompressor.h @@ -197,4 +197,3 @@ protected: } // End of namespace Sci #endif // SCI_SCICORE_DECOMPRESSOR_H - diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 2285e512bd..33ca3a6c9c 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -285,7 +285,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = { * @param[in] gameFlags The game's flags, which are adjusted accordingly for demos * @return The equivalent ScummVM game id */ -Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, ResourceManager *resMan) { +Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, ResourceManager &resMan) { // Convert the id to lower case, so that we match all upper/lower case variants. sierraId.toLowercase(); @@ -301,7 +301,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R if (sierraId == "fp" || sierraId == "gk" || sierraId == "pq4") demoThreshold = 150; - Common::ScopedPtr<Common::List<ResourceId> > resources(resMan->listResources(kResourceTypeScript, -1)); + Common::ScopedPtr<Common::List<ResourceId> > resources(resMan.listResources(kResourceTypeScript, -1)); if (resources->size() < demoThreshold) { *gameFlags |= ADGF_DEMO; @@ -337,7 +337,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R // This could either be qfg1 VGA, qfg3 or qfg4 demo (all SCI1.1), // or qfg4 full (SCI2) // qfg1 VGA doesn't have view 1 - if (!resMan->testResource(ResourceId(kResourceTypeView, 1))) + if (!resMan.testResource(ResourceId(kResourceTypeView, 1))) return "qfg1vga"; // qfg4 full is SCI2 @@ -480,10 +480,9 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, return 0; } - Common::ScopedPtr<ResourceManager> resMan(new ResourceManager()); - assert(resMan); - resMan->addAppropriateSources(fslist); - resMan->init(true); + ResourceManager resMan; + resMan.addAppropriateSources(fslist); + resMan.init(true); // TODO: Add error handling. #ifndef ENABLE_SCI32 @@ -494,7 +493,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, } #endif - ViewType gameViews = resMan->getViewType(); + ViewType gameViews = resMan.getViewType(); // Have we identified the game views? If not, stop here // Can't be SCI (or unsupported SCI views). Pinball Creep by sierra also uses resource.map/resource.000 files @@ -508,7 +507,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, s_fallbackDesc.platform = Common::kPlatformAmiga; // Determine the game id - Common::String sierraGameId = resMan->findSierraGameId(); + Common::String sierraGameId = resMan.findSierraGameId(); // If we don't have a game id, the game is not SCI if (sierraGameId.empty()) { @@ -530,7 +529,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, // As far as we know, these games store the messages of each language in separate // resources, and it's not possible to detect that easily // Also look for "%J" which is used in japanese games - Resource *text = resMan->findResource(ResourceId(kResourceTypeText, 0), 0); + Resource *text = resMan.findResource(ResourceId(kResourceTypeText, 0), 0); uint seeker = 0; if (text) { while (seeker < text->size) { @@ -588,7 +587,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles, s_fallbackDesc.extra = "CD"; } - return (const ADGameDescription *)&s_fallbackDesc; + return &s_fallbackDesc; } bool SciMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { @@ -677,13 +676,7 @@ SaveStateDescriptor SciMetaEngine::querySaveMetaInfos(const char *target, int sl SaveStateDescriptor desc(slot, meta.name); - Graphics::Surface *thumbnail = new Graphics::Surface(); - assert(thumbnail); - if (!Graphics::loadThumbnail(*in, *thumbnail)) { - delete thumbnail; - thumbnail = 0; - } - + Graphics::Surface *const thumbnail = Graphics::loadThumbnail(*in); desc.setThumbnail(thumbnail); desc.setDeletableFlag(true); diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h index 6641f243e6..3b18a1f68d 100644 --- a/engines/sci/detection_tables.h +++ b/engines/sci/detection_tables.h @@ -3150,6 +3150,15 @@ static const struct ADGameDescription SciGameDescriptions[] = { AD_LISTEND}, Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + + // Slater & Charlie Go Camping - English DOS/Windows (Sierra Originals) + {"slater", "", { + {"resource.000", 0, "d7b4cc8e2c0b3a4768f8dfb5de27f206", 2256126}, + {"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044}, + {"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132}, + AD_LISTEND}, + Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH }, + // Space Quest 1 VGA Remake - English Amiga (from www.back2roots.org) // SCI interpreter version 1.000.510 (just a guess) {"sq1sci", "SCI", { diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 7b8db22e3f..b383f88840 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -336,8 +336,9 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { if (align >= 0) while (str_leng-- > 1) *target++ = ' '; /* Format into the text */ - - *target++ = arguments[paramindex++]; + char argchar = arguments[paramindex++]; + if (argchar) + *target++ = argchar; mode = 0; } break; diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index ab67da32db..1510af8508 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -28,12 +28,6 @@ namespace Sci { -enum { - DEFAULT_SCRIPTS = 32, - DEFAULT_OBJECTS = 8, ///< default number of objects per script - DEFAULT_OBJECTS_INCREMENT = 4 ///< Number of additional objects to instantiate if we're running out of them -}; - SegManager::SegManager(ResourceManager *resMan) { _heap.push_back(0); diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp index e61da20f97..b2cde47f4a 100644 --- a/engines/sci/engine/workarounds.cpp +++ b/engines/sci/engine/workarounds.cpp @@ -283,6 +283,8 @@ const SciWorkaroundEntry kGraphSaveBox_workarounds[] = { // gameID, room,script,lvl, object-name, method-name, call,index, workaround const SciWorkaroundEntry kGraphRestoreBox_workarounds[] = { + { GID_LSL6, -1, 86, 0, "LL6Inv", "show", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // happens when restoring, is called with hunk segment, but hunk is not allocated at that time + // ^^ TODO: check, if this is really a script error or an issue with our restore code { GID_LSL6, -1, 86, 0, "LL6Inv", "hide", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // happens during the game, gets called with 1 extra parameter { GID_SQ5, 850, 850, 0, NULL, "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // happens while playing Battle Cruiser (invalid segment) - bug #3056811 SCI_WORKAROUNDENTRY_TERMINATOR diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index c5a3545701..38919593b4 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -683,7 +683,7 @@ bool GfxPalette::palVaryLoadTargetPalette(GuiResourceId resourceId) { void GfxPalette::palVaryInstallTimer() { int16 ticks = _palVaryTicks > 0 ? _palVaryTicks : 1; // Call signal increase every [ticks] - g_sci->getTimerManager()->installTimerProc(&palVaryCallback, 1000000 / 60 * ticks, this); + g_sci->getTimerManager()->installTimerProc(&palVaryCallback, 1000000 / 60 * ticks, this, "sciPalette"); } void GfxPalette::palVaryRemoveTimer() { diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index dbe2135143..6469bc0cb3 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -20,9 +20,9 @@ * */ -#include "common/timer.h" #include "common/util.h" #include "common/system.h" +#include "common/timer.h" #include "graphics/surface.h" #include "engines/util.h" diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp index 01c25ef401..d44109faec 100644 --- a/engines/sci/parser/said.cpp +++ b/engines/sci/parser/said.cpp @@ -1147,4 +1147,3 @@ True } // End of namespace Sci - diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index ace96ba499..dbcbf3d431 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -813,4 +813,3 @@ MidiPlayer *MidiPlayer_CMS_create(SciVersion version) { } } // End of namespace SCI - |