Changeset - r14473:12cc27fac236
[Not reviewed]
master
0 1 0
alberth - 14 years ago 2010-02-07 11:58:35
alberth@openttd.org
(svn r19052) -Codechange: Remove the _smallmap_draw_procs array.
1 file changed with 26 insertions and 27 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -209,104 +209,96 @@ static const uint32 _map_height_bits[] =
 
	MKCOLOUR(0x27272727),
 
	MKCOLOUR(0x27272727),
 
};
 
assert_compile(lengthof(_map_height_bits) == MAX_TILE_HEIGHT + 1);
 

	
 
struct AndOr {
 
	uint32 mor;
 
	uint32 mand;
 
};
 

	
 
static inline uint32 ApplyMask(uint32 colour, const AndOr *mask)
 
{
 
	return (colour & mask->mand) | mask->mor;
 
}
 

	
 

	
 
/** Colour masks for "Contour" and "Routes" modes. */
 
static const AndOr _smallmap_contours_andor[] = {
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_CLEAR
 
	{MKCOLOUR(0x000A0A00), MKCOLOUR(0xFF0000FF)}, // MP_RAILWAY
 
	{MKCOLOUR(0x00D7D700), MKCOLOUR(0xFF0000FF)}, // MP_ROAD
 
	{MKCOLOUR(0x00B5B500), MKCOLOUR(0xFF0000FF)}, // MP_HOUSE
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_TREES
 
	{MKCOLOUR(0x98989898), MKCOLOUR(0x00000000)}, // MP_STATION
 
	{MKCOLOUR(0xCACACACA), MKCOLOUR(0x00000000)}, // MP_WATER
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_VOID
 
	{MKCOLOUR(0xB5B5B5B5), MKCOLOUR(0x00000000)}, // MP_INDUSTRY
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_TUNNELBRIDGE
 
	{MKCOLOUR(0x00B5B500), MKCOLOUR(0xFF0000FF)}, // MP_UNMOVABLE
 
	{MKCOLOUR(0x000A0A00), MKCOLOUR(0xFF0000FF)},
 
};
 

	
 
/** Colour masks for "Vehicles", "Industry", and "Vegetation" modes. */
 
static const AndOr _smallmap_vehicles_andor[] = {
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_CLEAR
 
	{MKCOLOUR(0x00D7D700), MKCOLOUR(0xFF0000FF)}, // MP_RAILWAY
 
	{MKCOLOUR(0x00D7D700), MKCOLOUR(0xFF0000FF)}, // MP_ROAD
 
	{MKCOLOUR(0x00B5B500), MKCOLOUR(0xFF0000FF)}, // MP_HOUSE
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_TREES
 
	{MKCOLOUR(0x00D7D700), MKCOLOUR(0xFF0000FF)}, // MP_STATION
 
	{MKCOLOUR(0xCACACACA), MKCOLOUR(0x00000000)}, // MP_WATER
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_VOID
 
	{MKCOLOUR(0xB5B5B5B5), MKCOLOUR(0x00000000)}, // MP_INDUSTRY
 
	{MKCOLOUR(0x00000000), MKCOLOUR(0xFFFFFFFF)}, // MP_TUNNELBRIDGE
 
	{MKCOLOUR(0x00B5B500), MKCOLOUR(0xFF0000FF)}, // MP_UNMOVABLE
 
	{MKCOLOUR(0x00D7D700), MKCOLOUR(0xFF0000FF)},
 
};
 

	
 
/**
 
 * Function signature of the function to retrieve the colour data of a tile for display at the smallmap.
 
 * @param tile Tile that gets displayed.
 
 * @param t    Effective tile type of the tile (see #GetEffectiveTileType).
 
 * @return Colour data to display.
 
 */
 
typedef uint32 GetSmallMapPixels(TileIndex tile, TileType t);
 

	
 
/** Mapping of tile type to importance of the tile (higher number means more interesting to show). */
 
static const byte _tiletype_importance[] = {
 
	2, // MP_CLEAR
 
	8, // MP_RAILWAY
 
	7, // MP_ROAD
 
	5, // MP_HOUSE
 
	2, // MP_TREES
 
	9, // MP_STATION
 
	2, // MP_WATER
 
	1, // MP_VOID
 
	6, // MP_INDUSTRY
 
	8, // MP_TUNNELBRIDGE
 
	2, // MP_UNMOVABLE
 
	0,
 
};
 

	
 

	
 
