Changeset - r14813:2dc255bde71a
[Not reviewed]
master
0 6 0
alberth - 15 years ago 2010-03-14 12:39:24
alberth@openttd.org
(svn r19414) -Doc: Several doxygen additions and corrections.
6 files changed with 16 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/command.cpp
Show inline comments
 
@@ -26,13 +26,13 @@
 
#include "company_func.h"
 
#include "company_base.h"
 
#include "signal_func.h"
 

	
 
#include "table/strings.h"
 

	
 
StringID _error_message;
 
StringID _error_message; ///< Global error message. @see CommandCost::SetGlobalErrorMessage()
 

	
 
CommandProc CmdBuildRailroadTrack;
 
CommandProc CmdRemoveRailroadTrack;
 
CommandProc CmdBuildSingleRail;
 
CommandProc CmdRemoveSingleRail;
 

	
 
@@ -189,13 +189,13 @@ CommandProc CmdAutofillTimetable;
 
CommandProc CmdSetTimetableStart;
 

	
 
/**
 
 * The master command table
 
 *
 
 * This table contains all possible CommandProc functions with
 
 * the flags which belongs to it. The indizes are the same
 
 * the flags which belongs to it. The indices are the same
 
 * as the value from the CMD_* enums.
 
 */
 
static const Command _command_proc_table[] = {
 
	{CmdBuildRailroadTrack,   CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_RAILROAD_TRACK
 
	{CmdRemoveRailroadTrack,                 CMD_AUTO}, // CMD_REMOVE_RAILROAD_TRACK
 
	{CmdBuildSingleRail,      CMD_NO_WATER | CMD_AUTO}, // CMD_BUILD_SINGLE_RAIL
 
@@ -469,23 +469,23 @@ bool DoCommandP(const CommandContainer *
 
	return DoCommandP(container->tile, container->p1, container->p2, container->cmd, container->callback, container->text, my_cmd);
 
}
 

	
 
/*!
 
 * Toplevel network safe docommand function for the current company. Must not be called recursively.
 
 * The callback is called when the command succeeded or failed. The parameters
 
 * tile, p1 and p2 are from the #CommandProc function. The paramater cmd is the command to execute.
 
 * The parameter my_cmd is used to indicate if the command is from a company or the server.
 
 * \a tile, \a p1, and \a p2 are from the #CommandProc function. The parameter \a cmd is the command to execute.
 
 * The parameter \a my_cmd is used to indicate if the command is from a company or the server.
 
 *
 
 * @param tile The tile to perform a command on (see #CommandProc)
 
 * @param p1 Additional data for the command (see #CommandProc)
 
 * @param p2 Additional data for the command (see #CommandProc)
 
 * @param cmd The command to execute (a CMD_* value)
 
 * @param callback A callback function to call after the command is finished
 
 * @param text The text to pass
 
 * @param my_cmd indicator if the command is from a company or server (to display error messages for a user)
 
 * @return true if the command succeeded, else false
 
 * @return \c true if the command succeeded, else \c false.
 
 */
 
bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback, const char *text, bool my_cmd)
 
{
 
	/* Cost estimation is generally only done when the
 
	 * local user presses shift while doing somthing.
 
	 * However, in case of incoming network commands,
src/command_type.h
Show inline comments
 
@@ -88,22 +88,23 @@ public:
 
	{
 
		return this->expense_type;
 
	}
 

	
 
	/**
 
	 * Sets the global error message *if* this class has one.
 
	 * @see _error_message
 
	 */
 
	FORCEINLINE void SetGlobalErrorMessage() const
 
	{
 
		extern StringID _error_message;
 
		if (this->message != INVALID_STRING_ID) _error_message = this->message;
 
	}
 

	
 
	/**
 
	 * Makes this CommandCost behave like an error command.
 
	 * @param mesasge the error message.
 
	 * Makes this #CommandCost behave like an error command.
 
	 * @param message The error message.
 
	 */
 
	void MakeError(StringID message)
 
	{
 
		assert(message != INVALID_STRING_ID);
 
		this->success = false;
 
		this->message = message;
src/company_cmd.cpp
Show inline comments
 
@@ -156,12 +156,17 @@ void InvalidateCompanyWindows(const Comp
 
	CompanyID cid = company->index;
 

	
 
	if (cid == _local_company) SetWindowDirty(WC_STATUS_BAR, 0);
 
	SetWindowDirty(WC_FINANCES, cid);
 
}
 

	
 
/**
 
 * Verify whether the company can pay the bill.
 
 * @param cost [inout] Money to pay, is changed to an error if the company does not have enough money.
 
 * @return Function returns \c true if the company has enough money, else it returns \c false.
 
 */
 
bool CheckCompanyHasMoney(CommandCost &cost)
 
{
 
	if (cost.GetCost() > 0) {
 
		const Company *c = Company::GetIfValid(_current_company);
 
		if (c != NULL && cost.GetCost() > c->money) {
 
			SetDParam(0, cost.GetCost());
src/rail.h
Show inline comments
 
@@ -28,12 +28,13 @@ enum RailTypeFlags {
 
	RTFB_CATENARY = 1 << RTF_CATENARY, ///< Value for drawing a catenary.
 
};
 
DECLARE_ENUM_AS_BIT_SET(RailTypeFlags);
 

	
 
struct SpriteGroup;
 

	
 
/** Sprite groups for a railtype. */
 
enum RailTypeSpriteGroup {
 
	RTSG_CURSORS,     ///< Cursor and toolbar icon images
 
	RTSG_OVERLAY,     ///< Images for overlaying track
 
	RTSG_GROUND,      ///< Main group of ground images
 
	RTSG_TUNNEL,      ///< Main group of ground images for snow or desert
 
	RTSG_WIRES,       ///< Catenary wires
src/rail_cmd.cpp
Show inline comments
 
@@ -724,13 +724,13 @@ static CommandCost ValidateAutoDrag(Trac
 
			return CMD_ERROR;
 
	}
 

	
 
	return CommandCost();
 
}
 

	
 
/** Build a stretch of railroad tracks.
 
/** Build or remove a stretch of railroad tracks.
 
 * @param tile start tile of drag
 
 * @param flags operation to perform
 
 * @param p1 end tile of drag
 
 * @param p2 various bitstuffed elements
 
 * - p2 = (bit 0-3) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev)
 
 * - p2 = (bit 4-6) - track-orientation, valid values: 0-5 (Track enum)
src/tree_map.h
Show inline comments
 
@@ -57,13 +57,13 @@ enum {
 
 */
 
enum TreeGround {
 
	TREE_GROUND_GRASS       = 0, ///< normal grass
 
	TREE_GROUND_ROUGH       = 1, ///< some rough tile
 
	TREE_GROUND_SNOW_DESERT = 2, ///< a desert or snow tile, depend on landscape
 
	TREE_GROUND_SHORE       = 3, ///< shore
 
	TREE_GROUND_ROUGH_SNOW  = 4, ///< a snow tile that is rough underneed
 
	TREE_GROUND_ROUGH_SNOW  = 4, ///< A snow tile that is rough underneath.
 
};
 

	
 

	
 
/**
 
 * Returns the treetype of a tile.
 
 *
0 comments (0 inline, 0 general)