Changeset - r22414:34aae40869eb
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-07-22 21:38:49
frosch@openttd.org
(svn r27621) -Fix (r27620): Committed too early.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -717,53 +717,53 @@ void SmallMapWindow::SetZoomLevel(ZoomLe
 
			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);
 
		} else if (this->map_type == SMT_LINKSTATS) {
 
			this->overlay->RebuildCache();
 
		}
 
		this->SetWidgetDisabledState(WID_SM_ZOOM_IN,  this->zoom == zoomlevels[MIN_ZOOM_INDEX]);
 
		this->SetWidgetDisabledState(WID_SM_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.
 
 * @return Colours to display.
 
 */
 
inline uint32 SmallMapWindow::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 = GetTileType(tile);
 
		TileType ttype = GetTileType(ti);
 

	
 
		switch (ttype) {
 
			case MP_TUNNELBRIDGE: {
 
				TransportType tt = GetTunnelBridgeTransportType(tile);
 
				TransportType tt = GetTunnelBridgeTransportType(ti);
 

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

	
 
			default:
 
				break;
 
		}
 

	
 
		if (_tiletype_importance[ttype] > importance) {
 
			importance = _tiletype_importance[ttype];
 
			tile = ti;
 
			et = ttype;
 
		}
 
	}
 

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

	
0 comments (0 inline, 0 general)