From 32bfe0dddde81d016cb8de15e6a41bca3506d7be Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 3 Jan 2005 12:56:22 +0000 Subject: (svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY] While here replace one erroneous TILE_MAX_X with MapMaxY() --- viewport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'viewport.c') diff --git a/viewport.c b/viewport.c index b6bb6ba03..5b1712b2c 100644 --- a/viewport.c +++ b/viewport.c @@ -295,7 +295,7 @@ Point TranslateXYToTileCoord(ViewPort *vp, int x, int y) { pt.x = a+z; pt.y = b+z; - if ((uint)pt.x >= TILE_X_MAX*16 || (uint)pt.y >= TILE_Y_MAX*16) { + if ((uint)pt.x >= MapMaxX() * 16 || (uint)pt.y >= MapMaxY() * 16) { pt.x = pt.y = -1; } @@ -1289,8 +1289,8 @@ void UpdateViewportPosition(Window *w) vx = -x + y * 2; vy = x + y * 2; // clamp to size of map - vx = clamp(vx, 0 * 4, TILE_X_MAX * 16 * 4); - vy = clamp(vy, 0 * 4, TILE_Y_MAX * 16 * 4); + vx = clamp(vx, 0 * 4, MapMaxX() * 16 * 4); + vy = clamp(vy, 0 * 4, MapMaxY() * 16 * 4); // Convert map coordinates to viewport coordinates x = (-vx + vy) / 2; y = ( vx + vy) / 4; -- cgit v1.2.3-54-g00ecf