Changeset - r19944:25a78576fb5e
[Not reviewed]
master
! ! !
planetmaker - 12 years ago 2013-01-08 22:46:42
planetmaker@openttd.org
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
242 files changed with 528 insertions and 526 deletions:
0 comments (0 inline, 0 general)
src/ai/ai.hpp
Show inline comments
 
@@ -26,7 +26,7 @@ typedef std::map<const char *, class Scr
 
class AI {
 
public:
 
	/**
 
	 * The default months AIs start after eachother.
 
	 * The default months AIs start after each other.
 
	 */
 
	enum StartNext {
 
		START_NEXT_EASY   = DAYS_IN_YEAR * 2,
src/ai/ai_core.cpp
Show inline comments
 
@@ -197,7 +197,7 @@
 

	
 
/* static */ void AI::ResetConfig()
 
{
 
	/* Check for both newgame as current game if we can reload the AIInfo insde
 
	/* Check for both newgame as current game if we can reload the AIInfo inside
 
	 *  the AIConfig. If not, remove the AI from the list (which will assign
 
	 *  a random new AI on reload). */
 
	for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
src/ai/ai_scanner.hpp
Show inline comments
 
@@ -30,7 +30,7 @@ public:
 
	/**
 
	 * Check if we have an AI by name and version available in our list.
 
	 * @param nameParam The name of the AI.
 
	 * @param versionParam The versionof the AI, or -1 if you want the latest.
 
	 * @param versionParam The version of the AI, or -1 if you want the latest.
 
	 * @param force_exact_match Only match name+version, never latest.
 
	 * @return NULL if no match found, otherwise the AI that matched.
 
	 */
src/aircraft_cmd.cpp
Show inline comments
 
@@ -635,7 +635,7 @@ static int UpdateAircraftSpeed(Aircraft 
 
	/* Adjust distance moved by plane speed setting */
 
	if (_settings_game.vehicle.plane_speed > 1) spd /= _settings_game.vehicle.plane_speed;
 

	
 
	/* Convert direction-indepenent speed into direction-dependent speed. (old movement method) */
 
	/* Convert direction-independent speed into direction-dependent speed. (old movement method) */
 
	spd = v->GetOldAdvanceSpeed(spd);
 

	
 
	spd += v->progress;
 
@@ -660,7 +660,7 @@ int GetAircraftFlyingAltitude(const Airc
 
	int base_altitude = PLANE_HOLDING_ALTITUDE;
 

	
 
	/* Make sure eastbound and westbound planes do not "crash" into each
 
	 * other by providing them with vertical seperation
 
	 * other by providing them with vertical separation
 
	 */
 
	switch (v->direction) {
 
		case DIR_N:
 
@@ -1380,7 +1380,7 @@ static void AircraftEventHandler_AtTermi
 
		 * and get serviced at the same time - setting */
 
		if (_settings_game.order.serviceathelipad) {
 
			if (v->subtype == AIR_HELICOPTER && apc->num_helipads > 0) {
 
				/* an exerpt of ServiceAircraft, without the invisibility stuff */
 
				/* an excerpt of ServiceAircraft, without the invisibility stuff */
 
				v->date_of_last_service = _date;
 
				v->breakdowns_since_last_service = 0;
 
				v->reliability = v->GetEngine()->reliability;
 
@@ -1402,7 +1402,7 @@ static void AircraftEventHandler_AtTermi
 
	switch (v->current_order.GetType()) {
 
		case OT_GOTO_STATION: // ready to fly to another airport
 
			break;
 
		case OT_GOTO_DEPOT:   // visit hangar for serivicing, sale, etc.
 
		case OT_GOTO_DEPOT:   // visit hangar for servicing, sale, etc.
 
			go_to_hangar = v->current_order.GetDestination() == v->targetairport;
 
			break;
 
		case OT_CONDITIONAL:
src/airport.cpp
Show inline comments
 
@@ -22,7 +22,7 @@
 
 * @param terminals The terminals.
 
 * @param num_helipads Number of heli pads.
 
 * @param flags Information about the class of FTA.
 
 * @param delta_z Height of the arport above the land.
 
 * @param delta_z Height of the airport above the land.
 
 */
 
#define AIRPORT_GENERIC(name, terminals, num_helipads, flags, delta_z) \
 
	static AirportFTAClass _airportfta_ ## name(_airport_moving_data_ ## name, terminals, \
 
@@ -41,7 +41,7 @@
 
 * Define a heliport.
 
 * @param name Suffix of the names of the helipad data.
 
 * @param num_helipads Number of heli pads.
 
 * @param delta_z Height of the arport above the land.
 
 * @param delta_z Height of the airport above the land.
 
 */
 
#define HELIPORT(name, num_helipads, delta_z) \
 
	AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z)
src/articulated_vehicles.cpp
Show inline comments
 
@@ -68,7 +68,7 @@ bool IsArticulatedEngine(EngineID engine
 
 * Count the number of articulated parts of an engine.
 
 * @param engine_type The engine to get the number of parts of.
 
 * @param purchase_window Whether we are in the scope of the purchase window or not, i.e. whether we cannot allocate vehicles.
 
 * @return The nmumber of parts.
 
 * @return The number of parts.
 
 */
 
uint CountArticulatedParts(EngineID engine_type, bool purchase_window)
 
{
 
@@ -98,7 +98,7 @@ uint CountArticulatedParts(EngineID engi
 

	
 
/**
 
 * Returns the default (non-refitted) capacity of a specific EngineID.
 
 * @param engine the EngineID of iterest
 
 * @param engine the EngineID of interest
 
 * @param cargo_type returns the default cargo type, if needed
 
 * @return capacity
 
 */
 
@@ -113,7 +113,7 @@ static inline uint16 GetVehicleDefaultCa
 

	
 
/**
 
 * Returns all cargoes a vehicle can carry.
 
 * @param engine the EngineID of iterest
 
 * @param engine the EngineID of interest
 
 * @param include_initial_cargo_type if true the default cargo type of the vehicle is included; if false only the refit_mask
 
 * @return bit set of CargoIDs
 
 */
src/autoreplace_cmd.cpp
Show inline comments
 
@@ -66,18 +66,18 @@ bool CheckAutoreplaceValidity(EngineID f
 
			/* make sure the railtypes are compatible */
 
			if ((GetRailTypeInfo(e_from->u.rail.railtype)->compatible_railtypes & GetRailTypeInfo(e_to->u.rail.railtype)->compatible_railtypes) == 0) return false;
 

	
 
			/* make sure we do not replace wagons with engines or vise versa */
 
			/* make sure we do not replace wagons with engines or vice versa */
 
			if ((e_from->u.rail.railveh_type == RAILVEH_WAGON) != (e_to->u.rail.railveh_type == RAILVEH_WAGON)) return false;
 
			break;
 
		}
 

	
 
		case VEH_ROAD:
 
			/* make sure that we do not replace a tram with a normal road vehicles or vise versa */
 
			/* make sure that we do not replace a tram with a normal road vehicles or vice versa */
 
			if (HasBit(e_from->info.misc_flags, EF_ROAD_TRAM) != HasBit(e_to->info.misc_flags, EF_ROAD_TRAM)) return false;
 
			break;
 

	
 
		case VEH_AIRCRAFT:
 
			/* make sure that we do not replace a plane with a helicopter or vise versa */
 
			/* make sure that we do not replace a plane with a helicopter or vice versa */
 
			if ((e_from->u.air.subtype & AIR_CTOL) != (e_to->u.air.subtype & AIR_CTOL)) return false;
 
			break;
 

	
 
@@ -263,7 +263,7 @@ static CommandCost GetNewEngineType(cons
 
 * Builds and refits a replacement vehicle
 
 * Important: The old vehicle is still in the original vehicle chain (used for determining the cargo when the old vehicle did not carry anything, but the new one does)
 
 * @param old_veh A single (articulated/multiheaded) vehicle that shall be replaced.
 
 * @param new_vehicle Returns the newly build and refittet vehicle
 
 * @param new_vehicle Returns the newly build and refitted vehicle
 
 * @param part_of_chain The vehicle is part of a train
 
 * @return cost or error
 
 */
src/autoreplace_gui.cpp
Show inline comments
 
@@ -45,7 +45,7 @@ static int CDECL EngineNumberSorter(cons
 
 * @param id_g The group the engine belongs to
 
 *  Note: this function only works if it is called either
 
 *   - when a new vehicle is build, but before it's counted in num_engines
 
 *   - when a vehicle is deleted and after it's substracted from num_engines
 
 *   - when a vehicle is deleted and after it's subtracted from num_engines
 
 *   - when not changing the count (used when changing replace orders)
 
 */
 
void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
src/base_media_func.h
Show inline comments
 
@@ -269,7 +269,7 @@ template <class Tbase_set>
 
			if (missing == 0) {
 
				p += seprintf(p, last, " (%i corrupt file%s)\n", invalid, invalid == 1 ? "" : "s");
 
			} else {
 
				p += seprintf(p, last, " (unuseable: %i missing file%s)\n", missing, missing == 1 ? "" : "s");
 
				p += seprintf(p, last, " (unusable: %i missing file%s)\n", missing, missing == 1 ? "" : "s");
 
			}
 
		} else {
 
			p += seprintf(p, last, "\n");
src/blitter/32bpp_base.cpp
Show inline comments
 
@@ -107,7 +107,7 @@ void Blitter_32bppBase::ScrollBuffer(voi
 
		dst = (uint32 *)video + left + top * _screen.pitch;
 
		src = dst - scroll_y * _screen.pitch;
 

	
 
		/* Decrese height. (scroll_y is <=0). */
 
		/* Decrease height. (scroll_y is <=0). */
 
		height += scroll_y;
 
		assert(height > 0);
 

	
src/blitter/8bpp_base.cpp
Show inline comments
 
@@ -112,7 +112,7 @@ void Blitter_8bppBase::ScrollBuffer(void
 
		dst = (uint8 *)video + left + top * _screen.pitch;
 
		src = dst - scroll_y * _screen.pitch;
 

	
 
		/* Decrese height. (scroll_y is <=0). */
 
		/* Decrease height. (scroll_y is <=0). */
 
		height += scroll_y;
 
		assert(height > 0);
 

	
src/blitter/base.hpp
Show inline comments
 
@@ -123,7 +123,7 @@ public:
 

	
 
	/**
 
	 * Copy from a buffer to the screen.
 
	 * @param video The destionation pointer (video-buffer).
 
	 * @param video The destination pointer (video-buffer).
 
	 * @param src The buffer from which the data will be read.
 
	 * @param width The width of the buffer.
 
	 * @param height The height of the buffer.
src/blitter/null.hpp
Show inline comments
 
@@ -37,7 +37,7 @@ public:
 
	/* virtual */ int GetBytesPerPixel() { return 0; }
 
};
 

	
 
/** Factory for the blitter that doesn nothing. */
 
/** Factory for the blitter that does nothing. */
 
class FBlitter_Null: public BlitterFactory<FBlitter_Null> {
 
public:
 
	/* virtual */ const char *GetName() { return "null"; }
src/bootstrap_gui.cpp
Show inline comments
 
@@ -205,7 +205,7 @@ public:
 
#endif /* defined(ENABLE_NETWORK) && defined(WITH_FREETYPE) */
 

	
 
/**
 
 * Handle all procedures for bootstrapping OpenTTD without a base grapics set.
 
 * Handle all procedures for bootstrapping OpenTTD without a base graphics set.
 
 * This requires all kinds of trickery that is needed to avoid the use of
 
 * sprites from the base graphics set which are pretty interwoven.
 
 * @return True if a base set exists, otherwise false.
src/bridge_gui.cpp
Show inline comments
 
@@ -381,7 +381,7 @@ void ShowBuildBridgeWindow(TileIndex sta
 
	/* The bridge length without ramps. */
 
	const uint bridge_len = GetTunnelBridgeLength(start, end);
 

	
 
	/* If Ctrl is being pressed, check wether the last bridge built is available
 
	/* If Ctrl is being pressed, check whether the last bridge built is available
 
	 * If so, return this bridge type. Otherwise continue normally.
 
	 * We store bridge types for each transport type, so we have to check for
 
	 * the transport type beforehand.
src/bridge_map.h
Show inline comments
 
@@ -41,7 +41,7 @@ static inline bool IsBridgeTile(TileInde
 
 * checks for the possibility that a bridge may be on this tile
 
 * These are in fact all the tile types on which a bridge can be found
 
 * @param t The tile to analyze
 
 * @return true if a bridge migh be present
 
 * @return true if a bridge might be present
 
 */
 
static inline bool MayHaveBridgeAbove(TileIndex t)
 
{
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -272,7 +272,7 @@ static int CDECL EnginePowerVsRunningCos
 
	 * we will actually calculate cunning cost/power (to make it more than 1).
 
	 * Because of this, the return value have to be reversed as well and we return b - a instead of a - b.
 
	 * Another thing is that both power and running costs should be doubled for multiheaded engines.
 
	 * Since it would be multipling with 2 in both numerator and denumerator, it will even themselves out and we skip checking for multiheaded. */
 
	 * Since it would be multiplying with 2 in both numerator and denominator, it will even themselves out and we skip checking for multiheaded. */
 
	Money va = (e_a->GetRunningCost()) / max(1U, (uint)e_a->GetPower());
 
	Money vb = (e_b->GetRunningCost()) / max(1U, (uint)e_b->GetPower());
 
	int r = ClampToI32(vb - va);
 
@@ -967,7 +967,7 @@ struct BuildVehicleWindow : Window {
 
		this->vscroll = this->GetScrollbar(WID_BV_SCROLLBAR);
 

	
 
		/* If we are just viewing the list of vehicles, we do not need the Build button.
 
		 * So we just hide it, and enlarge the Rename buton by the now vacant place. */
 
		 * So we just hide it, and enlarge the Rename button by the now vacant place. */
 
		if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
 

	
 
		NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
src/cargomonitor.cpp
Show inline comments
 
@@ -31,7 +31,7 @@ void ClearCargoDeliveryMonitoring()
 
/**
 
 * Get and reset the amount associated with a cargo monitor.
 
 * @param[in,out] monitor_map Monitoring map to search (and reset for the queried entry).
 
 * @oaram monitor Cargo monitor to query/reset.
 
 * @param monitor Cargo monitor to query/reset.
 
 * @param keep_monitoring After returning from this call, continue monitoring.
 
 * @return Amount collected since last query/activation for the monitored combination.
 
 */
src/cargopacket.h
Show inline comments
 
@@ -161,7 +161,7 @@ public:
 

	
 
/**
 
 * Simple collection class for a list of cargo packets.
 
 * @tparam Tinst Actual instantation of this cargo list.
 
 * @tparam Tinst Actual instantiation of this cargo list.
 
 */
 
template <class Tinst>
 
class CargoList {
src/cargotype.h
Show inline comments
 
@@ -46,7 +46,7 @@ enum CargoClass {
 
	CC_LIQUID       = 1 <<  6, ///< Liquids (Oil, Water, Rubber)
 
	CC_REFRIGERATED = 1 <<  7, ///< Refrigerated cargo (Food, Fruit)
 
	CC_HAZARDOUS    = 1 <<  8, ///< Hazardous cargo (Nuclear Fuel, Explosives, etc.)
 
	CC_COVERED      = 1 <<  9, ///< Covered/Sheltered Freight (Transporation in Box Vans, Silo Wagons, etc.)
 
	CC_COVERED      = 1 <<  9, ///< Covered/Sheltered Freight (Transportation in Box Vans, Silo Wagons, etc.)
 
	CC_SPECIAL      = 1 << 15, ///< Special bit used for livery refit tricks instead of normal cargoes.
 
};
 

	
src/cheat_gui.cpp
Show inline comments
 
@@ -75,7 +75,7 @@ static int32 ClickChangeCompanyCheat(int
 
 * Allow (or disallow) changing production of all industries.
 
 * @param p1 new value
 
 * @param p2 unused
 
 * @return New value allwing change of industry production.
 
 * @return New value allowing change of industry production.
 
 */
 
static int32 ClickSetProdCheat(int32 p1, int32 p2)
 
{
src/clear_cmd.cpp
Show inline comments
 
@@ -190,12 +190,12 @@ static void TileLoopClearAlps(TileIndex 
 
		}
 
	}
 
	/* Update snow density. */
 
	uint curent_density = GetClearDensity(tile);
 
	uint current_density = GetClearDensity(tile);
 
	uint req_density = (k < 0) ? 0u : min((uint)k, 3);
 

	
 
	if (curent_density < req_density) {
 
	if (current_density < req_density) {
 
		AddClearDensity(tile, 1);
 
	} else if (curent_density > req_density) {
 
	} else if (current_density > req_density) {
 
		AddClearDensity(tile, -1);
 
	} else {
 
		/* Density at the required level. */
src/command.cpp
Show inline comments
 
@@ -331,7 +331,7 @@ static const Command _command_proc_table
 
/*!
 
 * This function range-checks a cmd, and checks if the cmd is not NULL
 
 *
 
 * @param cmd The integervalue of a command
 
 * @param cmd The integer value of a command
 
 * @return true if the command is valid (and got a CommandProc function)
 
 */
 
bool IsValidCommand(uint32 cmd)
src/command_type.h
Show inline comments
 
@@ -277,7 +277,7 @@ enum Commands {
 

	
 
	CMD_GIVE_MONEY,                   ///< give money to another company
 
	CMD_CHANGE_SETTING,               ///< change a setting
 
	CMD_CHANGE_COMPANY_SETTING,       ///< change a company etting
 
	CMD_CHANGE_COMPANY_SETTING,       ///< change a company setting
 

	
 
	CMD_SET_AUTOREPLACE,              ///< set an autoreplace entry
 

	
src/company_manager_face.h
Show inline comments
 
@@ -120,7 +120,7 @@ static inline void SetCompanyManagerFace
 
/**
 
 * Increase/Decrease the company manager's face variable by the given amount.
 
 * If the new value greater than the max value for this variable it will be set to 0.
 
 * Or is it negativ (< 0) it will be set to max value.
 
 * Or is it negative (< 0) it will be set to max value.
 
 *
 
 * @param cmf    the company manager face to write the bits to
 
 * @param cmfv   the company manager face variable to write the data of
src/console.cpp
Show inline comments
 
@@ -355,7 +355,7 @@ static void IConsoleAliasExec(const ICon
 
				aliasstream[astream_i++] = '"';
 
				break;
 

	
 
			case ';': // Cmd seperator, start new command
 
			case ';': // Cmd separator, start new command
 
				aliasstream[astream_i] = '\0';
 
				aliases[++a_index] = &aliasstream[++astream_i];
 
				cmdptr++;
 
@@ -364,7 +364,7 @@ static void IConsoleAliasExec(const ICon
 
			case '%': // Some or all parameters
 
				cmdptr++;
 
				switch (*cmdptr) {
 
					case '+': { // All parameters seperated: "[param 1]" "[param 2]"
 
					case '+': { // All parameters separated: "[param 1]" "[param 2]"
 
						for (i = 0; i != tokencount; i++) {
 
							aliasstream[astream_i++] = '"';
 
							astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
 
@@ -412,7 +412,7 @@ static void IConsoleAliasExec(const ICon
 

	
 
/**
 
 * Execute a given command passed to us. First chop it up into
 
 * individual tokens (seperated by spaces), then execute it if possible
 
 * individual tokens (separated by spaces), then execute it if possible
 
 * @param cmdstr string to be parsed and executed
 
 */
 
void IConsoleCmdExec(const char *cmdstr)
 
@@ -439,14 +439,14 @@ void IConsoleCmdExec(const char *cmdstr)
 
	memset(&tokens, 0, sizeof(tokens));
 
	memset(&tokenstream, 0, sizeof(tokenstream));
 

	
 
	/* 1. Split up commandline into tokens, seperated by spaces, commands
 
	/* 1. Split up commandline into tokens, separated by spaces, commands
 
	 * enclosed in "" are taken as one token. We can only go as far as the amount
 
	 * of characters in our stream or the max amount of tokens we can handle */
 
	for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; cmdptr++) {
 
		if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
 

	
 
		switch (*cmdptr) {
 
		case ' ': // Token seperator
 
		case ' ': // Token separator
 
			if (!foundtoken) break;
 

	
 
			if (longtoken) {
src/console_cmds.cpp
Show inline comments
 
@@ -1066,7 +1066,7 @@ DEF_CONSOLE_CMD(ConRestart)
 
}
 

	
 
/**
 
 * Print a text buffer line by line to the console. Lines are seperated by '\n'.
 
 * Print a text buffer line by line to the console. Lines are separated by '\n'.
 
 * @param buf The buffer to print.
 
 * @note All newlines are replace by '\0' characters.
 
 */
src/console_internal.h
Show inline comments
 
@@ -28,7 +28,7 @@ enum ConsoleHookResult {
 
 * --Commands--
 
 * Commands are commands, or functions. They get executed once and any
 
 * effect they produce are carried out. The arguments to the commands
 
 * are given to them, each input word seperated by a double-quote (") is an argument
 
 * are given to them, each input word separated by a double-quote (") is an argument
 
 * If you want to handle multiple words as one, enclose them in double-quotes
 
 * eg. 'say "hello sexy boy"'
 
 */
 
@@ -50,7 +50,7 @@ struct IConsoleCmd {
 
 * (eg. 'ng' for 'load %A; unpause; debug_level 5'). Aliases can parse the arguments
 
 * given to them in the command line.
 
 * - "%A - %Z" substitute arguments 1 t/m 26
 
 * - "%+" lists all parameters keeping them seperated
 
 * - "%+" lists all parameters keeping them separated
 
 * - "%!" also lists all parameters but presenting them to the aliased command as one argument
 
 * - ";" allows for combining commands (see example 'ng')
 
 */
src/core/bitmath_func.cpp
Show inline comments
 
@@ -27,7 +27,7 @@ const uint8 _ffb_64[64] = {
 
 * Search the first set bit in a 32 bit variable.
 
 *
 
 * This algorithm is a static implementation of a log
 
 * conguence search algorithm. It checks the first half
 
 * congruence search algorithm. It checks the first half
 
 * if there is a bit set search there further. And this
 
 * way further. If no bit is set return 0.
 
 *
 
@@ -55,7 +55,7 @@ uint8 FindFirstBit(uint32 x)
 
 * Search the last set bit in a 64 bit variable.
 
 *
 
 * This algorithm is a static implementation of a log
 
 * conguence search algorithm. It checks the second half
 
 * congruence search algorithm. It checks the second half
 
 * if there is a bit set search there further. And this
 
 * way further. If no bit is set return 0.
 
 *
src/core/enum_type.hpp
Show inline comments
 
@@ -89,7 +89,7 @@ template <typename Tenum_t> struct TinyE
 
template <typename Tenum_t>
 
struct TinyEnumT {
 
	typedef Tenum_t enum_type;                      ///< expose our enumeration type (i.e. Trackdir) to outside
 
	typedef EnumPropsT<Tenum_t> Props;              ///< make easier access to our enumeration propeties
 
	typedef EnumPropsT<Tenum_t> Props;              ///< make easier access to our enumeration properties
 
	typedef typename Props::storage storage_type;   ///< small storage type
 
	static const enum_type begin = Props::begin;    ///< enum beginning (i.e. TRACKDIR_BEGIN)
 
	static const enum_type end = Props::end;        ///< enum end (i.e. TRACKDIR_END)
src/core/pool_func.hpp
Show inline comments
 
@@ -108,7 +108,7 @@ DEFINE_POOL_METHOD(inline void *)::Alloc
 
		item = (Titem *)this->alloc_cache;
 
		this->alloc_cache = this->alloc_cache->next;
 
		if (Tzero) {
 
			/* Explicitly casting to (void *) prevets a clang warning -
 
			/* Explicitly casting to (void *) prevents a clang warning -
 
			 * we are actually memsetting a (not-yet-constructed) object */
 
			memset((void *)item, 0, sizeof(Titem));
 
		}
src/core/pool_type.hpp
Show inline comments
 
@@ -45,7 +45,7 @@ struct PoolBase {
 
	static void Clean(PoolType);
 

	
 
	/**
 
	 * Contructor registers this object in the pool vector.
 
	 * Constructor registers this object in the pool vector.
 
	 * @param pt type of this pool.
 
	 */
 
	PoolBase(PoolType pt) : type(pt)
 
@@ -278,7 +278,7 @@ struct Pool : PoolBase {
 
	};
 

	
 
private:
 
	static const size_t NO_FREE_ITEM = MAX_UVALUE(size_t); ///< Contant to indicate we can't allocate any more items
 
	static const size_t NO_FREE_ITEM = MAX_UVALUE(size_t); ///< Constant to indicate we can't allocate any more items
 

	
 
	/**
 
	 * Helper struct to cache 'freed' PoolItems so we
src/core/sort_func.hpp
Show inline comments
 
@@ -37,7 +37,7 @@ static inline void QSortT(T *base, uint 
 
/**
 
 * Type safe Gnome Sort.
 
 *
 
 * This is a slightly modifyied Gnome search. The basic
 
 * This is a slightly modified Gnome search. The basic
 
 * Gnome search tries to sort already sorted list parts.
 
 * The modification skips these.
 
 *
src/crashlog.h
Show inline comments
 
@@ -72,7 +72,7 @@ protected:
 
	virtual char *LogRegisters(char *buffer, const char *last) const;
 

	
 
	/**
 
	 * Writes the dynamically linked libaries/modules to the buffer, if there
 
	 * Writes the dynamically linked libraries/modules to the buffer, if there
 
	 * is information about it available.
 
	 * @param buffer The begin where to write at.
 
	 * @param last   The last position in the buffer to write to.
src/currency.cpp
Show inline comments
 
@@ -62,7 +62,7 @@ static const CurrencySpec origin_currenc
 
CurrencySpec _currency_specs[NUM_CURRENCY];
 

	
 
/**
 
 * These enums are only declared in order to make sens
 
 * These enums are only declared in order to make sense
 
 * out of the TTDPatch_To_OTTDIndex array that will follow
 
 * Every currency used by Ottd is there, just in case TTDPatch will
 
 * add those missing in its code
 
@@ -129,7 +129,7 @@ const byte TTDPatch_To_OTTDIndex[] =
 
};
 

	
 
/**
 
 * Will return the ottd's index correspondance to
 
 * Will return the ottd's index correspondence to
 
 * the ttdpatch's id.  If the id is bigger than the array,
 
 * it is a grf written for ottd, thus returning the same id.
 
 * Only called from newgrf.cpp
 
@@ -180,7 +180,7 @@ void CheckSwitchToEuro()
 
 * Called only from newgrf.cpp and settings.cpp.
 
 * @param preserve_custom will not reset custom currency (the latest one on the list)
 
 *        if ever it is flagged to true. In which case, the total size of the memory to move
 
 *        will be one currency spec less, thus preserving the custom curreny from been
 
 *        will be one currency spec less, thus preserving the custom currency from been
 
 *        overwritten.
 
 */
 
void ResetCurrencies(bool preserve_custom)
src/date.cpp
Show inline comments
 
@@ -138,7 +138,7 @@ void ConvertDateToYMD(Date date, YearMon
 
}
 

	
 
/**
 
 * Converts a tupe of Year, Month and Day to a Date.
 
 * Converts a tuple of Year, Month and Day to a Date.
 
 * @param year  is a number between 0..MAX_YEAR
 
 * @param month is a number between 0..11
 
 * @param day   is a number between 1..31
src/debug.h
Show inline comments
 
@@ -83,7 +83,7 @@ uint64 ottd_rdtsc();
 
 *
 
 * for (int i = 0; i < 5; i++) {
 
 *   TIC();
 
 *     --Do yuor code--
 
 *     --Do your code--
 
 *   TOC("A name", 5);
 
 * }
 
 *
src/depot_gui.cpp
Show inline comments
 
@@ -744,7 +744,7 @@ struct DepotWindow : Window {
 
			}
 

	
 
			case WID_D_SELL_ALL:
 
				/* Only open the confimation window if there are anything to sell */
 
				/* Only open the confirmation window if there are anything to sell */
 
				if (this->vehicle_list.Length() != 0 || this->wagon_list.Length() != 0) {
 
					TileIndex tile = this->window_number;
 
					byte vehtype = this->type;
src/direction_func.h
Show inline comments
 
@@ -93,7 +93,7 @@ static inline DiagDirection ReverseDiagD
 
 * the new DiagDirection.
 
 *
 
 * @param d The DiagDirection
 
 * @param delta The difference to applie on
 
 * @param delta The difference to apply on
 
 * @return The new direction which was calculated
 
 */
 
static inline DiagDirection ChangeDiagDir(DiagDirection d, DiagDirDiff delta)
 
@@ -207,7 +207,7 @@ static inline DiagDirection XYNSToDiagDi
 
}
 

	
 
/**
 
 * Checks if an interger value is a valid DiagDirection
 
 * Checks if an integer value is a valid DiagDirection
 
 *
 
 * @param d The value to check
 
 * @return True if the value belongs to a DiagDirection, else false
src/direction_type.h
Show inline comments
 
@@ -66,7 +66,7 @@ enum DirDiff {
 
	DIRDIFF_SAME    = 0,    ///< Both directions faces to the same direction
 
	DIRDIFF_45RIGHT = 1,    ///< Angle of 45 degrees right
 
	DIRDIFF_90RIGHT = 2,    ///< Angle of 90 degrees right
 
	DIRDIFF_REVERSE = 4,    ///< One direction is the opposit of the other one
 
	DIRDIFF_REVERSE = 4,    ///< One direction is the opposite of the other one
 
	DIRDIFF_90LEFT  = 6,    ///< Angle of 90 degrees left
 
	DIRDIFF_45LEFT  = 7,    ///< Angle of 45 degrees left
 
};
 
@@ -119,7 +119,7 @@ DECLARE_POSTFIX_INCREMENT(DiagDirDiff)
 
/**
 
 * Enumeration for the two axis X and Y
 
 *
 
 * This enumeration represente the two axis X and Y in the game.
 
 * This enumeration represents the two axis X and Y in the game.
 
 * The X axis is the one which goes align the north-west edge
 
 * (and south-east edge). The Y axis must be so the one which goes
 
 * align the north-east edge (and south-west) edge.
src/disaster_cmd.cpp
Show inline comments
 
@@ -382,7 +382,7 @@ static void DestructIndustry(Industry *i
 

	
 
/**
 
 * Aircraft handling, v->current_order.dest states:
 
 * 0: Fly towards the targetted industry
 
 * 0: Fly towards the targeted industry
 
 * 1: If within 15 tiles, fire away rockets and destroy industry
 
 * 2: Industry explosions
 
 * 3: Fly out of the map
src/dock_gui.cpp
Show inline comments
 
@@ -87,7 +87,7 @@ static TileIndex GetOtherAqueductEnd(Til
 
	return endtile;
 
}
 

	
 
/** Toolbar window for constructing water infra structure. */
 
/** Toolbar window for constructing water infrastructure. */
 
struct BuildDocksToolbarWindow : Window {
 
	DockToolbarWidgets last_clicked_widget; ///< Contains the last widget that has been clicked on this toolbar.
 

	
src/economy.cpp
Show inline comments
 
@@ -291,7 +291,7 @@ void ChangeOwnershipOfCompanyItems(Owner
 
#endif /* ENABLE_NETWORK */
 
	if (old_owner == _local_company) {
 
		/* Single player cheated to AI company.
 
		 * There are no specatators in single player, so we must pick some other company. */
 
		 * There are no spectators in single player, so we must pick some other company. */
 
		assert(!_networking);
 
		Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
 
		Company *c;
 
@@ -461,7 +461,7 @@ void ChangeOwnershipOfCompanyItems(Owner
 
		if (new_owner != INVALID_OWNER) {
 
			/* Update all signals because there can be new segment that was owned by two companies
 
			 * and signals were not propagated
 
			 * Similiar with crossings - it is needed to bar crossings that weren't before
 
			 * Similar with crossings - it is needed to bar crossings that weren't before
 
			 * because of different owner of crossing and approaching train */
 
			tile = 0;
 

	
 
@@ -545,7 +545,7 @@ static void CompanyCheckBankrupt(Company
 
		case 9:
 
			break;
 

	
 
		/* Warn about bancruptcy after 3 months */
 
		/* Warn about bankruptcy after 3 months */
 
		case 4: {
 
			CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1);
 
			cni->FillData(c);
 
@@ -572,7 +572,7 @@ static void CompanyCheckBankrupt(Company
 
			/* FALL THROUGH  to case 10 */
 
		}
 

	
 
		/* Bancrupt company after 6 months (if the company has no value) or latest
 
		/* Bankrupt company after 6 months (if the company has no value) or latest
 
		 * after 9 months (if it still had value after 6 months) */
 
		default:
 
		case 10: {
 
@@ -696,7 +696,7 @@ bool AddInflation(bool check_year)
 
	/* Approximation for (100 + infl_amount)% ** (1 / 12) - 100%
 
	 * scaled by 65536
 
	 * 12 -> months per year
 
	 * This is only a good approxiamtion for small values
 
	 * This is only a good approximation for small values
 
	 */
 
	_economy.inflation_prices  += (_economy.inflation_prices  * _economy.infl_amount    * 54) >> 16;
 
	_economy.inflation_payment += (_economy.inflation_payment * _economy.infl_amount_pr * 54) >> 16;
 
@@ -866,7 +866,7 @@ void StartupIndustryDailyChanges(bool in
 
	 * which stands for the days in a month.
 
	 * Using just 31 will make it so that a monthly reset (based on the real number of days of that month)
 
	 * would not be needed.
 
	 * Since it is based on "fractionnal parts", the leftover days will not make much of a difference
 
	 * Since it is based on "fractional parts", the leftover days will not make much of a difference
 
	 * on the overall total number of changes performed */
 
	_economy.industry_daily_increment = (1 << map_size) / 31;
 

	
src/effectvehicle.cpp
Show inline comments
 
@@ -547,7 +547,7 @@ static EffectInitProc * const _effect_in
 
};
 
assert_compile(lengthof(_effect_init_procs) == EV_END);
 

	
 
/** Functions for controling effect vehicles at each tick. */
 
/** Functions for controlling effect vehicles at each tick. */
 
static EffectTickProc * const _effect_tick_procs[] = {
 
	ChimneySmokeTick,   // EV_CHIMNEY_SMOKE
 
	SteamSmokeTick,     // EV_STEAM_SMOKE
src/elrail.cpp
Show inline comments
 
@@ -25,7 +25,7 @@
 
 * Group 0: Tiles with both an even X coordinate and an even Y coordinate
 
 * Group 1: Tiles with an even X and an odd Y coordinate
 
 * Group 2: Tiles with an odd X and an even Y coordinate
 
 * Group 3: Tiles with both an odd X and Y coordnate.
 
 * Group 3: Tiles with both an odd X and Y coordinate.
 
 *
 
 * <h3>Pylon Points</h3>
 
 * <h4>Control Points</h4>
 
@@ -39,7 +39,7 @@
 
 * other tile.
 
 *
 
 * Now on each edge there are two PCPs: One from each adjacent tile. Both PCPs
 
 * are merged using an OR operation (i. e. if one tile needs a PCP at the postion
 
 * are merged using an OR operation (i. e. if one tile needs a PCP at the position
 
 * in question, both tiles get it).
 
 *
 
 * <h4>Position Points</h4>
 
@@ -127,7 +127,7 @@ static TrackBits MaskWireBits(TileIndex 
 

	
 
	TrackdirBits neighbour_tdb = TRACKDIR_BIT_NONE;
 
	for (DiagDirection d = DIAGDIR_BEGIN; d < DIAGDIR_END; d++) {
 
		/* If the neighbor tile is either not electrified or has no tracks that can be reached
 
		/* If the neighbour tile is either not electrified or has no tracks that can be reached
 
		 * from this tile, mark all trackdirs that can be reached from the neighbour tile
 
		 * as needing no catenary. We make an exception for blocked station tiles with a matching
 
		 * axis that still display wires to preserve visual continuity. */
 
@@ -376,7 +376,7 @@ static void DrawCatenaryRailway(const Ti
 
		/* Station and road crossings are always "flat", so adjust the tileh accordingly */
 
		if (IsTileType(neighbour, MP_STATION) || IsTileType(neighbour, MP_ROAD)) tileh[TS_NEIGHBOUR] = SLOPE_FLAT;
 

	
 
		/* Read the foundataions if they are present, and adjust the tileh */
 
		/* Read the foundations if they are present, and adjust the tileh */
 
		if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE && IsTileType(neighbour, MP_RAILWAY) && HasCatenary(GetRailType(neighbour))) foundation = GetRailFoundation(tileh[TS_NEIGHBOUR], trackconfig[TS_NEIGHBOUR]);
 
		if (IsBridgeTile(neighbour)) {
 
			foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour)));
 
@@ -426,7 +426,7 @@ static void DrawCatenaryRailway(const Ti
 

	
 
					/* Don't build the pylon if it would be outside the tile */
 
					if (!HasBit(OwnedPPPonPCP[i], temp)) {
 
						/* We have a neighour that will draw it, bail out */
 
						/* We have a neighbour that will draw it, bail out */
 
						if (trackconfig[TS_NEIGHBOUR] != TRACK_BIT_NONE) break;
 
						continue; // No neighbour, go looking for a better position
 
					}
src/engine.cpp
Show inline comments
 
@@ -854,7 +854,7 @@ void EnginesDailyLoop()
 
 * Accept an engine prototype. XXX - it is possible that the top-company
 
 * changes while you are waiting to accept the offer? Then it becomes invalid
 
 * @param tile unused
 
 * @param flags operation to perfom
 
 * @param flags operation to perform
 
 * @param p1 engine-prototype offered
 
 * @param p2 unused
 
 * @param text unused
 
@@ -1000,7 +1000,7 @@ static bool IsUniqueEngineName(const cha
 
/**
 
 * Rename an engine.
 
 * @param tile unused
 
 * @param flags operation to perfom
 
 * @param flags operation to perform
 
 * @param p1 engine ID to rename
 
 * @param p2 unused
 
 * @param text the new name or an empty string when resetting to the default
src/engine_base.h
Show inline comments
 
@@ -72,7 +72,7 @@ struct Engine : EnginePool::PoolItem<&_e
 
	 * Usually a valid cargo is returned, even though the vehicle has zero capacity, and can therefore not carry anything. But the cargotype is still used
 
	 * for livery selection etc..
 
	 *
 
	 * Vehicles with CT_INVALID as default cargo are usally not available, but it can appear as default cargo of articulated parts.
 
	 * Vehicles with CT_INVALID as default cargo are usually not available, but it can appear as default cargo of articulated parts.
 
	 *
 
	 * @return The default cargo type.
 
	 * @see CanCarryCargo
src/error.h
Show inline comments
 
@@ -18,7 +18,7 @@
 

	
 
/** Message severity/type */
 
enum WarningLevel {
 
	WL_INFO,     ///< Used for DoCommand-like (and some nonfatal AI GUI) errors/information
 
	WL_INFO,     ///< Used for DoCommand-like (and some non-fatal AI GUI) errors/information
 
	WL_WARNING,  ///< Other information
 
	WL_ERROR,    ///< Errors (eg. saving/loading failed)
 
	WL_CRITICAL, ///< Critical errors, the MessageBox is shown in all cases
src/error_gui.cpp
Show inline comments
 
@@ -67,7 +67,7 @@ static const WindowDesc _errmsg_face_des
 
);
 

	
 
/**
 
 * Copy the given data into our instace.
 
 * Copy the given data into our instance.
 
 * @param data The data to copy.
 
 */
 
ErrorMessageData::ErrorMessageData(const ErrorMessageData &data)
src/fileio.cpp
Show inline comments
 
@@ -643,7 +643,7 @@ static void SimplifyFileName(char *name)
 
	/* Force lowercase */
 
	strtolower(name);
 

	
 
	/* Tar-files always have '/' path-seperator, but we want our PATHSEPCHAR */
 
	/* Tar-files always have '/' path-separator, but we want our PATHSEPCHAR */
 
#if (PATHSEPCHAR != '/')
 
	for (char *n = name; *n != '\0'; n++) if (*n == '/') *n = PATHSEPCHAR;
 
#endif
 
@@ -1364,7 +1364,7 @@ static uint ScanTar(FileScanner *fs, con
 
}
 

	
 
/**
 
 * Scan for files with the given extention in the given search path.
 
 * Scan for files with the given extension in the given search path.
 
 * @param extension the extension of files to search for.
 
 * @param sd        the sub directory to search in.
 
 * @param tars      whether to search in the tars too.
 
@@ -1410,7 +1410,7 @@ uint FileScanner::Scan(const char *exten
 
}
 

	
 
/**
 
 * Scan for files with the given extention in the given search path.
 
 * Scan for files with the given extension in the given search path.
 
 * @param extension the extension of files to search for.
 
 * @param directory the sub directory to search in.
 
 * @param recursive whether to search recursively
src/fios.h
Show inline comments
 
@@ -88,9 +88,9 @@ enum FileSlots {
 
	CONFIG_SLOT    =  0,
 
	/** Slot for the sound. */
 
	SOUND_SLOT     =  1,
 
	/** First slot useable for (New)GRFs used during the game. */
 
	/** First slot usable for (New)GRFs used during the game. */
 
	FIRST_GRF_SLOT =  2,
 
	/** Last slot useable for (New)GRFs used during the game. */
 
	/** Last slot usable for (New)GRFs used during the game. */
 
	LAST_GRF_SLOT  = 63,
 
	/** Maximum number of slots. */
 
	MAX_FILE_SLOTS = 64
src/fontcache.cpp
Show inline comments
 
@@ -160,8 +160,8 @@ static FT_Error GetFontByFaceName(const 
 
		 * - Batang & BatangChe & Gungsuh & GungsuhChe (TrueType)
 
		 * We will strip the font-type '()' if any and work with the font name
 
		 * itself, which must match exactly; if...
 
		 * TTC files, font files which contain more than one font are seperated
 
		 * byt '&'. Our best bet will be to do substr match for the fontname
 
		 * TTC files, font files which contain more than one font are separated
 
		 * by '&'. Our best bet will be to do substr match for the fontname
 
		 * and then let FreeType figure out which index to load */
 
		s = _tcschr(vbuffer, _T('('));
 
		if (s != NULL) s[-1] = '\0';
 
@@ -182,7 +182,7 @@ static FT_Error GetFontByFaceName(const 
 
	 * contain multiple fonts inside this single file. GetFontData however
 
	 * returns the whole file, so we need to check each font inside to get the
 
	 * proper font.
 
	 * Also note that FreeType does not support UNICODE filesnames! */
 
	 * Also note that FreeType does not support UNICODE filenames! */
 
#if defined(UNICODE)
 
	/* We need a cast here back from wide because FreeType doesn't support
 
	 * widechar filenames. Just use the buffer we allocated before for the
 
@@ -570,7 +570,7 @@ bool SetFallbackFont(FreeTypeSettings *s
 
		strecpy(buff, str, lastof(buff));
 
		str_validate(buff, lastof(buff), SVS_ALLOW_NEWLINE);
 

	
 
		/* Extract a UniChar represenation of the sample string. */
 
		/* Extract a UniChar representation of the sample string. */
 
		CFStringRef cf_str = CFStringCreateWithCString(kCFAllocatorDefault, buff, kCFStringEncodingUTF8);
 
		if (cf_str == NULL) {
 
			/* Something went wrong. Corrupt/invalid sample string? */
 
@@ -590,7 +590,7 @@ bool SetFallbackFont(FreeTypeSettings *s
 
		ATSUCreateTextLayoutWithTextPtr(string, kATSUFromTextBeginning, kATSUToTextEnd, str_len, 1, &run_len, &style, &text_layout);
 

	
 
		/* Try to match a font for the sample text. ATSUMatchFontsToText stops after
 
		 * it finds the first continous character run not renderable with the currently
 
		 * it finds the first continuous character run not renderable with the currently
 
		 * selected font starting at offset. The matching needs to be repeated until
 
		 * the end of the string is reached to make sure the fallback font matches for
 
		 * all characters in the string and not only the first run. */
src/game/game_core.cpp
Show inline comments
 
@@ -159,7 +159,7 @@
 

	
 
/* static */ void Game::ResetConfig()
 
{
 
	/* Check for both newgame as current game if we can reload the GameInfo insde
 
	/* Check for both newgame as current game if we can reload the GameInfo inside
 
	 *  the GameConfig. If not, remove the Game from the list. */
 
	if (_settings_game.game_config != NULL && _settings_game.game_config->HasScript()) {
 
		if (!_settings_game.game_config->ResetInfo(true)) {
src/game/game_scanner.hpp
Show inline comments
 
@@ -21,7 +21,7 @@ public:
 
	/**
 
	 * Check if we have a game by name and version available in our list.
 
	 * @param nameParam The name of the game script.
 
	 * @param versionParam The versionof the game script, or -1 if you want the latest.
 
	 * @param versionParam The version of the game script, or -1 if you want the latest.
 
	 * @param force_exact_match Only match name+version, never latest.
 
	 * @return NULL if no match found, otherwise the game script that matched.
 
	 */
src/gfx.cpp
Show inline comments
 
@@ -365,7 +365,7 @@ static WChar *HandleBiDiAndArabicShapes(
 

	
 

	
 
/**
 
 * Truncate a given string to a maximum width if neccessary.
 
 * Truncate a given string to a maximum width if necessary.
 
 * If the string is truncated, add three dots ('...') to show this.
 
 * @param *str string that is checked and possibly truncated
 
 * @param maxw maximum width in pixels of the string
 
@@ -754,7 +754,7 @@ uint32 FormatStringLinebreaks(char *str,
 
end_of_inner_loop:
 
		/* String didn't fit on line (or a '\n' was encountered), so 'dummy' terminate
 
		 * and increase linecount. We use Utf8PrevChar() as also non 1 char long
 
		 * whitespace seperators are supported */
 
		 * whitespace separators are supported */
 
		num++;
 
		char *s = Utf8PrevChar(str);
 
		*s++ = '\0';
 
@@ -1077,14 +1077,14 @@ void DrawCharCentered(WChar c, int x, in
 
/**
 
 * Draw a string at the given coordinates with the given colour.
 
 *  While drawing the string, parse it in case some formatting is specified,
 
 *  like new colour, new size or even positionning.
 
 *  like new colour, new size or even positioning.
 
 * @param string              The string to draw. This is already bidi reordered.
 
 * @param x                   Offset from left side of the screen
 
 * @param y                   Offset from top side of the screen
 
 * @param params              Text drawing parameters
 
 * @param parse_string_also_when_clipped
 
 *                            By default, always test the available space where to draw the string.
 
 *                            When in multipline drawing, it would already be done,
 
 *                            When in multiline drawing, it would already be done,
 
 *                            so no need to re-perform the same kind (more or less) of verifications.
 
 *                            It's not only an optimisation, it's also a way to ensures the string will be parsed
 
 *                            (as there are certain side effects on global variables, which are important for the next line)
 
@@ -1458,7 +1458,7 @@ void DoPaletteAnimations()
 
	}
 

	
 
	Colour *palette_pos = &_cur_palette.palette[PALETTE_ANIM_START];  // Points to where animations are taking place on the palette
 
	/* Makes a copy of the current anmation palette in old_val,
 
	/* Makes a copy of the current animation palette in old_val,
 
	 * so the work on the current palette could be compared, see if there has been any changes */
 
	memcpy(old_val, palette_pos, sizeof(old_val));
 

	
 
@@ -1840,7 +1840,7 @@ void DrawDirtyBlocks()
 
 * @param left The left edge of the rectangle
 
 * @param top The top edge of the rectangle
 
 * @param right The right edge of the rectangle
 
 * @param bottom The bottm edge of the rectangle
 
 * @param bottom The bottom edge of the rectangle
 
 * @see DrawDirtyBlocks
 
 *
 
 * @todo The name of the function should be called like @c AddDirtyBlock as
src/gfx_func.h
Show inline comments
 
@@ -26,10 +26,10 @@
 
 * This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This
 
 * rectangle defines the area on the screen which must be repaint. If a new object
 
 * needs to be repainted this rectangle is extended to 'catch' the object on the
 
 * screen. At some point (which is normaly uninteressted for patch writers) this
 
 * screen. At some point (which is normally uninteresting for patch writers) this
 
 * rectangle is send to the video drivers method
 
 * VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some
 
 * later point (which is uninteressted, too) the video driver
 
 * later point (which is uninteresting, too) the video driver
 
 * repaints all these saved rectangle instead of the whole screen and drop the
 
 * rectangle informations. Then a new round begins by marking objects "dirty".
 
 *
src/gfxinit.cpp
Show inline comments
 
@@ -352,7 +352,7 @@ template <class Tbase_set>
 

	
 
	const Tbase_set *best = NULL;
 
	for (const Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
 
		/* Skip unuseable sets */
 
		/* Skip unusable sets */
 
		if (c->GetNumMissing() != 0) continue;
 

	
 
		if (best == NULL ||
src/graph_gui.cpp
Show inline comments
 
@@ -285,7 +285,7 @@ protected:
 
		ValuesInterval interval; ///< Interval that contains all of the graph data.
 
		int x_axis_offset;       ///< Distance from the top of the graph to the x axis.
 

	
 
		/* the colours and cost array of GraphDrawer must accomodate
 
		/* the colours and cost array of GraphDrawer must accommodate
 
		 * both values for cargo and companies. So if any are higher, quit */
 
		assert_compile(GRAPH_MAX_DATASETS >= (int)NUM_CARGO && GRAPH_MAX_DATASETS >= (int)MAX_COMPANIES);
 
		assert(this->num_vert_lines > 0);
 
@@ -423,7 +423,7 @@ protected:
 
					if (datapoint != INVALID_DATAPOINT) {
 
						/*
 
						 * Check whether we need to reduce the 'accuracy' of the
 
						 * datapoint value and the highest value to splut overflows.
 
						 * datapoint value and the highest value to split overflows.
 
						 * And when 'drawing' 'one million' or 'one million and one'
 
						 * there is no significant difference, so the least
 
						 * significant bits can just be removed.
src/heightmap.cpp
Show inline comments
 
@@ -344,7 +344,7 @@ static void GrayscaleToMapHeights(uint i
 
					(col < col_pad) || (col >= (width  - col_pad - (_settings_game.construction.freeform_edges ? 0 : 1)))) {
 
				SetTileHeight(tile, 0);
 
			} else {
 
				/* Use nearest neighbor resizing to scale map data.
 
				/* Use nearest neighbour resizing to scale map data.
 
				 *  We rotate the map 45 degrees (counter)clockwise */
 
				img_row = (((row - row_pad) * num_div) / img_scale);
 
				switch (_settings_game.game_creation.heightmap_rotation) {
 
@@ -464,7 +464,7 @@ bool GetHeightmapDimensions(char *filena
 
 * Load a heightmap from file and change the map in his current dimensions
 
 *  to a landscape representing the heightmap.
 
 * It converts pixels to height. The brighter, the higher.
 
 * @param filename of the heighmap file to be imported
 
 * @param filename of the heightmap file to be imported
 
 */
 
void LoadHeightmap(char *filename)
 
{
src/hotkeys.cpp
Show inline comments
 
@@ -131,7 +131,7 @@ static void ParseHotkeys(Hotkey<T> *hotk
 

	
 
/**
 
 * Convert a hotkey to it's string representation so it can be written to the
 
 * config file. Seperate parts of the keycode (like "CTRL" and "F1" are split
 
 * config file. Separate parts of the keycode (like "CTRL" and "F1" are split
 
 * by a '+'.
 
 * @param keycode The keycode to convert to a string.
 
 * @return A string representation of this keycode.
src/industry.h
Show inline comments
 
@@ -79,7 +79,7 @@ struct Industry : IndustryPool::PoolItem
 
	/**
 
	 * Check if a given tile belongs to this industry.
 
	 * @param tile The tile to check.
 
	 * @return True if the tils is part of this industry.
 
	 * @return True if the tile is part of this industry.
 
	 */
 
	inline bool TileBelongsToIndustry(TileIndex tile) const
 
	{
src/industry_cmd.cpp
Show inline comments
 
@@ -329,7 +329,7 @@ static void DrawTile_Industry(TileInfo *
 

	
 
	SpriteID image = dits->ground.sprite;
 

	
 
	/* DrawFoundation() modifes ti->z and ti->tileh */
 
	/* DrawFoundation() modifies ti->z and ti->tileh */
 
	if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
 

	
 
	/* If the ground sprite is the default flat water sprite, draw also canal/river borders.
 
@@ -2655,7 +2655,7 @@ void IndustryDailyLoop()
 
	 * is sufficient for an industry. */
 
	uint16 change_loop = _economy.industry_daily_change_counter >> 16;
 

	
 
	/* Reset the active part of the counter, just keeping the "factional part" */
 
	/* Reset the active part of the counter, just keeping the "fractional part" */
 
	_economy.industry_daily_change_counter &= 0xFFFF;
 

	
 
	if (change_loop == 0) {
src/industry_gui.cpp
Show inline comments
 
@@ -247,7 +247,7 @@ class BuildIndustryWindow : public Windo
 
			}
 
		}
 

	
 
		/* first indutry type is selected if the current selection is invalid.
 
		/* first industry type is selected if the current selection is invalid.
 
		 * I'll be damned if there are none available ;) */
 
		if (this->selected_index == -1) {
 
			this->selected_index = 0;
src/industry_map.h
Show inline comments
 
@@ -157,7 +157,7 @@ static inline void SetIndustryGfx(TileIn
 
}
 

	
 
/**
 
 * Returns this indutry tile's construction counter value
 
 * Returns this industry tile's construction counter value
 
 * @param tile the tile to query
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 * @return the construction counter
 
@@ -169,7 +169,7 @@ static inline byte GetIndustryConstructi
 
}
 

	
 
/**
 
 * Sets this indutry tile's construction counter value
 
 * Sets this industry tile's construction counter value
 
 * @param tile the tile to query
 
 * @param value the new value for the construction counter
 
 * @pre IsTileType(tile, MP_INDUSTRY)
src/industrytype.h
Show inline comments
 
@@ -143,7 +143,7 @@ struct IndustrySpec {
 
};
 

	
 
/**
 
 * Defines the data structure of each indivudual tile of an industry.
 
 * Defines the data structure of each individual tile of an industry.
 
 */
 
struct IndustryTileSpec {
 
	CargoID accepts_cargo[3];             ///< Cargo accepted by this tile
src/main_gui.cpp
Show inline comments
 
@@ -76,7 +76,7 @@ void HandleOnEditText(const char *str)
 

	
 
		uint32 money_c = Clamp(ClampToI32(money), 0, 20000000); // Clamp between 20 million and 0
 

	
 
		/* Give 'id' the money, and substract it from ourself */
 
		/* Give 'id' the money, and subtract it from ourself */
 
		DoCommandP(0, money_c, _rename_id, CMD_GIVE_MONEY | CMD_MSG(STR_ERROR_INSUFFICIENT_FUNDS), CcGiveMoney, str);
 
		break;
 
	}
src/map_func.h
Show inline comments
 
@@ -146,7 +146,7 @@ static inline uint ScaleByMapSize1D(uint
 
/**
 
 * 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.
src/misc/binaryheap.hpp
Show inline comments
 
@@ -44,7 +44,7 @@
 
 * implementation.
 
 *
 
 * @par
 
 * For further information about the Binary Heap algotithm, see
 
 * For further information about the Binary Heap algorithm, see
 
 * http://www.policyalmanac.org/games/binaryHeaps.htm
 
 *
 
 * @tparam T Type of the items stored in the binary heap
 
@@ -187,7 +187,7 @@ public:
 
	/**
 
	 * Get the LAST item in the binary tree.
 
	 *
 
	 * @note The last item is not neccesary the biggest!
 
	 * @note The last item is not necessary the biggest!
 
	 *
 
	 * @return The last item
 
	 */
 
@@ -266,7 +266,7 @@ public:
 

	
 
	/**
 
	 * Search for an item in the priority queue.
 
	 *  Matching is done by comparing adress of the
 
	 *  Matching is done by comparing address of the
 
	 *  item.
 
	 *
 
	 * @param item The reference to the item
src/misc/blob.hpp
Show inline comments
 
@@ -31,7 +31,7 @@
 
 *     Always, when it allocates memory the allocated size is:
 
 *                                                      sizeof(BlobHeader) + <data capacity>
 
 *  3. Two 'virtual' members (items and capacity) are stored in the BlobHeader at beginning
 
 *     of the alloated block.
 
 *     of the allocated block.
 
 *  4. The pointer of the union pobsize_ts behind the header (to the first data byte).
 
 *     When memory block is allocated, the sizeof(BlobHeader) it added to it.
 
 *  5. Benefits of this layout:
src/misc/countedptr.hpp
Show inline comments
 
@@ -140,7 +140,7 @@ template <class T> struct AdaptT {
 
/**
 
 * Simple counted object. Use it as base of your struct/class if you want to use
 
 *  basic reference counting. Your struct/class will destroy and free itself when
 
 *  last reference to it is released (using Relese() method). The initial reference
 
 *  last reference to it is released (using Release() method). The initial reference
 
 *  count (when it is created) is zero (don't forget AddRef() at least one time if
 
 *  not using CCountedPtr<T>.
 
 *
src/misc_cmd.cpp
Show inline comments
 
@@ -207,7 +207,7 @@ CommandCost CmdMoneyCheat(TileIndex tile
 
/**
 
 * Transfer funds (money) from one company to another.
 
 * To prevent abuse in multiplayer games you can only send money to other
 
 * companies if you have paid off your loan (either explicitely, or implicitely
 
 * companies if you have paid off your loan (either explicitly, or implicitly
 
 * given the fact that you have more money than loan).
 
 * @param tile unused
 
 * @param flags operation to perform
src/misc_gui.cpp
Show inline comments
 
@@ -35,7 +35,7 @@ enum OskActivation {
 
	OSKA_DISABLED,           ///< The OSK shall not be activated at all.
 
	OSKA_DOUBLE_CLICK,       ///< Double click on the edit box opens OSK.
 
	OSKA_SINGLE_CLICK,       ///< Single click after focus click opens OSK.
 
	OSKA_IMMEDIATELY,        ///< Focussing click already opens OSK.
 
	OSKA_IMMEDIATELY,        ///< Focusing click already opens OSK.
 
};
 

	
 

	
 
@@ -704,7 +704,7 @@ struct TooltipsWindow : public Window
 
 * @param str String to be displayed
 
 * @param paramcount number of params to deal with
 
 * @param params (optional) up to 5 pieces of additional information that may be added to a tooltip
 
 * @param use_left_mouse_button close the tooltip when the left (true) or right (false) mousebutton is released
 
 * @param use_left_mouse_button close the tooltip when the left (true) or right (false) mouse button is released
 
 */
 
void GuiShowTooltips(Window *parent, StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_tooltip)
 
{
src/music/qtmidi.cpp
Show inline comments
 
@@ -78,7 +78,7 @@ static void SetMIDITypeIfNeeded(const FS
 
 *
 
 * @param *path String with the path of an existing MIDI file.
 
 * @param *moov Pointer to a @c Movie where the result will be stored.
 
 * @return Wether the file was loaded and the @c Movie successfully created.
 
 * @return Whether the file was loaded and the @c Movie successfully created.
 
 */
 
static bool LoadMovieForMIDIFile(const char *path, Movie *moov)
 
{
 
@@ -99,7 +99,7 @@ static bool LoadMovieForMIDIFile(const c
 
	 * XXX Manual check for MIDI header ('MThd'), as I don't know how to make
 
	 * QuickTime load MIDI files without a .mid suffix without knowing it's
 
	 * a MIDI file and setting the OSType of the file to the 'Midi' value.
 
	 * Perhahaps ugly, but it seems that it does the Right Thing(tm).
 
	 * Perhaps ugly, but it seems that it does the Right Thing(tm).
 
	 */
 
	fd = open(path, O_RDONLY, 0);
 
	if (fd == -1) return false;
 
@@ -192,7 +192,7 @@ const char *MusicDriver_QtMidi::Start(co
 

	
 

	
 
/**
 
 * Checks wether the player is active.
 
 * Checks whether the player is active.
 
 *
 
 * This function is called at regular intervals from OpenTTD's main loop, so
 
 * we call @c MoviesTask() from here to let QuickTime do its work.
src/network/core/address.cpp
Show inline comments
 
@@ -259,7 +259,7 @@ SOCKET NetworkAddress::Resolve(int famil
 
	for (struct addrinfo *runp = ai; runp != NULL; runp = runp->ai_next) {
 
		/* When we are binding to multiple sockets, make sure we do not
 
		 * connect to one with exactly the same address twice. That's
 
		 * ofcourse totally unneeded ;) */
 
		 * of course totally unneeded ;) */
 
		if (sockets != NULL) {
 
			NetworkAddress address(runp->ai_addr, (int)runp->ai_addrlen);
 
			if (sockets->Contains(address)) continue;
src/network/core/core.cpp
Show inline comments
 
@@ -51,7 +51,7 @@ bool NetworkCoreInitialize()
 
			if (OpenDevice("timer.device", UNIT_MICROHZ, (struct IORequest*)TimerRequest, 0) == 0) {
 
				TimerBase = TimerRequest->tr_node.io_Device;
 
				if (TimerBase == NULL) {
 
					/* free ressources... */
 
					/* free resources... */
 
					DEBUG(net, 0, "[core] can't initialize timer, network unavailable");
 
					return false;
 
				}
src/network/core/core.h
Show inline comments
 
@@ -28,12 +28,12 @@ enum NetworkRecvStatus {
 
	NETWORK_RECV_STATUS_DESYNC,           ///< A desync did occur
 
	NETWORK_RECV_STATUS_NEWGRF_MISMATCH,  ///< We did not have the required NewGRFs
 
	NETWORK_RECV_STATUS_SAVEGAME,         ///< Something went wrong (down)loading the savegame
 
	NETWORK_RECV_STATUS_CONN_LOST,        ///< The conection is 'just' lost
 
	NETWORK_RECV_STATUS_CONN_LOST,        ///< The connection is 'just' lost
 
	NETWORK_RECV_STATUS_MALFORMED_PACKET, ///< We apparently send a malformed packet
 
	NETWORK_RECV_STATUS_SERVER_ERROR,     ///< The server told us we made an error
 
	NETWORK_RECV_STATUS_SERVER_FULL,      ///< The server is full
 
	NETWORK_RECV_STATUS_SERVER_BANNED,    ///< The server has banned us
 
	NETWORK_RECV_STATUS_CLOSE_QUERY,      ///< Done quering the server
 
	NETWORK_RECV_STATUS_CLOSE_QUERY,      ///< Done querying the server
 
};
 

	
 
/** Forward declaration due to circular dependencies */
 
@@ -48,7 +48,7 @@ public:
 
	/** Create a new unbound socket */
 
	NetworkSocketHandler() { this->has_quit = false; }
 

	
 
	/** Close the socket when distructing the socket handler */
 
	/** Close the socket when destructing the socket handler */
 
	virtual ~NetworkSocketHandler() { this->Close(); }
 

	
 
	/** Really close the socket */
src/network/core/tcp.h
Show inline comments
 
@@ -52,7 +52,7 @@ public:
 

	
 
	/**
 
	 * Whether there is something pending in the send queue.
 
	 * @return true when someting is pending in the send queue.
 
	 * @return true when something is pending in the send queue.
 
	 */
 
	bool HasSendQueue() { return this->packet_queue != NULL; }
 

	
src/network/core/tcp_admin.h
Show inline comments
 
@@ -339,7 +339,7 @@ protected:
 
	virtual NetworkRecvStatus Receive_SERVER_COMPANY_UPDATE(Packet *p);
 

	
 
	/**
 
	 * Notification about a removed company (e.g. due to banrkuptcy).
 
	 * Notification about a removed company (e.g. due to bankruptcy).
 
	 * uint8   ID of the company.
 
	 * uint8   Reason for being removed (see #AdminCompanyRemoveReason).
 
	 * @param p The packet that was just received.
src/network/core/tcp_content.h
Show inline comments
 
@@ -139,7 +139,7 @@ protected:
 
	/**
 
	 * Client requesting a list of content info based on an external
 
	 * 'unique' id; GRF ID + MD5 checksum for NewGRFS, shortname and
 
	 * xor-ed MD5 checsums for base graphics and AIs.
 
	 * xor-ed MD5 checksums for base graphics and AIs.
 
	 * Scenarios and AI libraries are not supported
 
	 *  uint8   count of requests
 
	 *  for each request:
src/network/core/tcp_game.h
Show inline comments
 
@@ -326,8 +326,8 @@ protected:
 
	 * Sends the current frame counter to the client:
 
	 * uint32  Frame counter
 
	 * uint32  Frame counter max (how far may the client walk before the server?)
 
	 * uint32  General seed 1 (dependant on compile settings, not default).
 
	 * uint32  General seed 2 (dependant on compile settings, not default).
 
	 * uint32  General seed 1 (dependent on compile settings, not default).
 
	 * uint32  General seed 2 (dependent on compile settings, not default).
 
	 * uint8   Random token to validate the client is actually listening (only occasionally present).
 
	 * @param p The packet that was just received.
 
	 */
 
@@ -337,7 +337,7 @@ protected:
 
	 * Sends a sync-check to the client:
 
	 * uint32  Frame counter.
 
	 * uint32  General seed 1.
 
	 * uint32  General seed 2 (dependant on compile settings, not default).
 
	 * uint32  General seed 2 (dependent on compile settings, not default).
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_SERVER_SYNC(Packet *p);
 
@@ -413,13 +413,13 @@ protected:
 
	virtual NetworkRecvStatus Receive_CLIENT_SET_NAME(Packet *p);
 

	
 
	/**
 
	 * The client is quiting the game.
 
	 * The client is quitting the game.
 
	 * @param p The packet that was just received.
 
	 */
 
	virtual NetworkRecvStatus Receive_CLIENT_QUIT(Packet *p);
 

	
 
	/**
 
	 * The client made an error and is quiting the game.
 
	 * The client made an error and is quitting the game.
 
	 * uint8   Error of the code caused (see NetworkErrorCode).
 
	 * @param p The packet that was just received.
 
	 */
src/network/core/tcp_http.cpp
Show inline comments
 
@@ -177,7 +177,7 @@ int NetworkHTTPSocketHandler::HandleHead
 
	int ret = NetworkHTTPSocketHandler::Connect(uri, this->callback, this->data, this->redirect_depth + 1);
 
	if (ret != 0) return ret;
 

	
 
	/* We've relinguished control of data now. */
 
	/* We've relinquished control of data now. */
 
	this->data = NULL;
 

	
 
	/* Restore the header. */
src/network/core/tcp_http.h
Show inline comments
 
@@ -117,7 +117,7 @@ public:
 
	virtual void OnConnect(SOCKET s)
 
	{
 
		new NetworkHTTPSocketHandler(s, this->callback, this->address.GetHostname(), this->url, this->data, this->depth);
 
		/* We've relinguished control of data now. */
 
		/* We've relinquished control of data now. */
 
		this->data = NULL;
 
	}
 
};
src/network/core/udp.h
Show inline comments
 
@@ -27,7 +27,7 @@ enum PacketUDPType {
 
	PACKET_UDP_CLIENT_DETAIL_INFO,   ///< Queries a game server about details of the game, such as companies
 
	PACKET_UDP_SERVER_DETAIL_INFO,   ///< Reply of the game server about details of the game, such as companies
 
	PACKET_UDP_SERVER_REGISTER,      ///< Packet to register itself to the master server
 
	PACKET_UDP_MASTER_ACK_REGISTER,  ///< Packet indicating registration has succedeed
 
	PACKET_UDP_MASTER_ACK_REGISTER,  ///< Packet indicating registration has succeeded
 
	PACKET_UDP_CLIENT_GET_LIST,      ///< Request for serverlist from master server
 
	PACKET_UDP_MASTER_RESPONSE_LIST, ///< Response from master server with server ip's + port's
 
	PACKET_UDP_SERVER_UNREGISTER,    ///< Request to be removed from the server-list
 
@@ -73,7 +73,7 @@ protected:
 
	 *   all      1       the version of this packet's structure
 
	 *
 
	 *   4+       1       number of GRFs attached (n)
 
	 *   4+       n * 20  unique identifier for GRF files. Constists of:
 
	 *   4+       n * 20  unique identifier for GRF files. Consists of:
 
	 *                     - one 4 byte variable with the GRF ID
 
	 *                     - 16 bytes (sent sequentially) for the MD5 checksum
 
	 *                       of the GRF
src/network/network.cpp
Show inline comments
 
@@ -455,7 +455,7 @@ static void CheckPauseOnJoin()
 
 * Converts a string to ip/port/company
 
 *  Format: IP:port#company
 
 *
 
 * connection_string will be re-terminated to seperate out the hostname, and company and port will
 
 * connection_string will be re-terminated to separate out the hostname, and company and port will
 
 * be set to the company and port strings given by the user, inside the memory area originally
 
 * occupied by connection_string.
 
 */
 
@@ -488,7 +488,7 @@ void ParseConnectionString(const char **
 
}
 

	
 
/**
 
 * Handle the acception of a connection to the server.
 
 * Handle the accepting of a connection to the server.
 
 * @param s The socket of the new connection.
 
 * @param address The address of the peer.
 
 */
 
@@ -549,7 +549,7 @@ void NetworkClose(bool close_admins)
 
	InitializeNetworkPools(close_admins);
 
}
 

	
 
/* Inits the network (cleans sockets and stuff) */
 
/* Initializes the network (cleans sockets and stuff) */
 
static void NetworkInitialize(bool close_admins = true)
 
{
 
	InitializeNetworkPools(close_admins);
 
@@ -809,7 +809,7 @@ void NetworkDisconnect(bool blocking, bo
 

	
 
/**
 
 * Receives something from the network.
 
 * @return true if everthing went fine, false when the connection got closed.
 
 * @return true if everything went fine, false when the connection got closed.
 
 */
 
static bool NetworkReceive()
 
{
src/network/network_admin.cpp
Show inline comments
 
@@ -974,7 +974,7 @@ void ServerNetworkAdminSocketHandler::We
 

	
 
/**
 
 * Send (push) updates to the admin network as they have registered for these updates.
 
 * @param freq the frequency to be processd.
 
 * @param freq the frequency to be processed.
 
 */
 
void NetworkAdminUpdate(AdminUpdateFrequency freq)
 
{
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -451,7 +451,7 @@ struct NetworkChatWindow : public Window
 
		}
 

	
 
		if (second_scan) {
 
			/* We walked all posibilities, and the user presses tab again.. revert to original text */
 
			/* We walked all possibilities, and the user presses tab again.. revert to original text */
 
			this->message_editbox.text.Assign(_chat_tab_completion_buf);
 
			_chat_tab_completion_active = false;
 

	
src/network/network_client.cpp
Show inline comments
 
@@ -617,8 +617,8 @@ NetworkRecvStatus ClientNetworkGameSocke
 
	}
 

	
 
	/* There are at most as many ClientInfo as ClientSocket objects in a
 
	 * server. Having more Infos than a server can have means something
 
	 * has gone wrong somewhere, i.e. the server has more Infos than it
 
	 * server. Having more info than a server can have means something
 
	 * has gone wrong somewhere, i.e. the server has more info than it
 
	 * has actual clients. That means the server is feeding us an invalid
 
	 * state. So, bail out! This server is broken. */
 
	if (!NetworkClientInfo::CanAllocateItem()) return NETWORK_RECV_STATUS_MALFORMED_PACKET;
 
@@ -1056,7 +1056,7 @@ NetworkRecvStatus ClientNetworkGameSocke
 
	/* Only when we're trying to join we really
 
	 * care about the server shutting down. */
 
	if (this->status >= STATUS_JOIN) {
 
		/* To trottle the reconnects a bit, every clients waits its
 
		/* To throttle the reconnects a bit, every clients waits its
 
		 * Client ID modulo 16. This way reconnects should be spread
 
		 * out a bit. */
 
		_network_reconnect = _network_own_client_id % 16;
src/network/network_client.h
Show inline comments
 
@@ -29,7 +29,7 @@ private:
 
		STATUS_JOIN,          ///< We are trying to join a server.
 
		STATUS_NEWGRFS_CHECK, ///< Last action was checking NewGRFs.
 
		STATUS_AUTH_GAME,     ///< Last action was requesting game (server) password.
 
		STATUS_AUTH_COMPANY,  ///< Last action was requestion company password.
 
		STATUS_AUTH_COMPANY,  ///< Last action was requesting company password.
 
		STATUS_AUTHORIZED,    ///< The client is authorized at the server.
 
		STATUS_MAP_WAIT,      ///< The client is waiting as someone else is downloading the map.
 
		STATUS_MAP,           ///< The client is downloading the map.
src/network/network_content.cpp
Show inline comments
 
@@ -509,7 +509,7 @@ bool ClientNetworkContentSocketHandler::
 
		/* The filesize is > 0, so we are going to download it */
 
		const char *filename = GetFullFilename(this->curInfo, true);
 
		if (filename == NULL || (this->curFile = fopen(filename, "wb")) == NULL) {
 
			/* Unless that fails ofcourse... */
 
			/* Unless that fails of course... */
 
			DeleteWindowById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_CONTENT_DOWNLOAD);
 
			ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, WL_ERROR);
 
			return false;
src/network/network_server.cpp
Show inline comments
 
@@ -528,7 +528,7 @@ NetworkRecvStatus ServerNetworkGameSocke
 
/** This sends the map to the client */
 
NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
 
{
 
	static uint sent_packets; // How many packets we did send succecfully last time
 
	static uint sent_packets; // How many packets we did send successfully last time
 

	
 
	if (this->status < STATUS_AUTHORIZED) {
 
		/* Illegal call, return error and ignore the packet */
 
@@ -1500,7 +1500,7 @@ void NetworkSocketHandler::SendCompanyIn
 
	p->Send_uint64(income);
 
	p->Send_uint16(c->old_economy[0].performance_history);
 

	
 
	/* Send 1 if there is a passord for the company else send 0 */
 
	/* Send 1 if there is a password for the company else send 0 */
 
	p->Send_bool  (!StrEmpty(_network_company_states[c->index].password));
 

	
 
	for (uint i = 0; i < NETWORK_VEH_END; i++) {
 
@@ -1620,7 +1620,7 @@ static void NetworkAutoCleanCompanies()
 
		}
 
	}
 

	
 
	/* Go through all the comapnies */
 
	/* Go through all the companies */
 
	FOR_ALL_COMPANIES(c) {
 
		/* Skip the non-active once */
 
		if (c->is_ai) continue;
 
@@ -1786,7 +1786,7 @@ void NetworkServer_Tick(bool send_frame)
 
		switch (cs->status) {
 
			case NetworkClientSocket::STATUS_ACTIVE:
 
				if (lag > _settings_client.network.max_lag_time) {
 
					/* Client did still not report in within the specififed limit. */
 
					/* Client did still not report in within the specified limit. */
 
					IConsolePrintF(CC_ERROR, cs->last_packet + lag * MILLISECONDS_PER_TICK > _realtime_tick ?
 
							/* A packet was received in the last three game days, so the client is likely lagging behind. */
 
								"Client #%d is dropped because the client's game state is more than %d ticks behind" :
src/network/network_server.h
Show inline comments
 
@@ -19,7 +19,7 @@
 
#include "../thread/thread.h"
 

	
 
class ServerNetworkGameSocketHandler;
 
/** Make the code look slightliy nicer/simpler. */
 
/** Make the code look slightly nicer/simpler. */
 
typedef ServerNetworkGameSocketHandler NetworkClientSocket;
 
/** Pool with all client sockets. */
 
typedef Pool<NetworkClientSocket, ClientIndex, 8, MAX_CLIENT_SLOTS, PT_NCLIENT> NetworkClientSocketPool;
src/network/network_udp.cpp
Show inline comments
 
@@ -34,15 +34,15 @@
 

	
 
#include "core/udp.h"
 

	
 
/** Mutex for all out threaded udp resoltion and such. */
 
/** Mutex for all out threaded udp resolution and such. */
 
static ThreadMutex *_network_udp_mutex = ThreadMutex::New();
 

	
 
/** Session key to register ourselves to the master server */
 
static uint64 _session_key = 0;
 

	
 
static const uint ADVERTISE_NORMAL_INTERVAL = 30000; ///< interval between advertising in ticks (15 minutes)
 
static const uint ADVERTISE_RETRY_INTERVAL  =   300; ///< readvertise when no response after this many ticks (9 seconds)
 
static const uint ADVERTISE_RETRY_TIMES     =     3; ///< give up readvertising after this much failed retries
 
static const uint ADVERTISE_RETRY_INTERVAL  =   300; ///< re-advertise when no response after this many ticks (9 seconds)
 
static const uint ADVERTISE_RETRY_TIMES     =     3; ///< give up re-advertising after this much failed retries
 

	
 
NetworkUDPSocketHandler *_udp_client_socket = NULL; ///< udp client socket
 
NetworkUDPSocketHandler *_udp_server_socket = NULL; ///< udp server socket
src/newgrf.cpp
Show inline comments
 
@@ -8821,7 +8821,7 @@ void LoadNewGRFFile(GRFConfig *config, u
 
static void ActivateOldShore()
 
{
 
	/* Use default graphics, if no shore sprites were loaded.
 
	 * Should not happen, as openttd(w/d).grf includes some. */
 
	 * Should not happen, as the base set's extra grf should include some. */
 
	if (_loaded_newgrf_features.shore == SHORE_REPLACE_NONE) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_A;
 

	
 
	if (_loaded_newgrf_features.shore != SHORE_REPLACE_ACTION_5) {
src/newgrf.h
Show inline comments
 
@@ -167,7 +167,7 @@ struct GRFLoadedFeatures {
 
};
 

	
 
/**
 
 * Check for grf miscelaneous bits
 
 * Check for grf miscellaneous bits
 
 * @param bit The bit to check.
 
 * @return Whether the bit is set.
 
 */
src/newgrf_airport.h
Show inline comments
 
@@ -114,7 +114,7 @@ struct AirportSpec {
 
	TTDPAirportType ttd_airport_type;      ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
 
	AirportClassID cls_id;                 ///< the class to which this airport type belongs
 
	SpriteID preview_sprite;               ///< preview sprite for this airport
 
	uint16 maintenance_cost;               ///< maintenance cost mulltiplier
 
	uint16 maintenance_cost;               ///< maintenance cost multiplier
 
	/* Newgrf data */
 
	bool enabled;                          ///< Entity still available (by default true). Newgrf can disable it, though.
 
	struct GRFFileProps grf_prop;          ///< Properties related to the grf file.
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -133,11 +133,11 @@ static uint32 GetAirportTileIDAtOffset(T
 
	const AirportTileSpec *ats = AirportTileSpec::Get(gfx);
 

	
 
	if (gfx < NEW_AIRPORTTILE_OFFSET) { // Does it belongs to an old type?
 
		/* It is an old tile.  We have to see if it's been overriden */
 
		/* It is an old tile.  We have to see if it's been overridden */
 
		if (ats->grf_prop.override == INVALID_AIRPORTTILE) { // has it been overridden?
 
			return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
 
		}
 
		/* Overriden */
 
		/* Overridden */
 
		const AirportTileSpec *tile_ovr = AirportTileSpec::Get(ats->grf_prop.override);
 

	
 
		if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
src/newgrf_airporttiles.h
Show inline comments
 
@@ -47,7 +47,7 @@ struct AirportTileResolverObject : publi
 
};
 

	
 
/**
 
 * Defines the data structure of each indivudual tile of an airport.
 
 * Defines the data structure of each individual tile of an airport.
 
 */
 
struct AirportTileSpec {
 
	AnimationInfo animation;              ///< Information about the animation.
src/newgrf_commons.cpp
Show inline comments
 
@@ -95,7 +95,7 @@ void OverrideManagerBase::ResetOverride(
 

	
 
/**
 
 * Return the ID (if ever available) of a previously inserted entity.
 
 * @param grf_local_id ID of this enity withing the grfID
 
 * @param grf_local_id ID of this entity within the grfID
 
 * @param grfid ID of the grf file
 
 * @return the ID of the candidate, of the Invalid flag item ID
 
 */
 
@@ -170,7 +170,7 @@ uint16 OverrideManagerBase::GetSubstitut
 

	
 
/**
 
 * Install the specs into the HouseSpecs array
 
 * It will find itself the proper slot onwhich it will go
 
 * It will find itself the proper slot on which it will go
 
 * @param hs HouseSpec read from the grf file, ready for inclusion
 
 */
 
void HouseOverrideManager::SetEntitySpec(const HouseSpec *hs)
 
@@ -198,7 +198,7 @@ void HouseOverrideManager::SetEntitySpec
 

	
 
/**
 
 * Return the ID (if ever available) of a previously inserted entity.
 
 * @param grf_local_id ID of this enity withing the grfID
 
 * @param grf_local_id ID of this entity within the grfID
 
 * @param grfid ID of the grf file
 
 * @return the ID of the candidate, of the Invalid flag item ID
 
 */
 
@@ -226,7 +226,7 @@ uint16 IndustryOverrideManager::AddEntit
 
{
 
	/* This entity hasn't been defined before, so give it an ID now. */
 
	for (uint16 id = 0; id < max_new_entities; id++) {
 
		/* Skip overriden industries */
 
		/* Skip overridden industries */
 
		if (id < max_offset && entity_overrides[id] != invalid_ID) continue;
 

	
 
		/* Get the real live industry */
 
@@ -234,7 +234,7 @@ uint16 IndustryOverrideManager::AddEntit
 

	
 
		/* This industry must be one that is not available(enabled), mostly because of climate.
 
		 * And it must not already be used by a grf (grffile == NULL).
 
		 * So reseve this slot here, as it is the chosen one */
 
		 * So reserve this slot here, as it is the chosen one */
 
		if (!inds->enabled && inds->grf_prop.grffile == NULL) {
 
			EntityIDMapping *map = &mapping_ID[id];
 

	
 
@@ -252,8 +252,8 @@ uint16 IndustryOverrideManager::AddEntit
 
}
 

	
 
/**
 
 * Method to install the new indistry data in its proper slot
 
 * The slot assigment is internal of this method, since it requires
 
 * Method to install the new industry data in its proper slot
 
 * The slot assignment is internal of this method, since it requires
 
 * checking what is available
 
 * @param inds Industryspec that comes from the grf decoding process
 
 */
 
@@ -264,11 +264,11 @@ void IndustryOverrideManager::SetEntityS
 

	
 
	if (ind_id == invalid_ID) {
 
		/* Not found.
 
		 * Or it has already been overriden, so you've lost your place old boy.
 
		 * Or it has already been overridden, so you've lost your place old boy.
 
		 * Or it is a simple substitute.
 
		 * We need to find a free available slot */
 
		ind_id = this->AddEntityID(inds->grf_prop.local_id, inds->grf_prop.grffile->grfid, inds->grf_prop.subst_id);
 
		inds->grf_prop.override = invalid_ID;  // make sure it will not be detected as overriden
 
		inds->grf_prop.override = invalid_ID;  // make sure it will not be detected as overridden
 
	}
 

	
 
	if (ind_id == invalid_ID) {
 
@@ -308,7 +308,7 @@ void IndustryTileOverrideManager::SetEnt
 

	
 
/**
 
 * Method to install the new object data in its proper slot
 
 * The slot assigment is internal of this method, since it requires
 
 * The slot assignment is internal of this method, since it requires
 
 * checking what is available
 
 * @param spec ObjectSpec that comes from the grf decoding process
 
 */
 
@@ -319,7 +319,7 @@ void ObjectOverrideManager::SetEntitySpe
 

	
 
	if (type == invalid_ID) {
 
		/* Not found.
 
		 * Or it has already been overriden, so you've lost your place old boy.
 
		 * Or it has already been overridden, so you've lost your place old boy.
 
		 * Or it is a simple substitute.
 
		 * We need to find a free available slot */
 
		type = this->AddEntityID(spec->grf_prop.local_id, spec->grf_prop.grffile->grfid, OBJECT_TRANSMITTER);
src/newgrf_commons.h
Show inline comments
 
@@ -199,7 +199,7 @@ protected:
 
	uint16 max_offset;       ///< what is the length of the original entity's array of specs
 
	uint16 max_new_entities; ///< what is the amount of entities, old and new summed
 

	
 
	uint16 invalid_ID;       ///< ID used to dected invalid entities;
 
	uint16 invalid_ID;       ///< ID used to detected invalid entities;
 
	virtual bool CheckValidNewID(uint16 testid) { return true; }
 

	
 
public:
src/newgrf_config.h
Show inline comments
 
@@ -51,7 +51,7 @@ enum GRFBugs {
 
/** Status of post-gameload GRF compatibility check */
 
enum GRFListCompatibility {
 
	GLC_ALL_GOOD,   ///< All GRF needed by game are present
 
	GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different chacksum) GRF found in at least one case
 
	GLC_COMPATIBLE, ///< Compatible (eg. the same ID, but different checksum) GRF found in at least one case
 
	GLC_NOT_FOUND,  ///< At least one GRF couldn't be found (higher priority than GLC_COMPATIBLE)
 
};
 

	
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -68,7 +68,7 @@ static inline uint GetInspectWindowNumbe
 

	
 
/**
 
 * The type of a property to show. This is used to
 
 * provide an appropriate represenation in the GUI.
 
 * provide an appropriate representation in the GUI.
 
 */
 
enum NIType {
 
	NIT_INT,   ///< The property is a simple integer
 
@@ -278,7 +278,7 @@ struct NewGRFInspectWindow : Window {
 
	/** GRFID of the caller of this window, 0 if it has no caller. */
 
	uint32 caller_grfid;
 

	
 
	/** The currently editted parameter, to update the right one. */
 
	/** The currently edited parameter, to update the right one. */
 
	byte current_edit_param;
 

	
 
	Scrollbar *vscroll;
 
@@ -776,7 +776,7 @@ struct SpriteAlignerWindow : Window {
 
					case WID_SA_LEFT:  spr->x_offs -= ZOOM_LVL_BASE; break;
 
					case WID_SA_RIGHT: spr->x_offs += ZOOM_LVL_BASE; break;
 
				}
 
				/* Ofcourse, we need to redraw the sprite, but where is it used?
 
				/* Of course, we need to redraw the sprite, but where is it used?
 
				 * Everywhere is a safe bet. */
 
				MarkWholeScreenDirty();
 
				break;
src/newgrf_engine.cpp
Show inline comments
 
@@ -628,7 +628,7 @@ static uint32 VehicleGetVariable(Vehicle
 
			return v->GetCurrentMaxSpeed();
 

	
 
		/* Variables which use the parameter */
 
		case 0x60: // Count consist's engine ID occurance
 
		case 0x60: // Count consist's engine ID occurrence
 
			if (v->type != VEH_TRAIN) return v->GetEngine()->grf_prop.local_id == parameter ? 1 : 0;
 

	
 
			{
 
@@ -1059,7 +1059,7 @@ bool UsesWagonOverride(const Vehicle *v)
 

	
 
/**
 
 * Evaluate a newgrf callback for vehicles
 
 * @param callback The callback to evalute
 
 * @param callback The callback to evaluate
 
 * @param param1   First parameter of the callback
 
 * @param param2   Second parameter of the callback
 
 * @param engine   Engine type of the vehicle to evaluate the callback for
 
@@ -1077,11 +1077,11 @@ uint16 GetVehicleCallback(CallbackID cal
 

	
 
/**
 
 * Evaluate a newgrf callback for vehicles with a different vehicle for parent scope.
 
 * @param callback The callback to evalute
 
 * @param callback The callback to evaluate
 
 * @param param1   First parameter of the callback
 
 * @param param2   Second parameter of the callback
 
 * @param engine   Engine type of the vehicle to evaluate the callback for
 
 * @param v        The vehicle to evaluate the callback for, or NULL if it doesnt exist yet
 
 * @param v        The vehicle to evaluate the callback for, or NULL if it doesn't exist yet
 
 * @param parent   The vehicle to use for parent scope
 
 * @return The value the callback returned, or CALLBACK_FAILED if it failed
 
 */
 
@@ -1239,7 +1239,7 @@ void CommitVehicleListOrderChanges()
 
	}
 
	QSortT(ordering.Begin(), ordering.Length(), EnginePreSort);
 

	
 
	/* Apply Insertion-Sort opeations */
 
	/* Apply Insertion-Sort operations */
 
	const ListOrderChange *end = _list_order_changes.End();
 
	for (const ListOrderChange *it = _list_order_changes.Begin(); it != end; ++it) {
 
		EngineID source = it->engine;
src/newgrf_gui.cpp
Show inline comments
 
@@ -1466,7 +1466,7 @@ private:
 
#if defined(ENABLE_NETWORK)
 
/**
 
 * Show the content list window with all missing grfs from the given list.
 
 * @param list The list of grfs to check for missings / not exactly matching ones.
 
 * @param list The list of grfs to check for missing / not exactly matching ones.
 
 */
 
void ShowMissingContentWindow(const GRFConfig *list)
 
{
 
@@ -1584,12 +1584,12 @@ public:
 
		uint avs_extra_width = min_list_width - min_avs_width;   // Additional width needed for avs to reach min_list_width.
 
		uint acs_extra_width = min_list_width - min_acs_width;   // Additional width needed for acs to reach min_list_width.
 

	
 
		/* Use 2 or 3 colmuns? */
 
		/* Use 2 or 3 columns? */
 
		uint min_three_columns = min_avs_width + min_acs_width + min_inf_width + 2 * INTER_COLUMN_SPACING;
 
		uint min_two_columns   = min_list_width + min_inf_width + INTER_COLUMN_SPACING;
 
		bool use_three_columns = this->editable && (min_three_columns + MIN_EXTRA_FOR_3_COLUMNS <= given_width);
 

	
 
		/* Info panel is a seperate column in both modes. Compute its width first. */
 
		/* Info panel is a separate column in both modes. Compute its width first. */
 
		uint extra_width, inf_width;
 
		if (use_three_columns) {
 
			extra_width = given_width - min_three_columns;
 
@@ -1619,11 +1619,11 @@ public:
 
			acs_width = ComputeMaxSize(min_acs_width, acs_width, this->acs->GetHorizontalStepSize(sizing)) -
 
					this->acs->padding_left - this->acs->padding_right;
 

	
 
			/* Never use fill_y on these; the minimal size is choosen, so that the 3 column view looks nice */
 
			/* Never use fill_y on these; the minimal size is chosen, so that the 3 column view looks nice */
 
			uint avs_height = ComputeMaxSize(this->avs->smallest_y, given_height, this->avs->resize_y);
 
			uint acs_height = ComputeMaxSize(this->acs->smallest_y, given_height, this->acs->resize_y);
 

	
 
			/* Assign size and position to the childs. */
 
			/* Assign size and position to the children. */
 
			if (rtl) {
 
				x += this->inf->padding_left;
 
				this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
 
@@ -1662,7 +1662,7 @@ public:
 
			if (this->editable) extra_height -= avs_height - this->avs->smallest_y;
 
			uint acs_height = ComputeMaxSize(this->acs->smallest_y, this->acs->smallest_y + extra_height, this->acs->resize_y);
 

	
 
			/* Assign size and position to the childs. */
 
			/* Assign size and position to the children. */
 
			if (rtl) {
 
				x += this->inf->padding_left;
 
				this->inf->AssignSizePosition(sizing, x, y + this->inf->padding_top, inf_width, inf_height, rtl);
src/newgrf_house.cpp
Show inline comments
 
@@ -32,7 +32,7 @@ HouseOverrideManager _house_mngr(NEW_HOU
 
/**
 
 * Constructor of a house scope resolver.
 
 * @param ro Surrounding resolver.
 
 * @param house_id Houe type being queried.
 
 * @param house_id House type being queried.
 
 * @param tile %Tile containing the house.
 
 * @param town %Town containing the house.
 
 * @param not_yet_constructed House is still under construction.
src/newgrf_industries.cpp
Show inline comments
 
@@ -63,11 +63,11 @@ uint32 GetIndustryIDAtOffset(TileIndex t
 
	const IndustryTileSpec *indtsp = GetIndustryTileSpec(gfx);
 

	
 
	if (gfx < NEW_INDUSTRYTILEOFFSET) { // Does it belongs to an old type?
 
		/* It is an old tile.  We have to see if it's been overriden */
 
		/* It is an old tile.  We have to see if it's been overridden */
 
		if (indtsp->grf_prop.override == INVALID_INDUSTRYTILE) { // has it been overridden?
 
			return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
 
		}
 
		/* Overriden */
 
		/* Overridden */
 
		const IndustryTileSpec *tile_ovr = GetIndustryTileSpec(indtsp->grf_prop.override);
 

	
 
		if (tile_ovr->grf_prop.grffile->grfid == cur_grfid) {
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -236,7 +236,7 @@ extern bool IsSlopeRefused(Slope current
 
 * @param initial_random_bits Random bits of industry after construction
 
 * @param founder       Industry founder
 
 * @param creation_type The circumstances the industry is created under.
 
 * @return Suceeded or failed command.
 
 * @return Succeeded or failed command.
 
 */
 
CommandCost PerformIndustryTileSlopeCheck(TileIndex ind_base_tile, TileIndex ind_tile, const IndustryTileSpec *its, IndustryType type, IndustryGfx gfx, uint itspec_index, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type)
 
{
src/newgrf_sound.cpp
Show inline comments
 
@@ -198,7 +198,7 @@ bool PlayVehicleSound(const Vehicle *v, 
 
}
 

	
 
/**
 
 * Play a NewGRF sound effect at the location of a specfic tile.
 
 * Play a NewGRF sound effect at the location of a specific tile.
 
 * @param file NewGRF triggering the sound effect.
 
 * @param sound_id Sound effect the NewGRF wants to play.
 
 * @param tile Location of the effect.
src/newgrf_spritegroup.cpp
Show inline comments
 
@@ -58,7 +58,7 @@ static inline uint32 GetVariable(const R
 
			if (object == NULL || object->grffile == NULL) return 0;
 
			return object->grffile->GetParam(parameter);
 

	
 
		/* Not a common variable, so evalute the feature specific variables */
 
		/* Not a common variable, so evaluate the feature specific variables */
 
		default: return scope->GetVariable(variable, parameter, available);
 
	}
 
}
 
@@ -117,7 +117,7 @@ ScopeResolver::~ScopeResolver() {}
 

	
 
/**
 
 * Resolver constructor.
 
 * @param grffile NewGRF file asscoiated with the object (or \c NULL if none).
 
 * @param grffile NewGRF file associated with the object (or \c NULL if none).
 
 * @param callback Callback code being resolved (default value is #CBID_NO_CALLBACK).
 
 * @param callback_param1 First parameter (var 10) of the callback (only used when \a callback is also set).
 
 * @param callback_param2 Second parameter (var 18) of the callback (only used when \a callback is also set).
src/newgrf_spritegroup.h
Show inline comments
 
@@ -161,8 +161,8 @@ enum DeterministicSpriteGroupAdjustOpera
 
	DSGA_OP_RST,  ///< return b
 
	DSGA_OP_STOP, ///< store a into persistent storage, indexed by b, return a
 
	DSGA_OP_ROR,  ///< rotate a b positions to the right
 
	DSGA_OP_SCMP, ///< (signed) comparision (a < b -> 0, a == b = 1, a > b = 2)
 
	DSGA_OP_UCMP, ///< (unsigned) comparision (a < b -> 0, a == b = 1, a > b = 2)
 
	DSGA_OP_SCMP, ///< (signed) comparison (a < b -> 0, a == b = 1, a > b = 2)
 
	DSGA_OP_UCMP, ///< (unsigned) comparison (a < b -> 0, a == b = 1, a > b = 2)
 
	DSGA_OP_SHL,  ///< a << b
 
	DSGA_OP_SHR,  ///< (unsigned) a >> b
 
	DSGA_OP_SAR,  ///< (signed) a >> b
src/newgrf_station.cpp
Show inline comments
 
@@ -613,7 +613,7 @@ static const SpriteGroup *ResolveStation
 
 * @param st Station (NULL in GUI)
 
 * @param tile Station tile being drawn (INVALID_TILE in GUI)
 
 * @param var10 Value to put in variable 10; normally 0; 1 when resolving the groundsprite and SSF_SEPARATE_GROUND is set.
 
 * @return First sprite of the Action 1 spriteset ot use, minus an offset of 0x42D to accommodate for weird NewGRF specs.
 
 * @return First sprite of the Action 1 spriteset to use, minus an offset of 0x42D to accommodate for weird NewGRF specs.
 
 */
 
SpriteID GetCustomStationRelocation(const StationSpec *statspec, BaseStation *st, TileIndex tile, uint32 var10)
 
{
 
@@ -704,7 +704,7 @@ int AllocateSpecToStation(const StationS
 
	if (i == MAX_SPECLIST) {
 
		/* As final effort when the spec list is already full...
 
		 * try to find the same spec and return that one. This might
 
		 * result in slighty "wrong" (as per specs) looking stations,
 
		 * result in slightly "wrong" (as per specs) looking stations,
 
		 * but it's fairly unlikely that one reaches the limit anyways.
 
		 */
 
		for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
src/newgrf_station.h
Show inline comments
 
@@ -108,12 +108,12 @@ struct StationSpec {
 

	
 
	/**
 
	 * Bitmask of number of platforms available for the station.
 
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 platforms.
 
	 * 0..6 correspond to 1..7, while bit 7 corresponds to >7 platforms.
 
	 */
 
	byte disallowed_platforms;
 
	/**
 
	 * Bitmask of platform lengths available for the station.
 
	 * 0..6 correpsond to 1..7, while bit 7 corresponds to >7 tiles long.
 
	 * 0..6 correspond to 1..7, while bit 7 corresponds to >7 tiles long.
 
	 */
 
	byte disallowed_lengths;
 

	
src/newgrf_text.cpp
Show inline comments
 
@@ -182,7 +182,7 @@ private:
 
	GRFText(byte langid_, const char *text_, size_t len_) : next(NULL), len(len_), langid(langid_)
 
	{
 
		/* We need to use memcpy instead of strcpy due to
 
		 * the possibility of "choice lists" and therefor
 
		 * the possibility of "choice lists" and therefore
 
		 * intermediate string terminators. */
 
		memcpy(this->text, text_, len);
 
	}
src/newgrf_townname.h
Show inline comments
 
@@ -18,7 +18,7 @@
 
#include "strings_type.h"
 

	
 
struct NamePart {
 
	byte prob;     ///< The relative probablity of the following name to appear in the bottom 7 bits.
 
	byte prob;     ///< The relative probability of the following name to appear in the bottom 7 bits.
 
	union {
 
		char *text;    ///< If probability bit 7 is clear
 
		byte id;       ///< If probability bit 7 is set
src/news_gui.cpp
Show inline comments
 
@@ -40,7 +40,7 @@
 

	
 
const NewsItem *_statusbar_news_item = NULL;
 

	
 
static uint MIN_NEWS_AMOUNT = 30;           ///< prefered minimum amount of news messages
 
static uint MIN_NEWS_AMOUNT = 30;           ///< preferred minimum amount of news messages
 
static uint _total_news = 0;                ///< current number of news items
 
static NewsItem *_oldest_news = NULL;       ///< head of news items queue
 
static NewsItem *_latest_news = NULL;       ///< tail of news items queue
 
@@ -977,7 +977,7 @@ static void DrawNewsString(uint left, ui
 
	}
 

	
 
	*dest = '\0';
 
	/* Truncate and show string; postfixed by '...' if neccessary */
 
	/* Truncate and show string; postfixed by '...' if necessary */
 
	DrawString(left, right, y, buffer2, colour);
 
}
 

	
 
@@ -985,7 +985,7 @@ struct MessageHistoryWindow : Window {
 
	static const int top_spacing;    ///< Additional spacing at the top of the #WID_MH_BACKGROUND widget.
 
	static const int bottom_spacing; ///< Additional spacing at the bottom of the #WID_MH_BACKGROUND widget.
 

	
 
	int line_height; /// < Height of a single line in the news histoy window including spacing.
 
	int line_height; /// < Height of a single line in the news history window including spacing.
 
	int date_width;  /// < Width needed for the date part.
 

	
 
	Scrollbar *vscroll;
src/object_gui.cpp
Show inline comments
 
@@ -115,7 +115,7 @@ public:
 
			}
 

	
 
			case WID_BO_OBJECT_SPRITE: {
 
				bool two_wide = false;  // Whether there will be two widgets next to eachother in the matrix or not.
 
				bool two_wide = false;  // Whether there will be two widgets next to each other in the matrix or not.
 
				int height[2] = {0, 0}; // The height for the different views; in this case views 1/2 and 4.
 

	
 
				/* Get the height and view information. */
 
@@ -190,7 +190,7 @@ public:
 
				/* Height of the selection matrix.
 
				 * Depending on the number of views, the matrix has a 1x1, 1x2, 2x1 or 2x2 layout. To make the previews
 
				 * look nice in all layouts, we use the 4x4 layout (smallest previews) as starting point. For the bigger
 
				 * previews in the layouts with less views we add space homogenously on all sides, so the 4x4 preview-rectangle
 
				 * previews in the layouts with less views we add space homogeneously on all sides, so the 4x4 preview-rectangle
 
				 * is centered in the 2x1, 1x2 resp. 1x1 buttons. */
 
				uint matrix_height = this->GetWidget<NWidgetMatrix>(WID_BO_OBJECT_MATRIX)->current_y;
 

	
src/object_map.h
Show inline comments
 
@@ -125,7 +125,7 @@ static inline byte GetObjectRandomBits(T
 
 * @param u      The object type of the tile.
 
 * @param o      The new owner of the tile.
 
 * @param index  Index to the object.
 
 * @param wc     Water class for this obect.
 
 * @param wc     Water class for this object.
 
 * @param random Random data to store on the tile
 
 */
 
static inline void MakeObject(TileIndex t, ObjectType u, Owner o, ObjectID index, WaterClass wc, byte random)
src/openttd.cpp
Show inline comments
 
@@ -1027,7 +1027,7 @@ void SwitchToMode(SwitchMode new_mode)
 
		}
 
	}
 
#endif /* ENABLE_NETWORK */
 
	/* Make sure all AI controllers are gone at quiting game */
 
	/* Make sure all AI controllers are gone at quitting game */
 
	if (new_mode != SM_SAVE_GAME) AI::KillAll();
 

	
 
	switch (new_mode) {
 
@@ -1295,7 +1295,7 @@ static void CheckCaches()
 
 */
 
void StateGameLoop()
 
{
 
	/* dont execute the state loop during pause */
 
	/* don't execute the state loop during pause */
 
	if (_pause_mode != PM_UNPAUSED) {
 
		UpdateLandscapingLimits();
 
		Game::GameLoop();
src/order_cmd.cpp
Show inline comments
 
@@ -79,7 +79,7 @@ void Order::MakeGoToStation(StationID de
 
/**
 
 * Makes this order a Go To Depot order.
 
 * @param destination   the depot to go to.
 
 * @param order         is this order a 'default' order, or an overriden vehicle order?
 
 * @param order         is this order a 'default' order, or an overridden vehicle order?
 
 * @param non_stop_type how to get to the depot?
 
 * @param action        what to do in the depot?
 
 * @param cargo         the cargo type to change to.
 
@@ -1118,7 +1118,7 @@ CommandCost CmdMoveOrder(TileIndex tile,
 
			 * predictable and transparent behaviour.
 
			 *
 
			 * With that decision it basically does not matter what we do to cur_implicit_order_index.
 
			 * If we change orders between the implict- and real-index, the implicit orders are mostly likely
 
			 * If we change orders between the implicit- and real-index, the implicit orders are mostly likely
 
			 * completely out-dated anyway. So, keep it simple and just keep cur_implicit_order_index as well.
 
			 * The worst which can happen is that a lot of implicit orders are removed when reaching current_order.
 
			 */
 
@@ -1521,7 +1521,7 @@ CommandCost CmdCloneOrder(TileIndex tile
 
			if (ret.Failed()) return ret;
 

	
 
			/* Trucks can't copy all the orders from busses (and visa versa),
 
			 * and neither can helicopters and aircarft. */
 
			 * and neither can helicopters and aircraft. */
 
			const Order *order;
 
			FOR_VEHICLE_ORDERS(src, order) {
 
				if (OrderGoesToStation(dst, order) &&
src/order_gui.cpp
Show inline comments
 
@@ -522,7 +522,7 @@ private:
 

	
 
	/**
 
	 * Return the memorised selected order.
 
	 * @return the memorised order if it is a vaild one
 
	 * @return the memorised order if it is a valid one
 
	 *  else return the number of orders
 
	 */
 
	VehicleOrderID OrderGetSel() const
src/os/windows/crashlog_win.cpp
Show inline comments
 
@@ -622,7 +622,7 @@ static INT_PTR CALLBACK CrashDialogFunc(
 
	switch (msg) {
 
		case WM_INITDIALOG: {
 
#if defined(UNICODE)
 
			/* We need to put the crash-log in a seperate buffer because the default
 
			/* We need to put the crash-log in a separate buffer because the default
 
			 * buffer in MB_TO_WIDE is not large enough (512 chars) */
 
			wchar_t crash_msgW[lengthof(CrashLogWindows::current->crashlog)];
 
#endif
src/os/windows/win32.cpp
Show inline comments
 
@@ -238,7 +238,7 @@ bool FiosIsValidFile(const char *path, c
 
	 * we just have to subtract POSIX epoch and scale down to units of seconds.
 
	 * http://www.gamedev.net/community/forums/topic.asp?topic_id=294070&whichpage=1&#1860504
 
	 * XXX - not entirely correct, since filetimes on FAT aren't UTC but local,
 
	 * this won't entirely be correct, but we use the time only for comparsion. */
 
	 * this won't entirely be correct, but we use the time only for comparison. */
 
	sb->st_mtime = (time_t)((*(const uint64*)&fd->ftLastWriteTime - posix_epoch_hns) / 1E7);
 
	sb->st_mode  = (fd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)? S_IFDIR : S_IFREG;
 

	
 
@@ -371,7 +371,7 @@ static INT_PTR CALLBACK HelpDialogFunc(H
 
			}
 
			*q = '\0';
 
#if defined(UNICODE)
 
			/* We need to put the text in a seperate buffer because the default
 
			/* We need to put the text in a separate buffer because the default
 
			 * buffer in MB_TO_WIDE might not be large enough (512 chars) */
 
			wchar_t help_msgW[8192];
 
#endif
 
@@ -407,7 +407,7 @@ void ShowInfo(const char *str)
 
			DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(101), NULL, HelpDialogFunc);
 
		} else {
 
#if defined(UNICODE)
 
			/* We need to put the text in a seperate buffer because the default
 
			/* We need to put the text in a separate buffer because the default
 
			 * buffer in MB_TO_WIDE might not be large enough (512 chars) */
 
			wchar_t help_msgW[8192];
 
#endif
src/pathfinder/npf/aystar.cpp
Show inline comments
 
@@ -124,7 +124,7 @@ void AyStar::CheckTile(AyStarNode *curre
 
	/* The f-value if g + h */
 
	new_f = new_g + new_h;
 

	
 
	/* Get the pointer to the parent in the ClosedList (the currentone is to a copy of the one in the OpenList) */
 
	/* Get the pointer to the parent in the ClosedList (the current one is to a copy of the one in the OpenList) */
 
	closedlist_parent = this->ClosedListIsInList(&parent->path.node);
 

	
 
	/* Check if this item is already in the OpenList */
src/pathfinder/npf/aystar.h
Show inline comments
 
@@ -64,7 +64,7 @@ struct AyStar;
 
/**
 
 * Check whether the end-tile is found.
 
 * @param aystar %AyStar search algorithm data.
 
 * @param current Node to examone.
 
 * @param current Node to exam one.
 
 * @note The 2nd parameter should be #OpenListNode, and \em not #AyStarNode. #AyStarNode is
 
 * part of #OpenListNode and so it could be accessed without any problems.
 
 * The good part about #OpenListNode is, and how AIs use it, that you can
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -100,7 +100,7 @@ static inline void NPFSetFlag(AyStarNode
 
}
 

	
 
/**
 
 * Calculates the minimum distance traveled to get from t0 to t1 when only
 
 * Calculates the minimum distance travelled to get from t0 to t1 when only
 
 * using tracks (ie, only making 45 degree turns). Returns the distance in the
 
 * NPF scale, ie the number of full tiles multiplied by NPF_TILE_LENGTH to
 
 * prevent rounding.
 
@@ -145,7 +145,7 @@ static int32 NPFCalcZero(AyStar *as, AyS
 
	return 0;
 
}
 

	
 
/* Calcs the heuristic to the target station or tile. For train stations, it
 
/* Calculates the heuristic to the target station or tile. For train stations, it
 
 * takes into account the direction of approach.
 
 */
 
static int32 NPFCalcStationOrTileHeuristic(AyStar *as, AyStarNode *current, OpenListNode *parent)
 
@@ -245,7 +245,7 @@ static uint NPFSlopeCost(AyStarNode *cur
 
	}
 
	return 0;
 
	/* Should we give a bonus for slope down? Probably not, we
 
	 * could just substract that bonus from the penalty, because
 
	 * could just subtract that bonus from the penalty, because
 
	 * there is only one level of steepness... */
 
}
 

	
 
@@ -569,7 +569,7 @@ static int32 NPFFindStationOrTile(AyStar
 
 * Find the node containing the first signal on the path.
 
 *
 
 * If the first signal is on the very first two tiles of the path,
 
 * the second signal is returnd. If no suitable signal is present, the
 
 * the second signal is returned. If no suitable signal is present, the
 
 * last node of the path is returned.
 
 */
 
static const PathNode *FindSafePosition(PathNode *path, const Train *v)
 
@@ -1052,7 +1052,7 @@ static NPFFoundTargetData NPFRouteToStat
 
/* Search using breadth first. Good for little track choice and inaccurate
 
 * heuristic, such as railway/road with two start nodes, the second being the reverse. Call
 
 * NPFGetFlag(result.node, NPF_FLAG_REVERSE) to see from which node the path
 
 * orginated. All pathfs from the second node will have the given
 
 * originated. All paths from the second node will have the given
 
 * reverse_penalty applied (NPF_TILE_LENGTH is the equivalent of one full
 
 * tile).
 
 */
src/pathfinder/npf/queue.cpp
Show inline comments
 
@@ -158,7 +158,7 @@ bool BinaryHeap::Delete(void *item, int 
 

	
 
		for (;;) {
 
			j = i;
 
			/* Check if we have 2 childs */
 
			/* Check if we have 2 children */
 
			if (2 * j + 1 <= this->size) {
 
				/* Is this child smaller than the parent? */
 
				if (this->GetElement(j).priority >= this->GetElement(2 * j).priority) i = 2 * j;
 
@@ -170,13 +170,13 @@ bool BinaryHeap::Delete(void *item, int 
 
				if (this->GetElement(j).priority >= this->GetElement(2 * j).priority) i = 2 * j;
 
			}
 

	
 
			/* One of our childs is smaller than we are, switch */
 
			/* One of our children is smaller than we are, switch */
 
			if (i != j) {
 
				temp = this->GetElement(j);
 
				this->GetElement(j) = this->GetElement(i);
 
				this->GetElement(i) = temp;
 
			} else {
 
				/* None of our childs is smaller, so we stay here.. stop :) */
 
				/* None of our children is smaller, so we stay here.. stop :) */
 
				break;
 
			}
 
		}
src/pathfinder/pathfinder_type.h
Show inline comments
 
@@ -18,7 +18,7 @@
 
static const int NPF_TILE_LENGTH = 100;
 

	
 
/**
 
 * This penalty is the equivalent of "infite", which means that paths that
 
 * This penalty is the equivalent of "infinite", which means that paths that
 
 * get this penalty will be chosen, but only if there is no other route
 
 * without it. Be careful with not applying this penalty to often, or the
 
 * total path cost might overflow..
 
@@ -33,7 +33,7 @@ static const int YAPF_TILE_LENGTH = 100;
 
static const int YAPF_TILE_CORNER_LENGTH = 71;
 

	
 
/**
 
 * This penalty is the equivalent of "infite", which means that paths that
 
 * This penalty is the equivalent of "infinite", which means that paths that
 
 * get this penalty will be chosen, but only if there is no other route
 
 * without it. Be careful with not applying this penalty to often, or the
 
 * total path cost might overflow..
src/pathfinder/yapf/yapf_base.hpp
Show inline comments
 
@@ -34,8 +34,8 @@ extern int _total_pf_time_us;
 
 *  you need to declare only your node type. Look at test_yapf.h for an example.
 
 *
 
 *
 
 *  Requrements to your pathfinder class derived from CYapfBaseT:
 
 *  -------------------------------------------------------------
 
 *  Requirements to your pathfinder class derived from CYapfBaseT:
 
 *  --------------------------------------------------------------
 
 *  Your pathfinder derived class needs to implement following methods:
 
 *    inline void PfSetStartupNodes()
 
 *    inline void PfFollowNode(Node& org)
src/pathfinder/yapf/yapf_costbase.hpp
Show inline comments
 
@@ -15,7 +15,7 @@
 
/** Base implementation for cost accounting. */
 
struct CYapfCostBase {
 
	/**
 
	 * Does the given track direction on the given tile yeild an uphill penalty?
 
	 * Does the given track direction on the given tile yield an uphill penalty?
 
	 * @param tile The tile to check.
 
	 * @param td   The track direction to check.
 
	 * @return True if there's a slope, otherwise false.
src/pbs.cpp
Show inline comments
 
@@ -219,7 +219,7 @@ static PBSTileInfo FollowReservation(Own
 

	
 
		if (first_loop) {
 
			/* Update the start tile after we followed the track the first
 
			 * time. This is neccessary because the track follower can skip
 
			 * time. This is necessary because the track follower can skip
 
			 * tiles (in stations for example) which means that we might
 
			 * never visit our original starting tile again. */
 
			start_tile = tile;
 
@@ -376,7 +376,7 @@ bool IsSafeWaitingPosition(const Train *
 
		if (HasSignalOnTrackdir(tile, trackdir) && !IsPbsSignal(GetSignalType(tile, TrackdirToTrack(trackdir)))) return true;
 
	}
 

	
 
	/* Check next tile. For perfomance reasons, we check for 90 degree turns ourself. */
 
	/* Check next tile. For performance reasons, we check for 90 degree turns ourself. */
 
	CFollowTrackRail ft(v, GetRailTypeInfo(v->railtype)->compatible_railtypes);
 

	
 
	/* End of track? */
src/rail.cpp
Show inline comments
 
@@ -216,7 +216,7 @@ RailType GetBestRailtype(const CompanyID
 
/**
 
 * Add the rail types that are to be introduced at the given date.
 
 * @param current The currently available railtypes.
 
 * @param date    The date for the introduction comparisions.
 
 * @param date    The date for the introduction comparisons.
 
 * @return The rail types that should be available when date
 
 *         introduced rail types are taken into account as well.
 
 */
src/rail.h
Show inline comments
 
@@ -76,7 +76,7 @@ enum RailTrackOffset {
 
};
 

	
 
/**
 
 * Offsets for spries within a bridge surface overlay set.
 
 * Offsets for sprites within a bridge surface overlay set.
 
 */
 
enum RailTrackBridgeOffset {
 
	RTBO_X,     ///< Piece of rail in X direction
 
@@ -120,7 +120,7 @@ struct RailtypeInfo {
 
		SpriteID single_s;     ///< single piece of rail in the southern corner
 
		SpriteID single_e;     ///< single piece of rail in the eastern corner
 
		SpriteID single_w;     ///< single piece of rail in the western corner
 
		SpriteID single_sloped;///< single piecs of rail for slopes
 
		SpriteID single_sloped;///< single piece of rail for slopes
 
		SpriteID crossing;     ///< level crossing, rail in X direction
 
		SpriteID tunnel;       ///< tunnel sprites base
 
	} base_sprites;
src/rail_cmd.cpp
Show inline comments
 
@@ -923,7 +923,7 @@ CommandCost CmdRemoveRailroadTrack(TileI
 
 * @return the cost of this operation or an error
 
 *
 
 * @todo When checking for the tile slope,
 
 * distingush between "Flat land required" and "land sloped in wrong direction"
 
 * distinguish between "Flat land required" and "land sloped in wrong direction"
 
 */
 
CommandCost CmdBuildTrainDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
 
@@ -1096,7 +1096,7 @@ CommandCost CmdBuildSingleSignal(TileInd
 
				if (convert_signal) {
 
					/* convert signal button pressed */
 
					if (ctrl_pressed) {
 
						/* toggle the pressent signal variant: SIG_ELECTRIC <-> SIG_SEMAPHORE */
 
						/* toggle the present signal variant: SIG_ELECTRIC <-> SIG_SEMAPHORE */
 
						SetSignalVariant(tile, track, (GetSignalVariant(tile, track) == SIG_ELECTRIC) ? SIG_SEMAPHORE : SIG_ELECTRIC);
 
						/* Query current signal type so the check for PBS signals below works. */
 
						sigtype = GetSignalType(tile, track);
 
@@ -1650,7 +1650,7 @@ CommandCost CmdConvertRail(TileIndex til
 
				if (endtile < tile && TileX(endtile) >= TileX(ta.tile) && TileX(endtile) < TileX(ta.tile) + ta.w &&
 
						TileY(endtile) >= TileY(ta.tile) && TileY(endtile) < TileY(ta.tile) + ta.h) continue;
 

	
 
				/* When not coverting rail <-> el. rail, any vehicle cannot be in tunnel/bridge */
 
				/* When not converting rail <-> el. rail, any vehicle cannot be in tunnel/bridge */
 
				if (!IsCompatibleRail(GetRailType(tile), totype)) {
 
					CommandCost ret = TunnelBridgeIsFree(tile, endtile);
 
					if (ret.Failed()) {
 
@@ -2643,8 +2643,8 @@ static TrackStatus GetTileTrackStatus_Tr
 
			/* When signals are not present (in neither direction),
 
			 * we pretend them to be green. Otherwise, it depends on
 
			 * the signal type. For signals that are only active from
 
			 * one side, we set the missing signals explicitely to
 
			 * `green'. Otherwise, they implicitely become `red'. */
 
			 * one side, we set the missing signals explicitly to
 
			 * `green'. Otherwise, they implicitly become `red'. */
 
			if (!IsOnewaySignal(tile, TRACK_UPPER) || (a & SignalOnTrack(TRACK_UPPER)) == 0) b |= ~a & SignalOnTrack(TRACK_UPPER);
 
			if (!IsOnewaySignal(tile, TRACK_LOWER) || (a & SignalOnTrack(TRACK_LOWER)) == 0) b |= ~a & SignalOnTrack(TRACK_LOWER);
 

	
src/rail_gui.cpp
Show inline comments
 
@@ -294,7 +294,7 @@ static void ToggleRailButton_Remove(Wind
 
/**
 
 * Updates the Remove button because of Ctrl state change
 
 * @param w window the button belongs to
 
 * @return true iff the remove buton was changed
 
 * @return true iff the remove button was changed
 
 */
 
static bool RailToolbar_CtrlChanged(Window *w)
 
{
src/rev.cpp.in
Show inline comments
 
@@ -49,7 +49,7 @@ const char _openttd_build_date[] = __DAT
 

	
 
/**
 
 * Let us know if current build was modified. This detection
 
 * works even in the case when revision string is overriden by
 
 * works even in the case when revision string is overridden by
 
 * --revision argument.
 
 * Value 0 means no modification, 1 is for unknown state
 
 * (compiling from sources without any version control software)
 
@@ -68,7 +68,7 @@ const byte _openttd_revision_modified = 
 
 *
 
 * The 19th bit is there so the development/betas/alpha, etc. leading to a
 
 * final release will always have a lower version number than the released
 
 * version, thus making comparisions on specific revisions easy.
 
 * version, thus making comparisons on specific revisions easy.
 
 */
 
const uint32 _openttd_newgrf_version = 1 << 28 | 3 << 24 | 0 << 20 | 0 << 19 | (!!REVISION!! & ((1 << 19) - 1));
 

	
src/rev.h
Show inline comments
 
@@ -7,7 +7,7 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file rev.h declaration of OTTD revision dependant variables */
 
/** @file rev.h declaration of OTTD revision dependent variables */
 

	
 
#ifndef REV_H
 
#define REV_H
src/road.cpp
Show inline comments
 
@@ -23,7 +23,7 @@
 
/**
 
 * Return if the tile is a valid tile for a crossing.
 
 *
 
 * @param tile the curent tile
 
 * @param tile the current tile
 
 * @param ax the axis of the road over the rail
 
 * @return true if it is a valid tile
 
 */
 
@@ -36,7 +36,7 @@ static bool IsPossibleCrossing(const Til
 
}
 

	
 
/**
 
 * Clean up unneccesary RoadBits of a planed tile.
 
 * Clean up unnecessary RoadBits of a planed tile.
 
 * @param tile current tile
 
 * @param org_rb planed RoadBits
 
 * @return optimised RoadBits
 
@@ -56,7 +56,7 @@ RoadBits CleanUpRoadBits(const TileIndex
 
			const RoadBits mirrored_rb = MirrorRoadBits(target_rb);
 

	
 
			switch (GetTileType(neighbor_tile)) {
 
				/* Allways connective ones */
 
				/* Always connective ones */
 
				case MP_CLEAR: case MP_TREES:
 
					connective = true;
 
					break;
 
@@ -83,11 +83,11 @@ RoadBits CleanUpRoadBits(const TileIndex
 
					connective = !IsWater(neighbor_tile);
 
					break;
 

	
 
				/* The defentetly not connective ones */
 
				/* The definitely not connective ones */
 
				default: break;
 
			}
 

	
 
			/* If the neighbor tile is inconnective remove the planed road connection to it */
 
			/* If the neighbor tile is inconnective, remove the planed road connection to it */
 
			if (!connective) org_rb ^= target_rb;
 

	
 
		}
src/road_cmd.cpp
Show inline comments
 
@@ -993,7 +993,7 @@ CommandCost CmdRemoveLongRoad(TileIndex 
 
 * @return the cost of this operation or an error
 
 *
 
 * @todo When checking for the tile slope,
 
 * distingush between "Flat land required" and "land sloped in wrong direction"
 
 * distinguish between "Flat land required" and "land sloped in wrong direction"
 
 */
 
CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
 
{
src/road_func.h
Show inline comments
 
@@ -92,7 +92,7 @@ static inline RoadBits MirrorRoadBits(Ro
 
/**
 
 * Calculate rotated RoadBits
 
 *
 
 * Move the Roadbits clockwise til they are in their final position.
 
 * Move the Roadbits clockwise until they are in their final position.
 
 *
 
 * @param r The given RoadBits value
 
 * @param rot The given Rotation angle
src/road_gui.cpp
Show inline comments
 
@@ -273,7 +273,7 @@ static void PlaceRoad_TruckStation(TileI
 
typedef void OnButtonClick(Window *w);
 

	
 
/**
 
 * Toogles state of the Remove button of Build road toolbar
 
 * Toggles state of the Remove button of Build road toolbar
 
 * @param w window the button belongs to
 
 */
 
static void ToggleRoadButton_Remove(Window *w)
 
@@ -287,7 +287,7 @@ static void ToggleRoadButton_Remove(Wind
 
/**
 
 * Updates the Remove button because of Ctrl state change
 
 * @param w window the button belongs to
 
 * @return true iff the remove buton was changed
 
 * @return true iff the remove button was changed
 
 */
 
static bool RoadToolbar_CtrlChanged(Window *w)
 
{
 
@@ -350,7 +350,7 @@ struct BuildRoadToolbarWindow : Window {
 
	void UpdateOptionWidgetStatus(RoadToolbarWidgets clicked_widget)
 
	{
 
		/* The remove and the one way button state is driven
 
		 * by the other buttons so they don't act on themselfs.
 
		 * by the other buttons so they don't act on themselves.
 
		 * Both are only valid if they are able to apply as options. */
 
		switch (clicked_widget) {
 
			case WID_ROT_REMOVE:
src/roadstop.cpp
Show inline comments
 
@@ -65,7 +65,7 @@ void RoadStop::MakeDriveThrough()
 

	
 
	RoadStopType rst = GetRoadStopType(this->xy);
 
	DiagDirection dir = GetRoadStopDir(this->xy);
 
	/* Use absolute so we always go towards the nortern tile */
 
	/* Use absolute so we always go towards the northern tile */
 
	TileIndexDiff offset = abs(TileOffsByDiagDir(dir));
 

	
 
	/* Information about the tile north of us */
 
@@ -81,7 +81,7 @@ void RoadStop::MakeDriveThrough()
 
	/* Amount of road stops that will be added to the 'northern' head */
 
	int added = 1;
 
	if (north && rs_north->east != NULL) { // (east != NULL) == (west != NULL)
 
		/* There is a more nothern one, so this can join them */
 
		/* There is a more northern one, so this can join them */
 
		this->east = rs_north->east;
 
		this->west = rs_north->west;
 

	
 
@@ -133,7 +133,7 @@ void RoadStop::ClearDriveThrough()
 

	
 
	RoadStopType rst = GetRoadStopType(this->xy);
 
	DiagDirection dir = GetRoadStopDir(this->xy);
 
	/* Use absolute so we always go towards the nortern tile */
 
	/* Use absolute so we always go towards the northern tile */
 
	TileIndexDiff offset = abs(TileOffsByDiagDir(dir));
 

	
 
	/* Information about the tile north of us */
 
@@ -178,7 +178,7 @@ void RoadStop::ClearDriveThrough()
 
			/* We have to rebuild the entries because we cannot easily determine
 
			 * how full each part is. So instead of keeping and maintaining a list
 
			 * of vehicles and using that to 'rebuild' the occupied state we just
 
			 * rebuild it from scratch as that removes lots of maintainance code
 
			 * rebuild it from scratch as that removes lots of maintenance code
 
			 * for the vehicle list and it's faster in real games as long as you
 
			 * do not keep split and merge road stop every tick by the millions. */
 
			rs_south_base->east->Rebuild(rs_south_base);
 
@@ -243,7 +243,7 @@ bool RoadStop::Enter(RoadVehicle *rv)
 
		uint bay_nr = this->AllocateBay();
 
		SB(rv->state, RVS_USING_SECOND_BAY, 1, bay_nr);
 

	
 
		/* Mark the station entrace as busy */
 
		/* Mark the station entrance as busy */
 
		this->SetEntranceBusy(true);
 
		return true;
 
	}
 
@@ -290,7 +290,7 @@ void RoadStop::Entry::Leave(const RoadVe
 
void RoadStop::Entry::Enter(const RoadVehicle *rv)
 
{
 
	/* we cannot assert on this->occupied < this->length because of the
 
	 * remote possibility that RVs are running through eachother when
 
	 * remote possibility that RVs are running through each other when
 
	 * trying to prevention an infinite jam. */
 
	this->occupied += rv->gcache.cached_total_length;
 
}
src/saveload/afterload.cpp
Show inline comments
 
@@ -713,8 +713,8 @@ bool AfterLoadGame()
 

	
 
	/* If Load Scenario / New (Scenario) Game is used,
 
	 *  a company does not exist yet. So create one here.
 
	 * 1 exeption: network-games. Those can have 0 companies
 
	 *   But this exeption is not true for non dedicated network_servers! */
 
	 * 1 exception: network-games. Those can have 0 companies
 
	 *   But this exception is not true for non-dedicated network servers! */
 
	if (!Company::IsValidID(COMPANY_FIRST) && (!_networking || (_networking && _network_server && !_network_dedicated))) {
 
		DoStartupNewCompany(false);
 
		Company *c = Company::Get(COMPANY_FIRST);
 
@@ -821,7 +821,7 @@ bool AfterLoadGame()
 

	
 
					case STATION_OILRIG: {
 
						/* Very old savegames sometimes have phantom oil rigs, i.e.
 
						 * an oil rig which got shut down, but not completly removed from
 
						 * an oil rig which got shut down, but not completely removed from
 
						 * the map
 
						 */
 
						TileIndex t1 = TILE_ADDXY(t, 0, 1);
 
@@ -1275,7 +1275,7 @@ bool AfterLoadGame()
 
	}
 

	
 
	/* From 32 on we save the industry who made the farmland.
 
	 *  To give this prettyness to old savegames, we remove all farmfields and
 
	 *  To give this prettiness to old savegames, we remove all farmfields and
 
	 *  plant new ones. */
 
	if (IsSavegameVersionBefore(32)) {
 
		Industry *i;
 
@@ -1831,7 +1831,7 @@ bool AfterLoadGame()
 
					if (HasStationRail(t)) SetRailStationReservation(t, false);
 
					break;
 

	
 
				case MP_TUNNELBRIDGE: // Clear PBS reservation on tunnels/birdges
 
				case MP_TUNNELBRIDGE: // Clear PBS reservation on tunnels/bridges
 
					if (GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL) SetTunnelBridgeReservation(t, false);
 
					break;
 

	
src/saveload/cargopacket_sl.cpp
Show inline comments
 
@@ -22,7 +22,7 @@
 
{
 
	if (IsSavegameVersionBefore(44)) {
 
		Vehicle *v;
 
		/* If we remove a station while cargo from it is still enroute, payment calculation will assume
 
		/* If we remove a station while cargo from it is still en route, payment calculation will assume
 
		 * 0, 0 to be the source of the cargo, resulting in very high payments usually. v->source_xy
 
		 * stores the coordinates, preserving them even if the station is removed. However, if a game is loaded
 
		 * where this situation exists, the cargo-source information is lost. in this case, we set the source
src/saveload/oldloader.cpp
Show inline comments
 
@@ -78,7 +78,7 @@ byte ReadByte(LoadgameState *ls)
 
	which means that we have a chunk, which starts with a length
 
	byte. If that byte is negative, we have to repeat the next byte
 
	that many times ( + 1). Else, we need to read that amount of bytes.
 
	Works pretty good if you have many zero's behind eachother */
 
	Works pretty well if you have many zeros behind each other */
 

	
 
	if (ls->chunk_size == 0) {
 
		/* Read new chunk */
 
@@ -235,7 +235,7 @@ static inline bool CheckOldSavegameType(
 
	}
 

	
 
	bool ret = VerifyOldNameChecksum(temp, len);
 
	temp[len - 2] = '\0'; // name is nul-terminated in savegame, but it's better to be sure
 
	temp[len - 2] = '\0'; // name is null-terminated in savegame, but it's better to be sure
 
	str_validate(temp, last);
 

	
 
	return ret;
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -626,7 +626,7 @@ static bool LoadOldOrder(LoadgameState *
 
	if (o->IsType(OT_NOTHING)) {
 
		delete o;
 
	} else {
 
		/* Relink the orders to eachother (in the orders for one vehicle are behind eachother,
 
		/* Relink the orders to each other (in the orders for one vehicle are behind each other,
 
		 * with an invalid order (OT_NOTHING) as indication that it is the last order */
 
		Order *prev = Order::GetIfValid(num - 1);
 
		if (prev != NULL) prev->next = o;
 
@@ -637,7 +637,7 @@ static bool LoadOldOrder(LoadgameState *
 

	
 
static bool LoadOldAnimTileList(LoadgameState *ls, int num)
 
{
 
	/* This is sligthly hackish - we must load a chunk into an array whose
 
	/* This is slightly hackish - we must load a chunk into an array whose
 
	 * address isn't static, but instead pointed to by _animated_tile_list.
 
	 * To achieve that, create an OldChunks list on the stack on the fly.
 
	 * The list cannot be static because the value of _animated_tile_list
src/saveload/saveload.cpp
Show inline comments
 
@@ -1204,7 +1204,7 @@ static size_t ReferenceToInt(const void 
 
	if (obj == NULL) return 0;
 

	
 
	switch (rt) {
 
		case REF_VEHICLE_OLD: // Old vehicles we save as new onces
 
		case REF_VEHICLE_OLD: // Old vehicles we save as new ones
 
		case REF_VEHICLE:   return ((const  Vehicle*)obj)->index + 1;
 
		case REF_STATION:   return ((const  Station*)obj)->index + 1;
 
		case REF_TOWN:      return ((const     Town*)obj)->index + 1;
 
@@ -1392,7 +1392,7 @@ static inline bool SlSkipVariableOnLoad(
 
 * Calculate the size of an object.
 
 * @param object to be measured
 
 * @param sld The SaveLoad description of the object so we know how to manipulate it
 
 * @return size of given objetc
 
 * @return size of given object
 
 */
 
size_t SlCalcObjLength(const void *object, const SaveLoad *sld)
 
{
 
@@ -2087,7 +2087,7 @@ struct ZlibSaveFilter : SaveFilter {
 
			 * "Conditional jump or move depends on uninitialised value(s)" kind:
 
			 * According to the author of zlib it is not a bug and it won't be fixed.
 
			 * http://groups.google.com/group/comp.compression/browse_thread/thread/b154b8def8c2a3ef/cdf9b8729ce17ee2
 
			 * [Mark Adler, Feb 24 2004, 'zlib-1.2.1 valgrind warnings' in the newgroup comp.compression]
 
			 * [Mark Adler, Feb 24 2004, 'zlib-1.2.1 valgrind warnings' in the newsgroup comp.compression]
 
			 */
 
			int r = deflate(&this->z, mode);
 

	
 
@@ -2274,7 +2274,7 @@ static const SaveLoadFormat _saveload_fo
 
	 * Higher compression levels are possible, and might improve savegame size by up to 25%, but are also up to 10 times slower.
 
	 * The next significant reduction in file size is at level 4, but that is already 4 times slower. Level 3 is primarily 50%
 
	 * slower while not improving the filesize, while level 0 and 1 are faster, but don't reduce savegame size much.
 
	 * It's OTTX and not e.g. OTTL because liblzma is part of xz-utils and .tar.xz is prefered over .tar.lzma. */
 
	 * It's OTTX and not e.g. OTTL because liblzma is part of xz-utils and .tar.xz is preferred over .tar.lzma. */
 
	{"lzma",   TO_BE32X('OTTX'), CreateLoadFilter<LZMALoadFilter>,   CreateSaveFilter<LZMASaveFilter>,   0, 2, 9},
 
#else
 
	{"lzma",   TO_BE32X('OTTX'), NULL,                               NULL,                               0, 0, 0},
 
@@ -2472,10 +2472,10 @@ void WaitTillSaved()
 

	
 
/**
 
 * Actually perform the saving of the savegame.
 
 * General tactic is to first save the game to memory, then write it to file
 
 * General tactics is to first save the game to memory, then write it to file
 
 * using the writer, either in threaded mode if possible, or single-threaded.
 
 * @param writer   The filter to write the savegame to.
 
 * @param threaded Whether to try to perform the saving asynchroniously.
 
 * @param threaded Whether to try to perform the saving asynchronously.
 
 * @return Return the result of the action. #SL_OK or #SL_ERROR
 
 */
 
static SaveOrLoadResult DoSave(SaveFilter *writer, bool threaded)
 
@@ -2506,7 +2506,7 @@ static SaveOrLoadResult DoSave(SaveFilte
 
/**
 
 * Save the game using a (writer) filter.
 
 * @param writer   The filter to write the savegame to.
 
 * @param threaded Whether to try to perform the saving asynchroniously.
 
 * @param threaded Whether to try to perform the saving asynchronously.
 
 * @return Return the result of the action. #SL_OK or #SL_ERROR
 
 */
 
SaveOrLoadResult SaveWithFilter(SaveFilter *writer, bool threaded)
 
@@ -2568,7 +2568,7 @@ static SaveOrLoadResult DoLoad(LoadFilte
 
			_sl_version = TO_BE32(hdr[1]) >> 16;
 
			/* Minor is not used anymore from version 18.0, but it is still needed
 
			 * in versions before that (4 cases) which can't be removed easy.
 
			 * Therefor it is loaded, but never saved (or, it saves a 0 in any scenario). */
 
			 * Therefore it is loaded, but never saved (or, it saves a 0 in any scenario). */
 
			_sl_minor_version = (TO_BE32(hdr[1]) >> 8) & 0xFF;
 

	
 
			DEBUG(sl, 1, "Loading savegame version %d", _sl_version);
src/saveload/town_sl.cpp
Show inline comments
 
@@ -44,7 +44,7 @@ void RebuildTownCaches()
 
		if (GetHouseNorthPart(house_id) == 0) town->cache.num_houses++;
 
	}
 

	
 
	/* Update the population and num_house dependant values */
 
	/* Update the population and num_house dependent values */
 
	FOR_ALL_TOWNS(town) {
 
		UpdateTownRadius(town);
 
		UpdateTownCargoes(town);
src/screenshot.cpp
Show inline comments
 
@@ -844,7 +844,7 @@ bool MakeHeightmapScreenshot(const char 
 
 * Make an actual screenshot.
 
 * @param t    the type of screenshot to make.
 
 * @param name the name to give to the screenshot.
 
 * @return true iff the screenshow was made successfully
 
 * @return true iff the screenshot was made successfully
 
 */
 
bool MakeScreenshot(ScreenshotType t, const char *name)
 
{
src/script/api/ai_changelog.hpp
Show inline comments
 
@@ -215,7 +215,7 @@
 
 *     AIBaseStation, but can still be used as AIStation.GetConstructionDate
 
 * \li WaypointID was replaced by StationID. All WaypointIDs from previous
 
 *     savegames are invalid. Use STATION_INVALID instead of WAYPOINT_INVALID
 
 * \li AIWaypointList constructor now needs a WaypointType similiar to AIStationList,
 
 * \li AIWaypointList constructor now needs a WaypointType similar to AIStationList,
 
 *     it can also handle buoys.
 
 * \li AIVehicleList_Station now also works for waypoints
 
 * \li Stations can be build over rail without signals that is in the right
src/script/api/script_company.hpp
Show inline comments
 
@@ -172,13 +172,13 @@ public:
 
	 * @param quarter The quarter to get the income of.
 
	 * @pre ResolveCompanyID(company) != COMPANY_INVALID.
 
	 * @pre quarter <= EARLIEST_QUARTER.
 
	 * @return The bruto income of the company in the given quarter.
 
	 * @return The gross income of the company in the given quarter.
 
	 */
 
	static Money GetQuarterlyIncome(CompanyID company, uint32 quarter);
 

	
 
	/**
 
	 * Get the expenses of the company in the given quarter.
 
	 * Note that this function only considers recurring expensens from vehicle
 
	 * Note that this function only considers recurring expenses from vehicle
 
	 * running cost, maintenance and interests; it does not include one-time
 
	 * expenses from construction and buying stuff.
 
	 * @param company The company to get the quarterly expenses of.
 
@@ -223,7 +223,7 @@ public:
 

	
 
	/**
 
	 * Build your company's HQ on the given tile.
 
	 * @param tile The tile to build your HQ on, this tile is the most nothern tile of your HQ.
 
	 * @param tile The tile to build your HQ on, this tile is the most northern tile of your HQ.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @game @pre Valid ScriptCompanyMode active in scope.
 
	 * @exception ScriptError::ERR_AREA_NOT_CLEAR
 
@@ -238,7 +238,7 @@ public:
 
	 * Return the location of a company's HQ.
 
	 * @param company The company the get the HQ of.
 
	 * @pre ResolveCompanyID(company) != COMPANY_INVALID.
 
	 * @return The tile of the company's HQ, this tile is the most nothern tile
 
	 * @return The tile of the company's HQ, this tile is the most northern tile
 
	 *  of that HQ, or ScriptMap::TILE_INVALID if there is no HQ yet.
 
	 */
 
	static TileIndex GetCompanyHQ(CompanyID company);
src/script/api/script_controller.hpp
Show inline comments
 
@@ -129,7 +129,7 @@ public:
 
	 * Import a library.
 
	 * @param library The name of the library to import.
 
	 * @param class_name Under which name you want it to be available (or "" if you just want the returning object).
 
	 * @param version Which version you want specificly.
 
	 * @param version Which version you want specifically.
 
	 * @return The loaded library object. If class_name is set, it is also available (under the scope of the import) under that name.
 
	 * @note This command can be called from the global space, and does not need an instance.
 
	 */
src/script/api/script_engine.hpp
Show inline comments
 
@@ -255,7 +255,7 @@ public:
 

	
 
	/**
 
	 * Get the maximum allowed distance between two orders for an engine.
 
	 * The distance returned is a vehicle-type specific distance indepenent from other
 
	 * The distance returned is a vehicle-type specific distance independent from other
 
	 * map distances, you may use the result of this function to compare it
 
	 * with the result of ScriptOrder::GetOrderDistance.
 
	 * @param engine_id The engine to get the max distance for.
src/script/api/script_error.hpp
Show inline comments
 
@@ -129,7 +129,7 @@ public:
 
	/**
 
	 * Check the membership of the last thrown error.
 
	 * @return The category the error belongs to.
 
	 * @note The last throw error can be aquired by calling GetLastError().
 
	 * @note The last throw error can be acquired by calling GetLastError().
 
	 */
 
	static ErrorCategories GetErrorCategory();
 

	
src/script/api/script_event_types.hpp
Show inline comments
 
@@ -141,7 +141,7 @@ private:
 
};
 

	
 
/**
 
 * Event Subidy Awarded, indicating a subsidy is awarded to some company.
 
 * Event Subsidy Awarded, indicating a subsidy is awarded to some company.
 
 * @api ai game
 
 */
 
class ScriptEventSubsidyAwarded : public ScriptEvent {
 
@@ -168,7 +168,7 @@ public:
 
	SubsidyID GetSubsidyID() { return this->subsidy_id; }
 

	
 
private:
 
	SubsidyID subsidy_id; ///< The subsidy that was awared.
 
	SubsidyID subsidy_id; ///< The subsidy that was awarded.
 
};
 

	
 
/**
 
@@ -412,7 +412,7 @@ class ScriptEventCompanyMerger : public 
 
public:
 
	/**
 
	 * @param old_owner The company bought off.
 
	 * @param new_owner The company that bougth owner.
 
	 * @param new_owner The company that bought owner.
 
	 */
 
	ScriptEventCompanyMerger(Owner old_owner, Owner new_owner) :
 
		ScriptEvent(ET_COMPANY_MERGER),
 
@@ -432,7 +432,7 @@ public:
 
	 * @return The CompanyID of the company that has been bought.
 
	 * @note: The value below is not valid anymore as CompanyID, and
 
	 *  ScriptCompany::ResolveCompanyID will return COMPANY_COMPANY. It's
 
	 *  only usefull if you're keeping track of company's yourself.
 
	 *  only useful if you're keeping track of company's yourself.
 
	 */
 
	ScriptCompany::CompanyID GetOldCompanyID() { return this->old_owner; }
 

	
 
@@ -700,7 +700,7 @@ public:
 
	VehicleID GetVehicleID() { return this->vehicle; }
 

	
 
private:
 
	StationID station; ///< The station the vehicle arived at.
 
	StationID station; ///< The station the vehicle arrived at.
 
	VehicleID vehicle; ///< The vehicle that arrived at the station.
 
};
 

	
src/script/api/script_execmode.hpp
Show inline comments
 
@@ -25,7 +25,7 @@
 
class ScriptExecMode : public ScriptObject {
 
private:
 
	ScriptModeProc *last_mode;   ///< The previous mode we were in.
 
	ScriptObject *last_instance; ///< The previous instace of the mode.
 
	ScriptObject *last_instance; ///< The previous instance of the mode.
 

	
 
protected:
 
	/**
src/script/api/script_game.hpp
Show inline comments
 
@@ -26,7 +26,7 @@ public:
 
	 */
 
	enum LandscapeType {
 
		/* Note: these values represent part of the in-game LandscapeType enum */
 
		LT_TEMPERATE  = ::LT_TEMPERATE, ///< Temperate climiate.
 
		LT_TEMPERATE  = ::LT_TEMPERATE, ///< Temperate climate.
 
		LT_ARCTIC     = ::LT_ARCTIC,    ///< Arctic climate.
 
		LT_TROPIC     = ::LT_TROPIC,    ///< Tropic climate.
 
		LT_TOYLAND    = ::LT_TOYLAND,   ///< Toyland climate.
src/script/api/script_gamesettings.hpp
Show inline comments
 
@@ -43,7 +43,7 @@ public:
 
	 * @warning Results of this function are not governed by the API. This means
 
	 *          that a setting that previously existed can be gone or has
 
	 *          changed its name.
 
	 * @note Results achieved in the past offer no gurantee for the future.
 
	 * @note Results achieved in the past offer no guarantee for the future.
 
	 * @return True if and only if the setting is valid.
 
	 */
 
	static bool IsValid(const char *setting);
 
@@ -56,7 +56,7 @@ public:
 
	 *          that the value of settings may be out of the expected range. It
 
	 *          also means that a setting that previously existed can be gone or
 
	 *          has changed its name/characteristics.
 
	 * @note Results achieved in the past offer no gurantee for the future.
 
	 * @note Results achieved in the past offer no guarantee for the future.
 
	 * @return The value for the setting.
 
	 */
 
	static int32 GetValue(const char *setting);
 
@@ -67,7 +67,7 @@ public:
 
	 * @param value The value to set the setting to.
 
	 * @pre IsValid(setting).
 
	 * @return True if the action succeeded.
 
	 * @note Results achieved in the past offer no gurantee for the future.
 
	 * @note Results achieved in the past offer no guarantee for the future.
 
	 * @api -ai
 
	 */
 
	static bool SetValue(const char *setting, int value);
src/script/api/script_list.cpp
Show inline comments
 
@@ -835,7 +835,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELV
 
			return SQ_ERROR;
 
		}
 

	
 
		/* Retreive the return value */
 
		/* Retrieve the return value */
 
		SQInteger value;
 
		switch (sq_gettype(vm, -1)) {
 
			case OT_INTEGER: {
src/script/api/script_list.hpp
Show inline comments
 
@@ -164,7 +164,7 @@ public:
 
	/**
 
	 * Removes all items with a value above start and below end.
 
	 * @param start the lower bound of the to be removed values (exclusive).
 
	 * @param end   the upper bound of the to be removed valuens (exclusive).
 
	 * @param end   the upper bound of the to be removed values (exclusive).
 
	 */
 
	void RemoveBetweenValue(int32 start, int32 end);
 

	
src/script/api/script_order.hpp
Show inline comments
 
@@ -47,7 +47,7 @@ public:
 

	
 
		/** Do not stop at the stations that are passed when going to the destination. Only for trains and road vehicles. */
 
		OF_NON_STOP_INTERMEDIATE = 1 << 0,
 
		/** Do not stop at the destionation station. Only for trains and road vehicles. */
 
		/** Do not stop at the destination station. Only for trains and road vehicles. */
 
		OF_NON_STOP_DESTINATION  = 1 << 1,
 

	
 
		/** Always unload the vehicle; only for stations. Cannot be set when OF_TRANSFER or OF_NO_UNLOAD is set. */
 
@@ -586,7 +586,7 @@ public:
 
	/**
 
	 * Get the distance between two points for a vehicle type.
 
	 * Use this function to compute the distance between two tiles wrt. a vehicle type.
 
	 * These vehicle-type specific distances are indepenent from other map distances, you may
 
	 * These vehicle-type specific distances are independent from other map distances, you may
 
	 * use the result of this function to compare it with the result of
 
	 * ScriptEngine::GetMaximumOrderDistance or ScriptVehicle::GetMaximumOrderDistance.
 
	 * @param vehicle_type The vehicle type to get the distance for.
src/script/api/script_rail.hpp
Show inline comments
 
@@ -314,7 +314,7 @@ public:
 
	/**
 
	 * Remove all rail waypoint pieces within a rectangle on the map.
 
	 * @param tile One corner of the rectangle to clear.
 
	 * @param tile2 The oppposite corner.
 
	 * @param tile2 The opposite corner.
 
	 * @param keep_rail Whether to keep the rail after removal.
 
	 * @pre IsValidTile(tile).
 
	 * @pre IsValidTile(tile2).
 
@@ -326,7 +326,7 @@ public:
 
	/**
 
	 * Remove all rail station platform pieces within a rectangle on the map.
 
	 * @param tile One corner of the rectangle to clear.
 
	 * @param tile2 The oppposite corner.
 
	 * @param tile2 The opposite corner.
 
	 * @param keep_rail Whether to keep the rail after removal.
 
	 * @pre IsValidTile(tile).
 
	 * @pre IsValidTile(tile2).
src/script/api/script_road.hpp
Show inline comments
 
@@ -147,7 +147,7 @@ public:
 
	/**
 
	 * Checks whether the given tiles are directly connected, i.e. whether
 
	 *  a road vehicle can travel from the center of the first tile to the
 
	  * center of the second tile.
 
	 * center of the second tile.
 
	 * @param tile_from The source tile.
 
	 * @param tile_to The destination tile.
 
	 * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
src/script/api/script_subsidy.hpp
Show inline comments
 
@@ -26,7 +26,7 @@ public:
 
	 */
 
	enum SubsidyParticipantType {
 
		/* Values are important, as they represent the internal state of the game.
 
		 *  It is orignally named SourceType. ST_HEADQUARTERS is intentionally
 
		 *  It is originally named SourceType. ST_HEADQUARTERS is intentionally
 
		 *  left out, as it cannot be used for Subsidies. */
 
		SPT_INDUSTRY =    0, ///< Subsidy participant is an industry
 
		SPT_TOWN     =    1, ///< Subsidy participant is a town
src/script/api/script_testmode.hpp
Show inline comments
 
@@ -27,7 +27,7 @@
 
class ScriptTestMode : public ScriptObject {
 
private:
 
	ScriptModeProc *last_mode;   ///< The previous mode we were in.
 
	ScriptObject *last_instance; ///< The previous instace of the mode.
 
	ScriptObject *last_instance; ///< The previous instance of the mode.
 

	
 
protected:
 
	/**
src/script/api/script_town.hpp
Show inline comments
 
@@ -228,7 +228,7 @@ public:
 
	/**
 
	 * Set the amount of days between town growth.
 
	 * @param town_id The index of the town.
 
	 * @param days_between_town_growth The amont of days between town growth.
 
	 * @param days_between_town_growth The amount of days between town growth.
 
	 * @pre IsValidTown(town_id).
 
	 * @return True if the action succeeded.
 
	 * @note If 'Fund Building' and 'economy.town_growth_rate' is active, the game will often set a new GrowthRate.
src/script/api/script_vehicle.hpp
Show inline comments
 
@@ -370,7 +370,7 @@ public:
 
	static bool MoveWagonChain(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon);
 

	
 
	/**
 
	 * Gets the capacity of the given vehicle when refited to the given cargo type.
 
	 * Gets the capacity of the given vehicle when refitted to the given cargo type.
 
	 * @param vehicle_id The vehicle to refit.
 
	 * @param cargo The cargo to refit to.
 
	 * @pre IsValidVehicle(vehicle_id).
 
@@ -549,7 +549,7 @@ public:
 

	
 
	/**
 
	 * Get the maximum allowed distance between two orders for a vehicle.
 
	 * The distance returned is a vehicle-type specific distance indepenent from other
 
	 * The distance returned is a vehicle-type specific distance independent from other
 
	 * map distances, you may use the result of this function to compare it
 
	 * with the result of ScriptOrder::GetOrderDistance.
 
	 * @param vehicle_id The vehicle to get the distance for.
src/script/api/script_viewport.hpp
Show inline comments
 
@@ -7,7 +7,7 @@
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_viewport.hpp Everything to manipulate the users viewport. */
 
/** @file script_viewport.hpp Everything to manipulate the user's viewport. */
 

	
 
#ifndef SCRIPT_VIEWPORT_HPP
 
#define SCRIPT_VIEWPORT_HPP
 
@@ -15,7 +15,7 @@
 
#include "script_object.hpp"
 

	
 
/**
 
 * Class that manipultes the users viewport.
 
 * Class that manipulates the user's viewport.
 
 * @api game
 
 */
 
class ScriptViewport : public ScriptObject {
src/script/api/script_window.hpp
Show inline comments
 
@@ -908,7 +908,7 @@ public:
 
		WID_RV_LEFT_MATRIX                           = ::WID_RV_LEFT_MATRIX,                           ///< The matrix on the left.
 
		WID_RV_LEFT_SCROLLBAR                        = ::WID_RV_LEFT_SCROLLBAR,                        ///< The scrollbar for the matrix on the left.
 
		WID_RV_RIGHT_MATRIX                          = ::WID_RV_RIGHT_MATRIX,                          ///< The matrix on the right.
 
		WID_RV_RIGHT_SCROLLBAR                       = ::WID_RV_RIGHT_SCROLLBAR,                       ///< The scrollbar for the matrxi on the right.
 
		WID_RV_RIGHT_SCROLLBAR                       = ::WID_RV_RIGHT_SCROLLBAR,                       ///< The scrollbar for the matrix on the right.
 
		WID_RV_LEFT_DETAILS                          = ::WID_RV_LEFT_DETAILS,                          ///< Details of the entry on the left.
 
		WID_RV_RIGHT_DETAILS                         = ::WID_RV_RIGHT_DETAILS,                         ///< Details of the entry on the right.
 

	
 
@@ -1997,10 +1997,10 @@ public:
 
	/** Widgets of the #BuildRailDepotWindow class. */
 
	enum BuildRailDepotWidgets {
 
		/* Name starts with BRA instead of BR, because of collision with BuildRoadDepotWidgets */
 
		WID_BRAD_DEPOT_NE                            = ::WID_BRAD_DEPOT_NE,                            ///< Build a depot with the entrace in the north east.
 
		WID_BRAD_DEPOT_SE                            = ::WID_BRAD_DEPOT_SE,                            ///< Build a depot with the entrace in the south east.
 
		WID_BRAD_DEPOT_SW                            = ::WID_BRAD_DEPOT_SW,                            ///< Build a depot with the entrace in the south west.
 
		WID_BRAD_DEPOT_NW                            = ::WID_BRAD_DEPOT_NW,                            ///< Build a depot with the entrace in the north west.
 
		WID_BRAD_DEPOT_NE                            = ::WID_BRAD_DEPOT_NE,                            ///< Build a depot with the entrance in the north east.
 
		WID_BRAD_DEPOT_SE                            = ::WID_BRAD_DEPOT_SE,                            ///< Build a depot with the entrance in the south east.
 
		WID_BRAD_DEPOT_SW                            = ::WID_BRAD_DEPOT_SW,                            ///< Build a depot with the entrance in the south west.
 
		WID_BRAD_DEPOT_NW                            = ::WID_BRAD_DEPOT_NW,                            ///< Build a depot with the entrance in the north west.
 
	};
 

	
 
	/** Widgets of the #BuildRailWaypointWindow class. */
 
@@ -2097,8 +2097,8 @@ public:
 
		WID_CC_RATE_DOWN                             = ::WID_CC_RATE_DOWN,                             ///< Down button.
 
		WID_CC_RATE_UP                               = ::WID_CC_RATE_UP,                               ///< Up button.
 
		WID_CC_RATE                                  = ::WID_CC_RATE,                                  ///< Rate of currency.
 
		WID_CC_SEPARATOR_EDIT                        = ::WID_CC_SEPARATOR_EDIT,                        ///< Seperator edit button.
 
		WID_CC_SEPARATOR                             = ::WID_CC_SEPARATOR,                             ///< Current seperator.
 
		WID_CC_SEPARATOR_EDIT                        = ::WID_CC_SEPARATOR_EDIT,                        ///< Separator edit button.
 
		WID_CC_SEPARATOR                             = ::WID_CC_SEPARATOR,                             ///< Current separator.
 
		WID_CC_PREFIX_EDIT                           = ::WID_CC_PREFIX_EDIT,                           ///< Prefix edit button.
 
		WID_CC_PREFIX                                = ::WID_CC_PREFIX,                                ///< Current prefix.
 
		WID_CC_SUFFIX_EDIT                           = ::WID_CC_SUFFIX_EDIT,                           ///< Suffix edit button.
 
@@ -2229,7 +2229,7 @@ public:
 
		WID_TT_LEVEL_LAND                            = ::WID_TT_LEVEL_LAND,                            ///< Level land button.
 
		WID_TT_DEMOLISH                              = ::WID_TT_DEMOLISH,                              ///< Demolish aka dynamite button.
 
		WID_TT_BUY_LAND                              = ::WID_TT_BUY_LAND,                              ///< Buy land button.
 
		WID_TT_PLANT_TREES                           = ::WID_TT_PLANT_TREES,                           ///< Plant trees button (note: opens seperate window, no place-push-button).
 
		WID_TT_PLANT_TREES                           = ::WID_TT_PLANT_TREES,                           ///< Plant trees button (note: opens separate window, no place-push-button).
 
		WID_TT_PLACE_SIGN                            = ::WID_TT_PLACE_SIGN,                            ///< Place sign button.
 
		WID_TT_PLACE_OBJECT                          = ::WID_TT_PLACE_OBJECT,                          ///< Place object button.
 
	};
 
@@ -2473,7 +2473,7 @@ public:
 
		WID_VD_DETAILS_CARGO_CARRIED                 = ::WID_VD_DETAILS_CARGO_CARRIED,                 ///< Show carried cargo per part of the train.
 
		WID_VD_DETAILS_TRAIN_VEHICLES                = ::WID_VD_DETAILS_TRAIN_VEHICLES,                ///< Show all parts of the train with their description.
 
		WID_VD_DETAILS_CAPACITY_OF_EACH              = ::WID_VD_DETAILS_CAPACITY_OF_EACH,              ///< Show the capacity of all train parts.
 
		WID_VD_DETAILS_TOTAL_CARGO                   = ::WID_VD_DETAILS_TOTAL_CARGO,                   ///< Show the capacity and carried cargo amounts aggregrated per cargo of the train.
 
		WID_VD_DETAILS_TOTAL_CARGO                   = ::WID_VD_DETAILS_TOTAL_CARGO,                   ///< Show the capacity and carried cargo amounts aggregated per cargo of the train.
 
	};
 

	
 
	/** Widgets of the #VehicleListWindow class. */
src/script/squirrel.cpp
Show inline comments
 
@@ -345,7 +345,7 @@ Squirrel::Squirrel(const char *APIName) 
 
	sq_newclosure(this->vm, &Squirrel::_RunError, 0);
 
	sq_seterrorhandler(this->vm);
 

	
 
	/* Set the foreigh pointer, so we can always find this instance from within the VM */
 
	/* Set the foreign pointer, so we can always find this instance from within the VM */
 
	sq_setforeignptr(this->vm, this);
 

	
 
	sq_pushroottable(this->vm);
src/script/squirrel_std.hpp
Show inline comments
 
@@ -58,7 +58,7 @@ void squirrel_register_std(Squirrel *eng
 

	
 
/**
 
 * Register all standard functions that are available on first startup.
 
 * @note this set is very limited, and is only ment to load other scripts and things like that.
 
 * @note this set is very limited, and is only meant to load other scripts and things like that.
 
 */
 
void squirrel_register_global_std(Squirrel *engine);
 

	
src/settings.cpp
Show inline comments
 
@@ -98,7 +98,7 @@ static const char * const _list_group_na
 
};
 

	
 
/**
 
 * Find the index value of a ONEofMANY type in a string seperated by |
 
 * Find the index value of a ONEofMANY type in a string separated by |
 
 * @param many full domain of values the ONEofMANY setting can have
 
 * @param one the current value of the setting for which a value needs found
 
 * @param onelen force calculation of the *one parameter
 
@@ -130,7 +130,7 @@ static size_t LookupOneOfMany(const char
 
 * Find the set-integer value MANYofMANY type in a string
 
 * @param many full domain of values the MANYofMANY setting can have
 
 * @param str the current string value of the setting, each individual
 
 * of seperated by a whitespace,tab or | character
 
 * of separated by a whitespace,tab or | character
 
 * @return the 'fully' set integer, or -1 if a set is not found
 
 */
 
static size_t LookupManyOfMany(const char *many, const char *str)
 
@@ -159,7 +159,7 @@ static size_t LookupManyOfMany(const cha
 

	
 
/**
 
 * Parse an integerlist string and set each found value
 
 * @param p the string to be parsed. Each element in the list is seperated by a
 
 * @param p the string to be parsed. Each element in the list is separated by a
 
 * comma or a space character
 
 * @param items pointer to the integerlist-array that will be filled with values
 
 * @param maxitems the maximum number of elements the integerlist-array has
 
@@ -248,7 +248,7 @@ static bool LoadIntList(const char *str,
 

	
 
/**
 
 * Convert an integer-array (intlist) to a string representation. Each value
 
 * is seperated by a comma or a space character
 
 * is separated by a comma or a space character
 
 * @param buf output buffer where the string-representation will be stored
 
 * @param last last item to write to in the output buffer
 
 * @param array pointer to the integer-arrays that is read from
 
@@ -1502,7 +1502,7 @@ static IniFile *IniLoadConfig()
 
void LoadFromConfig(bool minimal)
 
{
 
	IniFile *ini = IniLoadConfig();
 
	if (!minimal) ResetCurrencies(false); // Initialize the array of curencies, without preserving the custom one
 
	if (!minimal) ResetCurrencies(false); // Initialize the array of currencies, without preserving the custom one
 

	
 
	/* Load basic settings only during bootstrap, load other settings not during bootstrap */
 
	HandleSettingDescs(ini, IniLoadSettings, IniLoadSettingList, minimal, !minimal);
src/settings_gui.cpp
Show inline comments
 
@@ -918,7 +918,7 @@ void SettingEntry::GetFoldingState(bool 
 

	
 
/**
 
 * Check whether an entry is visible and not folded or filtered away.
 
 * Note: This does not consider the scrolling range; it might still require scrolling ot make the setting really visible.
 
 * Note: This does not consider the scrolling range; it might still require scrolling to make the setting really visible.
 
 * @param item Entry to search for.
 
 * @return true if entry is visible.
 
 */
 
@@ -1390,7 +1390,7 @@ uint SettingsPage::GetMaxHelpHeight(int 
 
/**
 
 * Draw a selected part of the settings page.
 
 *
 
 * The scrollbar uses rows of the page, while the page data strucure is a tree of #SettingsPage and #SettingEntry objects.
 
 * The scrollbar uses rows of the page, while the page data structure is a tree of #SettingsPage and #SettingEntry objects.
 
 * As a result, the drawing routing traverses the tree from top to bottom, counting rows in \a cur_row until it reaches \a first_row.
 
 * Then it enables drawing rows while traversing until \a max_row is reached, at which point drawing is terminated.
 
 *
 
@@ -2491,7 +2491,7 @@ struct CustomCurrencyWindow : Window {
 
				_custom_currency.rate = Clamp(atoi(str), 1, UINT16_MAX);
 
				break;
 

	
 
			case WID_CC_SEPARATOR: // Thousands seperator
 
			case WID_CC_SEPARATOR: // Thousands separator
 
				strecpy(_custom_currency.separator, str, lastof(_custom_currency.separator));
 
				break;
 

	
src/settings_internal.h
Show inline comments
 
@@ -27,7 +27,7 @@ enum SettingDescTypeLong {
 
	SDT_BOOLX       = 1, ///< a boolean number
 
	SDT_ONEOFMANY   = 2, ///< bitmasked number where only ONE bit may be set
 
	SDT_MANYOFMANY  = 3, ///< bitmasked number where MULTIPLE bits may be set
 
	SDT_INTLIST     = 4, ///< list of integers seperated by a comma ','
 
	SDT_INTLIST     = 4, ///< list of integers separated by a comma ','
 
	SDT_STRING      = 5, ///< string with a pre-allocated buffer
 
	SDT_END,
 
	/* 10 more possible primitives */
 
@@ -88,7 +88,7 @@ enum SettingType {
 
};
 

	
 
typedef bool OnChange(int32 var);           ///< callback prototype on data modification
 
typedef size_t OnConvert(const char *value); ///< callback prototype for convertion error
 
typedef size_t OnConvert(const char *value); ///< callback prototype for conversion error
 

	
 
/** Properties of config file settings. */
 
struct SettingDescBase {
src/settings_type.h
Show inline comments
 
@@ -424,7 +424,7 @@ struct OrderSettings {
 
	bool   improved_load;                    ///< improved loading algorithm
 
	bool   gradual_loading;                  ///< load vehicles gradually
 
	bool   selectgoods;                      ///< only send the goods to station if a train has been there
 
	bool   no_servicing_if_no_breakdowns;    ///< dont send vehicles to depot when breakdowns are disabled
 
	bool   no_servicing_if_no_breakdowns;    ///< don't send vehicles to depot when breakdowns are disabled
 
	bool   serviceathelipad;                 ///< service helicopters at helipads automatically (no need to send to depot)
 
};
 

	
 
@@ -463,7 +463,7 @@ struct EconomySettings {
 
	bool   fund_buildings;                   ///< allow funding new buildings
 
	bool   fund_roads;                       ///< allow funding local road reconstruction
 
	bool   give_money;                       ///< allow giving other companies money
 
	bool   mod_road_rebuild;                 ///< roadworks remove unneccesary RoadBits
 
	bool   mod_road_rebuild;                 ///< roadworks remove unnecessary RoadBits
 
	bool   multiple_industry_per_town;       ///< allow many industries of the same type per town
 
	uint8  town_growth_rate;                 ///< town growth rate
 
	uint8  larger_towns;                     ///< the number of cities to build. These start off larger and grow twice as fast
src/ship_cmd.cpp
Show inline comments
 
@@ -375,7 +375,7 @@ static bool ShipAccelerate(Vehicle *v)
 
		SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
 
	}
 

	
 
	/* Convert direction-indepenent speed into direction-dependent speed. (old movement method) */
 
	/* Convert direction-independent speed into direction-dependent speed. (old movement method) */
 
	spd = v->GetOldAdvanceSpeed(spd);
 

	
 
	if (spd == 0) return false;
src/signal.cpp
Show inline comments
 
@@ -52,7 +52,7 @@ template <typename Tdir, uint items>
 
struct SmallSet {
 
private:
 
	uint n;           // actual number of units
 
	bool overflowed;  // did we try to oveflow the set?
 
	bool overflowed;  // did we try to overflow the set?
 
	const char *name; // name, used for debugging purposes...
 

	
 
	/** Element of set */
 
@@ -73,7 +73,7 @@ public:
 
	}
 

	
 
	/**
 
	 * Returns value of 'oveflowed'
 
	 * Returns value of 'overflowed'
 
	 * @return did we try to overflow the set?
 
	 */
 
	bool Overflowed()
 
@@ -131,7 +131,7 @@ public:
 
	 * Tries to find given tile and dir in the set
 
	 * @param tile tile
 
	 * @param dir and dir to find
 
	 * @return true iff the tile & dir elemnt was found
 
	 * @return true iff the tile & dir element was found
 
	 */
 
	bool IsIn(TileIndex tile, Tdir dir)
 
	{
 
@@ -201,7 +201,7 @@ static Vehicle *TrainOnTileEnum(Vehicle 
 
 * The new and reverse direction is removed from _globset, because we are sure
 
 * it doesn't need to be checked again
 
 * Also, remove reverse direction from _tbdset
 
 * This is the 'core' part so the graph seaching won't enter any tile twice
 
 * This is the 'core' part so the graph searching won't enter any tile twice
 
 *
 
 * @param t1 tile we are entering
 
 * @param d1 direction (tile side) we are entering
 
@@ -227,7 +227,7 @@ static inline bool CheckAddToTodoSet(Til
 
 * The new and reverse direction is removed from Global set, because we are sure
 
 * it doesn't need to be checked again
 
 * Also, remove reverse direction from Todo set
 
 * This is the 'core' part so the graph seaching won't enter any tile twice
 
 * This is the 'core' part so the graph searching won't enter any tile twice
 
 *
 
 * @param t1 tile we are entering
 
 * @param d1 direction (tile side) we are entering
src/signs_gui.cpp
Show inline comments
 
@@ -429,7 +429,7 @@ struct SignWindow : Window, SignList {
 

	
 
	void UpdateSignEditWindow(const Sign *si)
 
	{
 
		/* Display an empty string when the sign hasnt been edited yet */
 
		/* Display an empty string when the sign hasn't been edited yet */
 
		if (si->name != NULL) {
 
			SetDParam(0, si->index);
 
			this->name_editbox.text.Assign(STR_SIGN_NAME);
src/smallmap_gui.cpp
Show inline comments
 
@@ -151,7 +151,7 @@ static LegendAndColour _legend_land_owne
 

	
 
/**
 
 * Allow room for all industries, plus a terminator entry
 
 * This is required in order to have the indutry slots all filled up
 
 * This is required in order to have the industry slots all filled up
 
 */
 
static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES + 1];
 
/** For connecting industry type to position in industries list(small map legend) */
 
@@ -1593,8 +1593,8 @@ bool SmallMapWindow::show_towns = true;
 
 * Custom container class for displaying smallmap with a vertically resizing legend panel.
 
 * The legend panel has a smallest height that depends on its width. Standard containers cannot handle this case.
 
 *
 
 * @note The container assumes it has two childs, the first is the display, the second is the bar with legends and selection image buttons.
 
 *       Both childs should be both horizontally and vertically resizable and horizontally fillable.
 
 * @note The container assumes it has two children, the first is the display, the second is the bar with legends and selection image buttons.
 
 *       Both children should be both horizontally and vertically resizable and horizontally fillable.
 
 *       The bar should have a minimal size with a zero-size legends display. Child padding is not supported.
 
 */
 
class NWidgetSmallmapDisplay : public NWidgetContainer {
src/sortlist_type.h
Show inline comments
 
@@ -30,7 +30,7 @@ enum SortListFlags {
 
};
 
DECLARE_ENUM_AS_BIT_SET(SortListFlags)
 

	
 
/** Data structure describing how to show the list (what sort direction and criterium). */
 
/** Data structure describing how to show the list (what sort direction and criteria). */
 
struct Listing {
 
	bool order;    ///< Ascending/descending
 
	byte criteria; ///< Sorting criteria
 
@@ -232,7 +232,7 @@ public:
 
	}
 

	
 
	/**
 
	 * Toogle the sort order
 
	 * Toggle the sort order
 
	 *  Since that is the worst condition for the sort function
 
	 *  reverse the list here.
 
	 */
src/sound.cpp
Show inline comments
 
@@ -306,7 +306,7 @@ template <class Tbase_set>
 

	
 
	const Tbase_set *best = NULL;
 
	for (const Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != NULL; c = c->next) {
 
		/* Skip unuseable sets */
 
		/* Skip unusable sets */
 
		if (c->GetNumMissing() != 0) continue;
 

	
 
		if (best == NULL ||
src/sprite.cpp
Show inline comments
 
@@ -21,7 +21,7 @@
 
 * Draws a tile sprite sequence.
 
 * @param ti The tile to draw on
 
 * @param dts Sprite and subsprites to draw
 
 * @param to The transparancy bit that toggles drawing of these sprites
 
 * @param to The transparency bit that toggles drawing of these sprites
 
 * @param orig_offset Sprite-Offset for original sprites
 
 * @param newgrf_offset Sprite-Offset for NewGRF defined sprites
 
 * @param default_palette The default recolour sprite to use (typically company colour)
src/spritecache.cpp
Show inline comments
 
@@ -414,7 +414,7 @@ static void *ReadSprite(const SpriteCach
 
		 *  extract the data directly and store that as sprite.
 
		 * Ugly: yes. Other solution: no. Blame the original author or
 
		 *  something ;) The image should really have been a data-stream
 
		 *  (so type = 0xFF basicly). */
 
		 *  (so type = 0xFF basically). */
 
		uint num = sprite[ZOOM_LVL_NORMAL].width * sprite[ZOOM_LVL_NORMAL].height;
 

	
 
		Sprite *s = (Sprite *)allocator(sizeof(*s) + num);
src/station.cpp
Show inline comments
 
@@ -376,7 +376,7 @@ void StationRect::MakeEmpty()
 
 * @note x and y are in Tile coordinates
 
 * @param x X coordinate
 
 * @param y Y coordinate
 
 * @param distance The maxmium distance a point may have (L1 norm)
 
 * @param distance The maximum distance a point may have (L1 norm)
 
 * @return true if the point is within distance tiles of the station rectangle
 
 */
 
bool StationRect::PtInExtendedRect(int x, int y, int distance) const
src/station_cmd.cpp
Show inline comments
 
@@ -594,7 +594,7 @@ void UpdateStationAcceptance(Station *st
 
		uint num_acc = 0;
 
		uint num_rej = 0;
 

	
 
		/* Test each cargo type to see if its acceptange has changed */
 
		/* Test each cargo type to see if its acceptance has changed */
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
 
			if (HasBit(new_acc, i)) {
 
				if (!HasBit(old_acc, i) && num_acc < lengthof(accepts)) {
 
@@ -692,7 +692,7 @@ CommandCost ClearTile_Station(TileIndex 
 
 * @param invalid_dirs Prohibited directions for slopes (set of #DiagDirection).
 
 * @param allowed_z Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile.
 
 * @param allow_steep Whether steep slopes are allowed.
 
 * @param check_bridge Check for the existance of a bridge.
 
 * @param check_bridge Check for the existence of a bridge.
 
 * @return The cost in case of success, or an error code if it failed.
 
 */
 
CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge = true)
 
@@ -3075,7 +3075,7 @@ static VehicleEnterTileStatus VehicleEnt
 
		/* Stop whenever that amount of station ahead + the distance from the
 
		 * begin of the platform to the stop location is longer than the length
 
		 * of the platform. Station ahead 'includes' the current tile where the
 
		 * vehicle is on, so we need to substract that. */
 
		 * vehicle is on, so we need to subtract that. */
 
		if (!IsInsideBS(stop + station_ahead, station_length, TILE_SIZE)) return VETSB_CONTINUE;
 

	
 
		DiagDirection dir = DirToDiagDir(v->direction);
 
@@ -3268,7 +3268,7 @@ static void UpdateStationRating(Station 
 

	
 
				/* At some point we really must cap the cargo. Previously this
 
				 * was a strict 4095, but now we'll have a less strict, but
 
				 * increasingly agressive truncation of the amount of cargo. */
 
				 * increasingly aggressive truncation of the amount of cargo. */
 
				static const uint WAITING_CARGO_THRESHOLD  = 1 << 12;
 
				static const uint WAITING_CARGO_CUT_FACTOR = 1 <<  6;
 
				static const uint MAX_WAITING_CARGO        = 1 << 15;
src/statusbar_gui.h
Show inline comments
 
@@ -16,7 +16,7 @@
 
enum StatusBarInvalidate {
 
	SBI_SAVELOAD_START,  ///< started saving
 
	SBI_SAVELOAD_FINISH, ///< finished saving
 
	SBI_SHOW_TICKER,     ///< start scolling news
 
	SBI_SHOW_TICKER,     ///< start scrolling news
 
	SBI_SHOW_REMINDER,   ///< show a reminder (dot on the right side of the statusbar)
 
	SBI_NEWS_DELETED,    ///< abort current news display (active news were deleted)
 
	SBI_END
src/strgen/strgen.cpp
Show inline comments
 
@@ -263,7 +263,7 @@ struct FileWriter {
 
	/** Make sure the file is closed. */
 
	virtual ~FileWriter()
 
	{
 
		/* If we weren't closed an exception was thrown, so remove the termporary file. */
 
		/* If we weren't closed an exception was thrown, so remove the temporary file. */
 
		if (fh != NULL) {
 
			fclose(this->fh);
 
			unlink(this->filename);
 
@@ -371,16 +371,16 @@ static inline void ottd_mkdir(const char
 

	
 
/**
 
 * Create a path consisting of an already existing path, a possible
 
 * path seperator and the filename. The seperator is only appended if the path
 
 * does not already end with a seperator
 
 * path separator and the filename. The separator is only appended if the path
 
 * does not already end with a separator
 
 */
 
static inline char *mkpath(char *buf, size_t buflen, const char *path, const char *file)
 
{
 
	ttd_strlcpy(buf, path, buflen); // copy directory into buffer
 

	
 
	char *p = strchr(buf, '\0'); // add path seperator if necessary
 
	char *p = strchr(buf, '\0'); // add path separator if necessary
 
	if (p[-1] != PATHSEPCHAR && (size_t)(p - buf) + 1 < buflen) *p++ = PATHSEPCHAR;
 
	ttd_strlcpy(p, file, buflen - (size_t)(p - buf)); // catenate filename at end of buffer
 
	ttd_strlcpy(p, file, buflen - (size_t)(p - buf)); // concatenate filename at end of buffer
 
	return buf;
 
}
 

	
src/strgen/strgen.h
Show inline comments
 
@@ -44,7 +44,7 @@ struct StringData {
 
	LangString **strings; ///< Array of all known strings.
 
	uint16 *hash_heads;   ///< Hash table for the strings.
 
	size_t tabs;          ///< The number of 'tabs' of strings.
 
	size_t max_strings;   ///< The maxmimum number of strings.
 
	size_t max_strings;   ///< The maximum number of strings.
 
	int next_string_id;   ///< The next string ID to allocate.
 

	
 
	StringData(size_t tabs);
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -235,7 +235,7 @@ static int _cur_argidx;
 
/** The buffer for writing a single string. */
 
struct Buffer : SmallVector<byte, 256> {
 
	/**
 
	 * Conveniance method for adding a byte.
 
	 * Convenience method for adding a byte.
 
	 * @param value The value to add.
 
	 */
 
	void AppendByte(byte value)
src/string.cpp
Show inline comments
 
@@ -250,7 +250,7 @@ void str_validate(char *str, const char 
 
			if ((settings & SVS_REPLACE_WITH_QUESTION_MARK) != 0) *dst++ = '?';
 

	
 
			/* In case of these two special cases assume that they really
 
			 * mean SETX/SETXY and also "eat" the paramater. If this was
 
			 * mean SETX/SETXY and also "eat" the parameter. If this was
 
			 * not the case the string was broken to begin with and this
 
			 * would not break much more. */
 
			if (c == SCC_SETX) {
 
@@ -413,7 +413,7 @@ int CDECL vsnprintf(char *str, size_t si
 
		}
 
	} else if ((size_t)ret < size) {
 
		/* The buffer is big enough for the number of
 
		 * characers stored (excluding null), i.e.
 
		 * characters stored (excluding null), i.e.
 
		 * the string has been null-terminated. */
 
		return ret;
 
	}
src/string_func.h
Show inline comments
 
@@ -49,7 +49,7 @@ bool StrValid(const char *str, const cha
 
/**
 
 * Check if a string buffer is empty.
 
 *
 
 * @param s The pointer to the firste element of the buffer
 
 * @param s The pointer to the first element of the buffer
 
 * @return true if the buffer starts with the terminating null-character or
 
 *         if the given pointer points to NULL else return false
 
 */
 
@@ -61,7 +61,7 @@ static inline bool StrEmpty(const char *
 
/**
 
 * Get the length of a string, within a limited buffer.
 
 *
 
 * @param str The pointer to the firste element of the buffer
 
 * @param str The pointer to the first element of the buffer
 
 * @param maxlen The maximum size of the buffer
 
 * @return The length of the string
 
 */
src/strings.cpp
Show inline comments
 
@@ -95,7 +95,7 @@ void StringParameters::ShiftParameters(u
 
 * @param n Index of the string parameter.
 
 * @param max_value The biggest value which shall be displayed.
 
 *                  For the result only the number of digits of \a max_value matter.
 
 * @param min_count Minimum number of digits indepentent of \a max.
 
 * @param min_count Minimum number of digits independent of \a max.
 
 */
 
void SetDParamMaxValue(uint n, uint64 max_value, uint min_count)
 
{
 
@@ -203,7 +203,7 @@ const char *GetStringPtr(StringID string
 
 * @param buffr  Pointer to a string buffer where the formatted string should be written to.
 
 * @param string
 
 * @param args   Arguments for the string.
 
 * @param last   Pointer just past the end of buffr.
 
 * @param last   Pointer just past the end of \a buffr.
 
 * @param case_index  The "case index". This will only be set when FormatString wants to print the string in a different case.
 
 * @param game_script The string is coming directly from a game script.
 
 * @return       Pointer to the final zero byte of the formatted string.
 
@@ -556,7 +556,7 @@ static int DeterminePluralForm(int64 cou
 
		case 5:
 
			return n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2;
 

	
 
		/* Three forms: special cases for numbers ending in 1 except wehn ending in 11, and 2 to 4 except when ending in 12 to 14.
 
		/* Three forms: special cases for numbers ending in 1 except when ending in 11, and 2 to 4 except when ending in 12 to 14.
 
		 * Used in:
 
		 *   Croatian, Russian, Ukrainian */
 
		case 6:
 
@@ -2129,7 +2129,7 @@ void CheckForMissingGlyphs(bool base_fon
 
	if (bad_font) {
 
		/* All attempts have failed. Display an error. As we do not want the string to be translated by
 
		 * the translators, we 'force' it into the binary and 'load' it via a BindCString. To do this
 
		 * properly we have to set the colour of the string, otherwise we end up with a lot of artefacts.
 
		 * properly we have to set the colour of the string, otherwise we end up with a lot of artifacts.
 
		 * The colour 'character' might change in the future, so for safety we just Utf8 Encode it into
 
		 * the string, which takes exactly three characters, so it replaces the "XXX" with the colour marker. */
 
		static char *err_str = strdup("XXXThe current font is missing some of the characters used in the texts for this language. Read the readme to see how to solve this.");
 
@@ -2153,7 +2153,7 @@ void CheckForMissingGlyphs(bool base_fon
 
	 * be translated by the translators, we 'force' it into the
 
	 * binary and 'load' it via a BindCString. To do this
 
	 * properly we have to set the colour of the string,
 
	 * otherwise we end up with a lot of artefacts. The colour
 
	 * otherwise we end up with a lot of artifacts. The colour
 
	 * 'character' might change in the future, so for safety
 
	 * we just Utf8 Encode it into the string, which takes
 
	 * exactly three characters, so it replaces the "XXX" with
src/subsidy.cpp
Show inline comments
 
@@ -242,7 +242,7 @@ void CreateSubsidy(CargoID cid, SourceTy
 
 * - p1 = (bit 24 - 31) - CargoID of subsidy.
 
 * @param p2 various bitstuffed elements
 
 * - p2 = (bit  0 -  7) - SourceType of destination.
 
 * - p2 = (bit  8 - 23) - SourceID of destionation.
 
 * - p2 = (bit  8 - 23) - SourceID of destination.
 
 * @param text unused.
 
 * @return the cost of this operation or an error
 
 */
src/subsidy_gui.cpp
Show inline comments
 
@@ -154,7 +154,7 @@ struct SubsidyListWindow : Window {
 
		int pos = -this->vscroll->GetPosition();
 
		const int cap = this->vscroll->GetCapacity();
 

	
 
		/* Section for drawing the offered subisidies */
 
		/* Section for drawing the offered subsidies */
 
		if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_OFFERED_TITLE);
 
		pos++;
 

	
 
@@ -178,7 +178,7 @@ struct SubsidyListWindow : Window {
 
			pos++;
 
		}
 

	
 
		/* Section for drawing the already granted subisidies */
 
		/* Section for drawing the already granted subsidies */
 
		pos++;
 
		if (IsInsideMM(pos, 0, cap)) DrawString(x, right, y + pos * FONT_HEIGHT_NORMAL, STR_SUBSIDIES_SUBSIDISED_TITLE);
 
		pos++;
src/table/animcursors.h
Show inline comments
 
@@ -30,7 +30,7 @@
 
#define ANIM_CURSOR_END() ANIM_CURSOR_LINE(AnimCursor::LAST, 0)
 

	
 
/**
 
 * Animated cursor elements for demolishion
 
 * Animated cursor elements for demolition
 
 */
 
static const AnimCursor _demolish_animcursor[] = {
 
	ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_FIRST, 8)
src/table/bridge_land.h
Show inline comments
 
@@ -13,7 +13,7 @@
 
 * <ul><li>_bridge_sprite_table_n_m. Defines all the sprites of a bridge besides the pylons.
 
 * n defines the number of the bridge type, m the number of the section. the highest m for
 
 * each bridge set defines the heads.<br>
 
 * Sprites for middle secionts are arranged in groups of four, the elements are:
 
 * Sprites for middle sections are arranged in groups of four, the elements are:
 
 * <ol><li>Element containing the track. This element is logically behind the vehicle.</li>
 
 * <li>Element containing the structure that is logically between the vehicle and the camera</li>
 
 * <li>Element containing the pylons.</li></ol>
 
@@ -729,7 +729,7 @@ static const PalSpriteID * const * const
 

	
 
/**
 
 * Describes the data that defines each bridge in the game
 
 * @param y   year of availablity
 
 * @param y   year of availability
 
 * @param mnl minimum length (not counting bridge heads)
 
 * @param mxl maximum length (not counting bridge heads)
 
 * @param p   price multiplier
 
@@ -745,7 +745,7 @@ static const PalSpriteID * const * const
 

	
 
const BridgeSpec _orig_bridge[] = {
 
/*
 
	       year of availablity
 
	       year of availability
 
	       |  minimum length
 
	       |  |   maximum length
 
	       |  |   |        price multiplier
src/table/build_industry.h
Show inline comments
 
@@ -1171,7 +1171,7 @@ enum IndustryTypes {
 
 * @param a3   accepted cargo 3
 
 * @param im3  input multiplier for cargo 3
 
 * @param pr   industry life (actually, the same as extractive, organic, processing in ttdpatch's specs)
 
 * @param clim climate availaility
 
 * @param clim climate availability
 
 * @param bev  industry behaviour
 
 * @param in   name
 
 * @param intx text while building
src/table/elrail_data.h
Show inline comments
 
@@ -117,7 +117,7 @@ static const byte PreferredPPPofTrackAtP
 
#define NUM_IGNORE_GROUPS 3
 
#define IGNORE_NONE 0xFF
 
/**
 
 * In case we have a staight line, we place pylon only every two tiles,
 
 * In case we have a straight line, we place pylon only every two tiles,
 
 * so there are certain tiles which we ignore. A straight line is found if
 
 * we have exactly two PPPs.
 
 */
 
@@ -195,7 +195,7 @@ static const byte IgnoredPCP[NUM_IGNORE_
 

	
 
#undef NO_IGNORE
 

	
 
/** Which pylons can definately NOT be built */
 
/** Which pylons can definitely NOT be built */
 
static const byte DisallowedPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
 
	{1 << DIR_SW | 1 << DIR_NE, 0,           1 << DIR_SW | 1 << DIR_NE, 0          }, // X
 
	{0,           1 << DIR_NW | 1 << DIR_SE, 0,           1 << DIR_NW | 1 << DIR_SE}, // Y
src/table/sprites.h
Show inline comments
 
@@ -9,7 +9,7 @@
 

	
 
/**
 
 * @file sprites.h
 
 * This file contails all sprite-related enums and defines. These consist mainly of
 
 * This file contains all sprite-related enums and defines. These consist mainly of
 
 * the sprite numbers and a bunch of masks and macros to handle sprites and to get
 
 * rid of all the magic numbers in the code.
 
 *
 
@@ -26,7 +26,7 @@
 
 *
 
 * All sprites which are described here are referenced only one to a handful of times
 
 * throughout the code. When introducing new sprite enums, use meaningful names.
 
 * Don't be lazy and typing, and only use abbrevations when their meaning is clear or
 
 * Don't be lazy and typing, and only use abbreviations when their meaning is clear or
 
 * the length of the enum would get out of hand. In that case EXPLAIN THE ABBREVATION
 
 * IN THIS FILE, and perhaps add some comments in the code where it is used.
 
 * Now, don't whine about this being too much typing work if the enums are like
 
@@ -709,14 +709,14 @@ static const SpriteID SPR_BTSGA_MGLV_Y_R
 
 * TILE_* denotes the different tiles a suspension bridge
 
 * can have
 
 * TILE_A and TILE_B are the "beginnings" and "ends" of the
 
 *   suspension system. they have small rectangluar endcaps
 
 *   suspension system. They have small rectangular endcaps
 
 * TILE_C and TILE_D look almost identical to TILE_A and
 
 *   TILE_B, but they do not have the "endcaps". They form the
 
 *   middle part
 
 * TILE_E is a condensed configuration of two pillars. while they
 
 *   are usually 2 pillars apart, they only have 1 pillar separation
 
 *   here
 
 * TILE_F is an extended configuration of pillars. they are
 
 * TILE_F is an extended configuration of pillars. They are
 
 *   plugged in when pillars should be 3 tiles apart
 
 */
 
static const SpriteID SPR_BTSUS_ROAD_Y_REAR_TILE_A  = 2453;
 
@@ -860,7 +860,7 @@ static const SpriteID SPR_BTGIR_MGLV_Y  
 
 * tubular bridges have 3 kinds of tiles:
 
 *  a start tile (with only half a tube on the far side, marked _BEG
 
 *  a middle tile (full tunnel), marked _MID
 
 *  and an end tile (half a tube on the near side, maked _END
 
 *  and an end tile (half a tube on the near side, marked _END
 
 */
 
static const SpriteID SPR_BTTUB_X_FRONT_BEG       = 2559;
 
static const SpriteID SPR_BTTUB_X_FRONT_MID       = 2560;
src/table/strgen_tables.h
Show inline comments
 
@@ -197,7 +197,7 @@ static const char * const _pragmas[][4] 
 
	{ "plural",      "tp",  "0",      "Plural form to use" },
 
	{ "textdir",     "tl",  "ltr",    "Text direction. Either ltr (left-to-right) or rtl (right-to-left)" },
 
	{ "digitsep",    "td",  ",",      "Digit grouping separator for non-currency numbers" },
 
	{ "digitsepcur", "td",  ",",      "Digit grouping seprarator for currency numbers" },
 
	{ "digitsepcur", "td",  ",",      "Digit grouping separator for currency numbers" },
 
	{ "decimalsep",  "td",  ".",      "Decimal separator" },
 
	{ "winlangid",   "x2",  "0x0000", "Language ID for Windows" },
 
	{ "grflangid",   "x1",  "0x00",   "Language ID for NewGRFs" },
src/table/townname.h
Show inline comments
 
@@ -1729,7 +1729,7 @@ static const char * const _name_czech_pa
 
	/* CZG_PNEUT */ { "\xC3\xAD", "\xC3\xA1", "a" }
 
};
 

	
 
/* This way the substantives can choose only some adjectives/endings:
 
/* This way the substantive can choose only some adjectives/endings:
 
 * At least one of these flags must be satisfied: */
 
enum CzechAllow {
 
	CZA_SHORT = 1,
src/terraform_cmd.cpp
Show inline comments
 
@@ -23,14 +23,14 @@
 

	
 
/*
 
 * In one terraforming command all four corners of a initial tile can be raised/lowered (though this is not available to the player).
 
 * The maximal amount of height modifications is archieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
 
 * The maximal amount of height modifications is achieved when raising a complete flat land from sea level to MAX_TILE_HEIGHT or vice versa.
 
 * This affects all corners with a manhatten distance smaller than MAX_TILE_HEIGHT to one of the initial 4 corners.
 
 * Their maximal amount is computed to 4 * \sum_{i=1}^{h_max} i  =  2 * h_max * (h_max + 1).
 
 */
 
static const int TERRAFORMER_MODHEIGHT_SIZE = 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 1);
 

	
 
/*
 
 * The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similiar to
 
 * The maximal amount of affected tiles (i.e. the tiles that incident with one of the corners above, is computed similar to
 
 * 1 + 4 * \sum_{i=1}^{h_max} (i+1)  =  1 + 2 * h_max + (h_max + 3).
 
 */
 
static const int TERRAFORMER_TILE_TABLE_SIZE = 1 + 2 * MAX_TILE_HEIGHT * (MAX_TILE_HEIGHT + 3);
src/textbuf.cpp
Show inline comments
 
@@ -21,10 +21,10 @@
 
#include "core/alloc_func.hpp"
 

	
 
/**
 
 * Try to retrive the current clipboard contents.
 
 * Try to retrieve the current clipboard contents.
 
 *
 
 * @note OS-specific funtion.
 
 * @return True if some text could be retrived.
 
 * @note OS-specific function.
 
 * @return True if some text could be retrieved.
 
 */
 
bool GetClipboardContents(char *buffer, size_t buff_len);
 

	
 
@@ -221,7 +221,7 @@ bool Textbuf::InsertClipboard()
 
}
 

	
 
/**
 
 * Checks if it is possible to move carret to the left
 
 * Checks if it is possible to move caret to the left
 
 * @return true if the caret can be moved to the left, otherwise false.
 
 */
 
bool Textbuf::CanMoveCaretLeft()
 
@@ -248,7 +248,7 @@ WChar Textbuf::MoveCaretLeft()
 
}
 

	
 
/**
 
 * Checks if it is possible to move carret to the right
 
 * Checks if it is possible to move caret to the right
 
 * @return true if the caret can be moved to the right, otherwise false.
 
 */
 
bool Textbuf::CanMoveCaretRight()
 
@@ -275,7 +275,7 @@ WChar Textbuf::MoveCaretRight()
 

	
 
/**
 
 * Handle text navigation with arrow keys left/right.
 
 * This defines where the caret will blink and the next characer interaction will occur
 
 * This defines where the caret will blink and the next character interaction will occur
 
 * @param navmode Direction in which navigation occurs (WKC_CTRL |) WKC_LEFT, (WKC_CTRL |) WKC_RIGHT, WKC_END, WKC_HOME
 
 * @return Return true on successful change of Textbuf, or false otherwise
 
 */
 
@@ -304,7 +304,7 @@ bool Textbuf::MovePos(int navmode)
 
				if (!this->CanMoveCaretLeft()) return true;
 
				c = this->MoveCaretLeft();
 
			}
 
			/* Place caret at the begining of the left word. */
 
			/* Place caret at the beginning of the left word. */
 
			this->MoveCaretRight();
 
			return true;
 
		}
src/thread/thread.h
Show inline comments
 
@@ -40,7 +40,7 @@ public:
 

	
 
	/**
 
	 * Create a thread; proc will be called as first function inside the thread,
 
	 *  with optinal params.
 
	 *  with optional params.
 
	 * @param proc The procedure to call inside the thread.
 
	 * @param param The params to give with 'proc'.
 
	 * @param thread Place to store a pointer to the thread in. May be NULL.
src/tile_map.h
Show inline comments
 
@@ -105,8 +105,8 @@ static inline void SetTileType(TileIndex
 
 * This function checks if a tile got the given tiletype.
 
 *
 
 * @param tile The tile to check
 
 * @param type The type to check agains
 
 * @return true If the type matches agains the type of the tile
 
 * @param type The type to check against
 
 * @return true If the type matches against the type of the tile
 
 */
 
static inline bool IsTileType(TileIndex tile, TileType type)
 
{
 
@@ -169,7 +169,7 @@ static inline void SetTileOwner(TileInde
 
 * Checks if a tile belongs to the given owner
 
 *
 
 * @param tile The tile to check
 
 * @param owner The owner to check agains
 
 * @param owner The owner to check against
 
 * @return True if a tile belongs the the given owner
 
 */
 
static inline bool IsTileOwner(TileIndex tile, Owner owner)
src/tile_type.h
Show inline comments
 
@@ -52,7 +52,7 @@ enum TileType {
 
 *
 
 * In randomly generated maps:
 
 *  TROPICZONE_DESERT: Generated everywhere, if there is neither water nor mountains (TileHeight >= 4) in a certain distance from the tile.
 
 *  TROPICZONE_RAINFOREST: Genereated everywhere, if there is no desert in a certain distance from the tile.
 
 *  TROPICZONE_RAINFOREST: Generated everywhere, if there is no desert in a certain distance from the tile.
 
 *  TROPICZONE_NORMAL: Everywhere else, i.e. between desert and rainforest and on sea (if you clear the water).
 
 *
 
 * In scenarios:
src/tilearea.cpp
Show inline comments
 
@@ -159,7 +159,7 @@ DiagonalTileIterator::DiagonalTileIterat
 
}
 

	
 
/**
 
 * Move ourselves to the next tile in the rectange on the map.
 
 * Move ourselves to the next tile in the rectangle on the map.
 
 */
 
TileIterator &DiagonalTileIterator::operator++()
 
{
src/tilearea_type.h
Show inline comments
 
@@ -91,7 +91,7 @@ public:
 
	}
 

	
 
	/**
 
	 * Move ourselves to the next tile in the rectange on the map.
 
	 * Move ourselves to the next tile in the rectangle on the map.
 
	 */
 
	virtual TileIterator& operator ++() = 0;
 

	
 
@@ -118,7 +118,7 @@ public:
 
	}
 

	
 
	/**
 
	 * Move ourselves to the next tile in the rectange on the map.
 
	 * Move ourselves to the next tile in the rectangle on the map.
 
	 */
 
	inline TileIterator& operator ++()
 
	{
 
@@ -148,7 +148,7 @@ private:
 
	uint base_y; ///< The base tile y coordinate from where the iterating happens.
 
	int a_cur;   ///< The current (rotated) x coordinate of the iteration.
 
	int b_cur;   ///< The current (rotated) y coordinate of the iteration.
 
	int a_max;   ///< The (rotated) x coordinats of the end of the iteration.
 
	int a_max;   ///< The (rotated) x coordinate of the end of the iteration.
 
	int b_max;   ///< The (rotated) y coordinate of the end of the iteration.
 

	
 
public:
src/town.h
Show inline comments
 
@@ -209,7 +209,7 @@ enum TownActions {
 
	TACT_BUILD_STATUE     = 0x10, ///< Build a statue.
 
	TACT_FUND_BUILDINGS   = 0x20, ///< Fund new buildings.
 
	TACT_BUY_RIGHTS       = 0x40, ///< Buy exclusive transport rights.
 
	TACT_BRIBE            = 0x80, ///< Try to bribe the counsil.
 
	TACT_BRIBE            = 0x80, ///< Try to bribe the council.
 

	
 
	TACT_COUNT            = 8,    ///< Number of available town actions.
 

	
src/town_cmd.cpp
Show inline comments
 
@@ -283,7 +283,7 @@ static Foundation GetFoundation_Town(Til
 
/**
 
 * Animate a tile for a town
 
 * Only certain houses can be animated
 
 * The newhouses animation superseeds regular ones
 
 * The newhouses animation supersedes regular ones
 
 * @param tile TileIndex of the house to animate
 
 */
 
static void AnimateTile_Town(TileIndex tile)
 
@@ -374,8 +374,8 @@ void UpdateAllTownVirtCoords()
 

	
 
/**
 
 * Change the towns population
 
 * @param t Town which polulation has changed
 
 * @param mod polulation change (can be positive or negative)
 
 * @param t Town which population has changed
 
 * @param mod population change (can be positive or negative)
 
 */
 
static void ChangePopulation(Town *t, int mod)
 
{
 
@@ -804,9 +804,9 @@ static RoadBits GetTownRoadBits(TileInde
 
 *   Assuming a road from (tile - TileOffsByDiagDir(dir)) to tile,
 
 *   is there a parallel road left or right of it within distance dist_multi?
 
 *
 
 * @param tile curent tile
 
 * @param tile current tile
 
 * @param dir target direction
 
 * @param dist_multi distance multiplyer
 
 * @param dist_multi distance multiplayer
 
 * @return true if there is a parallel road
 
 */
 
static bool IsNeighborRoadTile(TileIndex tile, const DiagDirection dir, uint dist_multi)
 
@@ -1173,7 +1173,7 @@ static void GrowTownInTile(TileIndex *ti
 

	
 
	} else if (target_dir < DIAGDIR_END && !(cur_rb & DiagDirToRoadBits(ReverseDiagDir(target_dir)))) {
 
		/* Continue building on a partial road.
 
		 * Should be allways OK, so we only generate
 
		 * Should be always OK, so we only generate
 
		 * the fitting RoadBits */
 
		_grow_town_result = GROWTH_SEARCH_STOPPED;
 

	
 
@@ -2221,7 +2221,7 @@ static bool BuildTownHouse(Town *t, Tile
 
	while (probability_max > 0) {
 
		/* Building a multitile building can change the location of tile.
 
		 * The building would still be built partially on that tile, but
 
		 * its nothern tile would be elsewere. However, if the callback
 
		 * its northern tile would be elsewhere. However, if the callback
 
		 * fails we would be basing further work from the changed tile.
 
		 * So a next 1x1 tile building could be built on the wrong tile. */
 
		tile = baseTile;
 
@@ -2859,7 +2859,7 @@ static CommandCost TownActionBribe(Town 
 
				}
 
			}
 

	
 
			/* only show errormessage to the executing player. All errors are handled command.c
 
			/* only show error message to the executing player. All errors are handled command.c
 
			 * but this is special, because it can only 'fail' on a DC_EXEC */
 
			if (IsLocalCompany()) ShowErrorMessage(STR_ERROR_BRIBE_FAILED, INVALID_STRING_ID, WL_INFO);
 

	
src/town_gui.cpp
Show inline comments
 
@@ -668,7 +668,7 @@ private:
 

	
 
		/* If 'b' is the same town as in the last round, use the cached value
 
		 * We do this to speed stuff up ('b' is called with the same value a lot of
 
		 * times after eachother) */
 
		 * times after each other) */
 
		if (tb != last_town) {
 
			last_town = tb;
 
			SetDParam(0, tb->index);
src/town_map.h
Show inline comments
 
@@ -175,7 +175,7 @@ static inline void SetHouseCompleted(Til
 
/**
 
 * Gets the building stage of a house
 
 * Since the stage is used for determining what sprite to use,
 
 * if the house is complete (and that stage no longuer is available),
 
 * if the house is complete (and that stage no longer is available),
 
 * fool the system by returning the TOWN_HOUSE_COMPLETE (3),
 
 * thus showing a beautiful complete house.
 
 * @param t the tile of the house to get the building stage of
src/townname.cpp
Show inline comments
 
@@ -157,7 +157,7 @@ static inline uint32 SeedModChance(byte 
 
	 * than SeedChance(), which is absolutely horrible in that. If
 
	 * you do not believe me, try with i.e. the Czech town names,
 
	 * compare the words (nicely visible on prefixes) generated by
 
	 * SeedChance() and SeedModChance(). Do not get dicouraged by the
 
	 * SeedChance() and SeedModChance(). Do not get discouraged by the
 
	 * never-use-modulo myths, which hold true only for the linear
 
	 * congruential generators (and Random() isn't such a generator).
 
	 * --pasky
src/track_func.h
Show inline comments
 
@@ -113,7 +113,7 @@ static inline Track RemoveFirstTrack(Tra
 
/**
 
 * Removes first Trackdir from TrackdirBits and returns it
 
 *
 
 * This function searchs for the first bit in the TrackdirBits parameter,
 
 * This function searches for the first bit in the TrackdirBits parameter,
 
 * remove this bit from the parameter and returns the fnound bit as
 
 * Trackdir value. It returns INVALID_TRACKDIR if the trackdirs is
 
 * TRACKDIR_BIT_NONE or INVALID_TRACKDIR_BIT. This is basically used in a
 
@@ -200,7 +200,7 @@ static inline bool IsValidTrack(Track tr
 
 * Checks if a Trackdir is valid.
 
 *
 
 * @param trackdir The value to check
 
 * @return true if the given valie is a valid Trackdir
 
 * @return true if the given value is a valid Trackdir
 
 * @note Use this in an assert()
 
 */
 
static inline bool IsValidTrackdir(Trackdir trackdir)
 
@@ -422,8 +422,8 @@ static inline DiagDirection TrackdirToEx
 
 * direction which the DiagDirection is pointing. But this will be INVALID_TRACKDIR
 
 * if the DiagDirection is pointing 'away' the track.
 
 *
 
 * @param track The track to applie an direction on
 
 * @param diagdir The DiagDirection to applie on
 
 * @param track The track to apply an direction on
 
 * @param diagdir The DiagDirection to apply on
 
 * @return The resulting track direction or INVALID_TRACKDIR if not possible.
 
 */
 
static inline Trackdir TrackExitdirToTrackdir(Track track, DiagDirection diagdir)
 
@@ -442,7 +442,7 @@ static inline Trackdir TrackExitdirToTra
 
 * you follow the DiagDirection and then turn by 45 deg left or right on the
 
 * next tile. The new direction on the new track will be the returning Trackdir
 
 * value. If the parameters makes no sense like the track TRACK_UPPER and the
 
 * diraction DIAGDIR_NE (target track cannot be reached) this function returns
 
 * direction DIAGDIR_NE (target track cannot be reached) this function returns
 
 * INVALID_TRACKDIR.
 
 *
 
 * @param track The target track
 
@@ -524,7 +524,7 @@ static inline TrackdirBits DiagdirReache
 
 * This will obviously include 90 degree turns, since no
 
 * information is available about the exact angle of entering
 
 *
 
 * @param diagdir The joining irection
 
 * @param diagdir The joining direction
 
 * @return The tracks which can be used
 
 * @see DiagdirReachesTrackdirs
 
 */
 
@@ -545,7 +545,7 @@ static inline TrackdirBits TrackdirReach
 
	return _exitdir_reaches_trackdirs[TrackdirToExitdir(trackdir)];
 
}
 
/* Note that there is no direct table for this function (there used to be),
 
 * but it uses two simpeler tables to achieve the result */
 
 * but it uses two simpler tables to achieve the result */
 

	
 
/**
 
 * Maps a trackdir to all trackdirs that make 90 deg turns with it.
 
@@ -609,7 +609,7 @@ static inline bool TracksOverlap(TrackBi
 
/**
 
 * Check if a given track is contained within or overlaps some other tracks.
 
 *
 
 * @param tracks Tracks to be testet against
 
 * @param tracks Tracks to be tested against
 
 * @param track The track to test
 
 * @return true if the track is already in the tracks or overlaps the tracks.
 
 */
src/train.h
Show inline comments
 
@@ -37,7 +37,7 @@ enum VehicleRailFlags {
 
enum TrainForceProceeding {
 
	TFP_NONE   = 0,    ///< Normal operation.
 
	TFP_STUCK  = 1,    ///< Proceed till next signal, but ignore being stuck till then. This includes force leaving depots.
 
	TFP_SIGNAL = 2,    ///< Ignore next signal, after the signal ignore being stucked.
 
	TFP_SIGNAL = 2,    ///< Ignore next signal, after the signal ignore being stuck.
 
};
 
typedef SimpleTinyEnumT<TrainForceProceeding, byte> TrainForceProceedingByte;
 

	
src/train_cmd.cpp
Show inline comments
 
@@ -3893,7 +3893,7 @@ bool Train::Tick()
 
}
 

	
 
/**
 
 * Check whether a train needs serivce, and if so, find a depot or service it.
 
 * Check whether a train needs service, and if so, find a depot or service it.
 
 * @return v %Train to check.
 
 */
 
static void CheckIfTrainNeedsService(Train *v)
src/train_gui.cpp
Show inline comments
 
@@ -163,7 +163,7 @@ struct CargoSummaryItem {
 
	uint amount;      ///< Amount that is carried
 
	StationID source; ///< One of the source stations
 

	
 
	/** Used by CargoSummary::Find() and similiar functions */
 
	/** Used by CargoSummary::Find() and similar functions */
 
	inline bool operator != (const CargoSummaryItem &other) const
 
	{
 
		return this->cargo != other.cargo || this->subtype != other.subtype;
 
@@ -251,7 +251,7 @@ static void TrainDetailsCapacityTab(cons
 
}
 

	
 
/**
 
 * Collects the cargo transportet
 
 * Collects the cargo transported
 
 * @param v Vehicle to process
 
 * @param summary Space for the result
 
 */
 
@@ -316,7 +316,7 @@ int GetTrainDetailsWndVScroll(VehicleID 
 
			max_cargo[v->cargo_type] += v->cargo_cap;
 
		}
 

	
 
		/* Set scroll-amount seperately from counting, as to not compute num double
 
		/* Set scroll-amount separately from counting, as to not compute num double
 
		 * for more carriages of the same type
 
		 */
 
		for (CargoID i = 0; i < NUM_CARGO; i++) {
src/transparency_gui.cpp
Show inline comments
 
@@ -141,7 +141,7 @@ static const NWidgetPart _nested_transpa
 
		NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_TT_LOADING), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_TRAINLIST, STR_TRANSPARENT_LOADING_TOOLTIP),
 
		NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(1, 1), EndContainer(),
 
	EndContainer(),
 
	/* Panel with 'inivisibility' buttons. */
 
	/* Panel with 'invisibility' buttons. */
 
	NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_TT_BUTTONS), SetMinimalSize(219, 13), SetDataTip(0x0, STR_TRANSPARENT_INVISIBLE_TOOLTIP),
 
	EndContainer(),
 
};
src/tree_map.h
Show inline comments
 
@@ -27,7 +27,7 @@ enum TreeType {
 
	TREE_TEMPERATE    = 0x00, ///< temperate tree
 
	TREE_SUB_ARCTIC   = 0x0C, ///< tree on a sub_arctic landscape
 
	TREE_RAINFOREST   = 0x14, ///< tree on the 'green part' on a sub-tropical map
 
	TREE_CACTUS       = 0x1B, ///< a catus for the 'desert part' on a sub-tropical map
 
	TREE_CACTUS       = 0x1B, ///< a cactus for the 'desert part' on a sub-tropical map
 
	TREE_SUB_TROPICAL = 0x1C, ///< tree on a sub-tropical map, non-rainforest, non-desert
 
	TREE_TOYLAND      = 0x20, ///< tree on a toyland map
 
	TREE_INVALID      = 0xFF, ///< An invalid tree
 
@@ -104,7 +104,7 @@ static inline TreeGround GetTreeGround(T
 
 * tile. So this function returns the density of a tile for sub arctic
 
 * and sub tropical games. This means for sub arctic the type of snowline
 
 * (0 to 3 for all 4 types of snowtiles) and for sub tropical the value
 
 * 3 for a desert (and 0 for non-desert). The functionname is not read as
 
 * 3 for a desert (and 0 for non-desert). The function name is not read as
 
 * "get the tree density of a tile" but "get the density of a tile which got trees".
 
 *
 
 * @param t The tile to get the 'density'
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -10,7 +10,7 @@
 
/**
 
 * @file tunnelbridge_cmd.cpp
 
 * This file deals with tunnels and bridges (non-gui stuff)
 
 * @todo seperate this file into two
 
 * @todo separate this file into two
 
 */
 

	
 
#include "stdafx.h"
 
@@ -61,7 +61,7 @@ void ResetBridges()
 
		}
 
	}
 

	
 
	/* Then, wipe out current bidges */
 
	/* Then, wipe out current bridges */
 
	memset(&_bridge, 0, sizeof(_bridge));
 
	/* And finally, reinstall default data */
 
	memcpy(&_bridge, &_orig_bridge, sizeof(_orig_bridge));
 
@@ -91,8 +91,8 @@ int CalcBridgeLenCostFactor(int length)
 
/**
 
 * Get the foundation for a bridge.
 
 * @param tileh The slope to build the bridge on.
 
 * @param axis The axis of the bridge entrace.
 
 * @return The foundatiton required.
 
 * @param axis The axis of the bridge entrance.
 
 * @return The foundation required.
 
 */
 
Foundation GetBridgeFoundation(Slope tileh, Axis axis)
 
{
 
@@ -432,7 +432,7 @@ CommandCost CmdBuildBridge(TileIndex end
 
			if (flags & DC_EXEC) {
 
				/* We do this here because when replacing a bridge with another
 
				 * type calling SetBridgeMiddle isn't needed. After all, the
 
				 * tile alread has the has_bridge_above bits set. */
 
				 * tile already has the has_bridge_above bits set. */
 
				SetBridgeMiddle(tile, direction);
 
			}
 
		}
 
@@ -592,7 +592,7 @@ CommandCost CmdBuildTunnel(TileIndex sta
 

	
 
	TileIndex end_tile = start_tile;
 

	
 
	/* Tile shift coeficient. Will decrease for very long tunnels to avoid exponential growth of price*/
 
	/* Tile shift coefficient. Will decrease for very long tunnels to avoid exponential growth of price*/
 
	int tiles_coef = 3;
 
	/* Number of tiles from start of tunnel */
 
	int tiles = 0;
 
@@ -1077,7 +1077,7 @@ static void DrawBridgeTramBits(int x, in
 

	
 
/**
 
 * Draws a tunnel of bridge tile.
 
 * For tunnels, this is rather simple, as you only needa draw the entrance.
 
 * For tunnels, this is rather simple, as you only need to draw the entrance.
 
 * Bridges are a bit more complex. base_offset is where the sprite selection comes into play
 
 * and it works a bit like a bitmask.<p> For bridge heads:
 
 * @param ti TileInfo of the structure to draw
 
@@ -1556,7 +1556,7 @@ static void TileLoop_TunnelBridge(TileIn
 
	switch (_settings_game.game_creation.landscape) {
 
		case LT_ARCTIC: {
 
			/* As long as we do not have a snow density, we want to use the density
 
			 * from the entry endge. For tunnels this is the lowest point for bridges the highest point.
 
			 * from the entry edge. For tunnels this is the lowest point for bridges the highest point.
 
			 * (Independent of foundations) */
 
			int z = IsBridge(tile) ? GetTileMaxZ(tile) : GetTileZ(tile);
 
			if (snow_or_desert != (z > GetSnowLine())) {
src/tunnelbridge_map.h
Show inline comments
 
@@ -23,7 +23,7 @@
 
 * Bridge: Get the direction pointing onto the bridge
 
 * @param t The tile to analyze
 
 * @pre IsTileType(t, MP_TUNNELBRIDGE)
 
 * @return the above mentionned direction
 
 * @return the above mentioned direction
 
 */
 
static inline DiagDirection GetTunnelBridgeDirection(TileIndex t)
 
{
src/vehicle.cpp
Show inline comments
 
@@ -167,9 +167,9 @@ bool Vehicle::NeedsServicing() const
 
}
 

	
 
/**
 
 * Checks if the current order should be interupted for a service-in-depot-order.
 
 * Checks if the current order should be interrupted for a service-in-depot order.
 
 * @see NeedsServicing()
 
 * @return true if the current order should be interupted.
 
 * @return true if the current order should be interrupted.
 
 */
 
bool Vehicle::NeedsAutomaticServicing() const
 
{
 
@@ -894,7 +894,7 @@ void CallVehicleTicks()
 
				/* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */
 
				if (GB(v->motion_counter, 0, 8) < v->cur_speed) PlayVehicleSound(v, VSE_RUNNING);
 

	
 
				/* Play an alterate running sound every 16 ticks */
 
				/* Play an alternating running sound every 16 ticks */
 
				if (GB(v->tick_counter, 0, 4) == 0) PlayVehicleSound(v, v->cur_speed > 0 ? VSE_RUNNING_16 : VSE_STOPPED_16);
 
		}
 
	}
 
@@ -1775,7 +1775,7 @@ static PaletteID GetEngineColourMap(Engi
 
		uint16 callback = GetVehicleCallback(CBID_VEHICLE_COLOUR_MAPPING, 0, 0, engine_type, v);
 
		/* Failure means "use the default two-colour" */
 
		if (callback != CALLBACK_FAILED) {
 
			assert_compile(PAL_NONE == 0); // Returning 0x4000 (resp. 0xC000) conincidences with default value (PAL_NONE)
 
			assert_compile(PAL_NONE == 0); // Returning 0x4000 (resp. 0xC000) coincidences with default value (PAL_NONE)
 
			map = GB(callback, 0, 14);
 
			/* If bit 14 is set, then the company colours are applied to the
 
			 * map else it's returned as-is. */
 
@@ -2309,7 +2309,7 @@ void Vehicle::ShowVisualEffect() const
 
				/* Electric train's spark - more often occurs when train is departing (more load)
 
				 * Details: Electric locomotives are usually at least twice as powerful as their diesel counterparts, so spark
 
				 * emissions are kept simple. Only when starting, creating huge force are sparks more likely to happen, but when
 
				 * reaching its max. speed, quarter by quarter of it, chance decreases untill the usuall 2,22% at train's top speed.
 
				 * reaching its max. speed, quarter by quarter of it, chance decreases until the usual 2,22% at train's top speed.
 
				 * REGULATION:
 
				 * - in Chance16 the last value is 360 / 2^smoke_amount (max. sparks when 90 = smoke_amount of 2). */
 
				if (GB(v->tick_counter, 0, 2) == 0 &&
src/vehicle_gui.cpp
Show inline comments
 
@@ -1034,7 +1034,7 @@ static int CDECL VehicleCargoSorter(cons
 
	const Vehicle *v;
 
	CargoArray diff;
 

	
 
	/* Append the cargo of the connected weagons */
 
	/* Append the cargo of the connected waggons */
 
	for (v = *a; v != NULL; v = v->Next()) diff[v->cargo_type] += v->cargo_cap;
 
	for (v = *b; v != NULL; v = v->Next()) diff[v->cargo_type] -= v->cargo_cap;
 

	
 
@@ -1068,7 +1068,7 @@ static int CDECL VehicleModelSorter(cons
 
	return (r != 0) ? r : VehicleNumberSorter(a, b);
 
}
 

	
 
/** Sort vehciles by their value */
 
/** Sort vehicles by their value */
 
static int CDECL VehicleValueSorter(const Vehicle * const *a, const Vehicle * const *b)
 
{
 
	const Vehicle *u;
 
@@ -2433,7 +2433,7 @@ public:
 
					SetDParam(2, v->GetDisplaySpeed());
 
					if (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) {
 
						/* This case *only* happens when multiple nearest depot orders
 
						 * follow eachother (including an order list only one order: a
 
						 * follow each other (including an order list only one order: a
 
						 * nearest depot order) and there are no reachable depots.
 
						 * It is primarily to guard for the case that there is no
 
						 * depot with index 0, which would be used as fallback for
src/video/allegro_v.cpp
Show inline comments
 
@@ -29,7 +29,7 @@
 

	
 
#ifdef _DEBUG
 
/* Allegro replaces SEGV/ABRT signals meaning that the debugger will never
 
 * be triggered, so rereplace the signals and make the debugger userful. */
 
 * be triggered, so rereplace the signals and make the debugger useful. */
 
#include <signal.h>
 
#endif
 

	
 
@@ -438,7 +438,7 @@ const char *VideoDriver_Allegro::Start(c
 

	
 
#if defined _DEBUG
 
/* Allegro replaces SEGV/ABRT signals meaning that the debugger will never
 
 * be triggered, so rereplace the signals and make the debugger userful. */
 
 * be triggered, so rereplace the signals and make the debugger useful. */
 
	signal(SIGABRT, NULL);
 
	signal(SIGSEGV, NULL);
 
#endif
src/video/cocoa/cocoa_v.h
Show inline comments
 
@@ -134,7 +134,7 @@ public:
 
	virtual bool IsFullscreen() = 0;
 

	
 
	/** Toggle between fullscreen and windowed mode
 
	 * @return whether switch was successfull
 
	 * @return whether switch was successful
 
	 */
 
	virtual bool ToggleFullscreen() { return false; };
 

	
 
@@ -180,7 +180,7 @@ public:
 
	virtual void SetPortAlphaOpaque() { return; };
 

	
 
	/** Whether the window was successfully resized
 
	 * @return whether the window was succesfully resized
 
	 * @return whether the window was successfully resized
 
	 */
 
	virtual bool WindowResized() { return false; };
 
};
src/video/cocoa/fullscreen.mm
Show inline comments
 
@@ -357,7 +357,7 @@ class FullscreenSubdriver: public CocoaS
 

	
 
		this->UpdatePalette(0, 256);
 

	
 
		/* Move the mouse cursor to approx the same location */
 
		/* Move the mouse cursor to approx. the same location */
 
		CGPoint display_mouseLocation;
 
		display_mouseLocation.x = mouseLocation.x * this->device_width;
 
		display_mouseLocation.y = this->device_height - (mouseLocation.y * this->device_height);
src/video/cocoa/wnd_quickdraw.mm
Show inline comments
 
@@ -158,7 +158,7 @@ bool WindowQuickdrawSubdriver::SetVideoM
 
	this->GetDeviceInfo();
 

	
 
	if (bpp > this->device_depth) {
 
		DEBUG(driver, 0, "Cannot use a blitter with a higer screen depth than the display when running in windowed mode.");
 
		DEBUG(driver, 0, "Cannot use a blitter with a higher screen depth than the display when running in windowed mode.");
 
		this->setup = false;
 
		return false;
 
	}
src/video/dedicated_v.cpp
Show inline comments
 
@@ -237,7 +237,7 @@ static void DedicatedHandleKeyInput()
 
#if defined(UNIX) || defined(__OS2__) || defined(PSP)
 
	if (fgets(input_line, lengthof(input_line), stdin) == NULL) return;
 
#else
 
	/* Handle console input, and singal console thread, it can accept input again */
 
	/* Handle console input, and signal console thread, it can accept input again */
 
	assert_compile(lengthof(_win_console_thread_buffer) <= lengthof(input_line));
 
	strecpy(input_line, _win_console_thread_buffer, lastof(input_line));
 
	SetEvent(_hWaitForInputHandling);
src/video/sdl_v.cpp
Show inline comments
 
@@ -620,7 +620,7 @@ void VideoDriver_SDL::MainLoop()
 
#endif
 
			if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
 

	
 
			/* The gameloop is the part that can run asynchroniously. The rest
 
			/* The gameloop is the part that can run asynchronously. The rest
 
			 * except sleeping can't. */
 
			if (_draw_threaded) _draw_mutex->EndCritical();
 

	
src/video/win32_v.cpp
Show inline comments
 
@@ -352,7 +352,7 @@ bool VideoDriver_Win32::MakeWindow(bool 
 
	BlitterFactoryBase::GetCurrentBlitter()->PostResize();
 

	
 
	GameSizeChanged(); // invalidate all windows, force redraw
 
	return true; // the request succedded
 
	return true; // the request succeeded
 
}
 

	
 
/** Do palette animation and blit to the window. */
src/viewport.cpp
Show inline comments
 
@@ -1431,7 +1431,7 @@ static void ViewportDrawStrings(DrawPixe
 
			/* Do not draw signs nor station names if they are set invisible */
 
			if (IsInvisibilitySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) continue;
 

	
 
			/* if we didn't draw a rectangle, or if transparant building is on,
 
			/* if we didn't draw a rectangle, or if transperant building is on,
 
			 * draw the text in the colour the rectangle would have */
 
			if (IsTransparencySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) {
 
				/* Real colours need the TC_IS_PALETTE_COLOUR flag
 
@@ -1439,7 +1439,7 @@ static void ViewportDrawStrings(DrawPixe
 
				colour = (TextColour)_colour_gradient[ss->colour][6] | TC_IS_PALETTE_COLOUR;
 
			}
 

	
 
			/* Draw the rectangle if 'tranparent station signs' is off,
 
			/* Draw the rectangle if 'transparent station signs' is off,
 
			 * or if we are drawing a general text sign (STR_WHITE_SIGN) */
 
			if (!IsTransparencySet(TO_SIGNS) || ss->string == STR_WHITE_SIGN) {
 
				DrawFrameRect(
 
@@ -1726,7 +1726,7 @@ static void SetSelectionTilesDirty()
 
	int x_size = _thd.size.x;
 
	int y_size = _thd.size.y;
 

	
 
	if (!_thd.diagonal) { // Selecting in a straigth rectangle (or a single square)
 
	if (!_thd.diagonal) { // Selecting in a straight rectangle (or a single square)
 
		int x_start = _thd.pos.x;
 
		int y_start = _thd.pos.y;
 

	
src/viewport_type.h
Show inline comments
 
@@ -32,7 +32,7 @@ struct ViewPort {
 
	ZoomLevel zoom; ///< The zoom level of the viewport.
 
};
 

	
 
/** Margings for the viewport sign */
 
/** Margins for the viewport sign */
 
enum ViewportSignMargin {
 
	VPSM_LEFT   = 1, ///< Left margin
 
	VPSM_RIGHT  = 1, ///< Right margin
 
@@ -82,7 +82,7 @@ enum ViewportPlaceMethod {
 
	VPM_X_LIMITED       =    7, ///< Drag only in X axis with limited size
 
	VPM_Y_LIMITED       =    8, ///< Drag only in Y axis with limited size
 
	VPM_RAILDIRS        = 0x40, ///< all rail directions
 
	VPM_SIGNALDIRS      = 0x80, ///< similiar to VMP_RAILDIRS, but with different cursor
 
	VPM_SIGNALDIRS      = 0x80, ///< similar to VMP_RAILDIRS, but with different cursor
 
};
 
DECLARE_ENUM_AS_BIT_SET(ViewportPlaceMethod)
 

	
src/widget.cpp
Show inline comments
 
@@ -633,7 +633,7 @@ void Window::DrawSortButtonState(int wid
 
 * <ul>
 
 * <li> #NWidgetHorizontal for organizing child widgets in a (horizontal) row. The row switches order depending on the language setting (thus supporting
 
 *      right-to-left languages),
 
 * <li> #NWidgetHorizontalLTR for organizing child widgets in a (horizontal) row, always in the same order. All childs below this container will also
 
 * <li> #NWidgetHorizontalLTR for organizing child widgets in a (horizontal) row, always in the same order. All children below this container will also
 
 *      never swap order.
 
 * <li> #NWidgetVertical for organizing child widgets underneath each other.
 
 * <li> #NWidgetMatrix for organizing child widgets in a matrix form.
 
@@ -820,7 +820,7 @@ void NWidgetResizeBase::AssignSizePositi
 
 * @param fill_x      Default horizontal filling.
 
 * @param fill_y      Default vertical filling.
 
 * @param widget_data Data component of the widget. @see Widget::data
 
 * @param tool_tip    Tool tip of the widget. @see Widget::tootips
 
 * @param tool_tip    Tool tip of the widget. @see Widget::tooltips
 
 */
 
NWidgetCore::NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint32 widget_data, StringID tool_tip) : NWidgetResizeBase(tp, fill_x, fill_y)
 
{
 
@@ -1087,7 +1087,7 @@ NWidgetHorizontal::NWidgetHorizontal(NWi
 

	
 
void NWidgetHorizontal::SetupSmallestSize(Window *w, bool init_array)
 
{
 
	this->smallest_x = 0; // Sum of minimal size of all childs.
 
	this->smallest_x = 0; // Sum of minimal size of all children.
 
	this->smallest_y = 0; // Biggest child.
 
	this->fill_x = 0;     // smallest non-zero child widget fill step.
 
	this->fill_y = 1;     // smallest common child fill step.
 
@@ -1103,19 +1103,19 @@ void NWidgetHorizontal::SetupSmallestSiz
 
		max_vert_fill = max(max_vert_fill, child_wid->GetVerticalStepSize(ST_SMALLEST));
 
		this->smallest_y = max(this->smallest_y, child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom);
 
	}
 
	/* 1b. Make the container higher if needed to accomadate all childs nicely. */
 
	/* 1b. Make the container higher if needed to accommodate all children nicely. */
 
	uint max_smallest = this->smallest_y + 3 * max_vert_fill; // Upper limit to computing smallest height.
 
	uint cur_height = this->smallest_y;
 
	for (;;) {
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			uint step_size = child_wid->GetVerticalStepSize(ST_SMALLEST);
 
			uint child_height = child_wid->smallest_y + child_wid->padding_top + child_wid->padding_bottom;
 
			if (step_size > 1 && child_height < cur_height) { // Small step sizes or already fitting childs are not interesting.
 
			if (step_size > 1 && child_height < cur_height) { // Small step sizes or already fitting children are not interesting.
 
				uint remainder = (cur_height - child_height) % step_size;
 
				if (remainder > 0) { // Child did not fit entirely, widen the container.
 
					cur_height += step_size - remainder;
 
					assert(cur_height < max_smallest); // Safeguard against infinite height expansion.
 
					/* Remaining childs will adapt to the new cur_height, thus speeding up the computation. */
 
					/* Remaining children will adapt to the new cur_height, thus speeding up the computation. */
 
				}
 
			}
 
		}
 
@@ -1128,7 +1128,7 @@ void NWidgetHorizontal::SetupSmallestSiz
 
			if (child_wid->fill_x == 1) child_wid->smallest_x = longest;
 
		}
 
	}
 
	/* 3. Move PIP space to the childs, compute smallest, fill, and resize values of the container. */
 
	/* 3. Move PIP space to the children, compute smallest, fill, and resize values of the container. */
 
	if (this->head != NULL) this->head->padding_left += this->pip_pre;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		if (child_wid->next != NULL) {
 
@@ -1169,9 +1169,9 @@ void NWidgetHorizontal::AssignSizePositi
 

	
 
	this->StoreSizePosition(sizing, x, y, given_width, given_height);
 

	
 
	/* In principle, the additional horizontal space is distributed evenly over the available resizable childs. Due to step sizes, this may not always be feasible.
 
	 * To make resizing work as good as possible, first childs with biggest step sizes are done. These may get less due to rounding down.
 
	 * This additional space is then given to childs with smaller step sizes. This will give a good result when resize steps of each child is a multiple
 
	/* In principle, the additional horizontal space is distributed evenly over the available resizable children. Due to step sizes, this may not always be feasible.
 
	 * To make resizing work as good as possible, first children with biggest step sizes are done. These may get less due to rounding down.
 
	 * This additional space is then given to children with smaller step sizes. This will give a good result when resize steps of each child is a multiple
 
	 * of the child with the smallest non-zero stepsize.
 
	 *
 
	 * Since child sizes are computed out of order, positions cannot be calculated until all sizes are known. That means it is not possible to compute the child
 
@@ -1180,8 +1180,10 @@ void NWidgetHorizontal::AssignSizePositi
 
	 * then we call the child.
 
	 */
 

	
 
	/* First loop: Find biggest stepsize, find number of childs that want a piece of the pie, handle vertical size for all childs, handle horizontal size for non-resizing childs. */
 
	int num_changing_childs = 0; // Number of childs that can change size.
 
	/* First loop: Find biggest stepsize, find number of children that want a piece of the pie, handle vertical size for all children,
 
	 * handle horizontal size for non-resizing children.
 
	 */
 
	int num_changing_childs = 0; // Number of children that can change size.
 
	uint biggest_stepsize = 0;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		uint hor_step = child_wid->GetHorizontalStepSize(sizing);
 
@@ -1196,7 +1198,7 @@ void NWidgetHorizontal::AssignSizePositi
 
		child_wid->current_y = ComputeMaxSize(child_wid->smallest_y, given_height - child_wid->padding_top - child_wid->padding_bottom, vert_step);
 
	}
 

	
 
	/* Second loop: Allocate the additional horizontal space over the resizing childs, starting with the biggest resize steps. */
 
	/* Second loop: Allocate the additional horizontal space over the resizing children, starting with the biggest resize steps. */
 
	while (biggest_stepsize > 0) {
 
		uint next_biggest_stepsize = 0;
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
@@ -1250,7 +1252,7 @@ NWidgetVertical::NWidgetVertical(NWidCon
 
void NWidgetVertical::SetupSmallestSize(Window *w, bool init_array)
 
{
 
	this->smallest_x = 0; // Biggest child.
 
	this->smallest_y = 0; // Sum of minimal size of all childs.
 
	this->smallest_y = 0; // Sum of minimal size of all children.
 
	this->fill_x = 1;     // smallest common child fill step.
 
	this->fill_y = 0;     // smallest non-zero child widget fill step.
 
	this->resize_x = 1;   // smallest common child resize step.
 
@@ -1265,32 +1267,32 @@ void NWidgetVertical::SetupSmallestSize(
 
		max_hor_fill = max(max_hor_fill, child_wid->GetHorizontalStepSize(ST_SMALLEST));
 
		this->smallest_x = max(this->smallest_x, child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right);
 
	}
 
	/* 1b. Make the container wider if needed to accomadate all childs nicely. */
 
	/* 1b. Make the container wider if needed to accommodate all children nicely. */
 
	uint max_smallest = this->smallest_x + 3 * max_hor_fill; // Upper limit to computing smallest height.
 
	uint cur_width = this->smallest_x;
 
	for (;;) {
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			uint step_size = child_wid->GetHorizontalStepSize(ST_SMALLEST);
 
			uint child_width = child_wid->smallest_x + child_wid->padding_left + child_wid->padding_right;
 
			if (step_size > 1 && child_width < cur_width) { // Small step sizes or already fitting childs are not interesting.
 
			if (step_size > 1 && child_width < cur_width) { // Small step sizes or already fitting children are not interesting.
 
				uint remainder = (cur_width - child_width) % step_size;
 
				if (remainder > 0) { // Child did not fit entirely, widen the container.
 
					cur_width += step_size - remainder;
 
					assert(cur_width < max_smallest); // Safeguard against infinite width expansion.
 
					/* Remaining childs will adapt to the new cur_width, thus speeding up the computation. */
 
					/* Remaining children will adapt to the new cur_width, thus speeding up the computation. */
 
				}
 
			}
 
		}
 
		if (this->smallest_x == cur_width) break;
 
		this->smallest_x = cur_width; // Smallest width got changed, try again.
 
	}
 
	/* 2. For containers that must maintain equal width, extend child minimal size. */
 
	/* 2. For containers that must maintain equal width, extend children minimal size. */
 
	if (this->flags & NC_EQUALSIZE) {
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
			if (child_wid->fill_y == 1) child_wid->smallest_y = highest;
 
		}
 
	}
 
	/* 3. Move PIP space to the childs, compute smallest, fill, and resize values of the container. */
 
	/* 3. Move PIP space to the child, compute smallest, fill, and resize values of the container. */
 
	if (this->head != NULL) this->head->padding_top += this->pip_pre;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		if (child_wid->next != NULL) {
 
@@ -1331,12 +1333,12 @@ void NWidgetVertical::AssignSizePosition
 

	
 
	this->StoreSizePosition(sizing, x, y, given_width, given_height);
 

	
 
	/* Like the horizontal container, the vertical container also distributes additional height evenly, starting with the childs with the biggest resize steps.
 
	/* Like the horizontal container, the vertical container also distributes additional height evenly, starting with the children with the biggest resize steps.
 
	 * It also stores computed widths and heights into current_x and current_y values of the child.
 
	 */
 

	
 
	/* First loop: Find biggest stepsize, find number of childs that want a piece of the pie, handle horizontal size for all childs, handle vertical size for non-resizing childs. */
 
	int num_changing_childs = 0; // Number of childs that can change size.
 
	/* First loop: Find biggest stepsize, find number of children that want a piece of the pie, handle horizontal size for all children, handle vertical size for non-resizing child. */
 
	int num_changing_childs = 0; // Number of children that can change size.
 
	uint biggest_stepsize = 0;
 
	for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
		uint vert_step = child_wid->GetVerticalStepSize(sizing);
 
@@ -1351,7 +1353,7 @@ void NWidgetVertical::AssignSizePosition
 
		child_wid->current_x = ComputeMaxSize(child_wid->smallest_x, given_width - child_wid->padding_left - child_wid->padding_right, hor_step);
 
	}
 

	
 
	/* Second loop: Allocate the additional vertical space over the resizing childs, starting with the biggest resize steps. */
 
	/* Second loop: Allocate the additional vertical space over the resizing children, starting with the biggest resize steps. */
 
	while (biggest_stepsize > 0) {
 
		uint next_biggest_stepsize = 0;
 
		for (NWidgetBase *child_wid = this->head; child_wid != NULL; child_wid = child_wid->next) {
 
@@ -1672,7 +1674,7 @@ NWidgetBackground::~NWidgetBackground()
 
 * @param nwid Nested widget to add to the background widget.
 
 *
 
 * Unless a child container has been given in the constructor, a parent behaves as a vertical container.
 
 * You can add several childs to it, and they are put underneath each other.
 
 * You can add several children to it, and they are put underneath each other.
 
 */
 
void NWidgetBackground::Add(NWidgetBase *nwid)
 
{
src/widget_type.h
Show inline comments
 
@@ -308,7 +308,7 @@ public:
 

	
 
/**
 
 * Highlight the widget or not.
 
 * @param higlighted Widget must be highlighted (blink).
 
 * @param highlight_colour Widget must be highlighted (blink).
 
 */
 
inline void NWidgetCore::SetHighlighted(TextColour highlight_colour)
 
{
 
@@ -830,7 +830,7 @@ static inline uint ComputeMaxSize(uint b
 
 *   the child widgets (it has no meaning for the compiler but it makes the widget parts easier to read).
 
 *   Below the last child widget, use an #EndContainer part. This part should be aligned with the #NWidget part that started the container.
 
 *
 
 * - Stacked widgets #NWidgetStacked map each of their childs onto the same space. It behaves like a container, except there is no pre/inter/post space,
 
 * - Stacked widgets #NWidgetStacked map each of their children onto the same space. It behaves like a container, except there is no pre/inter/post space,
 
 *   so the widget does not support #SetPIP. #SetPadding is allowed though.
 
 *   Like the other container widgets, below the last child widgets, a #EndContainer part should be used to denote the end of the stacked widget.
 
 *
 
@@ -1071,7 +1071,7 @@ static inline NWidgetPart SetPIP(uint8 p
 
/**
 
 * Attach a scrollbar to a widget.
 
 * The scrollbar is controlled when using the mousewheel on the widget.
 
 * Multipe widgets can refer to the same scrollbar to make the mousewheel work in all of them.
 
 * Multiple widgets can refer to the same scrollbar to make the mousewheel work in all of them.
 
 * @param index Widget index of the scrollbar.
 
 * @ingroup NestedWidgetParts
 
 */
src/widgets/ai_widget.h
Show inline comments
 
@@ -60,7 +60,7 @@ enum AIDebugWidgets {
 
	WID_AID_SCRIPT_GAME,          ///< Game Script button.
 
	WID_AID_RELOAD_TOGGLE,        ///< Reload button.
 
	WID_AID_LOG_PANEL,            ///< Panel where the log is in.
 
	WID_AID_SCROLLBAR,            ///< Scrollbar of the log pannel.
 
	WID_AID_SCROLLBAR,            ///< Scrollbar of the log panel.
 
	WID_AID_COMPANY_BUTTON_START, ///< Buttons in the VIEW.
 
	WID_AID_COMPANY_BUTTON_END = WID_AID_COMPANY_BUTTON_START + MAX_COMPANIES - 1, ///< Last possible button in the VIEW.
 
	WID_AID_BREAK_STRING_WIDGETS, ///< The panel to handle the breaking on string.
src/widgets/autoreplace_widget.h
Show inline comments
 
@@ -20,7 +20,7 @@ enum ReplaceVehicleWidgets {
 
	WID_RV_LEFT_MATRIX,              ///< The matrix on the left.
 
	WID_RV_LEFT_SCROLLBAR,           ///< The scrollbar for the matrix on the left.
 
	WID_RV_RIGHT_MATRIX,             ///< The matrix on the right.
 
	WID_RV_RIGHT_SCROLLBAR,          ///< The scrollbar for the matrxi on the right.
 
	WID_RV_RIGHT_SCROLLBAR,          ///< The scrollbar for the matrix on the right.
 
	WID_RV_LEFT_DETAILS,             ///< Details of the entry on the left.
 
	WID_RV_RIGHT_DETAILS,            ///< Details of the entry on the right.
 

	
src/widgets/dropdown.cpp
Show inline comments
 
@@ -452,7 +452,7 @@ void ShowDropDownList(Window *w, DropDow
 
 * @param strings       Menu list, end with #INVALID_STRING_ID
 
 * @param selected      Index of initial selected item.
 
 * @param button        Button widget number of the parent window \a w that wants the dropdown menu.
 
 * @param disabled_mask Bitmask for diabled items (items with their bit set are not copied to the dropdown list).
 
 * @param disabled_mask Bitmask for disabled items (items with their bit set are not copied to the dropdown list).
 
 * @param hidden_mask   Bitmask for hidden items (items with their bit set are displayed, but not selectable in the dropdown list).
 
 * @param width         Width of the dropdown menu. If \c 0, use the width of parent widget \a button.
 
 */
src/widgets/osk_widget.h
Show inline comments
 
@@ -19,7 +19,7 @@ enum OnScreenKeyboardWidgets {
 
	WID_OSK_CANCEL,    ///< Cancel key.
 
	WID_OSK_OK,        ///< Ok key.
 
	WID_OSK_BACKSPACE, ///< Backspace key.
 
	WID_OSK_SPECIAL,   ///< Special key (at keyborads often used for tab key).
 
	WID_OSK_SPECIAL,   ///< Special key (at keyboards often used for tab key).
 
	WID_OSK_CAPS,      ///< Capslock key.
 
	WID_OSK_SHIFT,     ///< Shift(lock) key.
 
	WID_OSK_SPACE,     ///< Space bar.
src/widgets/rail_widget.h
Show inline comments
 
@@ -12,7 +12,7 @@
 
#ifndef WIDGETS_RAIL_WIDGET_H
 
#define WIDGETS_RAIL_WIDGET_H
 

	
 
/** Widgets of the #BuildRailToolbarWindow ckass. */
 
/** Widgets of the #BuildRailToolbarWindow class. */
 
enum RailToolbarWidgets {
 
	/* Name starts with RA instead of R, because of collision with RoadToolbarWidgets */
 
	WID_RAT_CAPTION,        ///< Caption of the window.
 
@@ -98,10 +98,10 @@ enum BuildSignalWidgets {
 
/** Widgets of the #BuildRailDepotWindow class. */
 
enum BuildRailDepotWidgets {
 
	/* Name starts with BRA instead of BR, because of collision with BuildRoadDepotWidgets */
 
	WID_BRAD_DEPOT_NE, ///< Build a depot with the entrace in the north east.
 
	WID_BRAD_DEPOT_SE, ///< Build a depot with the entrace in the south east.
 
	WID_BRAD_DEPOT_SW, ///< Build a depot with the entrace in the south west.
 
	WID_BRAD_DEPOT_NW, ///< Build a depot with the entrace in the north west.
 
	WID_BRAD_DEPOT_NE, ///< Build a depot with the entrance in the north east.
 
	WID_BRAD_DEPOT_SE, ///< Build a depot with the entrance in the south east.
 
	WID_BRAD_DEPOT_SW, ///< Build a depot with the entrance in the south west.
 
	WID_BRAD_DEPOT_NW, ///< Build a depot with the entrance in the north west.
 
};
 

	
 
/** Widgets of the #BuildRailWaypointWindow class. */
src/widgets/settings_widget.h
Show inline comments
 
@@ -55,8 +55,8 @@ enum CustomCurrencyWidgets {
 
	WID_CC_RATE_DOWN,      ///< Down button.
 
	WID_CC_RATE_UP,        ///< Up button.
 
	WID_CC_RATE,           ///< Rate of currency.
 
	WID_CC_SEPARATOR_EDIT, ///< Seperator edit button.
 
	WID_CC_SEPARATOR,      ///< Current seperator.
 
	WID_CC_SEPARATOR_EDIT, ///< Separator edit button.
 
	WID_CC_SEPARATOR,      ///< Current separator.
 
	WID_CC_PREFIX_EDIT,    ///< Prefix edit button.
 
	WID_CC_PREFIX,         ///< Current prefix.
 
	WID_CC_SUFFIX_EDIT,    ///< Suffix edit button.
src/widgets/terraform_widget.h
Show inline comments
 
@@ -21,7 +21,7 @@ enum TerraformToolbarWidgets {
 
	WID_TT_LEVEL_LAND,                        ///< Level land button.
 
	WID_TT_DEMOLISH,                          ///< Demolish aka dynamite button.
 
	WID_TT_BUY_LAND,                          ///< Buy land button.
 
	WID_TT_PLANT_TREES,                       ///< Plant trees button (note: opens seperate window, no place-push-button).
 
	WID_TT_PLANT_TREES,                       ///< Plant trees button (note: opens separate window, no place-push-button).
 
	WID_TT_PLACE_SIGN,                        ///< Place sign button.
 
	WID_TT_PLACE_OBJECT,                      ///< Place object button.
 
};
src/widgets/vehicle_widget.h
Show inline comments
 
@@ -56,7 +56,7 @@ enum VehicleDetailsWidgets {
 
	WID_VD_DETAILS_CARGO_CARRIED,       ///< Show carried cargo per part of the train.
 
	WID_VD_DETAILS_TRAIN_VEHICLES,      ///< Show all parts of the train with their description.
 
	WID_VD_DETAILS_CAPACITY_OF_EACH,    ///< Show the capacity of all train parts.
 
	WID_VD_DETAILS_TOTAL_CARGO,         ///< Show the capacity and carried cargo amounts aggregrated per cargo of the train.
 
	WID_VD_DETAILS_TOTAL_CARGO,         ///< Show the capacity and carried cargo amounts aggregated per cargo of the train.
 
};
 

	
 
/** Widgets of the #VehicleListWindow class. */
src/window.cpp
Show inline comments
 
@@ -2475,7 +2475,7 @@ static void HandleKeyScrolling()
 
{
 
	/*
 
	 * Check that any of the dirkeys is pressed and that the focused window
 
	 * dont has an edit-box as focused widget.
 
	 * doesn't have an edit-box as focused widget.
 
	 */
 
	if (_dirkeys && !EditBoxInGlobalFocus()) {
 
		int factor = _shift_pressed ? 50 : 10;
 
@@ -2806,7 +2806,7 @@ void SetWindowClassesDirty(WindowClass c
 
/**
 
 * Mark this window's data as invalid (in need of re-computing)
 
 * @param data The data to invalidate with
 
 * @param gui_scope Whether the funtion is called from GUI scope.
 
 * @param gui_scope Whether the function is called from GUI scope.
 
 */
 
void Window::InvalidateData(int data, bool gui_scope)
 
{
 
@@ -3071,7 +3071,7 @@ int PositionNewsMessage(Window *w)
 
/**
 
 * (Re)position network chat window at the screen.
 
 * @param w Window structure of the network chat window, may also be \c NULL.
 
 * @return X coordinate of left edge of the repositioned network chat winodw.
 
 * @return X coordinate of left edge of the repositioned network chat window.
 
 */
 
int PositionNetworkChatWindow(Window *w)
 
{
src/window_gui.h
Show inline comments
 
@@ -171,9 +171,9 @@ struct WindowDesc : ZeroedMemoryAllocato
 

	
 
	~WindowDesc();
 

	
 
	WindowPosition default_pos;    ///< Prefered position of the window. @see WindowPosition()
 
	int16 default_width;           ///< Prefered initial width of the window.
 
	int16 default_height;          ///< Prefered initial height of the window.
 
	WindowPosition default_pos;    ///< Preferred position of the window. @see WindowPosition()
 
	int16 default_width;           ///< Preferred initial width of the window.
 
	int16 default_height;          ///< Preferred initial height of the window.
 
	WindowClass cls;               ///< Class of the window, @see WindowClass.
 
	WindowClass parent_cls;        ///< Class of the parent window. @see WindowClass
 
	uint32 flags;                  ///< Flags. @see WindowDefaultFlag
 
@@ -284,7 +284,7 @@ public:
 
	WindowNumber window_number; ///< Window number within the window class
 

	
 
	uint8 timeout_timer;      ///< Timer value of the WF_TIMEOUT for flags.
 
	uint8 white_border_timer; ///< Timervalue of the WF_WHITE_BORDER for flags.
 
	uint8 white_border_timer; ///< Timer value of the WF_WHITE_BORDER for flags.
 

	
 
	int left;   ///< x position of left edge of the window
 
	int top;    ///< y position of top edge of the window
0 comments (0 inline, 0 general)