summaryrefslogtreecommitdiff
path: root/viewport.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-03 12:56:22 +0000
committertron <tron@openttd.org>2005-01-03 12:56:22 +0000
commit32bfe0dddde81d016cb8de15e6a41bca3506d7be (patch)
tree04b3f2dd580a9cd8387358c91a0cfcf95a525153 /viewport.c
parent4c14afba4eae4bbfe3d448eeaa072e11b326c78a (diff)
downloadopenttd-32bfe0dddde81d016cb8de15e6a41bca3506d7be.tar.xz
(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()
Diffstat (limited to 'viewport.c')
-rw-r--r--viewport.c6
1 files changed, 3 insertions, 3 deletions
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;