summaryrefslogtreecommitdiff
path: root/engine.h
diff options
context:
space:
mode:
authorhackykid <hackykid@openttd.org>2005-06-06 00:19:24 +0000
committerhackykid <hackykid@openttd.org>2005-06-06 00:19:24 +0000
commit1018d3b78670be09d0d6ffbb2633b715c0203146 (patch)
tree953354be89e9773360834c65363da6c96c051d79 /engine.h
parent09aadafda1dfb08780fade5a52289a0742f84674 (diff)
downloadopenttd-1018d3b78670be09d0d6ffbb2633b715c0203146.tar.xz
(svn r2414) - Feature: [newgrf] Implement powered wagons, and the callback that goes with it.
Diffstat (limited to 'engine.h')
-rw-r--r--engine.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/engine.h b/engine.h
index 698506afb..19ea10492 100644
--- a/engine.h
+++ b/engine.h
@@ -15,6 +15,12 @@ typedef struct RailVehicleInfo {
byte capacity;
byte cargo_type;
byte callbackmask; // see CallbackMask enum
+ uint16 pow_wag_power;
+ byte pow_wag_weight;
+ byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value
+ // for when the 'powered wagon' callback fails. But it should really also determine what
+ // kind of visual effect to generate for a vehicle (default, steam, diesel, electric).
+ // Same goes for the callback result, which atm is only used to check if a wagon is powered.
} RailVehicleInfo;
typedef struct ShipVehicleInfo {
@@ -126,6 +132,10 @@ enum GlobalCargo {
// This enum lists the implemented callbacks
// Use as argument for the GetCallBackResult function (see comments there)
enum CallbackID {
+ // Powered wagons, if the result is lower as 0x40 then the wagon is powered
+ // TODO: interpret the rest of the result, aka "visual effects"
+ CBID_WAGON_POWER = 0x10,
+
// Refit capacity, the passed vehicle needs to have its ->cargo_type set to
// the cargo we are refitting to, returns the new cargo capacity
CBID_REFIT_CAP = 0x15,
@@ -153,6 +163,7 @@ 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);
+bool UsesWagonOverride(const Vehicle *v);
#define GetCustomVehicleSprite(v, direction) GetCustomEngineSprite(v->engine_type, v, direction)
#define GetCustomVehicleIcon(et, direction) GetCustomEngineSprite(et, NULL, direction)