(svn r16965) -Codechange: use tile area instead of sets of variables for the station joiner code.

This commit is contained in:
rubidium
2009-07-26 21:07:03 +00:00
parent 4aa2785757
commit 47a37b6093
9 changed files with 72 additions and 58 deletions

View File

@@ -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()
{