mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 09:49:14 +00:00
ZVISION: Implement settings functions
This commit is contained in:
parent
d40caba5b7
commit
be8cf97674
@ -96,7 +96,7 @@ void ScriptManager::execScope(script_scope &scope) {
|
||||
for (PuzzleList::iterator PuzzleIter = scope._puzzles.begin(); PuzzleIter != scope._puzzles.end(); ++PuzzleIter)
|
||||
(*PuzzleIter)->addedBySetState = 0;
|
||||
|
||||
if (scope.proc_count < 2 || getStateValue(76)) {
|
||||
if (scope.proc_count < 2 || getStateValue(StateKey_ExecScopeStyle)) {
|
||||
for (PuzzleList::iterator PuzzleIter = scope._puzzles.begin(); PuzzleIter != scope._puzzles.end(); ++PuzzleIter)
|
||||
checkPuzzleCriteria(*PuzzleIter, scope.proc_count);
|
||||
} else {
|
||||
@ -738,6 +738,8 @@ void ScriptManager::deserialize(Common::SeekableReadStream *stream) {
|
||||
// Place for read prefs
|
||||
_engine->setRenderDelay(10);
|
||||
setStateValue(StateKey_RestoreFlag, 1);
|
||||
|
||||
_engine->loadSettings();
|
||||
}
|
||||
|
||||
Location ScriptManager::getCurrentLocation() const {
|
||||
|
@ -86,6 +86,7 @@ enum StateKey {
|
||||
StateKey_ShowErrorDlg = 73,
|
||||
StateKey_DebugCheats = 74,
|
||||
StateKey_JapanFonts = 75,
|
||||
StateKey_ExecScopeStyle = 76,
|
||||
StateKey_Brightness = 77,
|
||||
StateKey_EF9_R = 91,
|
||||
StateKey_EF9_G = 92,
|
||||
|
@ -54,6 +54,32 @@
|
||||
|
||||
namespace ZVision {
|
||||
|
||||
#define ZVISION_SETTINGS_KEYS_COUNT 17
|
||||
|
||||
struct zvisionIniSettings {
|
||||
const char *name;
|
||||
int16 slot;
|
||||
int16 deflt;
|
||||
} settingsKeys[ZVISION_SETTINGS_KEYS_COUNT] = {
|
||||
{"ZVision_KeyboardTurnSpeed", StateKey_KbdRotateSpeed, 5},
|
||||
{"ZVision_PanaRotateSpeed", StateKey_RotateSpeed, 540},
|
||||
{"ZVision_QSoundEnabled", StateKey_Qsound, 1},
|
||||
{"ZVision_VenusEnabled", StateKey_VenusEnable, 1},
|
||||
{"ZVision_HighQuality", StateKey_HighQuality, 1},
|
||||
{"ZVision_Platform", StateKey_Platform, 0},
|
||||
{"ZVision_InstallLevel", StateKey_InstallLevel, 0},
|
||||
{"ZVision_CountryCode", StateKey_CountryCode, 0},
|
||||
{"ZVision_CPU", StateKey_CPU, 1},
|
||||
{"ZVision_MovieCursor", StateKey_MovieCursor, 1},
|
||||
{"ZVision_NoAnimWhileTurning", StateKey_NoTurnAnim, 0},
|
||||
{"ZVision_Win958", StateKey_WIN958, 0},
|
||||
{"ZVision_ShowErrorDialogs", StateKey_ShowErrorDlg, 0},
|
||||
{"ZVision_ShowSubtitles", StateKey_Subtitles, 1},
|
||||
{"ZVision_DebugCheats", StateKey_DebugCheats, 0},
|
||||
{"ZVision_JapaneseFonts", StateKey_JapanFonts, 0},
|
||||
{"ZVision_Brightness", StateKey_Brightness, 0}
|
||||
};
|
||||
|
||||
ZVision::ZVision(OSystem *syst, const ZVisionGameDescription *gameDesc)
|
||||
: Engine(syst),
|
||||
_gameDescription(gameDesc),
|
||||
@ -93,6 +119,28 @@ ZVision::~ZVision() {
|
||||
DebugMan.clearAllDebugChannels();
|
||||
}
|
||||
|
||||
void ZVision::registerDefaultSettings() {
|
||||
for (int i = 0; i < ZVISION_SETTINGS_KEYS_COUNT; i++)
|
||||
ConfMan.registerDefault(settingsKeys[i].name, settingsKeys[i].deflt);
|
||||
ConfMan.registerDefault("doublefps", false);
|
||||
}
|
||||
|
||||
void ZVision::loadSettings() {
|
||||
for (int i = 0; i < ZVISION_SETTINGS_KEYS_COUNT; i++)
|
||||
_scriptManager->setStateValue(settingsKeys[i].slot, ConfMan.getInt(settingsKeys[i].name));
|
||||
|
||||
if (getGameId() == GID_NEMESIS)
|
||||
_scriptManager->setStateValue(StateKey_ExecScopeStyle, 1);
|
||||
else
|
||||
_scriptManager->setStateValue(StateKey_ExecScopeStyle, 0);
|
||||
}
|
||||
|
||||
void ZVision::saveSettings() {
|
||||
for (int i = 0; i < ZVISION_SETTINGS_KEYS_COUNT; i++)
|
||||
ConfMan.setInt(settingsKeys[i].name, _scriptManager->getStateValue(settingsKeys[i].slot));
|
||||
ConfMan.flushToDisk();
|
||||
}
|
||||
|
||||
void ZVision::initialize() {
|
||||
const Common::FSNode gameDataDir(ConfMan.get("path"));
|
||||
|
||||
@ -171,6 +219,10 @@ void ZVision::initialize() {
|
||||
_scriptManager->initialize();
|
||||
_stringManager->initialize(_gameDescription->gameId);
|
||||
|
||||
registerDefaultSettings();
|
||||
|
||||
loadSettings();
|
||||
|
||||
// Create debugger console. It requires GFX to be initialized
|
||||
_console = new Console(this);
|
||||
_halveDelay = ConfMan.getBool("doublefps");
|
||||
|
Loading…
x
Reference in New Issue
Block a user