Changeset - r19821:021f5f9159cc
[Not reviewed]
master
0 23 0
alberth - 12 years ago 2012-12-01 13:12:39
alberth@openttd.org
(svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb)
23 files changed with 79 insertions and 70 deletions:
0 comments (0 inline, 0 general)
src/cargotype.h
Show inline comments
 
@@ -154,11 +154,21 @@ static inline bool IsCargoInClass(CargoI
 
#define FOR_ALL_CARGOSPECS_FROM(var, start) for (size_t cargospec_index = start; var = NULL, cargospec_index < CargoSpec::GetArraySize(); cargospec_index++) \
 
		if ((var = CargoSpec::Get(cargospec_index))->IsValid())
 
#define FOR_ALL_CARGOSPECS(var) FOR_ALL_CARGOSPECS_FROM(var, 0)
 

	
 
#define FOR_EACH_SET_CARGO_ID(var, cargo_bits) FOR_EACH_SET_BIT_EX(CargoID, var, uint, cargo_bits)
 

	
 
/**
 
 * Loop header for iterating over cargoes, sorted by name. This includes phony cargoes like regearing cargoes.
 
 * @param var Reference getting the cargospec.
 
 * @see CargoSpec
 
 */
 
#define FOR_ALL_SORTED_CARGOSPECS(var) for (uint8 index = 0; var = _sorted_cargo_specs[index], index < _sorted_cargo_specs_size; index++)
 

	
 
/**
 
 * Loop header for iterating over 'real' cargoes, sorted by name. Phony cargoes like regearing cargoes are skipped.
 
 * @param var Reference getting the cargospec.
 
 * @see CargoSpec
 
 */
 
#define FOR_ALL_SORTED_STANDARD_CARGOSPECS(var) for (uint8 index = 0; var = _sorted_cargo_specs[index], index < _sorted_standard_cargo_specs_size; index++)
 

	
 
#endif /* CARGOTYPE_H */
src/core/bitmath_func.hpp
Show inline comments
 
@@ -10,24 +10,24 @@
 
/** @file bitmath_func.hpp Functions related to bit mathematics. */
 

	
 
#ifndef BITMATH_FUNC_HPP
 
#define BITMATH_FUNC_HPP
 

	
 
/**
 
 * Fetch n bits from x, started at bit s.
 
 * Fetch \a n bits from \a x, started at bit \a s.
 
 *
 
 * This function can be used to fetch n bits from the value x. The
 
 * s value set the startposition to read. The startposition is
 
 * count from the LSB and starts at 0. The result starts at a
 
 * This function can be used to fetch \a n bits from the value \a x. The
 
 * \a s value set the start position to read. The start position is
 
 * count from the LSB and starts at \c 0. The result starts at a
 
 * LSB, as this isn't just an and-bitmask but also some
 
 * bit-shifting operations. GB(0xFF, 2, 1) will so
 
 * return 0x01 (0000 0001) instead of
 
 * 0x04 (0000 0100).
 
 *
 
 * @param x The value to read some bits.
 
 * @param s The startposition to read some bits.
 
 * @param s The start position to read some bits.
 
 * @param n The number of bits to read.
 
 * @return The selected bits, aligned to a LSB.
 
 */
 
template <typename T>
 
static inline uint GB(const T x, const uint8 s, const uint8 n)
 
{
 
@@ -41,16 +41,16 @@ static inline uint GB(const T x, const u
 
 * \a d. The parameters \a x, \a s and \a n works the same as the parameters of
 
 * #GB. The result is saved in \a x again. Unused bits in the window
 
 * provided by n are set to 0 if the value of \a d isn't "big" enough.
 
 * This is not a bug, its a feature.
 
 *
 
 * @note Parameter \a x must be a variable as the result is saved there.
 
 * @note To avoid unexpecting results the value of \a d should not use more
 
 * @note To avoid unexpected results the value of \a d should not use more
 
 *       space as the provided space of \a n bits (log2)
 
 * @param x The variable to change some bits
 
 * @param s The startposition for the new bits
 
 * @param s The start position for the new bits
 
 * @param n The size/window for the new bits
 
 * @param d The actually new bits to save in the defined position.
 
 * @return The new value of \a x
 
 */
 
template <typename T, typename U>
 
static inline T SB(T &x, const uint8 s, const uint8 n, const U d)
 
@@ -58,25 +58,25 @@ static inline T SB(T &x, const uint8 s, 
 
	x &= (T)(~((((T)1U << n) - 1) << s));
 
	x |= (T)(d << s);
 
	return x;
 
}
 

	
 
/**
 
 * Add i to n bits of x starting at bit s.
 
 * Add \a i to \a n bits of \a x starting at bit \a s.
 
 *
 
 * This add the value of i on n bits of x starting at bit s. The parameters x,
 
 * s, i are similar to #GB besides x must be a variable as the result are
 
 * This adds the value of \a i on \a n bits of \a x starting at bit \a s. The parameters \a x,
 
 * \a s, \a i are similar to #GB. Besides, \ a x must be a variable as the result are
 
 * saved there. An overflow does not affect the following bits of the given
 
 * bit window and is simply ignored.
 
 *
 
 * @note Parameter x must be a variable as the result is saved there.
 
 * @param x The variable to add some bits at some position
 
 * @param s The startposition of the addition
 
 * @param s The start position of the addition
 
 * @param n The size/window for the addition
 
 * @param i The value to add at the given startposition in the given window.
 
 * @return The new value of x
 
 * @param i The value to add at the given start position in the given window.
 
 * @return The new value of \a x
 
 */
 
template <typename T, typename U>
 
static inline T AB(T &x, const uint8 s, const uint8 n, const U i)
 
{
 
	const T mask = ((((T)1U << n) - 1) << s);
 
	x = (T)((x & ~mask) | ((x + (i << s)) & mask));
 
@@ -84,14 +84,14 @@ static inline T AB(T &x, const uint8 s, 
 
}
 

	
 
/**
 
 * Checks if a bit in a value is set.
 
 *
 
 * This function checks if a bit inside a value is set or not.
 
 * The y value specific the position of the bit, started at the
 
 * LSB and count from 0.
 
 * The \a y value specific the position of the bit, started at the
 
 * LSB and count from \c 0.
 
 *
 
 * @param x The value to check
 
 * @param y The position of the bit to check, started from the LSB
 
 * @return True if the bit is set, false else.
 
 */
 
template <typename T>
 
@@ -162,13 +162,13 @@ static inline T ClrBit(T &x, const uint8
 
 * Toggles a bit in a variable.
 
 *
 
 * This function toggles a bit in a variable. The variable is
 
 * changed and the value is also returned. Parameter y defines the bit
 
 * to toggle and starts at the LSB with 0.
 
 *
 
 * @param x The varliable to toggle the bit
 
 * @param x The variable to toggle the bit
 
 * @param y The bit position to toggle
 
 * @return The new value of the old value with the bit toggled
 
 */
 
template <typename T>
 
static inline T ToggleBit(T &x, const uint8 y)
 
{
 
@@ -278,31 +278,31 @@ template <typename T>
 
static inline bool HasAtMostOneBit(T value)
 
{
 
	return (value & (value - 1)) == 0;
 
}
 

	
 
/**
 
 * ROtate x Left by n
 
 * ROtate \a x Left by \a n
 
 *
 
 * @note Assumes a byte has 8 bits
 
 * @param x The value which we want to rotate
 
 * @param n The number how many we waht to rotate
 
 * @param n The number how many we want to rotate
 
 * @return A bit rotated number
 
 */
 
template <typename T>
 
static inline T ROL(const T x, const uint8 n)
 
{
 
	return (T)(x << n | x >> (sizeof(x) * 8 - n));
 
}
 

	
 
/**
 
 * ROtate x Right by n
 
 * ROtate \a x Right by \a n
 
 *
 
 * @note Assumes a byte has 8 bits
 
 * @param x The value which we want to rotate
 
 * @param n The number how many we waht to rotate
 
 * @param n The number how many we want to rotate
 
 * @return A bit rotated number
 
 */
 
template <typename T>
 
static inline T ROR(const T x, const uint8 n)
 
{
 
	return (T)(x >> n | x << (sizeof(x) * 8 - n));
src/core/overflowsafe_type.hpp
Show inline comments
 
@@ -12,13 +12,13 @@
 
#ifndef OVERFLOWSAFE_TYPE_HPP
 
#define OVERFLOWSAFE_TYPE_HPP
 

	
 

	
 
/**
 
 * Overflow safe template for integers, i.e. integers that will never overflow
 
 * you multiply the maximum value with 2, or add 2, or substract somethng from
 
 * you multiply the maximum value with 2, or add 2, or subtract something from
 
 * the minimum value, etc.
 
 * @param T     the type these integers are stored with.
 
 * @param T_MAX the maximum value for the integers.
 
 * @param T_MIN the minimum value for the integers.
 
 */
 
template <class T, T T_MAX, T T_MIN>
 
@@ -51,13 +51,13 @@ public:
 
		} else {
 
			this->m_value += other.m_value;
 
		}
 
		return *this;
 
	}
 

	
 
	/* Operators for addition and substraction */
 
	/* Operators for addition and subtraction */
 
	inline OverflowSafeInt  operator +  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result += other; return result; }
 
	inline OverflowSafeInt  operator +  (const int              other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
 
	inline OverflowSafeInt  operator +  (const uint             other) const { OverflowSafeInt result = *this; result += (int64)other; return result; }
 
	inline OverflowSafeInt& operator -= (const OverflowSafeInt& other)       { return *this += (-other); }
 
	inline OverflowSafeInt  operator -  (const OverflowSafeInt& other) const { OverflowSafeInt result = *this; result -= other; return result; }
 
	inline OverflowSafeInt  operator -  (const int              other) const { OverflowSafeInt result = *this; result -= (int64)other; return result; }
src/core/random_func.hpp
Show inline comments
 
@@ -132,13 +132,13 @@ static inline bool Chance16(const uint a
 
/**
 
 * Flips a coin with a given probability and saves the randomize-number in a variable.
 
 *
 
 * This function uses the same parameters as Chance16. The third parameter
 
 * must be a variable the randomize-number from Random() is saved in.
 
 *
 
 * The low 16 bits of r will already be used and can therefor not be passed to
 
 * The low 16 bits of r will already be used and can therefore not be passed to
 
 * Chance16I. One can only send the high 16 bits to Chance16I.
 
 *
 
 * @see Chance16I()
 
 * @param a The numerator of the fraction
 
 * @param b The denominator of the fraction
 
 * @param r The variable to save the randomize-number from Random()
src/fontcache.cpp
Show inline comments
 
@@ -59,13 +59,13 @@ FreeTypeSettings _freetype;
 

	
 
static const byte FACE_COLOUR   = 1;
 
static const byte SHADOW_COLOUR = 2;
 

	
 
/**
 
 * Get the font loaded into a Freetype face by using a font-name.
 
 * If no appropiate font is found, the function returns an error
 
 * If no appropriate font is found, the function returns an error
 
 */
 

	
 
/* ========================================================================================
 
 * Windows support
 
 * ======================================================================================== */
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -106,13 +106,13 @@ static inline void GetAllCargoSuffixes(u
 
		} else {
 
			suffixes[j][0] = '\0';
 
		}
 
	}
 
}
 

	
 
IndustryType _sorted_industry_types[NUM_INDUSTRYTYPES];
 
IndustryType _sorted_industry_types[NUM_INDUSTRYTYPES]; ///< Industry types sorted by name.
 

	
 
/** Sort industry types by their name. */
 
static int CDECL IndustryTypeNameSorter(const IndustryType *a, const IndustryType *b)
 
{
 
	static char industry_name[2][64];
 

	
src/main_gui.cpp
Show inline comments
 
@@ -438,13 +438,13 @@ struct MainWindow : Window
 
	 * @param data Information about the changed data.
 
	 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
 
	 */
 
	virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
 
	{
 
		if (!gui_scope) return;
 
		/* Forward the message to the appropiate toolbar (ingame or scenario editor) */
 
		/* Forward the message to the appropriate toolbar (ingame or scenario editor) */
 
		InvalidateWindowData(WC_MAIN_TOOLBAR, 0, data, true);
 
	}
 

	
 
	static Hotkey<MainWindow> global_hotkeys[];
 
};
 

	
src/map_type.h
Show inline comments
 
@@ -34,13 +34,13 @@ struct TileExtended {
 
	byte m7; ///< Primarily used for newgrf support
 
};
 

	
 
/**
 
 * An offset value between to tiles.
 
 *
 
 * This value is used fro the difference between
 
 * This value is used for the difference between
 
 * to tiles. It can be added to a tileindex to get
 
 * the resulting tileindex of the start tile applied
 
 * with this saved difference.
 
 *
 
 * @see TileDiffXY(int, int)
 
 */
src/network/core/tcp_game.h
Show inline comments
 
@@ -26,13 +26,13 @@
 
 * For the exact meaning, look at #NetworkGameSocketHandler.
 
 */
 
enum PacketGameType {
 
	/*
 
	 * These first three pair of packets (thus six in
 
	 * total) must remain in this order for backward
 
	 * and forward compatability between clients that
 
	 * and forward compatibility between clients that
 
	 * are trying to join directly.
 
	 */
 

	
 
	/* Packets sent by socket accepting code without ever constructing a client socket instance. */
 
	PACKET_SERVER_FULL,                  ///< The server is full and has no place for you.
 
	PACKET_SERVER_BANNED,                ///< The server has banned you.
src/network/network_gamelist.cpp
Show inline comments
 
@@ -168,29 +168,29 @@ void NetworkGameListRequery()
 
 * Rebuild the GRFConfig's of the servers in the game list as we did
 
 * a rescan and might have found new NewGRFs.
 
 */
 
void NetworkAfterNewGRFScan()
 
{
 
	for (NetworkGameList *item = _network_game_list; item != NULL; item = item->next) {
 
		/* Reset compatability state */
 
		/* Reset compatibility state */
 
		item->info.compatible = item->info.version_compatible;
 

	
 
		for (GRFConfig *c = item->info.grfconfig; c != NULL; c = c->next) {
 
			assert(HasBit(c->flags, GCF_COPY));
 

	
 
			const GRFConfig *f = FindGRFConfig(c->ident.grfid, FGCM_EXACT, c->ident.md5sum);
 
			if (f == NULL) {
 
				/* Don't know the GRF, so mark game incompatible and the (possibly)
 
				 * already resolved name for this GRF (another server has sent the
 
				 * name of the GRF already */
 
				 * name of the GRF already. */
 
				c->name->Release();
 
				c->name = FindUnknownGRFName(c->ident.grfid, c->ident.md5sum, true);
 
				c->name->AddRef();
 
				c->status = GCS_NOT_FOUND;
 

	
 
				/* If we miss a file, we're obviously incompatible */
 
				/* If we miss a file, we're obviously incompatible. */
 
				item->info.compatible = false;
 
			} else {
 
				c->filename = f->filename;
 
				c->name->Release();
 
				c->name = f->name;
 
				c->name->AddRef();
src/network/network_gui.cpp
Show inline comments
 
@@ -69,13 +69,12 @@ void SortNetworkLanguages()
 
	QSortT(_language_dropdown + 1, NETLANG_COUNT - 1, &StringIDSorter);
 
}
 

	
 
/**
 
 * Update the network new window because a new server is
 
 * found on the network.
 
 * @param unselect unselect the currently selected item
 
 */
 
void UpdateNetworkGameWindow()
 
{
 
	InvalidateWindowData(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME, 0);
 
}
 

	
 
@@ -847,13 +846,13 @@ public:
 
					break;
 
				default: break;
 
			}
 

	
 
			this->server = this->servers[this->list_pos];
 

	
 
			/* scroll to the new server if it is outside the current range */
 
			/* Scroll to the new server if it is outside the current range. */
 
			this->ScrollToSelectedServer();
 

	
 
			/* redraw window */
 
			this->SetDirty();
 
			return ES_HANDLED;
 
		}
 
@@ -1034,13 +1033,13 @@ void ShowNetworkGameWindow()
 
	DeleteWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_LOBBY);
 
	DeleteWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_START);
 

	
 
	/* Only show once */
 
	if (first) {
 
		first = false;
 
		/* add all servers from the config file to our list */
 
		/* Add all servers from the config file to our list. */
 
		for (char **iter = _network_host_list.Begin(); iter != _network_host_list.End(); iter++) {
 
			NetworkAddServer(*iter);
 
		}
 
	}
 

	
 
	new NetworkGameWindow(&_network_game_window_desc);
 
@@ -1098,13 +1097,13 @@ struct NetworkStartServerWindow : public
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		switch (widget) {
 
			case WID_NSS_SETPWD:
 
				/* if password is set, draw red '*' next to 'Set password' button */
 
				/* If password is set, draw red '*' next to 'Set password' button. */
 
				if (!StrEmpty(_settings_client.network.server_password)) DrawString(r.right + WD_FRAMERECT_LEFT, this->width - WD_FRAMERECT_RIGHT, r.top, "*", TC_RED);
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
@@ -1123,13 +1122,13 @@ struct NetworkStartServerWindow : public
 
				ShowDropDownMenu(this, _connection_types_dropdown, _settings_client.network.server_advertise, WID_NSS_CONNTYPE_BTN, 0, 0); // do it for widget WID_NSS_CONNTYPE_BTN
 
				break;
 

	
 
			case WID_NSS_CLIENTS_BTND:    case WID_NSS_CLIENTS_BTNU:    // Click on up/down button for number of clients
 
			case WID_NSS_COMPANIES_BTND:  case WID_NSS_COMPANIES_BTNU:  // Click on up/down button for number of companies
 
			case WID_NSS_SPECTATORS_BTND: case WID_NSS_SPECTATORS_BTNU: // Click on up/down button for number of spectators
 
				/* Don't allow too fast scrolling */
 
				/* Don't allow too fast scrolling. */
 
				if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
 
					this->HandleButtonClick(widget);
 
					this->SetDirty();
 
					switch (widget) {
 
						default: NOT_REACHED();
 
						case WID_NSS_CLIENTS_BTND: case WID_NSS_CLIENTS_BTNU:
 
@@ -1350,13 +1349,13 @@ static void ShowNetworkStartServerWindow
 
	DeleteWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_LOBBY);
 

	
 
	new NetworkStartServerWindow(&_network_start_server_window_desc);
 
}
 

	
 
struct NetworkLobbyWindow : public Window {
 
	CompanyID company;       ///< Select company
 
	CompanyID company;       ///< Selected company
 
	NetworkGameList *server; ///< Selected server
 
	NetworkCompanyInfo company_info[MAX_COMPANIES];
 
	Scrollbar *vscroll;
 

	
 
	NetworkLobbyWindow(const WindowDesc *desc, NetworkGameList *ngl) :
 
			Window(), company(INVALID_COMPANY), server(ngl)
 
@@ -1366,13 +1365,13 @@ struct NetworkLobbyWindow : public Windo
 
		this->FinishInitNested(desc, WN_NETWORK_WINDOW_LOBBY);
 
		this->OnResize();
 
	}
 

	
 
	CompanyID NetworkLobbyFindCompanyIndex(byte pos) const
 
	{
 
		/* Scroll through all this->company_info and get the 'pos' item that is not empty */
 
		/* Scroll through all this->company_info and get the 'pos' item that is not empty. */
 
		for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) {
 
			if (!StrEmpty(this->company_info[i].company_name)) {
 
				if (pos-- == 0) return i;
 
			}
 
		}
 

	
 
@@ -1420,17 +1419,17 @@ struct NetworkLobbyWindow : public Windo
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		const NetworkGameInfo *gi = &this->server->info;
 

	
 
		/* Join button is disabled when no company is selected and for AI companies*/
 
		/* Join button is disabled when no company is selected and for AI companies. */
 
		this->SetWidgetDisabledState(WID_NL_JOIN, this->company == INVALID_COMPANY || GetLobbyCompanyInfo(this->company)->ai);
 
		/* Cannot start new company if there are too many */
 
		/* Cannot start new company if there are too many. */
 
		this->SetWidgetDisabledState(WID_NL_NEW, gi->companies_on >= gi->companies_max);
 
		/* Cannot spectate if there are too many spectators */
 
		/* Cannot spectate if there are too many spectators. */
 
		this->SetWidgetDisabledState(WID_NL_SPECTATE, gi->spectators_on >= gi->spectators_max);
 

	
 
		this->vscroll->SetCount(gi->companies_on);
 

	
 
		/* Draw window widgets */
 
		this->DrawWidgets();
 
@@ -1478,13 +1477,13 @@ struct NetworkLobbyWindow : public Windo
 
		}
 
	}
 

	
 
	void DrawDetails(const Rect &r) const
 
	{
 
		const int detail_height = 12 + FONT_HEIGHT_NORMAL + 12;
 
		/* Draw info about selected company when it is selected in the left window */
 
		/* Draw info about selected company when it is selected in the left window. */
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE);
 
		DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 12, STR_NETWORK_GAME_LOBBY_COMPANY_INFO, TC_FROMSTRING, SA_HOR_CENTER);
 

	
 
		if (this->company == INVALID_COMPANY || StrEmpty(this->company_info[this->company].company_name)) return;
 

	
 
		int y = r.top + detail_height + 4;
 
@@ -1556,13 +1555,13 @@ struct NetworkLobbyWindow : public Windo
 
				/* FIXME the disabling should go into some InvalidateData, which is called instead of the SetDirty */
 
				if (click_count > 1 && !this->IsWidgetDisabled(WID_NL_JOIN)) this->OnClick(pt, WID_NL_JOIN, 1);
 
				break;
 
			}
 

	
 
			case WID_NL_JOIN:     // Join company
 
				/* Button can be clicked only when it is enabled */
 
				/* Button can be clicked only when it is enabled. */
 
				NetworkClientConnectGame(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port), this->company);
 
				break;
 

	
 
			case WID_NL_NEW:      // New company
 
				NetworkClientConnectGame(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port), COMPANY_NEW_COMPANY);
 
				break;
 
