changeset 16544:862aa540d68a draft

(svn r21270) -Doc: Doxyment updates and additions. Removal of doxyment in code.
author alberth <alberth@openttd.org>
date Sat, 20 Nov 2010 14:15:02 +0000
parents 59ca1b65df69
children 38004c878635
files src/bridge.h src/bridge_gui.cpp src/industry_cmd.cpp src/newgrf_industries.cpp src/newgrf_station.cpp src/order_type.h src/saveload/saveload.cpp src/station_cmd.cpp src/viewport_func.h
diffstat 9 files changed, 61 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/bridge.h
+++ b/src/bridge.h
@@ -33,9 +33,9 @@
 
 DECLARE_POSTFIX_INCREMENT(BridgePieces)
 
-static const uint MAX_BRIDGES = 13;
+static const uint MAX_BRIDGES = 13; ///< Maximal number of available bridge specs.
 
-typedef uint BridgeType;
+typedef uint BridgeType; ///< Bridge spec number.
 
 /**
  * Struct containing information about a single bridge type
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -39,7 +39,7 @@
 	Money cost;
 };
 
-typedef GUIList<BuildBridgeData> GUIBridgeList;
+typedef GUIList<BuildBridgeData> GUIBridgeList; ///< List of bridges, used in #BuildBridgeWindow.
 
 /**
  * Callback executed after a build Bridge CMD has been called
@@ -63,11 +63,12 @@
 	BBSW_SCROLLBAR,
 };
 
+/** Window class for handling the bridge-build GUI. */
 class BuildBridgeWindow : public Window {
 private:
 	/* Runtime saved values */
-	static uint16 last_size;
-	static Listing last_sorting;
+	static uint16 last_size;     ///< Last size of the bridge GUI window.
+	static Listing last_sorting; ///< Last setting of the sort.
 
 	/* Constants for sorting the bridges */
 	static const StringID sorter_names[];
@@ -287,19 +288,19 @@
 	}
 };
 
-/* Set the default size of the Build Bridge Window */
+/** Set the default size of the Build Bridge Window. */
 uint16 BuildBridgeWindow::last_size = 4;
-/* Set the default sorting for the bridges */
+/** Set the default sorting for the bridges */
 Listing BuildBridgeWindow::last_sorting = {false, 0};
 
-/* Availible bridge sorting functions */
+/** Available bridge sorting functions. */
 GUIBridgeList::SortFunction * const BuildBridgeWindow::sorter_funcs[] = {
 	&BridgeIndexSorter,
 	&BridgePriceSorter,
 	&BridgeSpeedSorter
 };
 
-/* Names of the sorting functions */
+/** Names of the sorting functions. */
 const StringID BuildBridgeWindow::sorter_names[] = {
 	STR_SORT_BY_NUMBER,
 	STR_SORT_BY_COST,
@@ -307,6 +308,7 @@
 	INVALID_STRING_ID
 };
 
+/** Widgets of the bridge gui. */
 static const NWidgetPart _nested_build_bridge_widgets[] = {
 	/* Header */
 	NWidget(NWID_HORIZONTAL),
@@ -333,7 +335,7 @@
 	EndContainer(),
 };
 
-/* Window definition for the rail bridge selection window */
+/** Window definition for the rail bridge selection window. */
 static const WindowDesc _build_bridge_desc(
 	WDP_AUTO, 200, 114,
 	WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR,
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -1043,10 +1043,10 @@
 {
 	TileIndex tile = i->location.tile;
 
-	if (!IsIndustryCompleted(tile)) return;  ///< Can't proceed if not completed
-
-	if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, NULL)) { ///< 40x40 tiles  to search
-		i->produced_cargo_waiting[0] = min(0xffff, i->produced_cargo_waiting[0] + 45); ///< Found a tree, add according value to waiting cargo
+	if (!IsIndustryCompleted(tile)) return;  // Can't proceed if not completed.
+
+	if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, NULL)) { // 40x40 tiles  to search.
+		i->produced_cargo_waiting[0] = min(0xffff, i->produced_cargo_waiting[0] + 45); // Found a tree, add according value to waiting cargo.
 	}
 }
 
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -506,6 +506,12 @@
 	NOT_REACHED();
 }
 
+/**
+ * Check with callback #CBM_IND_AVAILABLE whether the industry can be built.
+ * @param type Industry type to check.
+ * @param creation_type Reason to construct a new industry.
+ * @return If the industry has no callback or allows building, \c true is returned. Otherwise, \c false is returned.
+ */
 bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type)
 {
 	const IndustrySpec *indspec = GetIndustrySpec(type);
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -89,12 +89,17 @@
 };
 
 
