(svn r7555) -Fix (r5479): off-by-one error due do truncation on division by 2. Thanks to Ben_Robbins_ for providing the test case.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 18 years ago
parent 5cf3b8a1a9
commit 67f63c8584

@ -318,8 +318,8 @@ static void GrayscaleToMapHeights(uint img_width, uint img_height, byte *map)
/* 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.

Loading…
Cancel
Save