Index: src/smallmap_gui.cpp =================================================================== --- src/smallmap_gui.cpp (revision 19760) +++ src/smallmap_gui.cpp (working copy) @@ -63,6 +63,9 @@ /** Macro for break marker in arrays of LegendAndColour. * It will have valid data, though */ #define MS(a, b) {a, b, INVALID_INDUSTRYTYPE, true, false, true} +/** Macro for break marker in arrays of LegendAndColour with configurable colour. + * It will have valid data, though. */ +#define MCS(b) {0, b, INVALID_INDUSTRYTYPE, true, false, true} /** Structure for holding relevant data for legends in small map */ struct LegendAndColour { @@ -81,7 +84,11 @@ MC(STR_TINY_BLACK_HEIGHT), MC(STR_TINY_BLACK_HEIGHT), MC(STR_TINY_BLACK_HEIGHT), + + MCS(STR_TINY_BLACK_HEIGHT), MC(STR_TINY_BLACK_HEIGHT), + MC(STR_TINY_BLACK_HEIGHT), + MC(STR_TINY_BLACK_HEIGHT), MS(0xD7, STR_SMALLMAP_LEGENDA_ROADS), MK(0x0A, STR_SMALLMAP_LEGENDA_RAILROADS), @@ -141,6 +148,7 @@ #undef MK #undef MC #undef MS +#undef MCS #undef MKEND /** Allow room for all industries, plus a terminator entry @@ -272,10 +280,13 @@ void BuildLandLegend() { _legend_land_contours[0].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[0]; - _legend_land_contours[1].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[4]; - _legend_land_contours[2].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[8]; - _legend_land_contours[3].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[12]; - _legend_land_contours[4].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[14]; + _legend_land_contours[1].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[2]; + _legend_land_contours[2].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[4]; + _legend_land_contours[3].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[6]; + _legend_land_contours[4].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[8]; + _legend_land_contours[5].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[10]; + _legend_land_contours[6].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[12]; + _legend_land_contours[7].colour = _heightmap_schemes[_settings_client.gui.smallmap_land_colour].height_colours[14]; } struct AndOr { @@ -1104,7 +1115,7 @@ } } else { if (this->map_type == SMT_CONTOUR) { - SetDParam(0, (tbl - _legend_table[this->map_type] + 1) * 100); + SetDParam(0, (tbl - _legend_table[this->map_type]) * _minimap_height_step * 2); } /* Anything that is not an industry is using normal process */ GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, 0); Index: src/landscape.h =================================================================== --- src/landscape.h (revision 19760) +++ src/landscape.h (working copy) @@ -95,4 +95,11 @@ void InitializeLandscape(); void GenerateLandscape(byte mode); +/** + * Used for building up the smallmap height legend entries + * and for displaying the height difference in the tooltips in the viewports. + * @return _minimap_height_step the height in meters of one heightlevel. + */ +static const int _minimap_height_step = 25; ///< 1 minimap legend heightstep is 1 heightlevel. + #endif /* LANDSCAPE_H */ Index: src/viewport.cpp =================================================================== --- src/viewport.cpp (revision 19760) +++ src/viewport.cpp (working copy) @@ -2170,7 +2170,7 @@ } /** Calculates height difference between one tile and another - * Multiplies the result to suit the standard given by minimap - 50 meters high + * Multiplies the result to suit the standard given by minimap - _minimap_height_step meters high * To correctly get the height difference we need the direction we are dragging * in, as well as with what kind of tool we are dragging. For example a horizontal * autorail tool that starts in bottom and ends at the top of a tile will need the @@ -2251,8 +2251,8 @@ } if (swap) Swap(h0, h1); - /* Minimap shows height in intervals of 50 meters, let's do the same */ - return (int)(h1 - h0) * 50; + /* Minimap shows height in intervals of _minimap_height_step meters for each step, let's do the same. */ + return (int)(h1 - h0) * _minimap_height_step; } static const StringID measure_strings_length[] = {STR_NULL, STR_MEASURE_LENGTH, STR_MEASURE_LENGTH_HEIGHTDIFF};