120 GC_PURCHASE = 30, |
120 GC_PURCHASE = 30, |
121 GC_INVALID = 255, |
121 GC_INVALID = 255, |
122 NUM_GLOBAL_CID = 31 |
122 NUM_GLOBAL_CID = 31 |
123 }; |
123 }; |
124 |
124 |
|
125 // This enum only lists implemented callbacks |
|
126 enum CallbackID { |
|
127 // Refit capacity, the passed vehicle needs to have its ->cargo_type set to |
|
128 // the cargo we are refitting to, returns the new cargo capacity |
|
129 CB_REFIT_CAP = 0x15, |
|
130 }; |
|
131 |
|
132 enum { |
|
133 CALLBACK_FAILED = 0xFFFF |
|
134 }; |
|
135 |
125 VARDEF const uint32 _default_refitmasks[NUM_VEHICLE_TYPES]; |
136 VARDEF const uint32 _default_refitmasks[NUM_VEHICLE_TYPES]; |
126 VARDEF const CargoID _global_cargo_id[NUM_LANDSCAPE][NUM_CARGO]; |
137 VARDEF const CargoID _global_cargo_id[NUM_LANDSCAPE][NUM_CARGO]; |
127 VARDEF const uint32 _landscape_global_cargo_mask[NUM_LANDSCAPE]; |
138 VARDEF const uint32 _landscape_global_cargo_mask[NUM_LANDSCAPE]; |
128 VARDEF const CargoID _local_cargo_id_ctype[NUM_GLOBAL_CID]; |
139 VARDEF const CargoID _local_cargo_id_ctype[NUM_GLOBAL_CID]; |
129 |
140 |
131 VARDEF byte _engine_original_sprites[256]; |
142 VARDEF byte _engine_original_sprites[256]; |
132 void SetWagonOverrideSprites(byte engine, struct SpriteGroup *group, byte *train_id, int trains); |
143 void SetWagonOverrideSprites(byte engine, struct SpriteGroup *group, byte *train_id, int trains); |
133 void SetCustomEngineSprites(byte engine, byte cargo, struct SpriteGroup *group); |
144 void SetCustomEngineSprites(byte engine, byte cargo, struct SpriteGroup *group); |
134 // loaded is in percents, overriding_engine 0xffff is none |
145 // loaded is in percents, overriding_engine 0xffff is none |
135 int GetCustomEngineSprite(byte engine, const Vehicle *v, byte direction); |
146 int GetCustomEngineSprite(byte engine, const Vehicle *v, byte direction); |
|
147 uint16 GetCallBackResult(uint16 callback_info, byte engine, const Vehicle *v); |
136 #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction) |
148 #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction) |
137 #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction) |
149 #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction) |
138 |
150 |
139 typedef enum VehicleTrigger { |
151 typedef enum VehicleTrigger { |
140 VEHICLE_TRIGGER_NEW_CARGO = 1, |
152 VEHICLE_TRIGGER_NEW_CARGO = 1, |