RigsofRods
Soft-body Physics Simulation
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_BASIC = "Basic (fastest)";
81 
82 const char* CONF_INPUT_GRAB_DYNAMIC = "Dynamically";
83 const char* CONF_INPUT_GRAB_NONE = "None";
84 const char* CONF_INPUT_GRAB_ALL = "All";
85 
86 IoInputGrabMode ParseIoInputGrabMode(std::string const & s)
87 {
89  if (s == CONF_INPUT_GRAB_NONE ) { return RoR::IoInputGrabMode::NONE ; }
90  else { return RoR::IoInputGrabMode::ALL ; }
91 }
92 
93 GfxShadowType ParseGfxShadowType(std::string const & s)
94 {
95  if (s == CONF_GFX_SHADOW_PSSM) { return GfxShadowType::PSSM ; }
96  else { return GfxShadowType::NONE ; }
97 }
98 
99 GfxExtCamMode ParseGfxExtCamMode(std::string const & s)
100 {
101  if (s == CONF_EXTCAM_PITCHING) { return GfxExtCamMode::PITCHING ; }
102  if (s == CONF_EXTCAM_STATIC) { return GfxExtCamMode::STATIC ; }
103  else { return GfxExtCamMode::NONE ; }
104 }
105 
106 GfxTexFilter ParseGfxTexFilter(std::string const & s)
107 {
108  if (s == CONF_TEXFILTER_NONE) { return GfxTexFilter::NONE ; }
109  if (s == CONF_TEXFILTER_BILI) { return GfxTexFilter::BILINEAR ; }
110  if (s == CONF_TEXFILTER_TRILI) { return GfxTexFilter::TRILINEAR ; }
111  if (s == CONF_TEXFILTER_ANISO) { return GfxTexFilter::ANISOTROPIC ; }
112  else { return GfxTexFilter::NONE ; }
113 }
114 
115 GfxVegetation ParseGfxVegetation(std::string const & s)
116 {
117  if (s == CONF_VEGET_NONE ) { return GfxVegetation::NONE ; }
118  if (s == CONF_VEGET_20PERC) { return GfxVegetation::x20PERC ; }
119  if (s == CONF_VEGET_50PERC) { return GfxVegetation::x50PERC ; }
120  if (s == CONF_VEGET_FULL ) { return GfxVegetation::FULL ; }
121  else { return GfxVegetation::NONE ; }
122 }
123 
124 SimGearboxMode ParseSimGearboxMode(std::string const & s)
125 {
126  if (s == CONF_GEARBOX_AUTO ) { return SimGearboxMode::AUTO ; }
127  if (s == CONF_GEARBOX_SEMIAUTO ) { return SimGearboxMode::SEMI_AUTO ; }
128  if (s == CONF_GEARBOX_MANUAL ) { return SimGearboxMode::MANUAL ; }
129  if (s == CONF_GEARBOX_MAN_STICK ) { return SimGearboxMode::MANUAL_STICK ; }
130  if (s == CONF_GEARBOX_MAN_RANGES) { return SimGearboxMode::MANUAL_RANGES ; }
131  else { return SimGearboxMode::AUTO ; }
132 }
133 
134 GfxFlaresMode ParseGfxFlaresMode(std::string const & s)
135 {
136  if (s == CONF_FLARES_NONE ) { return GfxFlaresMode::NONE ; }
137  if (s == CONF_FLARES_NO_LIGHT ) { return GfxFlaresMode::NO_LIGHTSOURCES ; }
138  if (s == CONF_FLARES_CURR_HEAD ) { return GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY ; }
139  if (s == CONF_FLARES_ALL_HEADS ) { return GfxFlaresMode::ALL_VEHICLES_HEAD_ONLY ; }
140  if (s == CONF_FLARES_ALL_LIGHTS) { return GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS ; }
141  else { return GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY ; }
142 }
143 
144 GfxWaterMode ParseGfxWaterMode(std::string const & s)
145 {
146  if (s == CONF_WATER_NONE ) { return GfxWaterMode::NONE ; }
147  if (s == CONF_WATER_BASIC ) { return GfxWaterMode::BASIC ; }
148  if (s == CONF_WATER_REFLECT ) { return GfxWaterMode::REFLECT ; }
149  if (s == CONF_WATER_FULL_FAST) { return GfxWaterMode::FULL_FAST ; }
150  if (s == CONF_WATER_FULL_HQ ) { return GfxWaterMode::FULL_HQ ; }
151  if (s == CONF_WATER_HYDRAX ) { return GfxWaterMode::HYDRAX ; }
152  else { return GfxWaterMode::BASIC ; }
153 }
154 
155 GfxSkyMode ParseGfxSkyMode(std::string const & s)
156 {
157  if (s == CONF_SKY_BASIC) { return GfxSkyMode::BASIC ; }
158  if (s == CONF_SKY_CAELUM ) { return GfxSkyMode::CAELUM ; }
159  if (s == CONF_SKY_SKYX ) { return GfxSkyMode::SKYX ; }
160  else { return GfxSkyMode::BASIC ; }
161 }
162 
164 {
165  switch (v)
166  {
167  case IoInputGrabMode::DYNAMIC: return CONF_INPUT_GRAB_DYNAMIC;
168  case IoInputGrabMode::NONE : return CONF_INPUT_GRAB_NONE;
169  case IoInputGrabMode::ALL : return CONF_INPUT_GRAB_ALL;
170  default : return "";
171  }
172 }
173 
175 {
176  switch (v)
177  {
178  case GfxShadowType::PSSM : return CONF_GFX_SHADOW_PSSM;
179  case GfxShadowType::NONE : return CONF_GFX_SHADOW_NONE;
180  default : return "";
181  }
182 }
183 
185 {
186  switch (v)
187  {
188  case GfxExtCamMode::PITCHING: return CONF_EXTCAM_PITCHING;
189  case GfxExtCamMode::STATIC : return CONF_EXTCAM_STATIC;
190  case GfxExtCamMode::NONE : return CONF_EXTCAM_NONE;
191  default : return "";
192  }
193 }
194 
196 {
197  switch (v)
198  {
199  case GfxTexFilter::NONE : return CONF_TEXFILTER_NONE;
200  case GfxTexFilter::BILINEAR : return CONF_TEXFILTER_BILI;
201  case GfxTexFilter::TRILINEAR : return CONF_TEXFILTER_TRILI;
202  case GfxTexFilter::ANISOTROPIC: return CONF_TEXFILTER_ANISO;
203  default : return "";
204  }
205 }
206 
208 {
209  switch (v)
210  {
211  case GfxVegetation::NONE : return CONF_VEGET_NONE;
212  case GfxVegetation::x20PERC: return CONF_VEGET_20PERC;
213  case GfxVegetation::x50PERC: return CONF_VEGET_50PERC;
214  case GfxVegetation::FULL : return CONF_VEGET_FULL;
215  default : return "";
216  }
217 }
218 
220 {
221  switch (v)
222  {
223  case SimGearboxMode::AUTO : return CONF_GEARBOX_AUTO;
224  case SimGearboxMode::SEMI_AUTO : return CONF_GEARBOX_SEMIAUTO;
225  case SimGearboxMode::MANUAL : return CONF_GEARBOX_MANUAL;
226  case SimGearboxMode::MANUAL_STICK : return CONF_GEARBOX_MAN_STICK;
227  case SimGearboxMode::MANUAL_RANGES: return CONF_GEARBOX_MAN_RANGES;
228  default : return "";
229  }
230 }
231 
233 {
234  switch(v)
235  {
236  case GfxFlaresMode::NONE : return CONF_FLARES_NONE;
237  case GfxFlaresMode::NO_LIGHTSOURCES : return CONF_FLARES_NO_LIGHT;
238  case GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY : return CONF_FLARES_CURR_HEAD;
239  case GfxFlaresMode::ALL_VEHICLES_HEAD_ONLY : return CONF_FLARES_ALL_HEADS;
240  case GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS: return CONF_FLARES_ALL_LIGHTS;
241  default : return "";
242  }
243 }
244 
246 {
247  switch(v)
248  {
249  case GfxWaterMode::NONE : return CONF_WATER_NONE;
250  case GfxWaterMode::BASIC : return CONF_WATER_BASIC;
251  case GfxWaterMode::REFLECT : return CONF_WATER_REFLECT;
252  case GfxWaterMode::FULL_FAST: return CONF_WATER_FULL_FAST;
253  case GfxWaterMode::FULL_HQ : return CONF_WATER_FULL_HQ;
254  case GfxWaterMode::HYDRAX : return CONF_WATER_HYDRAX;
255  default : return "";
256  }
257 }
258 
260 {
261  switch(v)
262  {
263  case GfxSkyMode::CAELUM : return CONF_SKY_CAELUM;
264  case GfxSkyMode::SKYX : return CONF_SKY_SKYX;
265  case GfxSkyMode::BASIC: return CONF_SKY_BASIC;
266  default : return "";
267  }
268 }
269 
270 // --------------------------------
271 // Config file parsing
272 
273 void AssignHelper(CVar* cvar, int val)
274 {
275  Str<25> s; s << val;
276  App::GetConsole()->cVarAssign(cvar, s.ToCStr());
277 }
278 
279 void ParseHelper(CVar* cvar, std::string const & val)
280 {
281  if (cvar->getName() == App::gfx_envmap_rate->getName())
282  {
283  int rate = Ogre::StringConverter::parseInt(val);
284  if (rate < 0) { rate = 0; }
285  if (rate > 6) { rate = 6; }
287  }
288  else if (cvar->getName() == App::gfx_shadow_quality->getName())
289  {
290  int quality = Ogre::StringConverter::parseInt(val);
291  if (quality < 0) { quality = 0; }
292  if (quality > 3) { quality = 3; }
294  }
295  else if (cvar->getName() == App::gfx_shadow_type->getName())
296  {
298  }
299  else if (cvar->getName() == App::gfx_extcam_mode->getName())
300  {
302  }
303  else if (cvar->getName() == App::gfx_texture_filter->getName())
304  {
306  }
307  else if (cvar->getName() == App::gfx_vegetation_mode->getName())
308  {
310  }
311  else if (cvar->getName() == App::gfx_flares_mode->getName())
312  {
314  }
315  else if (cvar->getName() == App::gfx_water_mode->getName())
316  {
318  }
319  else if (cvar->getName() == App::gfx_sky_mode->getName())
320  {
322  }
323  else if (cvar->getName() == App::sim_gearbox_mode->getName())
324  {
326  }
327  else if (cvar->getName() == App::gfx_fov_external_default->getName() ||
329  {
330  int fov = Ogre::StringConverter::parseInt(val);
331  if (fov >= 10) // FOV shouldn't be below 10
332  {
333  AssignHelper(cvar, fov);
334  }
335  }
336  else
337  {
338  App::GetConsole()->cVarAssign(cvar, val);
339  }
340 }
341 
342 void Console::loadConfig()
343 {
344  Ogre::ConfigFile cfg;
345  try
346  {
347  std::string path = PathCombine(App::sys_config_dir->getStr(), CONFIG_FILE_NAME);
348  cfg.load(path, "=:\t", /*trimWhitespace=*/true);
349 
350  Ogre::ConfigFile::SettingsIterator i = cfg.getSettingsIterator();
351  while (i.hasMoreElements())
352  {
353  std::string cvar_name = SanitizeUtf8String(i.peekNextKey());
354  CVar* cvar = App::GetConsole()->cVarFind(cvar_name);
355  if (cvar && !cvar->hasFlag(CVAR_ARCHIVE))
356  {
357  RoR::LogFormat("[RoR|Settings] CVar '%s' cannot be set from %s (defined without 'archive' flag)", cvar->getName().c_str(), CONFIG_FILE_NAME);
358  i.moveNext();
359  continue;
360  }
361 
362  if (!cvar)
363  {
364  cvar = App::GetConsole()->cVarGet(cvar_name, CVAR_ARCHIVE);
365  }
366 
367  ParseHelper(cvar, SanitizeUtf8String(i.peekNextValue()));
368 
369  i.moveNext();
370  }
371  }
372  catch (Ogre::FileNotFoundException&) {} // Just continue with defaults...
373 }
374 
375 void WriteVarsHelper(std::stringstream& f, const char* label, const char* prefix)
376 {
377  f << std::endl << "; " << label << std::endl;
378 
379  for (auto& pair: App::GetConsole()->getCVars())
380  {
381  if (pair.second->hasFlag(CVAR_ARCHIVE) && pair.first.find(prefix) == 0)
382  {
383  if (App::app_config_long_names->getBool())
384  {
385  f << pair.second->getLongName() << "=";
386  }
387  else
388  {
389  f << pair.second->getName() << "=";
390  }
391 
392  if (pair.second->getName() == App::gfx_shadow_type->getName() ){ f << GfxShadowTypeToStr(App::gfx_shadow_type ->getEnum<GfxShadowType>()); }
393  else if (pair.second->getName() == App::gfx_extcam_mode->getName() ){ f << GfxExtCamModeToStr(App::gfx_extcam_mode ->getEnum<GfxExtCamMode>()); }
394  else if (pair.second->getName() == App::gfx_texture_filter->getName() ){ f << GfxTexFilterToStr (App::gfx_texture_filter ->getEnum<GfxTexFilter>()); }
395  else if (pair.second->getName() == App::gfx_vegetation_mode->getName() ){ f << GfxVegetationToStr(App::gfx_vegetation_mode ->getEnum<GfxVegetation>()); }
396  else if (pair.second->getName() == App::gfx_flares_mode->getName() ){ f << GfxFlaresModeToStr(App::gfx_flares_mode ->getEnum<GfxFlaresMode>()); }
397  else if (pair.second->getName() == App::gfx_water_mode->getName() ){ f << GfxWaterModeToStr (App::gfx_water_mode ->getEnum<GfxWaterMode>()); }
398  else if (pair.second->getName() == App::gfx_sky_mode->getName() ){ f << GfxSkyModeToStr (App::gfx_sky_mode ->getEnum<GfxSkyMode>()); }
399  else if (pair.second->getName() == App::sim_gearbox_mode->getName() ){ f << SimGearboxModeToStr(App::sim_gearbox_mode->getEnum<SimGearboxMode>()); }
400  else { f << pair.second->getStr(); }
401 
402  f << std::endl;
403  }
404  }
405 }
406 
407 void Console::saveConfig()
408 {
409  std::stringstream f;
410 
411  f << "; Rigs of Rods configuration file" << std::endl;
412  f << "; -------------------------------" << std::endl;
413 
414  WriteVarsHelper(f, "Application", "app_");
415  WriteVarsHelper(f, "Multiplayer", "mp_");
416  WriteVarsHelper(f, "Simulation", "sim_");
417  WriteVarsHelper(f, "Input/Output", "io_");
418  WriteVarsHelper(f, "Graphics", "gfx_");
419  WriteVarsHelper(f, "GUI", "ui_");
420  WriteVarsHelper(f, "Audio", "audio_");
421  WriteVarsHelper(f, "Diagnostics", "diag_");
422 
423  try
424  {
425  Ogre::DataStreamPtr stream
426  = Ogre::ResourceGroupManager::getSingleton().createResource(
427  CONFIG_FILE_NAME, RGN_CONFIG, /*overwrite=*/true);
428  size_t written = stream->write(f.str().c_str(), f.str().length());
429  if (written < f.str().length())
430  {
431  RoR::LogFormat("[RoR] Error writing file '%s' (resource group '%s'), ",
432  "only written %u out of %u bytes!",
433  CONFIG_FILE_NAME, RGN_CONFIG, written, f.str().length());
434  }
435  }
436  catch (std::exception& e)
437  {
438  RoR::LogFormat("[RoR|Settings] Error writing file '%s' (resource group '%s'), message: '%s'",
439  CONFIG_FILE_NAME, RGN_CONFIG, e.what());
440  }
441 }
442 
443 
CONF_EXTCAM_NONE
const char * CONF_EXTCAM_NONE
Definition: AppConfig.cpp:47
GfxWaterModeToStr
const char * GfxWaterModeToStr(GfxWaterMode v)
Definition: AppConfig.cpp:245
RoR::App::gfx_envmap_rate
CVar * gfx_envmap_rate
Definition: Application.cpp:232
ParseSimGearboxMode
SimGearboxMode ParseSimGearboxMode(std::string const &s)
Definition: AppConfig.cpp:124
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:275
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:259
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:163
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:219
CONF_INPUT_GRAB_NONE
const char * CONF_INPUT_GRAB_NONE
Definition: AppConfig.cpp:83
ParseGfxShadowType
GfxShadowType ParseGfxShadowType(std::string const &s)
Definition: AppConfig.cpp:93
ContentManager.h
RoR::GfxWaterMode
GfxWaterMode
Definition: Application.h:234
CONF_SKY_CAELUM
const char * CONF_SKY_CAELUM
Definition: AppConfig.cpp:78
CONF_TEXFILTER_NONE
const char * CONF_TEXFILTER_NONE
Definition: AppConfig.cpp:49
RoR::App::gfx_shadow_type
CVar * gfx_shadow_type
Definition: Application.cpp:216
RoR::App::gfx_extcam_mode
CVar * gfx_extcam_mode
Definition: Application.cpp:217
RoR::SanitizeUtf8String
std::string SanitizeUtf8String(std::string const &str_in)
Definition: Utils.cpp:117
RoR::Console::cVarFind
CVar * cVarFind(std::string const &input_name)
Find cvar by short/long name.
Definition: CVar.cpp:247
RoR::LogFormat
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
Definition: Application.cpp:367
Console.h
RoR::App::gfx_fov_external_default
CVar * gfx_fov_external_default
Definition: Application.cpp:238
CONF_WATER_NONE
const char * CONF_WATER_NONE
Definition: AppConfig.cpp:71
GfxShadowTypeToStr
const char * GfxShadowTypeToStr(GfxShadowType v)
Definition: AppConfig.cpp:174
Utils.h
RoR::App::gfx_texture_filter
CVar * gfx_texture_filter
Definition: Application.cpp:221
Language.h
CONF_EXTCAM_STATIC
const char * CONF_EXTCAM_STATIC
Definition: AppConfig.cpp:46
ParseIoInputGrabMode
IoInputGrabMode ParseIoInputGrabMode(std::string const &s)
Definition: AppConfig.cpp:86
RoR::CVAR_ARCHIVE
@ CVAR_ARCHIVE
Will be written to RoR.cfg.
Definition: CVar.h:41
RoR::GfxShadowType
GfxShadowType
Definition: Application.h:191
Actor.h
RoR::SimGearboxMode
SimGearboxMode
Definition: Application.h:178
ParseGfxExtCamMode
GfxExtCamMode ParseGfxExtCamMode(std::string const &s)
Definition: AppConfig.cpp:99
CONF_VEGET_50PERC
const char * CONF_VEGET_50PERC
Definition: AppConfig.cpp:56
GfxFlaresModeToStr
const char * GfxFlaresModeToStr(GfxFlaresMode v)
Definition: AppConfig.cpp:232
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:273
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:229
CONF_INPUT_GRAB_ALL
const char * CONF_INPUT_GRAB_ALL
Definition: AppConfig.cpp:84
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_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
ParseGfxWaterMode
GfxWaterMode ParseGfxWaterMode(std::string const &s)
Definition: AppConfig.cpp:144
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:198
RoR::GfxSkyMode
GfxSkyMode
Definition: Application.h:245
Application.h
Central state/object manager and communications hub.
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:269
RoR::GfxVegetation
GfxVegetation
Definition: Application.h:215
RoR::CVar::hasFlag
bool hasFlag(int f) const
Definition: CVar.h:105
RoR::App::gfx_fov_internal_default
CVar * gfx_fov_internal_default
Definition: Application.cpp:240
WriteVarsHelper
void WriteVarsHelper(std::stringstream &f, const char *label, const char *prefix)
Definition: AppConfig.cpp:375
RoR::App::gfx_water_mode
CVar * gfx_water_mode
Definition: Application.cpp:223
RoR::App::gfx_flares_mode
CVar * gfx_flares_mode
Definition: Application.cpp:214
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:218
CONF_GEARBOX_MAN_RANGES
const char * CONF_GEARBOX_MAN_RANGES
Definition: AppConfig.cpp:63
GfxExtCamModeToStr
const char * GfxExtCamModeToStr(GfxExtCamMode v)
Definition: AppConfig.cpp:184
RoR::App::sys_config_dir
CVar * sys_config_dir
Definition: Application.cpp:163
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:279
RoR::App::gfx_shadow_quality
CVar * gfx_shadow_quality
Definition: Application.cpp:233
CONF_INPUT_GRAB_DYNAMIC
const char * CONF_INPUT_GRAB_DYNAMIC
Definition: AppConfig.cpp:82
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:207
CONF_EXTCAM_PITCHING
const char * CONF_EXTCAM_PITCHING
Definition: AppConfig.cpp:45
RoR::GfxFlaresMode
GfxFlaresMode
Definition: Application.h:224
RoR::IoInputGrabMode
IoInputGrabMode
Definition: Application.h:253
RoR::IoInputGrabMode::ALL
@ ALL
ParseGfxTexFilter
GfxTexFilter ParseGfxTexFilter(std::string const &s)
Definition: AppConfig.cpp:106
Ogre
Definition: ExtinguishableFireAffector.cpp:35
ParseGfxSkyMode
GfxSkyMode ParseGfxSkyMode(std::string const &s)
Definition: AppConfig.cpp:155
CONF_FLARES_CURR_HEAD
const char * CONF_FLARES_CURR_HEAD
Definition: AppConfig.cpp:67
GfxTexFilterToStr
const char * GfxTexFilterToStr(GfxTexFilter v)
Definition: AppConfig.cpp:195
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:222
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:206
RoR
Definition: AppContext.h:36
ParseGfxFlaresMode
GfxFlaresMode ParseGfxFlaresMode(std::string const &s)
Definition: AppConfig.cpp:134
CONF_VEGET_NONE
const char * CONF_VEGET_NONE
Definition: AppConfig.cpp:54
ParseGfxVegetation
GfxVegetation ParseGfxVegetation(std::string const &s)
Definition: AppConfig.cpp:115
CONF_SKY_BASIC
const char * CONF_SKY_BASIC
Definition: AppConfig.cpp:80