Update existing assertions to log tile information where suitable

This commit is contained in:
Jonathan G Rennison
2018-07-26 19:13:35 +01:00
parent 5661763d6a
commit 9e1e074c2b
36 changed files with 243 additions and 243 deletions

View File

@@ -64,7 +64,7 @@ enum IndustryGraphics {
*/
static inline IndustryID GetIndustryIndex(TileIndex t)
{
assert(IsTileType(t, MP_INDUSTRY));
assert_tile(IsTileType(t, MP_INDUSTRY), t);
return _m[t].m2;
}
@@ -76,7 +76,7 @@ static inline IndustryID GetIndustryIndex(TileIndex t)
*/
static inline bool IsIndustryCompleted(TileIndex t)
{
assert(IsTileType(t, MP_INDUSTRY));
assert_tile(IsTileType(t, MP_INDUSTRY), t);
return HasBit(_m[t].m1, 7);
}
@@ -89,7 +89,7 @@ IndustryType GetIndustryType(TileIndex tile);
*/
static inline void SetIndustryCompleted(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
SB(_m[tile].m1, 7, 1, 1);
}
@@ -101,7 +101,7 @@ static inline void SetIndustryCompleted(TileIndex tile)
*/
static inline byte GetIndustryConstructionStage(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
return IsIndustryCompleted(tile) ? (byte)INDUSTRY_COMPLETED : GB(_m[tile].m1, 0, 2);
}
@@ -113,7 +113,7 @@ static inline byte GetIndustryConstructionStage(TileIndex tile)
*/
static inline void SetIndustryConstructionStage(TileIndex tile, byte value)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
SB(_m[tile].m1, 0, 2, value);
}
@@ -126,7 +126,7 @@ static inline void SetIndustryConstructionStage(TileIndex tile, byte value)
*/
static inline IndustryGfx GetCleanIndustryGfx(TileIndex t)
{
assert(IsTileType(t, MP_INDUSTRY));
assert_tile(IsTileType(t, MP_INDUSTRY), t);
return _m[t].m5 | (GB(_me[t].m6, 2, 1) << 8);
}
@@ -138,7 +138,7 @@ static inline IndustryGfx GetCleanIndustryGfx(TileIndex t)
*/
static inline IndustryGfx GetIndustryGfx(TileIndex t)
{
assert(IsTileType(t, MP_INDUSTRY));
assert_tile(IsTileType(t, MP_INDUSTRY), t);
return GetTranslatedIndustryTileID(GetCleanIndustryGfx(t));
}
@@ -150,7 +150,7 @@ static inline IndustryGfx GetIndustryGfx(TileIndex t)
*/
static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx)
{
assert(IsTileType(t, MP_INDUSTRY));
assert_tile(IsTileType(t, MP_INDUSTRY), t);
_m[t].m5 = GB(gfx, 0, 8);
SB(_me[t].m6, 2, 1, GB(gfx, 8, 1));
}
@@ -163,7 +163,7 @@ static inline void SetIndustryGfx(TileIndex t, IndustryGfx gfx)
*/
static inline byte GetIndustryConstructionCounter(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
return GB(_m[tile].m1, 2, 2);
}
@@ -175,7 +175,7 @@ static inline byte GetIndustryConstructionCounter(TileIndex tile)
*/
static inline void SetIndustryConstructionCounter(TileIndex tile, byte value)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
SB(_m[tile].m1, 2, 2, value);
}
@@ -188,7 +188,7 @@ static inline void SetIndustryConstructionCounter(TileIndex tile, byte value)
*/
static inline void ResetIndustryConstructionStage(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
SB(_m[tile].m1, 0, 4, 0);
SB(_m[tile].m1, 7, 1, 0);
}
@@ -200,7 +200,7 @@ static inline void ResetIndustryConstructionStage(TileIndex tile)
*/
static inline byte GetIndustryAnimationLoop(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
return _m[tile].m4;
}
@@ -212,7 +212,7 @@ static inline byte GetIndustryAnimationLoop(TileIndex tile)
*/
static inline void SetIndustryAnimationLoop(TileIndex tile, byte count)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
_m[tile].m4 = count;
}
@@ -225,7 +225,7 @@ static inline void SetIndustryAnimationLoop(TileIndex tile, byte count)
*/
static inline byte GetIndustryRandomBits(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
return _m[tile].m3;
}
@@ -238,7 +238,7 @@ static inline byte GetIndustryRandomBits(TileIndex tile)
*/
static inline void SetIndustryRandomBits(TileIndex tile, byte bits)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
_m[tile].m3 = bits;
}
@@ -251,7 +251,7 @@ static inline void SetIndustryRandomBits(TileIndex tile, byte bits)
*/
static inline byte GetIndustryTriggers(TileIndex tile)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
return GB(_me[tile].m6, 3, 3);
}
@@ -265,7 +265,7 @@ static inline byte GetIndustryTriggers(TileIndex tile)
*/
static inline void SetIndustryTriggers(TileIndex tile, byte triggers)
{
assert(IsTileType(tile, MP_INDUSTRY));
assert_tile(IsTileType(tile, MP_INDUSTRY), tile);
SB(_me[tile].m6, 3, 3, triggers);
}