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