diff options
Diffstat (limited to 'src/station.cpp')
-rw-r--r-- | src/station.cpp | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/station.cpp b/src/station.cpp index e6b984d68..fef63b305 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -498,72 +498,6 @@ 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 TileArea::Add(TileIndex to_add) -{ - if (this->tile == INVALID_TILE) { - this->tile = to_add; - this->w = 1; - this->h = 1; - return; - } - - uint sx = TileX(this->tile); - uint sy = TileY(this->tile); - uint ex = sx + this->w - 1; - uint ey = sy + this->h - 1; - - uint ax = TileX(to_add); - uint ay = TileY(to_add); - - sx = min(ax, sx); - sy = min(ay, sy); - ex = max(ax, ex); - ey = max(ay, ey); - - this->tile = TileXY(sx, sy); - this->w = ex - sx + 1; - this->h = ey - sy + 1; -} - -bool TileArea::Intersects(const TileArea &ta) const -{ - if (ta.w == 0 || this->w == 0) return false; - - assert(ta.w != 0 && ta.h != 0 && this->w != 0 && this->h != 0); - - uint left1 = TileX(this->tile); - uint top1 = TileY(this->tile); - uint right1 = left1 + this->w - 1; - uint bottom1 = top1 + this->h - 1; - - uint left2 = TileX(ta.tile); - uint top2 = TileY(ta.tile); - uint right2 = left2 + ta.w - 1; - uint bottom2 = top2 + ta.h - 1; - - return !( - left2 > right1 || - right2 < left1 || - top2 > bottom1 || - bottom2 < top1 - ); -} - void InitializeStations() { |