OpenTTD Source: MutableSpriteCache Struct Reference

OpenTTD Source 15.0-RC2

Data Fields
MutableSpriteCache Struct Reference

Cache for vehicle sprites and values relating to whether they should be updated before drawing, or calculating the viewport. More...

`#include <vehicle_base.h>`

## Data Fields
Direction | last_direction = INVALID_DIR
| Last direction we obtained sprites for.
bool | revalidate_before_draw = false
| We need to do a GetImage() and check bounds before drawing this sprite.
bool | is_viewport_candidate = false
| This vehicle can potentially be drawn on a viewport.
Rect | old_coord {}
| Co-ordinates from the last valid bounding box.
VehicleSpriteSeq | sprite_seq {}
| Vehicle appearance.

## Detailed Description

Cache for vehicle sprites and values relating to whether they should be updated before drawing, or calculating the viewport.

Definition at line 157 of file vehicle_base.h.

## Field Documentation

## ◆ is_viewport_candidate

bool MutableSpriteCache::is_viewport_candidate = false

This vehicle can potentially be drawn on a viewport.

Definition at line 160 of file vehicle_base.h.

## ◆ last_direction

Direction MutableSpriteCache::last_direction = INVALID_DIR

Last direction we obtained sprites for.

Definition at line 158 of file vehicle_base.h.

Referenced by SpecializedVehicle< T, Type >::UpdateViewport().

## ◆ old_coord

Rect MutableSpriteCache::old_coord {}

Co-ordinates from the last valid bounding box.

Definition at line 161 of file vehicle_base.h.

Referenced by Vehicle::Vehicle().

## ◆ revalidate_before_draw

bool MutableSpriteCache::revalidate_before_draw = false

We need to do a GetImage() and check bounds before drawing this sprite.

Definition at line 159 of file vehicle_base.h.

Referenced by SpecializedVehicle< T, Type >::UpdateViewport(), and ViewportAddVehicles().

## ◆ sprite_seq

VehicleSpriteSeq MutableSpriteCache::sprite_seq {}

Vehicle appearance.

Definition at line 162 of file vehicle_base.h.

Referenced by AddArticulatedParts(), AfterLoadVehiclesPhase2(), CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRailWagon(), DisasterTick_Helicopter_Rotors(), DoDrawVehicle(), IncrementSprite(), Aircraft::MarkDirty(), SetAircraftPosition(), SpecializedVehicle< T, Type >::SpecializedVehicle(), SpecializedVehicle< T, Type >::UpdateViewport(), and ViewportAddVehicles().

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

- src/vehicle_base.h