# newgrf_callbacks.h

Go to the documentation of this file.

    00001 /* $Id: newgrf_callbacks.h 17558 2009-09-16 19:10:50Z rubidium $ */
    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_TRAIN_WAGON_POWER               = 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
    00048   CBID_VEHICLE_REFIT_CAPACITY          = 0x15, // 15 bit callback
    00049
    00051   CBID_VEHICLE_ARTIC_ENGINE            = 0x16, // 8 bit callback
    00052
    00054   CBID_HOUSE_ALLOW_CONSTRUCTION        = 0x17, // 8 bit callback
    00055
    00057   CBID_GENERIC_AI_PURCHASE_SELECTION   = 0x18, // 8 bit callback, not implemented
    00058
    00060   CBID_VEHICLE_CARGO_SUFFIX            = 0x19,
    00061
    00063   CBID_HOUSE_ANIMATION_NEXT_FRAME      = 0x1A, // 15 bit callback
    00064
    00066   CBID_HOUSE_ANIMATION_START_STOP      = 0x1B, // 15 bit callback
    00067
    00069   CBID_HOUSE_CONSTRUCTION_STATE_CHANGE = 0x1C, // 15 bit callback
    00070
    00072   CBID_TRAIN_ALLOW_WAGON_ATTACH        = 0x1D,
    00073
    00075   CBID_HOUSE_COLOUR                    = 0x1E, // 15 bit callback
    00076
    00078   CBID_HOUSE_CARGO_ACCEPTANCE          = 0x1F, // 15 bit callback
    00079
    00081   CBID_HOUSE_ANIMATION_SPEED           = 0x20, // 8 bit callback
    00082
    00084   CBID_HOUSE_DESTRUCTION               = 0x21, // 8 bit callback
    00085
    00087   CBID_INDUSTRY_AVAILABLE              = 0x22, // 15 bit callback
    00088
    00091   CBID_VEHICLE_ADDITIONAL_TEXT         = 0x23,
    00092
    00094   CBID_STATION_TILE_LAYOUT             = 0x24, // 15 bit callback
    00095
    00097   CBID_INDTILE_ANIM_START_STOP         = 0x25, // 15 bit callback
    00098
    00100   CBID_INDTILE_ANIM_NEXT_FRAME         = 0x26, // 15 bit callback
    00101
    00103   CBID_INDTILE_ANIMATION_SPEED         = 0x27, // 8 bit callback
    00104
    00106   CBID_INDUSTRY_LOCATION               = 0x28, // 15 bit callback
    00107
    00109   CBID_INDUSTRY_PRODUCTION_CHANGE      = 0x29, // 15 bit callback
    00110
    00112   CBID_HOUSE_ACCEPT_CARGO              = 0x2A, // 15 bit callback
    00113
    00115   CBID_INDTILE_CARGO_ACCEPTANCE        = 0x2B, // 15 bit callback
    00116
    00118   CBID_INDTILE_ACCEPT_CARGO            = 0x2C, // 15 bit callback
    00119
    00122   CBID_VEHICLE_COLOUR_MAPPING          = 0x2D, // 15 bit callback
    00123
    00125   CBID_HOUSE_PRODUCE_CARGO             = 0x2E, // 15 bit callback
    00126
    00128   CBID_INDTILE_SHAPE_CHECK             = 0x2F, // 15 bit callback
    00129
    00131   CBID_INDUSTRY_DRAW_FOUNDATIONS       = 0x30, // 15 bit callback
    00132
    00135   CBID_VEHICLE_START_STOP_CHECK        = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
    00136
    00138   CBID_VEHICLE_32DAY_CALLBACK          = 0x32, // 2 bit callback
    00139
    00141   CBID_VEHICLE_SOUND_EFFECT            = 0x33, // 15 bit callback
    00142
    00144   CBID_VEHICLE_AUTOREPLACE_SELECTION   = 0x34, // 15 bit callback, not implemented
    00145
    00147   CBID_INDUSTRY_MONTHLYPROD_CHANGE     = 0x35, // 15 bit callback
    00148
    00151   CBID_VEHICLE_MODIFY_PROPERTY         = 0x36, // 8/15 bit depends on queried property
    00152
    00154   CBID_INDUSTRY_CARGO_SUFFIX           = 0x37, // 15 bit callback, but 0xFF test is done with 8 bit
    00155
    00157   CBID_INDUSTRY_FUND_MORE_TEXT         = 0x38, // 15 bit callback
    00158
    00160   CBID_CARGO_PROFIT_CALC               = 0x39, // 15 bit callback
    00161
    00163   CBID_INDUSTRY_WINDOW_MORE_TEXT       = 0x3A, // 15 bit callback
    00164
    00166   CBID_INDUSTRY_SPECIAL_EFFECT         = 0x3B, // 15 bit callback
    00167
    00169   CBID_INDUSTRY_AUTOSLOPE              = 0x3C, // 15 bit callback
    00170
    00172   CBID_INDUSTRY_REFUSE_CARGO           = 0x3D, // 15 bit callback
    00173
    00174   /* There are no callbacks 0x3E - 0x13F */
    00175
    00177   CBID_STATION_ANIM_START_STOP         = 0x140, // 15 bit callback
    00178
    00180   CBID_STATION_ANIM_NEXT_FRAME         = 0x141, // 15 bit callback
    00181
    00183   CBID_STATION_ANIMATION_SPEED         = 0x142, // 8 bit callback
    00184
    00186   CBID_HOUSE_DENY_DESTRUCTION          = 0x143, // 15 bit callback
    00187
    00189   CBID_SOUNDS_AMBIENT_EFFECT           = 0x144, // 15 bit callback, not implemented
    00190
    00192   CBID_CARGO_STATION_RATING_CALC       = 0x145, // 15 bit callback
    00193
    00195   CBID_NEW_SIGNALS_SPRITE_DRAW         = 0x146, // 15 bit callback, not implemented
    00196
    00198   CBID_CANALS_SPRITE_OFFSET            = 0x147, // 15 bit callback, not implemented
    00199
    00201   CBID_HOUSE_WATCHED_CARGO_ACCEPTED    = 0x148, // 15 bit callback, not implemented
    00202
    00204   CBID_STATION_LAND_SLOPE_CHECK        = 0x149, // 15 bit callback, not implemented
    00205
    00207   CBID_INDUSTRY_DECIDE_COLOUR          = 0x14A, // 4 bit callback
    00208
    00210   CBID_INDUSTRY_INPUT_CARGO_TYPES      = 0x14B, // 8 bit callback
    00211
    00213   CBID_INDUSTRY_OUTPUT_CARGO_TYPES     = 0x14C, // 8 bit callback
    00214
    00216   CBID_HOUSE_CUSTOM_NAME               = 0x14D, // 15 bit callback
    00217
    00219   CBID_HOUSE_DRAW_FOUNDATIONS          = 0x14E, // 15 bit callback
    00220
    00222   CBID_HOUSE_AUTOSLOPE                 = 0x14F, // 15 bit callback
    00223 };
    00224
    00229 enum VehicleCallbackMask {
    00230   CBM_TRAIN_WAGON_POWER      = 0,
    00231   CBM_VEHICLE_LENGTH         = 1,
    00232   CBM_VEHICLE_LOAD_AMOUNT    = 2,
    00233   CBM_VEHICLE_REFIT_CAPACITY = 3,
    00234   CBM_VEHICLE_ARTIC_ENGINE   = 4,
    00235   CBM_VEHICLE_CARGO_SUFFIX   = 5,
    00236   CBM_VEHICLE_COLOUR_REMAP   = 6,
    00237   CBM_VEHICLE_SOUND_EFFECT   = 7,
    00238 };
    00239
    00243 enum StationCallbackMask {
    00244   CBM_STATION_AVAIL                = 0,
    00245   CBM_STATION_SPRITE_LAYOUT        = 1,
    00246   CBM_STATION_ANIMATION_NEXT_FRAME = 2,
    00247   CBM_STATION_ANIMATION_SPEED      = 3,
    00248   CBM_STATION_SLOPE_CHECK          = 4,
    00249 };
    00250
    00254 enum HouseCallbackMask {
    00255   CBM_HOUSE_ALLOW_CONSTRUCTION        =  0,
    00256   CBM_HOUSE_ANIMATION_NEXT_FRAME      =  1,
    00257   CBM_HOUSE_ANIMATION_START_STOP      =  2,
    00258   CBM_HOUSE_CONSTRUCTION_STATE_CHANGE =  3,
    00259   CBM_HOUSE_COLOUR                    =  4,
    00260   CBM_HOUSE_CARGO_ACCEPTANCE          =  5,
    00261   CBM_HOUSE_ANIMATION_SPEED           =  6,
    00262   CBM_HOUSE_DESTRUCTION               =  7,
    00263   CBM_HOUSE_ACCEPT_CARGO              =  8,
    00264   CBM_HOUSE_PRODUCE_CARGO             =  9,
    00265   CBM_HOUSE_DENY_DESTRUCTION          = 10,
    00266   CBM_HOUSE_DRAW_FOUNDATIONS          = 11,
    00267   CBM_HOUSE_AUTOSLOPE                 = 12,
    00268 };
    00269
    00273 enum CanalCallbackMask {
    00274   CBM_CANAL_SPRITE_OFFSET       = 0,
    00275 };
    00276
    00280 enum CargoCallbackMask {
    00281   CBM_CARGO_PROFIT_CALC         = 0,
    00282   CBM_CARGO_STATION_RATING_CALC = 1,
    00283 };
    00284
    00288 enum IndustryCallbackMask {
    00289   CBM_IND_AVAILABLE                 =  0,
    00290   CBM_IND_PRODUCTION_CARGO_ARRIVAL  =  1,
    00291   CBM_IND_PRODUCTION_256_TICKS      =  2,
    00292   CBM_IND_LOCATION                  =  3,
    00293   CBM_IND_PRODUCTION_CHANGE         =  4,
    00294   CBM_IND_MONTHLYPROD_CHANGE        =  5,
    00295   CBM_IND_CARGO_SUFFIX              =  6,
    00296   CBM_IND_FUND_MORE_TEXT            =  7,
    00297   CBM_IND_WINDOW_MORE_TEXT          =  8,
    00298   CBM_IND_SPECIAL_EFFECT            =  9,
    00299   CBM_IND_REFUSE_CARGO              = 10,
    00300   CBM_IND_DECIDE_COLOUR             = 11,
    00301   CBM_IND_INPUT_CARGO_TYPES         = 12,
    00302   CBM_IND_OUTPUT_CARGO_TYPES        = 13,
    00303 };
    00304
    00308 enum IndustryTileCallbackMask {
    00309   CBM_INDT_ANIM_NEXT_FRAME          = 0,
    00310   CBM_INDT_ANIM_SPEED               = 1,
    00311   CBM_INDT_CARGO_ACCEPTANCE         = 2,
    00312   CBM_INDT_ACCEPT_CARGO             = 3,
    00313   CBM_INDT_SHAPE_CHECK              = 4,
    00314   CBM_INDT_DRAW_FOUNDATIONS         = 5,
    00315   CBM_INDT_AUTOSLOPE                = 6,
    00316 };
    00317
    00321 enum {
    00322   CALLBACK_FAILED              = 0xFFFF,
    00323   CALLBACK_HOUSEPRODCARGO_END  = 0x20FF,
    00324 };
    00325
    00326 #endif /* NEWGRF_CALLBACKS_H */