10 #ifndef NEWGRF_ENGINE_H 11 #define NEWGRF_ENGINE_H 35 :
ScopeResolver(ro), v(v), self_type(engine_type), info_view(info_view)
39 void SetVehicle(
const Vehicle *v) { this->v =
v; }
42 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const override;
70 static const uint TRAININFO_DEFAULT_VEHICLE_WIDTH = 29;
71 static const uint ROADVEHINFO_DEFAULT_VEHICLE_WIDTH = 32;
72 static const uint VEHICLEINFO_FULL_VEHICLE_WIDTH = 32;
81 #define GetCustomVehicleSprite(v, direction, image_type, result) GetCustomEngineSprite(v->engine_type, v, direction, image_type, result) 82 #define GetCustomVehicleIcon(et, direction, image_type, result) GetCustomEngineSprite(et, nullptr, direction, image_type, result) 85 #define GetCustomRotorSprite(v, i, image_type, result) GetRotorOverrideSprite(v->engine_type, v, i, image_type, result) 86 #define GetCustomRotorIcon(et, image_type, result) GetRotorOverrideSprite(et, nullptr, true, image_type, result) 103 enum VehicleTrigger {
104 VEHICLE_TRIGGER_NEW_CARGO = 0x01,
106 VEHICLE_TRIGGER_DEPOT = 0x02,
108 VEHICLE_TRIGGER_EMPTY = 0x04,
110 VEHICLE_TRIGGER_ANY_NEW_CARGO = 0x08,
112 VEHICLE_TRIGGER_CALLBACK_32 = 0x10,
114 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.
uint32 GetTriggers() const override
Get the triggers.
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.
VehicleType
Available vehicle types.
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.
uint32 GetRandomBits() const override
Get a few random bits.
Callbacks that NewGRFs could implement.
Resolve no wagon overrides.
VehicleScopeResolver self_scope
Scope resolver for the indicated vehicle.
Resolver for a vehicle (chain)
void CommitVehicleListOrderChanges()
Deternine default engine sorting and execute recorded ListOrderChanges from AlterVehicleListOrder.
Direction
Defines the 8 directions on the map.
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.
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.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
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.
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.
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.