From f76c7a8873aa4019c64c01d3a8ed4c49f8de5609 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Tue, 22 Nov 2011 21:24:08 +0100 Subject: fixed a bug with constants, made the macro more readable --- src/tools/tileset_bordercopy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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))]; } } } -- cgit 1.4.1