From 351d7aaa9fd2fe1e5cd464130186727df38e646f Mon Sep 17 00:00:00 2001 From: hackykid Date: Wed, 1 Jun 2005 11:34:37 +0000 Subject: (svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks. - Feature: [newgrf] Implement the 'refit capacity' callback. --- engine.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engine.h') diff --git a/engine.h b/engine.h index b588478fe..b27b094c3 100644 --- a/engine.h +++ b/engine.h @@ -122,6 +122,17 @@ enum GlobalCargo { NUM_GLOBAL_CID = 31 }; +// This enum only lists implemented callbacks +enum CallbackID { + // Refit capacity, the passed vehicle needs to have its ->cargo_type set to + // the cargo we are refitting to, returns the new cargo capacity + CB_REFIT_CAP = 0x15, +}; + +enum { + CALLBACK_FAILED = 0xFFFF +}; + VARDEF const uint32 _default_refitmasks[NUM_VEHICLE_TYPES]; VARDEF const CargoID _global_cargo_id[NUM_LANDSCAPE][NUM_CARGO]; VARDEF const uint32 _landscape_global_cargo_mask[NUM_LANDSCAPE]; @@ -133,6 +144,7 @@ void SetWagonOverrideSprites(byte engine, struct SpriteGroup *group, byte *train void SetCustomEngineSprites(byte engine, byte cargo, struct SpriteGroup *group); // loaded is in percents, overriding_engine 0xffff is none int GetCustomEngineSprite(byte engine, const Vehicle *v, byte direction); +uint16 GetCallBackResult(uint16 callback_info, byte engine, const Vehicle *v); #define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction) #define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction) -- cgit v1.2.3-54-g00ecf