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