OpenTTD Source 20251019-master-g9f7f314f81
newgrf_act5.cpp File Reference

NewGRF Action 0x05 handler. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../gfx_type.h"
#include "../newgrf_act5.h"
#include "../spritecache.h"
#include "newgrf_bytereader.h"
#include "newgrf_internal.h"
#include "../table/sprites.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

static uint16_t SanitizeSpriteOffset (uint16_t &num, uint16_t offset, int max_sprites, std::string_view name)
 Sanitize incoming sprite offsets for Action 5 graphics replacements.
 
std::span< const Action5TypeGetAction5Types ()
 Get list of all action 5 types.
 
static void GraphicsNew (ByteReader &buf)
 
static void SkipAct5 (ByteReader &buf)
 

Variables

static constexpr auto _action5_types
 The information about action 5 types.
 

Detailed Description

NewGRF Action 0x05 handler.

Definition in file newgrf_act5.cpp.

Function Documentation

◆ GetAction5Types()

std::span< const Action5Type > GetAction5Types ( )

Get list of all action 5 types.

Returns
Read-only span of action 5 type information.

Definition at line 88 of file newgrf_act5.cpp.

References _action5_types.

Referenced by SpriteAlignerWindow::GetWidgetString().

◆ GraphicsNew()

static void GraphicsNew ( ByteReader buf)
static

Definition at line 94 of file newgrf_act5.cpp.

◆ SanitizeSpriteOffset()

static uint16_t SanitizeSpriteOffset ( uint16_t &  num,
uint16_t  offset,
int  max_sprites,
std::string_view  name 
)
static

Sanitize incoming sprite offsets for Action 5 graphics replacements.

Parameters
numThe number of sprites to load.
offsetOffset from the base.
max_spritesThe maximum number of sprites that can be loaded in this action 5.
nameUsed for error warnings.
Returns
The number of sprites that is going to be skipped.

Definition at line 30 of file newgrf_act5.cpp.

◆ SkipAct5()

static void SkipAct5 ( ByteReader buf)
static

Definition at line 183 of file newgrf_act5.cpp.

Variable Documentation

◆ _action5_types

constexpr auto _action5_types
staticconstexpr

The information about action 5 types.

Definition at line 52 of file newgrf_act5.cpp.

Referenced by GetAction5Types().