static inline TileType GetEffectiveTileType(TileIndex tile)
 
{
 
	TileType t = GetTileType(tile);
 

	
 
	if (t == MP_TUNNELBRIDGE) {
 
		TransportType tt = GetTunnelBridgeTransportType(tile);
 

	
 
		switch (tt) {
 
			case TRANSPORT_RAIL: t = MP_RAILWAY; break;
 
			case TRANSPORT_ROAD: t = MP_ROAD;    break;
 
			default:             t = MP_WATER;   break;
 
		}
 
	}
 
	return t;
 
}
 

	
 
/**
 
 * Return the colour a tile would be displayed with in the small map in mode "Contour".
 
 * @param tile The tile of which we would like to get the colour.
 
 * @param t    Effective tile type of the tile (see #GetEffectiveTileType).
 
 * @return The colour of tile in the small map in mode "Contour"
 
 */
 
static inline uint32 GetSmallMapContoursPixels(TileIndex tile, TileType t)
 
{
 
	return ApplyMask(_map_height_bits[TileHeight(tile)], &_smallmap_contours_andor[t]);
 
}
 

	
 
/**
 
 * Return the colour a tile would be displayed with in the small map in mode "Vehicles".
 
 *
 
 * @param tile The tile of which we would like to get the colour.
 
@@ -385,108 +377,96 @@ static const uint32 _vegetation_clear_bi
 
 */
 
static inline uint32 GetSmallMapVegetationPixels(TileIndex tile, TileType t)
 
{
 
	switch (t) {
 
		case MP_CLEAR:
 
			return (IsClearGround(tile, CLEAR_GRASS) && GetClearDensity(tile) < 3) ? MKCOLOUR(0x37373737) : _vegetation_clear_bits[GetClearGround(tile)];
 

	
 
		case MP_INDUSTRY:
 
			return GetIndustrySpec(Industry::GetByTile(tile)->type)->check_proc == CHECK_FOREST ? MKCOLOUR(0xD0D0D0D0) : MKCOLOUR(0xB5B5B5B5);
 

	
 
		case MP_TREES:
 
			if (GetTreeGround(tile) == TREE_GROUND_SNOW_DESERT || GetTreeGround(tile) == TREE_GROUND_ROUGH_SNOW) {
 
				return (_settings_game.game_creation.landscape == LT_ARCTIC) ? MKCOLOUR(0x98575798) : MKCOLOUR(0xC25757C2);
 
			}
 
			return MKCOLOUR(0x54575754);
 

	
 
		default:
 
			return ApplyMask(MKCOLOUR(0x54545454), &_smallmap_vehicles_andor[t]);
 
	}
 
}
 

	
 

	
 
static uint32 _owner_colours[OWNER_END + 1];
 

	
 
/**
 
 * Return the colour a tile would be displayed with in the small map in mode "Owner".
 
 *
 
 * @param tile The tile of which we would like to get the colour.
 
 * @param t    Effective tile type of the tile (see #GetEffectiveTileType).
 
 * @return The colour of tile in the small map in mode "Owner"
 
 */
 
static inline uint32 GetSmallMapOwnerPixels(TileIndex tile, TileType t)
 
{
 
	Owner o;
 

	
 
	switch (t) {
 
		case MP_INDUSTRY: o = OWNER_END;          break;
 
		case MP_HOUSE:    o = OWNER_TOWN;         break;
 
		default:          o = GetTileOwner(tile); break;
 
		/* FIXME: For MP_ROAD there are multiple owners.
 
		 * GetTileOwner returns the rail owner (level crossing) resp. the owner of ROADTYPE_ROAD (normal road),
 
		 * even if there are no ROADTYPE_ROAD bits on the tile.
 
		 */
 
	}
 

	
 
	return _owner_colours[o];
 
}
 

	
 
/* Each tile has 4 x pixels and 1 y pixel */
 

	
 
/** Holds function pointers to determine tile colour in the smallmap for each smallmap mode. */
 
