Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
AppConfig.cpp
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2020 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include "Actor.h"
23#include "Application.h"
24#include "Console.h"
25#include "ContentManager.h" // RGN_CONFIG
26#include "ErrorUtils.h"
27#include "Language.h"
28#include "PlatformUtils.h"
29#include "Utils.h"
30
31#include <Ogre.h>
32#include <sstream>
33
34using namespace Ogre;
35using namespace RoR;
36
37#define CONFIG_FILE_NAME "RoR.cfg"
38
39// --------------------------------
40// Config file strings and helpers
41
42const char* CONF_GFX_SHADOW_PSSM = "Parallel-split Shadow Maps";
43const char* CONF_GFX_SHADOW_NONE = "No shadows (fastest)";
44
45const char* CONF_EXTCAM_PITCHING = "Pitching";
46const char* CONF_EXTCAM_STATIC = "Static";
47const char* CONF_EXTCAM_NONE = "None";
48
49const char* CONF_TEXFILTER_NONE = "None (fastest)";
50const char* CONF_TEXFILTER_BILI = "Bilinear";
51const char* CONF_TEXFILTER_TRILI = "Trilinear";
52const char* CONF_TEXFILTER_ANISO = "Anisotropic (best looking)";
53
54const char* CONF_VEGET_NONE = "None (fastest)";
55const char* CONF_VEGET_20PERC = "20%";
56const char* CONF_VEGET_50PERC = "50%";
57const char* CONF_VEGET_FULL = "Full (best looking, slower)";
58
59const char* CONF_GEARBOX_AUTO = "Automatic shift";
60const char* CONF_GEARBOX_SEMIAUTO = "Manual shift - Auto clutch";
61const char* CONF_GEARBOX_MANUAL = "Fully Manual: sequential shift";
62const char* CONF_GEARBOX_MAN_STICK = "Fully manual: stick shift";
63const char* CONF_GEARBOX_MAN_RANGES = "Fully Manual: stick shift with ranges";
64
65const char* CONF_FLARES_NONE = "None (fastest)";
66const char* CONF_FLARES_NO_LIGHT = "No light sources";
67const char* CONF_FLARES_CURR_HEAD = "Only current vehicle, main lights";
68const char* CONF_FLARES_ALL_HEADS = "All vehicles, main lights";
69const char* CONF_FLARES_ALL_LIGHTS = "All vehicles, all lights";
70
71const char* CONF_WATER_NONE = "None";
72const char* CONF_WATER_BASIC = "Basic (fastest)";
73const char* CONF_WATER_REFLECT = "Reflection";
74const char* CONF_WATER_FULL_FAST = "Reflection + refraction (speed optimized)";
75const char* CONF_WATER_FULL_HQ = "Reflection + refraction (quality optimized)";
76const char* CONF_WATER_HYDRAX = "Hydrax";
77
78const char* CONF_SKY_CAELUM = "Caelum (best looking, slower)";
79const char* CONF_SKY_SKYX = "SkyX (best looking, slower)";
80const char* CONF_SKY_SANDSTORM = "Sandstorm (fastest)";
81
82const char* CONF_EFX_REVERB_ENGINE_EAXREVERB = "EAXREVERB (more realistic effects, slower)";
83const char* CONF_EFX_REVERB_ENGINE_REVERB = "REVERB";
84const char* CONF_EFX_REVERB_ENGINE_NONE = "None (no reverb, fastest)";
85
86const char* CONF_INPUT_GRAB_DYNAMIC = "Dynamically";
87const char* CONF_INPUT_GRAB_NONE = "None";
88const char* CONF_INPUT_GRAB_ALL = "All";
89
91{
94 else { return RoR::IoInputGrabMode::ALL ; }
95}
96
97GfxShadowType ParseGfxShadowType(std::string const & s)
98{
99 if (s == CONF_GFX_SHADOW_PSSM) { return GfxShadowType::PSSM ; }
100 else { return GfxShadowType::NONE ; }
101}
102
103GfxExtCamMode ParseGfxExtCamMode(std::string const & s)
104{
105 if (s == CONF_EXTCAM_PITCHING) { return GfxExtCamMode::PITCHING ; }
106 if (s == CONF_EXTCAM_STATIC) { return GfxExtCamMode::STATIC ; }
107 else { return GfxExtCamMode::NONE ; }
108}
109
110GfxTexFilter ParseGfxTexFilter(std::string const & s)
111{
112 if (s == CONF_TEXFILTER_NONE) { return GfxTexFilter::NONE ; }
113 if (s == CONF_TEXFILTER_BILI) { return GfxTexFilter::BILINEAR ; }
114 if (s == CONF_TEXFILTER_TRILI) { return GfxTexFilter::TRILINEAR ; }
115 if (s == CONF_TEXFILTER_ANISO) { return GfxTexFilter::ANISOTROPIC ; }
116 else { return GfxTexFilter::NONE ; }
117}
118
119GfxVegetation ParseGfxVegetation(std::string const & s)
120{
121 if (s == CONF_VEGET_NONE ) { return GfxVegetation::NONE ; }
122 if (s == CONF_VEGET_20PERC) { return GfxVegetation::x20PERC ; }
123 if (s == CONF_VEGET_50PERC) { return GfxVegetation::x50PERC ; }
124 if (s == CONF_VEGET_FULL ) { return GfxVegetation::FULL ; }
125 else { return GfxVegetation::NONE ; }
126}
127
129{
130 if (s == CONF_GEARBOX_AUTO ) { return SimGearboxMode::AUTO ; }
131 if (s == CONF_GEARBOX_SEMIAUTO ) { return SimGearboxMode::SEMI_AUTO ; }
132 if (s == CONF_GEARBOX_MANUAL ) { return SimGearboxMode::MANUAL ; }
133 if (s == CONF_GEARBOX_MAN_STICK ) { return SimGearboxMode::MANUAL_STICK ; }
134 if (s == CONF_GEARBOX_MAN_RANGES) { return SimGearboxMode::MANUAL_RANGES ; }
135 else { return SimGearboxMode::AUTO ; }
136}
137
138GfxFlaresMode ParseGfxFlaresMode(std::string const & s)
139{
140 if (s == CONF_FLARES_NONE ) { return GfxFlaresMode::NONE ; }
141 if (s == CONF_FLARES_NO_LIGHT ) { return GfxFlaresMode::NO_LIGHTSOURCES ; }
142 if (s == CONF_FLARES_CURR_HEAD ) { return GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY ; }
143 if (s == CONF_FLARES_ALL_HEADS ) { return GfxFlaresMode::ALL_VEHICLES_HEAD_ONLY ; }
144 if (s == CONF_FLARES_ALL_LIGHTS) { return GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS ; }
145 else { return GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY ; }
146}
147
148GfxWaterMode ParseGfxWaterMode(std::string const & s)
149{
150 if (s == CONF_WATER_NONE ) { return GfxWaterMode::NONE ; }
151 if (s == CONF_WATER_BASIC ) { return GfxWaterMode::BASIC ; }
152 if (s == CONF_WATER_REFLECT ) { return GfxWaterMode::REFLECT ; }
153 if (s == CONF_WATER_FULL_FAST) { return GfxWaterMode::FULL_FAST ; }
154 if (s == CONF_WATER_FULL_HQ ) { return GfxWaterMode::FULL_HQ ; }
155 if (s == CONF_WATER_HYDRAX ) { return GfxWaterMode::HYDRAX ; }
156 else { return GfxWaterMode::BASIC ; }
157}
158
159GfxSkyMode ParseGfxSkyMode(std::string const & s)
160{
161 if (s == CONF_SKY_SANDSTORM) { return GfxSkyMode::SANDSTORM ; }
162 if (s == CONF_SKY_CAELUM ) { return GfxSkyMode::CAELUM ; }
163 if (s == CONF_SKY_SKYX ) { return GfxSkyMode::SKYX ; }
164 else { return GfxSkyMode::SANDSTORM ; }
165}
166
168{
169 if (s == CONF_EFX_REVERB_ENGINE_EAXREVERB) { return EfxReverbEngine::EAXREVERB ; }
170 if (s == CONF_EFX_REVERB_ENGINE_REVERB) { return EfxReverbEngine::REVERB ; }
171 if (s == CONF_EFX_REVERB_ENGINE_NONE) { return EfxReverbEngine::NONE ; }
172 else { return EfxReverbEngine::NONE ; }
173}
174
176{
177 switch (v)
178 {
179 case IoInputGrabMode::DYNAMIC: return CONF_INPUT_GRAB_DYNAMIC;
180 case IoInputGrabMode::NONE : return CONF_INPUT_GRAB_NONE;
181 case IoInputGrabMode::ALL : return CONF_INPUT_GRAB_ALL;
182 default : return "";
183 }
184}
185
187{
188 switch (v)
189 {
190 case GfxShadowType::PSSM : return CONF_GFX_SHADOW_PSSM;
191 case GfxShadowType::NONE : return CONF_GFX_SHADOW_NONE;
192 default : return "";
193 }
194}
195
197{
198 switch (v)
199 {
200 case GfxExtCamMode::PITCHING: return CONF_EXTCAM_PITCHING;
201 case GfxExtCamMode::STATIC : return CONF_EXTCAM_STATIC;
202 case GfxExtCamMode::NONE : return CONF_EXTCAM_NONE;
203 default : return "";
204 }
205}
206
208{
209 switch (v)
210 {
211 case GfxTexFilter::NONE : return CONF_TEXFILTER_NONE;
212 case GfxTexFilter::BILINEAR : return CONF_TEXFILTER_BILI;
213 case GfxTexFilter::TRILINEAR : return CONF_TEXFILTER_TRILI;
214 case GfxTexFilter::ANISOTROPIC: return CONF_TEXFILTER_ANISO;
215 default : return "";
216 }
217}
218
220{
221 switch (v)
222 {
223 case GfxVegetation::NONE : return CONF_VEGET_NONE;
224 case GfxVegetation::x20PERC: return CONF_VEGET_20PERC;
225 case GfxVegetation::x50PERC: return CONF_VEGET_50PERC;
226 case GfxVegetation::FULL : return CONF_VEGET_FULL;
227 default : return "";
228 }
229}
230
232{
233 switch (v)
234 {
235 case SimGearboxMode::AUTO : return CONF_GEARBOX_AUTO;
236 case SimGearboxMode::SEMI_AUTO : return CONF_GEARBOX_SEMIAUTO;
237 case SimGearboxMode::MANUAL : return CONF_GEARBOX_MANUAL;
238 case SimGearboxMode::MANUAL_STICK : return CONF_GEARBOX_MAN_STICK;
239 case SimGearboxMode::MANUAL_RANGES: return CONF_GEARBOX_MAN_RANGES;
240 default : return "";
241 }
242}
243
245{
246 switch(v)
247 {
248 case GfxFlaresMode::NONE : return CONF_FLARES_NONE;
249 case GfxFlaresMode::NO_LIGHTSOURCES : return CONF_FLARES_NO_LIGHT;
250 case GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY : return CONF_FLARES_CURR_HEAD;
251 case GfxFlaresMode::ALL_VEHICLES_HEAD_ONLY : return CONF_FLARES_ALL_HEADS;
252 case GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS: return CONF_FLARES_ALL_LIGHTS;
253 default : return "";
254 }
255}
256
258{
259 switch(v)
260 {
261 case GfxWaterMode::NONE : return CONF_WATER_NONE;
262 case GfxWaterMode::BASIC : return CONF_WATER_BASIC;
263 case GfxWaterMode::REFLECT : return CONF_WATER_REFLECT;
264 case GfxWaterMode::FULL_FAST: return CONF_WATER_FULL_FAST;
265 case GfxWaterMode::FULL_HQ : return CONF_WATER_FULL_HQ;
266 case GfxWaterMode::HYDRAX : return CONF_WATER_HYDRAX;
267 default : return "";
268 }
269}
270
272{
273 switch(v)
274 {
275 case GfxSkyMode::CAELUM : return CONF_SKY_CAELUM;
276 case GfxSkyMode::SKYX : return CONF_SKY_SKYX;
277 case GfxSkyMode::SANDSTORM: return CONF_SKY_SANDSTORM;
278 default : return "";
279 }
280}
281
283{
284 switch(v)
285 {
286 case EfxReverbEngine::EAXREVERB : return CONF_EFX_REVERB_ENGINE_EAXREVERB;
287 case EfxReverbEngine::REVERB : return CONF_EFX_REVERB_ENGINE_REVERB;
288 case EfxReverbEngine::NONE : return CONF_EFX_REVERB_ENGINE_NONE;
289 default : return "";
290 }
291}
292
293// --------------------------------
294// Config file parsing
295
296void AssignHelper(CVar* cvar, int val)
297{
298 Str<25> s; s << val;
299 App::GetConsole()->cVarAssign(cvar, s.ToCStr());
300}
301
302void ParseHelper(CVar* cvar, std::string const & val)
303{
304 if (cvar->getName() == App::gfx_envmap_rate->getName())
305 {
306 int rate = Ogre::StringConverter::parseInt(val);
307 if (rate < 0) { rate = 0; }
308 if (rate > 2) { rate = 2; }
310 }
311 else if (cvar->getName() == App::gfx_shadow_quality->getName())
312 {
313 int quality = Ogre::StringConverter::parseInt(val);
314 if (quality < 0) { quality = 0; }
315 if (quality > 3) { quality = 3; }
317 }
318 else if (cvar->getName() == App::gfx_shadow_type->getName())
319 {
321 }
322 else if (cvar->getName() == App::gfx_extcam_mode->getName())
323 {
325 }
326 else if (cvar->getName() == App::gfx_texture_filter->getName())
327 {
329 }
330 else if (cvar->getName() == App::gfx_vegetation_mode->getName())
331 {
333 }
334 else if (cvar->getName() == App::gfx_flares_mode->getName())
335 {
337 }
338 else if (cvar->getName() == App::gfx_water_mode->getName())
339 {
341 }
342 else if (cvar->getName() == App::gfx_sky_mode->getName())
343 {
345 }
346 else if (cvar->getName() == App::sim_gearbox_mode->getName())
347 {
349 }
350 else if (cvar->getName() == App::gfx_fov_external_default->getName() ||
352 {
353 int fov = Ogre::StringConverter::parseInt(val);
354 if (fov >= 10) // FOV shouldn't be below 10
355 {
356 AssignHelper(cvar, fov);
357 }
358 }
359 else if (cvar->getName() == App::audio_efx_reverb_engine->getName())
360 {
362 }
363 else
364 {
365 App::GetConsole()->cVarAssign(cvar, val);
366 }
367}
368
370{
371 Ogre::ConfigFile cfg;
372 try
373 {
374 std::string path = PathCombine(App::sys_config_dir->getStr(), CONFIG_FILE_NAME);
375 cfg.load(path, "=:\t", /*trimWhitespace=*/true);
376
377 Ogre::ConfigFile::SettingsIterator i = cfg.getSettingsIterator();
378 while (i.hasMoreElements())
379 {
380 std::string cvar_name = SanitizeUtf8String(i.peekNextKey());
381 CVar* cvar = App::GetConsole()->cVarFind(cvar_name);
382 if (cvar && !cvar->hasFlag(CVAR_ARCHIVE))
383 {
384 RoR::LogFormat("[RoR|Settings] CVar '%s' cannot be set from %s (defined without 'archive' flag)", cvar->getName().c_str(), CONFIG_FILE_NAME);
385 i.moveNext();
386 continue;
387 }
388
389 if (!cvar)
390 {
391 cvar = App::GetConsole()->cVarGet(cvar_name, CVAR_ARCHIVE);
392 }
393
394 ParseHelper(cvar, SanitizeUtf8String(i.peekNextValue()));
395
396 i.moveNext();
397 }
398 }
399 catch (Ogre::FileNotFoundException&) {} // Just continue with defaults...
400}
401
402void WriteVarsHelper(std::stringstream& f, const char* label, const char* prefix)
403{
404 f << std::endl << "; " << label << std::endl;
405
406 for (auto& pair: App::GetConsole()->getCVars())
407 {
408 if (pair.second->hasFlag(CVAR_ARCHIVE) && pair.first.find(prefix) == 0)
409 {
410 if (App::app_config_long_names->getBool())
411 {
412 f << pair.second->getLongName() << "=";
413 }
414 else
415 {
416 f << pair.second->getName() << "=";
417 }
418
419 if (pair.second->getName() == App::gfx_shadow_type->getName() ){ f << GfxShadowTypeToStr(App::gfx_shadow_type ->getEnum<GfxShadowType>()); }
420 else if (pair.second->getName() == App::gfx_extcam_mode->getName() ){ f << GfxExtCamModeToStr(App::gfx_extcam_mode ->getEnum<GfxExtCamMode>()); }
421 else if (pair.second->getName() == App::gfx_texture_filter->getName() ){ f << GfxTexFilterToStr (App::gfx_texture_filter ->getEnum<GfxTexFilter>()); }
422 else if (pair.second->getName() == App::gfx_vegetation_mode->getName() ){ f << GfxVegetationToStr(App::gfx_vegetation_mode ->getEnum<GfxVegetation>()); }
423 else if (pair.second->getName() == App::gfx_flares_mode->getName() ){ f << GfxFlaresModeToStr(App::gfx_flares_mode ->getEnum<GfxFlaresMode>()); }
424 else if (pair.second->getName() == App::gfx_water_mode->getName() ){ f << GfxWaterModeToStr (App::gfx_water_mode ->getEnum<GfxWaterMode>()); }
425 else if (pair.second->getName() == App::gfx_sky_mode->getName() ){ f << GfxSkyModeToStr (App::gfx_sky_mode ->getEnum<GfxSkyMode>()); }
426 else if (pair.second->getName() == App::sim_gearbox_mode->getName() ){ f << SimGearboxModeToStr(App::sim_gearbox_mode->getEnum<SimGearboxMode>()); }
427 else if (pair.second->getName() == App::audio_efx_reverb_engine->getName() ) {f << EfxReverbEngineToStr(App::audio_efx_reverb_engine->getEnum<EfxReverbEngine>());}
428 else { f << pair.second->getStr(); }
429
430 f << std::endl;
431 }
432 }
433}
434
436{
437 std::stringstream f;
438
439 f << "; Rigs of Rods configuration file" << std::endl;
440 f << "; -------------------------------" << std::endl;
441
442 WriteVarsHelper(f, "Application", "app_");
443 WriteVarsHelper(f, "Multiplayer", "mp_");
444 WriteVarsHelper(f, "Simulation", "sim_");
445 WriteVarsHelper(f, "Input/Output", "io_");
446 WriteVarsHelper(f, "Graphics", "gfx_");
447 WriteVarsHelper(f, "GUI", "ui_");
448 WriteVarsHelper(f, "Audio", "audio_");
449 WriteVarsHelper(f, "Diagnostics", "diag_");
450
451 try
452 {
453 Ogre::DataStreamPtr stream
454 = Ogre::ResourceGroupManager::getSingleton().createResource(
455 CONFIG_FILE_NAME, RGN_CONFIG, /*overwrite=*/true);
456 size_t written = stream->write(f.str().c_str(), f.str().length());
457 if (written < f.str().length())
458 {
459 RoR::LogFormat("[RoR] Error writing file '%s' (resource group '%s'), ",
460 "only written %u out of %u bytes!",
461 CONFIG_FILE_NAME, RGN_CONFIG, written, f.str().length());
462 }
463 }
464 catch (std::exception& e)
465 {
466 RoR::LogFormat("[RoR|Settings] Error writing file '%s' (resource group '%s'), message: '%s'",
467 CONFIG_FILE_NAME, RGN_CONFIG, e.what());
468 }
469}
470
471
const char * CONF_EXTCAM_PITCHING
Definition AppConfig.cpp:45
const char * CONF_GEARBOX_MAN_STICK
Definition AppConfig.cpp:62
const char * CONF_EXTCAM_NONE
Definition AppConfig.cpp:47
void WriteVarsHelper(std::stringstream &f, const char *label, const char *prefix)
GfxFlaresMode ParseGfxFlaresMode(std::string const &s)
const char * CONF_WATER_NONE
Definition AppConfig.cpp:71
const char * CONF_GFX_SHADOW_NONE
Definition AppConfig.cpp:43
const char * GfxSkyModeToStr(GfxSkyMode v)
const char * CONF_GEARBOX_SEMIAUTO
Definition AppConfig.cpp:60
void ParseHelper(CVar *cvar, std::string const &val)
const char * CONF_VEGET_FULL
Definition AppConfig.cpp:57
const char * GfxShadowTypeToStr(GfxShadowType v)
const char * EfxReverbEngineToStr(EfxReverbEngine v)
const char * GfxWaterModeToStr(GfxWaterMode v)
IoInputGrabMode ParseIoInputGrabMode(std::string const &s)
Definition AppConfig.cpp:90
const char * GfxTexFilterToStr(GfxTexFilter v)
const char * CONF_INPUT_GRAB_DYNAMIC
Definition AppConfig.cpp:86
SimGearboxMode ParseSimGearboxMode(std::string const &s)
const char * CONF_TEXFILTER_NONE
Definition AppConfig.cpp:49
const char * CONF_FLARES_CURR_HEAD
Definition AppConfig.cpp:67
void AssignHelper(CVar *cvar, int val)
const char * CONF_SKY_CAELUM
Definition AppConfig.cpp:78
const char * SimGearboxModeToStr(SimGearboxMode v)
GfxWaterMode ParseGfxWaterMode(std::string const &s)
GfxExtCamMode ParseGfxExtCamMode(std::string const &s)
const char * CONF_EFX_REVERB_ENGINE_NONE
Definition AppConfig.cpp:84
#define CONFIG_FILE_NAME
Definition AppConfig.cpp:37
const char * CONF_SKY_SANDSTORM
Definition AppConfig.cpp:80
const char * CONF_EXTCAM_STATIC
Definition AppConfig.cpp:46
const char * CONF_SKY_SKYX
Definition AppConfig.cpp:79
const char * CONF_WATER_FULL_HQ
Definition AppConfig.cpp:75
const char * CONF_GFX_SHADOW_PSSM
Definition AppConfig.cpp:42
const char * CONF_VEGET_NONE
Definition AppConfig.cpp:54
const char * CONF_WATER_REFLECT
Definition AppConfig.cpp:73
GfxSkyMode ParseGfxSkyMode(std::string const &s)
GfxVegetation ParseGfxVegetation(std::string const &s)
const char * IoInputGrabModeToStr(IoInputGrabMode v)
const char * CONF_FLARES_ALL_LIGHTS
Definition AppConfig.cpp:69
const char * CONF_WATER_FULL_FAST
Definition AppConfig.cpp:74
const char * CONF_WATER_HYDRAX
Definition AppConfig.cpp:76
const char * CONF_GEARBOX_MANUAL
Definition AppConfig.cpp:61
const char * GfxVegetationToStr(GfxVegetation v)
const char * CONF_FLARES_NONE
Definition AppConfig.cpp:65
const char * CONF_GEARBOX_MAN_RANGES
Definition AppConfig.cpp:63
const char * GfxExtCamModeToStr(GfxExtCamMode v)
GfxTexFilter ParseGfxTexFilter(std::string const &s)
EfxReverbEngine ParseEfxReverbEngine(std::string const &s)
const char * CONF_VEGET_20PERC
Definition AppConfig.cpp:55
const char * CONF_VEGET_50PERC
Definition AppConfig.cpp:56
const char * GfxFlaresModeToStr(GfxFlaresMode v)
const char * CONF_EFX_REVERB_ENGINE_EAXREVERB
Definition AppConfig.cpp:82
const char * CONF_WATER_BASIC
Definition AppConfig.cpp:72
const char * CONF_EFX_REVERB_ENGINE_REVERB
Definition AppConfig.cpp:83
const char * CONF_GEARBOX_AUTO
Definition AppConfig.cpp:59
const char * CONF_FLARES_ALL_HEADS
Definition AppConfig.cpp:68
const char * CONF_TEXFILTER_BILI
Definition AppConfig.cpp:50
const char * CONF_INPUT_GRAB_ALL
Definition AppConfig.cpp:88
const char * CONF_TEXFILTER_ANISO
Definition AppConfig.cpp:52
const char * CONF_TEXFILTER_TRILI
Definition AppConfig.cpp:51
GfxShadowType ParseGfxShadowType(std::string const &s)
Definition AppConfig.cpp:97
const char * CONF_FLARES_NO_LIGHT
Definition AppConfig.cpp:66
const char * CONF_INPUT_GRAB_NONE
Definition AppConfig.cpp:87
Central state/object manager and communications hub.
#define RGN_CONFIG
Definition Application.h:49
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
Quake-style console variable, defined in RoR.cfg or crated via Console UI and scripts.
Definition CVar.h:53
std::string const & getName() const
Definition CVar.h:103
bool hasFlag(int f) const
Definition CVar.h:105
void cVarAssign(CVar *cvar, std::string const &value)
Parse value by cvar type.
Definition CVar.cpp:249
void saveConfig()
CVar * cVarFind(std::string const &input_name)
Find cvar by short/long name.
Definition CVar.cpp:267
void loadConfig()
CVar * cVarGet(std::string const &input_name, int flags)
Get cvar by short/long name, or create new one using input as short name.
Definition CVar.cpp:295
CVarPtrMap & getCVars()
Definition Console.h:132
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition Str.h:36
const char * ToCStr() const
Definition Str.h:46
std::string PathCombine(std::string a, std::string b)
@ CVAR_ARCHIVE
Will be written to RoR.cfg.
Definition CVar.h:41
SimGearboxMode
CVar * gfx_sky_mode
CVar * audio_efx_reverb_engine
CVar * gfx_water_mode
CVar * gfx_extcam_mode
CVar * gfx_envmap_rate
CVar * gfx_fov_internal_default
CVar * sys_config_dir
CVar * gfx_vegetation_mode
Console * GetConsole()
CVar * gfx_flares_mode
CVar * app_config_long_names
CVar * sim_gearbox_mode
CVar * gfx_texture_filter
CVar * gfx_fov_external_default
CVar * gfx_shadow_quality
CVar * gfx_shadow_type
GfxExtCamMode
GfxFlaresMode
EfxReverbEngine
GfxShadowType
GfxWaterMode
IoInputGrabMode
GfxVegetation
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
std::string SanitizeUtf8String(std::string const &str_in)
Definition Utils.cpp:120
GfxTexFilter