Changeset - r12335:832893ebf982
[Not reviewed]
master
0 5 0
rubidium - 15 years ago 2009-07-08 08:50:20
rubidium@openttd.org
(svn r16765) -Codechange: give ViewportSign's width_1 and width_2 more self explaining names
5 files changed with 46 insertions and 48 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -788,23 +788,23 @@ public:
 
			FOR_ALL_TOWNS(t) {
 
				/* Remap the town coordinate */
 
				Point pt = RemapCoords(
 
						this->RemapX(TileX(t->xy)),
 
						this->RemapY(TileY(t->xy)),
 
						0);
 
				x = pt.x - this->subscroll + 3 - (t->sign.width_2 >> 1);
 
				x = pt.x - this->subscroll + 3 - (t->sign.width_small >> 1);
 
				y = pt.y;
 

	
 
				/* Check if the town sign is within bounds */
 
				if (x + t->sign.width_2 > dpi->left &&
 
				if (x + t->sign.width_small > dpi->left &&
 
						x < dpi->left + dpi->width &&
 
						y + 6 > dpi->top &&
 
						y < dpi->top + dpi->height) {
 
					/* And draw it. */
 
					SetDParam(0, t->index);
 
					DrawString(x, x + t->sign.width_2, y, STR_SMALLMAP_TOWN);
 
					DrawString(x, x + t->sign.width_small, y, STR_SMALLMAP_TOWN);
 
				}
 
			}
 
		}
 

	
 
		/* Find main viewport. */
 
		ViewPort *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
src/station.cpp
Show inline comments
 
@@ -150,13 +150,13 @@ void Station::AddFacility(StationFacilit
 
	this->owner = _current_company;
 
	this->build_date = _date;
 
}
 

	
 
void Station::MarkDirty() const
 
