Changeset - r22004:8e03a1c07920
[Not reviewed]
master
0 2 0
frosch - 10 years ago 2015-02-22 14:14:30
frosch@openttd.org
(svn r27160) -Fix: Division of signed values by TILE_SIZE requires cast to stay signed.
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -844,13 +844,13 @@ void SmallMapWindow::DrawVehicles(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);
 
		Point pt = this->RemapTile(v->x_pos / (int)TILE_SIZE, v->y_pos / (int)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.
src/viewport.cpp
Show inline comments
 
@@ -2566,13 +2566,13 @@ bool ScrollWindowTo(int x, int y, int z,
 
	/* The slope cannot be acquired outside of the map, so make sure we are always within the map. */
 
	if (z == -1) {
 
		if ( x >= 0 && x <= (int)MapSizeX() * (int)TILE_SIZE - 1
 
				&& y >= 0 && y <= (int)MapSizeY() * (int)TILE_SIZE - 1) {
 
			z = GetSlopePixelZ(x, y);
 
		} else {
 
			z = TileHeightOutsideMap(x / TILE_SIZE, y / TILE_SIZE);
 
			z = TileHeightOutsideMap(x / (int)TILE_SIZE, y / (int)TILE_SIZE);
 
		}
 
	}
 

	
 
	Point pt = MapXYZToViewport(w->viewport, x, y, z);
 
	w->viewport->follow_vehicle = INVALID_VEHICLE;
 

	
0 comments (0 inline, 0 general)