From f9dee5aaa0a557987eeef41690a2a88536f4902b Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Tue, 12 Jan 2021 20:32:17 +0000 Subject: Feature: Show rainforest under vegetation on small map --- src/gfx_func.h | 1 + src/lang/english.txt | 1 + src/smallmap_gui.cpp | 13 +++++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gfx_func.h b/src/gfx_func.h index 0edbf722a..7ac26f29b 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -227,6 +227,7 @@ static const uint8 PC_LIGHT_BLUE = 0x98; ///< Light blue palet static const uint8 PC_ROUGH_LAND = 0x52; ///< Dark green palette colour for rough land. static const uint8 PC_GRASS_LAND = 0x54; ///< Dark green palette colour for grass land. static const uint8 PC_BARE_LAND = 0x37; ///< Brown palette colour for bare land. +static const uint8 PC_RAINFOREST = 0x5C; ///< Pale green palette colour for rainforest. static const uint8 PC_FIELDS = 0x25; ///< Light brown palette colour for fields. static const uint8 PC_TREES = 0x57; ///< Green palette colour for trees. static const uint8 PC_WATER = 0xC9; ///< Dark blue palette colour for water. diff --git a/src/lang/english.txt b/src/lang/english.txt index 8ec1250b8..dc184aa31 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -747,6 +747,7 @@ STR_SMALLMAP_LEGENDA_DOCK :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_ROUGH_LAND :{TINY_FONT}{BLACK}Rough Land STR_SMALLMAP_LEGENDA_GRASS_LAND :{TINY_FONT}{BLACK}Grass Land STR_SMALLMAP_LEGENDA_BARE_LAND :{TINY_FONT}{BLACK}Bare Land +STR_SMALLMAP_LEGENDA_RAINFOREST :{TINY_FONT}{BLACK}Rainforest STR_SMALLMAP_LEGENDA_FIELDS :{TINY_FONT}{BLACK}Fields STR_SMALLMAP_LEGENDA_TREES :{TINY_FONT}{BLACK}Trees STR_SMALLMAP_LEGENDA_ROCKS :{TINY_FONT}{BLACK}Rocks diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 8ece48d93..ef1638d2f 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -115,11 +115,12 @@ static const LegendAndColour _legend_vegetation[] = { MK(PC_ROUGH_LAND, STR_SMALLMAP_LEGENDA_ROUGH_LAND), MK(PC_GRASS_LAND, STR_SMALLMAP_LEGENDA_GRASS_LAND), MK(PC_BARE_LAND, STR_SMALLMAP_LEGENDA_BARE_LAND), + MK(PC_RAINFOREST, STR_SMALLMAP_LEGENDA_RAINFOREST), MK(PC_FIELDS, STR_SMALLMAP_LEGENDA_FIELDS), MK(PC_TREES, STR_SMALLMAP_LEGENDA_TREES), - MK(PC_GREEN, STR_SMALLMAP_LEGENDA_FOREST), - MS(PC_GREY, STR_SMALLMAP_LEGENDA_ROCKS), + MS(PC_GREEN, STR_SMALLMAP_LEGENDA_FOREST), + MK(PC_GREY, STR_SMALLMAP_LEGENDA_ROCKS), MK(PC_ORANGE, STR_SMALLMAP_LEGENDA_DESERT), MK(PC_LIGHT_BLUE, STR_SMALLMAP_LEGENDA_SNOW), MK(PC_BLACK, STR_SMALLMAP_LEGENDA_TRANSPORT_ROUTES), @@ -531,7 +532,11 @@ static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t) { switch (t) { case MP_CLEAR: - return (IsClearGround(tile, CLEAR_GRASS) && GetClearDensity(tile) < 3) ? MKCOLOUR_XXXX(PC_BARE_LAND) : _vegetation_clear_bits[GetClearGround(tile)]; + if (IsClearGround(tile, CLEAR_GRASS)) { + if (GetClearDensity(tile) < 3) return MKCOLOUR_XXXX(PC_BARE_LAND); + if (GetTropicZone(tile) == TROPICZONE_RAINFOREST) return MKCOLOUR_XXXX(PC_RAINFOREST); + } + return _vegetation_clear_bits[GetClearGround(tile)]; case MP_INDUSTRY: return IsTileForestIndustry(tile) ? MKCOLOUR_XXXX(PC_GREEN) : MKCOLOUR_XXXX(PC_DARK_RED); @@ -540,7 +545,7 @@ static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t) if (GetTreeGround(tile) == TREE_GROUND_SNOW_DESERT || GetTreeGround(tile) == TREE_GROUND_ROUGH_SNOW) { return (_settings_game.game_creation.landscape == LT_ARCTIC) ? MKCOLOUR_XYYX(PC_LIGHT_BLUE, PC_TREES) : MKCOLOUR_XYYX(PC_ORANGE, PC_TREES); } - return MKCOLOUR_XYYX(PC_GRASS_LAND, PC_TREES); + return (GetTropicZone(tile) == TROPICZONE_RAINFOREST) ? MKCOLOUR_XYYX(PC_RAINFOREST, PC_TREES) : MKCOLOUR_XYYX(PC_GRASS_LAND, PC_TREES); default: return ApplyMask(MKCOLOUR_XXXX(PC_GRASS_LAND), &_smallmap_vehicles_andor[t]); -- cgit v1.2.3-70-g09d2