(svn r7668) -Backport from trunk (r7555): 0.5
authorDarkvater
Sat, 30 Dec 2006 23:11:14 +0000
branch0.5
changeset 5367 5e0dcec0b317
parent 5366 ef01dc923a5b
child 5368 753b85e1616a
(svn r7668) -Backport from trunk (r7555):
- off-by-one error due do truncation on division by 2 in heightmap code.
heightmap.c
--- a/heightmap.c	Sat Dec 30 23:09:27 2006 +0000
+++ b/heightmap.c	Sat Dec 30 23:11:14 2006 +0000
@@ -318,8 +318,8 @@
 
 			/* Check if current tile is within the 1-pixel map edge or padding regions */
 			if ((DistanceFromEdge(tile) <= 1) ||
-					(row < row_pad) || (row >= (height - row_pad)) ||
-					(col < col_pad) || (col >= (width - col_pad))) {
+					(row < row_pad) || (row >= (img_height + row_pad)) ||
+					(col < col_pad) || (col >= (img_width  + col_pad))) {
 				SetTileHeight(tile, 0);
 			} else {
 				/* Use nearest neighbor resizing to scale map data.