From f763b5d5e0759b8a1716c46755c0c42dd5af333b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 19 Jan 2019 04:28:06 +0000 Subject: [PATCH] Remove some assertions on tile accessors in non-debug builds --- src/tile_map.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tile_map.h b/src/tile_map.h index 19fda350fc..d6ee5b94bd 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -30,7 +30,10 @@ */ static inline uint TileHeight(TileIndex tile) { + /* this method is inlined in many places and is performance-critical, drop assertion in non-debug builds */ +#ifdef _DEBUG assert_msg(tile < MapSize(), "tile: 0x%X, size: 0x%X", tile, MapSize()); +#endif return _m[tile].height; } @@ -88,7 +91,10 @@ static inline uint TilePixelHeightOutsideMap(int x, int y) */ static inline TileType GetTileType(TileIndex tile) { + /* this method is inlined in many places and is performance-critical, drop assertion in non-debug builds */ +#ifdef _DEBUG assert_msg(tile < MapSize(), "tile: 0x%X, size: 0x%X", tile, MapSize()); +#endif return (TileType)GB(_m[tile].type, 4, 4); }