author | tron |
Mon, 29 Nov 2004 11:59:09 +0000 | |
changeset 523 | 1184a22723ad |
parent 485 | 453c096beb1b |
child 534 | 17ab2f22ff74 |
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 |
||
39 |
// Current date |
|
40 |
VARDEF uint16 _date; |
|
41 |
VARDEF uint16 _date_fract; |
|
42 |
||
43 |
// Amount of game ticks |
|
44 |
VARDEF uint16 _tick_counter; |
|
45 |
||
46 |
// Used when calling OnNewDay |
|
47 |
VARDEF VehicleID _vehicle_id_ctr_day; |
|
48 |
||
49 |
// Skip aging of cargo? |
|
50 |
VARDEF byte _age_cargo_skip_counter; |
|
51 |
||
52 |
// Available aircraft types |
|
53 |
VARDEF byte _avail_aircraft; |
|
54 |
||
55 |
// Position in tile loop |
|
56 |
VARDEF TileIndex _cur_tileloop_tile; |
|
57 |
||
58 |
// Also save scrollpos_x, scrollpos_y and zoom |
|
59 |
VARDEF uint16 _disaster_delay; |
|
60 |
||
61 |
// Determines what station to operate on in the |
|
62 |
// tick handler. |
|
63 |
VARDEF uint16 _station_tick_ctr; |
|
64 |
||
206 | 65 |
VARDEF uint32 _random_seeds[2][2]; |
66 |
VARDEF uint32 _player_seeds[MAX_PLAYERS][2]; |
|
67 |
||
0 | 68 |
// Iterator through all towns in OnTick_Town |
69 |
VARDEF byte _cur_town_ctr; |
|
70 |
||
71 |
VARDEF uint _cur_player_tick_index; |
|
72 |
VARDEF uint _next_competitor_start; |
|
73 |
||
74 |
// Determines how often to run the tree loop |
|
75 |
VARDEF byte _trees_tick_ctr; |
|
76 |
||
77 |
// Keep track of current game position |
|
78 |
VARDEF int _saved_scrollpos_x; |
|
79 |
VARDEF int _saved_scrollpos_y; |
|
80 |
VARDEF byte _saved_scrollpos_zoom; |
|
81 |
||
82 |
// ********* END OF SAVE REGION |
|
83 |
||
84 |
typedef struct Patches { |
|
85 |
bool vehicle_speed; // show vehicle speed |
|
86 |
bool build_on_slopes; // allow building on slopes |
|
87 |
bool mammoth_trains; // allow very long trains |
|
88 |
bool join_stations; // allow joining of train stations |
|
89 |
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
|
90 |
bool improved_load; // improved loading algorithm |
0 | 91 |
byte station_spread; // amount a station may spread |
92 |
bool inflation; // disable inflation |
|
93 |
bool selectgoods; // only send the goods to station if a train has been there |
|
94 |
bool longbridges; // allow 100 tile long bridges |
|
95 |
bool gotodepot; // allow goto depot in orders |
|
96 |
bool build_rawmaterial_ind; // allow building raw material industries |
|
97 |
bool multiple_industry_per_town; // allow many industries of the same type per town |
|
98 |
bool same_industry_close; // allow same type industries to be built close to each other |
|
99 |
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
|
100 |
uint8 order_review_system; |
0 | 101 |
bool train_income_warn; // if train is generating little income, show a warning |
102 |
bool status_long_date; // always show long date in status bar |
|
103 |
bool signal_side; // show signals on right side |
|
104 |
bool show_finances; // show finances at end of year |
|
105 |
bool new_nonstop; // ttdpatch compatible nonstop handling |
|
106 |
bool roadveh_queue; // buggy road vehicle queueing |
|
107 |
bool autoscroll; // scroll when moving mouse to the edge. |
|
108 |
byte errmsg_duration; // duration of error message |
|
109 |
byte snow_line_height; // a number 0-15 that configured snow line height |
|
110 |
bool bribe; // enable bribing the local authority |
|
111 |
bool new_depot_finding; // use new algorithm to find a depot. |
|
112 |
bool nonuniform_stations;// allow nonuniform train stations |
|
113 |
bool always_small_airport; // always allow small airports |
|
114 |
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
|
115 |
bool invisible_trees; // don't show trees when buildings are transparent |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
116 |
|
68
4051f3c8efa2
(svn r69) -Feature: align toolbar left/center/right patch (TrueLight)
darkvater
parents:
67
diff
changeset
|
117 |
uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right |
350 | 118 |
uint8 window_snap_radius; // Windows snap at each other if closer than this |
0 | 119 |
|
120 |
byte max_trains; //max trains in game per player (these are 8bit because the unitnumber field can't hold more) |
|
121 |
byte max_roadveh; //max trucks in game per player |
|
122 |
byte max_aircraft; //max planes in game per player |
|
123 |
byte max_ships; //max ships in game per player |
|
124 |
||
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
|
125 |
bool servint_ispercent; // service intervals are in percents |
0 | 126 |
uint16 servint_trains; // service interval for trains |
127 |
uint16 servint_roadveh; // service interval for road vehicles |
|
128 |
uint16 servint_aircraft;// service interval for aircraft |
|
129 |
uint16 servint_ships; // service interval for ships |
|
130 |
||
131 |
bool autorenew; |
|
26 | 132 |
int16 autorenew_months; |
133 |
int32 autorenew_money; |
|
0 | 134 |
|
135 |
bool new_pathfinding; // use optimized pathfinding algoritm for trains |
|
136 |
byte pf_maxdepth; // maximum recursion depth when searching for a train route for new pathfinder |
|
137 |
uint16 pf_maxlength; // maximum length when searching for a train route for new pathfinder |
|
138 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
139 |
|
0 | 140 |
bool bridge_pillars; // show bridge pillars for high bridges |
141 |
||
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
142 |
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
|
143 |
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
|
144 |
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
|
145 |
bool ai_disable_veh_ship; // disable types for AI |
0 | 146 |
uint32 starting_date; // starting date |
147 |
uint32 colored_news_date; // when does newspaper become colored? |
|
148 |
||
149 |
bool keep_all_autosave; // name the autosave in a different way. |
|
150 |
bool extra_dynamite; // extra dynamite |
|
151 |
||
152 |
bool never_expire_vehicles; // never expire vehicles |
|
153 |
byte extend_vehicle_life; // extend vehicle life by this many years |
|
154 |
||
155 |
bool auto_euro; // automatically switch to euro in 2002 |
|
156 |
bool serviceathelipad; // service helicopters at helipads automatically (no need to send to depot) |
|
157 |
bool smooth_economy; // smooth economy |
|
158 |
byte dist_local_authority; // distance for town local authority, default 20 |
|
159 |
||
160 |
byte wait_oneway_signal; //waitingtime in days before a oneway signal |
|
161 |
byte wait_twoway_signal; //waitingtime in days before a twoway signal |
|
162 |
||
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
|
163 |
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
|
164 |
bool ainew_active; // Is the new AI active? |
0 | 165 |
} Patches; |
166 |
||
167 |
VARDEF Patches _patches; |
|
168 |
||
169 |
||
170 |
typedef struct Cheat { |
|
171 |
bool been_used; // has this cheat been used before? |
|
172 |
byte value; // active? |
|
173 |
} Cheat; |
|
174 |
||
175 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
176 |
// WARNING! Do _not_ remove entries in Cheats struct or change the order |
0 | 177 |
// of the existing ones! Would break downward compatibility. |
178 |
// Only add new entries at the end of the struct! |
|
179 |
||
180 |
typedef struct Cheats { |
|
181 |
Cheat magic_bulldozer; // dynamite industries, unmovables |
|
182 |
Cheat switch_player; // change to another player |
|
183 |
Cheat money; // get rich |
|
184 |
Cheat crossing_tunnels; // allow tunnels that cross each other |
|
100 | 185 |
Cheat build_in_pause; // build while in pause mode |
186 |
Cheat no_jetcrash; // no jet will crash on small airports anymore |
|
187 |
Cheat switch_climate; |
|
108
8e2e584a9500
(svn r109) added/heavily modified patch by truesatan: cheat change date
dominik
parents:
105
diff
changeset
|
188 |
Cheat change_date; //changes date ingame |
0 | 189 |
} Cheats; |
190 |
||
191 |
VARDEF Cheats _cheats; |
|
192 |
||
193 |
typedef struct Paths { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
194 |
char *personal_dir; // includes cfg file and save folder |
0 | 195 |
char *game_data_dir; // includes data, gm, lang |
196 |
char *data_dir; |
|
197 |
char *gm_dir; |
|
198 |
char *lang_dir; |
|
199 |
char *save_dir; |
|
200 |
char *autosave_dir; |
|
201 |
char *scenario_dir; |
|
202 |
} Paths; |
|
203 |
||
204 |
VARDEF Paths _path; |
|
205 |
||
206 |
// Which options struct does options modify? |
|
207 |
VARDEF GameOptions *_opt_mod_ptr; |
|
208 |
||
209 |
// NOSAVE: Used in palette animations only, not really important. |
|
210 |
VARDEF int _timer_counter; |
|
211 |
||
212 |
||
213 |
// NOSAVE: can be determined from _date |
|
214 |
VARDEF byte _cur_year; |
|
215 |
VARDEF byte _cur_month; |
|
216 |
||
217 |
// NOSAVE: can be determined from player structs |
|
218 |
VARDEF byte _player_colors[MAX_PLAYERS]; |
|
219 |
||
220 |
VARDEF bool _in_state_game_loop; |
|
206 | 221 |
VARDEF uint32 _frame_counter; |
0 | 222 |
|
206 | 223 |
VARDEF uint32 _frame_counter_max; // for networking, this is the frame that we are not allowed to execute yet. |
224 |
VARDEF uint32 _frame_counter_srv; // for networking, this is the last known framecounter of the server. it is always less than frame_counter_max. |
|
0 | 225 |
|
226 |
// networking settings |
|
105 | 227 |
VARDEF bool _network_available; // is network mode available? |
228 |
VARDEF uint32 _network_ip_list[10]; // Network IPs |
|
229 |
VARDEF uint16 _network_game_count; |
|
230 |
||
231 |
VARDEF uint _network_client_port; |
|
232 |
VARDEF uint _network_server_port; |
|
233 |
||
188
30f27b5c1ee5
(svn r189) -Fix: [1024750] Fix: network.c - timeout error. When one client timed out, all clients were disconnected (sign_de)
darkvater
parents:
185
diff
changeset
|
234 |
VARDEF uint16 _network_sync_freq; |
30f27b5c1ee5
(svn r189) -Fix: [1024750] Fix: network.c - timeout error. When one client timed out, all clients were disconnected (sign_de)
darkvater
parents:
185
diff
changeset
|
235 |
VARDEF uint16 _network_ahead_frames; |
220
dc1710f96b39
(svn r221) -Feature: console command and variable hooking
signde
parents:
206
diff
changeset
|
236 |
VARDEF uint16 _network_ready_ahead; |
dc1710f96b39
(svn r221) -Feature: console command and variable hooking
signde
parents:
206
diff
changeset
|
237 |
VARDEF uint16 _network_client_timeout; |
0 | 238 |
|
239 |
VARDEF uint32 _sync_seed_1, _sync_seed_2; |
|
240 |
||
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
70
diff
changeset
|
241 |
VARDEF bool _is_ai_player; // current player is an AI player? - Can be removed if new AI is done |
0 | 242 |
|
243 |
VARDEF bool _do_autosave; |
|
244 |
VARDEF int _autosave_ctr; |
|
245 |
||
246 |
VARDEF byte _local_player; |
|
247 |
VARDEF byte _display_opt; |
|
248 |
VARDEF byte _pause; |
|
249 |
VARDEF int _caret_timer; |
|
250 |
VARDEF uint16 _news_display_opt; |
|
251 |
VARDEF byte _game_mode; |
|
252 |
||
253 |
VARDEF StringID _error_message; |
|
254 |
VARDEF StringID _error_message_2; |
|
255 |
VARDEF int32 _additional_cash_required; |
|
256 |
||
472
4b15c9f4f969
(svn r723) Increase size of dparam so more parameters can be passed to string output
tron
parents:
350
diff
changeset
|
257 |
VARDEF uint32 _decode_parameters[20]; |
0 | 258 |
VARDEF byte _current_player; |
259 |
||
260 |
VARDEF int _docommand_recursive; |
|
261 |
||
262 |
VARDEF uint32 _pressed_key; // Low 8 bits = ASCII, High 16 bits = keycode |
|
263 |
VARDEF bool _ctrl_pressed; // Is Ctrl pressed? |
|
264 |
VARDEF bool _shift_pressed; // Is Alt pressed? |
|
265 |
VARDEF byte _dirkeys; // 1=left, 2=up, 4=right, 8=down |
|
266 |
||
267 |
VARDEF bool _fullscreen; |
|
268 |
VARDEF bool _double_size; |
|
269 |
VARDEF uint _display_hz; |
|
270 |
VARDEF bool _force_full_redraw; |
|
271 |
VARDEF uint _fullscreen_bpp; |
|
272 |
VARDEF bool _fast_forward; |
|
273 |
VARDEF bool _rightclick_emulate; |
|
274 |
||
275 |
// IN/OUT parameters to commands |
|
276 |
VARDEF byte _yearly_expenses_type; |
|
277 |
VARDEF TileIndex _terraform_err_tile; |
|
278 |
VARDEF uint _build_tunnel_endtile; |
|
279 |
VARDEF bool _generating_world; |
|
280 |
VARDEF int _new_town_size; |
|
281 |
VARDEF uint _returned_refit_amount; |
|
282 |
||
283 |
// Deals with the type of the savegame, independent of extension |
|
284 |
typedef struct { |
|
285 |
int mode; // savegame/scenario type (old, new) |
|
286 |
byte name[MAX_PATH]; // name |
|
287 |
} SmallFiosItem; |
|
288 |
||
289 |
// Used when switching from the intro menu. |
|
290 |
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
|
291 |
VARDEF StringID _switch_mode_errorstr; |
0 | 292 |
VARDEF bool _exit_game; |
293 |
VARDEF SmallFiosItem _file_to_saveload; |
|
294 |
VARDEF byte _make_screenshot; |
|
295 |
||
296 |
VARDEF bool _networking; |
|
105 | 297 |
VARDEF bool _networking_override; // dont shutdown network core when the GameMenu appears. |
298 |
||
0 | 299 |
VARDEF bool _networking_sync; // if we use network mode and the games must stay in sync. |
300 |
VARDEF bool _networking_server; |
|
301 |
VARDEF bool _networking_queuing; // queueing only? |
|
302 |
||
303 |
VARDEF byte _network_playas; // an id to play as.. |
|
304 |
||
305 |
VARDEF byte _get_z_hint; // used as a hint to getslopez to return the right height at a bridge. |
|
306 |
||
307 |
VARDEF char *_newgrf_files[32]; |
|
308 |
||
309 |
||
310 |
VARDEF Vehicle *_place_clicked_vehicle; |
|
311 |
||
312 |
VARDEF char _ini_videodriver[16], _ini_musicdriver[16], _ini_sounddriver[16]; |
|
313 |
||
314 |
VARDEF bool _cache_sprites; |
|
315 |
||
316 |
// debug features |
|
317 |
VARDEF char _savedump_path[64]; |
|
318 |
VARDEF uint _savedump_first, _savedump_freq, _savedump_last; |
|
319 |
// end of debug features |
|
320 |
||
321 |
||
322 |
typedef struct { |
|
323 |
char *name; |
|
324 |
char *file; |
|
325 |
} DynLangEnt; |
|
326 |
||
327 |
// Used for dynamic language support |
|
328 |
typedef struct { |
|
329 |
int num; // number of languages |
|
330 |
int curr; // currently selected language index |
|
331 |
char curr_file[32]; // currently selected language file |
|
332 |
StringID dropdown[32 + 1]; // used in settings dialog |
|
333 |
DynLangEnt ent[32]; |
|
334 |
} DynamicLanguages; |
|
335 |
||
336 |
VARDEF DynamicLanguages _dynlang; |
|
337 |
||
338 |
VARDEF int _num_resolutions; |
|
339 |
VARDEF uint16 _resolutions[32][2]; |
|
340 |
VARDEF uint16 _cur_resolution[2]; |
|
341 |
||
342 |
VARDEF char _screenshot_format_name[8]; |
|
343 |
VARDEF int _num_screenshot_formats, _cur_screenshot_format; |
|
344 |
||
345 |
VARDEF char _savegame_format[8]; |
|
346 |
||
347 |
VARDEF char *_config_file; |
|
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 |
#define SET_DPARAM32(n, v) (_decode_parameters[n] = (v)) |
|
371 |
#define SET_DPARAMX32(s, n, v) ((s)[n] = (v)) |
|
372 |
#define GET_DPARAM32(n) (_decode_parameters[n]) |
|
373 |
||
374 |
#define SET_DPARAM(n, v) (_decode_parameters[n] = (v)) |
|
375 |
#define SET_DPARAMX(s, n, v) ((s)[n] = (v)) |
|
376 |
#define GET_DPARAM(n) (_decode_parameters[n]) |
|
377 |
||
378 |
static void FORCEINLINE SET_DPARAM64(int n, int64 v) |
|
379 |
{ |
|
380 |
_decode_parameters[n] = (uint32)v; |
|
381 |
_decode_parameters[n+1] = (uint32)((uint64)v >> 32); |
|
382 |
} |
|
383 |
||
384 |
#if defined(TTD_LITTLE_ENDIAN) |
|
385 |
#define SET_DPARAMX16(s, n, v) ( ((uint16*)(s+n))[0] = (v)) |
|
386 |
#define SET_DPARAMX8(s, n, v) ( ((uint8*)(s+n))[0] = (v)) |
|
387 |
#define GET_DPARAMX16(s, n) ( ((uint16*)(s+n))[0]) |
|
388 |
#define GET_DPARAMX8(s, n) ( ((uint8*)(s+n))[0]) |
|
389 |
#elif defined(TTD_BIG_ENDIAN) |
|
390 |
#define SET_DPARAMX16(s, n, v) ( ((uint16*)(s+n))[1] = (v)) |
|
391 |
#define SET_DPARAMX8(s, n, v) ( ((uint8*)(s+n))[3] = (v)) |
|
392 |
#define GET_DPARAMX16(s, n) ( ((uint16*)(s+n))[1]) |
|
393 |
#define GET_DPARAMX8(s, n) ( ((uint8*)(s+n))[3]) |
|
394 |
#endif |
|
395 |
||
396 |
#define SET_DPARAM16(n, v) SET_DPARAMX16(_decode_parameters, n, v) |
|
397 |
#define SET_DPARAM8(n, v) SET_DPARAMX8(_decode_parameters, n, v) |
|
398 |
#define GET_DPARAM16(n) GET_DPARAMX16(_decode_parameters, n) |
|
399 |
#define GET_DPARAM8(n) GET_DPARAMX8(_decode_parameters, n) |
|
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 |
||
406 |
#define SET_EXPENSES_TYPE(x) if (x) _yearly_expenses_type=x; |
|
407 |
||
408 |
/* landscape.c */ |
|
409 |
extern const byte _tileh_to_sprite[32]; |
|
410 |
extern byte _map_type_and_height[TILES_X * TILES_Y]; |
|
411 |
extern byte _map5[TILES_X * TILES_Y]; |
|
412 |
extern byte _map3_lo[TILES_X * TILES_Y]; |
|
413 |
extern byte _map3_hi[TILES_X * TILES_Y]; |
|
414 |
extern byte _map_owner[TILES_X * TILES_Y]; |
|
415 |
extern byte _map2[TILES_X * TILES_Y]; |
|
416 |
extern byte _map_extra_bits[TILES_X * TILES_Y/4]; |
|
417 |
||
418 |
static const byte _inclined_tileh[] = { |
|
419 |
3,9,3,6,12,6,12,9, |
|
420 |
}; |
|
421 |
||
422 |
extern const TileTypeProcs * const _tile_type_procs[16]; |
|
423 |
||
424 |
/* station_cmd.c */ |
|
425 |
// there are 5 types of airport (Country (3x4) , City(6x6), Metropolitan(6x6), International(7x7), Heliport(1x1) |
|
426 |
// will become obsolete once airports are loaded from seperate file |
|
427 |
extern const byte _airport_size_x[5]; |
|
428 |
extern const byte _airport_size_y[5]; |
|
429 |
||
430 |
extern const TileIndexDiff _tileoffs_by_dir[4]; |
|
431 |
||
432 |
/* misc */ |
|
433 |
VARDEF byte str_buffr[512]; |
|
434 |
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
|
435 |
#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
|
436 |
VARDEF char _userstring[USERSTRING_LEN]; |
0 | 437 |
VARDEF byte _vehicle_design_names; |
438 |
||
439 |
VARDEF SignStruct _sign_list[40]; |
|
440 |
VARDEF SignStruct *_new_sign_struct; |
|
441 |
||
442 |
VARDEF bool _ignore_wrong_grf; |
|
443 |
||
444 |
/* tunnelbridge */ |
|
445 |
#define MAX_BRIDGES 13 |
|
446 |
||
447 |
/* Debugging levels */ |
|
448 |
VARDEF int _debug_spritecache_level; |
|
449 |
VARDEF int _debug_misc_level; |
|
65
f9f866bc609c
(svn r66) -Fix Station list updated on station deletion/station rename
darkvater
parents:
58
diff
changeset
|
450 |
VARDEF int _debug_grf_level; |
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
70
diff
changeset
|
451 |
VARDEF int _debug_ai_level; |
185
646403e35006
(svn r186) -Add: debug 'net' for network debug (sign_de)
truelight
parents:
172
diff
changeset
|
452 |
VARDEF int _debug_net_level; |
0 | 453 |
|
454 |
void CDECL debug(const char *s, ...); |
|
66
d0f669221657
(svn r67) -Forget to change debug message for grfspecial.c
darkvater
parents:
65
diff
changeset
|
455 |
#ifdef NO_DEBUG_MESSAGES |
d0f669221657
(svn r67) -Forget to change debug message for grfspecial.c
darkvater
parents:
65
diff
changeset
|
456 |
#define DEBUG(name, level) |
d0f669221657
(svn r67) -Forget to change debug message for grfspecial.c
darkvater
parents:
65
diff
changeset
|
457 |
#else |
d0f669221657
(svn r67) -Forget to change debug message for grfspecial.c
darkvater
parents:
65
diff
changeset
|
458 |
#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
|
459 |
#endif |
0 | 460 |
|
461 |
#endif /* VARIABLES_H */ |