diff options
author | hackykid <hackykid@openttd.org> | 2005-06-06 00:19:24 +0000 |
---|---|---|
committer | hackykid <hackykid@openttd.org> | 2005-06-06 00:19:24 +0000 |
commit | 26e87892e2177a3aa63b159744d824d1fbee5474 (patch) | |
tree | 953354be89e9773360834c65363da6c96c051d79 /engine.h | |
parent | eebe82c983a2d52535187f9731ff30c3bf6f2e6b (diff) | |
download | openttd-26e87892e2177a3aa63b159744d824d1fbee5474.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.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) |