diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp index fafcd014f6..3745bb616c 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -676,7 +676,7 @@ static void DrawTile_Trees(TileInfo *ti) uint trees = GetTreeCount(ti->tile); for (uint i = 0; i < trees; i++) { - SpriteID sprite = s[0].sprite + (i == trees - 1 ? static_cast(GetTreeGrowth(ti->tile)) : 3); + SpriteID sprite = s[0].sprite + (i == trees - 1 ? to_underlying(GetTreeGrowth(ti->tile)) : 3); PaletteID pal = s[0].pal; te[i].sprite = sprite; diff --git a/src/tree_map.h b/src/tree_map.h index 0cabe6a8eb..782656876b 100644 --- a/src/tree_map.h +++ b/src/tree_map.h @@ -226,7 +226,7 @@ inline void AddTreeGrowth(Tile t, int a) inline void SetTreeGrowth(Tile t, TreeGrowthStage g) { assert(IsTileType(t, MP_TREES)); // XXX incomplete - SB(t.m5(), 0, 3, static_cast(g)); + SB(t.m5(), 0, 3, to_underlying(g)); } /** @@ -249,7 +249,7 @@ inline void MakeTree(Tile t, TreeType type, uint count, TreeGrowthStage growth, t.m2() = ground << 6 | density << 4 | 0; t.m3() = type; t.m4() = 0 << 5 | 0 << 2; - t.m5() = count << 6 | static_cast(growth); + t.m5() = count << 6 | to_underlying(growth); SB(t.m6(), 2, 6, 0); t.m7() = 0; t.m8() = 0;