From 47a37b6093c3bb93dba81e4d3440c4098699a849 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 26 Jul 2009 21:07:03 +0000 Subject: (svn r16965) -Codechange: use tile area instead of sets of variables for the station joiner code. --- src/station.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/station.cpp') diff --git a/src/station.cpp b/src/station.cpp index f4138af04..84c7efb60 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -491,6 +491,21 @@ StationRect& StationRect::operator = (Rect src) return *this; } +TileArea::TileArea(TileIndex start, TileIndex end) +{ + uint sx = TileX(start); + uint sy = TileY(start); + uint ex = TileX(end); + uint ey = TileY(end); + + if (sx > ex) Swap(sx, ex); + if (sy > ey) Swap(sy, ey); + + this->tile = TileXY(sx, sy); + this->w = ex - sx + 1; + this->h = ey - sy + 1; +} + void InitializeStations() { -- cgit v1.2.3-54-g00ecf