# newgrf_callbacks.h

Go to the documentation of this file.

    00001 /* $Id: newgrf_callbacks.h 12352 2008-03-10 15:31:07Z frosch $ */
    00002
    00006 #ifndef NEWGRF_CALLBACKS_H
    00007 #define NEWGRF_CALLBACKS_H
    00008
    00009
    00020 enum CallbackID {
    00022   CBID_NO_CALLBACK                     = 0x00,
    00023
    00025   CBID_RANDOM_TRIGGER                  = 0x01,
    00026
    00027   /* There are no callbacks 0x02 - 0x0F. */
    00028
    00031   CBID_TRAIN_WAGON_POWER               = 0x10,
    00032
    00034   CBID_VEHICLE_LENGTH                  = 0x11,
    00035
    00037   CBID_VEHICLE_LOAD_AMOUNT             = 0x12,
    00038
    00040   CBID_STATION_AVAILABILITY            = 0x13,
    00041
    00043   CBID_STATION_SPRITE_LAYOUT           = 0x14,
    00044
    00047   CBID_VEHICLE_REFIT_CAPACITY          = 0x15,
    00048
    00050   CBID_VEHICLE_ARTIC_ENGINE            = 0x16,
    00051
    00053   CBID_HOUSE_ALLOW_CONSTRUCTION        = 0x17,
    00054
    00056   CBID_GENERIC_AI_PURCHASE_SELECTION   = 0x18, // not implemented
    00057
    00059   CBID_VEHICLE_CARGO_SUFFIX            = 0x19,
    00060
    00062   CBID_HOUSE_ANIMATION_NEXT_FRAME      = 0x1A,
    00063
    00065   CBID_HOUSE_ANIMATION_START_STOP      = 0x1B,
    00066
    00068   CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C,
    00069
    00071   CBID_TRAIN_ALLOW_WAGON_ATTACH        = 0x1D,
    00072
    00074   CBID_HOUSE_COLOUR                    = 0x1E,
    00075
    00077   CBID_HOUSE_CARGO_ACCEPTANCE          = 0x1F,
    00078
    00080   CBID_HOUSE_ANIMATION_SPEED           = 0x20,
    00081
    00083   CBID_HOUSE_DESTRUCTION               = 0x21,
    00084
    00086   CBID_INDUSTRY_AVAILABLE              = 0x22,
    00087
    00090   CBID_VEHICLE_ADDITIONAL_TEXT         = 0x23,
    00091
    00093   CBID_STATION_TILE_LAYOUT             = 0x24,
    00094
    00096   CBID_INDTILE_ANIM_START_STOP         = 0x25,
    00097
    00099   CBID_INDTILE_ANIM_NEXT_FRAME         = 0x26,
    00100
    00102   CBID_INDTILE_ANIMATION_SPEED         = 0x27,
    00103
    00105   CBID_INDUSTRY_LOCATION               = 0x28,
    00106
    00108   CBID_INDUSTRY_PRODUCTION_CHANGE      = 0x29,
    00109
    00111   CBID_HOUSE_ACCEPT_CARGO              = 0x2A,
    00112
    00114   CBID_INDTILE_CARGO_ACCEPTANCE        = 0x2B,
    00115
    00117   CBID_INDTILE_ACCEPT_CARGO            = 0x2C,
    00118
    00121   CBID_VEHICLE_COLOUR_MAPPING          = 0x2D,
    00122
    00124   CBID_HOUSE_PRODUCE_CARGO             = 0x2E,
    00125
    00127   CBID_INDTILE_SHAPE_CHECK             = 0x2F,
    00128
    00130   CBID_INDUSTRY_DRAW_FOUNDATIONS       = 0x30,
    00131
    00134   CBID_VEHICLE_START_STOP_CHECK        = 0x31,
    00135
    00137   CBID_VEHICLE_32DAY_CALLBACK          = 0x32,
    00138
    00140   CBID_VEHICLE_SOUND_EFFECT            = 0x33,
    00141
    00143   CBID_VEHICLE_AUTOREPLACE_SELECTION   = 0x34,
    00144
    00146   CBID_INDUSTRY_MONTHLYPROD_CHANGE     = 0x35,
    00147
    00150   CBID_VEHICLE_MODIFY_PROPERTY         = 0x36,
    00151
    00153   CBID_INDUSTRY_CARGO_SUFFIX           = 0x37, // not implemented
    00154
    00156   CBID_INDUSTRY_FUND_MORE_TEXT         = 0x38,
    00157
    00159   CBID_CARGO_PROFIT_CALC               = 0x39,
    00160
    00162   CBID_INDUSTRY_WINDOW_MORE_TEXT       = 0x3A,
    00163
    00165   CBID_INDUSTRY_SPECIAL_EFFECT         = 0x3B,
    00166
    00168   CBID_INDUSTRY_AUTOSLOPE              = 0x3C,
    00169
    00171   CBID_INDUSTRY_REFUSE_CARGO           = 0x3D,
    00172
    00173   /* There are no callbacks 0x3E - 0x13F */
    00174
    00176   CBID_STATION_ANIM_START_STOP         = 0x140, // not implemented
    00177
    00179   CBID_STATION_ANIM_NEXT_FRAME         = 0x141, // not implemented
    00180
    00182   CBID_STATION_ANIMATION_SPEED         = 0x142, // not implemented
    00183
    00185   CBID_HOUSE_DENY_DESTRUCTION          = 0x143,
    00186
    00188   CBID_SOUNDS_AMBIENT_EFFECT           = 0x144, // not implemented
    00189
    00191   CBID_CARGO_STATION_RATING_CALC       = 0x145,
    00192
    00194   CBID_NEW_SIGNALS_SPRITE_DRAW         = 0x146, // not implemented
    00195
    00197   CBID_CANALS_SPRITE_OFFSET            = 0x147, // not implemented
    00198
    00200   CBID_HOUSE_WATCHED_CARGO_ACCEPTED    = 0x148, // not implemented
    00201
    00203   CBID_STATION_LAND_SLOPE_CHECK        = 0x149, // not implemented
    00204
    00206   CBID_INDUSTRY_DECIDE_COLOUR          = 0x14A,
    00207
    00209   CBID_INDUSTRY_INPUT_CARGO_TYPES      = 0x14B,
    00210
    00212   CBID_INDUSTRY_OUTPUT_CARGO_TYPES     = 0x14C,
    00213
    00214   /* ATTENTION:
    00215    * When adding new callbacks and their result is 15bit, add them to newgrf_spritegroup.cpp:Is8BitCallback().
    00216    * It does not harm to add them there though they are not implemented. But it does harm if they get forgotton.
    00217    */
    00218 };
    00219
    00224 enum VehicleCallbackMask {
    00225   CBM_TRAIN_WAGON_POWER      = 0,
    00226   CBM_VEHICLE_LENGTH         = 1,
    00227   CBM_VEHICLE_LOAD_AMOUNT    = 2,
    00228   CBM_VEHICLE_REFIT_CAPACITY = 3,
    00229   CBM_VEHICLE_ARTIC_ENGINE   = 4,
    00230   CBM_VEHICLE_CARGO_SUFFIX   = 5,
    00231   CBM_VEHICLE_COLOUR_REMAP   = 6,
    00232   CBM_VEHICLE_SOUND_EFFECT   = 7,
    00233 };
    00234
    00238 enum StationCallbackMask {
    00239   CBM_STATION_AVAIL                = 0,
    00240   CBM_STATION_SPRITE_LAYOUT        = 1,
    00241   CBM_STATION_ANIMATION_NEXT_FRAME = 2,
    00242   CBM_STATION_ANIMATION_SPEED      = 3,
    00243   CBM_STATION_SLOPE_CHECK          = 4,
    00244 };
    00245
    00249 enum HouseCallbackMask {
    00250   CBM_HOUSE_ALLOW_CONSTRUCTION        =  0,
    00251   CBM_HOUSE_ANIMATION_NEXT_FRAME      =  1,
    00252   CBM_HOUSE_ANIMATION_START_STOP      =  2,
    00253   CBM_HOUSE_CONSTRUCTION_STATE_CHANGE =  3,
    00254   CBM_HOUSE_COLOUR                    =  4,
    00255   CBM_HOUSE_CARGO_ACCEPTANCE          =  5,
    00256   CBM_HOUSE_ANIMATION_SPEED           =  6,
    00257   CBM_HOUSE_DESTRUCTION               =  7,
    00258   CBM_HOUSE_ACCEPT_CARGO              =  8,
    00259   CBM_HOUSE_PRODUCE_CARGO             =  9,
    00260   CBM_HOUSE_DENY_DESTRUCTION          = 10,
    00261 };
    00262
    00266 enum CargoCallbackMask {
    00267   CBM_CARGO_PROFIT_CALC         = 0,
    00268   CBM_CARGO_STATION_RATING_CALC = 1,
    00269 };
    00270
    00274 enum IndustryCallbackMask {
    00275   CBM_IND_AVAILABLE                 =  0,
    00276   CBM_IND_PRODUCTION_CARGO_ARRIVAL  =  1,
    00277   CBM_IND_PRODUCTION_256_TICKS      =  2,
    00278   CBM_IND_LOCATION                  =  3,
    00279   CBM_IND_PRODUCTION_CHANGE         =  4,
    00280   CBM_IND_MONTHLYPROD_CHANGE        =  5,
    00281   CBM_IND_CARGO_SUFFIX              =  6,
    00282   CBM_IND_FUND_MORE_TEXT            =  7,
    00283   CBM_IND_WINDOW_MORE_TEXT          =  8,
    00284   CBM_IND_SPECIAL_EFFECT            =  9,
    00285   CBM_IND_REFUSE_CARGO              = 10,
    00286   CBM_IND_DECIDE_COLOUR             = 11,
    00287   CBM_IND_INPUT_CARGO_TYPES         = 12,
    00288   CBM_IND_OUTPUT_CARGO_TYPES        = 13,
    00289 };
    00290
    00294 enum IndustryTileCallbackMask {
    00295   CBM_INDT_ANIM_NEXT_FRAME          = 0,
    00296   CBM_INDT_ANIM_SPEED               = 1,
    00297   CBM_INDT_CARGO_ACCEPTANCE         = 2,
    00298   CBM_INDT_ACCEPT_CARGO             = 3,
    00299   CBM_INDT_SHAPE_CHECK              = 4,
    00300   CBM_INDT_DRAW_FOUNDATIONS         = 5,
    00301   CBM_INDT_AUTOSLOPE                = 6,
    00302 };
    00303
    00307 enum {
    00308   CALLBACK_FAILED              = 0xFFFF,
    00309   CALLBACK_HOUSEPRODCARGO_END  = 0x20FF,
    00310 };
    00311
    00312 #endif /* NEWGRF_CALLBACKS_H */