From 6ec077e1b9f766da0a74bfb85b4ee2cc891cb348 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 7 Dec 2014 14:37:51 +0200 Subject: AGI: Set the correct palette to use for each Amiga game The Amiga palettes were added in 16529e58e6, but were never used. A new game-specific option has been added for the old Amiga palette --- engines/agi/detection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/agi/detection.cpp') diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 1d58900056..e7285d8112 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -145,6 +145,13 @@ static const ExtraGuiOption agiExtraGuiOption = { false }; +static const ExtraGuiOption agiExtraGuiOptionAmiga = { + _s("Use an alternative palette"), + _s("Use an alternative palette, common for all Amiga games. This was the old behavior"), + "altamigapalette", + false +}; + #include "agi/detection_tables.h" using namespace Agi; @@ -230,6 +237,8 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD const ExtraGuiOptions AgiMetaEngine::getExtraGuiOptions(const Common::String &target) const { ExtraGuiOptions options; options.push_back(agiExtraGuiOption); + if (target.contains("-amiga")) + options.push_back(agiExtraGuiOptionAmiga); return options; } -- cgit v1.2.3 From cfd00ad6afc09ca6990ce905b1a8db4ea1ad1602 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 22 Dec 2014 22:39:05 +0100 Subject: AGI: use Common::String::format when possible Use Common::String::format instead of a MAXPATHLEN-sized char[] buffer. --- engines/agi/detection.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/agi/detection.cpp') diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index e7285d8112..3230b4e5d3 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -276,15 +276,13 @@ SaveStateList AgiMetaEngine::listSaves(const char *target) const { int AgiMetaEngine::getMaximumSaveSlot() const { return 999; } void AgiMetaEngine::removeSaveState(const char *target, int slot) const { - char fileName[MAXPATHLEN]; - sprintf(fileName, "%s.%03d", target, slot); + Common::String fileName = Common::String::format("%s.%03d", target, slot); g_system->getSavefileManager()->removeSavefile(fileName); } SaveStateDescriptor AgiMetaEngine::querySaveMetaInfos(const char *target, int slot) const { const uint32 AGIflag = MKTAG('A','G','I',':'); - char fileName[MAXPATHLEN]; - sprintf(fileName, "%s.%03d", target, slot); + Common::String fileName = Common::String::format("%s.%03d", target, slot); Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fileName); -- cgit v1.2.3 From e339cd66c118ad3764639f19381989791ab8932b Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 15 May 2015 04:09:55 +0200 Subject: AGI: implement engine option to disable mouse engine option gets disabled for all Amiga games also disabled for certain fanmade games, which require a mouse. defaults to enabled mouse Engine options are not shown for previously detected games until those games get redetected If there is a way to handle those cases, please fix. --- engines/agi/detection.cpp | 50 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) (limited to 'engines/agi/detection.cpp') diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 3230b4e5d3..a44053dd14 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -152,8 +152,49 @@ static const ExtraGuiOption agiExtraGuiOptionAmiga = { false }; +static const ExtraGuiOption agiExtraGuiOptionEnableMouse = { + _s("Enable mouse"), + _s("Enables mouse. Games, that require a mouse, will have mouse always enabled."), + "enablemouse", + true +}; + #include "agi/detection_tables.h" +static const ADExtraGuiOptionsMap optionsList[] = { + { + GAMEOPTION_ORIGINAL_SAVELOAD, + { + _s("Use original save/load screens"), + _s("Use the original save/load screens, instead of the ScummVM ones"), + "originalsaveload", + false + } + }, + + { + GAMEOPTION_AMIGA_ALTERNATIVE_PALETTE, + { + _s("Use an alternative palette"), + _s("Use an alternative palette, common for all Amiga games. This was the old behavior"), + "altamigapalette", + false + } + }, + + { + GAMEOPTION_DISABLE_MOUSE, + { + _s("Enable mouse"), + _s("Enables mouse. Games, that require a mouse, will have mouse always enabled."), + "enablemouse", + true + } + }, + + AD_EXTRA_GUI_OPTIONS_TERMINATOR +}; + using namespace Agi; class AgiMetaEngine : public AdvancedMetaEngine { @@ -161,7 +202,7 @@ class AgiMetaEngine : public AdvancedMetaEngine { mutable Common::String _extra; public: - AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames) { + AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames, optionsList) { _singleid = "agi"; _guioptions = GUIO1(GUIO_NOSPEECH); } @@ -175,7 +216,7 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; - virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; + //virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; @@ -234,6 +275,10 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD return res; } +// TODO: original 2 gui engine options are not shown for games, that were detected before our change +// because gui-options from the detection-table are saved internally. +// I also can't set those 2 options manually in case they were not set by optionsList[] +#if 0 const ExtraGuiOptions AgiMetaEngine::getExtraGuiOptions(const Common::String &target) const { ExtraGuiOptions options; options.push_back(agiExtraGuiOption); @@ -241,6 +286,7 @@ const ExtraGuiOptions AgiMetaEngine::getExtraGuiOptions(const Common::String &ta options.push_back(agiExtraGuiOptionAmiga); return options; } +#endif SaveStateList AgiMetaEngine::listSaves(const char *target) const { const uint32 AGIflag = MKTAG('A','G','I',':'); -- cgit v1.2.3 From b39b15485bbf4e53a248e04423ecd93f990d4740 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 15 May 2015 05:10:08 +0200 Subject: AGI: mouse support cleanup --- engines/agi/detection.cpp | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'engines/agi/detection.cpp') diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index a44053dd14..823ec7be66 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -138,27 +138,6 @@ static const PlainGameDescriptor agiGames[] = { {0, 0} }; -static const ExtraGuiOption agiExtraGuiOption = { - _s("Use original save/load screens"), - _s("Use the original save/load screens, instead of the ScummVM ones"), - "originalsaveload", - false -}; - -static const ExtraGuiOption agiExtraGuiOptionAmiga = { - _s("Use an alternative palette"), - _s("Use an alternative palette, common for all Amiga games. This was the old behavior"), - "altamigapalette", - false -}; - -static const ExtraGuiOption agiExtraGuiOptionEnableMouse = { - _s("Enable mouse"), - _s("Enables mouse. Games, that require a mouse, will have mouse always enabled."), - "enablemouse", - true -}; - #include "agi/detection_tables.h" static const ADExtraGuiOptionsMap optionsList[] = { @@ -185,9 +164,9 @@ static const ADExtraGuiOptionsMap optionsList[] = { { GAMEOPTION_DISABLE_MOUSE, { - _s("Enable mouse"), - _s("Enables mouse. Games, that require a mouse, will have mouse always enabled."), - "enablemouse", + _s("Mouse support"), + _s("Enables mouse support. Allows to use mouse for movement and in game menus."), + "mousesupport", true } }, @@ -216,7 +195,6 @@ public: virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; - //virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const; virtual SaveStateList listSaves(const char *target) const; virtual int getMaximumSaveSlot() const; virtual void removeSaveState(const char *target, int slot) const; @@ -275,19 +253,6 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD return res; } -// TODO: original 2 gui engine options are not shown for games, that were detected before our change -// because gui-options from the detection-table are saved internally. -// I also can't set those 2 options manually in case they were not set by optionsList[] -#if 0 -const ExtraGuiOptions AgiMetaEngine::getExtraGuiOptions(const Common::String &target) const { - ExtraGuiOptions options; - options.push_back(agiExtraGuiOption); - if (target.contains("-amiga")) - options.push_back(agiExtraGuiOptionAmiga); - return options; -} -#endif - SaveStateList AgiMetaEngine::listSaves(const char *target) const { const uint32 AGIflag = MKTAG('A','G','I',':'); Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); -- cgit v1.2.3