SCI: Add per-game GUI option support.

This commit is contained in:
Filippos Karapetis 2012-03-19 03:39:14 +02:00 committed by Johannes Schickel
parent eabdf8048e
commit 96f132994f
2 changed files with 431 additions and 356 deletions

View File

@ -26,6 +26,7 @@
#include "common/ptr.h"
#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
@ -362,6 +363,73 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R
#include "sci/detection_tables.h"
static const ADExtraGuiOptionsMap optionsList[] = {
{
GAMEOPTION_PREFER_DIGITAL_SFX,
{
_s("Prefer digital sound effects"),
_s("Prefer digital sound effects instead of synthesized ones"),
"prefer_digitalsfx",
true
}
},
{
GAMEOPTION_ORIGINAL_SAVELOAD,
{
_s("Use original save/load screens"),
_s("Use the original save/load screens, instead of the ScummVM ones"),
"sci_originalsaveload",
false
}
},
{
GAMEOPTION_FB01_MIDI,
{
_s("Use IMF/Yahama FB-01 for MIDI output"),
_s("Use an IBM Music Feature card or a Yahama FB-01 FM synth module for MIDI output"),
"native_fb01",
false
}
},
// Jones in the Fast Lane - CD audio tracks or resource.snd
{
GAMEOPTION_JONES_CDAUDIO,
{
_s("Use CD audio"),
_s("Use CD audio instead of in-game audio, if available"),
"use_cdaudio",
true
}
},
// KQ6 Windows - windows cursors
{
GAMEOPTION_KQ6_WINDOWS_CURSORS,
{
_s("Use Windows cursors"),
_s("Use the Windows cursors (smaller and monochrome) instead of the DOS ones"),
"windows_cursors",
false
}
},
// SQ4 CD - silver cursors
{
GAMEOPTION_SQ4_SILVER_CURSORS,
{
_s("Use silver cursors"),
_s("Use the alternate set of silver cursors, instead of the normal golden ones"),
"silver_cursors",
false
}
},
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
/**
* The fallback game descriptor used by the SCI engine's fallbackDetector.
* Contents of this struct are overwritten by the fallbackDetector.
@ -373,14 +441,14 @@ static ADGameDescription s_fallbackDesc = {
Common::UNK_LANG,
Common::kPlatformPC,
ADGF_NO_FLAGS,
GUIO0()
GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI)
};
static char s_fallbackGameIdBuf[256];
class SciMetaEngine : public AdvancedMetaEngine {
public:
SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles) {
SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles, optionsList) {
_singleid = "sci";
}
@ -435,7 +503,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
s_fallbackDesc.flags = ADGF_NO_FLAGS;
s_fallbackDesc.platform = Common::kPlatformPC; // default to PC platform
s_fallbackDesc.gameid = "sci";
s_fallbackDesc.guioptions = GUIO0();
s_fallbackDesc.guioptions = GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);
if (allFiles.contains("resource.map") || allFiles.contains("Data1")
|| allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) {
@ -565,7 +633,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
const bool isCD = (s_fallbackDesc.flags & ADGF_CD);
if (!isCD)
s_fallbackDesc.guioptions = GUIO1(GUIO_NOSPEECH);
s_fallbackDesc.guioptions = GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI);
if (gameId.hasSuffix("sci")) {
s_fallbackDesc.extra = "SCI";

File diff suppressed because it is too large Load Diff