# newgrf_callbacks.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef NEWGRF_CALLBACKS_H
    00013 #define NEWGRF_CALLBACKS_H
    00014
    00022 enum CallbackID {
    00024   CBID_NO_CALLBACK                     = 0x00,
    00025
    00027   CBID_RANDOM_TRIGGER                  = 0x01,
    00028
    00029   /* There are no callbacks 0x02 - 0x0F. */
    00030
    00032   CBID_VEHICLE_VISUAL_EFFECT           = 0x10, // 8 bit callback
    00033
    00035   CBID_VEHICLE_LENGTH                  = 0x11,
    00036
    00038   CBID_VEHICLE_LOAD_AMOUNT             = 0x12, // 8 bit callback
    00039
    00041   CBID_STATION_AVAILABILITY            = 0x13, // 8 bit callback
    00042
    00044   CBID_STATION_SPRITE_LAYOUT           = 0x14,
    00045
    00050   CBID_VEHICLE_REFIT_CAPACITY          = 0x15, // 15 bit callback
    00051
    00053   CBID_VEHICLE_ARTIC_ENGINE            = 0x16, // 8 bit callback
    00054
    00056   CBID_HOUSE_ALLOW_CONSTRUCTION        = 0x17, // 8 bit callback
    00057
    00059   CBID_GENERIC_AI_PURCHASE_SELECTION   = 0x18, // 8 bit callback, not implemented
    00060
    00062   CBID_VEHICLE_CARGO_SUFFIX            = 0x19,
    00063
    00065   CBID_HOUSE_ANIMATION_NEXT_FRAME      = 0x1A, // 15 bit callback
    00066
    00068   CBID_HOUSE_ANIMATION_START_STOP      = 0x1B, // 15 bit callback
    00069
    00071   CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
    00072
    00074   CBID_TRAIN_ALLOW_WAGON_ATTACH        = 0x1D,
    00075
    00077   CBID_HOUSE_COLOUR                    = 0x1E, // 15 bit callback
    00078
    00080   CBID_HOUSE_CARGO_ACCEPTANCE          = 0x1F, // 15 bit callback
    00081
    00083   CBID_HOUSE_ANIMATION_SPEED           = 0x20, // 8 bit callback
    00084
    00086   CBID_HOUSE_DESTRUCTION               = 0x21, // 8 bit callback
    00087
    00089   CBID_INDUSTRY_AVAILABLE              = 0x22, // 15 bit callback
    00090
    00095   CBID_VEHICLE_ADDITIONAL_TEXT         = 0x23,
    00096
    00098   CBID_STATION_TILE_LAYOUT             = 0x24, // 15 bit callback
    00099
    00101   CBID_INDTILE_ANIM_START_STOP         = 0x25, // 15 bit callback
    00102
    00104   CBID_INDTILE_ANIM_NEXT_FRAME         = 0x26, // 15 bit callback
    00105
    00107   CBID_INDTILE_ANIMATION_SPEED         = 0x27, // 8 bit callback
    00108
    00110   CBID_INDUSTRY_LOCATION               = 0x28, // 15 bit callback
    00111
    00113   CBID_INDUSTRY_PRODUCTION_CHANGE      = 0x29, // 15 bit callback
    00114
    00116   CBID_HOUSE_ACCEPT_CARGO              = 0x2A, // 15 bit callback
    00117
    00119   CBID_INDTILE_CARGO_ACCEPTANCE        = 0x2B, // 15 bit callback
    00120
    00122   CBID_INDTILE_ACCEPT_CARGO            = 0x2C, // 15 bit callback
    00123
    00128   CBID_VEHICLE_COLOUR_MAPPING          = 0x2D, // 15 bit callback
    00129
    00131   CBID_HOUSE_PRODUCE_CARGO             = 0x2E, // 15 bit callback
    00132
    00134   CBID_INDTILE_SHAPE_CHECK             = 0x2F, // 15 bit callback
    00135
    00137   CBID_INDTILE_DRAW_FOUNDATIONS        = 0x30, // 15 bit callback
    00138
    00143   CBID_VEHICLE_START_STOP_CHECK        = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
    00144
    00146   CBID_VEHICLE_32DAY_CALLBACK          = 0x32, // 2 bit callback
    00147
    00149   CBID_VEHICLE_SOUND_EFFECT            = 0x33, // 15 bit callback
    00150
    00152   CBID_VEHICLE_AUTOREPLACE_SELECTION   = 0x34, // 15 bit callback, not implemented
    00153
    00155   CBID_INDUSTRY_MONTHLYPROD_CHANGE     = 0x35, // 15 bit callback
    00156
    00161   CBID_VEHICLE_MODIFY_PROPERTY         = 0x36, // 8/15 bit depends on queried property
    00162
    00164   CBID_INDUSTRY_CARGO_SUFFIX           = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit
    00165
    00167   CBID_INDUSTRY_FUND_MORE_TEXT         = 0x38, // 15 bit callback
    00168
    00170   CBID_CARGO_PROFIT_CALC               = 0x39, // 15 bit callback
    00171
    00173   CBID_INDUSTRY_WINDOW_MORE_TEXT       = 0x3A, // 15 bit callback
    00174
    00176   CBID_INDUSTRY_SPECIAL_EFFECT         = 0x3B, // 15 bit callback
    00177
    00179   CBID_INDTILE_AUTOSLOPE               = 0x3C, // 15 bit callback
    00180
    00182   CBID_INDUSTRY_REFUSE_CARGO           = 0x3D, // 15 bit callback
    00183
    00184   /* There are no callbacks 0x3E - 0x13F */
    00185
    00187   CBID_STATION_ANIM_START_STOP         = 0x140, // 15 bit callback
    00188
    00190   CBID_STATION_ANIM_NEXT_FRAME         = 0x141, // 15 bit callback
    00191
    00193   CBID_STATION_ANIMATION_SPEED         = 0x142, // 8 bit callback
    00194
    00196   CBID_HOUSE_DENY_DESTRUCTION          = 0x143, // 15 bit callback
    00197
    00199   CBID_SOUNDS_AMBIENT_EFFECT           = 0x144, // 15 bit callback, not implemented
    00200
    00202   CBID_CARGO_STATION_RATING_CALC       = 0x145, // 15 bit callback
    00203
    00205   CBID_NEW_SIGNALS_SPRITE_DRAW         = 0x146, // 15 bit callback, not implemented
    00206
    00208   CBID_CANALS_SPRITE_OFFSET            = 0x147, // 15 bit callback
    00209
    00211   CBID_HOUSE_WATCHED_CARGO_ACCEPTED    = 0x148, // 15 bit callback, not implemented
    00212
    00214   CBID_STATION_LAND_SLOPE_CHECK        = 0x149, // 15 bit callback, not implemented
    00215
    00217   CBID_INDUSTRY_DECIDE_COLOUR          = 0x14A, // 4 bit callback
    00218
    00220   CBID_INDUSTRY_INPUT_CARGO_TYPES      = 0x14B, // 8 bit callback
    00221
    00223   CBID_INDUSTRY_OUTPUT_CARGO_TYPES     = 0x14C, // 8 bit callback
    00224
    00226   CBID_HOUSE_CUSTOM_NAME               = 0x14D, // 15 bit callback
    00227
    00229   CBID_HOUSE_DRAW_FOUNDATIONS          = 0x14E, // 15 bit callback
    00230
    00232   CBID_HOUSE_AUTOSLOPE                 = 0x14F, // 15 bit callback
    00233
    00235   CBID_AIRPTILE_DRAW_FOUNDATIONS       = 0x150, // 15 bit callback
    00236
    00238   CBID_AIRPTILE_ANIM_START_STOP        = 0x152, // 15 bit callback
    00239
    00241   CBID_AIRPTILE_ANIM_NEXT_FRAME        = 0x153, // 15 bit callback
    00242
    00244   CBID_AIRPTILE_ANIMATION_SPEED        = 0x154, // 8 bit callback
    00245
    00250   CBID_AIRPORT_ADDITIONAL_TEXT         = 0x155, // 15 bit callback
    00251
    00253   CBID_AIRPORT_LAYOUT_NAME             = 0x156, // 15 bit callback
    00254
    00256   CBID_OBJECT_LAND_SLOPE_CHECK         = 0x157, // 15 bit callback
    00257
    00259   CBID_OBJECT_ANIMATION_NEXT_FRAME     = 0x158, // 15 bit callback
    00260
    00262   CBID_OBJECT_ANIMATION_START_STOP     = 0x159, // 15 bit callback
    00263
    00265   CBID_OBJECT_ANIMATION_SPEED          = 0x15A, // 8 bit callback
    00266
    00268   CBID_OBJECT_COLOUR                   = 0x15B, // 15 bit callback
    00269
    00271   CBID_OBJECT_FUND_MORE_TEXT           = 0x15C, // 15 bit callback
    00272
    00274   CBID_OBJECT_AUTOSLOPE                = 0x15D, // 15 bit callback
    00275 };
    00276
    00281 enum VehicleCallbackMask {
    00282   CBM_VEHICLE_VISUAL_EFFECT  = 0,
    00283   CBM_VEHICLE_LENGTH         = 1,
    00284   CBM_VEHICLE_LOAD_AMOUNT    = 2,
    00285   CBM_VEHICLE_REFIT_CAPACITY = 3,
    00286   CBM_VEHICLE_ARTIC_ENGINE   = 4,
    00287   CBM_VEHICLE_CARGO_SUFFIX   = 5,
    00288   CBM_VEHICLE_COLOUR_REMAP   = 6,
    00289   CBM_VEHICLE_SOUND_EFFECT   = 7,
    00290 };
    00291
    00295 enum StationCallbackMask {
    00296   CBM_STATION_AVAIL                = 0,
    00297   CBM_STATION_SPRITE_LAYOUT        = 1,
    00298   CBM_STATION_ANIMATION_NEXT_FRAME = 2,
    00299   CBM_STATION_ANIMATION_SPEED      = 3,
    00300   CBM_STATION_SLOPE_CHECK          = 4,
    00301 };
    00302
    00306 enum HouseCallbackMask {
    00307   CBM_HOUSE_ALLOW_CONSTRUCTION        =  0,
    00308   CBM_HOUSE_ANIMATION_NEXT_FRAME      =  1,
    00309   CBM_HOUSE_ANIMATION_START_STOP      =  2,
    00310   CBM_HOUSE_CONSTRUCTION_STATE_CHANGE =  3,
    00311   CBM_HOUSE_COLOUR                    =  4,
    00312   CBM_HOUSE_CARGO_ACCEPTANCE          =  5,
    00313   CBM_HOUSE_ANIMATION_SPEED           =  6,
    00314   CBM_HOUSE_DESTRUCTION               =  7,
    00315   CBM_HOUSE_ACCEPT_CARGO              =  8,
    00316   CBM_HOUSE_PRODUCE_CARGO             =  9,
    00317   CBM_HOUSE_DENY_DESTRUCTION          = 10,
    00318   CBM_HOUSE_DRAW_FOUNDATIONS          = 11,
    00319   CBM_HOUSE_AUTOSLOPE                 = 12,
    00320 };
    00321
    00325 enum CanalCallbackMask {
    00326   CBM_CANAL_SPRITE_OFFSET       = 0,
    00327 };
    00328
    00332 enum CargoCallbackMask {
    00333   CBM_CARGO_PROFIT_CALC         = 0,
    00334   CBM_CARGO_STATION_RATING_CALC = 1,
    00335 };
    00336
    00340 enum IndustryCallbackMask {
    00341   CBM_IND_AVAILABLE                 =  0,
    00342   CBM_IND_PRODUCTION_CARGO_ARRIVAL  =  1,
    00343   CBM_IND_PRODUCTION_256_TICKS      =  2,
    00344   CBM_IND_LOCATION                  =  3,
    00345   CBM_IND_PRODUCTION_CHANGE         =  4,
    00346   CBM_IND_MONTHLYPROD_CHANGE        =  5,
    00347   CBM_IND_CARGO_SUFFIX              =  6,
    00348   CBM_IND_FUND_MORE_TEXT            =  7,
    00349   CBM_IND_WINDOW_MORE_TEXT          =  8,
    00350   CBM_IND_SPECIAL_EFFECT            =  9,
    00351   CBM_IND_REFUSE_CARGO              = 10,
    00352   CBM_IND_DECIDE_COLOUR             = 11,
    00353   CBM_IND_INPUT_CARGO_TYPES         = 12,
    00354   CBM_IND_OUTPUT_CARGO_TYPES        = 13,
    00355 };
    00356
    00360 enum IndustryTileCallbackMask {
    00361   CBM_INDT_ANIM_NEXT_FRAME          = 0,
    00362   CBM_INDT_ANIM_SPEED               = 1,
    00363   CBM_INDT_CARGO_ACCEPTANCE         = 2,
    00364   CBM_INDT_ACCEPT_CARGO             = 3,
    00365   CBM_INDT_SHAPE_CHECK              = 4,
    00366   CBM_INDT_DRAW_FOUNDATIONS         = 5,
    00367   CBM_INDT_AUTOSLOPE                = 6,
    00368 };
    00369
    00373 enum ObjectCallbackMask {
    00374   CBM_OBJ_SLOPE_CHECK               =  0,
    00375   CBM_OBJ_ANIMATION_NEXT_FRAME      =  1,
    00376   CBM_OBJ_ANIMATION_SPEED           =  2,
    00377   CBM_OBJ_COLOUR                    =  3,
    00378   CBM_OBJ_FUND_MORE_TEXT            =  4,
    00379   CBM_OBJ_AUTOSLOPE                 =  5,
    00380 };
    00381
    00385 enum AirportTileCallbackMask {
    00386   CBM_AIRT_ANIM_NEXT_FRAME          = 0,
    00387   CBM_AIRT_ANIM_SPEED               = 1,
    00388   CBM_AIRT_SHAPE_CHECK              = 4,
    00389   CBM_AIRT_DRAW_FOUNDATIONS         = 5,
    00390   CBM_AIRT_AUTOSLOPE                = 6,
    00391 };
    00392
    00396 static const uint CALLBACK_FAILED              = 0xFFFF;
    00397 static const uint CALLBACK_HOUSEPRODCARGO_END  = 0x20FF;
    00398
    00399 #endif /* NEWGRF_CALLBACKS_H */