summaryrefslogtreecommitdiff
path: root/engine.h
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-01 11:34:37 +0000
committerhackykid <hackykid@openttd.org>2005-06-01 11:34:37 +0000
commit351d7aaa9fd2fe1e5cd464130186727df38e646f (patch)
tree09bec4a6bd097d4449f7cfdff13cc475960d9703 /engine.h
parentd1c1a7cba725de322c2b7948db75fd83cdf77fe5 (diff)
downloadopenttd-351d7aaa9fd2fe1e5cd464130186727df38e646f.tar.xz
(svn r2389) - Feature: [newgrf] Implement the mechanism for handling newgrf callbacks.
- Feature: [newgrf] Implement the 'refit capacity' callback.
Diffstat (limited to 'engine.h')
-rw-r--r--engine.h12
1 files changed, 12 insertions, 0 deletions
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)