static GetSmallMapPixels * const _smallmap_draw_procs[] = {
 
	GetSmallMapContoursPixels,
 
	GetSmallMapVehiclesPixels,
 
	GetSmallMapIndustriesPixels,
 
	GetSmallMapRoutesPixels,
 
	GetSmallMapVegetationPixels,
 
	GetSmallMapOwnerPixels,
 
};
 

	
 
/** Vehicle colours in #SMT_VEHICLES mode. Indexed by #VehicleTypeByte. */
 
static const byte _vehicle_type_colours[6] = {
 
	184, 191, 152, 15, 215, 184
 
};
 

	
 

	
 
/** Class managing the smallmap window. */
 
class SmallMapWindow : public Window {
 
	/** Types of legends in the #SM_WIDGET_LEGEND widget. */
 
	enum SmallMapType {
 
		SMT_CONTOUR,
 
		SMT_VEHICLES,
 
		SMT_INDUSTRY,
 
		SMT_ROUTES,
 
		SMT_VEGETATION,
 
		SMT_OWNER,
 
	};
 

	
 
	/** Available kinds of zoomlevel changes. */
 
	enum ZoomLevelChange {
 
		ZLC_INITIALIZE, ///< Initialize zoom level.
 
		ZLC_ZOOM_OUT,   ///< Zoom out.
 
		ZLC_ZOOM_IN,    ///< Zoom in.
 
	};
 

	
 
	static SmallMapType map_type; ///< Currently displayed legends.
 
	static bool show_towns;       ///< Display town names in the smallmap.
 

	
 
	static const uint LEGEND_BLOB_WIDTH = 8;              ///< Width of the coloured blob in front of a line text in the #SM_WIDGET_LEGEND widget.
 
	static const uint INDUSTRY_MIN_NUMBER_OF_COLUMNS = 2; ///< Minimal number of columns in the #SM_WIDGET_LEGEND widget for the #SMT_INDUSTRY legend.
 
	uint min_number_of_columns;    ///< Minimal number of columns in  legends.
 
	uint min_number_of_fixed_rows; ///< Minimal number of rows in the legends for the fixed layouts only (all except #SMT_INDUSTRY).
 
	uint column_width;             ///< Width of a column in the #SM_WIDGET_LEGEND widget.
 

	
 
	int32 scroll_x;  ///< Horizontal world coordinate of the base tile left of the top-left corner of the smallmap display.
 
	int32 scroll_y;  ///< Vertical world coordinate of the base tile left of the top-left corner of the smallmap display.
 
	int32 subscroll; ///< Number of pixels (0..3) between the right end of the base tile and the pixel at the top-left corner of the smallmap display.
 
	int zoom;        ///< Zoom level. Bigger number means more zoom-out (further away).
 

	
 
	static const uint8 FORCE_REFRESH_PERIOD = 0x1F; ///< map is redrawn after that many ticks
 
	uint8 refresh; ///< refresh counter, zeroed every FORCE_REFRESH_PERIOD ticks
 

	
 
