|
OpenTTD Source 20251104-master-g3befbdd52f
|
Sprite sequence for a vehicle part. More...
#include <vehicle_base.h>
Public Member Functions | |
| bool | operator== (const VehicleSpriteSeq &other) const |
| bool | IsValid () const |
| Check whether the sequence contains any sprites. | |
| void | Clear () |
| Clear all information. | |
| void | Set (SpriteID sprite) |
| Assign a single sprite to the sequence. | |
| void | CopyWithoutPalette (const VehicleSpriteSeq &src) |
| Copy data from another sprite sequence, while dropping all recolouring information. | |
| void | GetBounds (Rect *bounds) const |
| Determine shared bounds of all sprites. | |
| void | Draw (int x, int y, PaletteID default_pal, bool force_pal) const |
| Draw the sprite sequence. | |
Data Fields | |
| std::array< PalSpriteID, 8 > | seq |
| uint | count |
Sprite sequence for a vehicle part.
Definition at line 102 of file vehicle_base.h.
|
inline |
Clear all information.
Definition at line 122 of file vehicle_base.h.
|
inline |
Copy data from another sprite sequence, while dropping all recolouring information.
Definition at line 140 of file vehicle_base.h.
Referenced by AfterLoadVehiclesPhase2(), and SetAircraftPosition().
| void VehicleSpriteSeq::Draw | ( | int | x, |
| int | y, | ||
| PaletteID | default_pal, | ||
| bool | force_pal | ||
| ) | const |
Draw the sprite sequence.
| x | X position |
| y | Y position |
| default_pal | Vehicle palette |
| force_pal | Whether to ignore individual palettes, and draw everything with default_pal. |
Definition at line 142 of file vehicle.cpp.
References DrawSprite().
Referenced by DrawAircraftImage(), DrawRoadVehEngine(), DrawRoadVehImage(), DrawShipImage(), DrawTrainDetails(), and DrawTrainImage().
| void VehicleSpriteSeq::GetBounds | ( | Rect * | bounds | ) | const |
Determine shared bounds of all sprites.
| [out] | bounds | Shared bounds. |
Definition at line 114 of file vehicle.cpp.
References Sprite::height, Normal, Sprite::width, Sprite::x_offs, and Sprite::y_offs.
Referenced by DrawAircraftImage(), DrawRoadVehEngine(), DrawShipImage(), GetAircraftSpriteSize(), GetRoadVehSpriteSize(), GetShipSpriteSize(), GetSingleVehicleWidth(), and GetTrainSpriteSize().
|
inline |
Check whether the sequence contains any sprites.
Definition at line 114 of file vehicle_base.h.
Referenced by DrawAircraftImage(), Aircraft::GetImage(), RoadVehicle::GetImage(), Ship::GetImage(), Train::GetImage(), SetMouseCursorVehicle(), and ViewportAddVehicles().
|
inline |
Definition at line 106 of file vehicle_base.h.
|
inline |
Assign a single sprite to the sequence.
Definition at line 130 of file vehicle_base.h.
Referenced by AddArticulatedParts(), CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRailWagon(), DrawAircraftImage(), Aircraft::GetImage(), RoadVehicle::GetImage(), Ship::GetImage(), Train::GetImage(), and SetMouseCursorVehicle().
| uint VehicleSpriteSeq::count |
Definition at line 104 of file vehicle_base.h.
| std::array<PalSpriteID, 8> VehicleSpriteSeq::seq |
Definition at line 103 of file vehicle_base.h.