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