{
 
	if (this->sign.width_1 != 0) {
 
	if (this->sign.width_normal != 0) {
 
		InvalidateWindowWidget(WC_STATION_VIEW, index, SVW_CAPTION);
 
		this->sign.MarkDirty();
 
	}
 
}
 

	
 
void Station::MarkTilesDirty(bool cargo_change) const
src/station_cmd.cpp
Show inline comments
 
@@ -1435,13 +1435,12 @@ CommandCost CmdBuildRoadStop(TileIndex t
 
			st->town = ClosestTownFromTile(tile, UINT_MAX);
 
			st->string_id = GenerateStationName(st, tile, STATIONNAMING_ROAD);
 

	
 
			if (Company::IsValidID(_current_company)) {
 
				SetBit(st->town->have_ratings, _current_company);
 
			}
 
			st->sign.width_1 = 0;
 
		}
 
	}
 

	
 
	cost.AddCost((type) ? _price.build_truck_station : _price.build_bus_station);
 

	
 
	if (flags & DC_EXEC) {
 
@@ -1792,13 +1791,12 @@ CommandCost CmdBuildAirport(TileIndex ti
 
			st->town = t;
 
			st->string_id = GenerateStationName(st, tile, !(afc->flags & AirportFTAClass::AIRPLANES) ? STATIONNAMING_HELIPORT : STATIONNAMING_AIRPORT);
 

	
 
			if (Company::IsValidID(_current_company)) {
 
				SetBit(st->town->have_ratings, _current_company);
 
			}
 
			st->sign.width_1 = 0;
 
		}
 
	}
 

	
 
	cost.AddCost(_price.build_airport * w * h);
 

	
 
	if (flags & DC_EXEC) {
 
@@ -1928,13 +1926,12 @@ CommandCost CmdBuildBuoy(TileIndex tile,
 
		st->town = ClosestTownFromTile(tile, UINT_MAX);
 
		st->string_id = GenerateStationName(st, tile, STATIONNAMING_BUOY);
 

	
 
		if (Company::IsValidID(_current_company)) {
 
			SetBit(st->town->have_ratings, _current_company);
 
		}
 
		st->sign.width_1 = 0;
 
		st->dock_tile = tile;
 
		st->facilities |= FACIL_DOCK;
 
		/* Buoys are marked in the Station struct by this flag. Yes, it is this
 
		 * braindead.. */
 
		st->had_vehicle_of_type |= HVOT_BUOY;
 
		st->owner = OWNER_NONE;
 
@@ -2944,13 +2941,12 @@ void BuildOilRig(TileIndex tile)
 
		DEBUG(misc, 0, "Can't allocate station for oilrig at 0x%X, reverting to oilrig only", tile);
 
		return;
 
	}
 

	
 
	Station *st = new Station(tile);
 
	st->town = ClosestTownFromTile(tile, UINT_MAX);
 
	st->sign.width_1 = 0;
 

	
 
	st->string_id = GenerateStationName(st, tile, STATIONNAMING_OILRIG);
 

	
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
	DeleteAnimatedTile(tile);
 
	MakeOilrig(tile, st->index, GetWaterClass(tile));
src/viewport.cpp
Show inline comments
 
@@ -1040,13 +1040,13 @@ static void ViewportAddTownNames(DrawPix
 
	switch (dpi->zoom) {
 
		case ZOOM_LVL_NORMAL:
 
			FOR_ALL_TOWNS(t) {
 
				if (bottom > t->sign.top &&
 
						top    < t->sign.top + 12 &&
 
						right  > t->sign.left &&
 
						left   < t->sign.left + t->sign.width_1) {
 
						left   < t->sign.left + t->sign.width_normal) {
 
					AddStringToDraw(t->sign.left + 1, t->sign.top + 1,
 
						_settings_client.gui.population_in_label ? STR_TOWN_LABEL_POP : STR_TOWN_LABEL,
 
						t->index, t->population);
 
				}
 
			}
 
			break;
 
@@ -1056,13 +1056,13 @@ static void ViewportAddTownNames(DrawPix
 
			bottom += 2;
 

	
 
			FOR_ALL_TOWNS(t) {
 
				if (bottom > t->sign.top &&
 
						top    < t->sign.top + 24 &&
 
						right  > t->sign.left &&
 
						left   < t->sign.left + t->sign.width_1 * 2) {
 
						left   < t->sign.left + t->sign.width_normal * 2) {
 
					AddStringToDraw(t->sign.left + 1, t->sign.top + 1,
 
						_settings_client.gui.population_in_label ? STR_TOWN_LABEL_POP : STR_TOWN_LABEL,
 
						t->index, t->population);
 
				}
 
			}
 
			break;
 
@@ -1073,13 +1073,13 @@ static void ViewportAddTownNames(DrawPix
 
			bottom += ScaleByZoom(1, dpi->zoom) + 1;
 

	
 
			FOR_ALL_TOWNS(t) {
 
				if (bottom > t->sign.top &&
 
						top    < t->sign.top + ScaleByZoom(12, dpi->zoom) &&
 
						right  > t->sign.left &&
 
						left   < t->sign.left + ScaleByZoom(t->sign.width_2, dpi->zoom)) {
 
						left   < t->sign.left + ScaleByZoom(t->sign.width_small, dpi->zoom)) {
 
					AddStringToDraw(t->sign.left + 5, t->sign.top + 1, STR_TOWN_LABEL_TINY_BLACK, t->index, 0);
 
					AddStringToDraw(t->sign.left + 1, t->sign.top - 3, STR_TOWN_LABEL_TINY_WHITE, t->index, 0);
 
				}
 
			}
 
			break;
 

	
 
@@ -1110,27 +1110,27 @@ static void ViewportAddStationNames(Draw
 
	switch (dpi->zoom) {
 
		case ZOOM_LVL_NORMAL:
 
			FOR_ALL_STATIONS(st) {
 
				if (bottom > st->sign.top &&
 
						top    < st->sign.top + 12 &&
 
						right  > st->sign.left &&
 
						left   < st->sign.left + st->sign.width_1) {
 
					AddStation(st, STR_STATION_SIGN, st->sign.width_1);
 
						left   < st->sign.left + st->sign.width_normal) {
 
					AddStation(st, STR_STATION_SIGN, st->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_2X:
 
			right += 2;
 
			bottom += 2;
 
			FOR_ALL_STATIONS(st) {
 
				if (bottom > st->sign.top &&
 
						top    < st->sign.top + 24 &&
 
						right  > st->sign.left &&
 
						left   < st->sign.left + st->sign.width_1 * 2) {
 
					AddStation(st, STR_STATION_SIGN, st->sign.width_1);
 
						left   < st->sign.left + st->sign.width_normal * 2) {
 
					AddStation(st, STR_STATION_SIGN, st->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_4X:
 
		case ZOOM_LVL_OUT_8X:
 
@@ -1138,14 +1138,14 @@ static void ViewportAddStationNames(Draw
 
			bottom += ScaleByZoom(1, dpi->zoom) + 1;
 

	
 
			FOR_ALL_STATIONS(st) {
 
				if (bottom > st->sign.top &&
 
						top    < st->sign.top + ScaleByZoom(12, dpi->zoom) &&
 
						right  > st->sign.left &&
 
						left   < st->sign.left + ScaleByZoom(st->sign.width_2, dpi->zoom)) {
 
					AddStation(st, STR_STATION_SIGN_TINY, st->sign.width_2 | 0x8000);
 
						left   < st->sign.left + ScaleByZoom(st->sign.width_small, dpi->zoom)) {
 
					AddStation(st, STR_STATION_SIGN_TINY, st->sign.width_small | 0x8000);
 
				}
 
			}
 
			break;
 

	
 
		default: NOT_REACHED();
 
	}
 
@@ -1174,27 +1174,27 @@ static void ViewportAddSigns(DrawPixelIn
 
	switch (dpi->zoom) {
 
		case ZOOM_LVL_NORMAL:
 
			FOR_ALL_SIGNS(si) {
 
				if (bottom > si->sign.top &&
 
						top    < si->sign.top + 12 &&
 
						right  > si->sign.left &&
 
						left   < si->sign.left + si->sign.width_1) {
 
					AddSign(si, STR_SIGN_WHITE, si->sign.width_1);
 
						left   < si->sign.left + si->sign.width_normal) {
 
					AddSign(si, STR_SIGN_WHITE, si->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_2X:
 
			right += 2;
 
			bottom += 2;
 
			FOR_ALL_SIGNS(si) {
 
				if (bottom > si->sign.top &&
 
						top    < si->sign.top + 24 &&
 
						right  > si->sign.left &&
 
						left   < si->sign.left + si->sign.width_1 * 2) {
 
					AddSign(si, STR_SIGN_WHITE, si->sign.width_1);
 
						left   < si->sign.left + si->sign.width_normal * 2) {
 
					AddSign(si, STR_SIGN_WHITE, si->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_4X:
 
		case ZOOM_LVL_OUT_8X:
 
@@ -1202,14 +1202,14 @@ static void ViewportAddSigns(DrawPixelIn
 
			bottom += ScaleByZoom(1, dpi->zoom) + 1;
 

	
 
			FOR_ALL_SIGNS(si) {
 
				if (bottom > si->sign.top &&
 
						top    < si->sign.top + ScaleByZoom(12, dpi->zoom) &&
 
						right  > si->sign.left &&
 
						left   < si->sign.left + ScaleByZoom(si->sign.width_2, dpi->zoom)) {
 
					AddSign(si, IsTransparencySet(TO_SIGNS) ? STR_SIGN_SMALL_WHITE : STR_SIGN_SMALL_BLACK, si->sign.width_2 | 0x8000);
 
						left   < si->sign.left + ScaleByZoom(si->sign.width_small, dpi->zoom)) {
 
					AddSign(si, IsTransparencySet(TO_SIGNS) ? STR_SIGN_SMALL_WHITE : STR_SIGN_SMALL_BLACK, si->sign.width_small | 0x8000);
 
				}
 
			}
 
			break;
 

	
 
		default: NOT_REACHED();
 
	}
 
@@ -1238,27 +1238,27 @@ static void ViewportAddWaypoints(DrawPix
 
	switch (dpi->zoom) {
 
		case ZOOM_LVL_NORMAL:
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (bottom > wp->sign.top &&
 
						top    < wp->sign.top + 12 &&
 
						right  > wp->sign.left &&
 
						left   < wp->sign.left + wp->sign.width_1) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_1);
 
						left   < wp->sign.left + wp->sign.width_normal) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_2X:
 
			right += 2;
 
			bottom += 2;
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (bottom > wp->sign.top &&
 
						top    < wp->sign.top + 24 &&
 
						right  > wp->sign.left &&
 
						left   < wp->sign.left + wp->sign.width_1 * 2) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_1);
 
						left   < wp->sign.left + wp->sign.width_normal * 2) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_normal);
 
				}
 
			}
 
			break;
 

	
 
		case ZOOM_LVL_OUT_4X:
 
		case ZOOM_LVL_OUT_8X:
 
@@ -1266,14 +1266,14 @@ static void ViewportAddWaypoints(DrawPix
 
			bottom += ScaleByZoom(1, dpi->zoom) + 1;
 

	
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (bottom > wp->sign.top &&
 
						top    < wp->sign.top + ScaleByZoom(12, dpi->zoom) &&
 
						right  > wp->sign.left &&
 
						left   < wp->sign.left + ScaleByZoom(wp->sign.width_2, dpi->zoom)) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT_TINY, wp->sign.width_2 | 0x8000);
 
						left   < wp->sign.left + ScaleByZoom(wp->sign.width_small, dpi->zoom)) {
 
					AddWaypoint(wp, STR_WAYPOINT_VIEWPORT_TINY, wp->sign.width_small | 0x8000);
 
				}
 
			}
 
			break;
 

	
 
		default: NOT_REACHED();
 
	}
 
@@ -1289,18 +1289,18 @@ void ViewportSign::UpdatePosition(int ce
 
{
 
	this->top = top;
 

	
 
	char buffer[DRAW_STRING_BUFFER];
 

	
 
	GetString(buffer, str, lastof(buffer));
 
	this->width_1 = GetStringBoundingBox(buffer).width + 3;
 
	this->left = center - this->width_1 / 2;
 
	this->width_normal = GetStringBoundingBox(buffer).width + 3;
 
	this->left = center - this->width_normal / 2;
 

	
 
	/* zoomed out version */
 
	_cur_fontsize = FS_SMALL;
 
	this->width_2 = GetStringBoundingBox(buffer).width + 3;
 
	this->width_small = GetStringBoundingBox(buffer).width + 3;
 
	_cur_fontsize = FS_NORMAL;
 
}
 

	
 
/**
 
 * Mark the sign dirty in all viewports.
 
 *
 
@@ -1311,13 +1311,13 @@ void ViewportSign::MarkDirty() const
 
	/* We use ZOOM_LVL_MAX here, as every viewport can have an other zoom,
 
	 *  and there is no way for us to know which is the biggest. So make the
 
	 *  biggest area dirty, and we are safe for sure. */
 
	MarkAllViewportsDirty(
 
		this->left - 6,
 
		this->top  - 3,
 
		this->left + ScaleByZoom(this->width_1 + 12, ZOOM_LVL_MAX),
 
		this->left + ScaleByZoom(this->width_normal + 12, ZOOM_LVL_MAX),
 
		this->top  + ScaleByZoom(12, ZOOM_LVL_MAX));
 
}
 

	
 
static void ViewportDrawTileSprites(const TileSpriteToDrawVector *tstdv)
 
{
 
	const TileSpriteToDraw *tsend = tstdv->End();
 
@@ -1842,13 +1842,13 @@ static bool CheckClickOnTown(const ViewP
 
			x = x - vp->left + vp->virtual_left;
 
			y = y - vp->top  + vp->virtual_top;
 
			FOR_ALL_TOWNS(t) {
 
				if (y >= t->sign.top &&
 
						y < t->sign.top + 12 &&
 
						x >= t->sign.left &&
 
						x < t->sign.left + t->sign.width_1) {
 
						x < t->sign.left + t->sign.width_normal) {
 
					ShowTownViewWindow(t->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1856,13 +1856,13 @@ static bool CheckClickOnTown(const ViewP
 
			x = (x - vp->left + 1) * 2 + vp->virtual_left;
 
			y = (y - vp->top  + 1) * 2 + vp->virtual_top;
 
			FOR_ALL_TOWNS(t) {
 
				if (y >= t->sign.top &&
 
						y < t->sign.top + 24 &&
 
						x >= t->sign.left &&
 
						x < t->sign.left + t->sign.width_1 * 2) {
 
						x < t->sign.left + t->sign.width_normal * 2) {
 
					ShowTownViewWindow(t->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1872,13 +1872,13 @@ static bool CheckClickOnTown(const ViewP
 
			y = ScaleByZoom(y - vp->top  + ScaleByZoom(1, vp->zoom) - 1, vp->zoom) + vp->virtual_top;
 

	
 
			FOR_ALL_TOWNS(t) {
 
				if (y >= t->sign.top &&
 
						y < t->sign.top + ScaleByZoom(12, vp->zoom) &&
 
						x >= t->sign.left &&
 
						x < t->sign.left + ScaleByZoom(t->sign.width_2, vp->zoom)) {
 
						x < t->sign.left + ScaleByZoom(t->sign.width_small, vp->zoom)) {
 
					ShowTownViewWindow(t->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1900,13 +1900,13 @@ static bool CheckClickOnStation(const Vi
 
			x = x - vp->left + vp->virtual_left;
 
			y = y - vp->top  + vp->virtual_top;
 
			FOR_ALL_STATIONS(st) {
 
				if (y >= st->sign.top &&
 
						y < st->sign.top + 12 &&
 
						x >= st->sign.left &&
 
						x < st->sign.left + st->sign.width_1) {
 
						x < st->sign.left + st->sign.width_normal) {
 
					ShowStationViewWindow(st->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1914,13 +1914,13 @@ static bool CheckClickOnStation(const Vi
 
			x = (x - vp->left + 1) * 2 + vp->virtual_left;
 
			y = (y - vp->top  + 1) * 2 + vp->virtual_top;
 
			FOR_ALL_STATIONS(st) {
 
				if (y >= st->sign.top &&
 
						y < st->sign.top + 24 &&
 
						x >= st->sign.left &&
 
						x < st->sign.left + st->sign.width_1 * 2) {
 
						x < st->sign.left + st->sign.width_normal * 2) {
 
					ShowStationViewWindow(st->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1930,13 +1930,13 @@ static bool CheckClickOnStation(const Vi
 
			y = ScaleByZoom(y - vp->top  + ScaleByZoom(1, vp->zoom) - 1, vp->zoom) + vp->virtual_top;
 

	
 
			FOR_ALL_STATIONS(st) {
 
				if (y >= st->sign.top &&
 
						y < st->sign.top + ScaleByZoom(12, vp->zoom) &&
 
						x >= st->sign.left &&
 
						x < st->sign.left + ScaleByZoom(st->sign.width_2, vp->zoom)) {
 
						x < st->sign.left + ScaleByZoom(st->sign.width_small, vp->zoom)) {
 
					ShowStationViewWindow(st->index);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1959,13 +1959,13 @@ static bool CheckClickOnSign(const ViewP
 
			x = x - vp->left + vp->virtual_left;
 
			y = y - vp->top  + vp->virtual_top;
 
			FOR_ALL_SIGNS(si) {
 
				if (y >= si->sign.top &&
 
						y <  si->sign.top + 12 &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + si->sign.width_1) {
 
						x <  si->sign.left + si->sign.width_normal) {
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1973,13 +1973,13 @@ static bool CheckClickOnSign(const ViewP
 
			x = (x - vp->left + 1) * 2 + vp->virtual_left;
 
			y = (y - vp->top  + 1) * 2 + vp->virtual_top;
 
			FOR_ALL_SIGNS(si) {
 
				if (y >= si->sign.top &&
 
						y <  si->sign.top + 24 &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + si->sign.width_1 * 2) {
 
						x <  si->sign.left + si->sign.width_normal * 2) {
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -1989,13 +1989,13 @@ static bool CheckClickOnSign(const ViewP
 
			y = ScaleByZoom(y - vp->top  + ScaleByZoom(1, vp->zoom) - 1, vp->zoom) + vp->virtual_top;
 

	
 
			FOR_ALL_SIGNS(si) {
 
				if (y >= si->sign.top &&
 
						y <  si->sign.top + ScaleByZoom(12, vp->zoom) &&
 
						x >= si->sign.left &&
 
						x <  si->sign.left + ScaleByZoom(si->sign.width_2, vp->zoom)) {
 
						x <  si->sign.left + ScaleByZoom(si->sign.width_small, vp->zoom)) {
 
					HandleClickOnSign(si);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -2017,13 +2017,13 @@ static bool CheckClickOnWaypoint(const V
 
			x = x - vp->left + vp->virtual_left;
 
			y = y - vp->top  + vp->virtual_top;
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (y >= wp->sign.top &&
 
						y < wp->sign.top + 12 &&
 
						x >= wp->sign.left &&
 
						x < wp->sign.left + wp->sign.width_1) {
 
						x < wp->sign.left + wp->sign.width_normal) {
 
					ShowWaypointWindow(wp);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -2031,13 +2031,13 @@ static bool CheckClickOnWaypoint(const V
 
			x = (x - vp->left + 1) * 2 + vp->virtual_left;
 
			y = (y - vp->top  + 1) * 2 + vp->virtual_top;
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (y >= wp->sign.top &&
 
						y < wp->sign.top + 24 &&
 
						x >= wp->sign.left &&
 
						x < wp->sign.left + wp->sign.width_1 * 2) {
 
						x < wp->sign.left + wp->sign.width_normal * 2) {
 
					ShowWaypointWindow(wp);
 
					return true;
 
				}
 
			}
 
			break;
 

	
 
@@ -2047,13 +2047,13 @@ static bool CheckClickOnWaypoint(const V
 
			y = ScaleByZoom(y - vp->top  + ScaleByZoom(1, vp->zoom) - 1, vp->zoom) + vp->virtual_top;
 

	
 
			FOR_ALL_WAYPOINTS(wp) {
 
				if (y >= wp->sign.top &&
 
						y < wp->sign.top + ScaleByZoom(12, vp->zoom) &&
 
						x >= wp->sign.left &&
 
						x < wp->sign.left + ScaleByZoom(wp->sign.width_2, vp->zoom)) {
 
						x < wp->sign.left + ScaleByZoom(wp->sign.width_small, vp->zoom)) {
 
					ShowWaypointWindow(wp);
 
					return true;
 
				}
 
			}
 
			break;
 

	
src/viewport_type.h
Show inline comments
 
@@ -22,16 +22,18 @@ struct ViewPort {
 
	int virtual_width;   ///< width << zoom
 
	int virtual_height;  ///< height << zoom
 

	
 
	ZoomLevel zoom;
 
};
 

	
 
/** Location information about a sign as seen on the viewport */
 
struct ViewportSign {
 
	int32 left;
 
	int32 top;
 
	uint16 width_1, width_2;
 
	int32 left; ///< The left most position of the sign
 
	int32 top;  ///< THe top of the sign
 
	uint16 width_normal; ///< The width when not zoomed out (normal font)
 
	uint16 width_small;  ///< The width when zoomed out (small font)
 

	
 
	void UpdatePosition(int center, int top, StringID str);
 
	void MarkDirty() const;
 
};
 

	
 
enum {
0 comments (0 inline, 0 general)