@@ -1754,19 +1753,19 @@ struct NetworkClientListPopupWindow : Wi
 
		if (Company::IsValidID(ci->client_playas) || ci->client_playas == COMPANY_SPECTATOR) {
 
			this->AddAction(STR_NETWORK_CLIENTLIST_SPEAK_TO_COMPANY, &ClientList_SpeakToCompany);
 
		}
 
		this->AddAction(STR_NETWORK_CLIENTLIST_SPEAK_TO_ALL, &ClientList_SpeakToAll);
 

	
 
		if (_network_own_client_id != ci->client_id) {
 
			/* We are no spectator and the company we want to give money to is no spectator and money gifts are allowed */
 
			/* We are no spectator and the company we want to give money to is no spectator and money gifts are allowed. */
 
			if (Company::IsValidID(_local_company) && Company::IsValidID(ci->client_playas) && _settings_game.economy.give_money) {
 
				this->AddAction(STR_NETWORK_CLIENTLIST_GIVE_MONEY, &ClientList_GiveMoney);
 
			}
 
		}
 

	
 
		/* A server can kick clients (but not himself) */
 
		/* A server can kick clients (but not himself). */
 
		if (_network_server && _network_own_client_id != ci->client_id) {
 
			this->AddAction(STR_NETWORK_CLIENTLIST_KICK, &ClientList_Kick);
 
			this->AddAction(STR_NETWORK_CLIENTLIST_BAN, &ClientList_Ban);
 
		}
 

	
 
		this->InitNested(desc, client_id);