	/**
 
	 * Remap tile to location on this smallmap.
 
	 * @param tile_x X coordinate of the tile.
 
	 * @param tile_y Y coordinate of the tile.
 
	 * @return Position to draw on.
 
	 */
 
@@ -540,156 +520,175 @@ class SmallMapWindow : public Window {
 
	 * @param change  Way to change the zoom level.
 
	 * @param zoom_pt Position to keep fixed while zooming.
 
	 * @pre \c *zoom_pt should contain a point in the smallmap display when zooming in or out.
 
	 */
 
	void SetZoomLevel(ZoomLevelChange change, const Point *zoom_pt)
 
	{
 
		static const int zoomlevels[] = {1, 2, 4, 6, 8}; // Available zoom levels. Bigger number means more zoom-out (further away).
 
		static const int MIN_ZOOM_INDEX = 0;
 
		static const int MAX_ZOOM_INDEX = lengthof(zoomlevels) - 1;
 

	
 
		int new_index, cur_index, sub;
 
		Point tile;
 
		switch (change) {
 
			case ZLC_INITIALIZE:
 
				cur_index = - 1; // Definitely different from new_index.
 
				new_index = MIN_ZOOM_INDEX;
 
				break;
 

	
 
			case ZLC_ZOOM_IN:
 
			case ZLC_ZOOM_OUT:
 
				for (cur_index = MIN_ZOOM_INDEX; cur_index <= MAX_ZOOM_INDEX; cur_index++) {
 
					if (this->zoom == zoomlevels[cur_index]) break;
 
				}
 
				assert(cur_index <= MAX_ZOOM_INDEX);
 

	
 
				tile = this->PixelToTile(zoom_pt->x, zoom_pt->y, &sub);
 
				new_index = Clamp(cur_index + ((change == ZLC_ZOOM_IN) ? -1 : 1), MIN_ZOOM_INDEX, MAX_ZOOM_INDEX);
 
				break;
 

	
 
			default: NOT_REACHED();
 
		}
 

	
 
		if (new_index != cur_index) {
 
			this->zoom = zoomlevels[new_index];
 
			if (cur_index >= 0) {
 
				Point new_tile = this->PixelToTile(zoom_pt->x, zoom_pt->y, &sub);
 
				this->SetNewScroll(this->scroll_x + (tile.x - new_tile.x) * TILE_SIZE,
 
						this->scroll_y + (tile.y - new_tile.y) * TILE_SIZE, sub);
 
			}
 
			this->SetWidgetDisabledState(SM_WIDGET_ZOOM_IN,  this->zoom == zoomlevels[MIN_ZOOM_INDEX]);
 
			this->SetWidgetDisabledState(SM_WIDGET_ZOOM_OUT, this->zoom == zoomlevels[MAX_ZOOM_INDEX]);
 
			this->SetDirty();
 
		}
 
	}
 

	
 
	/**
 
	 * Decide which colours to show to the user for a group of tiles.
 
	 * @param ta   Tile area to investigate.
 
	 * @param proc Pointer to the colour function.
 
	 * @return Colours to display.
 
	 */
 
	inline uint32 GetTileColours(const TileArea &ta, GetSmallMapPixels *proc) const
 
	inline uint32 GetTileColours(const TileArea &ta) const
 
	{
 
		int importance = 0;
 
		TileIndex tile = INVALID_TILE; // Position of the most important tile.
 
		TileType et = MP_VOID;         // Effective tile type at that position.
 

	
 
		TILE_AREA_LOOP(ti, ta) {
 
			TileType ttype = GetEffectiveTileType(ti);
 
			if (_tiletype_importance[ttype] > importance) {
 
				importance = _tiletype_importance[ttype];
 
				tile = ti;
 
				et = ttype;
 
			}
 
		}
 
		return proc(tile, et);
 

	
 
		switch (this->map_type) {
 
			case SMT_CONTOUR:
 
				return GetSmallMapContoursPixels(tile, et);
 

	
 
			case SMT_VEHICLES:
 
				return GetSmallMapVehiclesPixels(tile, et);
 

	
 
			case SMT_INDUSTRY:
 
				return GetSmallMapIndustriesPixels(tile, et);
 

	
 
			case SMT_ROUTES:
 
				return GetSmallMapRoutesPixels(tile, et);
 

	
 
			case SMT_VEGETATION:
 
				return GetSmallMapVegetationPixels(tile, et);
 

	
 
			case SMT_OWNER:
 
				return GetSmallMapOwnerPixels(tile, et);
 

	
 
			default: NOT_REACHED();
 
		}
 
	}
 

	
 
	/**
 
	 * Draws one column of tiles of the small map in a certain mode onto the screen buffer, skipping the shifted rows in between.
 
	 *
 
	 * @param dst Pointer to a part of the screen buffer to write to.
 
	 * @param xc The X coordinate of the first tile in the column.
 
	 * @param yc The Y coordinate of the first tile in the column
 
	 * @param pitch Number of pixels to advance in the screen buffer each time a pixel is written.
 
	 * @param reps Number of lines to draw
 
	 * @param start_pos Position of first pixel to draw.
 
	 * @param end_pos Position of last pixel to draw (exclusive).
 
	 * @param blitter current blitter
 
	 * @param proc Pointer to the colour function
 
	 * @note If pixel position is below \c 0, skip drawing.
 
	 * @see GetSmallMapPixels(TileIndex)
 
	 */
 
	void DrawSmallMapColumn(void *dst, uint xc, uint yc, int pitch, int reps, int start_pos, int end_pos, Blitter *blitter, GetSmallMapPixels *proc) const
 
	void DrawSmallMapColumn(void *dst, uint xc, uint yc, int pitch, int reps, int start_pos, int end_pos, Blitter *blitter) const
 
	{
 
		void *dst_ptr_abs_end = blitter->MoveTo(_screen.dst_ptr, 0, _screen.height);
 
		uint min_xy = _settings_game.construction.freeform_edges ? 1 : 0;
 

	
 
		do {
 
			/* Check if the tile (xc,yc) is within the map range */
 
			if (xc >= MapMaxX() || yc >= MapMaxY()) continue;
 

	
 
			/* Check if the dst pointer points to a pixel inside the screen buffer */
 
			if (dst < _screen.dst_ptr) continue;
 
			if (dst >= dst_ptr_abs_end) continue;
 

	
 
			/* Construct tilearea covered by (xc, yc, xc + this->zoom, yc + this->zoom) such that it is within min_xy limits. */
 
			TileArea ta;
 
			if (min_xy == 1 && (xc == 0 || yc == 0)) {
 
				if (this->zoom == 1) continue; // The tile area is empty, don't draw anything.
 

	
 
				ta = TileArea(TileXY(max(min_xy, xc), max(min_xy, yc)), this->zoom - (xc == 0), this->zoom - (yc == 0));
 
			} else {
 
				ta = TileArea(TileXY(xc, yc), this->zoom, this->zoom);
 
			}
 
			ta.ClampToMap(); // Clamp to map boundaries (may contain MP_VOID tiles!).
 

	
 
			uint32 val = this->GetTileColours(ta, proc);
 
			uint32 val = this->GetTileColours(ta);
 
			uint8 *val8 = (uint8 *)&val;
 
			int idx = max(0, -start_pos);
 
			for (int pos = max(0, start_pos); pos < end_pos; pos++) {
 
				blitter->SetPixel(dst, idx, 0, val8[idx]);
 
				idx++;
 
			}
 
		/* Switch to next tile in the column */
 
		} while (xc += this->zoom, yc += this->zoom, dst = blitter->MoveTo(dst, pitch, 0), --reps != 0);
 
	}
 

	
 
	/**
 
	 * Adds vehicles to the smallmap.
 
	 * @param dpi the part of the smallmap to be drawn into
 
	 * @param blitter current blitter
 
	 */
 
	void DrawVehicles(const DrawPixelInfo *dpi, Blitter *blitter) const
 
	{
 
		const Vehicle *v;
 
		FOR_ALL_VEHICLES(v) {
 
			if (v->type == VEH_EFFECT) continue;
 
			if (v->vehstatus & (VS_HIDDEN | VS_UNCLICKABLE)) continue;
 

	
 
			/* Remap into flat coordinates. */
 
			Point pt = this->RemapTile(v->x_pos / TILE_SIZE, v->y_pos / TILE_SIZE);
 

	
 
			int y = pt.y - dpi->top;
 
			if (!IsInsideMM(y, 0, dpi->height)) continue; // y is out of bounds.
 

	
 
			bool skip = false; // Default is to draw both pixels.
 
			int x = pt.x - this->subscroll - 3 - dpi->left; // Offset X coordinate.
 
			if (x < 0) {
 
				/* if x+1 is 0, that means we're on the very left edge,
 
				 * and should thus only draw a single pixel */
 
				if (++x != 0) continue;
 
				skip = true;
 
			} else if (x >= dpi->width - 1) {
 
				/* Check if we're at the very right edge, and if so draw only a single pixel */
 
				if (x != dpi->width - 1) continue;
 
				skip = true;
 
			}
 

	
 
			/* Calculate pointer to pixel and the colour */
 
			byte colour = (this->map_type == SMT_VEHICLES) ? _vehicle_type_colours[v->type] : 0xF;
 

	
 
			/* And draw either one or two pixels depending on clipping */
 
			blitter->SetPixel(dpi->dst_ptr, x, y, colour);
 
			if (!skip) blitter->SetPixel(dpi->dst_ptr, x + 1, y, colour);
 
		}
 
@@ -778,97 +777,97 @@ class SmallMapWindow : public Window {
 
	 *
 
	 * @param dpi pointer to pixel to write onto
 
	 */
 
	void DrawSmallMap(DrawPixelInfo *dpi) const
 
	{
 
		Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
 
		DrawPixelInfo *old_dpi;
 

	
 
		old_dpi = _cur_dpi;
 
		_cur_dpi = dpi;
 

	
 
		/* Clear it */
 
		GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, 0);
 

	
 
		/* Setup owner table */
 
		if (this->map_type == SMT_OWNER) {
 
			const Company *c;
 

	
 
			/* Fill with some special colours */
 
			_owner_colours[OWNER_TOWN]  = MKCOLOUR(0xB4B4B4B4);
 
			_owner_colours[OWNER_NONE]  = MKCOLOUR(0x54545454);
 
			_owner_colours[OWNER_WATER] = MKCOLOUR(0xCACACACA);
 
			_owner_colours[OWNER_END]   = MKCOLOUR(0x20202020); // Industry
 

	
 
			/* Now fill with the company colours */
 
			FOR_ALL_COMPANIES(c) {
 
				_owner_colours[c->index] = _colour_gradient[c->colour][5] * 0x01010101;
 
			}
 
		}
 

	
 
		/* Which tile is displayed at (dpi->left, dpi->top)? */
 
		int dx;
 
		Point tile = this->PixelToTile(dpi->left, dpi->top, &dx);
 
		int tile_x = this->scroll_x / TILE_SIZE + tile.x;
 
		int tile_y = this->scroll_y / TILE_SIZE + tile.y;
 

	
 
		void *ptr = blitter->MoveTo(dpi->dst_ptr, -dx - 4, 0);
 
		int x = - dx - 4;
 
		int y = 0;
 

	
 
		for (;;) {
 
			/* Distance from left edge */
 
			if (x >= -3) {
 
				if (x >= dpi->width) break; // Exit the loop.
 

	
 
				int end_pos = min(dpi->width, x + 4);
 
				int reps = (dpi->height - y + 1) / 2; // Number of lines.
 
				if (reps > 0) {
 
					this->DrawSmallMapColumn(ptr, tile_x, tile_y, dpi->pitch * 2, reps, x, end_pos, blitter, _smallmap_draw_procs[this->map_type]);
 
					this->DrawSmallMapColumn(ptr, tile_x, tile_y, dpi->pitch * 2, reps, x, end_pos, blitter);
 
				}
 
			}
 

	
 
			if (y == 0) {
 
				tile_y += this->zoom;
 
				y++;
 
				ptr = blitter->MoveTo(ptr, 0, 1);
 
			} else {
 
				tile_x -= this->zoom;
 
				y--;
 
				ptr = blitter->MoveTo(ptr, 0, -1);
 
			}
 
			ptr = blitter->MoveTo(ptr, 2, 0);
 
			x += 2;
 
		}
 

	
 
		/* Draw vehicles */
 
		if (this->map_type == SMT_CONTOUR || this->map_type == SMT_VEHICLES) this->DrawVehicles(dpi, blitter);
 

	
 
		/* Draw town names */
 
		if (this->show_towns) this->DrawTowns(dpi);
 

	
 
		/* Draw map indicators */
 
		this->DrawMapIndicators();
 

	
 
		_cur_dpi = old_dpi;
 
	}
 

	
 
public:
 
	SmallMapWindow(const WindowDesc *desc, int window_number) : Window(), refresh(FORCE_REFRESH_PERIOD)
 
	{
 
		this->InitNested(desc, window_number);
 
		this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
 

	
 
		_smallmap_industry_show_heightmap = false;
 
		this->SetWidgetLoweredState(SM_WIDGET_SHOW_HEIGHT, _smallmap_industry_show_heightmap);
 

	
 
		this->SetWidgetLoweredState(SM_WIDGET_TOGGLETOWNNAME, this->show_towns);
 
		this->GetWidget<NWidgetStacked>(SM_WIDGET_SELECTINDUSTRIES)->SetDisplayedPlane(this->map_type != SMT_INDUSTRY);
 

	
 
		this->SetZoomLevel(ZLC_INITIALIZE, NULL);
 
		this->SmallMapCenterOnCurrentPos();
 
	}
 

	
 
	/** Compute maximal required height of the legends.
 
	 * @return Maximally needed height for displaying the smallmap legends in pixels.
 
	 */
 
	inline uint GetMaxLegendHeight() const
0 comments (0 inline, 0 general)