summaryrefslogtreecommitdiff
path: root/engine.h
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-03 10:39:30 +0000
committerhackykid <hackykid@openttd.org>2005-06-03 10:39:30 +0000
commitad2eef0a30832e41dad0e50c96aa364de3732511 (patch)
treed3f3e4b5c205c4a1d8156cbf146d05b01db0adf6 /engine.h
parent3f3cbea5c49ccf0293d22066ed810b6daf8b9a54 (diff)
downloadopenttd-ad2eef0a30832e41dad0e50c96aa364de3732511.tar.xz
(svn r2401) - Fix: [newgrf] Finish up callback mechanism, implement 'refit capacity' callback slightly more correct.
Diffstat (limited to 'engine.h')
-rw-r--r--engine.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/engine.h b/engine.h
index b27b094c3..698506afb 100644
--- a/engine.h
+++ b/engine.h
@@ -14,6 +14,7 @@ typedef struct RailVehicleInfo {
byte engclass; // 0: steam, 1: diesel, 2: electric
byte capacity;
byte cargo_type;
+ byte callbackmask; // see CallbackMask enum
} RailVehicleInfo;
typedef struct ShipVehicleInfo {
@@ -122,11 +123,18 @@ enum GlobalCargo {
NUM_GLOBAL_CID = 31
};
-// This enum only lists implemented callbacks
+// This enum lists the implemented callbacks
+// Use as argument for the GetCallBackResult function (see comments there)
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,
+ CBID_REFIT_CAP = 0x15,
+};
+
+// bit positions for rvi->callbackmask, indicates which callbacks are used by an engine
+// (some callbacks are always used, and dont appear here)
+enum CallbackMask {
+ CBM_REFIT_CAP = 3,
};
enum {