12 #ifndef NEWGRF_ENGINE_H 13 #define NEWGRF_ENGINE_H 37 :
ScopeResolver(ro), v(v), self_type(engine_type), info_view(info_view)
41 void SetVehicle(
const Vehicle *v) { this->v =
v; }
44 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const;
72 static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29;
73 static const uint ROADVEHINFO_DEFAULT_VEHICLE_WIDTH = 32;
74 static const uint VEHICLEINFO_FULL_VEHICLE_WIDTH = 32;
83 #define GetCustomVehicleSprite(v, direction, image_type, result) GetCustomEngineSprite(v->engine_type, v, direction, image_type, result) 84 #define GetCustomVehicleIcon(et, direction, image_type, result) GetCustomEngineSprite(et, NULL, direction, image_type, result) 87 #define GetCustomRotorSprite(v, i, image_type, result) GetRotorOverrideSprite(v->engine_type, v, i, image_type, result) 88 #define GetCustomRotorIcon(et, image_type, result) GetRotorOverrideSprite(et, NULL, true, image_type, result) 105 enum VehicleTrigger {
106 VEHICLE_TRIGGER_NEW_CARGO = 0x01,
108 VEHICLE_TRIGGER_DEPOT = 0x02,
110 VEHICLE_TRIGGER_EMPTY = 0x04,
112 VEHICLE_TRIGGER_ANY_NEW_CARGO = 0x08,
114 VEHICLE_TRIGGER_CALLBACK_32 = 0x10,
116 void TriggerVehicle(
Vehicle *veh, VehicleTrigger trigger);
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope)...
Different types to 'show' directions.
Resolver for a vehicle scope.
ResolverObject & ro
Surrounding resolver object.
byte cached_relative_count
Relative position of the other vehicle.
uint16 GetVehicleCallbackParent(CallbackID callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v, const Vehicle *parent)
Evaluate a newgrf callback for vehicles with a different vehicle for parent scope.
Interface for SpriteGroup-s to access the gamestate.
Types related to engines.
Aircraft, helicopters, rotors and their shadows belong to this class.
Set when using the callback resolve system, but not to resolve a callback.
PropertyID
List of NewGRF properties used in Action 0 or Callback 0x36 (CBID_VEHICLE_MODIFY_PROPERTY).
EngineImageType
Visualisation contexts of vehicles and engines.
Callbacks that NewGRFs could implement.
Direction
Defines the 8 directions on the map.
Resolve no wagon overrides.
VehicleScopeResolver self_scope
Scope resolver for the indicated vehicle.
VehicleType
Available vehicle types.
Resolver for a vehicle (chain)
void CommitVehicleListOrderChanges()
Deternine default engine sorting and execute recorded ListOrderChanges from AlterVehicleListOrder.
VehicleScopeResolver relative_scope
Scope resolver for an other vehicle in the chain.
EngineID self_type
Type of the vehicle.
bool UsesWagonOverride(const Vehicle *v)
Check if a wagon is currently using a wagon override.
void AlterVehicleListOrder(EngineID engine, uint target)
Record a vehicle ListOrderChange.
Sprite sequence for a vehicle part.
VehicleScopeResolver parent_scope
Scope resolver for its parent vehicle.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
uint16 EngineID
Unique identification number of an engine.
VehicleScopeResolver(ResolverObject &ro, EngineID engine_type, const Vehicle *v, bool info_view)
Scope resolver of a single vehicle.
Resolve self-override (helicopter rotors and such).
Types related to vehicles.
void UnloadWagonOverrides(Engine *e)
Unload all wagon override sprite groups.
uint16 GetVehicleCallback(CallbackID callback, uint32 param1, uint32 param2, EngineID engine, const Vehicle *v)
Evaluate a newgrf callback for vehicles.
EngineID engine_type
The type of engine used for this vehicle.
CallbackID
List of implemented NewGRF callbacks.
byte CargoID
Cargo slots to indicate a cargo type within a game.
const struct Vehicle * v
The vehicle being resolved.
uint32 GetTriggers() const
Get the triggers.
bool info_view
Indicates if the item is being drawn in an info window.
EngineID GetNewEngineID(const GRFFile *file, VehicleType type, uint16 internal_id)
Return the ID of a new engine.
Properties of NewGRF Action 0.
Types related to the graphics and/or input devices.
uint32 GetRandomBits() const
Get a few random bits.
Dynamic data of a loaded NewGRF.
void SetEngineGRF(EngineID engine, const GRFFile *file)
Tie a GRFFile entry to an engine, to allow us to retrieve GRF parameters etc during a game...
Resolve wagon overrides using TrainCache::cached_override.