OpenTTD: src/newgrf_callbacks.h Source File

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

newgrf_callbacks.h
Go to the documentation of this file.
1 /* $Id: newgrf_callbacks.h 26747 2014-08-17 14:53:11Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef NEWGRF_CALLBACKS_H
13 #define NEWGRF_CALLBACKS_H
14
22 enum CallbackID {
24 CBID_NO_CALLBACK = 0x00,
25
27 CBID_RANDOM_TRIGGER = 0x01,
28
29 /* There are no callbacks 0x02 - 0x0F. */
30
32 CBID_VEHICLE_VISUAL_EFFECT = 0x10, // 8 bit callback
33
35 CBID_VEHICLE_LENGTH = 0x11,
36
38 CBID_VEHICLE_LOAD_AMOUNT = 0x12, // 8 bit callback
39
41 CBID_STATION_AVAILABILITY = 0x13, // 8 bit callback
42
44 CBID_STATION_SPRITE_LAYOUT = 0x14,
45
50 CBID_VEHICLE_REFIT_CAPACITY = 0x15, // 15 bit callback
51
53 CBID_VEHICLE_ARTIC_ENGINE = 0x16, // 8 bit callback for grf version < 8
54
56 CBID_HOUSE_ALLOW_CONSTRUCTION = 0x17, // 8 bit callback
57
59 CBID_GENERIC_AI_PURCHASE_SELECTION = 0x18, // 8 bit callback, implemented for stations only
60
62 CBID_VEHICLE_CARGO_SUFFIX = 0x19,
63
65 CBID_HOUSE_ANIMATION_NEXT_FRAME = 0x1A, // 15 bit callback
66
68 CBID_HOUSE_ANIMATION_START_STOP = 0x1B, // 15 bit callback
69
71 CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
72
74 CBID_TRAIN_ALLOW_WAGON_ATTACH = 0x1D,
75
77 CBID_HOUSE_COLOUR = 0x1E, // 15 bit callback
78
80 CBID_HOUSE_CARGO_ACCEPTANCE = 0x1F, // 15 bit callback
81
83 CBID_HOUSE_ANIMATION_SPEED = 0x20, // 8 bit callback
84
86 CBID_HOUSE_DESTRUCTION = 0x21, // 8 bit callback
87
89 CBID_INDUSTRY_PROBABILITY = 0x22, // 15 bit callback
90
95 CBID_VEHICLE_ADDITIONAL_TEXT = 0x23,
96
98 CBID_STATION_TILE_LAYOUT = 0x24, // 15 bit callback
99
101 CBID_INDTILE_ANIM_START_STOP = 0x25, // 15 bit callback
102
104 CBID_INDTILE_ANIM_NEXT_FRAME = 0x26, // 15 bit callback
105
107 CBID_INDTILE_ANIMATION_SPEED = 0x27, // 8 bit callback
108
110 CBID_INDUSTRY_LOCATION = 0x28, // 15 bit callback
111
113 CBID_INDUSTRY_PRODUCTION_CHANGE = 0x29, // 15 bit callback
114
116 CBID_HOUSE_ACCEPT_CARGO = 0x2A, // 15 bit callback
117
119 CBID_INDTILE_CARGO_ACCEPTANCE = 0x2B, // 15 bit callback
120
122 CBID_INDTILE_ACCEPT_CARGO = 0x2C, // 15 bit callback
123
128 CBID_VEHICLE_COLOUR_MAPPING = 0x2D, // 15 bit callback
129
131 CBID_HOUSE_PRODUCE_CARGO = 0x2E, // 15 bit callback
132
134 CBID_INDTILE_SHAPE_CHECK = 0x2F, // 15 bit callback
135
137 CBID_INDTILE_DRAW_FOUNDATIONS = 0x30, // 15 bit callback
138
143 CBID_VEHICLE_START_STOP_CHECK = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
144
146 CBID_VEHICLE_32DAY_CALLBACK = 0x32, // 2 bit callback
147
149 CBID_VEHICLE_SOUND_EFFECT = 0x33, // 15 bit callback
150
152 CBID_VEHICLE_AUTOREPLACE_SELECTION = 0x34, // 15 bit callback, not implemented
153
155 CBID_INDUSTRY_MONTHLYPROD_CHANGE = 0x35, // 15 bit callback
156
161 CBID_VEHICLE_MODIFY_PROPERTY = 0x36, // 8/15 bit depends on queried property
162
164 CBID_INDUSTRY_CARGO_SUFFIX = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit
165
167 CBID_INDUSTRY_FUND_MORE_TEXT = 0x38, // 15 bit callback
168
170 CBID_CARGO_PROFIT_CALC = 0x39, // 15 bit callback
171
173 CBID_INDUSTRY_WINDOW_MORE_TEXT = 0x3A, // 15 bit callback
174
176 CBID_INDUSTRY_SPECIAL_EFFECT = 0x3B, // 15 bit callback
177
179 CBID_INDTILE_AUTOSLOPE = 0x3C, // 15 bit callback
180
182 CBID_INDUSTRY_REFUSE_CARGO = 0x3D, // 15 bit callback
183
184 /* There are no callbacks 0x3E - 0x13F */
185
187 CBID_STATION_ANIM_START_STOP = 0x140, // 15 bit callback
188
190 CBID_STATION_ANIM_NEXT_FRAME = 0x141, // 15 bit callback
191
193 CBID_STATION_ANIMATION_SPEED = 0x142, // 8 bit callback
194
196 CBID_HOUSE_DENY_DESTRUCTION = 0x143, // 15 bit callback
197
199 CBID_SOUNDS_AMBIENT_EFFECT = 0x144, // 15 bit callback
200
202 CBID_CARGO_STATION_RATING_CALC = 0x145, // 15 bit callback
203
205 CBID_NEW_SIGNALS_SPRITE_DRAW = 0x146, // 15 bit callback, not implemented
206
208 CBID_CANALS_SPRITE_OFFSET = 0x147, // 15 bit callback
209
211 CBID_HOUSE_WATCHED_CARGO_ACCEPTED = 0x148, // 15 bit callback
212
214 CBID_STATION_LAND_SLOPE_CHECK = 0x149, // 15 bit callback
215
217 CBID_INDUSTRY_DECIDE_COLOUR = 0x14A, // 4 bit callback
218
220 CBID_INDUSTRY_INPUT_CARGO_TYPES = 0x14B, // 8 bit callback
221
223 CBID_INDUSTRY_OUTPUT_CARGO_TYPES = 0x14C, // 8 bit callback
224
226 CBID_HOUSE_CUSTOM_NAME = 0x14D, // 15 bit callback
227
229 CBID_HOUSE_DRAW_FOUNDATIONS = 0x14E, // 15 bit callback
230
232 CBID_HOUSE_AUTOSLOPE = 0x14F, // 15 bit callback
233
235 CBID_AIRPTILE_DRAW_FOUNDATIONS = 0x150, // 15 bit callback
236
238 CBID_AIRPTILE_ANIM_START_STOP = 0x152, // 15 bit callback
239
241 CBID_AIRPTILE_ANIM_NEXT_FRAME = 0x153, // 15 bit callback
242
244 CBID_AIRPTILE_ANIMATION_SPEED = 0x154, // 8 bit callback
245
250 CBID_AIRPORT_ADDITIONAL_TEXT = 0x155, // 15 bit callback
251
253 CBID_AIRPORT_LAYOUT_NAME = 0x156, // 15 bit callback
254
256 CBID_OBJECT_LAND_SLOPE_CHECK = 0x157, // 15 bit callback
257
259 CBID_OBJECT_ANIMATION_NEXT_FRAME = 0x158, // 15 bit callback
260
262 CBID_OBJECT_ANIMATION_START_STOP = 0x159, // 15 bit callback
263
265 CBID_OBJECT_ANIMATION_SPEED = 0x15A, // 8 bit callback
266
268 CBID_OBJECT_COLOUR = 0x15B, // 15 bit callback
269
271 CBID_OBJECT_FUND_MORE_TEXT = 0x15C, // 15 bit callback
272
274 CBID_OBJECT_AUTOSLOPE = 0x15D, // 15 bit callback
275
277 CBID_VEHICLE_REFIT_COST = 0x15E, // 15 bit callback
278
280 CBID_INDUSTRY_PROD_CHANGE_BUILD = 0x15F, // 15 bit callback
281
283 CBID_VEHICLE_SPAWN_VISUAL_EFFECT = 0x160, // 15 bit callback
284 };
285
290 enum VehicleCallbackMask {
291 CBM_VEHICLE_VISUAL_EFFECT = 0,
292 CBM_VEHICLE_LENGTH = 1,
293 CBM_VEHICLE_LOAD_AMOUNT = 2,
294 CBM_VEHICLE_REFIT_CAPACITY = 3,
295 CBM_VEHICLE_ARTIC_ENGINE = 4,
296 CBM_VEHICLE_CARGO_SUFFIX = 5,
297 CBM_VEHICLE_COLOUR_REMAP = 6,
298 CBM_VEHICLE_SOUND_EFFECT = 7,
299 };
300
304 enum StationCallbackMask {
305 CBM_STATION_AVAIL = 0,
306 CBM_STATION_SPRITE_LAYOUT = 1,
307 CBM_STATION_ANIMATION_NEXT_FRAME = 2,
308 CBM_STATION_ANIMATION_SPEED = 3,
309 CBM_STATION_SLOPE_CHECK = 4,
310 };
311
315 enum HouseCallbackMask {
316 CBM_HOUSE_ALLOW_CONSTRUCTION = 0,
317 CBM_HOUSE_ANIMATION_NEXT_FRAME = 1,
318 CBM_HOUSE_ANIMATION_START_STOP = 2,
319 CBM_HOUSE_CONSTRUCTION_STATE_CHANGE = 3,
320 CBM_HOUSE_COLOUR = 4,
321 CBM_HOUSE_CARGO_ACCEPTANCE = 5,
322 CBM_HOUSE_ANIMATION_SPEED = 6,
323 CBM_HOUSE_DESTRUCTION = 7,
324 CBM_HOUSE_ACCEPT_CARGO = 8,
325 CBM_HOUSE_PRODUCE_CARGO = 9,
326 CBM_HOUSE_DENY_DESTRUCTION = 10,
327 CBM_HOUSE_DRAW_FOUNDATIONS = 11,
328 CBM_HOUSE_AUTOSLOPE = 12,
329 };
330
334 enum CanalCallbackMask {
335 CBM_CANAL_SPRITE_OFFSET = 0,
336 };
337
341 enum CargoCallbackMask {
342 CBM_CARGO_PROFIT_CALC = 0,
343 CBM_CARGO_STATION_RATING_CALC = 1,
344 };
345
349 enum IndustryCallbackMask {
350 CBM_IND_PROBABILITY = 0,
351 CBM_IND_PRODUCTION_CARGO_ARRIVAL = 1,
352 CBM_IND_PRODUCTION_256_TICKS = 2,
353 CBM_IND_LOCATION = 3,
354 CBM_IND_PRODUCTION_CHANGE = 4,
355 CBM_IND_MONTHLYPROD_CHANGE = 5,
356 CBM_IND_CARGO_SUFFIX = 6,
357 CBM_IND_FUND_MORE_TEXT = 7,
358 CBM_IND_WINDOW_MORE_TEXT = 8,
359 CBM_IND_SPECIAL_EFFECT = 9,
360 CBM_IND_REFUSE_CARGO = 10,
361 CBM_IND_DECIDE_COLOUR = 11,
362 CBM_IND_INPUT_CARGO_TYPES = 12,
363 CBM_IND_OUTPUT_CARGO_TYPES = 13,
364 CBM_IND_PROD_CHANGE_BUILD = 14,
365 };
366
370 enum IndustryTileCallbackMask {
371 CBM_INDT_ANIM_NEXT_FRAME = 0,
372 CBM_INDT_ANIM_SPEED = 1,
373 CBM_INDT_CARGO_ACCEPTANCE = 2,
374 CBM_INDT_ACCEPT_CARGO = 3,
375 CBM_INDT_SHAPE_CHECK = 4,
376 CBM_INDT_DRAW_FOUNDATIONS = 5,
377 CBM_INDT_AUTOSLOPE = 6,
378 };
379
383 enum ObjectCallbackMask {
384 CBM_OBJ_SLOPE_CHECK = 0,
385 CBM_OBJ_ANIMATION_NEXT_FRAME = 1,
386 CBM_OBJ_ANIMATION_SPEED = 2,
387 CBM_OBJ_COLOUR = 3,
388 CBM_OBJ_FUND_MORE_TEXT = 4,
389 CBM_OBJ_AUTOSLOPE = 5,
390 };
391
395 enum AirportTileCallbackMask {
396 CBM_AIRT_ANIM_NEXT_FRAME = 0,
397 CBM_AIRT_ANIM_SPEED = 1,
398 CBM_AIRT_SHAPE_CHECK = 4,
399 CBM_AIRT_DRAW_FOUNDATIONS = 5,
400 CBM_AIRT_AUTOSLOPE = 6,
401 };
402
406 static const uint CALLBACK_FAILED = 0xFFFF;
407 static const uint CALLBACK_HOUSEPRODCARGO_END = 0x20FF;
408
409 #endif /* NEWGRF_CALLBACKS_H */