From 9b8665fa85ae2a65d448ad9dba06dd27455f48d1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 13 Aug 2008 10:13:22 +0000 Subject: Clarify SCUMM MD5 message: We do not want reports on fanmade translations svn-id: r33817 --- engines/scumm/detection.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 68d3010199..ca5dba7865 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -820,9 +820,10 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons // unknown MD5, or with a medium debug level in case of a known MD5 (for // debugging purposes). if (!findInMD5Table(res.md5.c_str())) { - printf("Your game version appears to be unknown. Please, report the following\n"); - printf("data to the ScummVM team along with name of the game you tried to add\n"); - printf("and its version/language/etc.:\n"); + printf("Your game version appears to be unknown. If this is *NOT* a fan-modified\n"); + printf("version (in particular, not a fan-made translation), please, report the\n"); + printf("following data to the ScummVM team along with name of the game you tried\n"); + printf("to add and its version/language/etc.:\n"); printf(" SCUMM gameid '%s', file '%s', MD5 '%s'\n\n", res.game.gameid, -- cgit v1.2.3 From 5bc5855ae9148672b242bd99f3faf5e7ede93ac8 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Fri, 15 Aug 2008 07:10:23 +0000 Subject: Added some MetaEngineFeatures, defined MEFs for the Scumm engine svn-id: r33893 --- engines/scumm/detection.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 68d3010199..716a456c90 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -677,6 +677,7 @@ public: virtual GameList getSupportedGames() const; virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const FSList &fslist) const; + virtual bool hasFeature(MetaEngineFeature f); virtual PluginError createInstance(OSystem *syst, Engine **engine) const; @@ -691,6 +692,12 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } +bool ScummMetaEngine::hasFeature(MetaEngineFeature f) { + return + (f == kSupportsListSaves) || + (f == kSupportsDirectLoad) || + (f == kSupportsDeleteSave); +} GameList ScummMetaEngine::detectGames(const FSList &fslist) const { GameList detectedGames; -- cgit v1.2.3 From 9d3cdcb2da64ae3afdcd19f1ea18a917f9318190 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Fri, 15 Aug 2008 18:15:14 +0000 Subject: Defined some MetaEngineFeatures for the engines, the launcher uses these features to allow/disallow loading and deleting saves svn-id: r33909 --- engines/scumm/detection.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 716a456c90..8d93b04a14 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -674,16 +674,23 @@ public: virtual const char *getName() const; virtual const char *getCopyright() const; + virtual bool hasFeature(MetaEngineFeature f) const; virtual GameList getSupportedGames() const; virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const FSList &fslist) const; - virtual bool hasFeature(MetaEngineFeature f); - + virtual PluginError createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; }; +bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { + return + (f == kSupportsListSaves) || + (f == kSupportsDirectLoad) || + (f == kSupportsDeleteSave); +} + GameList ScummMetaEngine::getSupportedGames() const { return GameList(gameDescriptions); } @@ -692,13 +699,6 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } -bool ScummMetaEngine::hasFeature(MetaEngineFeature f) { - return - (f == kSupportsListSaves) || - (f == kSupportsDirectLoad) || - (f == kSupportsDeleteSave); -} - GameList ScummMetaEngine::detectGames(const FSList &fslist) const { GameList detectedGames; Common::List results; -- cgit v1.2.3 From ec8dac5540d87925525523eb1715abc1ec271261 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Sat, 16 Aug 2008 02:53:16 +0000 Subject: Added a MetaEngineFeature for RTL support, the RTL button is disabled in the GMM if the engine doesn't support it svn-id: r33921 --- engines/scumm/detection.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 8d93b04a14..0622e3c5fe 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -686,6 +686,7 @@ public: bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); -- cgit v1.2.3 From 531bcf847ceef2b9eca82e0b3ef8473612889632 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 3 Sep 2008 11:22:51 +0000 Subject: Moved FilesystemNode / FSList to namespace Common; also got rid of some 'typedef Common::String String;' name aliases svn-id: r34302 --- engines/scumm/detection.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 0cc0f3aa1c..2a6e0c0b10 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -177,7 +177,7 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename } struct DetectorDesc { - FilesystemNode node; + Common::FilesystemNode node; Common::String md5; const MD5Table *md5Entry; // Entry of the md5 table corresponding to this file, if any. }; @@ -191,8 +191,8 @@ static bool testGame(const GameSettings *g, const DescMap &fileMD5Map, const Com // when performing the matching. The first match is returned, so if you // search for "resource" and two nodes "RESOURE and "resource" are present, // the first match is used. -static bool searchFSNode(const FSList &fslist, const Common::String &name, FilesystemNode &result) { - for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { +static bool searchFSNode(const Common::FSList &fslist, const Common::String &name, Common::FilesystemNode &result) { + for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (!scumm_stricmp(file->getName().c_str(), name.c_str())) { result = *file; return true; @@ -202,7 +202,7 @@ static bool searchFSNode(const FSList &fslist, const Common::String &name, Files } // The following function tries to detect the language for COMI and DIG -static Common::Language detectLanguage(const FSList &fslist, byte id) { +static Common::Language detectLanguage(const Common::FSList &fslist, byte id) { assert(id == GID_CMI || id == GID_DIG); // Check for LANGUAGE.BND (Dig) resp. LANGUAGE.TAB (CMI). @@ -212,14 +212,14 @@ static Common::Language detectLanguage(const FSList &fslist, byte id) { // switch to MD5 based detection). const char *filename = (id == GID_CMI) ? "LANGUAGE.TAB" : "LANGUAGE.BND"; Common::File tmp; - FilesystemNode langFile; + Common::FilesystemNode langFile; if (!searchFSNode(fslist, filename, langFile) || !tmp.open(langFile)) { // try loading in RESOURCE sub dir... - FilesystemNode resDir; - FSList tmpList; + Common::FilesystemNode resDir; + Common::FSList tmpList; if (searchFSNode(fslist, "RESOURCE", resDir) && resDir.isDirectory() - && resDir.getChildren(tmpList, FilesystemNode::kListFilesOnly) + && resDir.getChildren(tmpList, Common::FilesystemNode::kListFilesOnly) && searchFSNode(tmpList, filename, langFile)) { tmp.open(langFile); } @@ -270,7 +270,7 @@ static Common::Language detectLanguage(const FSList &fslist, byte id) { } -static void computeGameSettingsFromMD5(const FSList &fslist, const GameFilenamePattern *gfp, const MD5Table *md5Entry, DetectorResult &dr) { +static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameFilenamePattern *gfp, const MD5Table *md5Entry, DetectorResult &dr) { dr.language = md5Entry->language; dr.extra = md5Entry->extra; @@ -315,12 +315,12 @@ static void computeGameSettingsFromMD5(const FSList &fslist, const GameFilenameP } } -static void detectGames(const FSList &fslist, Common::List &results, const char *gameid) { +static void detectGames(const Common::FSList &fslist, Common::List &results, const char *gameid) { DescMap fileMD5Map; DetectorResult dr; char md5str[32+1]; - for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { + for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (!file->isDirectory()) { DetectorDesc d; d.node = *file; @@ -677,7 +677,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual GameList getSupportedGames() const; virtual GameDescriptor findGame(const char *gameid) const; - virtual GameList detectGames(const FSList &fslist) const; + virtual GameList detectGames(const Common::FSList &fslist) const; virtual PluginError createInstance(OSystem *syst, Engine **engine) const; @@ -700,7 +700,7 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } -GameList ScummMetaEngine::detectGames(const FSList &fslist) const { +GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const { GameList detectedGames; Common::List results; @@ -777,9 +777,9 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons } // Fetch the list of files in the current directory - FSList fslist; - FilesystemNode dir(ConfMan.get("path")); - if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) { + Common::FSList fslist; + Common::FilesystemNode dir(ConfMan.get("path")); + if (!dir.getChildren(fslist, Common::FilesystemNode::kListFilesOnly)) { return kInvalidPathError; } -- cgit v1.2.3 From 0a35842954b9f1e79a84316deb496a4f4ecacf55 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 11 Sep 2008 19:47:45 +0000 Subject: Committed my patch #2105593 "Launcher/MetaEngine: Finnished removeSaveState". svn-id: r34495 --- engines/scumm/detection.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 2a6e0c0b10..1062e77114 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -682,6 +682,7 @@ public: virtual PluginError createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; + virtual void removeSaveState(const char *target, int slot) const; }; bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -975,6 +976,16 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { return saveList; } +void ScummMetaEngine::removeSaveState(const char *target, int slot) const { + char extension[6]; + snprintf(extension, sizeof(extension), ".s%02d", slot); + + Common::String filename = target; + filename += extension; + + g_system->getSavefileManager()->removeSavefile(filename.c_str()); +} + #if PLUGIN_ENABLED_DYNAMIC(SCUMM) REGISTER_PLUGIN_DYNAMIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine); #else -- cgit v1.2.3 From 725bd8b778046c6b3acd0b98e1fa8a05d5b732b1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 14 Sep 2008 21:13:40 +0000 Subject: Added thumbnail support for launcher to SCUMM engine. svn-id: r34540 --- engines/scumm/detection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 1062e77114..af1838b27d 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -683,6 +683,7 @@ public: virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; + virtual Graphics::Surface *loadThumbnailFromSlot(const char *target, int slot) const; }; bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -690,7 +691,8 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || - (f == kSupportsDeleteSave); + (f == kSupportsDeleteSave) || + (f == kSupportsThumbnails); } GameList ScummMetaEngine::getSupportedGames() const { @@ -986,6 +988,10 @@ void ScummMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(filename.c_str()); } +Graphics::Surface *ScummMetaEngine::loadThumbnailFromSlot(const char *target, int slot) const { + return ScummEngine::loadThumbnailFromSlot(target, slot); +} + #if PLUGIN_ENABLED_DYNAMIC(SCUMM) REGISTER_PLUGIN_DYNAMIC(SCUMM, PLUGIN_TYPE_ENGINE, ScummMetaEngine); #else -- cgit v1.2.3 From 77273facda2a01823755f46f9af765aff0ce3d4b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 14 Sep 2008 21:34:49 +0000 Subject: Little cleanup. svn-id: r34543 --- engines/scumm/detection.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index af1838b27d..ce991a8997 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -979,12 +979,7 @@ SaveStateList ScummMetaEngine::listSaves(const char *target) const { } void ScummMetaEngine::removeSaveState(const char *target, int slot) const { - char extension[6]; - snprintf(extension, sizeof(extension), ".s%02d", slot); - - Common::String filename = target; - filename += extension; - + Common::String filename = ScummEngine::makeSavegameName(target, slot, false); g_system->getSavefileManager()->removeSavefile(filename.c_str()); } -- cgit v1.2.3 From 259d87a8a68d443d2bbb2bcc1887b4f11b7d342e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 16 Sep 2008 14:10:55 +0000 Subject: Added "querySaveMetaInfos" to MetaEngine. -> Allows easy addition of save state specific infos like playtime, save date atc. -> Removed MetaEngine::loadThumbnailFromSlot, superseded by meta infos -> Changed SCUMM / KYRA to implement the newly added functionallity -> Removed hack in KYRAs listSavefiles, which is now handled via meta infos svn-id: r34581 --- engines/scumm/detection.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index ce991a8997..34775ab575 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -683,7 +683,7 @@ public: virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; - virtual Graphics::Surface *loadThumbnailFromSlot(const char *target, int slot) const; + virtual SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const; }; bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -692,6 +692,7 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave) || + (f == kSupportsMetaInfos) || (f == kSupportsThumbnails); } @@ -983,8 +984,25 @@ void ScummMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(filename.c_str()); } -Graphics::Surface *ScummMetaEngine::loadThumbnailFromSlot(const char *target, int slot) const { - return ScummEngine::loadThumbnailFromSlot(target, slot); +SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int slot) const { + Common::String filename = ScummEngine::makeSavegameName(target, slot, false); + Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str()); + + if (!in) + return SaveStateDescriptor(); + + Common::String saveDesc; + Scumm::getSavegameName(in, saveDesc, 0); // FIXME: heversion?!? + delete in; + + // TODO: Cleanup + Graphics::Surface *thumbnail = ScummEngine::loadThumbnailFromSlot(target, slot); + + SaveStateDescriptor desc(slot, saveDesc, filename); + desc.setDeletableFlag(true); + desc.setThumbnail(thumbnail); + + return desc; } #if PLUGIN_ENABLED_DYNAMIC(SCUMM) -- cgit v1.2.3 From 3739662b75dbd04715731071e3b89d1d06a50a8e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 16 Sep 2008 14:56:02 +0000 Subject: Added support for SCUMM savestates date/time and playtime info in the launcher load dialog. svn-id: r34583 --- engines/scumm/detection.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'engines/scumm/detection.cpp') diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 34775ab575..d3397fe208 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -693,7 +693,9 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave) || (f == kSupportsMetaInfos) || - (f == kSupportsThumbnails); + (f == kSupportsThumbnails) || + (f == kSupportsSaveDate) || + (f == kSupportsSavePlayTime); } GameList ScummMetaEngine::getSupportedGames() const { @@ -1002,6 +1004,27 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int desc.setDeletableFlag(true); desc.setThumbnail(thumbnail); + InfoStuff infos; + memset(&infos, 0, sizeof(infos)); + if (ScummEngine::loadInfosFromSlot(target, slot, &infos)) { + int day = (infos.date >> 24) & 0xFF; + int month = (infos.date >> 16) & 0xFF; + int year = infos.date & 0xFFFF; + + desc.setSaveDate(year, month, day); + + int hour = (infos.time >> 8) & 0xFF; + int minutes = infos.time & 0xFF; + + desc.setSaveTime(hour, minutes); + + minutes = infos.playtime / 60; + hour = minutes / 60; + minutes %= 60; + + desc.setPlayTime(hour, minutes); + } + return desc; } -- cgit v1.2.3