15 #ifndef NEWGRF_COMMONS_H 
   16 #define NEWGRF_COMMONS_H 
   79   assert(num_sprites > 0);
 
   80   if (num_sprites > 4) num_sprites = 4;
 
   81   switch (construction_stage) {
 
   83     case 1: 
return num_sprites > 2 ? 1 : 0;
 
   84     case 2: 
return num_sprites > 2 ? num_sprites - 2 : 0;
 
   85     case 3: 
return num_sprites - 1;
 
   86     default: NOT_REACHED();
 
  135     assert(source != NULL && 
this != source);
 
  143     free(this->registers);
 
  154     return this->registers != NULL;
 
  157   uint32 
PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, 
bool separate_ground) 
const;
 
  158   void ProcessRegisters(uint8 resolved_var10, uint32 resolved_sprite, 
bool separate_ground) 
const;
 
  168     *ground = front->image;
 
  196   uint16 *entity_overrides;
 
  197   uint32 *grfid_overrides;
 
  203   virtual bool CheckValidNewID(uint16 testid) { 
return true; }
 
  214   void Add(uint8 local_id, uint32 grfid, uint entity_type);
 
  215   virtual uint16 
AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
 
  217   uint32 
GetGRFID(uint16 entity_id) 
const;
 
  219   virtual uint16 
GetID(uint8 grf_local_id, uint32 grfid) 
const;
 
  222   inline uint16 GetMaxOffset()
 const { 
return max_offset; }
 
  241   virtual uint16 
AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
 
  242   virtual uint16 
GetID(uint8 grf_local_id, uint32 grfid) 
const;
 
  250   virtual bool CheckValidNewID(uint16 testid) { 
return testid != 0xFF; }
 
  270   virtual bool CheckValidNewID(uint16 testid) { 
return testid != 0xFF; }
 
  281   virtual bool CheckValidNewID(uint16 testid) { 
return testid != 0xFF; }
 
  310 template <
size_t Tcnt>