about summary refs log tree commit diff
diff options
context:
space:
mode:
authorheinrich5991 <heinrich5991@gmail.com>2011-11-22 21:24:08 +0100
committeroy <Tom_Adams@web.de>2011-12-29 14:35:45 +0100
commitf76c7a8873aa4019c64c01d3a8ed4c49f8de5609 (patch)
tree781e42bf15ebf8d57ef9f2ca41d1e8eb3db30ed8
parent41daa3b11085a555056b569d3887bb220062a357 (diff)
downloadzcatch-f76c7a8873aa4019c64c01d3a8ed4c49f8de5609.tar.gz
zcatch-f76c7a8873aa4019c64c01d3a8ed4c49f8de5609.zip
fixed a bug with constants, made the macro more readable
-rw-r--r--src/tools/tileset_bordercopy.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/tileset_bordercopy.cpp b/src/tools/tileset_bordercopy.cpp
index 5bbe0921..14b0ed14 100644
--- a/src/tools/tileset_bordercopy.cpp
+++ b/src/tools/tileset_bordercopy.cpp
@@ -22,8 +22,8 @@ static void TilesetBorderfix(int w, int h, CPixel *pSrc, CPixel *pDest)
 			{
 				for(int y = 0; y < TileH; y++)
 				{
-					#define TILE_INDEX(tx, ty, x, y) (((ty) * TileH + (y)) * w + (tx) * TileW + (x))
-					pDest[TILE_INDEX(tx, ty, x, y)] = pSrc[TILE_INDEX(tx, ty, clamp(x, 2, 13), clamp(y, 2, 13))];
+					#define TILE_INDEX(tx_, ty_, x_, y_) (((ty_) * TileH + (y_)) * w + (tx_) * TileW + (x_))
+					pDest[TILE_INDEX(tx, ty, x, y)] = pSrc[TILE_INDEX(tx, ty, clamp(x, 2, TileW - 3), clamp(y, 2, TileH - 3))];
 				}
 			}
 		}