OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
commandline.h
Go to the documentation of this file.
1#pragma once
2
3#include <Tempest/Platform>
4#include <Tempest/Dir>
5
6#include <cstdint>
7#include <stdexcept>
8#include <string>
9
10#include "game/constants.h"
11
12class VersionInfo;
13class GothicNotFoundException : std::logic_error {
14 using logic_error::logic_error;
15 };
16
18 public:
19 CommandLine(int argc,const char** argv);
20 static const CommandLine& inst();
21
22 enum GraphicBackend : uint8_t {
25 };
26 auto graphicsApi() const -> GraphicBackend;
27 std::u16string_view rootPath() const;
28 std::u16string scriptPath() const;
29 std::u16string scriptPath(ScriptLang lang) const;
30 std::u16string cutscenePath() const;
31 std::u16string cutscenePath(ScriptLang lang) const;
32 std::u16string_view modPath() const { return gmod; }
33 std::u16string nestedPath(const std::initializer_list<const char16_t*> &name, Tempest::Dir::FileType type) const;
34
35 bool isDevMode() const { return devmode; }
36 bool isValidationMode() const { return isDebug; }
37 bool isWindowMode() const { return isWindow; }
38 bool isRayQuery() const { return isRQuery; }
39 bool isRtGi() const { return isGi; }
40 bool isMeshShading() const { return isMeshSh; }
41 bool isBindless() const { return isBindlessSh; }
42 bool isVirtualShadow() const { return isVsm; }
43 bool isSoftwareShadow() const { return isRtSm; }
44 bool doStartMenu() const { return !noMenu; }
45 Benchmark isBenchmarkMode() const { return isBenchmark; }
46 bool doForceG1() const { return forceG1; }
47 bool doForceG2() const { return forceG2; }
48 bool doForceG2NR() const { return forceG2NR; }
49 bool aaPreset() const { return aaPresetId; }
50 std::string_view defaultSave() const { return saveDef; }
51
52 std::string wrldDef;
53
54 private:
55 bool validateGothicPath() const;
56
58 std::u16string gpath, gmod;
59 std::u16string gscript;
60 std::u16string gcutscene;
61 std::string saveDef;
62 bool devmode = false;
63 bool noMenu = false;
64 Benchmark isBenchmark = Benchmark::None;
65 bool isWindow = false;
66 bool isDebug = false;
67#if defined(__OSX__)
68 bool isRQuery = false;
69 bool isMeshSh = false;
70#else
71 bool isRQuery = true;
72 bool isMeshSh = true;
73#endif
74 bool isBindlessSh = true;
75 bool isVsm = false;
76 bool isRtSm = false;
77 bool isGi = false;
78 bool forceG1 = false;
79 bool forceG2 = false;
80 bool forceG2NR = false;
81 uint32_t aaPresetId = 0;
82 };
83
bool doForceG1() const
Definition commandline.h:46
std::string_view defaultSave() const
Definition commandline.h:50
bool doStartMenu() const
Definition commandline.h:44
bool doForceG2NR() const
Definition commandline.h:48
bool isVirtualShadow() const
Definition commandline.h:42
bool isBindless() const
Definition commandline.h:41
bool isSoftwareShadow() const
Definition commandline.h:43
bool doForceG2() const
Definition commandline.h:47
bool isRayQuery() const
Definition commandline.h:38
bool isWindowMode() const
Definition commandline.h:37
bool aaPreset() const
Definition commandline.h:49
auto graphicsApi() const -> GraphicBackend
std::u16string nestedPath(const std::initializer_list< const char16_t * > &name, Tempest::Dir::FileType type) const
bool isValidationMode() const
Definition commandline.h:36
std::u16string_view modPath() const
Definition commandline.h:32
bool isMeshShading() const
Definition commandline.h:40
std::u16string scriptPath() const
bool isDevMode() const
Definition commandline.h:35
Benchmark isBenchmarkMode() const
Definition commandline.h:45
std::string wrldDef
Definition commandline.h:52
bool isRtGi() const
Definition commandline.h:39
std::u16string cutscenePath() const
static const CommandLine & inst()
std::u16string_view rootPath() const
Benchmark
Definition constants.h:537
ScriptLang
Definition constants.h:518