OpenTTD Source: src/newgrf_spritegroup.h File Reference

OpenTTD Source 15.3

Data Structures | Typedefs | Enumerations | Variables
newgrf_spritegroup.h File Reference

Action 2 handling. More...

`#include "core/pool_type.hpp"`
`#include "town_type.h"`
`#include "engine_type.h"`
`#include "house_type.h"`
`#include "industry_type.h"`
`#include "newgrf_callbacks.h"`
`#include "newgrf_generic.h"`
`#include "newgrf_storage.h"`
`#include "newgrf_commons.h"`

Go to the source code of this file.

## Data Structures
struct | SpriteGroup
struct | RealSpriteGroup
struct | DeterministicSpriteGroupAdjust
struct | DeterministicSpriteGroupResult
struct | DeterministicSpriteGroupRange
struct | DeterministicSpriteGroup
struct | RandomizedSpriteGroup
struct | CallbackResultSpriteGroup
struct | ResultSpriteGroup
struct | TileLayoutSpriteGroup
| Action 2 sprite layout for houses, industry tiles, objects and airport tiles. More...
struct | IndustryProductionSpriteGroup
struct | ScopeResolver
| Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope). More...
struct | ResolverObject
| Interface for SpriteGroup-s to access the gamestate. More...
struct | SpecializedResolverObject< RandomTriggers >
| Specialization of ResolverObject with type-safe access to RandomTriggers. More...

## Typedefs
using | CallbackResult = uint16_t
using | ResolverResult = std::variant< std::monostate, CallbackResult, const ResultSpriteGroup *, const TileLayoutSpriteGroup *, const IndustryProductionSpriteGroup * >
| Result of resolving sprite groups:
using | SpriteGroupID = PoolID< uint32_t, struct SpriteGroupIDTag, 1U<< 30, 0xFFFFFFFF >
using | SpriteGroupPool = Pool< SpriteGroup, SpriteGroupID, 1024, PoolType::Data >

## Enumerations
enum | VarSpriteGroupScope : uint8_t { VSG_BEGIN , VSG_SCOPE_SELF = VSG_BEGIN , VSG_SCOPE_PARENT , VSG_SCOPE_RELATIVE , VSG_END }
enum | DeterministicSpriteGroupSize : uint8_t { DSG_SIZE_BYTE , DSG_SIZE_WORD , DSG_SIZE_DWORD }
enum | DeterministicSpriteGroupAdjustType : uint8_t { DSGA_TYPE_NONE , DSGA_TYPE_DIV , DSGA_TYPE_MOD }
enum | DeterministicSpriteGroupAdjustOperation : uint8_t { DSGA_OP_ADD , DSGA_OP_SUB , DSGA_OP_SMIN , DSGA_OP_SMAX , DSGA_OP_UMIN , DSGA_OP_UMAX , DSGA_OP_SDIV , DSGA_OP_SMOD , DSGA_OP_UDIV , DSGA_OP_UMOD , DSGA_OP_MUL , DSGA_OP_AND , DSGA_OP_OR , DSGA_OP_XOR , DSGA_OP_STO , DSGA_OP_RST , DSGA_OP_STOP , DSGA_OP_ROR , DSGA_OP_SCMP , DSGA_OP_UCMP , DSGA_OP_SHL , DSGA_OP_SHR , DSGA_OP_SAR }
enum | RandomizedSpriteGroupCompareMode : uint8_t { RSG_CMP_ANY , RSG_CMP_ALL }

## Variables
SpriteGroupPool | _spritegroup_pool

## Detailed Description

Action 2 handling.

Definition in file newgrf_spritegroup.h.

## Typedef Documentation

## ◆ CallbackResult

using CallbackResult = uint16_t

Definition at line 29 of file newgrf_spritegroup.h.

## ◆ ResolverResult

using ResolverResult = std::variant<std::monostate, CallbackResult, const ResultSpriteGroup *, const TileLayoutSpriteGroup *, const IndustryProductionSpriteGroup *>

Result of resolving sprite groups:

- std::monostate: Failure.
- CallbackResult: Callback result.
- SpriteGroup: ResultSpriteGroup, TileLayoutSpriteGroup, IndustryProductionSpriteGroup

Definition at line 37 of file newgrf_spritegroup.h.

## ◆ SpriteGroupID

using SpriteGroupID = PoolID<uint32_t, struct SpriteGroupIDTag, 1U << 30, 0xFFFFFFFF>

Definition at line 42 of file newgrf_spritegroup.h.

## ◆ SpriteGroupPool

using SpriteGroupPool = Pool<SpriteGroup, SpriteGroupID, 1024, PoolType::Data>

Definition at line 43 of file newgrf_spritegroup.h.

## Enumeration Type Documentation

## ◆ DeterministicSpriteGroupAdjustOperation

enum DeterministicSpriteGroupAdjustOperation : uint8_t

Enumerator
DSGA_OP_ADD | a + b
DSGA_OP_SUB | a - b
DSGA_OP_SMIN | (signed) min(a, b)
DSGA_OP_SMAX | (signed) max(a, b)
DSGA_OP_UMIN | (unsigned) min(a, b)
DSGA_OP_UMAX | (unsigned) max(a, b)
DSGA_OP_SDIV | (signed) a / b
DSGA_OP_SMOD | (signed) a % b
DSGA_OP_UDIV | (unsigned) a / b
DSGA_OP_UMOD | (unsigned) a & b
DSGA_OP_MUL | a * b
DSGA_OP_AND | a & b
DSGA_OP_OR | a | b
DSGA_OP_XOR | a ^ b
DSGA_OP_STO | store a into temporary storage, indexed by b. return a
DSGA_OP_RST | return b
DSGA_OP_STOP | store a into persistent storage, indexed by b, return a
DSGA_OP_ROR | rotate a b positions to the right
DSGA_OP_SCMP | (signed) comparison (a < b -> 0, a == b = 1, a > b = 2)
DSGA_OP_UCMP | (unsigned) comparison (a < b -> 0, a == b = 1, a > b = 2)
DSGA_OP_SHL | a << b
DSGA_OP_SHR | (unsigned) a >> b
DSGA_OP_SAR | (signed) a >> b

Definition at line 105 of file newgrf_spritegroup.h.

## ◆ DeterministicSpriteGroupAdjustType

enum DeterministicSpriteGroupAdjustType : uint8_t

Definition at line 99 of file newgrf_spritegroup.h.

## ◆ DeterministicSpriteGroupSize

enum DeterministicSpriteGroupSize : uint8_t

Definition at line 93 of file newgrf_spritegroup.h.

## ◆ RandomizedSpriteGroupCompareMode

enum RandomizedSpriteGroupCompareMode : uint8_t

Definition at line 176 of file newgrf_spritegroup.h.

## ◆ VarSpriteGroupScope

enum VarSpriteGroupScope : uint8_t

Enumerator
VSG_SCOPE_SELF | Resolved object itself.
VSG_SCOPE_PARENT | Related object of the resolved one.
VSG_SCOPE_RELATIVE | Relative position (vehicles only)

Definition at line 82 of file newgrf_spritegroup.h.