OpenTTD Source: SpriteCache Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
SpriteCache Struct Reference

## Public Member Functions
void | ClearSpriteData ()

## Data Fields
std::unique_ptr< std::byte[]> | ptr
size_t | file_pos = 0
SpriteFile * | file = nullptr
| The file the sprite in this entry can be found in.
uint32_t | length
| Length of sprite data.
uint32_t | id = 0
uint32_t | lru = 0
SpriteType | type = SpriteType::Invalid
| In some cases a single sprite is misused by two NewGRFs. Once as real sprite and once as recolour sprite. If the recolour sprite gets into the cache it might be drawn as real sprite which causes enormous trouble.
bool | warned = false
| True iff the user has been warned about incorrect use of this sprite.
SpriteCacheCtrlFlags | control_flags {}
| Control flags, see SpriteCacheCtrlFlags.

## Detailed Description

Definition at line 22 of file spritecache_internal.h.

## Member Function Documentation

## ◆ ClearSpriteData()

void SpriteCache::ClearSpriteData | ( |  | ) |

Definition at line 786 of file spritecache.cpp.

## Field Documentation

## ◆ control_flags

SpriteCacheCtrlFlags SpriteCache::control_flags {}

Control flags, see SpriteCacheCtrlFlags.

Definition at line 31 of file spritecache_internal.h.

Referenced by LoadNextSprite(), and ReadSprite().

## ◆ file

SpriteFile* SpriteCache::file = nullptr

The file the sprite in this entry can be found in.

Definition at line 25 of file spritecache_internal.h.

Referenced by GetOriginFile(), GetRawSprite(), GetSpriteCountForFile(), LoadNextSprite(), and ReadSprite().

## ◆ file_pos

size_t SpriteCache::file_pos = 0

Definition at line 24 of file spritecache_internal.h.

## ◆ id

uint32_t SpriteCache::id = 0

Definition at line 27 of file spritecache_internal.h.

## ◆ length

uint32_t SpriteCache::length

Length of sprite data.

Definition at line 26 of file spritecache_internal.h.

Referenced by DeleteEntriesFromSpriteCache(), GetRawSprite(), and LoadNextSprite().

## ◆ lru

uint32_t SpriteCache::lru = 0

Definition at line 28 of file spritecache_internal.h.

## ◆ ptr

std::unique_ptr<std::byte[]> SpriteCache::ptr

Definition at line 23 of file spritecache_internal.h.

## ◆ type

SpriteType SpriteCache::type = SpriteType::Invalid

In some cases a single sprite is misused by two NewGRFs. Once as real sprite and once as recolour sprite. If the recolour sprite gets into the cache it might be drawn as real sprite which causes enormous trouble.

Definition at line 29 of file spritecache_internal.h.

Referenced by GetRawSprite(), GetSpriteType(), HandleInvalidSpriteRequest(), LoadNextSprite(), and ReadSprite().

## ◆ warned

bool SpriteCache::warned = false

True iff the user has been warned about incorrect use of this sprite.

Definition at line 30 of file spritecache_internal.h.

Referenced by HandleInvalidSpriteRequest(), and LoadNextSprite().

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

- src/spritecache_internal.h
- src/spritecache.cpp