MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ReadConfiguration

Method ReadConfiguration

apps/cwr/GameBase/GameBase.cpp:141–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139 LOG_INFO(Core, "Changed working directory to: {}", workDir);
140
141 if (AppConfig::Instance().PrintMPVersion())
142 {
143 PrintMPCompatibilityTuple(*this);
144 m_startupExitCode = 0;
145 return false;
146 }
147
148 const std::string oldPathsRoot = std::filesystem::current_path().string();
149 GamePaths::Instance().Initialize("CWR", "ColdWarAssault", "Cold War Assault", AppConfig::Instance().OldPaths(),
150 oldPathsRoot.c_str());
151 Poseidon::ApplyGamePathsToLegacyGlobals();
152
153 // Refresh the crash handler after path setup. Linux uses the user dir for reports; Windows
154 // keeps minidumps beside the executable.
155 Poseidon::Foundation::InstallCrashHandler(GamePaths::Instance().UserDir().c_str());
156
157 LOG_INFO(Core, "Command-line parsing complete");
158 LOG_INFO(Core, " user_dir: {}", GamePaths::Instance().UserDir());
159 LOG_INFO(Core, " user_content_dir: {}", GamePaths::Instance().UserContentDir());
160 LOG_INFO(Core, " cache_dir: {}", GamePaths::Instance().CacheDir());
161 LOG_INFO(Core, " temp_dir: {}", GamePaths::Instance().TempDir());
162
163 // Disable caps lock for cheats / dev hotkeys.
164 InitCapsLock();
165 return true;
166}
167
168bool GameBase::ReadConfiguration()
169{
170 LOG_INFO(Config, "Initializing configuration system...");
171
172 // Config: in-process defaults → CLI overrides.
173 AppConfig& appConfig = AppConfig::Instance();
174 GetConfig().Initialize(appConfig);
175

Callers

nothing calls this directly

Calls 5

ApplyConfigurationFlagsFunction · 0.85
InitializeMethod · 0.45
GetLanguageMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected