author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1529 | 3a8196d15b01 |
child 1643 | 420cad9e62e4 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef VARIABLES_H |
2 |
#define VARIABLES_H |
|
3 |
||
4 |
#include "player.h" |
|
5 |
||
6 |
// ********* START OF SAVE REGION |
|
7 |
#if !defined(MAX_PATH) |
|
8 |
# define MAX_PATH 260 |
|
9 |
#endif |
|
10 |
||
1282
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
11 |
typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be) |
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
12 |
|
0 | 13 |
// Prices and also the fractional part. |
14 |
VARDEF Prices _price; |
|
15 |
VARDEF uint16 _price_frac[NUM_PRICES]; |
|
16 |
||
17 |
VARDEF uint32 _cargo_payment_rates[NUM_CARGO]; |
|
18 |
VARDEF uint16 _cargo_payment_rates_frac[NUM_CARGO]; |
|
19 |
||
20 |
typedef struct { |
|
21 |
GameDifficulty diff; |
|
22 |
byte diff_level; |
|
23 |
byte currency; |
|
24 |
bool kilometers; |
|
25 |
byte town_name; |
|
26 |
byte landscape; |
|
27 |
byte snow_line; |
|
28 |
byte autosave; |
|
29 |
byte road_side; |
|
30 |
} GameOptions; |
|
31 |
||
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
32 |
/* These are the options for the current game |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
33 |
* either ingame, or loaded. Also used for networking games */ |
0 | 34 |
VARDEF GameOptions _opt; |
35 |
||
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
36 |
/* These are the default options for a new game */ |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
37 |
VARDEF GameOptions _opt_newgame; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
38 |
|
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
39 |
// Pointer to one of the two _opt OR _opt_newgame structs |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
40 |
VARDEF GameOptions *_opt_ptr; |
0 | 41 |
|
759
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
42 |
enum { |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
43 |
CF_NOEURO = 0, |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
44 |
CF_ISEURO = 1, |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
45 |
}; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
46 |
|
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
47 |
typedef struct { |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
48 |
uint16 rate; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
49 |
char separator; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
50 |
uint16 to_euro; |
788
951b52443d48
(svn r1255) Renamed "postfix" to "suffix", for strings and variable names
dominik
parents:
761
diff
changeset
|
51 |
char prefix[16]; |
951b52443d48
(svn r1255) Renamed "postfix" to "suffix", for strings and variable names
dominik
parents:
761
diff
changeset
|
52 |
char suffix[16]; |
759
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
53 |
} CurrencySpec; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
54 |
|
761
9bfb58cb3a69
(svn r1219) -Fix: compilation for windows release build (forgotten VARDEF)
darkvater
parents:
759
diff
changeset
|
55 |
VARDEF CurrencySpec _currency_specs[24]; |
759
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
56 |
|
0 | 57 |
// Current date |
58 |
VARDEF uint16 _date; |
|
59 |
VARDEF uint16 _date_fract; |
|
60 |
||
61 |
// Amount of game ticks |
|
62 |
VARDEF uint16 _tick_counter; |
|
63 |
||
64 |
// Used when calling OnNewDay |
|
65 |
VARDEF VehicleID _vehicle_id_ctr_day; |
|
66 |
||
67 |
// Skip aging of cargo? |
|
68 |
VARDEF byte _age_cargo_skip_counter; |
|
69 |
||
70 |
// Available aircraft types |
|
71 |
VARDEF byte _avail_aircraft; |
|
72 |
||
73 |
// Position in tile loop |
|
74 |
VARDEF TileIndex _cur_tileloop_tile; |
|
75 |
||
76 |
// Also save scrollpos_x, scrollpos_y and zoom |
|
77 |
VARDEF uint16 _disaster_delay; |
|
78 |
||
79 |
// Determines what station to operate on in the |
|
80 |
// tick handler. |
|
81 |
VARDEF uint16 _station_tick_ctr; |
|
82 |
||
206 | 83 |
VARDEF uint32 _random_seeds[2][2]; |
84 |
VARDEF uint32 _player_seeds[MAX_PLAYERS][2]; |
|
85 |
||
0 | 86 |
// Iterator through all towns in OnTick_Town |
1517
596d52828893
(svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubi?ski <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much.
pasky
parents:
1500
diff
changeset
|
87 |
VARDEF uint32 _cur_town_ctr; |
1529
3a8196d15b01
(svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it.
pasky
parents:
1517
diff
changeset
|
88 |
// Frequency iterator at the same place |
3a8196d15b01
(svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it.
pasky
parents:
1517
diff
changeset
|
89 |
VARDEF uint32 _cur_town_iter; |
0 | 90 |
|
91 |
VARDEF uint _cur_player_tick_index; |
|
92 |
VARDEF uint _next_competitor_start; |
|
93 |
||
94 |
// Determines how often to run the tree loop |
|
95 |
VARDEF byte _trees_tick_ctr; |
|
96 |
||
97 |
// Keep track of current game position |
|
98 |
VARDEF int _saved_scrollpos_x; |
|
99 |
VARDEF int _saved_scrollpos_y; |
|
100 |
VARDEF byte _saved_scrollpos_zoom; |
|
101 |
||
102 |
// ********* END OF SAVE REGION |
|
103 |
||
104 |
typedef struct Patches { |
|
568
b0d0df062880
(svn r979) Allow more realistically sized catchment areas
Celestar
parents:
561
diff
changeset
|
105 |
bool modified_catchment; //different-size catchment areas |
0 | 106 |
bool vehicle_speed; // show vehicle speed |
107 |
bool build_on_slopes; // allow building on slopes |
|
108 |
bool mammoth_trains; // allow very long trains |
|
109 |
bool join_stations; // allow joining of train stations |
|
110 |
bool full_load_any; // new full load calculation, any cargo must be full |
|
523
8871819c9afd
(svn r853) -Feature: Implement improved vehicle loading algorithm
tron
parents:
485
diff
changeset
|
111 |
bool improved_load; // improved loading algorithm |
0 | 112 |
byte station_spread; // amount a station may spread |
113 |
bool inflation; // disable inflation |
|
114 |
bool selectgoods; // only send the goods to station if a train has been there |
|
115 |
bool longbridges; // allow 100 tile long bridges |
|
116 |
bool gotodepot; // allow goto depot in orders |
|
117 |
bool build_rawmaterial_ind; // allow building raw material industries |
|
118 |
bool multiple_industry_per_town; // allow many industries of the same type per town |
|
119 |
bool same_industry_close; // allow same type industries to be built close to each other |
|
120 |
uint16 lost_train_days; // if a train doesn't switch order in this amount of days, a train is lost warning is shown |
|
55
73fae6c6568e
(svn r56) Improved order checker + patch setting for it (celestar)
dominik
parents:
26
diff
changeset
|
121 |
uint8 order_review_system; |
0 | 122 |
bool train_income_warn; // if train is generating little income, show a warning |
123 |
bool status_long_date; // always show long date in status bar |
|
124 |
bool signal_side; // show signals on right side |
|
125 |
bool show_finances; // show finances at end of year |
|
126 |
bool new_nonstop; // ttdpatch compatible nonstop handling |
|
127 |
bool roadveh_queue; // buggy road vehicle queueing |
|
128 |
bool autoscroll; // scroll when moving mouse to the edge. |
|
129 |
byte errmsg_duration; // duration of error message |
|
130 |
byte snow_line_height; // a number 0-15 that configured snow line height |
|
131 |
bool bribe; // enable bribing the local authority |
|
132 |
bool new_depot_finding; // use new algorithm to find a depot. |
|
133 |
bool nonuniform_stations;// allow nonuniform train stations |
|
134 |
bool always_small_airport; // always allow small airports |
|
135 |
bool realistic_acceleration; // realistic acceleration for trains |
|
1247 | 136 |
bool forbid_90_deg; // forbid trains to make 90 deg turns |
91
6477ea0c240d
(svn r92) Feature: invisible trees when in transparent mode (patch entry)
dominik
parents:
84
diff
changeset
|
137 |
bool invisible_trees; // don't show trees when buildings are transparent |
1037
4fbbb01cf87b
(svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none (jaguar7)
darkvater
parents:
998
diff
changeset
|
138 |
bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
139 |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
140 |
uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right |
350 | 141 |
uint8 window_snap_radius; // Windows snap at each other if closer than this |
0 | 142 |
|
1282
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
143 |
UnitID max_trains; //max trains in game per player (these are 16bit because the unitnumber field can't hold more) |
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
144 |
UnitID max_roadveh; //max trucks in game per player |
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
145 |
UnitID max_aircraft; //max planes in game per player |
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
146 |
UnitID max_ships; //max ships in game per player |
0 | 147 |
|
156
8fef5e5752d6
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
darkvater
parents:
108
diff
changeset
|
148 |
bool servint_ispercent; // service intervals are in percents |
0 | 149 |
uint16 servint_trains; // service interval for trains |
150 |
uint16 servint_roadveh; // service interval for road vehicles |
|
151 |
uint16 servint_aircraft;// service interval for aircraft |
|
152 |
uint16 servint_ships; // service interval for ships |
|
153 |
||
154 |
bool autorenew; |
|
26 | 155 |
int16 autorenew_months; |
156 |
int32 autorenew_money; |
|
0 | 157 |
|
158 |
bool new_pathfinding; // use optimized pathfinding algoritm for trains |
|
159 |
byte pf_maxdepth; // maximum recursion depth when searching for a train route for new pathfinder |
|
160 |
uint16 pf_maxlength; // maximum length when searching for a train route for new pathfinder |
|
161 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
162 |
|
0 | 163 |
bool bridge_pillars; // show bridge pillars for high bridges |
164 |
||
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
165 |
bool ai_disable_veh_train; // disable types for AI |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
166 |
bool ai_disable_veh_roadveh; // disable types for AI |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
167 |
bool ai_disable_veh_aircraft; // disable types for AI |
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
168 |
bool ai_disable_veh_ship; // disable types for AI |
0 | 169 |
uint32 starting_date; // starting date |
998
c90459c24842
(svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
darkvater
parents:
988
diff
changeset
|
170 |
uint32 ending_date; // end of the game (just show highscore) |
0 | 171 |
uint32 colored_news_date; // when does newspaper become colored? |
172 |
||
173 |
bool keep_all_autosave; // name the autosave in a different way. |
|
643
a9c84d04eacb
(svn r1076) Feature: Patch setting to autosave the game on exit
dominik
parents:
614
diff
changeset
|
174 |
bool autosave_on_exit; // save an autosave when you quit the game, but do not ask "Do you really want to quit?" |
0 | 175 |
bool extra_dynamite; // extra dynamite |
176 |
||
177 |
bool never_expire_vehicles; // never expire vehicles |
|
178 |
byte extend_vehicle_life; // extend vehicle life by this many years |
|
179 |
||
180 |
bool auto_euro; // automatically switch to euro in 2002 |
|
181 |
bool serviceathelipad; // service helicopters at helipads automatically (no need to send to depot) |
|
182 |
bool smooth_economy; // smooth economy |
|
930
ab42e283749d
(svn r1418) -Feature: [1098254] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid)
darkvater
parents:
900
diff
changeset
|
183 |
bool allow_shares; // allow the buying/selling of shares |
0 | 184 |
byte dist_local_authority; // distance for town local authority, default 20 |
185 |
||
186 |
byte wait_oneway_signal; //waitingtime in days before a oneway signal |
|
187 |
byte wait_twoway_signal; //waitingtime in days before a twoway signal |
|
188 |
||
1218 | 189 |
uint map_x; // Size of map |
190 |
uint map_y; |
|
191 |
||
58
b9fdcc9b5c90
(svn r59) -Feature: Added Autosignals, just like Autorail. Can copy signal style, convert signal<->semaphore, etc. Big thanks to betatesters Dribbel and Testman57 (Darkvater)
darkvater
parents:
55
diff
changeset
|
192 |
byte drag_signals_density; // many signals density |
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
70
diff
changeset
|
193 |
bool ainew_active; // Is the new AI active? |
835
f6a341f541d7
(svn r1312) -Add: Patch which is on by default: population in label of the town
truelight
parents:
788
diff
changeset
|
194 |
|
1247 | 195 |
/* New Path Finding */ |
196 |
bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */ |
|
197 |
||
198 |
uint32 npf_rail_firstred_penalty; /* The penalty for when the first signal is red */ |
|
1459
19333d7f99b3
(svn r1963) - Add: [NPF] Penalty for a red signal that is the last signal on the path.
matthijs
parents:
1417
diff
changeset
|
199 |
uint32 npf_rail_lastred_penalty; /* The penalty for when the last signal is red */ |
1247 | 200 |
uint32 npf_rail_station_penalty; /* The penalty for station tiles */ |
201 |
uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */ |
|
1460 | 202 |
uint32 npf_rail_curve_penalty; /* The penalty for curves */ |
1247 | 203 |
|
835
f6a341f541d7
(svn r1312) -Add: Patch which is on by default: population in label of the town
truelight
parents:
788
diff
changeset
|
204 |
bool population_in_label; // Show the population of a town in his label? |
0 | 205 |
} Patches; |
206 |
||
207 |
VARDEF Patches _patches; |
|
208 |
||
209 |
||
210 |
typedef struct Cheat { |
|
211 |
bool been_used; // has this cheat been used before? |
|
212 |
byte value; // active? |
|
213 |
} Cheat; |
|
214 |
||
215 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
216 |
// WARNING! Do _not_ remove entries in Cheats struct or change the order |
0 | 217 |
// of the existing ones! Would break downward compatibility. |
218 |
// Only add new entries at the end of the struct! |
|
219 |
||
220 |
typedef struct Cheats { |
|
221 |
Cheat magic_bulldozer; // dynamite industries, unmovables |
|
222 |
Cheat switch_player; // change to another player |
|
223 |
Cheat money; // get rich |
|
224 |
Cheat crossing_tunnels; // allow tunnels that cross each other |
|
100 | 225 |
Cheat build_in_pause; // build while in pause mode |
226 |
Cheat no_jetcrash; // no jet will crash on small airports anymore |
|
227 |
Cheat switch_climate; |
|
108
8e2e584a9500
(svn r109) added/heavily modified patch by truesatan: cheat change date
dominik
parents:
105
diff
changeset
|
228 |
Cheat change_date; //changes date ingame |
1176
cc9d8618620d
(svn r1678) Added cheat option for setting production of raw-material product industries in game
miham
parents:
1128
diff
changeset
|
229 |
Cheat setup_prod; //setup raw-material production in game |
0 | 230 |
} Cheats; |
231 |
||
232 |
VARDEF Cheats _cheats; |
|
233 |
||
234 |
typedef struct Paths { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
235 |
char *personal_dir; // includes cfg file and save folder |
0 | 236 |
char *game_data_dir; // includes data, gm, lang |
237 |
char *data_dir; |
|
238 |
char *gm_dir; |
|
239 |
char *lang_dir; |
|
240 |
char *save_dir; |
|
241 |
char *autosave_dir; |
|
242 |
char *scenario_dir; |
|
561
9a0c469a251c
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
543
diff
changeset
|
243 |
char *second_data_dir; |
0 | 244 |
} Paths; |
245 |
||
246 |
VARDEF Paths _path; |
|
247 |
||
248 |
// NOSAVE: Used in palette animations only, not really important. |
|
249 |
VARDEF int _timer_counter; |
|
250 |
||
251 |
||
252 |
// NOSAVE: can be determined from _date |
|
253 |
VARDEF byte _cur_year; |
|
254 |
VARDEF byte _cur_month; |
|
255 |
||
256 |
// NOSAVE: can be determined from player structs |
|
257 |
VARDEF byte _player_colors[MAX_PLAYERS]; |
|
258 |
||
259 |
VARDEF bool _in_state_game_loop; |
|
206 | 260 |
VARDEF uint32 _frame_counter; |
0 | 261 |
|
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
70
diff
changeset
|
262 |
VARDEF bool _is_ai_player; // current player is an AI player? - Can be removed if new AI is done |
0 | 263 |
|
264 |
VARDEF bool _do_autosave; |
|
265 |
VARDEF int _autosave_ctr; |
|
266 |
||
267 |
VARDEF byte _local_player; |
|
268 |
VARDEF byte _display_opt; |
|
269 |
VARDEF byte _pause; |
|
270 |
VARDEF int _caret_timer; |
|
271 |
VARDEF uint16 _news_display_opt; |
|
272 |
VARDEF byte _game_mode; |
|
273 |
||
274 |
VARDEF StringID _error_message; |
|
275 |
VARDEF StringID _error_message_2; |
|
276 |
VARDEF int32 _additional_cash_required; |
|
277 |
||
472
ba697666956e
(svn r723) Increase size of dparam so more parameters can be passed to string output
tron
parents:
350
diff
changeset
|
278 |
VARDEF uint32 _decode_parameters[20]; |
0 | 279 |
VARDEF byte _current_player; |
280 |
||
281 |
VARDEF int _docommand_recursive; |
|
282 |
||
283 |
VARDEF uint32 _pressed_key; // Low 8 bits = ASCII, High 16 bits = keycode |
|
284 |
VARDEF bool _ctrl_pressed; // Is Ctrl pressed? |
|
285 |
VARDEF bool _shift_pressed; // Is Alt pressed? |
|
286 |
VARDEF byte _dirkeys; // 1=left, 2=up, 4=right, 8=down |
|
287 |
||
288 |
VARDEF bool _fullscreen; |
|
289 |
VARDEF bool _double_size; |
|
290 |
VARDEF uint _display_hz; |
|
291 |
VARDEF bool _force_full_redraw; |
|
292 |
VARDEF uint _fullscreen_bpp; |
|
293 |
VARDEF bool _fast_forward; |
|
294 |
VARDEF bool _rightclick_emulate; |
|
295 |
||
296 |
// IN/OUT parameters to commands |
|
297 |
VARDEF byte _yearly_expenses_type; |
|
298 |
VARDEF TileIndex _terraform_err_tile; |
|
299 |
VARDEF uint _build_tunnel_endtile; |
|
300 |
VARDEF bool _generating_world; |
|
301 |
VARDEF int _new_town_size; |
|
302 |
VARDEF uint _returned_refit_amount; |
|
303 |
||
304 |
// Deals with the type of the savegame, independent of extension |
|
305 |
typedef struct { |
|
306 |
int mode; // savegame/scenario type (old, new) |
|
1329 | 307 |
char name[MAX_PATH]; // name |
0 | 308 |
} SmallFiosItem; |
309 |
||
310 |
// Used when switching from the intro menu. |
|
311 |
VARDEF byte _switch_mode; |
|
172
8d8b3383470d
(svn r173) -Network: [1023231] Debug Code + ErrorBoxes + Load Game/Scenario. Added some more desync debug code and replaced some of the error() calls with some better error boxes. Hopefully find desyncs easier (sign_de)
darkvater
parents:
156
diff
changeset
|
312 |
VARDEF StringID _switch_mode_errorstr; |
0 | 313 |
VARDEF bool _exit_game; |
314 |
VARDEF SmallFiosItem _file_to_saveload; |
|
315 |
VARDEF byte _make_screenshot; |
|
316 |
||
317 |
VARDEF byte _get_z_hint; // used as a hint to getslopez to return the right height at a bridge. |
|
318 |
||
319 |
VARDEF char *_newgrf_files[32]; |
|
320 |
||
321 |
||
322 |
VARDEF Vehicle *_place_clicked_vehicle; |
|
323 |
||
324 |
VARDEF char _ini_videodriver[16], _ini_musicdriver[16], _ini_sounddriver[16]; |
|
325 |
||
326 |
VARDEF bool _cache_sprites; |
|
327 |
||
328 |
// debug features |
|
329 |
VARDEF char _savedump_path[64]; |
|
330 |
VARDEF uint _savedump_first, _savedump_freq, _savedump_last; |
|
331 |
// end of debug features |
|
332 |
||
333 |
// Used for dynamic language support |
|
334 |
typedef struct { |
|
335 |
int num; // number of languages |
|
336 |
int curr; // currently selected language index |
|
337 |
char curr_file[32]; // currently selected language file |
|
338 |
StringID dropdown[32 + 1]; // used in settings dialog |
|
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
339 |
struct { |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
340 |
char *name; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
341 |
char *file; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
342 |
} ent[32]; |
0 | 343 |
} DynamicLanguages; |
344 |
||
345 |
VARDEF DynamicLanguages _dynlang; |
|
346 |
||
347 |
VARDEF int _num_resolutions; |
|
348 |
VARDEF uint16 _resolutions[32][2]; |
|
349 |
VARDEF uint16 _cur_resolution[2]; |
|
350 |
||
351 |
VARDEF char _screenshot_format_name[8]; |
|
352 |
VARDEF int _num_screenshot_formats, _cur_screenshot_format; |
|
353 |
||
354 |
VARDEF char _savegame_format[8]; |
|
355 |
||
356 |
VARDEF char *_config_file; |
|
983
4765bf636f6b
(svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
darkvater
parents:
930
diff
changeset
|
357 |
VARDEF char *_highscore_file; |
704
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
358 |
VARDEF char *_log_file; |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
359 |
VARDEF FILE *_log_file_fd; |
0 | 360 |
|
361 |
// NOSAVE: These can be recalculated from InitializeLandscapeVariables |
|
362 |
typedef struct { |
|
363 |
StringID names_s[NUM_CARGO]; |
|
364 |
StringID names_p[NUM_CARGO]; |
|
365 |
StringID names_long_s[NUM_CARGO]; |
|
366 |
StringID names_long_p[NUM_CARGO]; |
|
367 |
StringID names_short[NUM_CARGO]; |
|
368 |
byte weights[NUM_CARGO]; |
|
369 |
SpriteID sprites[NUM_CARGO]; |
|
370 |
byte transit_days_1[NUM_CARGO]; |
|
371 |
byte transit_days_2[NUM_CARGO]; |
|
372 |
byte ai_railwagon[3][NUM_CARGO]; |
|
373 |
byte ai_roadveh_start[NUM_CARGO]; |
|
374 |
byte ai_roadveh_count[NUM_CARGO]; |
|
375 |
} CargoConst; |
|
376 |
||
377 |
VARDEF CargoConst _cargoc; |
|
378 |
||
379 |
||
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
380 |
static inline void SetDParamX(uint32 *s, uint n, uint32 v) |
0 | 381 |
{ |
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
382 |
s[n] = v; |
0 | 383 |
} |
384 |
||
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
385 |
static inline uint32 GetDParamX(const uint32 *s, uint n) |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
386 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
387 |
return s[n]; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
388 |
} |
0 | 389 |
|
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
390 |
static inline void SetDParam(uint n, uint32 v) |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
391 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
392 |
assert(n < lengthof(_decode_parameters)); |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
393 |
_decode_parameters[n] = v; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
394 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
395 |
|
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
396 |
static inline void SetDParam64(uint n, uint64 v) |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
397 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
398 |
assert(n + 1 < lengthof(_decode_parameters)); |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
399 |
_decode_parameters[n + 0] = v & 0xffffffff; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
400 |
_decode_parameters[n + 1] = v >> 32; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
401 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
402 |
|
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
403 |
static inline uint32 GetDParam(uint n) |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
404 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
405 |
assert(n < lengthof(_decode_parameters)); |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
406 |
return _decode_parameters[n]; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
407 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
408 |
|
0 | 409 |
|
410 |
#define COPY_IN_DPARAM(offs,src,num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num)) |
|
411 |
#define COPY_OUT_DPARAM(dst,offs,num) memcpy(dst,_decode_parameters + offs, sizeof(uint32) * (num)) |
|
412 |
||
413 |
||
889
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
842
diff
changeset
|
414 |
#define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x; |
0 | 415 |
|
416 |
/* landscape.c */ |
|
417 |
extern const byte _tileh_to_sprite[32]; |
|
418 |
||
419 |
static const byte _inclined_tileh[] = { |
|
420 |
3,9,3,6,12,6,12,9, |
|
421 |
}; |
|
422 |
||
423 |
extern const TileTypeProcs * const _tile_type_procs[16]; |
|
424 |
||
425 |
/* station_cmd.c */ |
|
426 |
// there are 5 types of airport (Country (3x4) , City(6x6), Metropolitan(6x6), International(7x7), Heliport(1x1) |
|
427 |
// will become obsolete once airports are loaded from seperate file |
|
1417
74779e56d5db
(svn r1921) -Fix: Out of bounds array access which caused oil rigs to accept other cargo types besides passengers and mail
tron
parents:
1406
diff
changeset
|
428 |
extern const byte _airport_size_x[]; |
74779e56d5db
(svn r1921) -Fix: Out of bounds array access which caused oil rigs to accept other cargo types besides passengers and mail
tron
parents:
1406
diff
changeset
|
429 |
extern const byte _airport_size_y[]; |
0 | 430 |
|
431 |
/* misc */ |
|
432 |
VARDEF char _screenshot_name[128]; |
|
485
7a7484b85037
(svn r767) Introduce USERSTRING_LEN (128) and try to make sure we don't overflow it anywhere (as long as we keep USERSTRING_LEN above 7 or so).
pasky
parents:
472
diff
changeset
|
433 |
#define USERSTRING_LEN 128 |
7a7484b85037
(svn r767) Introduce USERSTRING_LEN (128) and try to make sure we don't overflow it anywhere (as long as we keep USERSTRING_LEN above 7 or so).
pasky
parents:
472
diff
changeset
|
434 |
VARDEF char _userstring[USERSTRING_LEN]; |
0 | 435 |
VARDEF byte _vehicle_design_names; |
436 |
||
437 |
/* tunnelbridge */ |
|
438 |
#define MAX_BRIDGES 13 |
|
439 |
||
1247 | 440 |
/* For new pathfinding. Define here so it is globally available */ |
441 |
#define NPF_TILE_LENGTH 100 |
|
442 |
||
842 | 443 |
/* Autoreplace vehicle stuff*/ |
1128
ca7f860db7ac
(svn r1629) added a counter to tell how many engines you have of each type to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list.
bjarni
parents:
1037
diff
changeset
|
444 |
VARDEF byte _autoreplace_array[256]; |
ca7f860db7ac
(svn r1629) added a counter to tell how many engines you have of each type to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list.
bjarni
parents:
1037
diff
changeset
|
445 |
VARDEF uint16 _player_num_engines[256]; |
1178
7c39a741eafb
(svn r1680) Feature: Replace train GUI now remembers the railtype selected in the dropdown menu
bjarni
parents:
1176
diff
changeset
|
446 |
VARDEF byte _railtype_selected_in_replace_gui; |
842 | 447 |
|
704
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
448 |
/* Forking stuff */ |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
449 |
VARDEF bool _dedicated_forks; |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
450 |
|
0 | 451 |
#endif /* VARIABLES_H */ |