OpenTTD Source 20260208-master-g43af8e94d0
VehicleSpriteSeq Struct Reference

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

Detailed Description

Sprite sequence for a vehicle part.

Definition at line 102 of file vehicle_base.h.

Member Function Documentation

◆ Clear()

void VehicleSpriteSeq::Clear ( )
inline

Clear all information.

Definition at line 122 of file vehicle_base.h.

◆ CopyWithoutPalette()

void VehicleSpriteSeq::CopyWithoutPalette ( const VehicleSpriteSeq & src)
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().

◆ Draw()

void VehicleSpriteSeq::Draw ( int x,
int y,
PaletteID default_pal,
bool force_pal ) const

Draw the sprite sequence.

Parameters
xX position
yY position
default_palVehicle palette
force_palWhether 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().

◆ GetBounds()

void VehicleSpriteSeq::GetBounds ( Rect * bounds) const

◆ IsValid()

bool VehicleSpriteSeq::IsValid ( ) const
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().

◆ operator==()

bool VehicleSpriteSeq::operator== ( const VehicleSpriteSeq & other) const
inline

Definition at line 106 of file vehicle_base.h.

◆ Set()

void VehicleSpriteSeq::Set ( SpriteID sprite)
inline

Field Documentation

◆ count

uint VehicleSpriteSeq::count

Definition at line 104 of file vehicle_base.h.

◆ seq

std::array<PalSpriteID, 8> VehicleSpriteSeq::seq

Definition at line 103 of file vehicle_base.h.


The documentation for this struct was generated from the following files: