(svn r16896) -Codechange: make station spec allocation and station animation functions work for both stations and waypoints

This commit is contained in:
rubidium
2009-07-21 11:11:05 +00:00
parent d79a1543bc
commit 6670fae515
6 changed files with 126 additions and 54 deletions

View File

@@ -77,6 +77,13 @@ struct StationRect : public Rect {
StationRect& operator = (Rect src);
};
/** Represents the covered area */
struct TileArea {
TileIndex tile; ///< The base tile of the area
uint8 w; ///< The width of the area
uint8 h; ///< The height of the area
};
/** Base class for all station-ish types */
struct BaseStation {
TileIndex xy; ///< Base tile of the station
@@ -125,6 +132,13 @@ struct BaseStation {
*/
virtual void UpdateVirtCoord() = 0;
/**
* Get the tile area for a given station type.
* @param ta tile area to fill.
* @param type the type of the area
*/
virtual void GetTileArea(TileArea *ta, StationType type) const = 0;
/**
* Get the base station belonging to a specific tile.
* @param tile The tile to get the base station from.
@@ -258,6 +272,8 @@ public:
/* virtual */ uint32 GetNewGRFVariable(const ResolverObject *object, byte variable, byte parameter, bool *available) const;
/* virtual */ void GetTileArea(TileArea *ta, StationType type) const;
/**
* Determines whether a station is a buoy only.
* @todo Ditch this encoding of buoys