Changeset - r10815:993109adf4c1
[Not reviewed]
master
0 1 0
Yexo - 15 years ago 2009-01-19 13:50:56
yexo@openttd.org
(svn r15150) -Fix: Don't highlight tiles outside the visible map.
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/viewport.cpp
Show inline comments
 
@@ -783,6 +783,8 @@ static void DrawSelectionSprite(SpriteID
 
 */
 
static void DrawTileSelectionRect(const TileInfo *ti, SpriteID pal)
 
{
 
	if (!IsValidTile(ti->tile)) return;
 

	
 
	SpriteID sel;
 
	if (IsHalftileSlope(ti->tileh)) {
 
		Corner halftile_corner = GetHalftileSlopeCorner(ti->tileh);
 
@@ -971,8 +973,8 @@ static void ViewportAddLandscape()
 

	
 
			ti.x = x_cur;
 
			ti.y = y_cur;
 
			if (0 <= x_cur && x_cur < (int)MapMaxX() * TILE_SIZE &&
 
					0 <= y_cur && y_cur < (int)MapMaxY() * TILE_SIZE) {
 
			if (0 <= x_cur && x_cur < (int)MapSizeX() * TILE_SIZE &&
 
					0 <= y_cur && y_cur < (int)MapSizeY() * TILE_SIZE) {
 
				TileIndex tile = TileVirtXY(x_cur, y_cur);
 

	
 
				ti.tile = tile;
 
@@ -980,7 +982,7 @@ static void ViewportAddLandscape()
 
				tt = GetTileType(tile);
 
			} else {
 
				ti.tileh = SLOPE_FLAT;
 
				ti.tile = 0;
 
				ti.tile = INVALID_TILE;
 
				ti.z = 0;
 
				tt = MP_VOID;
 
			}
 
@@ -995,7 +997,7 @@ static void ViewportAddLandscape()
 
			_vd.last_foundation_child[1] = NULL;
 

	
 
			_tile_type_procs[tt]->draw_tile_proc(&ti);
 
			DrawTileSelection(&ti);
 
			if (ti.tile != INVALID_TILE) DrawTileSelection(&ti);
 
		} while (--width_cur);
 

	
 
		if ((direction ^= 1) != 0) {
0 comments (0 inline, 0 general)