author | tron |
Fri, 29 Jul 2005 18:22:04 +0000 | |
changeset 2230 | e461b07aead7 |
parent 2201 | f240b3c7e2ec |
child 2288 | 2e27113b0611 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef VARIABLES_H |
4 |
#define VARIABLES_H |
|
5 |
||
6 |
// ********* START OF SAVE REGION |
|
7 |
#if !defined(MAX_PATH) |
|
8 |
# define MAX_PATH 260 |
|
9 |
#endif |
|
10 |
||
11 |
// Prices and also the fractional part. |
|
12 |
VARDEF Prices _price; |
|
13 |
VARDEF uint16 _price_frac[NUM_PRICES]; |
|
14 |
||
15 |
VARDEF uint32 _cargo_payment_rates[NUM_CARGO]; |
|
16 |
VARDEF uint16 _cargo_payment_rates_frac[NUM_CARGO]; |
|
17 |
||
18 |
typedef struct { |
|
19 |
GameDifficulty diff; |
|
20 |
byte diff_level; |
|
21 |
byte currency; |
|
22 |
bool kilometers; |
|
23 |
byte town_name; |
|
24 |
byte landscape; |
|
25 |
byte snow_line; |
|
26 |
byte autosave; |
|
27 |
byte road_side; |
|
28 |
} GameOptions; |
|
29 |
||
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
30 |
/* These are the options for the current game |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
31 |
* either ingame, or loaded. Also used for networking games */ |
0 | 32 |
VARDEF GameOptions _opt; |
33 |
||
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
34 |
/* These are the default options for a new game */ |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
35 |
VARDEF GameOptions _opt_newgame; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
36 |
|
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
37 |
// Pointer to one of the two _opt OR _opt_newgame structs |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
38 |
VARDEF GameOptions *_opt_ptr; |
0 | 39 |
|
759
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
40 |
enum { |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
41 |
CF_NOEURO = 0, |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
42 |
CF_ISEURO = 1, |
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 |
|
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
45 |
typedef struct { |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
46 |
uint16 rate; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
47 |
char separator; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
48 |
uint16 to_euro; |
788
951b52443d48
(svn r1255) Renamed "postfix" to "suffix", for strings and variable names
dominik
parents:
761
diff
changeset
|
49 |
char prefix[16]; |
951b52443d48
(svn r1255) Renamed "postfix" to "suffix", for strings and variable names
dominik
parents:
761
diff
changeset
|
50 |
char suffix[16]; |
759
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
51 |
} CurrencySpec; |
a445474d7c21
(svn r1215) Feature: You can now make a custom currency by chosing "Custom..."
dominik
parents:
708
diff
changeset
|
52 |
|
761
9bfb58cb3a69
(svn r1219) -Fix: compilation for windows release build (forgotten VARDEF)
darkvater
parents:
759
diff
changeset
|
53 |
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
|
54 |
|
0 | 55 |
// Current date |
56 |
VARDEF uint16 _date; |
|
57 |
VARDEF uint16 _date_fract; |
|
58 |
||
59 |
// Amount of game ticks |
|
60 |
VARDEF uint16 _tick_counter; |
|
61 |
||
2090
66677ed50f3c
(svn r2600) Fix: [vehicles] Fix problem with vehicle loop not distributing the calls evenly over the day.
ludde
parents:
2084
diff
changeset
|
62 |
// This one is not used anymore. |
0 | 63 |
VARDEF VehicleID _vehicle_id_ctr_day; |
64 |
||
65 |
// Skip aging of cargo? |
|
66 |
VARDEF byte _age_cargo_skip_counter; |
|
67 |
||
68 |
// Available aircraft types |
|
69 |
VARDEF byte _avail_aircraft; |
|
70 |
||
71 |
// Position in tile loop |
|
72 |
VARDEF TileIndex _cur_tileloop_tile; |
|
73 |
||
74 |
// Also save scrollpos_x, scrollpos_y and zoom |
|
75 |
VARDEF uint16 _disaster_delay; |
|
76 |
||
77 |
// Determines what station to operate on in the |
|
78 |
// tick handler. |
|
79 |
VARDEF uint16 _station_tick_ctr; |
|
80 |
||
206 | 81 |
VARDEF uint32 _random_seeds[2][2]; |
2073 | 82 |
|
0 | 83 |
// Iterator through all towns in OnTick_Town |
1517
596d52828893
(svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubi?ski <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much.
pasky
parents:
1500
diff
changeset
|
84 |
VARDEF uint32 _cur_town_ctr; |
1529
3a8196d15b01
(svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it.
pasky
parents:
1517
diff
changeset
|
85 |
// Frequency iterator at the same place |
3a8196d15b01
(svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it.
pasky
parents:
1517
diff
changeset
|
86 |
VARDEF uint32 _cur_town_iter; |
0 | 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
b0d0df062880
(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 |
|
2008
cdb444f6d43c
(svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
hackykid
parents:
2006
diff
changeset
|
105 |
bool auto_pbs_placement;// automatic pbs signal placement |
0 | 106 |
bool mammoth_trains; // allow very long trains |
107 |
bool join_stations; // allow joining of train stations |
|
108 |
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
|
109 |
bool improved_load; // improved loading algorithm |
0 | 110 |
byte station_spread; // amount a station may spread |
111 |
bool inflation; // disable inflation |
|
112 |
bool selectgoods; // only send the goods to station if a train has been there |
|
113 |
bool longbridges; // allow 100 tile long bridges |
|
114 |
bool gotodepot; // allow goto depot in orders |
|
115 |
bool build_rawmaterial_ind; // allow building raw material industries |
|
116 |
bool multiple_industry_per_town; // allow many industries of the same type per town |
|
117 |
bool same_industry_close; // allow same type industries to be built close to each other |
|
118 |
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
|
119 |
uint8 order_review_system; |
0 | 120 |
bool train_income_warn; // if train is generating little income, show a warning |
121 |
bool status_long_date; // always show long date in status bar |
|
122 |
bool signal_side; // show signals on right side |
|
123 |
bool show_finances; // show finances at end of year |
|
124 |
bool new_nonstop; // ttdpatch compatible nonstop handling |
|
125 |
bool roadveh_queue; // buggy road vehicle queueing |
|
126 |
bool autoscroll; // scroll when moving mouse to the edge. |
|
127 |
byte errmsg_duration; // duration of error message |
|
128 |
byte snow_line_height; // a number 0-15 that configured snow line height |
|
129 |
bool bribe; // enable bribing the local authority |
|
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
4fbbb01cf87b
(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
ea2ae881814c
(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) |
ea2ae881814c
(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 |
ea2ae881814c
(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 |
ea2ae881814c
(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up to 5000
truelight
parents:
1247
diff
changeset
|
143 |
UnitID max_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 |
byte pf_maxdepth; // maximum recursion depth when searching for a train route for new pathfinder |
|
156 |
uint16 pf_maxlength; // maximum length when searching for a train route for new pathfinder |
|
157 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
158 |
|
0 | 159 |
bool bridge_pillars; // show bridge pillars for high bridges |
160 |
||
20
13a47054d81e
(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOL
truelight
parents:
11
diff
changeset
|
161 |
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
|
162 |
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
|
163 |
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
|
164 |
bool ai_disable_veh_ship; // disable types for AI |
0 | 165 |
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
|
166 |
uint32 ending_date; // end of the game (just show highscore) |
0 | 167 |
uint32 colored_news_date; // when does newspaper become colored? |
168 |
||
169 |
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
|
170 |
bool autosave_on_exit; // save an autosave when you quit the game, but do not ask "Do you really want to quit?" |
0 | 171 |
bool extra_dynamite; // extra dynamite |
172 |
||
173 |
bool never_expire_vehicles; // never expire vehicles |
|
174 |
byte extend_vehicle_life; // extend vehicle life by this many years |
|
175 |
||
176 |
bool auto_euro; // automatically switch to euro in 2002 |
|
177 |
bool serviceathelipad; // service helicopters at helipads automatically (no need to send to depot) |
|
178 |
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
|
179 |
bool allow_shares; // allow the buying/selling of shares |
0 | 180 |
byte dist_local_authority; // distance for town local authority, default 20 |
181 |
||
182 |
byte wait_oneway_signal; //waitingtime in days before a oneway signal |
|
183 |
byte wait_twoway_signal; //waitingtime in days before a twoway signal |
|
184 |
||
1218 | 185 |
uint map_x; // Size of map |
186 |
uint map_y; |
|
187 |
||
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
|
188 |
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
|
189 |
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
|
190 |
|
1700
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
191 |
/* |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
192 |
* New Path Finding |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
193 |
*/ |
1247 | 194 |
bool new_pathfinding_all; /* Use the newest pathfinding algorithm for all */ |
195 |
||
1700
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
196 |
/** |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
197 |
* The maximum amount of search nodes a single NPF run should take. This |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
198 |
* limit should make sure performance stays at acceptable levels at the cost |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
199 |
* of not being perfect anymore. This will probably be fixed in a more |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
200 |
* sophisticated way sometime soon |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
201 |
*/ |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
202 |
uint32 npf_max_search_nodes; |
e1fe3446d013
(svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though.
matthijs
parents:
1688
diff
changeset
|
203 |
|
1643
420cad9e62e4
(svn r2147) - Add: [NPF] Give red presignal exit signals a different (higher) penalty, to discourage trains from waiting at presignal exits.
matthijs
parents:
1529
diff
changeset
|
204 |
uint32 npf_rail_firstred_penalty; /* The penalty for when the first signal is red (and it is not an exit or combo signal) */ |
420cad9e62e4
(svn r2147) - Add: [NPF] Give red presignal exit signals a different (higher) penalty, to discourage trains from waiting at presignal exits.
matthijs
parents:
1529
diff
changeset
|
205 |
uint32 npf_rail_firstred_exit_penalty; /* The penalty for when the first signal is red (and it is an exit or combo signal) */ |
1459
19333d7f99b3
(svn r1963) - Add: [NPF] Penalty for a red signal that is the last signal on the path.
matthijs
parents:
1417
diff
changeset
|
206 |
uint32 npf_rail_lastred_penalty; /* The penalty for when the last signal is red */ |
1247 | 207 |
uint32 npf_rail_station_penalty; /* The penalty for station tiles */ |
208 |
uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */ |
|
1460 | 209 |
uint32 npf_rail_curve_penalty; /* The penalty for curves */ |
1777
f703cf05b5b9
(svn r2281) - Fix: [ 1115204 ] [NPF] When pressing the goto depot button, trains will now also look behind it if there is no depot in front. If so, the train reverses immediately. This also work anywhere, not just at stations.
matthijs
parents:
1770
diff
changeset
|
210 |
uint32 npf_rail_depot_reverse_penalty; /* The penalty for reversing in depots */ |
1751
009a240d035a
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1700
diff
changeset
|
211 |
uint32 npf_buoy_penalty; /* The penalty for going over (through) a buoy */ |
009a240d035a
(svn r2255) - Fix: [ 9680363 ] [NPF] Broken buoy handling for ships
matthijs
parents:
1700
diff
changeset
|
212 |
uint32 npf_water_curve_penalty; /* The penalty for curves */ |
1941
ca268f8837df
(svn r2447) * Add: [NPF] Penalty for road vehicles making turns.
matthijs
parents:
1787
diff
changeset
|
213 |
uint32 npf_road_curve_penalty; /* The penalty for curves */ |
2006
9d5d7fd428c2
(svn r2514) - Codechange: [NPF] Move the checking of railtype into a funciton IsCompatibleRail().
matthijs
parents:
1977
diff
changeset
|
214 |
uint32 npf_crossing_penalty; /* The penalty for level crossings */ |
1247 | 215 |
|
835
f6a341f541d7
(svn r1312) -Add: Patch which is on by default: population in label of the town
truelight
parents:
788
diff
changeset
|
216 |
bool population_in_label; // Show the population of a town in his label? |
0 | 217 |
} Patches; |
218 |
||
219 |
VARDEF Patches _patches; |
|
220 |
||
221 |
||
222 |
typedef struct Cheat { |
|
223 |
bool been_used; // has this cheat been used before? |
|
224 |
byte value; // active? |
|
225 |
} Cheat; |
|
226 |
||
227 |
||
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
228 |
// WARNING! Do _not_ remove entries in Cheats struct or change the order |
0 | 229 |
// of the existing ones! Would break downward compatibility. |
230 |
// Only add new entries at the end of the struct! |
|
231 |
||
232 |
typedef struct Cheats { |
|
233 |
Cheat magic_bulldozer; // dynamite industries, unmovables |
|
234 |
Cheat switch_player; // change to another player |
|
235 |
Cheat money; // get rich |
|
236 |
Cheat crossing_tunnels; // allow tunnels that cross each other |
|
100 | 237 |
Cheat build_in_pause; // build while in pause mode |
238 |
Cheat no_jetcrash; // no jet will crash on small airports anymore |
|
239 |
Cheat switch_climate; |
|
108
8e2e584a9500
(svn r109) added/heavily modified patch by truesatan: cheat change date
dominik
parents:
105
diff
changeset
|
240 |
Cheat change_date; //changes date ingame |
1176
cc9d8618620d
(svn r1678) Added cheat option for setting production of raw-material product industries in game
miham
parents:
1128
diff
changeset
|
241 |
Cheat setup_prod; //setup raw-material production in game |
0 | 242 |
} Cheats; |
243 |
||
244 |
VARDEF Cheats _cheats; |
|
245 |
||
246 |
typedef struct Paths { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
188
diff
changeset
|
247 |
char *personal_dir; // includes cfg file and save folder |
0 | 248 |
char *game_data_dir; // includes data, gm, lang |
249 |
char *data_dir; |
|
250 |
char *gm_dir; |
|
251 |
char *lang_dir; |
|
252 |
char *save_dir; |
|
253 |
char *autosave_dir; |
|
254 |
char *scenario_dir; |
|
561
9a0c469a251c
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
543
diff
changeset
|
255 |
char *second_data_dir; |
0 | 256 |
} Paths; |
257 |
||
258 |
VARDEF Paths _path; |
|
259 |
||
260 |
// NOSAVE: Used in palette animations only, not really important. |
|
261 |
VARDEF int _timer_counter; |
|
262 |
||
263 |
||
264 |
// NOSAVE: can be determined from _date |
|
265 |
VARDEF byte _cur_year; |
|
266 |
VARDEF byte _cur_month; |
|
267 |
||
268 |
VARDEF bool _in_state_game_loop; |
|
206 | 269 |
VARDEF uint32 _frame_counter; |
0 | 270 |
|
84
1e0721c29bad
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
truelight
parents:
70
diff
changeset
|
271 |
VARDEF bool _is_ai_player; // current player is an AI player? - Can be removed if new AI is done |
0 | 272 |
|
273 |
VARDEF bool _do_autosave; |
|
274 |
VARDEF int _autosave_ctr; |
|
275 |
||
1787
0feb89e77229
(svn r2291) - Fix (regression): When a client joined it changed the server-player's name. Funny effect; but not desired. Thanks for pointing it out Tron. It needed a bit of hacking, but is not less of a hack than the one used before :)
Darkvater
parents:
1777
diff
changeset
|
276 |
VARDEF PlayerID _local_player; |
0 | 277 |
VARDEF byte _display_opt; |
278 |
VARDEF byte _pause; |
|
279 |
VARDEF int _caret_timer; |
|
1688
af2bb9bcb2ed
(svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
Darkvater
parents:
1643
diff
changeset
|
280 |
VARDEF uint32 _news_display_opt; |
af2bb9bcb2ed
(svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
Darkvater
parents:
1643
diff
changeset
|
281 |
VARDEF bool _news_ticker_sound; |
0 | 282 |
VARDEF byte _game_mode; |
283 |
||
284 |
VARDEF StringID _error_message; |
|
285 |
VARDEF StringID _error_message_2; |
|
286 |
VARDEF int32 _additional_cash_required; |
|
287 |
||
472
ba697666956e
(svn r723) Increase size of dparam so more parameters can be passed to string output
tron
parents:
350
diff
changeset
|
288 |
VARDEF uint32 _decode_parameters[20]; |
0 | 289 |
|
290 |
VARDEF int _docommand_recursive; |
|
291 |
||
292 |
VARDEF uint32 _pressed_key; // Low 8 bits = ASCII, High 16 bits = keycode |
|
293 |
VARDEF bool _ctrl_pressed; // Is Ctrl pressed? |
|
294 |
VARDEF bool _shift_pressed; // Is Alt pressed? |
|
295 |
VARDEF byte _dirkeys; // 1=left, 2=up, 4=right, 8=down |
|
296 |
||
297 |
VARDEF bool _fullscreen; |
|
298 |
VARDEF bool _double_size; |
|
299 |
VARDEF uint _display_hz; |
|
300 |
VARDEF bool _force_full_redraw; |
|
301 |
VARDEF uint _fullscreen_bpp; |
|
302 |
VARDEF bool _fast_forward; |
|
303 |
VARDEF bool _rightclick_emulate; |
|
304 |
||
305 |
// IN/OUT parameters to commands |
|
306 |
VARDEF byte _yearly_expenses_type; |
|
307 |
VARDEF TileIndex _terraform_err_tile; |
|
1977
37bbebf94434
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents:
1958
diff
changeset
|
308 |
VARDEF TileIndex _build_tunnel_endtile; |
0 | 309 |
VARDEF bool _generating_world; |
310 |
VARDEF int _new_town_size; |
|
311 |
VARDEF uint _returned_refit_amount; |
|
312 |
||
313 |
// Deals with the type of the savegame, independent of extension |
|
314 |
typedef struct { |
|
2099
02c5a49863e9
(svn r2609) - Feature: remove extension from savegames/scenarios when browsing the folders.
Darkvater
parents:
2090
diff
changeset
|
315 |
int mode; // savegame/scenario type (old, new) |
02c5a49863e9
(svn r2609) - Feature: remove extension from savegames/scenarios when browsing the folders.
Darkvater
parents:
2090
diff
changeset
|
316 |
char name[MAX_PATH]; // name |
02c5a49863e9
(svn r2609) - Feature: remove extension from savegames/scenarios when browsing the folders.
Darkvater
parents:
2090
diff
changeset
|
317 |
char title[255]; // internal name of the game |
0 | 318 |
} SmallFiosItem; |
319 |
||
320 |
// Used when switching from the intro menu. |
|
321 |
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
|
322 |
VARDEF StringID _switch_mode_errorstr; |
0 | 323 |
VARDEF bool _exit_game; |
324 |
VARDEF SmallFiosItem _file_to_saveload; |
|
325 |
VARDEF byte _make_screenshot; |
|
326 |
||
327 |
VARDEF byte _get_z_hint; // used as a hint to getslopez to return the right height at a bridge. |
|
328 |
||
329 |
VARDEF char *_newgrf_files[32]; |
|
330 |
||
331 |
||
332 |
VARDEF Vehicle *_place_clicked_vehicle; |
|
333 |
||
334 |
VARDEF char _ini_videodriver[16], _ini_musicdriver[16], _ini_sounddriver[16]; |
|
335 |
||
336 |
// debug features |
|
337 |
VARDEF char _savedump_path[64]; |
|
338 |
VARDEF uint _savedump_first, _savedump_freq, _savedump_last; |
|
339 |
// end of debug features |
|
340 |
||
341 |
// Used for dynamic language support |
|
342 |
typedef struct { |
|
343 |
int num; // number of languages |
|
344 |
int curr; // currently selected language index |
|
345 |
char curr_file[32]; // currently selected language file |
|
346 |
StringID dropdown[32 + 1]; // used in settings dialog |
|
1500
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
347 |
struct { |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
348 |
char *name; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
349 |
char *file; |
a66721629bc0
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
Darkvater
parents:
1460
diff
changeset
|
350 |
} ent[32]; |
0 | 351 |
} DynamicLanguages; |
352 |
||
353 |
VARDEF DynamicLanguages _dynlang; |
|
354 |
||
355 |
VARDEF int _num_resolutions; |
|
356 |
VARDEF uint16 _resolutions[32][2]; |
|
357 |
VARDEF uint16 _cur_resolution[2]; |
|
358 |
||
359 |
VARDEF char _savegame_format[8]; |
|
360 |
||
361 |
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
|
362 |
VARDEF char *_highscore_file; |
704
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
363 |
VARDEF char *_log_file; |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
364 |
VARDEF FILE *_log_file_fd; |
0 | 365 |
|
366 |
// NOSAVE: These can be recalculated from InitializeLandscapeVariables |
|
367 |
typedef struct { |
|
368 |
StringID names_s[NUM_CARGO]; |
|
2084
65639f898a50
(svn r2594) Fix: [strgen] Misc updates to the string system.
ludde
parents:
2078
diff
changeset
|
369 |
StringID names_long[NUM_CARGO]; |
0 | 370 |
StringID names_short[NUM_CARGO]; |
371 |
byte weights[NUM_CARGO]; |
|
372 |
SpriteID sprites[NUM_CARGO]; |
|
373 |
byte transit_days_1[NUM_CARGO]; |
|
374 |
byte transit_days_2[NUM_CARGO]; |
|
375 |
byte ai_railwagon[3][NUM_CARGO]; |
|
376 |
byte ai_roadveh_start[NUM_CARGO]; |
|
377 |
byte ai_roadveh_count[NUM_CARGO]; |
|
378 |
} CargoConst; |
|
379 |
||
380 |
VARDEF CargoConst _cargoc; |
|
381 |
||
382 |
||
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
383 |
static inline void SetDParamX(uint32 *s, uint n, uint32 v) |
0 | 384 |
{ |
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
385 |
s[n] = v; |
0 | 386 |
} |
387 |
||
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
388 |
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
|
389 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
390 |
return s[n]; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
391 |
} |
0 | 392 |
|
534
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
393 |
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
|
394 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
395 |
assert(n < lengthof(_decode_parameters)); |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
396 |
_decode_parameters[n] = v; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
397 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
398 |
|
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
399 |
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
|
400 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
401 |
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
|
402 |
_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
|
403 |
_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
|
404 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
405 |
|
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
406 |
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
|
407 |
{ |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
408 |
assert(n < lengthof(_decode_parameters)); |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
409 |
return _decode_parameters[n]; |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
410 |
} |
306bc86eb23e
(svn r901) Small step in the process to clean up the DPARAM mess:
tron
parents:
523
diff
changeset
|
411 |
|
2055
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
412 |
// Used to bind a C string name to a dparam number. |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
413 |
// NOTE: This has a short lifetime. You can't |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
414 |
// use this string much later or it will be gone. |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
415 |
void SetDParamStr(uint n, const char *str); |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
416 |
|
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
417 |
// This function takes a C-string and allocates a temporary string ID. |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
418 |
// The duration of the bound string is valid only until the next acll to GetString, |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
419 |
// so be careful. |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
420 |
StringID BindCString(const char *str); |
4926ed1a7562
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
ludde
parents:
2044
diff
changeset
|
421 |
|
0 | 422 |
|
423 |
#define COPY_IN_DPARAM(offs,src,num) memcpy(_decode_parameters + offs, src, sizeof(uint32) * (num)) |
|
424 |
#define COPY_OUT_DPARAM(dst,offs,num) memcpy(dst,_decode_parameters + offs, sizeof(uint32) * (num)) |
|
425 |
||
426 |
||
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
|
427 |
#define SET_EXPENSES_TYPE(x) _yearly_expenses_type = x; |
0 | 428 |
|
429 |
/* landscape.c */ |
|
430 |
extern const byte _tileh_to_sprite[32]; |
|
1958
0266bb01a1e6
(svn r2464) Move definition of _inclined_tileh out of variables.h
tron
parents:
1941
diff
changeset
|
431 |
extern const byte _inclined_tileh[8]; |
0 | 432 |
|
433 |
extern const TileTypeProcs * const _tile_type_procs[16]; |
|
434 |
||
435 |
/* station_cmd.c */ |
|
436 |
// there are 5 types of airport (Country (3x4) , City(6x6), Metropolitan(6x6), International(7x7), Heliport(1x1) |
|
437 |
// will become obsolete once airports are loaded from seperate file |
|
1417
74779e56d5db
(svn r1921) -Fix: Out of bounds array access which caused oil rigs to accept other cargo types besides passengers and mail
tron
parents:
1406
diff
changeset
|
438 |
extern const byte _airport_size_x[]; |
74779e56d5db
(svn r1921) -Fix: Out of bounds array access which caused oil rigs to accept other cargo types besides passengers and mail
tron
parents:
1406
diff
changeset
|
439 |
extern const byte _airport_size_y[]; |
0 | 440 |
|
441 |
/* misc */ |
|
442 |
VARDEF char _screenshot_name[128]; |
|
443 |
VARDEF byte _vehicle_design_names; |
|
444 |
||
445 |
/* tunnelbridge */ |
|
446 |
#define MAX_BRIDGES 13 |
|
447 |
||
1777
f703cf05b5b9
(svn r2281) - Fix: [ 1115204 ] [NPF] When pressing the goto depot button, trains will now also look behind it if there is no depot in front. If so, the train reverses immediately. This also work anywhere, not just at stations.
matthijs
parents:
1770
diff
changeset
|
448 |
/* For new pathfinding. Define here so it is globally available without having |
f703cf05b5b9
(svn r2281) - Fix: [ 1115204 ] [NPF] When pressing the goto depot button, trains will now also look behind it if there is no depot in front. If so, the train reverses immediately. This also work anywhere, not just at stations.
matthijs
parents:
1770
diff
changeset
|
449 |
* to include npf.h */ |
1247 | 450 |
#define NPF_TILE_LENGTH 100 |
451 |
||
842 | 452 |
/* Autoreplace vehicle stuff*/ |
1128
ca7f860db7ac
(svn r1629) added a counter to tell how many engines you have of each type to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list.
bjarni
parents:
1037
diff
changeset
|
453 |
VARDEF byte _autoreplace_array[256]; |
ca7f860db7ac
(svn r1629) added a counter to tell how many engines you have of each type to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list.
bjarni
parents:
1037
diff
changeset
|
454 |
VARDEF uint16 _player_num_engines[256]; |
1178
7c39a741eafb
(svn r1680) Feature: Replace train GUI now remembers the railtype selected in the dropdown menu
bjarni
parents:
1176
diff
changeset
|
455 |
VARDEF byte _railtype_selected_in_replace_gui; |
842 | 456 |
|
704
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
457 |
/* Forking stuff */ |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
458 |
VARDEF bool _dedicated_forks; |
e843dd369938
(svn r1154) -Add: [Network] Forked dedicated server (start openttd with -Df) (GeniusDex)
truelight
parents:
679
diff
changeset
|
459 |
|
0 | 460 |
#endif /* VARIABLES_H */ |