133 bool doFrate()
const {
return showFpsCounter; }
147 void startLoad(std::string_view banner,
const std::function<std::unique_ptr<GameSession>(std::unique_ptr<GameSession>&&)> f);
148 void startSave(Tempest::Texture2d&& tex,
const std::function<std::unique_ptr<GameSession>(std::unique_ptr<GameSession>&&)> f);
151 void tick(uint64_t dt);
156 void save(std::string_view slot, std::string_view usrName);
157 void load(std::string_view slot);
168 Tempest::Signal<void(std::string_view,std::string_view)>
onSaveGame;
174 Tempest::Signal<void(std::string_view)>
onPrint;
175 Tempest::Signal<void(std::string_view)>
onVideo;
186 std::string_view
messageFromSvm(std::string_view
id,
int voice)
const;
190 static std::u16string
nestedPath(
const std::initializer_list<const char16_t*> &name, Tempest::Dir::FileType type);
202 static int settingsGetI(std::string_view sec, std::string_view name);
203 static void settingsSetI(std::string_view sec, std::string_view name,
int val);
204 static std::string_view
settingsGetS(std::string_view sec, std::string_view name);
205 static void settingsSetS(std::string_view sec, std::string_view name, std::string_view val);
206 static float settingsGetF(std::string_view sec, std::string_view name);
207 static void settingsSetF(std::string_view sec, std::string_view name,
float val);
213 std::mt19937 randGen;
215 bool isMarvin =
false;
216 bool godMode =
false;
217 bool desktop =
false;
218 bool showFpsCounter =
false;
219 bool showTime =
false;
222 std::string wrldDef, plDef, gameDatDef, ouDef;
224 std::unique_ptr<IniFile> defaults;
225 std::unique_ptr<IniFile> baseIniFile;
226 std::unique_ptr<IniFile> iniFile;
227 std::unique_ptr<IniFile> modFile;
228 std::unique_ptr<IniFile> systemPackIniFile;
230 Tempest::Texture2d loadTex;
231 Tempest::Texture2d saveTex;
232 std::atomic_int loadProgress{0};
233 std::thread loaderTh;
236 std::unique_ptr<GameSession> game, pendingGame;
237 std::unique_ptr<FightAi> fight;
238 std::unique_ptr<CameraDefinitions> camDef;
239 std::unique_ptr<SoundDefinitions> soundDef;
240 std::unique_ptr<VisualFxDefinitions> vfxDef;
241 std::unique_ptr<ParticlesDefinitions> particleDef;
242 std::unique_ptr<MusicDefinitions> music;
245 Tempest::SoundDevice sndDev;
246 std::unordered_map<std::string,SoundFx> sndFxCache;
247 std::unordered_map<std::string,SoundFx> sndWavCache;
248 std::vector<Tempest::SoundEffect> sndStorage;
250 std::vector<std::unique_ptr<DocumentMenu::Show>> documents;
252 bool pendingChapter=
false;
254 std::vector<ItmFlags> inventoryOrder;
258 void implStartLoadSave(std::string_view banner,
260 const std::function<std::unique_ptr<GameSession>(std::unique_ptr<GameSession>&&)> f);
262 void detectGothicVersion();
263 void setupSettings();
265 auto getDocument(
int id) -> std::unique_ptr<DocumentMenu::Show>&;
267 static void notImplementedRoutine(std::string_view fn);
269 static std::string concatstrings (std::string_view a, std::string_view b);
270 static std::string inttostring (
int i);
271 static std::string floattostring (
float f);
272 static int floattoint (
float f);
273 static float inttofloat (
int i);
275 static bool hlp_strcmp (std::string_view a, std::string_view b);
276 int hlp_random (
int max);
278 void introducechapter (std::string_view title, std::string_view subtitle, std::string_view img, std::string_view sound,
int time);
279 bool playvideo (std::string_view name);
280 bool playvideoex (std::string_view name,
bool screenBlend,
bool exitSession);
281 bool printscreen (std::string_view msg,
int posx,
int posy, std::string_view font,
int timesec);
282 bool printdialog (
int dialognr, std::string_view msg,
int posx,
int posy, std::string_view font,
int timesec);
283 void print (std::string_view msg);
286 int doc_createmap ();
287 void doc_setpage (
int handle,
int page, std::string_view img,
int scale);
288 void doc_setpages (
int handle,
int count);
289 void doc_printline (
int handle,
int page, std::string_view text);
290 void doc_printlines (
int handle,
int page, std::string_view text);
291 void doc_setmargins (
int handle,
int page,
int left,
int top,
int right,
int bottom,
int mul);
292 void doc_setfont (
int handle,
int page, std::string_view font);
293 void doc_setlevel (
int handle, std::string_view level);
294 void doc_setlevelcoords(
int handle,
int left,
int top,
int right,
int bottom);
295 void doc_show (
int handle);
299 void printdebug (std::string_view msg);
300 void printdebugch (
int ch, std::string_view msg);
301 void printdebuginst (std::string_view msg);
302 void printdebuginstch (
int ch, std::string_view msg);