2018-05-24 14:50:43 +08:00
|
|
|
/* ResidualVM - A 3D game interpreter
|
|
|
|
*
|
|
|
|
* ResidualVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the AUTHORS
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
2018-05-24 16:45:22 +08:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2018-05-24 14:50:43 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef STARK_SERVICES_SETTINGS_H
|
|
|
|
#define STARK_SERVICES_SETTINGS_H
|
|
|
|
|
|
|
|
#include "common/config-manager.h"
|
|
|
|
|
2018-05-27 21:59:47 +08:00
|
|
|
#include "engines/stark/services/services.h"
|
|
|
|
#include "engines/advancedDetector.h"
|
|
|
|
|
2018-05-25 11:09:24 +08:00
|
|
|
namespace Audio {
|
|
|
|
class Mixer;
|
2018-05-24 14:50:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Stark {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Settings services.
|
|
|
|
*
|
|
|
|
* Maintains the settings of the game.
|
|
|
|
*/
|
|
|
|
class Settings {
|
|
|
|
public:
|
|
|
|
enum BoolSettingIndex {
|
|
|
|
kHighModel,
|
|
|
|
kSubtitle,
|
|
|
|
kSpecialFX,
|
|
|
|
kShadow,
|
|
|
|
kHighFMV,
|
|
|
|
kTimeSkip
|
|
|
|
};
|
|
|
|
|
|
|
|
enum IntSettingIndex {
|
|
|
|
kVoice,
|
|
|
|
kMusic,
|
|
|
|
kSfx
|
|
|
|
};
|
|
|
|
|
2018-05-27 21:59:47 +08:00
|
|
|
static bool isDemo() {
|
|
|
|
return StarkGameDescription->flags & ADGF_DEMO;
|
|
|
|
}
|
|
|
|
|
2018-05-25 11:09:24 +08:00
|
|
|
explicit Settings(Audio::Mixer *mixer);
|
2018-05-24 14:50:43 +08:00
|
|
|
~Settings() {}
|
|
|
|
|
|
|
|
/** Get the settings value */
|
2018-05-25 11:09:24 +08:00
|
|
|
bool getBoolSetting(BoolSettingIndex index) { return ConfMan.getBool(_boolKey[index]); }
|
|
|
|
int getIntSetting(IntSettingIndex index) { return ConfMan.getInt(_intKey[index]); }
|
2018-05-24 14:50:43 +08:00
|
|
|
|
|
|
|
/** Flip the boolean settings */
|
2018-05-25 11:09:24 +08:00
|
|
|
void flipSetting(BoolSettingIndex index) {
|
|
|
|
ConfMan.setBool(_boolKey[index], !getBoolSetting(index));
|
|
|
|
}
|
2018-05-24 14:50:43 +08:00
|
|
|
|
|
|
|
/** Set the integer settings */
|
2018-05-25 11:09:24 +08:00
|
|
|
void setIntSetting(IntSettingIndex index, int value);
|
2018-05-24 14:50:43 +08:00
|
|
|
|
2018-05-24 16:45:22 +08:00
|
|
|
/** Check whether low-resolution fmv is available */
|
|
|
|
bool hasLowResFMV() { return _hasLowRes; }
|
|
|
|
|
2018-05-24 14:50:43 +08:00
|
|
|
private:
|
2018-05-25 11:09:24 +08:00
|
|
|
Audio::Mixer *_mixer;
|
|
|
|
bool _hasLowRes;
|
2018-05-24 14:50:43 +08:00
|
|
|
|
2018-05-25 11:09:24 +08:00
|
|
|
const char *_boolKey[6];
|
|
|
|
const char *_intKey[3];
|
2018-05-24 14:50:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Stark
|
|
|
|
|
|
|
|
#endif // STARK_SERVICES_SETTINGS_H
|