diff options
Diffstat (limited to 'src/newgrf_commons.h')
-rw-r--r-- | src/newgrf_commons.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index a77da3cd2..7c55911a8 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -96,6 +96,8 @@ struct TileLayoutRegisters { uint8 dodraw; ///< Register deciding whether the sprite shall be drawn at all. Non-zero means drawing. uint8 sprite; ///< Register specifying a signed offset for the sprite. uint8 palette; ///< Register specifying a signed offset for the palette. + uint16 max_sprite_offset; ///< Maximum offset to add to the sprite. (limited by size of the spriteset) + uint16 max_palette_offset; ///< Maximum offset to add to the palette. (limited by size of the spriteset) union { uint8 parent[3]; ///< Registers for signed offsets for the bounding box position of parent sprites. uint8 child[2]; ///< Registers for signed offsets for the position of child sprites. @@ -114,6 +116,12 @@ static const uint TLR_MAX_VAR10 = 7; ///< Maximum value for var 10. struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites { const TileLayoutRegisters *registers; + /** + * Number of sprites in all referenced spritesets. + * If these numbers are inconsistent, then this is 0 and the real values are in \c registers. + */ + uint consistent_max_offset; + void Allocate(uint num_sprites); void AllocateRegisters(); void Clone(const DrawTileSeqStruct *source); @@ -147,7 +155,7 @@ struct NewGRFSpriteLayout : ZeroedMemoryAllocator, DrawTileSprites { return this->registers != NULL; } - uint32 PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, bool separate_ground) const; + uint32 PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const; void ProcessRegisters(uint8 resolved_var10, uint32 resolved_sprite, bool separate_ground) const; /** |