newgrf_callbacks.h
changeset 2982 eb7f50dcb249
parent 2971 cae3a81e8674
child 3007 5c0d90264d47
equal deleted inserted replaced
2981:ca5959cf9fc7 2982:eb7f50dcb249
       
     1 /* $Id$ */
       
     2 
       
     3 #ifndef NEWGRF_CALLBACKS_H
       
     4 #define NEWGRF_CALLBACKS_H
       
     5 
       
     6 /** @file newgrf_callbacks.h
       
     7  */
       
     8 
       
     9 // This enum lists the implemented callbacks
       
    10 // Use as argument for the GetCallBackResult function (see comments there)
       
    11 enum CallbackID {
       
    12 	// Powered wagons, if the result is lower as 0x40 then the wagon is powered
       
    13 	// TODO: interpret the rest of the result, aka "visual effects"
       
    14 	CBID_WAGON_POWER = 0x10,
       
    15 
       
    16 	// Vehicle length, returns the amount of 1/8's the vehicle is shorter
       
    17 	// only for train vehicles
       
    18 	CBID_VEH_LENGTH = 0x11,
       
    19 
       
    20 	// Refit capacity, the passed vehicle needs to have its ->cargo_type set to
       
    21 	// the cargo we are refitting to, returns the new cargo capacity
       
    22 	CBID_REFIT_CAP = 0x15,
       
    23 
       
    24 	CBID_ARTIC_ENGINE = 0x16,
       
    25 };
       
    26 
       
    27 // bit positions for rvi->callbackmask, indicates which callbacks are used by an engine
       
    28 // (some callbacks are always used, and dont appear here)
       
    29 enum CallbackMask {
       
    30 	CBM_WAGON_POWER = 0,
       
    31 	CBM_VEH_LENGTH = 1,
       
    32 	CBM_REFIT_CAP = 3,
       
    33 	CBM_ARTIC_ENGINE = 4,
       
    34 };
       
    35 
       
    36 enum {
       
    37 	CALLBACK_FAILED = 0xFFFF
       
    38 };
       
    39 
       
    40 #endif /* NEWGRF_CALLBACKS_H */