Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
options.cpp
Go to the documentation of this file.
1 #include "options.h"
2 #include "configxml.h"
3 
4 extern VegaConfig *vs_config;
5 
7 {
8  /* General Options */
9  write_savegame_on_exit = XMLSupport::parse_bool( vs_config->getVariable( "general", "write_savegame_on_exit", "true" ) );
10  times_to_show_help_screen = XMLSupport::parse_int( vs_config->getVariable( "general", "times_to_show_help_screen", "3" ) );
11  remember_savegame = XMLSupport::parse_bool( vs_config->getVariable( "general", "remember_savegame", "true" ) );
12  new_game_save_name = vs_config->getVariable( "general", "new_game_save_name", "New_Game" );
14  XMLSupport::parse_int( vs_config->getVariable( "general", "quick_savegame_summaries_buffer", "16384" ) );
15  empty_mission = vs_config->getVariable( "general", "empty_mission", "internal.mission" );
16  custompython = vs_config->getVariable( "general", "custompython", "import custom;custom.processMessage" );
17  quick_savegame_summaries = XMLSupport::parse_bool( vs_config->getVariable( "general", "quick_savegame_summaries", "true" ) );
18  garbagecollectfrequency = XMLSupport::parse_int( vs_config->getVariable( "general", "garbagecollectfrequency", "20" ) );
19  numoldsystems = XMLSupport::parse_int( vs_config->getVariable( "general", "numoldsystems", "6" ) );
20  deleteoldsystems = XMLSupport::parse_bool( vs_config->getVariable( "general", "deleteoldsystems", "true" ) );
21  vsdebug = XMLSupport::parse_int(vs_config->getVariable("general", "verbose_output", "0" ));
22 
23  /* Audio Options */
24  threadtime = XMLSupport::parse_int( vs_config->getVariable( "audio", "threadtime", "1" ) );
25  missionvictorysong = vs_config->getVariable( "audio", "missionvictorysong", "../music/victory.ogg" );
26 
27  /* Cockpit Audio Options */
28  comm = vs_config->getVariable( "cockpitaudio", "comm", "vdu_c" );
29  scanning = vs_config->getVariable( "cockpitaudio", "scanning", "vdu_c" );
30  objective = vs_config->getVariable( "cockpitaudio", "objective", "vdu_c" );
31  examine = vs_config->getVariable( "cockpitaudio", "examine", "vdu_b" );
32  view = vs_config->getVariable( "cockpitaudio", "view", "vdu_b" );
33  repair = vs_config->getVariable( "cockpitaudio", "repair", "vdu_a" );
34  manifest = vs_config->getVariable( "cockpitaudio", "manifest", "vdu_a" );
35  compress_max = XMLSupport::parse_int( vs_config->getVariable( "cockpitaudio", "compress_max", "3" ) );
36  compress_loop = vs_config->getVariable( "cockpitaudio", "compress_loop", "compress_loop" );
37  compress_change = vs_config->getVariable( "cockpitaudio", "compress_change", "compress_burst" );
38  compress_stop = vs_config->getVariable( "cockpitaudio", "compress_stop", "compress_end" );
39  compress_interval = XMLSupport::parse_int( vs_config->getVariable( "cockpitaudio", "compress_interval", "3" ) );
40 
41  comm_preload = XMLSupport::parse_bool( vs_config->getVariable( "cockpitaudio", "comm_preload", "false" ) );
42 
43  /* Unit Audio Options */
44  jumpleave = vs_config->getVariable( "unitaudio", "jumpleave", "sfx43.wav" );
45 
46  /* Graphics Options */
47  jumpgate = vs_config->getVariable( "graphics", "jumpgate", "warp.ani" );
48  jumpanimationshrink = XMLSupport::parse_float( vs_config->getVariable( "graphics", "jumpanimationshrink", ".95" ) );
49  jumpgatesize = XMLSupport::parse_float( vs_config->getVariable( "graphics", "jumpgatesize", "1.75" ) );
51  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "hud", "switchToTargetModeOnKey", "true" ) );
52  camera_pan_speed = XMLSupport::parse_float( vs_config->getVariable( "graphics", "camera_pan_speed", "0.0001" ) );
53  background = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "background", "true" ) );
54  cockpit = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "cockpit", "true" ) );
55  disabled_cockpit_allowed = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "disabled_cockpit_allowed", "true" ) );
56  splash_screen = vs_config->getVariable( "graphics", "splash_screen", "vega_splash.ani" );
57  vbo = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "vbo", "false" ) );
58  num_near_stars = XMLSupport::parse_int( vs_config->getVariable( "graphics", "num_near_stars", "1000" ) );
59  num_far_stars = XMLSupport::parse_int( vs_config->getVariable( "graphics", "num_far_stars", "2000" ) );
60  star_spreading = XMLSupport::parse_float( vs_config->getVariable( "graphics", "star_spreading", "30000" ) );
61  usePlanetAtmosphere = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "usePlanetAtmosphere", "true" ) );
62  usePlanetFog = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "usePlanetFog", "true" ) );
63  reflectivity = XMLSupport::parse_float( vs_config->getVariable( "graphics", "reflectivity", ".2" ) );
64  hardware_cursor = XMLSupport::parse_bool( vs_config->getVariable( "physics", "hardware_cursor", "false" ) );
65  always_make_smooth_cam = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "always_make_smooth_cam", "false" ) ); //Not used yet
66  precull_dist = XMLSupport::parse_float( vs_config->getVariable( "graphics", "precull_dist", "500000000" ) );
68  XMLSupport::parse_bool( vs_config->getVariable( "graphics", "draw_near_stars_in_front_of_planets", "false" ) );
69  starblend = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "starblend", "true" ) );
70 
71  techniquesBasePath = vs_config->getVariable( "data", "techniques", "techniques" );
72  techniquesSubPath = vs_config->getVariable( "graphics", "technique_set", "." );
73 
74  /* Terrain Options */
75  xscale = XMLSupport::parse_float( vs_config->getVariable( "terrain", "xscale", "1.0" ) );
76  yscale = XMLSupport::parse_float( vs_config->getVariable( "terrain", "yscale", "1.0" ) );
77  zscale = XMLSupport::parse_float( vs_config->getVariable( "terrain", "zscale", "1.0" ) );
78  mass = XMLSupport::parse_float( vs_config->getVariable( "terrain", "mass", "100.0" ) );
79  radius = XMLSupport::parse_float( vs_config->getVariable( "terrain", "radius", "10000.0" ) );
80 
81  /* Player Options */
82 
83  /* Joystick Options */
84  joystick_exponent = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "joystick_exponent", "1.0" ) );
85  polling_rate = XMLSupport::parse_int( vs_config->getVariable( "joystick", "polling_rate", "0" ) );
86  force_use_of_joystick = XMLSupport::parse_bool( vs_config->getVariable( "joystick", "force_use_of_joystick", "false" ) );
88  XMLSupport::parse_bool( vs_config->getVariable( "joystick", "debug_digital_hatswitch", "false" ) );
89  deadband = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "deadband", "0.05" ) );
90  mouse_deadband = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "mouse_deadband", "0.025" ) );
91  warp_mouse = XMLSupport::parse_bool( vs_config->getVariable( "joystick", "warp_mouse", "false" ) );
92  mouse_sensitivity = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "mouse_sensitivity", "50.0" ) );
93  mouse_exponent = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "mouse_exponent", "3.0" ) );
94  mouse_blur = XMLSupport::parse_floatf( vs_config->getVariable( "joystick", "mouse_blur", ".025" ) );
95  force_feedback = XMLSupport::parse_bool( vs_config->getVariable( "joystick", "force_feedback", "false" ) );
96  ff_device = XMLSupport::parse_int( vs_config->getVariable( "joystick", "ff_device", "0" ) );
97 
98  /* AI Options */
99  AllowCivilWar = XMLSupport::parse_bool( vs_config->getVariable( "AI", "AllowCivilWar", "false" ) );
100  CappedFactionRating = XMLSupport::parse_bool( vs_config->getVariable( "AI", "CappedFactionRating", "true" ) );
101  AllowNonplayerFactionChange = XMLSupport::parse_bool( vs_config->getVariable( "AI", "AllowNonplayerFactionChange", "false" ) );
102  min_relationship = XMLSupport::parse_float( vs_config->getVariable( "AI", "min_relationship", "-20.0" ) );
103 
104  /* Physics Options */
105  Drone = vs_config->getVariable( "physics", "Drone", "drone" );
106  max_missions = XMLSupport::parse_int( vs_config->getVariable( "physics", "max_missions", "4" ) );
107  game_speed = XMLSupport::parse_float( vs_config->getVariable( "physics", "game_speed", "1.0" ) );
108  runtime_compactness = XMLSupport::parse_float( vs_config->getVariable( "physics", "runtime_compactness", "1.0" ) );
109  autogen_compactness = XMLSupport::parse_float( vs_config->getVariable( "physics", "autogen_compactness", "1.0" ) );
110  AsteroidDifficulty = XMLSupport::parse_float( vs_config->getVariable( "physics", "AsteroidDifficulty", ".4" ) );
111  YearScale = XMLSupport::parse_float( vs_config->getVariable( "physics", "YearScale", "10.0" ) );
113  XMLSupport::parse_bool( vs_config->getVariable( "physics", "game_speed_affects_autogen_systems", "false" ) );
114  star_system_scale = XMLSupport::parse_float( vs_config->getVariable( "physics", "star_system_scale", "1.0" ) );
115  respawn_unit_size = XMLSupport::parse_float( vs_config->getVariable( "physics", "respawn_unit_size", "400.0" ) );
117  XMLSupport::parse_floatf( vs_config->getVariable( "physics", "auto_pilot_planet_radius_percent", ".75" ) );
118  campaigns = vs_config->getVariable( "physics", "campaigns", "privateer_campaign vegastrike_campaign" ); //WRONG SECTION change after 0.5
119  NumRunningSystems = XMLSupport::parse_int( vs_config->getVariable( "physics", "NumRunningSystems", "4" ) );
120  InactiveSystemTime = XMLSupport::parse_floatf( vs_config->getVariable( "physics", "InactiveSystemTime", "0.3" ) );
121 
122  /* Data Options */
123  universe_path = vs_config->getVariable( "data", "universe_path", "universe" );
124  sectors = vs_config->getVariable( "data", "sectors", "sectors" ); //Not Used
125 
126  /* Galaxy Options */
127  PushValuesToMean = XMLSupport::parse_bool( vs_config->getVariable( "galaxy", "PushValuesToMean", "true" ) );
128 
129  /* Cargo Options */
130  news_from_cargolist = XMLSupport::parse_bool( vs_config->getVariable( "cargo", "news_from_cargolist", "false" ) );
131 }
132 
133 string vs_options::getCallsign( int squadnum )
134 {
135  return vs_config->getVariable( std::string( "player" )
136  +( (squadnum > 0) ? XMLSupport::tostring( squadnum+1 ) : std::string(
137  "" ) ), "callsign", "pilot" );
138 }
139