OpenTTD Source: GrfProcessingState Struct Reference

OpenTTD Source 13.2.1

Data Structures | Public Member Functions | Data Fields | Private Attributes
GrfProcessingState Struct Reference

Temporary data during loading of GRFs. More...

## Data Structures
struct | SpriteSet
| Definition of a single Action1 spriteset. More...

## Public Member Functions
void | ClearDataForNextFile ()
| Clear temporary data before processing the next file in the current loading stage.
void | AddSpriteSets (byte feature, SpriteID first_sprite, uint first_set, uint numsets, uint numents)
| Records new spritesets. More...
bool | HasValidSpriteSets (byte feature) const
| Check whether there are any valid spritesets for a feature. More...
bool | IsValidSpriteSet (byte feature, uint set) const
| Check whether a specific set is defined. More...
SpriteID | GetSprite (byte feature, uint set) const
| Returns the first sprite of a spriteset. More...
uint | GetNumEnts (byte feature, uint set) const
| Returns the number of sprites in a spriteset. More...

## Data Fields
GrfLoadingStage | stage
| Current loading stage.
SpriteID | spriteid
| First available SpriteID for loading realsprites.
SpriteFile * | file
| File of currently processed GRF file.
GRFFile * | grffile
| Currently processed GRF file.
GRFConfig * | grfconfig
| Config of the currently processed GRF file.
uint32 | nfo_line
| Currently processed pseudo sprite number in the GRF.
int | skip_sprites
| Number of pseudo sprites to skip before processing the next one. (-1 to skip to end of file)
const SpriteGroup * | spritegroups [MAX_SPRITEGROUP+1]

## Private Attributes
std::map< uint, SpriteSet > | spritesets [GSF_END]
| Currently referenceable spritesets.

## Detailed Description

Temporary data during loading of GRFs.

Definition at line 86 of file newgrf.cpp.

## Member Function Documentation

## ◆ AddSpriteSets()

void GrfProcessingState::AddSpriteSets | ( | byte | feature,
|  | SpriteID | first_sprite,
|  | uint | first_set,
|  | uint | numsets,
|  | uint | numents
| ) |  |
| inline

Records new spritesets.

Parameters

  feature | GrfSpecFeature the set is defined for.
  first_sprite | SpriteID of the first sprite in the set.
  first_set | First spriteset to define.
  numsets | Number of sets to define.
  numents | Number of sprites per set to define.

Definition at line 135 of file newgrf.cpp.

## ◆ GetNumEnts()

uint GrfProcessingState::GetNumEnts | ( | byte | feature,
|  | uint | set
| ) |  | const
| inline

Returns the number of sprites in a spriteset.

Parameters

  feature | GrfSpecFeature to query.
  set | Set to query.

Returns
  Number of sprites in the set.

Definition at line 188 of file newgrf.cpp.

References IsValidSpriteSet().

## ◆ GetSprite()

SpriteID GrfProcessingState::GetSprite | ( | byte | feature,
|  | uint | set
| ) |  | const
| inline

Returns the first sprite of a spriteset.

Parameters

  feature | GrfSpecFeature to query.
  set | Set to query.

Returns
  First sprite of the set.

Definition at line 176 of file newgrf.cpp.

References IsValidSpriteSet().

## ◆ HasValidSpriteSets()

bool GrfProcessingState::HasValidSpriteSets | ( | byte | feature | ) | const
| inline

Check whether there are any valid spritesets for a feature.

Parameters

  feature | GrfSpecFeature to check.

Returns
  true if there are any valid sets.

Note
  Spritesets with zero sprites are valid to allow callback-failures.

Definition at line 151 of file newgrf.cpp.

## ◆ IsValidSpriteSet()

bool GrfProcessingState::IsValidSpriteSet | ( | byte | feature,
|  | uint | set
| ) |  | const
| inline

Check whether a specific set is defined.

Parameters

  feature | GrfSpecFeature to check.
  set | Set to check.

Returns
  true if the set is valid.

Note
  Spritesets with zero sprites are valid to allow callback-failures.

Definition at line 164 of file newgrf.cpp.

Referenced by GetNumEnts(), and GetSprite().

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

- src/newgrf.cpp