OpenTTD Source  1.11.2
newgrf_commons.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
13 #ifndef NEWGRF_COMMONS_H
14 #define NEWGRF_COMMONS_H
15 
16 #include "sprite.h"
17 #include "core/alloc_type.hpp"
18 #include "core/smallvec_type.hpp"
19 #include "command_type.h"
20 #include "direction_type.h"
21 #include "company_type.h"
22 
28 };
29 
34  TLF_NOTHING = 0x00,
35 
36  TLF_DODRAW = 0x01,
37  TLF_SPRITE = 0x02,
38  TLF_PALETTE = 0x04,
40 
42  TLF_BB_Z_OFFSET = 0x20,
43 
46 
49 
50  TLF_KNOWN_FLAGS = 0xFF,
51 
54 
57 
60 
63 
66 };
68 
69 
75 static inline uint GetConstructionStageOffset(uint construction_stage, uint num_sprites)
76 {
77  assert(num_sprites > 0);
78  if (num_sprites > 4) num_sprites = 4;
79  switch (construction_stage) {
80  case 0: return 0;
81  case 1: return num_sprites > 2 ? 1 : 0;
82  case 2: return num_sprites > 2 ? num_sprites - 2 : 0;
83  case 3: return num_sprites - 1;
84  default: NOT_REACHED();
85  }
86 }
87 
93  uint8 dodraw;
94  uint8 sprite;
95  uint8 palette;
98  union {
99  uint8 parent[3];
100  uint8 child[2];
101  } delta;
102  uint8 sprite_var10;
104 };
105 
106 static const uint TLR_MAX_VAR10 = 7;
107 
114  const TileLayoutRegisters *registers;
115 
121 
122  void Allocate(uint num_sprites);
123  void AllocateRegisters();
124  void Clone(const DrawTileSeqStruct *source);
125  void Clone(const NewGRFSpriteLayout *source);
126 
131  void Clone(const DrawTileSprites *source)
132  {
133  assert(source != nullptr && this != source);
134  this->ground = source->ground;
135  this->Clone(source->seq);
136  }
137 
138  virtual ~NewGRFSpriteLayout()
139  {
140  free(this->seq);
141  free(this->registers);
142  }
143 
150  bool NeedsPreprocessing() const
151  {
152  return this->registers != nullptr;
153  }
154 
155  uint32 PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const;
156  void ProcessRegisters(uint8 resolved_var10, uint32 resolved_sprite, bool separate_ground) const;
157 
164  {
165  DrawTileSeqStruct *front = result_seq.data();
166  *ground = front->image;
167  return front + 1;
168  }
169 
170 private:
171  static std::vector<DrawTileSeqStruct> result_seq;
172 };
173 
187  uint32 grfid;
188  uint8 entity_id;
190 };
191 
193 protected:
194  uint16 *entity_overrides;
195  uint32 *grfid_overrides;
196 
197  uint16 max_offset;
199 
200  uint16 invalid_ID;
201  virtual bool CheckValidNewID(uint16 testid) { return true; }
202 
203 public:
205 
206  OverrideManagerBase(uint16 offset, uint16 maximum, uint16 invalid);
207  virtual ~OverrideManagerBase();
208 
209  void ResetOverride();
210  void ResetMapping();
211 
212  void Add(uint8 local_id, uint32 grfid, uint entity_type);
213  virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
214 
215  uint32 GetGRFID(uint16 entity_id) const;
216  uint16 GetSubstituteID(uint16 entity_id) const;
217  virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const;
218 
219  inline uint16 GetMaxMapping() const { return max_new_entities; }
220  inline uint16 GetMaxOffset() const { return max_offset; }
221 };
222 
223 
224 struct HouseSpec;
226 public:
227  HouseOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
228  OverrideManagerBase(offset, maximum, invalid) {}
229 
230  void SetEntitySpec(const HouseSpec *hs);
231 };
232 
233 
234 struct IndustrySpec;
236 public:
237  IndustryOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
238  OverrideManagerBase(offset, maximum, invalid) {}
239 
240  uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id) override;
241  uint16 GetID(uint8 grf_local_id, uint32 grfid) const override;
242 
243  void SetEntitySpec(IndustrySpec *inds);
244 };
245 
246 
247 struct IndustryTileSpec;
249 protected:
250  virtual bool CheckValidNewID(uint16 testid) { return testid != 0xFF; }
251 public:
252  IndustryTileOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
253  OverrideManagerBase(offset, maximum, invalid) {}
254 
255  void SetEntitySpec(const IndustryTileSpec *indts);
256 };
257 
258 struct AirportSpec;
260 public:
261  AirportOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
262  OverrideManagerBase(offset, maximum, invalid) {}
263 
264  void SetEntitySpec(AirportSpec *inds);
265 };
266 
267 struct AirportTileSpec;
269 protected:
270  virtual bool CheckValidNewID(uint16 testid) { return testid != 0xFF; }
271 public:
272  AirportTileOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
273  OverrideManagerBase(offset, maximum, invalid) {}
274 
275  void SetEntitySpec(const AirportTileSpec *ats);
276 };
277 
278 struct ObjectSpec;
280 protected:
281  virtual bool CheckValidNewID(uint16 testid) { return testid != 0xFF; }
282 public:
283  ObjectOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
284  OverrideManagerBase(offset, maximum, invalid) {}
285 
286  void SetEntitySpec(ObjectSpec *spec);
287 };
288 
289 extern HouseOverrideManager _house_mngr;
290 extern IndustryOverrideManager _industry_mngr;
291 extern IndustryTileOverrideManager _industile_mngr;
292 extern AirportOverrideManager _airport_mngr;
293 extern AirportTileOverrideManager _airporttile_mngr;
295 
296 uint32 GetTerrainType(TileIndex tile, TileContext context = TCX_NORMAL);
297 TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets = true, Axis axis = INVALID_AXIS);
298 uint32 GetNearbyTileInformation(TileIndex tile, bool grf_version8);
299 uint32 GetCompanyInfo(CompanyID owner, const struct Livery *l = nullptr);
300 CommandCost GetErrorMessageFromLocationCallbackResult(uint16 cb_res, const GRFFile *grffile, StringID default_error);
301 
302 void ErrorUnknownCallbackResult(uint32 grfid, uint16 cbid, uint16 cb_res);
303 bool ConvertBooleanCallback(const struct GRFFile *grffile, uint16 cbid, uint16 cb_res);
304 bool Convert8bitBooleanCallback(const struct GRFFile *grffile, uint16 cbid, uint16 cb_res);
305 
310 template <size_t Tcnt>
313  {
314  /* The lack of some compilers to provide default constructors complying to the specs
315  * requires us to zero the stuff ourself. */
316  memset(spritegroup, 0, sizeof(spritegroup));
317  }
318 
319  uint16 local_id;
320  const struct GRFFile *grffile;
321  const struct SpriteGroup *spritegroup[Tcnt];
322 };
323 
327  GRFFileProps(uint16 subst_id = 0) :
328  GRFFilePropsBase<1>(), subst_id(subst_id), override(subst_id)
329  {
330  }
331 
332  uint16 subst_id;
333  uint16 override;
334 };
335 
336 #endif /* NEWGRF_COMMONS_H */
TCX_UPPER_HALFTILE
@ TCX_UPPER_HALFTILE
Querying information about the upper part of a tile with halftile foundation.
Definition: newgrf_commons.h:26
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:83
GetErrorMessageFromLocationCallbackResult
CommandCost GetErrorMessageFromLocationCallbackResult(uint16 cb_res, const GRFFile *grffile, StringID default_error)
Get the error message from a shape/location/slope check callback result.
Definition: newgrf_commons.cpp:480
GRFFileProps::override
uint16 override
id of the entity been replaced by
Definition: newgrf_commons.h:333
direction_type.h
GRFFileProps::GRFFileProps
GRFFileProps(uint16 subst_id=0)
Set all default data constructor for the props.
Definition: newgrf_commons.h:327
EntityIDMapping::substitute_id
uint8 substitute_id
The (original) entity ID to use if this GRF is not available.
Definition: newgrf_commons.h:189
TLF_DODRAW
@ TLF_DODRAW
Only draw sprite if value of register TileLayoutRegisters::dodraw is non-zero.
Definition: newgrf_commons.h:36
NewGRFSpriteLayout::PrepareLayout
uint32 PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const
Prepares a sprite layout before resolving action-1-2-3 chains.
Definition: newgrf_commons.cpp:660
ObjectSpec
Allow incrementing of ObjectClassID variables.
Definition: newgrf_object.h:58
sprite.h
TLF_CHILD_X_OFFSET
@ TLF_CHILD_X_OFFSET
Add signed offset to child sprite X positions from register TileLayoutRegisters::delta....
Definition: newgrf_commons.h:44
TileLayoutRegisters::sprite
uint8 sprite
Register specifying a signed offset for the sprite.
Definition: newgrf_commons.h:94
NewGRFSpriteLayout::AllocateRegisters
void AllocateRegisters()
Allocate memory for register modifiers.
Definition: newgrf_commons.cpp:636
OverrideManagerBase::~OverrideManagerBase
virtual ~OverrideManagerBase()
Destructor of the generic class.
Definition: newgrf_commons.cpp:57
TileLayoutRegisters::parent
uint8 parent[3]
Registers for signed offsets for the bounding box position of parent sprites.
Definition: newgrf_commons.h:99
smallvec_type.hpp
IndustryOverrideManager
Definition: newgrf_commons.h:235
TileLayoutRegisters::palette_var10
uint8 palette_var10
Value for variable 10 when resolving the palette.
Definition: newgrf_commons.h:103
ObjectOverrideManager
Definition: newgrf_commons.h:279
NewGRFSpriteLayout::ProcessRegisters
void ProcessRegisters(uint8 resolved_var10, uint32 resolved_sprite, bool separate_ground) const
Evaluates the register modifiers and integrates them into the preprocessed sprite layout.
Definition: newgrf_commons.cpp:731
TLF_CUSTOM_PALETTE
@ TLF_CUSTOM_PALETTE
Palette is from Action 1 (moved to SPRITE_MODIFIER_CUSTOM_SPRITE in palette during loading).
Definition: newgrf_commons.h:39
OverrideManagerBase::GetID
virtual uint16 GetID(uint8 grf_local_id, uint32 grfid) const
Return the ID (if ever available) of a previously inserted entity.
Definition: newgrf_commons.cpp:102
OverrideManagerBase::Add
void Add(uint8 local_id, uint32 grfid, uint entity_type)
Since the entity IDs defined by the GRF file does not necessarily correlate to those used by the game...
Definition: newgrf_commons.cpp:72
NewGRFSpriteLayout::Clone
void Clone(const DrawTileSprites *source)
Clone a spritelayout.
Definition: newgrf_commons.h:131
ConvertBooleanCallback
bool ConvertBooleanCallback(const GRFFile *grffile, uint16 cbid, uint16 cb_res)
Converts a callback result into a boolean.
Definition: newgrf_commons.cpp:550
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
TLF_BB_Z_OFFSET
@ TLF_BB_Z_OFFSET
Add signed offset to bounding box Z positions from register TileLayoutRegisters::delta....
Definition: newgrf_commons.h:42
AirportSpec
Defines the data structure for an airport.
Definition: newgrf_airport.h:98
TileLayoutRegisters
Additional modifiers for items in sprite layouts.
Definition: newgrf_commons.h:91
TileLayoutRegisters::dodraw
uint8 dodraw
Register deciding whether the sprite shall be drawn at all. Non-zero means drawing.
Definition: newgrf_commons.h:93
IndustryOverrideManager::GetID
uint16 GetID(uint8 grf_local_id, uint32 grfid) const override
Return the ID (if ever available) of a previously inserted entity.
Definition: newgrf_commons.cpp:205
alloc_type.hpp
EntityIDMapping::grfid
uint32 grfid
The GRF ID of the file the entity belongs to.
Definition: newgrf_commons.h:187
TLF_KNOWN_FLAGS
@ TLF_KNOWN_FLAGS
Known flags. Any unknown set flag will disable the GRF.
Definition: newgrf_commons.h:50
DrawTileSprites::ground
PalSpriteID ground
Palette and sprite for the ground.
Definition: sprite.h:59
AirportTileSpec
Defines the data structure of each individual tile of an airport.
Definition: newgrf_airporttiles.h:66
OverrideManagerBase::OverrideManagerBase
OverrideManagerBase(uint16 offset, uint16 maximum, uint16 invalid)
Constructor of generic class.
Definition: newgrf_commons.cpp:41
CommandCost
Common return value for all commands.
Definition: command_type.h:23
TLF_BB_XY_OFFSET
@ TLF_BB_XY_OFFSET
Add signed offset to bounding box X and Y positions from register TileLayoutRegisters::delta....
Definition: newgrf_commons.h:41
OverrideManagerBase::ResetMapping
void ResetMapping()
Resets the mapping, which is used while initializing game.
Definition: newgrf_commons.cpp:82
TLF_CHILD_Y_OFFSET
@ TLF_CHILD_Y_OFFSET
Add signed offset to child sprite Y positions from register TileLayoutRegisters::delta....
Definition: newgrf_commons.h:45
Convert8bitBooleanCallback
bool Convert8bitBooleanCallback(const GRFFile *grffile, uint16 cbid, uint16 cb_res)
Converts a callback result into a boolean.
Definition: newgrf_commons.cpp:569
ZeroedMemoryAllocator
Base class that provides memory initialization on dynamically created objects.
Definition: alloc_type.hpp:85
ErrorUnknownCallbackResult
void ErrorUnknownCallbackResult(uint32 grfid, uint16 cbid, uint16 cb_res)
Record that a NewGRF returned an unknown/invalid callback result.
Definition: newgrf_commons.cpp:516
GRFFileProps
Data related to the handling of grf files.
Definition: newgrf_commons.h:325
TileContext
TileContext
Context for tile accesses.
Definition: newgrf_commons.h:24
TileLayoutRegisters::child
uint8 child[2]
Registers for signed offsets for the position of child sprites.
Definition: newgrf_commons.h:100
NewGRFSpriteLayout
NewGRF supplied spritelayout.
Definition: newgrf_commons.h:113
ObjectOverrideManager::SetEntitySpec
void SetEntitySpec(ObjectSpec *spec)
Method to install the new object data in its proper slot The slot assignment is internal of this meth...
Definition: newgrf_commons.cpp:315
NewGRFSpriteLayout::NeedsPreprocessing
bool NeedsPreprocessing() const
Tests whether this spritelayout needs preprocessing by PrepareLayout() and ProcessRegisters(),...
Definition: newgrf_commons.h:150
TLR_MAX_VAR10
static const uint TLR_MAX_VAR10
Maximum value for var 10.
Definition: newgrf_commons.h:106
DrawTileSprites
Ground palette sprite of a tile, together with its sprite layout.
Definition: sprite.h:58
TCX_NORMAL
@ TCX_NORMAL
Nothing special.
Definition: newgrf_commons.h:25
GetConstructionStageOffset
static uint GetConstructionStageOffset(uint construction_stage, uint num_sprites)
Determines which sprite to use from a spriteset for a specific construction stage.
Definition: newgrf_commons.h:75
EntityIDMapping
Maps an entity id stored on the map to a GRF file.
Definition: newgrf_commons.h:186
TLF_NON_GROUND_FLAGS
@ TLF_NON_GROUND_FLAGS
Flags which do not work for the (first) ground sprite.
Definition: newgrf_commons.h:56
IndustrySpec
Defines the data structure for constructing industry.
Definition: industrytype.h:107
command_type.h
TileLayoutRegisters::sprite_var10
uint8 sprite_var10
Value for variable 10 when resolving the sprite.
Definition: newgrf_commons.h:102
EntityIDMapping::entity_id
uint8 entity_id
The entity ID within the GRF file.
Definition: newgrf_commons.h:188
StringID
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:16
GRFFilePropsBase::spritegroup
const struct SpriteGroup * spritegroup[Tcnt]
pointer to the different sprites of the entity
Definition: newgrf_commons.h:321
TLF_VAR10_FLAGS
@ TLF_VAR10_FLAGS
Flags which refer to using multiple action-1-2-3 chains.
Definition: newgrf_commons.h:59
OverrideManagerBase::max_new_entities
uint16 max_new_entities
what is the amount of entities, old and new summed
Definition: newgrf_commons.h:198
TileLayoutRegisters::palette
uint8 palette
Register specifying a signed offset for the palette.
Definition: newgrf_commons.h:95
TileLayoutRegisters::max_palette_offset
uint16 max_palette_offset
Maximum offset to add to the palette. (limited by size of the spriteset)
Definition: newgrf_commons.h:97
OverrideManagerBase::GetSubstituteID
uint16 GetSubstituteID(uint16 entity_id) const
Gives the substitute of the entity, as specified by the grf file.
Definition: newgrf_commons.cpp:166
HouseOverrideManager
Definition: newgrf_commons.h:225
TCX_ON_BRIDGE
@ TCX_ON_BRIDGE
Querying information about stuff on the bridge (via some bridgehead).
Definition: newgrf_commons.h:27
IndustryOverrideManager::AddEntityID
uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id) override
Method to find an entity ID and to mark it as reserved for the Industry to be included.
Definition: newgrf_commons.cpp:225
NewGRFSpriteLayout::consistent_max_offset
uint consistent_max_offset
Number of sprites in all referenced spritesets.
Definition: newgrf_commons.h:120
OverrideManagerBase::ResetOverride
void ResetOverride()
Resets the override, which is used while initializing game.
Definition: newgrf_commons.cpp:88
TileLayoutFlags
TileLayoutFlags
Flags to enable register usage in sprite layouts.
Definition: newgrf_commons.h:33
PalSpriteID
Combination of a palette sprite and a 'real' sprite.
Definition: gfx_type.h:22
OverrideManagerBase::mapping_ID
EntityIDMapping * mapping_ID
mapping of ids from grf files. Public out of convenience
Definition: newgrf_commons.h:204
GetTerrainType
uint32 GetTerrainType(TileIndex tile, TileContext context=TCX_NORMAL)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
Definition: newgrf_commons.cpp:348
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:29
GetNearbyTile
TileIndex GetNearbyTile(byte parameter, TileIndex tile, bool signed_offsets=true, Axis axis=INVALID_AXIS)
Get the tile at the given offset.
Definition: newgrf_commons.cpp:423
IndustryTileOverrideManager
Definition: newgrf_commons.h:248
NewGRFSpriteLayout::Clone
void Clone(const DrawTileSeqStruct *source)
Clone the building sprites of a spritelayout.
Definition: newgrf_commons.cpp:586
GetCompanyInfo
uint32 GetCompanyInfo(CompanyID owner, const Livery *l)
Returns company information like in vehicle var 43 or station var 43.
Definition: newgrf_commons.cpp:467
DrawTileSprites::seq
const DrawTileSeqStruct * seq
Array of child sprites. Terminated with a terminator entry.
Definition: sprite.h:60
OverrideManagerBase
Definition: newgrf_commons.h:192
TileLayoutRegisters::flags
TileLayoutFlags flags
Flags defining which members are valid and to be used.
Definition: newgrf_commons.h:92
OverrideManagerBase::max_offset
uint16 max_offset
what is the length of the original entity's array of specs
Definition: newgrf_commons.h:197
HouseSpec
Definition: house.h:98
Axis
Axis
Allow incrementing of DiagDirDiff variables.
Definition: direction_type.h:123
NewGRFSpriteLayout::GetLayout
const DrawTileSeqStruct * GetLayout(PalSpriteID *ground) const
Returns the result spritelayout after preprocessing.
Definition: newgrf_commons.h:163
OverrideManagerBase::AddEntityID
virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id)
Reserves a place in the mapping array for an entity to be installed.
Definition: newgrf_commons.cpp:123
_object_mngr
ObjectOverrideManager _object_mngr
The override manager for our objects.
OverrideManagerBase::GetGRFID
uint32 GetGRFID(uint16 entity_id) const
Gives the GRFID of the file the entity belongs to.
Definition: newgrf_commons.cpp:156
GRFFilePropsBase::local_id
uint16 local_id
id defined by the grf file for this entity
Definition: newgrf_commons.h:319
TLF_PALETTE_REG_FLAGS
@ TLF_PALETTE_REG_FLAGS
Flags which require resolving the action-1-2-3 chain for the palette, even if it is no action-1 palet...
Definition: newgrf_commons.h:65
TLF_SPRITE
@ TLF_SPRITE
Add signed offset to sprite from register TileLayoutRegisters::sprite.
Definition: newgrf_commons.h:37
TLF_PALETTE
@ TLF_PALETTE
Add signed offset to palette from register TileLayoutRegisters::palette.
Definition: newgrf_commons.h:38
GRFFilePropsBase::grffile
const struct GRFFile * grffile
grf file that introduced this entity
Definition: newgrf_commons.h:320
INVALID_AXIS
@ INVALID_AXIS
Flag for an invalid Axis.
Definition: direction_type.h:127
free
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
Definition: stdafx.h:456
IndustryOverrideManager::SetEntitySpec
void SetEntitySpec(IndustrySpec *inds)
Method to install the new industry data in its proper slot The slot assignment is internal of this me...
Definition: newgrf_commons.cpp:260
IndustryTileSpec
Defines the data structure of each individual tile of an industry.
Definition: industrytype.h:156
TLF_DRAWING_FLAGS
@ TLF_DRAWING_FLAGS
Flags which are still required after loading the GRF.
Definition: newgrf_commons.h:53
TLF_PALETTE_VAR10
@ TLF_PALETTE_VAR10
Resolve palette with a specific value in variable 10.
Definition: newgrf_commons.h:48
TLF_SPRITE_REG_FLAGS
@ TLF_SPRITE_REG_FLAGS
Flags which require resolving the action-1-2-3 chain for the sprite, even if it is no action-1 sprite...
Definition: newgrf_commons.h:62
TLF_SPRITE_VAR10
@ TLF_SPRITE_VAR10
Resolve sprite with a specific value in variable 10.
Definition: newgrf_commons.h:47
GRFFilePropsBase
Data related to the handling of grf files.
Definition: newgrf_commons.h:311
Livery
Information about a particular livery.
Definition: livery.h:78
NewGRFSpriteLayout::result_seq
static std::vector< DrawTileSeqStruct > result_seq
Temporary storage when preprocessing spritelayouts.
Definition: newgrf_commons.h:171
company_type.h
SpriteGroup
Definition: newgrf_spritegroup.h:57
AirportOverrideManager
Definition: newgrf_commons.h:259
NewGRFSpriteLayout::Allocate
void Allocate(uint num_sprites)
Allocate a spritelayout for num_sprites building sprites.
Definition: newgrf_commons.cpp:624
GRFFile
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:105
OverrideManagerBase::invalid_ID
uint16 invalid_ID
ID used to detected invalid entities;.
Definition: newgrf_commons.h:200
AirportTileOverrideManager
Definition: newgrf_commons.h:268
GetNearbyTileInformation
uint32 GetNearbyTileInformation(TileIndex tile, bool grf_version8)
Common part of station var 0x67, house var 0x62, indtile var 0x60, industry var 0x62.
Definition: newgrf_commons.cpp:446
TileLayoutRegisters::max_sprite_offset
uint16 max_sprite_offset
Maximum offset to add to the sprite. (limited by size of the spriteset)
Definition: newgrf_commons.h:96
DrawTileSeqStruct
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Definition: sprite.h:25
HouseOverrideManager::SetEntitySpec
void SetEntitySpec(const HouseSpec *hs)
Install the specs into the HouseSpecs array It will find itself the proper slot on which it will go.
Definition: newgrf_commons.cpp:176