RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
34 using namespace Ogre;
35 using namespace RoR;
36 
37 #define CONFIG_FILE_NAME "RoR.cfg"
38 
39 // --------------------------------
40 // Config file strings and helpers
41 
42 const char* CONF_GFX_SHADOW_PSSM = "Parallel-split Shadow Maps";
43 const char* CONF_GFX_SHADOW_NONE = "No shadows (fastest)";
44 
45 const char* CONF_EXTCAM_PITCHING = "Pitching";
46 const char* CONF_EXTCAM_STATIC = "Static";
47 const char* CONF_EXTCAM_NONE = "None";
48 
49 const char* CONF_TEXFILTER_NONE = "None (fastest)";
50 const char* CONF_TEXFILTER_BILI = "Bilinear";
51 const char* CONF_TEXFILTER_TRILI = "Trilinear";
52 const char* CONF_TEXFILTER_ANISO = "Anisotropic (best looking)";
53 
54 const char* CONF_VEGET_NONE = "None (fastest)";
55 const char* CONF_VEGET_20PERC = "20%";
56 const char* CONF_VEGET_50PERC = "50%";
57 const char* CONF_VEGET_FULL = "Full (best looking, slower)";
58 
59 const char* CONF_GEARBOX_AUTO = "Automatic shift";
60 const char* CONF_GEARBOX_SEMIAUTO = "Manual shift - Auto clutch";
61 const char* CONF_GEARBOX_MANUAL = "Fully Manual: sequential shift";
62 const char* CONF_GEARBOX_MAN_STICK = "Fully manual: stick shift";
63 const char* CONF_GEARBOX_MAN_RANGES = "Fully Manual: stick shift with ranges";
64 
65 const char* CONF_FLARES_NONE = "None (fastest)";
66 const char* CONF_FLARES_NO_LIGHT = "No light sources";
67 const char* CONF_FLARES_CURR_HEAD = "Only current vehicle, main lights";
68 const char* CONF_FLARES_ALL_HEADS = "All vehicles, main lights";
69 const char* CONF_FLARES_ALL_LIGHTS = "All vehicles, all lights";
70 
71 const char* CONF_WATER_NONE = "None";
72 const char* CONF_WATER_BASIC = "Basic (fastest)";
73 const char* CONF_WATER_REFLECT = "Reflection";
74 const char* CONF_WATER_FULL_FAST = "Reflection + refraction (speed optimized)";
75 const char* CONF_WATER_FULL_HQ = "Reflection + refraction (quality optimized)";
76 const char* CONF_WATER_HYDRAX = "Hydrax";
77 
78 const char* CONF_SKY_CAELUM = "Caelum (best looking, slower)";
79 const char* CONF_SKY_SKYX = "SkyX (best looking, slower)";
80 const char* CONF_SKY_SANDSTORM = "Sandstorm (fastest)";
81 
82 const char* CONF_EFX_REVERB_ENGINE_EAXREVERB = "EAXREVERB (more realistic effects, slower)";
83 const char* CONF_EFX_REVERB_ENGINE_REVERB = "REVERB";
84 const char* CONF_EFX_REVERB_ENGINE_NONE = "None (no reverb, fastest)";
85 
86 const char* CONF_INPUT_GRAB_DYNAMIC = "Dynamically";
87 const char* CONF_INPUT_GRAB_NONE = "None";
88 const char* CONF_INPUT_GRAB_ALL = "All";
89 
90 IoInputGrabMode ParseIoInputGrabMode(std::string const & s)
91 {
93  if (s == CONF_INPUT_GRAB_NONE ) { return RoR::IoInputGrabMode::NONE ; }
94  else { return RoR::IoInputGrabMode::ALL ; }
95 }
96 
97 GfxShadowType ParseGfxShadowType(std::string const & s)
98 {
99  if (s == CONF_GFX_SHADOW_PSSM) { return GfxShadowType::PSSM ; }
100  else { return GfxShadowType::NONE ; }
101 }
102 
103 GfxExtCamMode 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 
110 GfxTexFilter 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 
119 GfxVegetation 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 
128 SimGearboxMode ParseSimGearboxMode(std::string const & s)
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 
138 GfxFlaresMode 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 
148 GfxWaterMode 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 
159 GfxSkyMode 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 
167 EfxReverbEngine ParseEfxReverbEngine(std::string const & s)
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 
296 void AssignHelper(CVar* cvar, int val)
297 {
298  Str<25> s; s << val;
299  App::GetConsole()->cVarAssign(cvar, s.ToCStr());
300 }
301 
302 void 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 
369 void Console::loadConfig()
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 
402 void 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 
435 void Console::saveConfig()
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 
CONF_EXTCAM_NONE
const char * CONF_EXTCAM_NONE
Definition: AppConfig.cpp:47
GfxWaterModeToStr
const char * GfxWaterModeToStr(GfxWaterMode v)
Definition: AppConfig.cpp:257
RoR::App::gfx_envmap_rate
CVar * gfx_envmap_rate
Definition: Application.cpp:245
ParseSimGearboxMode
SimGearboxMode ParseSimGearboxMode(std::string const &s)
Definition: AppConfig.cpp:128
CONF_VEGET_20PERC
const char * CONF_VEGET_20PERC
Definition: AppConfig.cpp:55
RoR::Console::cVarGet
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:292
CONF_FLARES_NO_LIGHT
const char * CONF_FLARES_NO_LIGHT
Definition: AppConfig.cpp:66
CONF_GFX_SHADOW_PSSM
const char * CONF_GFX_SHADOW_PSSM
Definition: AppConfig.cpp:42
GfxSkyModeToStr
const char * GfxSkyModeToStr(GfxSkyMode v)
Definition: AppConfig.cpp:271
RGN_CONFIG
#define RGN_CONFIG
Definition: Application.h:48
CONF_WATER_FULL_FAST
const char * CONF_WATER_FULL_FAST
Definition: AppConfig.cpp:74
CONF_FLARES_NONE
const char * CONF_FLARES_NONE
Definition: AppConfig.cpp:65
CONF_TEXFILTER_ANISO
const char * CONF_TEXFILTER_ANISO
Definition: AppConfig.cpp:52
IoInputGrabModeToStr
const char * IoInputGrabModeToStr(IoInputGrabMode v)
Definition: AppConfig.cpp:175
CONF_GEARBOX_MANUAL
const char * CONF_GEARBOX_MANUAL
Definition: AppConfig.cpp:61
CONF_TEXFILTER_TRILI
const char * CONF_TEXFILTER_TRILI
Definition: AppConfig.cpp:51
SimGearboxModeToStr
const char * SimGearboxModeToStr(SimGearboxMode v)
Definition: AppConfig.cpp:231
CONF_INPUT_GRAB_NONE
const char * CONF_INPUT_GRAB_NONE
Definition: AppConfig.cpp:87
ParseGfxShadowType
GfxShadowType ParseGfxShadowType(std::string const &s)
Definition: AppConfig.cpp:97
ContentManager.h
RoR::GfxWaterMode
GfxWaterMode
Definition: Application.h:394
CONF_SKY_CAELUM
const char * CONF_SKY_CAELUM
Definition: AppConfig.cpp:78
CONF_TEXFILTER_NONE
const char * CONF_TEXFILTER_NONE
Definition: AppConfig.cpp:49
CONF_EFX_REVERB_ENGINE_REVERB
const char * CONF_EFX_REVERB_ENGINE_REVERB
Definition: AppConfig.cpp:83
RoR::App::gfx_shadow_type
CVar * gfx_shadow_type
Definition: Application.cpp:229
RoR::App::gfx_extcam_mode
CVar * gfx_extcam_mode
Definition: Application.cpp:230
RoR::SanitizeUtf8String
std::string SanitizeUtf8String(std::string const &str_in)
Definition: Utils.cpp:120
RoR::Console::cVarFind
CVar * cVarFind(std::string const &input_name)
Find cvar by short/long name.
Definition: CVar.cpp:264
RoR::LogFormat
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
Definition: Application.cpp:440
Console.h
RoR::App::gfx_fov_external_default
CVar * gfx_fov_external_default
Definition: Application.cpp:251
CONF_WATER_NONE
const char * CONF_WATER_NONE
Definition: AppConfig.cpp:71
GfxShadowTypeToStr
const char * GfxShadowTypeToStr(GfxShadowType v)
Definition: AppConfig.cpp:186
Utils.h
RoR::App::gfx_texture_filter
CVar * gfx_texture_filter
Definition: Application.cpp:234
Language.h
CONF_EXTCAM_STATIC
const char * CONF_EXTCAM_STATIC
Definition: AppConfig.cpp:46
ParseIoInputGrabMode
IoInputGrabMode ParseIoInputGrabMode(std::string const &s)
Definition: AppConfig.cpp:90
RoR::CVAR_ARCHIVE
@ CVAR_ARCHIVE
Will be written to RoR.cfg.
Definition: CVar.h:41
RoR::GfxShadowType
GfxShadowType
Definition: Application.h:351
Actor.h
RoR::SimGearboxMode
SimGearboxMode
Definition: Application.h:338
ParseGfxExtCamMode
GfxExtCamMode ParseGfxExtCamMode(std::string const &s)
Definition: AppConfig.cpp:103
CONF_VEGET_50PERC
const char * CONF_VEGET_50PERC
Definition: AppConfig.cpp:56
GfxFlaresModeToStr
const char * GfxFlaresModeToStr(GfxFlaresMode v)
Definition: AppConfig.cpp:244
RoR::App::sim_gearbox_mode
CVar * sim_gearbox_mode
Definition: Application.cpp:108
CONF_WATER_REFLECT
const char * CONF_WATER_REFLECT
Definition: AppConfig.cpp:73
AssignHelper
void AssignHelper(CVar *cvar, int val)
Definition: AppConfig.cpp:296
RoR::App::app_config_long_names
CVar * app_config_long_names
Definition: Application.cpp:91
RoR::Str
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition: Str.h:35
RoR::Console::cVarAssign
void cVarAssign(CVar *cvar, std::string const &value)
Parse value by cvar type.
Definition: CVar.cpp:246
EfxReverbEngineToStr
const char * EfxReverbEngineToStr(EfxReverbEngine v)
Definition: AppConfig.cpp:282
CONF_INPUT_GRAB_ALL
const char * CONF_INPUT_GRAB_ALL
Definition: AppConfig.cpp:88
CONF_TEXFILTER_BILI
const char * CONF_TEXFILTER_BILI
Definition: AppConfig.cpp:50
CONF_WATER_HYDRAX
const char * CONF_WATER_HYDRAX
Definition: AppConfig.cpp:76
RoR::PathCombine
std::string PathCombine(std::string a, std::string b)
Definition: PlatformUtils.h:48
CONFIG_FILE_NAME
#define CONFIG_FILE_NAME
Definition: AppConfig.cpp:37
ErrorUtils.h
CONF_SKY_SKYX
const char * CONF_SKY_SKYX
Definition: AppConfig.cpp:79
CONF_SKY_SANDSTORM
const char * CONF_SKY_SANDSTORM
Definition: AppConfig.cpp:80
CONF_FLARES_ALL_HEADS
const char * CONF_FLARES_ALL_HEADS
Definition: AppConfig.cpp:68
RoR::IoInputGrabMode::DYNAMIC
@ DYNAMIC
RoR::Str::ToCStr
const char * ToCStr() const
Definition: Str.h:46
CONF_GFX_SHADOW_NONE
const char * CONF_GFX_SHADOW_NONE
Definition: AppConfig.cpp:43
CONF_EFX_REVERB_ENGINE_EAXREVERB
const char * CONF_EFX_REVERB_ENGINE_EAXREVERB
Definition: AppConfig.cpp:82
ParseGfxWaterMode
GfxWaterMode ParseGfxWaterMode(std::string const &s)
Definition: AppConfig.cpp:148
CONF_WATER_BASIC
const char * CONF_WATER_BASIC
Definition: AppConfig.cpp:72
PlatformUtils.h
Platform-specific utilities. We use narrow UTF-8 encoded strings as paths. Inspired by http://utf8eve...
CONF_FLARES_ALL_LIGHTS
const char * CONF_FLARES_ALL_LIGHTS
Definition: AppConfig.cpp:69
RoR::GfxExtCamMode
GfxExtCamMode
Definition: Application.h:358
RoR::GfxSkyMode
GfxSkyMode
Definition: Application.h:405
Application.h
Central state/object manager and communications hub.
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:286
RoR::GfxVegetation
GfxVegetation
Definition: Application.h:375
RoR::CVar::hasFlag
bool hasFlag(int f) const
Definition: CVar.h:105
ParseEfxReverbEngine
EfxReverbEngine ParseEfxReverbEngine(std::string const &s)
Definition: AppConfig.cpp:167
RoR::App::gfx_fov_internal_default
CVar * gfx_fov_internal_default
Definition: Application.cpp:253
WriteVarsHelper
void WriteVarsHelper(std::stringstream &f, const char *label, const char *prefix)
Definition: AppConfig.cpp:402
RoR::App::gfx_water_mode
CVar * gfx_water_mode
Definition: Application.cpp:236
RoR::App::gfx_flares_mode
CVar * gfx_flares_mode
Definition: Application.cpp:227
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:231
CONF_GEARBOX_MAN_RANGES
const char * CONF_GEARBOX_MAN_RANGES
Definition: AppConfig.cpp:63
GfxExtCamModeToStr
const char * GfxExtCamModeToStr(GfxExtCamMode v)
Definition: AppConfig.cpp:196
RoR::App::sys_config_dir
CVar * sys_config_dir
Definition: Application.cpp:164
RoR::CVar
Quake-style console variable, defined in RoR.cfg or crated via Console UI and scripts.
Definition: CVar.h:52
ParseHelper
void ParseHelper(CVar *cvar, std::string const &val)
Definition: AppConfig.cpp:302
RoR::App::gfx_shadow_quality
CVar * gfx_shadow_quality
Definition: Application.cpp:246
CONF_INPUT_GRAB_DYNAMIC
const char * CONF_INPUT_GRAB_DYNAMIC
Definition: AppConfig.cpp:86
RoR::EfxReverbEngine
EfxReverbEngine
Definition: Application.h:413
CONF_GEARBOX_AUTO
const char * CONF_GEARBOX_AUTO
Definition: AppConfig.cpp:59
RoR::CVar::getName
std::string const & getName() const
Definition: CVar.h:103
GfxVegetationToStr
const char * GfxVegetationToStr(GfxVegetation v)
Definition: AppConfig.cpp:219
CONF_EXTCAM_PITCHING
const char * CONF_EXTCAM_PITCHING
Definition: AppConfig.cpp:45
RoR::GfxFlaresMode
GfxFlaresMode
Definition: Application.h:384
RoR::App::audio_efx_reverb_engine
CVar * audio_efx_reverb_engine
Definition: Application.cpp:217
RoR::IoInputGrabMode
IoInputGrabMode
Definition: Application.h:421
RoR::IoInputGrabMode::ALL
@ ALL
ParseGfxTexFilter
GfxTexFilter ParseGfxTexFilter(std::string const &s)
Definition: AppConfig.cpp:110
Ogre
Definition: ExtinguishableFireAffector.cpp:35
ParseGfxSkyMode
GfxSkyMode ParseGfxSkyMode(std::string const &s)
Definition: AppConfig.cpp:159
CONF_FLARES_CURR_HEAD
const char * CONF_FLARES_CURR_HEAD
Definition: AppConfig.cpp:67
GfxTexFilterToStr
const char * GfxTexFilterToStr(GfxTexFilter v)
Definition: AppConfig.cpp:207
CONF_EFX_REVERB_ENGINE_NONE
const char * CONF_EFX_REVERB_ENGINE_NONE
Definition: AppConfig.cpp:84
CONF_WATER_FULL_HQ
const char * CONF_WATER_FULL_HQ
Definition: AppConfig.cpp:75
RoR::App::gfx_vegetation_mode
CVar * gfx_vegetation_mode
Definition: Application.cpp:235
RoR::IoInputGrabMode::NONE
@ NONE
CONF_GEARBOX_SEMIAUTO
const char * CONF_GEARBOX_SEMIAUTO
Definition: AppConfig.cpp:60
CONF_GEARBOX_MAN_STICK
const char * CONF_GEARBOX_MAN_STICK
Definition: AppConfig.cpp:62
CONF_VEGET_FULL
const char * CONF_VEGET_FULL
Definition: AppConfig.cpp:57
RoR::GfxTexFilter
GfxTexFilter
Definition: Application.h:366
RoR
Definition: AppContext.h:36
ParseGfxFlaresMode
GfxFlaresMode ParseGfxFlaresMode(std::string const &s)
Definition: AppConfig.cpp:138
CONF_VEGET_NONE
const char * CONF_VEGET_NONE
Definition: AppConfig.cpp:54
ParseGfxVegetation
GfxVegetation ParseGfxVegetation(std::string const &s)
Definition: AppConfig.cpp:119