OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
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.
void | Draw (int x, int y, PaletteID default_pal, bool force_pal) const
| Draw the sprite sequence.

## Data Fields
PalSpriteID | seq [4]
uint | count

## Detailed Description

Sprite sequence for a vehicle part.

Definition at line 130 of file vehicle_base.h.

## Member Function Documentation

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

Draw the sprite sequence.

Parameters

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

References DrawSprite(), and PalSpriteID::pal.

Referenced by DrawAircraftImage(), DrawRoadVehEngine(), DrawRoadVehImage(), DrawShipImage(), DrawTrainDetails(), and DrawTrainImage().

void VehicleSpriteSeq::GetBounds | ( | Rect * | bounds | ) | const

Determine shared bounds of all sprites.

Parameters

  [out] | bounds | Shared bounds.

Definition at line 76 of file vehicle.cpp.

References Sprite::height, ST_NORMAL, Sprite::width, Sprite::x_offs, and Sprite::y_offs.

Referenced by DrawAircraftImage(), DrawRoadVehEngine(), DrawShipImage(), GetAircraftSpriteSize(), GetRoadVehSpriteSize(), GetShipSpriteSize(), GetSingleVehicleWidth(), GetTrainSpriteSize(), and Vehicle::UpdateViewport().

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

- src/vehicle_base.h
- src/vehicle.cpp