-/* Evaluate a tile's position within a station, and return the result a bit-stuffed format.
+/**
+ * Evaluate a tile's position within a station, and return the result in a bit-stuffed format.
  * if not centered: .TNLcCpP, if centered: .TNL..CP
- * T = Tile layout number (#GetStationGfx), N = Number of platforms, L = Length of platforms
- * C = Current platform number from start, c = from end
- * P = Position along platform from start, p = from end
+ * - T = Tile layout number (#GetStationGfx)
+ * - N = Number of platforms
+ * - L = Length of platforms
+ * - C = Current platform number from start, c = from end
+ * - P = Position along platform from start, p = from end
+ * .
  * if centered, C/P start from the centre and c/p are not available.
+ * @return Platform information in bit-stuffed format.
  */
 uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, int y, bool centred)
 {
@@ -129,9 +134,13 @@
 }
 
 
-/* Find the end of a railway station, from the tile, in the direction of delta.
- * If check_type is set, we stop if the custom station type changes.
- * If check_axis is set, we stop if the station direction changes.
+/**
+ * Find the end of a railway station, from the \a tile, in the direction of \a delta.
+ * @param tile Start tile.
+ * @param delta Movement direction.
+ * @param check_type Stop when the custom station type changes.
+ * @param check_axis Stop when the station direction changes.
+ * @return Found end of the railway station.
  */
 static TileIndex FindRailStationEnd(TileIndex tile, TileIndexDiff delta, bool check_type, bool check_axis)
 {
@@ -785,8 +794,12 @@
 }
 
 
-/* Check if a rail station tile is traversable.
- * XXX This could be cached (during build) in the map array to save on all the dereferencing */
+/**
+ * Check whether a rail station tile is NOT traversable.
+ * @param tile %Tile to test.
+ * @return Station tile is blocked.
+ * @note This could be cached (during build) in the map array to save on all the dereferencing.
+ */
 bool IsStationTileBlocked(TileIndex tile)
 {
 	const StationSpec *statspec = GetStationSpec(tile);
@@ -794,8 +807,12 @@
 	return statspec != NULL && HasBit(statspec->blocked, GetStationGfx(tile));
 }
 
-/* Check if a rail station tile is electrifiable.
- * XXX This could be cached (during build) in the map array to save on all the dereferencing */
+/**
+ * Check if a rail station tile can be electrified.
+ * @param tile %Tile to test.
+ * @return Tile can be electrified.
+ * @note This could be cached (during build) in the map array to save on all the dereferencing.
+ */
 bool IsStationTileElectrifiable(TileIndex tile)
 {
 	const StationSpec *statspec = GetStationSpec(tile);
--- a/src/order_type.h
+++ b/src/order_type.h
@@ -27,7 +27,7 @@
 /** Invalid order (sentinel) */
 static const OrderID INVALID_ORDER = 0xFFFF;
 
-/* Order types */
+/** Order types */
 enum OrderType {
 	OT_BEGIN         = 0,
 	OT_NOTHING       = 0,
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -13,8 +13,8 @@
  * are as follows for saving a game (loading is analogous):
  * <ol>
  * <li>initialize the writer by creating a temporary memory-buffer for it
- * <li>go through all to-be saved elements, each 'chunk' (ChunkHandler) prefixed by a label
- * <li>use their description array (SaveLoad) to know what elements to save and in what version
+ * <li>go through all to-be saved elements, each 'chunk' (#ChunkHandler) prefixed by a label
+ * <li>use their description array (#SaveLoad) to know what elements to save and in what version
  *    of the game it was active (used when loading)
  * <li>write all data byte-by-byte to the temporary buffer so it is endian-safe
  * <li>when the buffer is full; flush it to the output (eg save to file) (_sl.buf, _sl.bufp, _sl.bufe)
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1546,7 +1546,7 @@
 
 
 /**
- * Remove a rail road station/waypoint
+ * Remove a rail station/waypoint
  * @param st The station/waypoint to remove the rail part from
  * @param flags operation to perform
  * @tparam T the type of station to remove
@@ -1614,7 +1614,7 @@
 }
 
 /**
- * Remove a rail road station
+ * Remove a rail station
  * @param tile TileIndex been queried
  * @param flags operation to perform
  * @return cost or failure of operation
--- a/src/viewport_func.h
+++ b/src/viewport_func.h
@@ -40,6 +40,12 @@
 Point GetTileZoomCenterWindow(bool in, Window * w);
 void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
 
+/**
+ * Zoom a viewport as far as possible in the given direction.
+ * @param how Zooming direction.
+ * @param w   Window owning the viewport.
+ * @pre \a how should not be #ZOOM_NONE.
+ */
 static inline void MaxZoomInOut(ZoomStateChange how, Window *w)
 {
 	while (DoZoomInOutWindow(how, w)) {};