116 lines
2.9 KiB
C
Raw Normal View History

/* 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,
* 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"
#include "engines/stark/gfx/texture.h"
#include "engines/stark/services/services.h"
struct ADGameDescription;
2018-05-25 11:09:24 +08:00
namespace Audio {
class Mixer;
}
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,
kSaveLoadPage
};
Settings(Audio::Mixer *mixer, const ADGameDescription *gd);
~Settings() {}
/**
* Is this a demo version of the game?
*
* This is true either for 4-CD or 2-CD style demos
*/
bool isDemo() const {
return _isDemo;
}
/** 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]); }
/** Flip the boolean settings */
2018-05-25 11:09:24 +08:00
void flipSetting(BoolSettingIndex index) {
ConfMan.setBool(_boolKey[index], !getBoolSetting(index));
}
/** Set the integer settings */
2018-05-25 11:09:24 +08:00
void setIntSetting(IntSettingIndex index, int value);
2018-05-24 16:45:22 +08:00
/** Check whether low-resolution fmv is available */
bool hasLowResFMV() { return _hasLowRes; }
/** Enable the book of secrets */
void enableBookOfSecrets() {
ConfMan.setBool("xoBfOsterceS", true);
ConfMan.flushToDisk();
}
/** Check whether the book of secrets is enabled */
bool hasBookOfSecrets() { return ConfMan.hasKey("xoBfOsterceS"); }
/** Should the game try to load external replacement assets? */
bool isAssetsModEnabled() const;
/** Should linear filtering be used when sampling the background image textures? */
Gfx::Texture::SamplingFilter getImageSamplingFilter() const;
private:
2018-05-25 11:09:24 +08:00
Audio::Mixer *_mixer;
bool _hasLowRes;
const bool _isDemo;
2018-05-25 11:09:24 +08:00
const char *_boolKey[6];
const char *_intKey[4];
};
} // End of namespace Stark
#endif // STARK_SERVICES_SETTINGS_H