37 uint16_t first_set = 0;
39 if (num_sets == 0 && buf.HasData(3)) {
47 if (feature >= GSF_END) {
48 _cur_gps.skip_sprites = num_sets * num_ents;
49 GrfMsg(1,
"NewSpriteSet: Unsupported feature 0x{:02X}, skipping {} sprites", feature, _cur_gps.skip_sprites);
53 _cur_gps.AddSpriteSets(feature, _cur_gps.spriteid, first_set, num_sets, num_ents);
55 GrfMsg(7,
"New sprite set at {} of feature 0x{:02X}, consisting of {} sets with {} views each (total {})",
56 _cur_gps.spriteid, feature, num_sets, num_ents, num_sets * num_ents
59 for (
int i = 0; i < num_sets * num_ents; i++) {
61 LoadNextSprite(_cur_gps.spriteid++, *_cur_gps.file, _cur_gps.nfo_line);
71 if (num_sets == 0 && buf.HasData(3)) {
79 _cur_gps.skip_sprites = num_sets * num_ents;
81 GrfMsg(3,
"SkipAct1: Skipping {} sprites", _cur_gps.skip_sprites);
Class to read from a NewGRF file.
uint16_t ReadExtendedByte()
Read a single Extended Byte (8 or 16 bits).
uint8_t ReadByte()
Read a single byte (8 bits).
Functions related to debugging.
NewGRF buffer reader definition.
NewGRF internal processing state.
A number of safeguards to prevent using unsafe methods.
bool LoadNextSprite(SpriteID load_index, SpriteFile &file, uint file_sprite_id)
Load a real or recolour sprite.
Functions to cache sprites in memory.
Definition of base types and functions in a cross-platform compatible way.
static void FileScan(ByteReader &buf)
Implementation of the GrfLoadingStage::FileScan stage of this action.
static void SafetyScan(ByteReader &buf)
Implementation of the GrfLoadingStage::SafetyScan stage of this action.
static void Reserve(ByteReader &buf)
Implementation of the GrfLoadingStage::Reserve stage of this action.
static void Activation(ByteReader &buf)
Implementation of the GrfLoadingStage::Activation stage of this action.
static void Init(ByteReader &buf)
Implementation of the GrfLoadingStage::Init stage of this action.
static void LabelScan(ByteReader &buf)
Implementation of the GrfLoadingStage::LabelScan stage of this action.