diff -r 99e314c88eb8 src/landscape.cpp --- a/src/landscape.cpp Sun Oct 19 09:57:27 2008 +0200 +++ b/src/landscape.cpp Sun Oct 19 10:06:43 2008 +0200 @@ -360,7 +360,11 @@ return (z_N_here > z_N) || (z_E_here > z_E); } - +/** + * Draw foundation \a f at tile \a ti. Updates \a ti. + * @param ti Tile to draw foundation on + * @param f Foundation to draw + */ void DrawFoundation(TileInfo *ti, Foundation f) { if (!IsFoundation(f)) return; diff -r 99e314c88eb8 src/road_cmd.cpp --- a/src/road_cmd.cpp Sun Oct 19 09:57:27 2008 +0200 +++ b/src/road_cmd.cpp Sun Oct 19 10:06:43 2008 +0200 @@ -43,7 +43,10 @@ #include "table/sprites.h" #include "table/strings.h" - +/** + * Verify whether a road vehicle is available. + * @return \c true if at least one road vehicle is available, \c false if not + */ bool RoadVehiclesAreBuilt() { const Vehicle* v; @@ -1156,6 +1159,7 @@ } } +/** Tile callback function for rendering a road tile to the screen */ static void DrawTile_Road(TileInfo *ti) { switch (GetRoadTileType(ti->tile)) { @@ -1630,7 +1634,7 @@ return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); } - +/** Tile callback functions for road tiles */ extern const TileTypeProcs _tile_type_road_procs = { DrawTile_Road, /* draw_tile_proc */ GetSlopeZ_Road, /* get_slope_z_proc */ diff -r 99e314c88eb8 src/station.cpp --- a/src/station.cpp Sun Oct 19 09:57:27 2008 +0200 +++ b/src/station.cpp Sun Oct 19 10:06:43 2008 +0200 @@ -321,6 +321,15 @@ BeforeAddTile(tile, mode) && BeforeAddTile(TILE_ADDXY(tile, w - 1, h - 1), mode); } +/** + * Check whether station tiles of the given station id exist in the given rectangle + * @param st_id Station ID to look for in the rectangle + * @param left_a Minimal tile X edge of the rectangle + * @param top_a Minimal tile Y edge of the rectangle + * @param right_a Maximal tile X edge of the rectangle (inclusive) + * @param bottom_a Maximal tile Y edge of the rectangle (inclusive) + * @return \c true if a station tile with the given \a st_id exists in the rectangle, \c false otherwise + */ /*static*/ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a) { TileIndex top_left = TileXY(left_a, top_a); diff -r 99e314c88eb8 src/station_base.h --- a/src/station_base.h Sun Oct 19 09:57:27 2008 +0200 +++ b/src/station_base.h Sun Oct 19 10:06:43 2008 +0200 @@ -107,6 +107,7 @@ StationRect& operator = (Rect src); }; +/** Station data structure */ struct Station : PoolItem { public: RoadStop *GetPrimaryRoadStop(RoadStopType type) const @@ -150,13 +151,13 @@ uint8 num_specs; StationSpecList *speclist; - Date build_date; + Date build_date; ///< Date of construction uint64 airport_flags; ///< stores which blocks on the airport are taken. was 16 bit earlier on, then 32 byte last_vehicle_type; std::list loading_vehicles; - GoodsEntry goods[NUM_CARGO]; + GoodsEntry goods[NUM_CARGO]; ///< Goods at this station uint16 random_bits; byte waiting_triggers; diff -r 99e314c88eb8 src/station_map.h --- a/src/station_map.h Sun Oct 19 09:57:27 2008 +0200 +++ b/src/station_map.h Sun Oct 19 10:06:43 2008 +0200 @@ -14,6 +14,10 @@ typedef byte StationGfx; +/** Get Station ID from a tile + * @pre Tile \t must be part of the station + * @param t Tile to query station ID from + * @return Station ID of the station at \a t */ static inline StationID GetStationIndex(TileIndex t) { assert(IsTileType(t, MP_STATION)); @@ -97,16 +101,29 @@ bool IsHangar(TileIndex t); +/** + * Is the station at \a t a truck stop? + * @param t Tile to check + * @return \c true if station is a truck stop, \c false otherwise */ static inline bool IsTruckStop(TileIndex t) { return GetStationType(t) == STATION_TRUCK; } +/** + * Is the station at \a t a bus stop? + * @param t Tile to check + * @return \c true if station is a bus stop, \c false otherwise */ static inline bool IsBusStop(TileIndex t) { return GetStationType(t) == STATION_BUS; } +/** + * Is the station at \a t a road station? + * @pre Tile at \a t is a station tile + * @param t Tile to check + * @return \c true if station at the tile is a bus top or a truck stop, \c false otherwise */ static inline bool IsRoadStop(TileIndex t) { assert(IsTileType(t, MP_STATION)); diff -r 99e314c88eb8 src/station_type.h --- a/src/station_type.h Sun Oct 19 09:57:27 2008 +0200 +++ b/src/station_type.h Sun Oct 19 10:06:43 2008 +0200 @@ -14,6 +14,7 @@ static const StationID INVALID_STATION = 0xFFFF; +/** Station types */ enum StationType { STATION_RAIL, STATION_AIRPORT, diff -r 99e314c88eb8 src/tile_cmd.h --- a/src/tile_cmd.h Sun Oct 19 09:57:27 2008 +0200 +++ b/src/tile_cmd.h Sun Oct 19 10:06:43 2008 +0200 @@ -39,12 +39,13 @@ }; DECLARE_ENUM_AS_BIT_SET(VehicleEnterTileStatus); +/** Tile information, used while rendering the tile */ struct TileInfo { - uint x; - uint y; - Slope tileh; - TileIndex tile; - uint z; + uint x; ///< X position of the tile in unit coordinates + uint y; ///< Y position of the tile in unit coordinates + Slope tileh; ///< Slope of the tile + TileIndex tile; ///< Tile index + uint z; ///< Height }; struct TileDesc { diff -r 99e314c88eb8 src/tile_map.cpp --- a/src/tile_map.cpp Sun Oct 19 09:57:27 2008 +0200 +++ b/src/tile_map.cpp Sun Oct 19 10:06:43 2008 +0200 @@ -7,6 +7,11 @@ #include "tile_map.h" #include "core/math_func.hpp" +/** + * Return the slope of a given tile + * @param tile Tile to compute slope of + * @param h If not \c NULL, pointer to storage of z height + * @return Slope of the tile, except for the HALFTILE part */ Slope GetTileSlope(TileIndex tile, uint *h) { uint a; @@ -42,6 +47,10 @@ return (Slope)r; } +/** + * Get bottom height of the tile + * @param tile Tile to compute height of + * @return Minimum height of the tile */ uint GetTileZ(TileIndex tile) { if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0; @@ -54,7 +63,10 @@ return h * TILE_HEIGHT; } - +/** + * Get top height of the tile + * @param tile Tile to compute height of + * @return Maximum height of the tile */ uint GetTileMaxZ(TileIndex t) { if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;