OpenTTD Source  20241108-master-g80f628063a
VehicleSpriteSeq Struct Reference

Sprite sequence for a vehicle part. More...

#include <vehicle_base.h>

Public Member Functions

bool operator== (const VehicleSpriteSeq &other) const
 
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. More...
 
void Draw (int x, int y, PaletteID default_pal, bool force_pal) const
 Draw the sprite sequence. More...
 

Data Fields

PalSpriteID seq [8]
 
uint count
 

Detailed Description

Sprite sequence for a vehicle part.

Definition at line 135 of file vehicle_base.h.

Member Function Documentation

◆ 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 131 of file vehicle.cpp.

◆ GetBounds()

void VehicleSpriteSeq::GetBounds ( Rect bounds) const

Determine shared bounds of all sprites.

Parameters
[out]boundsShared bounds.

Definition at line 103 of file vehicle.cpp.

Referenced by DrawAircraftImage(), DrawShipImage(), GetSingleVehicleWidth(), and Vehicle::UpdateBoundingBoxCoordinates().


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