src/clear_map.h
branchcustombridgeheads
changeset 5648 1608018c5ff2
parent 5643 3778051e8095
child 5650 aefc131bf5ce
equal deleted inserted replaced
5647:cbde85c8c878 5648:1608018c5ff2
     3 #ifndef CLEAR_MAP_H
     3 #ifndef CLEAR_MAP_H
     4 #define CLEAR_MAP_H
     4 #define CLEAR_MAP_H
     5 
     5 
     6 #include "macros.h"
     6 #include "macros.h"
     7 #include "tile.h"
     7 #include "tile.h"
       
     8 #include "bridge_map.h"
     8 
     9 
     9 /* ground type, m5 bits 2...4
    10 /* ground type, m5 bits 2...4
    10  * valid densities (bits 0...1) in comments after the enum
    11  * valid densities (bits 0...1) in comments after the enum
    11  */
    12  */
    12 typedef enum ClearGround {
    13 typedef enum ClearGround {
   121 }
   122 }
   122 
   123 
   123 
   124 
   124 static inline void MakeClear(TileIndex t, ClearGround g, uint density)
   125 static inline void MakeClear(TileIndex t, ClearGround g, uint density)
   125 {
   126 {
       
   127 	/* If this is a non-bridgeable tile, clear the bridge bits while the rest
       
   128 	 * of the tile information is still here. */
       
   129 	if (!MayHaveBridgeAbove(t)) SB(_m[t].extra, 6, 2, 0);
       
   130 
   126 	SetTileType(t, MP_CLEAR);
   131 	SetTileType(t, MP_CLEAR);
   127 	SetTileOwner(t, OWNER_NONE);
   132 	SetTileOwner(t, OWNER_NONE);
   128 	_m[t].m2 = 0;
   133 	_m[t].m2 = 0;
   129 	_m[t].m3 = 0;
   134 	_m[t].m3 = 0;
   130 	_m[t].m4 = 0 << 5 | 0 << 2;
   135 	_m[t].m4 = 0 << 5 | 0 << 2;
   131 	SetClearGroundDensity(t, g, density);
   136 	SetClearGroundDensity(t, g, density);
       
   137 	SB(_m[t].extra, 2, 4, 0);
   132 }
   138 }
   133 
   139 
   134 
   140 
   135 static inline void MakeField(TileIndex t, uint field_type, uint16 industry)
   141 static inline void MakeField(TileIndex t, uint field_type, uint16 industry)
   136 {
   142 {