Add object shore/flooding support, adjust handling of foundations

Add info to debug window
This commit is contained in:
Jonathan G Rennison
2021-12-05 21:20:58 +00:00
parent d9116106ca
commit 06fa1ae332
8 changed files with 119 additions and 9 deletions

View File

@@ -16,6 +16,7 @@
enum ObjectGround {
OBJECT_GROUND_GRASS = 0, ///< Grass or bare
OBJECT_GROUND_SNOW_DESERT = 1, ///< Snow or desert
OBJECT_GROUND_SHORE = 2, ///< Shore
};
ObjectType GetObjectType(TileIndex t);
@@ -155,6 +156,18 @@ static inline void SetObjectGroundTypeDensity(TileIndex t, ObjectGround type, ui
_m[t].m4 = 0 << 5 | type << 2 | density;
}
static inline bool GetObjectHasNoEffectiveFoundation(TileIndex t)
{
assert_tile(IsTileType(t, MP_OBJECT), t);
return GB(_m[t].m4, 4, 1);
}
static inline void SetObjectHasNoEffectiveFoundation(TileIndex t, bool no_foundation)
{
assert_tile(IsTileType(t, MP_OBJECT), t);
SB(_m[t].m4, 4, 1, no_foundation ? 1 : 0);
}
/**
* Make an Object tile.
* @param t The tile to make and object tile.