tron@2186: /* $Id$ */ tron@2186: belugas@6919: /** @file variables.h */ belugas@6919: truelight@0: #ifndef VARIABLES_H truelight@0: #define VARIABLES_H truelight@0: KUDr@3900: #include "yapf/yapf_settings.h" KUDr@3900: belugas@6919: /* ********* START OF SAVE REGION */ truelight@0: celestar@5936: #include "gfx.h" celestar@5936: belugas@6919: /* Prices and also the fractional part. */ truelight@0: VARDEF Prices _price; truelight@0: VARDEF uint16 _price_frac[NUM_PRICES]; truelight@0: rubidium@7450: VARDEF Money _cargo_payment_rates[NUM_CARGO]; truelight@0: VARDEF uint16 _cargo_payment_rates_frac[NUM_CARGO]; truelight@0: rubidium@6574: struct GameOptions { truelight@0: GameDifficulty diff; truelight@0: byte diff_level; truelight@0: byte currency; peter1138@3342: byte units; truelight@0: byte town_name; truelight@0: byte landscape; truelight@0: byte snow_line; truelight@0: byte autosave; truelight@0: byte road_side; rubidium@6574: }; truelight@0: Darkvater@1500: /* These are the options for the current game Darkvater@1500: * either ingame, or loaded. Also used for networking games */ truelight@0: VARDEF GameOptions _opt; truelight@0: Darkvater@1500: /* These are the default options for a new game */ Darkvater@1500: VARDEF GameOptions _opt_newgame; Darkvater@1500: belugas@6919: /* Pointer to one of the two _opt OR _opt_newgame structs */ Darkvater@1500: VARDEF GameOptions *_opt_ptr; truelight@0: belugas@6919: /* Amount of game ticks */ truelight@0: VARDEF uint16 _tick_counter; truelight@0: belugas@6919: /* This one is not used anymore. */ truelight@0: VARDEF VehicleID _vehicle_id_ctr_day; truelight@0: belugas@6919: /* Skip aging of cargo? */ truelight@0: VARDEF byte _age_cargo_skip_counter; truelight@0: belugas@6919: /* Position in tile loop */ truelight@0: VARDEF TileIndex _cur_tileloop_tile; truelight@0: belugas@6919: /* Also save scrollpos_x, scrollpos_y and zoom */ truelight@0: VARDEF uint16 _disaster_delay; truelight@0: belugas@6919: /* Determines what station to operate on in the belugas@6919: * tick handler. */ truelight@0: VARDEF uint16 _station_tick_ctr; truelight@0: signde@206: VARDEF uint32 _random_seeds[2][2]; ludde@2073: belugas@6919: /* Iterator through all towns in OnTick_Town */ pasky@1517: VARDEF uint32 _cur_town_ctr; belugas@6919: /* Frequency iterator at the same place */ pasky@1529: VARDEF uint32 _cur_town_iter; truelight@0: truelight@0: VARDEF uint _cur_player_tick_index; truelight@0: VARDEF uint _next_competitor_start; truelight@0: belugas@6919: /* Determines how often to run the tree loop */ truelight@0: VARDEF byte _trees_tick_ctr; truelight@0: belugas@6919: /* Keep track of current game position */ truelight@0: VARDEF int _saved_scrollpos_x; truelight@0: VARDEF int _saved_scrollpos_y; truelight@0: belugas@6919: /* ********* END OF SAVE REGION */ truelight@0: rubidium@6574: struct Patches { rubidium@4344: bool modified_catchment; // different-size catchment areas rubidium@4344: bool vehicle_speed; // show vehicle speed rubidium@4344: bool build_on_slopes; // allow building on slopes rubidium@4344: bool mammoth_trains; // allow very long trains rubidium@4344: bool join_stations; // allow joining of train stations rubidium@4344: bool full_load_any; // new full load calculation, any cargo must be full rubidium@4344: bool improved_load; // improved loading algorithm peter1138@5211: bool gradual_loading; // load vehicles gradually rubidium@4344: byte station_spread; // amount a station may spread rubidium@4344: bool inflation; // disable inflation rubidium@4344: bool selectgoods; // only send the goods to station if a train has been there rubidium@4344: bool longbridges; // allow 100 tile long bridges rubidium@4344: bool gotodepot; // allow goto depot in orders rubidium@7673: uint8 raw_industry_construction; ///< Type of (raw) industry construction (none, "normal", prospecting) rubidium@4344: bool multiple_industry_per_town; // allow many industries of the same type per town rubidium@4344: bool same_industry_close; // allow same type industries to be built close to each other KUDr@4870: bool lost_train_warn; // if a train can't find its destination, show a warning dominik@55: uint8 order_review_system; rubidium@4344: bool train_income_warn; // if train is generating little income, show a warning rubidium@4344: bool status_long_date; // always show long date in status bar rubidium@4344: bool signal_side; // show signals on right side rubidium@4344: bool show_finances; // show finances at end of year rubidium@4344: bool new_nonstop; // ttdpatch compatible nonstop handling rubidium@4344: bool roadveh_queue; // buggy road vehicle queueing rubidium@4344: bool autoscroll; // scroll when moving mouse to the edge. rubidium@4344: byte errmsg_duration; // duration of error message rubidium@4344: byte land_generator; // the landscape generator rubidium@4344: byte oil_refinery_limit; // distance oil refineries allowed from map edge rubidium@4344: byte snow_line_height; // a number 0-15 that configured snow line height rubidium@4344: byte tgen_smoothness; // how rough is the terrain from 0-3 rubidium@4344: uint32 generation_seed; // noise seed for world generation rubidium@4344: byte tree_placer; // the tree placer algorithm rubidium@4344: byte heightmap_rotation; // rotation director for the heightmap rubidium@4344: byte se_flat_world_height; // land height a flat world gets in SE rubidium@4344: bool bribe; // enable bribing the local authority rubidium@4344: bool nonuniform_stations; // allow nonuniform train stations maedhros@7170: bool adjacent_stations; // allow stations to be built directly adjacent to other stations rubidium@4344: bool always_small_airport; // always allow small airports rubidium@4344: bool realistic_acceleration; // realistic acceleration for trains rubidium@4344: bool wagon_speed_limits; // enable wagon speed limits rubidium@4344: bool forbid_90_deg; // forbid trains to make 90 deg turns rubidium@4344: bool invisible_trees; // don't show trees when buildings are transparent darkvater@1037: bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled rubidium@4344: bool link_terraform_toolbar; // display terraform toolbar when displaying rail, road, water and airport toolbars rubidium@4344: bool reverse_scroll; // Right-Click-Scrolling scrolls in the opposite direction peter1138@7226: bool smooth_scroll; ///< Smooth scroll viewports KUDr@5116: bool disable_elrails; // when true, the elrails are disabled Darkvater@4834: bool measure_tooltip; // Show a permanent tooltip when dragging tools peter1138@4616: byte liveries; // Options for displaying company liveries, 0=none, 1=self, 2=all Darkvater@5107: bool prefer_teamchat; // Choose the chat message target with , true=all players, false=your team rubidium@7139: bool advanced_vehicle_list; // Use the "advanced" vehicle list truelight@7494: bool loading_indicators; // Show loading indicators rubidium@7560: uint8 default_rail_type; ///< The default rail type for the rail GUI truelight@0: rubidium@4344: uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right rubidium@4344: uint8 window_snap_radius; // Windows snap at each other if closer than this truelight@0: rubidium@7582: bool always_build_infrastructure; ///< Always allow building of infrastructure, even when you do not have the vehicles for it rubidium@4344: UnitID max_trains; // max trains in game per player (these are 16bit because the unitnumber field can't hold more) rubidium@4344: UnitID max_roadveh; // max trucks in game per player rubidium@4344: UnitID max_aircraft; // max planes in game per player rubidium@4344: UnitID max_ships; // max ships in game per player rubidium@4344: rubidium@4344: bool servint_ispercent; // service intervals are in percents rubidium@4344: uint16 servint_trains; // service interval for trains rubidium@4344: uint16 servint_roadveh; // service interval for road vehicles rubidium@4344: uint16 servint_aircraft; // service interval for aircraft rubidium@4344: uint16 servint_ships; // service interval for ships truelight@0: truelight@0: bool autorenew; truelight@26: int16 autorenew_months; truelight@26: int32 autorenew_money; truelight@0: rubidium@4344: byte pf_maxdepth; // maximum recursion depth when searching for a train route for new pathfinder rubidium@4344: uint16 pf_maxlength; // maximum length when searching for a train route for new pathfinder truelight@0: truelight@193: rubidium@4344: bool bridge_pillars; // show bridge pillars for high bridges truelight@0: rubidium@4344: bool ai_disable_veh_train; // disable types for AI rubidium@4344: bool ai_disable_veh_roadveh; // disable types for AI rubidium@4344: bool ai_disable_veh_aircraft; // disable types for AI rubidium@4344: bool ai_disable_veh_ship; // disable types for AI rubidium@4344: Year starting_year; // starting date rubidium@4344: Year ending_year; // end of the game (just show highscore) rubidium@4344: Year colored_news_year; // when does newspaper become colored? truelight@0: rubidium@4344: bool keep_all_autosave; // name the autosave in a different way. rubidium@4344: bool autosave_on_exit; // save an autosave when you quit the game, but do not ask "Do you really want to quit?" rubidium@4344: byte max_num_autosaves; // controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1) rubidium@4344: bool extra_dynamite; // extra dynamite rubidium@6338: bool road_stop_on_town_road; // allow building of drive-through road stops on town owned roads truelight@0: rubidium@4344: bool never_expire_vehicles; // never expire vehicles rubidium@4344: byte extend_vehicle_life; // extend vehicle life by this many years truelight@0: rubidium@4344: bool auto_euro; // automatically switch to euro in 2002 rubidium@4344: bool serviceathelipad; // service helicopters at helipads automatically (no need to send to depot) rubidium@4344: bool smooth_economy; // smooth economy rubidium@4344: bool allow_shares; // allow the buying/selling of shares rubidium@4344: byte dist_local_authority; // distance for town local authority, default 20 rubidium@4344: rubidium@4344: byte wait_oneway_signal; // waitingtime in days before a oneway signal rubidium@4344: byte wait_twoway_signal; // waitingtime in days before a twoway signal rubidium@4344: rubidium@4344: uint8 map_x; // Size of map bjarni@3126: uint8 map_y; tron@1218: rubidium@4344: byte drag_signals_density; // many signals density maedhros@5939: Year semaphore_build_before; // Build semaphore signals automatically before this year rubidium@4344: bool ainew_active; // Is the new AI active? rubidium@4344: bool ai_in_multiplayer; // Do we allow AIs in multiplayer truelight@835: matthijs@1700: /* rubidium@4549: * New Path Finding rubidium@4549: */ matthijs@1247: bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */ matthijs@1247: matthijs@1700: /** rubidium@4549: * The maximum amount of search nodes a single NPF run should take. This rubidium@4549: * limit should make sure performance stays at acceptable levels at the cost rubidium@4549: * of not being perfect anymore. This will probably be fixed in a more rubidium@4549: * sophisticated way sometime soon rubidium@4549: */ matthijs@1700: uint32 npf_max_search_nodes; matthijs@1700: belugas@6919: uint32 npf_rail_firstred_penalty; // The penalty for when the first signal is red (and it is not an exit or combo signal) belugas@6919: uint32 npf_rail_firstred_exit_penalty; // The penalty for when the first signal is red (and it is an exit or combo signal) belugas@6919: uint32 npf_rail_lastred_penalty; // The penalty for when the last signal is red belugas@6919: uint32 npf_rail_station_penalty; // The penalty for station tiles belugas@6919: uint32 npf_rail_slope_penalty; // The penalty for sloping upwards belugas@6919: uint32 npf_rail_curve_penalty; // The penalty for curves belugas@6919: uint32 npf_rail_depot_reverse_penalty; // The penalty for reversing in depots belugas@6919: uint32 npf_buoy_penalty; // The penalty for going over (through) a buoy belugas@6919: uint32 npf_water_curve_penalty; // The penalty for curves belugas@6919: uint32 npf_road_curve_penalty; // The penalty for curves belugas@6919: uint32 npf_crossing_penalty; // The penalty for level crossings belugas@6919: uint32 npf_road_drive_through_penalty; // The penalty for going through a drive-through road stop matthijs@1247: truelight@835: bool population_in_label; // Show the population of a town in his label? KUDr@3900: belugas@6919: uint8 freight_trains; // Value to multiply the weight of cargo by peter1138@5163: KUDr@3900: /** YAPF settings */ KUDr@3900: YapfSettings yapf; KUDr@3900: bjarni@7981: uint8 right_mouse_btn_emulation; bjarni@7981: bjarni@6615: uint8 scrollwheel_scrolling; bjarni@6615: uint8 scrollwheel_multiplier; maedhros@6950: maedhros@6982: uint8 town_growth_rate; ///< Town growth rate maedhros@6982: uint8 larger_towns; ///< The number of cities to build. These start off larger and grow twice as fast maedhros@6982: uint8 initial_city_size; ///< Multiplier for the initial size of the cities compared to towns maedhros@7039: maedhros@7039: bool pause_on_newgame; ///< Whether to start new games paused or not. belugas@7067: glx@7073: TownLayoutByte town_layout; ///< Select town layout maedhros@7476: maedhros@7476: bool timetabling; ///< Whether to allow timetabling. maedhros@7476: bool timetable_in_ticks; ///< Whether to show the timetable in ticks rather than days. rubidium@6574: }; truelight@0: truelight@0: VARDEF Patches _patches; truelight@0: truelight@0: rubidium@6574: struct Cheat { bjarni@4237: bool been_used; // has this cheat been used before? bjarni@4237: bool value; // tells if the bool cheat is active or not rubidium@6574: }; truelight@0: truelight@0: belugas@6919: /* WARNING! Do _not_ remove entries in Cheats struct or change the order belugas@6919: * of the existing ones! Would break downward compatibility. belugas@6919: * Only add new entries at the end of the struct! */ truelight@0: rubidium@6574: struct Cheats { rubidium@4344: Cheat magic_bulldozer; // dynamite industries, unmovables rubidium@4344: Cheat switch_player; // change to another player rubidium@4344: Cheat money; // get rich rubidium@4344: Cheat crossing_tunnels; // allow tunnels that cross each other rubidium@4344: Cheat build_in_pause; // build while in pause mode rubidium@4344: Cheat no_jetcrash; // no jet will crash on small airports anymore dominik@100: Cheat switch_climate; rubidium@4344: Cheat change_date; // changes date ingame rubidium@4344: Cheat setup_prod; // setup raw-material production in game KUDr@5116: Cheat dummy; // empty cheat (enable running el-engines on normal rail) rubidium@6574: }; truelight@0: truelight@0: VARDEF Cheats _cheats; truelight@0: belugas@6919: /* NOSAVE: Used in palette animations only, not really important. */ truelight@7514: VARDEF int _palette_animation_counter; truelight@0: truelight@0: signde@206: VARDEF uint32 _frame_counter; truelight@7514: VARDEF uint32 _realtime_tick; truelight@0: truelight@2422: VARDEF bool _is_old_ai_player; // current player is an oldAI player? (enables a lot of cheats..) truelight@0: truelight@0: VARDEF bool _do_autosave; truelight@0: VARDEF int _autosave_ctr; truelight@0: truelight@0: VARDEF byte _display_opt; peter1138@6923: VARDEF byte _transparent_opt; truelight@0: VARDEF int _caret_timer; Darkvater@1688: VARDEF uint32 _news_display_opt; Darkvater@1688: VARDEF bool _news_ticker_sound; truelight@0: truelight@0: VARDEF StringID _error_message; rubidium@7486: VARDEF Money _additional_cash_required; truelight@0: truelight@0: VARDEF bool _rightclick_emulate; truelight@0: belugas@6919: /* IN/OUT parameters to commands */ truelight@0: VARDEF byte _yearly_expenses_type; truelight@0: VARDEF TileIndex _terraform_err_tile; tron@1977: VARDEF TileIndex _build_tunnel_endtile; truelight@0: VARDEF bool _generating_world; truelight@0: belugas@6919: /* Deals with the type of the savegame, independent of extension */ rubidium@6574: struct SmallFiosItem { Darkvater@2099: int mode; // savegame/scenario type (old, new) Darkvater@2099: char name[MAX_PATH]; // name Darkvater@2099: char title[255]; // internal name of the game rubidium@6574: }; truelight@0: belugas@6919: /* Used when switching from the intro menu. */ truelight@0: VARDEF byte _switch_mode; darkvater@172: VARDEF StringID _switch_mode_errorstr; truelight@0: VARDEF SmallFiosItem _file_to_saveload; truelight@0: truelight@0: truelight@0: truelight@0: VARDEF Vehicle *_place_clicked_vehicle; truelight@0: Darkvater@6136: VARDEF char _ini_videodriver[32], _ini_musicdriver[32], _ini_sounddriver[32]; truelight@0: truelight@0: VARDEF int _num_resolutions; truelight@0: VARDEF uint16 _resolutions[32][2]; truelight@0: VARDEF uint16 _cur_resolution[2]; truelight@0: truelight@0: VARDEF char _savegame_format[8]; truelight@0: truelight@0: VARDEF char *_config_file; darkvater@983: VARDEF char *_highscore_file; truelight@704: VARDEF char *_log_file; truelight@0: truelight@0: darkvater@889: #define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x; truelight@0: belugas@6919: /* landscape.cpp */ truelight@0: extern const byte _tileh_to_sprite[32]; truelight@0: truelight@0: extern const TileTypeProcs * const _tile_type_procs[16]; truelight@0: truelight@0: /* misc */ truelight@0: VARDEF char _screenshot_name[128]; truelight@0: VARDEF byte _vehicle_design_names; truelight@0: truelight@704: /* Forking stuff */ truelight@704: VARDEF bool _dedicated_forks; truelight@704: truelight@0: #endif /* VARIABLES_H */