ScummVM API documentation
settings.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef STARK_SERVICES_SETTINGS_H
23 #define STARK_SERVICES_SETTINGS_H
24 
25 #include "common/config-manager.h"
26 #include "common/language.h"
27 #include "common/ustr.h"
28 
29 #include "engines/stark/gfx/bitmap.h"
30 #include "engines/stark/services/services.h"
31 
32 struct ADGameDescription;
33 
34 namespace Audio {
35 class Mixer;
36 }
37 
38 namespace Stark {
39 
45 class Settings {
46 public:
47  enum BoolSettingIndex {
48  kHighModel,
49  kSubtitle,
50  kSpecialFX,
51  kShadow,
52  kHighFMV,
53  kTimeSkip
54  };
55 
56  enum IntSettingIndex {
57  kVoice,
58  kMusic,
59  kSfx,
60  kSaveLoadPage
61  };
62 
63  Settings(Audio::Mixer *mixer, const ADGameDescription *gd);
64  ~Settings() {}
65 
71  bool isDemo() const {
72  return _isDemo;
73  }
74 
76  bool getBoolSetting(BoolSettingIndex index) { return ConfMan.getBool(_boolKey[index]); }
77  int getIntSetting(IntSettingIndex index) { return ConfMan.getInt(_intKey[index]); }
78 
80  void flipSetting(BoolSettingIndex index) {
81  ConfMan.setBool(_boolKey[index], !getBoolSetting(index));
82  }
83 
85  void setIntSetting(IntSettingIndex index, int value);
86 
88  bool hasLowResFMV() { return _hasLowRes; }
89 
92  ConfMan.setBool("xoBfOsterceS", true);
93  ConfMan.flushToDisk();
94  }
95 
97  bool hasBookOfSecrets() { return ConfMan.hasKey("xoBfOsterceS"); }
98 
100  bool isAssetsModEnabled() const;
101 
111  bool shouldPreMultiplyReplacementPNGs() const;
112 
114  Gfx::Bitmap::SamplingFilter getImageSamplingFilter() const;
115 
117  Common::CodePage getTextCodePage() const;
118 
120  bool isFontAntialiasingEnabled() const;
121 
129  bool shouldIgnoreFontSettings() const;
130 
134  Common::Language getLanguage() const;
135 
136 private:
137  Audio::Mixer *_mixer;
138  bool _hasLowRes;
139  const bool _isDemo;
140  const Common::Language _language;
141 
142  const char *_boolKey[6];
143  const char *_intKey[4];
144 };
145 
146 } // End of namespace Stark
147 
148 #endif // STARK_SERVICES_SETTINGS_H
void enableBookOfSecrets()
Definition: settings.h:91
Definition: advancedDetector.h:163
bool hasLowResFMV()
Definition: settings.h:88
bool isDemo() const
Definition: settings.h:71
void flipSetting(BoolSettingIndex index)
Definition: settings.h:80
bool hasBookOfSecrets()
Definition: settings.h:97
Definition: mixer.h:59
bool getBoolSetting(BoolSettingIndex index)
Definition: settings.h:76
Definition: console.h:27
Definition: settings.h:45
Definition: system.h:38
Language
Definition: language.h:45