src/newgrf_gui.cpp
Show inline comments
 
@@ -1396,13 +1396,13 @@ private:
 
			if (_settings_client.gui.newgrf_show_old_versions) {
 
				*this->avails.Append() = c;
 
			} else {
 
				const GRFConfig *best = FindGRFConfig(c->ident.grfid, HasBit(c->flags, GCF_INVALID) ? FGCM_NEWEST : FGCM_NEWEST_VALID);
 
				/*
 
				 * If the best version is 0, then all NewGRF with this GRF ID
 
				 * have version 0, so for backward compatability reasons we
 
				 * have version 0, so for backward compatibility reasons we
 
				 * want to show them all.
 
				 * If we are the best version, then we definitely want to
 
				 * show that NewGRF!.
 
				 */
 
				if (best->version == 0 || best->ident.HasGrfIdentifier(c->ident.grfid, c->ident.md5sum)) {
 
					*this->avails.Append() = c;
src/order_type.h
Show inline comments
 
@@ -58,14 +58,14 @@ enum OrderUnloadFlags {
 

	
 
/**
 
 * Flags related to the loading order.
 
 */
 
enum OrderLoadFlags {
 
	OLF_LOAD_IF_POSSIBLE = 0,      ///< Load as long as there is cargo that fits in the train.
 
	OLFB_FULL_LOAD       = 1 << 1, ///< Full load the complete the consist.
 
	OLF_FULL_LOAD_ANY    = 3,      ///< Full load the a single cargo of the consist.
 
	OLFB_FULL_LOAD       = 1 << 1, ///< Full load all cargoes of the consist.
 
	OLF_FULL_LOAD_ANY    = 3,      ///< Full load a single cargo of the consist.
 
	OLFB_NO_LOAD         = 4,      ///< Do not load anything.
 
};
 

	
 
/**
 
 * Non-stop order flags.
 
 */
 
@@ -134,13 +134,13 @@ enum OrderConditionComparator {
 
	OCC_IS_FALSE,    ///< Skip if the variable is false
 
	OCC_END
 
};
 

	
 

	
 
/**
 
 * Enumeration for the data to set in CmdModifyOrder.
 
 * Enumeration for the data to set in #CmdModifyOrder.
 
 */
 
enum ModifyOrderFlags {
 
	MOF_NON_STOP,        ///< Passes an OrderNonStopFlags.
 
	MOF_STOP_LOCATION,   ///< Passes an OrderStopLocation.
 
	MOF_UNLOAD,          ///< Passes an OrderUnloadType.
 
	MOF_LOAD,            ///< Passes an OrderLoadType
 
@@ -151,34 +151,34 @@ enum ModifyOrderFlags {
 
	MOF_COND_DESTINATION,///< Change the destination of a conditional order.
 
	MOF_END
 
};
 
template <> struct EnumPropsT<ModifyOrderFlags> : MakeEnumPropsT<ModifyOrderFlags, byte, MOF_NON_STOP, MOF_END, MOF_END, 4> {};
 

	
 
/**
 
 * Depot action to switch to when doing a MOF_DEPOT_ACTION.
 
 * Depot action to switch to when doing a #MOF_DEPOT_ACTION.
 
 */
 
enum OrderDepotAction {
 
	DA_ALWAYS_GO, ///< Always go to the depot
 
	DA_SERVICE,   ///< Service only if needed
 
	DA_STOP,      ///< Go to the depot and stop there
 
	DA_END
 
};
 

	
 
/**
 
 * Enumeration for the data to set in CmdChangeTimetable.
 
 * Enumeration for the data to set in #CmdChangeTimetable.
 
 */
 
enum ModifyTimetableFlags {
 
	MTF_WAIT_TIME,    ///< Set wait time.
 
	MTF_TRAVEL_TIME,  ///< Set travel time.
 
	MTF_TRAVEL_SPEED, ///< Set max travel speed.
 
	MTF_END
 
};
 
template <> struct EnumPropsT<ModifyTimetableFlags> : MakeEnumPropsT<ModifyTimetableFlags, byte, MTF_WAIT_TIME, MTF_END, MTF_END, 2> {};
 

	
 

	
 
/* Possible clone options */
 
/** Clone actions. */
 
enum CloneOptions {
 
	CO_SHARE   = 0,
 
	CO_COPY    = 1,
 
	CO_UNSHARE = 2
 
};
 

	
src/roadstop.cpp
Show inline comments
 
@@ -41,13 +41,13 @@ RoadStop::~RoadStop()
 
 */
 
RoadStop *RoadStop::GetNextRoadStop(const RoadVehicle *v) const
 
{
 
	for (RoadStop *rs = this->next; rs != NULL; rs = rs->next) {
 
		/* The vehicle cannot go to this roadstop (different roadtype) */
 
		if ((GetRoadTypes(rs->xy) & v->compatible_roadtypes) == ROADTYPES_NONE) continue;
 
		/* The vehicle is articulated and can therefor not go the a standard road stop */
 
		/* The vehicle is articulated and can therefore not go to a standard road stop. */
 
		if (IsStandardRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue;
 

	
 
		/* The vehicle can actually go to this road stop. So, return it! */
 
		return rs;
 
	}
 

	
src/saveload/afterload.cpp
Show inline comments
 
@@ -633,13 +633,13 @@ bool AfterLoadGame()
 

	
 
	/* Update current year
 
	 * must be done before loading sprites as some newgrfs check it */
 
	SetDate(_date, _date_fract);
 

	
 
	/*
 
	 * Force the old behaviour for compatability reasons with old savegames.
 
	 * Force the old behaviour for compatibility reasons with old savegames.
 
	 *
 
	 * Note that there is no non-stop in here. This is because the setting could have
 
	 * either value in TTDPatch. To convert it properly the user has to make sure the
 
	 * right value has been chosen in the settings. Otherwise we will be converting
 
	 * it incorrectly in half of the times without a means to correct that.
 
	 */
src/saveload/saveload.cpp
Show inline comments
 
@@ -1215,13 +1215,13 @@ static size_t ReferenceToInt(const void 
 
		default: NOT_REACHED();
 
	}
 
}
 

	
 
/**
 
 * Pointers cannot be loaded from a savegame, so this function
 
 * gets the index from the savegame and returns the appropiate
 
 * gets the index from the savegame and returns the appropriate
 
 * pointer from the already loaded base.
 
 * Remember that an index of 0 is a NULL pointer so all indices
 
 * are +1 so vehicle 0 is saved as 1.
 
 * @param index The index that is being converted to a pointer
 
 * @param rt SLRefType type of the object the pointer is sought of
 
 * @return Return the index converted to a pointer of any type
 
@@ -1672,13 +1672,13 @@ static void SlStubSaveProc()
 
{
 
	SlAutolength(SlStubSaveProc2, NULL);
 
}
 

	
 
/**
 
 * Save a chunk of data (eg. vehicles, stations, etc.). Each chunk is
 
 * prefixed by an ID identifying it, followed by data, and terminator where appropiate
 
 * prefixed by an ID identifying it, followed by data, and terminator where appropriate
 
 * @param ch The chunkhandler that will be used for the operation
 
 */
 
static void SlSaveChunk(const ChunkHandler *ch)
 
{
 
	ChunkSaveLoadProc *proc = ch->save_proc;
 

	
 
@@ -1727,13 +1727,13 @@ static void SlSaveChunks()
 
}
 

	
 
/**
 
 * Find the ChunkHandler that will be used for processing the found
 
 * chunk in the savegame or in memory
 
 * @param id the chunk in question
 
 * @return returns the appropiate chunkhandler
 
 * @return returns the appropriate chunkhandler
 
 */
 
static const ChunkHandler *SlFindChunkHandler(uint32 id)
 
{
 
	FOR_ALL_CHUNK_HANDLERS(ch) if (ch->id == id) return ch;
 
	return NULL;
 
}
 
@@ -2405,13 +2405,13 @@ static void SaveFileError()
 
	ShowErrorMessage(STR_JUST_RAW_STRING, INVALID_STRING_ID, WL_ERROR);
 
	SaveFileDone();
 
}
 

	
 
/**
 
 * We have written the whole game into memory, _memory_savegame, now find
 
 * and appropiate compressor and start writing to file.
 
 * and appropriate compressor and start writing to file.
 
 */
 
static SaveOrLoadResult SaveFileToDisk(bool threaded)
 
{
 
	try {
 
		byte compression;
 
		const SaveLoadFormat *fmt = GetSavegameFormat(_savegame_format, &compression);
src/script/api/script_group.hpp
Show inline comments
 
@@ -110,13 +110,13 @@ public:
 
	 * @return The number of engines with id engine_id in the group with id group_id.
 
	 */
 
	static int32 GetNumEngines(GroupID group_id, EngineID engine_id);
 

	
 
	/**
 
	 * Move a vehicle to a group.
 
	 * @param group_id The group to move the vehicel to.
 
	 * @param group_id The group to move the vehicle to.
 
	 * @param vehicle_id The vehicle to move to the group.
 
	 * @pre IsValidGroup(group_id) || group_id == GROUP_DEFAULT.
 
	 * @pre ScriptVehicle::IsValidVehicle(vehicle_id).
 
	 * @return True if and only if the vehicle was successfully moved to the group.
 
	 * @note A vehicle can be in only one group at the same time. To remove it from
 
	 *  a group, move it to another or to GROUP_DEFAULT. Moving the vehicle to the
 
@@ -126,13 +126,13 @@ public:
 

	
 
	/**
 
	 * Enable or disable the removal of wagons when a (part of a) vehicle is
 
	 *  (auto)replaced with a longer variant (longer wagons or longer engines)
 
	 *  If enabled, wagons are removed from the end of the vehicle until it
 
	 *  fits in the same number of tiles as it did before.
 
	 * @param keep_length If true, wagons will be removed if the a new engine is longer.
 
	 * @param keep_length If true, wagons will be removed if the new engine is longer.
 
	 * @return True if and only if the value was successfully changed.
 
	 */
 
	static bool EnableWagonRemoval(bool keep_length);
 

	
 
	/**
 
	 * Get the current status of wagon removal.
src/script/api/script_info_docs.hpp
Show inline comments
 
@@ -130,13 +130,13 @@ public:
 
	bool UseAsRandomAI();
 

	
 
	/**
 
	 * Can a non-developer select Script for a new game.
 
	 *
 
	 * The idea behind this function is to 'forbid' using your script with a new
 
	 *  game if you for example specificly wrote it for a certain scenario.
 
	 *  game if you for example specifically wrote it for a certain scenario.
 
	 *
 
	 * @return True if the Script can be selected from the GUI as non-developer.
 
	 * @note This function is optional. Default is false.
 
	 *
 
	 * @api -ai
 
	 */
 
@@ -150,19 +150,19 @@ public:
 
	 * @note This function is required.
 
	 */
 
	string CreateInstance();
 

	
 
	/**
 
	 * Gets the API version this Script is written for. If this function
 
	 * does not exist API compatability with version 0.7 is assumed.
 
	 * does not exist API compatibility with version 0.7 is assumed.
 
	 * If the function returns something OpenTTD does not understand,
 
	 * for example a newer version or a string that is not a version,
 
	 * the Script will not be loaded.
 
	 *
 
	 * Although in the future we might need to make a separate
 
	 * compatability 'wrapper' for a specific version of OpenTTD, for
 
	 * compatibility 'wrapper' for a specific version of OpenTTD, for
 
	 * example '0.7.1', we will use only the major and minor number
 
	 * and not the bugfix number as valid return for this function.
 
	 *
 
	 * Valid return values are:
 
	 * - "0.7" (for AI only)
 
	 * - "1.0" (for AI only)
 
@@ -243,13 +243,13 @@ public:
 
	/**
 
	 * Add labels for the values of a setting. Instead of a number the
 
	 *  user will see the corresponding name.
 
	 * @param setting_name The name of the setting.
 
	 * @param value_names A table that maps values to names. The first
 
	 *   character of every identifier is ignored and the rest should
 
	 *   be the an integer of the value you define a name for. The value
 
	 *   be an integer of the value you define a name for. The value
 
	 *   is a short description of that value.
 
	 * To define labels for a setting named "competition_level" you could
 
	 * for example call it like this:
 
	 * AddLabels("competition_level", {_0 = "no competition", _1 = "some competition",
 
	 * _2 = "a lot of competition"});
 
	 *
src/script/script_info_dummy.cpp
Show inline comments
 
@@ -14,15 +14,15 @@
 

	
 
#include "../string_func.h"
 
#include "../strings_func.h"
 

	
 
/* The reason this exists in C++, is that a user can trash his ai/ or game/ dir,
 
 *  leaving no Scripts available. The complexity to solve this is insane, and
 
 *  therefor the alternative is used, and make sure there is always a Script
 
 *  therefore the alternative is used, and make sure there is always a Script
 
 *  available, no matter what the situation is. By defining it in C++, there
 
 *  is simply no way a user can delete it, and therefor safe to use. It has
 
 *  is simply no way a user can delete it, and therefore safe to use. It has
 
 *  to be noted that this Script is complete invisible for the user, and impossible
 
 *  to select manual. It is a fail-over in case no Scripts are available.
 
 */
 

	
 
/** Run the dummy info.nut. */
 
void Script_CreateDummyInfo(HSQUIRRELVM vm, const char *type, const char *dir)
src/settings_gui.cpp
Show inline comments
 
@@ -1393,13 +1393,13 @@ bool SettingEntry::UpdateFilterState(Str
 
 *  |-- setting
 
 *  |-- (-) - Title
 
 *  |    |-- setting
 
 *  |    |-- setting
 
 * \endverbatim
 
 * The left-most vertical line is not wanted. It is prevented by setting the
 
 * appropiate bit in the \a parent_last parameter.
 
 * appropriate bit in the \a parent_last parameter.
 
 *
 
 * @param settings_ptr Pointer to current values of all settings
 
 * @param left         Left-most position in window/panel to start drawing \a first_row
 
 * @param right        Right-most x position to draw strings at.
 
 * @param base_y       Upper-most position in window/panel to start drawing \a first_row
 
 * @param first_row    First row number to draw
src/station.cpp
Show inline comments
 
@@ -140,13 +140,13 @@ RoadStop *Station::GetPrimaryRoadStop(co
 
{
 
	RoadStop *rs = this->GetPrimaryRoadStop(v->IsBus() ? ROADSTOP_BUS : ROADSTOP_TRUCK);
 

	
 
	for (; rs != NULL; rs = rs->next) {
 
		/* The vehicle cannot go to this roadstop (different roadtype) */
 
		if ((GetRoadTypes(rs->xy) & v->compatible_roadtypes) == ROADTYPES_NONE) continue;
 
		/* The vehicle is articulated and can therefor not go the a standard road stop */
 
		/* The vehicle is articulated and can therefore not go to a standard road stop. */
 
		if (IsStandardRoadStopTile(rs->xy) && v->HasArticulatedPart()) continue;
 

	
 
		/* The vehicle can actually go to this road stop. So, return it! */
 
		break;
 
	}
 

	
src/tgp.cpp
Show inline comments
 
@@ -287,13 +287,13 @@ static inline height_t RandomHeight(ampl
 
}
 

	
 
/**
 
 * One interpolation and noise round
 
 *
 
 * The heights on the map are generated in an iterative process.
 
 * We start off with a frequency of 1 (log_frequency == 0), and generate heights only for corners on the most coarsely mesh
 
 * We start off with a frequency of 1 (log_frequency == 0), and generate heights only for corners on the most coarsest mesh
 
 * (i.e. only for x/y coordinates which are multiples of the minimum edge length).
 
 *
 
 * After this initial step the frequency is doubled (log_frequency incremented) each iteration to generate corners on the next finer mesh.
 
 * The heights of the newly added corners are first set by interpolating the heights from the previous iteration.
 
 * Finally noise with the given amplitude is applied to all corners of the new mesh.
 
 *
src/town_cmd.cpp
Show inline comments
 
@@ -1089,13 +1089,13 @@ static bool GrowTownWithBridge(const Tow
 
		if (DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE).Succeeded()) {
 
			DoCommand(tile, bridge_tile, bridge_type | ROADTYPES_ROAD << 8 | TRANSPORT_ROAD << 15, DC_EXEC | CommandFlagsToDCFlags(GetCommandFlags(CMD_BUILD_BRIDGE)), CMD_BUILD_BRIDGE);
 
			_grow_town_result = GROWTH_SUCCEED;
 
			return true;
 
		}
 
	}
 
	/* Quit if it selecting an appropiate bridge type fails a large number of times. */
 
	/* Quit if it selecting an appropriate bridge type fails a large number of times. */
 
	return false;
 
}
 

	
 
/**
 
 * Grows the given town.
 
 * There are at the moment 3 possible way's for
0 comments (0 inline, 0 general)