diff options
author | rubidium <rubidium@openttd.org> | 2009-07-26 21:07:03 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-07-26 21:07:03 +0000 |
commit | 47a37b6093c3bb93dba81e4d3440c4098699a849 (patch) | |
tree | 322f91b3bf8e463dde3d472a4b390600a84ca350 /src/station.cpp | |
parent | 4aa2785757b132a4faee3a5fa821f2795be94f76 (diff) | |
download | openttd-47a37b6093c3bb93dba81e4d3440c4098699a849.tar.xz |
(svn r16965) -Codechange: use tile area instead of sets of variables for the station joiner code.
Diffstat (limited to 'src/station.cpp')
-rw-r--r-- | src/station.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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() { |