Changeset - r15613:193c12018337
[Not reviewed]
master
! ! !
frosch - 14 years ago 2010-08-01 19:44:49
frosch@openttd.org
(svn r20286) -Codechange: Unify end of doxygen comments.
93 files changed with 424 insertions and 220 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_abstractlist.hpp
Show inline comments
 
@@ -218,7 +218,7 @@ public:
 
	/**
 
	 * Keep all items with this value.
 
	 * @param value the value to keep.
 
	 **/
 
	 */
 
	void KeepValue(int32 value);
 

	
 
	/**
src/aircraft_cmd.cpp
Show inline comments
 
@@ -9,7 +9,8 @@
 

	
 
/**
 
 * @file aircraft_cmd.cpp
 
 * This file deals with aircraft and airport movements functionalities */
 
 * This file deals with aircraft and airport movements functionalities
 
 */
 

	
 
#include "stdafx.h"
 
#include "aircraft.h"
 
@@ -73,7 +74,8 @@ void Aircraft::UpdateDeltaXY(Direction d
 

	
 
/**
 
 * this maps the terminal to its corresponding state and block flag
 
 *  currently set for 10 terms, 4 helipads */
 
 *  currently set for 10 terms, 4 helipads
 
 */
 
static const byte _airport_terminal_state[] = {2, 3, 4, 5, 6, 7, 19, 20, 0, 0, 8, 9, 21, 22};
 
static const byte _airport_terminal_flag[] =  {0, 1, 2, 3, 4, 5, 22, 23, 0, 0, 6, 7, 24, 25};
 

	
 
@@ -143,7 +145,8 @@ static StationID FindNearestHangar(const
 
/**
 
 * Check if given vehicle has a goto hangar in his orders
 
 * @param v vehicle to inquiry
 
 * @return true if vehicle v has an airport in the schedule, that has a hangar */
 
 * @return true if vehicle v has an airport in the schedule, that has a hangar
 
 */
 
static bool HaveHangarInOrderList(Aircraft *v)
 
{
 
	const Order *order;
src/airport.cpp
Show inline comments
 
@@ -230,7 +230,8 @@ AirportFTAClass::~AirportFTAClass()
 
/**
 
 * Get the number of elements of a source Airport state automata
 
 * Since it is actually just a big array of AirportFTA types, we only
 
 * know one element from the other by differing 'position' identifiers */
 
 * know one element from the other by differing 'position' identifiers
 
 */
 
static uint16 AirportGetNofElements(const AirportFTAbuildup *apFA)
 
{
 
	uint16 nofelements = 0;
 
@@ -249,7 +250,8 @@ static uint16 AirportGetNofElements(cons
 
/**
 
 * We calculate the terminal/helipod count based on the data passed to us
 
 * This data (terminals) contains an index as a first element as to how many
 
 * groups there are, and then the number of terminals for each group */
 
 * groups there are, and then the number of terminals for each group
 
 */
 
static byte AirportGetTerminalCount(const byte *terminals, byte *groups)
 
{
 
	byte nof_terminals = 0;
src/autoreplace.cpp
Show inline comments
 
@@ -20,7 +20,8 @@ INSTANTIATE_POOL_METHODS(EngineRenew)
 

	
 
/**
 
 * Retrieves the EngineRenew that specifies the replacement of the given
 
 * engine type from the given renewlist */
 
 * engine type from the given renewlist
 
 */
 
static EngineRenew *GetEngineReplacement(EngineRenewList erl, EngineID engine, GroupID group)
 
{
 
	EngineRenew *er = (EngineRenew *)erl;
src/core/enum_type.hpp
Show inline comments
 
@@ -81,7 +81,8 @@ struct MakeEnumPropsT {
 
 *  compiler type - checking causes errors like:
 
 *     'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
 
 *  u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
 
 *  to teach the compiler that u->u.rail.railtype is to be treated as RailType. */
 
 *  to teach the compiler that u->u.rail.railtype is to be treated as RailType.
 
 */
 
template <typename Tenum_t> struct TinyEnumT;
 

	
 
/** The general declaration of TinyEnumT<> (above) */
src/currency.cpp
Show inline comments
 
@@ -62,7 +62,7 @@ CurrencySpec _currency_specs[NUM_CURRENC
 
 * 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
 
 **/
 
 */
 
enum Currencies {
 
	CURR_GBP,
 
	CURR_USD,
 
@@ -99,7 +99,7 @@ enum Currencies {
 
 * compared to TTDPatch's ones.
 
 * When a grf sends currencies, they are based on the order defined by TTDPatch.
 
 * So, we must reindex them to our own order.
 
 **/
 
 */
 
const byte TTDPatch_To_OTTDIndex[] =
 
{
 
	CURR_GBP,
 
@@ -130,7 +130,7 @@ const byte TTDPatch_To_OTTDIndex[] =
 
 * Only called from newgrf.cpp
 
 * @param grfcurr_id currency id coming from newgrf
 
 * @return the corrected index
 
 **/
 
 */
 
byte GetNewgrfCurrencyIdConverted(byte grfcurr_id)
 
{
 
	return (grfcurr_id >= lengthof(TTDPatch_To_OTTDIndex)) ? grfcurr_id : TTDPatch_To_OTTDIndex[grfcurr_id];
 
@@ -158,7 +158,7 @@ uint GetMaskOfAllowedCurrencies()
 

	
 
/**
 
 * Verify if the currency chosen by the user is about to be converted to Euro
 
 **/
 
 */
 
void CheckSwitchToEuro()
 
{
 
	if (_currency_specs[_settings_game.locale.currency].to_euro != CF_NOEURO &&
 
@@ -177,7 +177,7 @@ void CheckSwitchToEuro()
 
 *        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
 
 *        overwritten.
 
 **/
 
 */
 
void ResetCurrencies(bool preserve_custom)
 
{
 
	memcpy(&_currency_specs, &origin_currency_specs, sizeof(origin_currency_specs) - (preserve_custom ? sizeof(_custom_currency) : 0));
src/depot_gui.cpp
Show inline comments
 
@@ -161,7 +161,8 @@ static void TrainDepotMoveVehicle(const 
 

	
 
/**
 
 * Array containing the cell size in pixels of the #DEPOT_WIDGET_MATRIX widget for each vehicle type.
 
 * @note The train vehicle type uses the entire row for each train. */
 
 * @note The train vehicle type uses the entire row for each train.
 
 */
 
static Dimension _base_block_sizes[4];
 

	
 
static void InitBlocksizeForShipAircraft(VehicleType type)
 
@@ -197,7 +198,8 @@ static void InitBlocksizeForShipAircraft
 

	
 
/**
 
 * Set the size of the blocks in the window so we can be sure that they are big enough for the vehicle sprites in the current game.
 
 * @note Calling this function once for each game is enough. */
 
 * @note Calling this function once for each game is enough.
 
 */
 
void InitDepotWindowBlockSizes()
 
{
 
	_base_block_sizes[VEH_TRAIN].width = 0;
src/disaster_cmd.cpp
Show inline comments
 
@@ -131,7 +131,8 @@ static void DisasterVehicleUpdateImage(D
 

	
 
/**
 
 * Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable
 
 * and owned by nobody */
 
 * and owned by nobody
 
 */
 
static void InitializeDisasterVehicle(DisasterVehicle *v, int x, int y, byte z, Direction direction, byte subtype)
 
{
 
	v->x_pos = x;
 
@@ -674,7 +675,8 @@ typedef void DisasterInitProc();
 

	
 
/**
 
 * Zeppeliner which crashes on a small airport if one found,
 
 * otherwise crashes on a random tile */
 
 * otherwise crashes on a random tile
 
 */
 
static void Disaster_Zeppeliner_Init()
 
{
 
	if (!Vehicle::CanAllocateItem(2)) return;
 
@@ -703,7 +705,8 @@ static void Disaster_Zeppeliner_Init()
 

	
 
/**
 
 * Ufo which flies around aimlessly from the middle of the map a bit
 
 * until it locates a road vehicle which it targets and then destroys */
 
 * until it locates a road vehicle which it targets and then destroys
 
 */
 
static void Disaster_Small_Ufo_Init()
 
{
 
	if (!Vehicle::CanAllocateItem(2)) return;
 
@@ -850,7 +853,8 @@ static void Disaster_Big_Submarine_Init(
 

	
 
/**
 
 * Coal mine catastrophe, destroys a stretch of 30 tiles of
 
 * land in a certain direction */
 
 * land in a certain direction
 
 */
 
static void Disaster_CoalMine_Init()
 
{
 
	int index = GB(Random(), 0, 4);
src/economy.cpp
Show inline comments
 
@@ -162,7 +162,8 @@ Money CalculateCompanyValue(const Compan
 
 * @param update the economy with calculated score
 
 * @param c company been evaluated
 
 * @return actual score of this company
 
 * */
 
 *
 
 */
 
int UpdateCompanyRatingAndValue(Company *c, bool update)
 
{
 
	Owner owner = c->index;
src/endian_check.cpp
Show inline comments
 
@@ -15,7 +15,8 @@
 
 *
 
 * After that it outputs the contents of an include files (endian.h)
 
 *  that says or TTD_LITTLE_ENDIAN, or TTD_BIG_ENDIAN. Makefile takes
 
 *  care of the real writing to the file. */
 
 *  care of the real writing to the file.
 
 */
 

	
 
#include <stdio.h>
 
#include <string.h>
src/engine.cpp
Show inline comments
 
@@ -40,7 +40,8 @@ EngineOverrideManager _engine_mngr;
 

	
 
/**
 
 * Year that engine aging stops. Engines will not reduce in reliability
 
 * and no more engines will be introduced */
 
 * and no more engines will be introduced
 
 */
 
static Year _year_engine_aging_stops;
 

	
 
/** Number of engines of each vehicle type in original engine data */
src/fios_gui.cpp
Show inline comments
 
@@ -698,7 +698,8 @@ static const WindowDesc _save_dialog_des
 

	
 
/**
 
 * These values are used to convert the file/operations mode into a corresponding file type.
 
 * So each entry, as expressed by the related comment, is based on the enum   */
 
 * So each entry, as expressed by the related comment, is based on the enum
 
 */
 
static const FileType _file_modetotype[] = {
 
	FT_SAVEGAME,  ///< used for SLD_LOAD_GAME
 
	FT_SCENARIO,  ///< used for SLD_LOAD_SCENARIO
src/fontcache.cpp
Show inline comments
 
@@ -44,7 +44,8 @@ static const byte SHADOW_COLOUR = 2;
 

	
 
/**
 
 * Get the font loaded into a Freetype face by using a font-name.
 
 * If no appropiate font is found, the function returns an error */
 
 * If no appropiate font is found, the function returns an error
 
 */
 
#ifdef WIN32
 
#include <windows.h>
 
#include <shlobj.h> /* SHGetFolderPath */
src/gfx.cpp
Show inline comments
 
@@ -970,7 +970,8 @@ int DrawStringMultiLine(int left, int ri
 
 * but not every possible combination
 
 * @param str string to calculate pixel-width
 
 * @param start_fontsize Fontsize to start the text with
 
 * @return string width and height in pixels */
 
 * @return string width and height in pixels
 
 */
 
Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
 
{
 
	FontSize size = start_fontsize;
 
@@ -1726,7 +1727,8 @@ void MarkWholeScreenDirty()
 
 * offset from the calling window coordinates
 
 * @return return false if the requested rectangle is not possible with the
 
 * current dpi pointer. Only continue of the return value is true, or you'll
 
 * get some nasty results */
 
 * get some nasty results
 
 */
 
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
 
{
 
	Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
src/highscore_gui.cpp
Show inline comments
 
@@ -220,7 +220,8 @@ static const WindowDesc _endgame_desc(
 
/**
 
 * Show the highscore table for a given difficulty. When called from
 
 * endgame ranking is set to the top5 element that was newly added
 
 * and is thus highlighted */
 
 * and is thus highlighted
 
 */
 
void ShowHighscoreTable(int difficulty, int8 ranking)
 
{
 
	DeleteWindowByClass(WC_HIGHSCORE);
 
@@ -229,7 +230,8 @@ void ShowHighscoreTable(int difficulty, 
 

	
 
/**
 
 * Show the endgame victory screen in 2050. Update the new highscore
 
 * if it was high enough */
 
 * if it was high enough
 
 */
 
void ShowEndGameChart()
 
{
 
	/* Dedicated server doesn't need the highscore window and neither does -v null. */
src/house.h
Show inline comments
 
@@ -20,7 +20,8 @@
 

	
 
/**
 
 * Simple value that indicates the house has reached the final stage of
 
 * construction. */
 
 * construction.
 
 */
 
static const byte TOWN_HOUSE_COMPLETED = 3;
 

	
 
static const uint HOUSE_NO_CLASS      = 0;
 
@@ -30,7 +31,8 @@ static const HouseID INVALID_HOUSE_ID = 
 

	
 
/**
 
 * There can only be as many classes as there are new houses, plus one for
 
 * NO_CLASS, as the original houses don't have classes. */
 
 * NO_CLASS, as the original houses don't have classes.
 
 */
 
static const uint HOUSE_CLASS_MAX  = HOUSE_MAX - NEW_HOUSE_OFFSET + 1;
 

	
 
enum BuildingFlags {
src/industry_cmd.cpp
Show inline comments
 
@@ -66,7 +66,8 @@ IndustryTileSpec _industry_tile_specs[NU
 
 * This function initialize the spec arrays of both
 
 * industry and industry tiles.
 
 * It adjusts the enabling of the industry too, based on climate availability.
 
 * This will allow for clearer testings */
 
 * This will allow for clearer testings
 
 */
 
void ResetIndustries()
 
{
 
	memset(&_industry_specs, 0, sizeof(_industry_specs));
 
@@ -93,7 +94,7 @@ void ResetIndustries()
 
 * @param tile that is queried
 
 * @pre IsTileType(tile, MP_INDUSTRY)
 
 * @return general type for this industry, as defined in industry.h
 
 **/
 
 */
 
IndustryType GetIndustryType(TileIndex tile)
 
{
 
	assert(IsTileType(tile, MP_INDUSTRY));
 
@@ -110,7 +111,7 @@ IndustryType GetIndustryType(TileIndex t
 
 * @param thistype of industry (which is the index in _industry_specs)
 
 * @pre thistype < NUM_INDUSTRYTYPES
 
 * @return a pointer to the corresponding industry spec
 
 **/
 
 */
 
const IndustrySpec *GetIndustrySpec(IndustryType thistype)
 
{
 
	assert(thistype < NUM_INDUSTRYTYPES);
 
@@ -124,7 +125,7 @@ const IndustrySpec *GetIndustrySpec(Indu
 
 * @param gfx of industrytile (which is the index in _industry_tile_specs)
 
 * @pre gfx < INVALID_INDUSTRYTILE
 
 * @return a pointer to the corresponding industrytile spec
 
 **/
 
 */
 
const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx)
 
{
 
	assert(gfx < INVALID_INDUSTRYTILE);
 
@@ -1535,7 +1536,8 @@ static CommandCost CheckIfFarEnoughFromC
 
/**
 
 * Production level maximum, minimum and default values.
 
 * It is not a value been really used in order to change, but rather an indicator
 
 * of how the industry is behaving. */
 
 * of how the industry is behaving.
 
 */
 
enum ProductionLevels {
 
	PRODLEVEL_CLOSURE = 0x00,  ///< signal set to actually close the industry
 
	PRODLEVEL_MINIMUM = 0x04,  ///< below this level, the industry is set to be closing
src/landscape.cpp
Show inline comments
 
@@ -48,7 +48,8 @@ extern const TileTypeProcs
 
/**
 
 * Tile callback functions for each type of tile.
 
 * @ingroup TileCallbackGroup
 
 * @see TileType */
 
 * @see TileType
 
 */
 
const TileTypeProcs * const _tile_type_procs[16] = {
 
	&_tile_type_clear_procs,        ///< Callback functions for MP_CLEAR tiles
 
	&_tile_type_rail_procs,         ///< Callback functions for MP_RAILWAY tiles
 
@@ -75,7 +76,8 @@ extern const byte _slope_to_sprite_offse
 
 * If it is \c NULL, a static snowline height is used, as set by \c _settings_game.game_creation.snow_line.
 
 * Otherwise it points to a table loaded from a newGRF file, that describes the variable snowline
 
 * @ingroup SnowLineGroup
 
 * @see GetSnowLine() GameCreationSettings */
 
 * @see GetSnowLine() GameCreationSettings
 
 */
 
static SnowLine *_snow_line = NULL;
 

	
 
/**
src/landscape.h
Show inline comments
 
@@ -20,7 +20,8 @@ static const uint SNOW_LINE_DAYS   = 32;
 

	
 
/**
 
 * Structure describing the height of the snow line each day of the year
 
 * @ingroup SnowLineGroup */
 
 * @ingroup SnowLineGroup
 
 */
 
struct SnowLine {
 
	byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; ///< Height of the snow line each day of the year
 
	byte highest_value; ///< Highest snow line of the year
src/misc/array.hpp
Show inline comments
 
@@ -17,7 +17,8 @@
 

	
 
/**
 
 * Flexible array with size limit. Implemented as fixed size
 
 *  array of fixed size arrays */
 
 *  array of fixed size arrays
 
 */
 
template <class T, uint B = 1024, uint N = B>
 
class SmallArray {
 
protected:
src/misc/blob.hpp
Show inline comments
 
@@ -105,7 +105,8 @@ protected:
 

	
 
	/**
 
	 * Return header pointer to the static BlobHeader with
 
	 * both items and capacity containing zero */
 
	 * both items and capacity containing zero
 
	 */
 
	static FORCEINLINE BlobHeader *Zero()
 
	{
 
		return const_cast<BlobHeader *>(&ByteBlob::hdrEmpty[1]);
 
@@ -235,7 +236,8 @@ public:
 

	
 
	/**
 
	 * Reallocate if there is no free space for num_bytes bytes.
 
	 *  @return pointer to the new data to be added */
 
	 *  @return pointer to the new data to be added
 
	 */
 
	FORCEINLINE byte *Prepare(size_t num_bytes)
 
	{
 
		size_t new_size = Length() + num_bytes;
 
@@ -245,7 +247,8 @@ public:
 

	
 
	/**
 
	 * Increase Length() by num_bytes.
 
	 *  @return pointer to the new data added */
 
	 *  @return pointer to the new data added
 
	 */
 
	FORCEINLINE byte *Append(size_t num_bytes)
 
	{
 
		byte *pNewData = Prepare(num_bytes);
 
@@ -297,7 +300,8 @@ public:
 
 *  1. When adding new item(s) it automatically grows capacity if needed.
 
 *  2. When variable of type Blob comes out of scope it automatically frees the data buffer.
 
 *  3. Takes care about the actual data size (number of used items).
 
 *  4. Dynamically constructs only used items (as opposite of static array which constructs all items) */
 
 *  4. Dynamically constructs only used items (as opposite of static array which constructs all items)
 
 */
 
template <typename T>
 
class CBlobT : public ByteBlob {
 
	/* make template arguments public: */
 
@@ -387,7 +391,8 @@ public:
 

	
 
	/**
 
	 * Ensures that given number of items can be added to the end of Blob. Returns pointer to the
 
	 *  first free (unused) item */
 
	 *  first free (unused) item
 
	 */
 
	FORCEINLINE T *MakeFreeSpace(size_t num_items)
 
	{
 
		return (T*)base::Prepare(num_items * type_size);
src/misc/fixedsizearray.hpp
Show inline comments
 
@@ -18,7 +18,8 @@
 
 * fixed size array
 
 *  Upon construction it preallocates fixed size block of memory
 
 *  for all items, but doesn't construct them. Item's construction
 
 *  is delayed. */
 
 *  is delayed.
 
 */
 
template <class T, uint C>
 
struct FixedSizeArray {
 
protected:
 
@@ -35,7 +36,8 @@ protected:
 

	
 
	/**
 
	 * the only member of fixed size array is pointer to the block
 
	 *  of C array of items. Header can be found on the offset -sizeof(ArrayHeader). */
 
	 *  of C array of items. Header can be found on the offset -sizeof(ArrayHeader).
 
	 */
 
	T *data;
 

	
 
	/** return reference to the array header (non-const) */
src/misc/hashtable.hpp
Show inline comments
 
@@ -139,7 +139,8 @@ public:
 
protected:
 
	/**
 
	 * each slot contains pointer to the first item in the list,
 
	 *  Titem contains pointer to the next item - GetHashNext(), SetHashNext() */
 
	 *  Titem contains pointer to the next item - GetHashNext(), SetHashNext()
 
	 */
 
	typedef CHashTableSlotT<Titem_> Slot;
 

	
 
	Slot *m_slots;     // here we store our data (array of blobs)
src/misc_gui.cpp
Show inline comments
 
@@ -1096,7 +1096,8 @@ bool MoveTextBufferPos(Textbuf *tb, int 
 
 * @param maxsize maximum size in bytes, including terminating '\0'
 
 * @param maxwidth maximum length in pixels of this buffer. If reached, buffer
 
 * cannot grow, even if maxsize would allow because there is space. Width
 
 * of zero '0' means the buffer is only restricted by maxsize */
 
 * of zero '0' means the buffer is only restricted by maxsize
 
 */
 
void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 maxsize, uint16 maxwidth)
 
{
 
	assert(maxsize != 0);
src/music/allegro_m.cpp
Show inline comments
 
@@ -21,7 +21,8 @@ static MIDI *_midi = NULL;
 

	
 
/**
 
 * There are multiple modules that might be using Allegro and
 
 * Allegro can only be initiated once. */
 
 * Allegro can only be initiated once.
 
 */
 
extern int _allegro_instance_count;
 

	
 
const char *MusicDriver_Allegro::Start(const char * const *param)
src/network/core/packet.h
Show inline comments
 
@@ -37,7 +37,8 @@ struct Packet {
 
	/**
 
	 * The size of the whole packet for received packets. For packets
 
	 * that will be sent, the value is filled in just before the
 
	 * actual transmission. */
 
	 * actual transmission.
 
	 */
 
	PacketSize size;
 
	/** The current read/write position in the packet */
 
	PacketSize pos;
src/network/network.cpp
Show inline comments
 
@@ -477,7 +477,8 @@ static void CheckPauseOnJoin()
 
 *
 
 * connection_string will be re-terminated to seperate 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. */
 
 * occupied by connection_string.
 
 */
 
void ParseConnectionString(const char **company, const char **port, char *connection_string)
 
{
 
	bool ipv6 = (strchr(connection_string, ':') != strrchr(connection_string, ':'));
src/network/network_gamelist.cpp
Show inline comments
 
@@ -72,7 +72,8 @@ static void NetworkGameListHandleDelayed
 
 * return the existing item instead of adding it again
 
 * @param address the address of the to-be added item
 
 * @param port the port the server is running on
 
 * @return a point to the newly added or already existing item */
 
 * @return a point to the newly added or already existing item
 
 */
 
NetworkGameList *NetworkGameListAddItem(NetworkAddress address)
 
{
 
	const char *hostname = address.GetHostname();
 
@@ -110,7 +111,8 @@ NetworkGameList *NetworkGameListAddItem(
 

	
 
/**
 
 * Remove an item from the gamelist linked list
 
 * @param remove pointer to the item to be removed */
 
 * @param remove pointer to the item to be removed
 
 */
 
void NetworkGameListRemoveItem(NetworkGameList *remove)
 
{
 
	NetworkGameList *prev_item = NULL;
src/network/network_gui.cpp
Show inline comments
 
@@ -67,7 +67,8 @@ void SortNetworkLanguages()
 
/**
 
 * Update the network new window because a new server is
 
 * found on the network.
 
 * @param unselect unselect the currently selected item */
 
 * @param unselect unselect the currently selected item
 
 */
 
void UpdateNetworkGameWindow(bool unselect)
 
{
 
	InvalidateWindowData(WC_NETWORK_WINDOW, 0, unselect ? 1 : 0);
 
@@ -283,7 +284,8 @@ protected:
 
	/**
 
	 * Sort servers by the amount of clients online on a
 
	 * server. If the two servers have the same amount, the one with the
 
	 * higher maximum is preferred. */
 
	 * higher maximum is preferred.
 
	 */
 
	static int CDECL NGameClientSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		/* Reverse as per default we are interested in most-clients first */
 
@@ -321,7 +323,8 @@ protected:
 

	
 
	/**
 
	 * Sort servers by joinability. If both servers are the
 
	 * same, prefer the non-passworded server first. */
 
	 * same, prefer the non-passworded server first.
 
	 */
 
	static int CDECL NGameAllowedSorter(NetworkGameList * const *a, NetworkGameList * const *b)
 
	{
 
		/* The servers we do not know anything about (the ones that did not reply) should be at the bottom) */
src/network/network_server.cpp
Show inline comments
 
@@ -1773,7 +1773,7 @@ void NetworkServerUpdateCompanyPassworde
 
 * @param client_id id of the client we want to move.
 
 * @param company_id id of the company we want to move the client to.
 
 * @return void
 
 **/
 
 */
 
void NetworkServerDoMove(ClientID client_id, CompanyID company_id)
 
{
 
	/* Only allow non-dedicated servers and normal clients to be moved */
src/newgrf.cpp
Show inline comments
 
@@ -230,7 +230,8 @@ static GRFLineToSpriteOverride _grf_line
 
 * loading/parsing grf files, not for runtime debug messages as there
 
 * is no file information available during that time.
 
 * @param severity debugging severity level, see debug.h
 
 * @param str message in printf() format */
 
 * @param str message in printf() format
 
 */
 
void CDECL grfmsg(int severity, const char *str, ...)
 
{
 
	char buf[1024];
 
@@ -6797,7 +6798,8 @@ static void InitNewGRFFile(const GRFConf
 

	
 
/**
 
 * List of what cargo labels are refittable for the given the vehicle-type.
 
 * Only currently active labels are applied. */
 
 * Only currently active labels are applied.
 
 */
 
static const CargoLabel _default_refitmasks_rail[] = {
 
	'PASS', 'COAL', 'MAIL', 'LVST', 'GOOD', 'GRAI', 'WHEA', 'MAIZ', 'WOOD',
 
	'IORE', 'STEL', 'VALU', 'GOLD', 'DIAM', 'PAPR', 'FOOD', 'FRUT', 'CORE',
 
@@ -6933,7 +6935,8 @@ static void FinaliseCargoArray()
 
 * Add all new houses to the house array. House properties can be set at any
 
 * time in the GRF file, so we can only add a house spec to the house array
 
 * after the file has finished loading. We also need to check the dates, due to
 
 * the TTDPatch behaviour described below that we need to emulate. */
 
 * the TTDPatch behaviour described below that we need to emulate.
 
 */
 
static void FinaliseHouseArray()
 
{
 
	/* If there are no houses with start dates before 1930, then all houses
 
@@ -6998,7 +7001,8 @@ static void FinaliseHouseArray()
 
/**
 
 * Add all new industries to the industry array. Industry properties can be set at any
 
 * time in the GRF file, so we can only add a industry spec to the industry array
 
 * after the file has finished loading. */
 
 * after the file has finished loading.
 
 */
 
static void FinaliseIndustriesArray()
 
{
 
	const GRFFile * const *end = _grf_files.End();
src/newgrf_callbacks.h
Show inline comments
 
@@ -45,7 +45,8 @@ enum CallbackID {
 

	
 
	/**
 
	 * Refit capacity, the passed vehicle needs to have its ->cargo_type set to
 
	 * the cargo we are refitting to, returns the new cargo capacity. */
 
	 * the cargo we are refitting to, returns the new cargo capacity.
 
	 */
 
	CBID_VEHICLE_REFIT_CAPACITY          = 0x15, // 15 bit callback
 

	
 
	/** Builds articulated engines for trains and RVs. */
 
@@ -89,7 +90,8 @@ enum CallbackID {
 

	
 
	/**
 
	 * This callback is called from vehicle purchase lists. It returns a value to be
 
	 * used as a custom string ID in the 0xD000 range. */
 
	 * used as a custom string ID in the 0xD000 range.
 
	 */
 
	CBID_VEHICLE_ADDITIONAL_TEXT         = 0x23,
 

	
 
	/** Called when building a station to customize the tile layout */
 
@@ -121,7 +123,8 @@ enum CallbackID {
 

	
 
	/**
 
	 * Called to determine if a specific colour map should be used for a vehicle
 
	 * instead of the default livery. */
 
	 * instead of the default livery.
 
	 */
 
	CBID_VEHICLE_COLOUR_MAPPING          = 0x2D, // 15 bit callback
 

	
 
	/** Called to determine how much cargo a town building produces. */
 
@@ -135,7 +138,8 @@ enum CallbackID {
 

	
 
	/**
 
	 * Called when the company (or AI) tries to start or stop a vehicle. Mainly
 
	 * used for preventing a vehicle from leaving the depot. */
 
	 * used for preventing a vehicle from leaving the depot.
 
	 */
 
	CBID_VEHICLE_START_STOP_CHECK        = 0x31, // 15 bit callback, but 0xFF test is done with 8 bit
 

	
 
	/** Called for every vehicle every 32 days (not all on same date though). */
 
@@ -152,7 +156,8 @@ enum CallbackID {
 

	
 
	/**
 
	 * Called to modify various vehicle properties. Callback parameter 1
 
	 * specifies the property index, as used in Action 0, to change. */
 
	 * specifies the property index, as used in Action 0, to change.
 
	 */
 
	CBID_VEHICLE_MODIFY_PROPERTY         = 0x36, // 8/15 bit depends on queried property
 

	
 
	/** Called to determine text to display after cargo name */
src/newgrf_canal.h
Show inline comments
 
@@ -18,7 +18,8 @@
 

	
 
/**
 
 * List of different canal 'features'.
 
 * Each feature gets an entry in the canal spritegroup table */
 
 * Each feature gets an entry in the canal spritegroup table
 
 */
 
enum CanalFeature {
 
	CF_WATERSLOPE,
 
	CF_LOCKS,
src/newgrf_commons.cpp
Show inline comments
 
@@ -294,7 +294,8 @@ void IndustryTileOverrideManager::SetEnt
 
 * @param tile TileIndex of the tile been queried
 
 * @param upper_halftile If true, query upper halftile in case of rail tiles.
 
 * @return value corresponding to the grf expected format:
 
 *         Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline */
 
 *         Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline
 
 */
 
uint32 GetTerrainType(TileIndex tile, bool upper_halftile)
 
{
 
	switch (_settings_game.game_creation.landscape) {
src/newgrf_config.cpp
Show inline comments
 
@@ -323,7 +323,8 @@ void ClearGRFConfigList(GRFConfig **conf
 
 * @param dst pointer to destination list
 
 * @param src pointer to source list values
 
 * @param init_only the copied GRF will be processed up to GLS_INIT
 
 * @return pointer to the last value added to the destination list */
 
 * @return pointer to the last value added to the destination list
 
 */
 
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only)
 
{
 
	/* Clear destination as it will be overwritten */
 
@@ -388,7 +389,8 @@ void AppendStaticGRFConfigs(GRFConfig **
 
/**
 
 * Appends an element to a list of GRFs
 
 * @param dst the head of the list to add to
 
 * @param el the new tail to be */
 
 * @param el the new tail to be
 
 */
 
void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el)
 
{
 
	GRFConfig **tail = dst;
 
@@ -416,7 +418,8 @@ void ResetGRFConfig(bool defaults)
 
 * <li> GLC_COMPATIBLE: For one or more GRF's no exact match was found, but a
 
 *     compatible GRF with the same grfid was found and used instead
 
 * <li> GLC_NOT_FOUND: For one or more GRF's no match was found at all
 
 * </ul> */
 
 * </ul>
 
 */
 
GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig)
 
{
 
	GRFListCompatibility res = GLC_ALL_GOOD;
src/newgrf_gui.cpp
Show inline comments
 
@@ -1531,7 +1531,8 @@ static void NewGRFConfirmationCallback(W
 
 * @param show_params show information about what parameters are set for the grf files
 
 * @param exec_changes if changes are made to the list (editable is true), apply these
 
 *        changes immediately or only update the list
 
 * @param config pointer to a linked-list of grfconfig's that will be shown */
 
 * @param config pointer to a linked-list of grfconfig's that will be shown
 
 */
 
void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config)
 
{
 
	DeleteWindowByClass(WC_GAME_OPTIONS);
src/newgrf_industries.cpp
Show inline comments
 
@@ -161,7 +161,8 @@ static uint32 GetCountAndDistanceOfClose
 
 * @param variable that is queried
 
 * @param parameter unused
 
 * @param available will return false if ever the variable asked for does not exist
 
 * @return the value stored in the corresponding variable*/
 
 * @return the value stored in the corresponding variable
 
 */
 
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
 
{
 
	const Industry *industry = object->u.industry.ind;
src/newgrf_town.cpp
Show inline comments
 
@@ -19,7 +19,8 @@
 
 * @param parameter unused
 
 * @param available will return false if ever the variable asked for does not exist
 
 * @param t is of course the town we are inquiring
 
 * @return the value stored in the corresponding variable*/
 
 * @return the value stored in the corresponding variable
 
 */
 
uint32 TownGetVariable(byte variable, byte parameter, bool *available, const Town *t)
 
{
 
	switch (variable) {
src/news_gui.cpp
Show inline comments
 
@@ -45,7 +45,8 @@ static NewsItem *_latest_news = NULL;   
 
 * Forced news item.
 
 * Users can force an item by accessing the history or "last message".
 
 * If the message being shown was forced by the user, a pointer is stored
 
 * in _forced_news. Otherwise, \a _forced_news variable is NULL. */
 
 * in _forced_news. Otherwise, \a _forced_news variable is NULL.
 
 */
 
static const NewsItem *_forced_news = NULL;       ///< item the user has asked for
 

	
 
/** Current news item (last item shown regularly). */
src/openttd.cpp
Show inline comments
 
@@ -1276,7 +1276,8 @@ void StateGameLoop()
 

	
 
/**
 
 * Create an autosave. The default name is "autosave#.sav". However with
 
 * the setting 'keep_all_autosave' the name defaults to company-name + date */
 
 * the setting 'keep_all_autosave' the name defaults to company-name + date
 
 */
 
static void DoAutosave()
 
{
 
	char buf[MAX_PATH];
src/order_base.h
Show inline comments
 
@@ -314,13 +314,15 @@ public:
 

	
 
	/**
 
	 * Get number of orders in the order list.
 
	 * @return number of orders in the chain. */
 
	 * @return number of orders in the chain.
 
	 */
 
	inline VehicleOrderID GetNumOrders() const { return this->num_orders; }
 

	
 
	/**
 
	 * Insert a new order into the order chain.
 
	 * @param new_order is the order to insert into the chain.
 
	 * @param index is the position where the order is supposed to be inserted. */
 
	 * @param index is the position where the order is supposed to be inserted.
 
	 */
 
	void InsertOrderAt(Order *new_order, int index);
 

	
 
	/**
 
@@ -332,7 +334,8 @@ public:
 
	/**
 
	 * Move an order to another position within the order list.
 
	 * @param from is the zero-based position of the order to move.
 
	 * @param to is the zero-based position where the order is moved to. */
 
	 * @param to is the zero-based position where the order is moved to.
 
	 */
 
	void MoveOrder(int from, int to);
 

	
 
	/**
src/os/unix/unix.cpp
Show inline comments
 
@@ -129,7 +129,8 @@ const char *GetCurrentLocale(const char 
 
/**
 
 * Try and try to decipher the current locale from environmental
 
 * variables. MacOSX is hardcoded, other OS's are dynamic. If no suitable
 
 * locale can be found, don't do any conversion "" */
 
 * locale can be found, don't do any conversion ""
 
 */
 
static const char *GetLocalCode()
 
{
 
#if defined(__APPLE__)
 
@@ -178,7 +179,8 @@ static const char *convert_tofrom_fs(ico
 
/**
 
 * Convert from OpenTTD's encoding to that of the local environment
 
 * @param name pointer to a valid string that will be converted
 
 * @return pointer to a new stringbuffer that contains the converted string */
 
 * @return pointer to a new stringbuffer that contains the converted string
 
 */
 
const char *OTTD2FS(const char *name)
 
{
 
	static iconv_t convd = (iconv_t)(-1);
 
@@ -198,7 +200,8 @@ const char *OTTD2FS(const char *name)
 
/**
 
 * Convert to OpenTTD's encoding from that of the local environment
 
 * @param name pointer to a valid string that will be converted
 
 * @return pointer to a new stringbuffer that contains the converted string */
 
 * @return pointer to a new stringbuffer that contains the converted string
 
 */
 
const char *FS2OTTD(const char *name)
 
{
 
	static iconv_t convd = (iconv_t)(-1);
src/os/windows/win32.cpp
Show inline comments
 
@@ -44,7 +44,8 @@ bool MyShowCursor(bool show)
 
/**
 
 * Helper function needed by dynamically loading libraries
 
 * XXX: Hurray for MS only having an ANSI GetProcAddress function
 
 * on normal windows and no Wide version except for in Windows Mobile/CE */
 
 * on normal windows and no Wide version except for in Windows Mobile/CE
 
 */
 
bool LoadLibraryList(Function proc[], const char *dll)
 
{
 
	while (*dll != '\0') {
 
@@ -567,7 +568,8 @@ void CSleep(int milliseconds)
 
 * @param name pointer to a valid string that will be converted (local, or wide)
 
 * @return pointer to the converted string; if failed string is of zero-length
 
 * @see the current code-page comes from video\win32_v.cpp, event-notification
 
 * WM_INPUTLANGCHANGE */
 
 * WM_INPUTLANGCHANGE
 
 */
 
const char *FS2OTTD(const TCHAR *name)
 
{
 
	static char utf8_buf[512];
 
@@ -604,7 +606,8 @@ const char *FS2OTTD(const TCHAR *name)
 
 * @param name pointer to a valid string that will be converted (UTF8)
 
 * @return pointer to the converted string; if failed string is of zero-length
 
 * @see the current code-page comes from video\win32_v.cpp, event-notification
 
 * WM_INPUTLANGCHANGE */
 
 * WM_INPUTLANGCHANGE
 
 */
 
const TCHAR *OTTD2FS(const char *name)
 
{
 
	static TCHAR system_buf[512];
 
@@ -638,7 +641,8 @@ const TCHAR *OTTD2FS(const char *name)
 
 * @param name pointer to a valid string that will be converted
 
 * @param utf8_buf pointer to a valid buffer that will receive the converted string
 
 * @param buflen length in characters of the receiving buffer
 
 * @return pointer to utf8_buf. If conversion fails the string is of zero-length */
 
 * @return pointer to utf8_buf. If conversion fails the string is of zero-length
 
 */
 
char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen)
 
{
 
	int len = WideCharToMultiByte(CP_UTF8, 0, name, -1, utf8_buf, (int)buflen, NULL, NULL);
 
@@ -658,7 +662,8 @@ char *convert_from_fs(const wchar_t *nam
 
 * @param utf16_buf pointer to a valid wide-char buffer that will receive the
 
 * converted string
 
 * @param buflen length in wide characters of the receiving buffer
 
 * @return pointer to utf16_buf. If conversion fails the string is of zero-length */
 
 * @return pointer to utf16_buf. If conversion fails the string is of zero-length
 
 */
 
wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen)
 
{
 
	int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, (int)buflen);
 
@@ -674,7 +679,8 @@ wchar_t *convert_to_fs(const char *name,
 
 * Our very own SHGetFolderPath function for support of windows operating
 
 * systems that don't have this function (eg Win9x, etc.). We try using the
 
 * native function, and if that doesn't exist we will try a more crude approach
 
 * of environment variables and hope for the best */
 
 * of environment variables and hope for the best
 
 */
 
HRESULT OTTDSHGetFolderPath(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)
 
{
 
	static HRESULT (WINAPI *SHGetFolderPath)(HWND, int, HANDLE, DWORD, LPTSTR) = NULL;
src/pathfinder/follow_track.hpp
Show inline comments
 
@@ -24,7 +24,8 @@
 
/**
 
 * Track follower helper template class (can serve pathfinders and vehicle
 
 *  controllers). See 6 different typedefs below for 3 different transport
 
 *  types w/ or w/o 90-deg turns allowed */
 
 *  types w/ or w/o 90-deg turns allowed
 
 */
 
template <TransportType Ttr_type_, typename VehicleType, bool T90deg_turns_allowed_ = true, bool Tmask_reserved_tracks = false>
 
struct CFollowTrackT
 
{
 
@@ -113,7 +114,8 @@ struct CFollowTrackT
 

	
 
	/**
 
	 * main follower routine. Fills all members and return true on success.
 
	 *  Otherwise returns false if track can't be followed. */
 
	 *  Otherwise returns false if track can't be followed.
 
	 */
 
	inline bool Follow(TileIndex old_tile, Trackdir old_td)
 
	{
 
		m_old_tile = old_tile;
src/pathfinder/npf/queue.h
Show inline comments
 
@@ -100,7 +100,8 @@ void init_InsSort(Queue *q);
 

	
 
/**
 
 * Initializes a binary heap and allocates internal memory for maximum of
 
 * max_size elements */
 
 * max_size elements
 
 */
 
void init_BinaryHeap(Queue *q, uint max_size);
 

	
 

	
 
@@ -137,22 +138,26 @@ struct Hash {
 
/**
 
 * Deletes the value with the specified key pair from the hash and returns
 
 * that value. Returns NULL when the value was not present. The value returned
 
 * is _not_ free()'d! */
 
 * is _not_ free()'d!
 
 */
 
void *Hash_Delete(Hash *h, uint key1, uint key2);
 
/**
 
 * Sets the value associated with the given key pair to the given value.
 
 * Returns the old value if the value was replaced, NULL when it was not yet present. */
 
 * Returns the old value if the value was replaced, NULL when it was not yet present.
 
 */
 
void *Hash_Set(Hash *h, uint key1, uint key2, void *value);
 
/**
 
 * Gets the value associated with the given key pair, or NULL when it is not
 
 * present. */
 
 * present.
 
 */
 
void *Hash_Get(const Hash *h, uint key1, uint key2);
 

	
 
/* Call these function to create/destroy a hash */
 

	
 
/**
 
 * Builds a new hash in an existing struct. Make sure that hash() always
 
 * returns a hash less than num_buckets! Call delete_hash after use */
 
 * returns a hash less than num_buckets! Call delete_hash after use
 
 */
 
void init_Hash(Hash *h, Hash_HashProc *hash, uint num_buckets);
 
/**
 
 * Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash
src/pathfinder/opf/opf_ship.cpp
Show inline comments
 
@@ -181,7 +181,8 @@ bad:;
 
/**
 
 * returns the track to choose on the next tile, or -1 when it's better to
 
 * reverse. The tile given is the tile we are about to enter, enterdir is the
 
 * direction in which we are entering the tile */
 
 * direction in which we are entering the tile
 
 */
 
Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
 
{
 
	assert(IsValidDiagDirection(enterdir));
src/pathfinder/yapf/nodelist.hpp
Show inline comments
 
@@ -19,7 +19,8 @@
 
/**
 
 * Hash table based node list multi-container class.
 
 *  Implements open list, closed list and priority queue for A-star
 
 *  path finder. */
 
 *  path finder.
 
 */
 
template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
 
class CNodeList_HashTableT {
 
public:
src/pathfinder/yapf/yapf_base.hpp
Show inline comments
 
@@ -116,7 +116,8 @@ public:
 
	 *      - the destination was found
 
	 *      - or the open list is empty (no route to destination).
 
	 *      - or the maximum amount of loops reached - m_max_search_nodes (default = 10000)
 
	 * @return true if the path was found */
 
	 * @return true if the path was found
 
	 */
 
	inline bool FindPath(const VehicleType *v)
 
	{
 
		m_veh = v;
 
@@ -223,7 +224,8 @@ public:
 

	
 
	/**
 
	 * AddNewNode() - called by Tderived::PfFollowNode() for each child node.
 
	 *  Nodes are evaluated here and added into open list */
 
	 *  Nodes are evaluated here and added into open list
 
	 */
 
	void AddNewNode(Node &n, const TrackFollower &tf)
 
	{
 
		/* evaluate the node */
src/pathfinder/yapf/yapf_common.hpp
Show inline comments
 
@@ -148,7 +148,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate
 
	 */
 
	inline bool PfCalcEstimate(Node& n)
 
	{
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
@@ -179,7 +180,8 @@ public:
 
 * YAPF template that uses Ttypes template argument to determine all YAPF
 
 *  components (base classes) from which the actual YAPF is composed.
 
 *  For example classes consult: CYapfRail_TypesT template and its instantiations:
 
 *  CYapfRail1, CYapfRail2, CYapfRail3, CYapfAnyDepotRail1, CYapfAnyDepotRail2, CYapfAnyDepotRail3 */
 
 *  CYapfRail1, CYapfRail2, CYapfRail3, CYapfAnyDepotRail1, CYapfAnyDepotRail2, CYapfAnyDepotRail3
 
 */
 
template <class Ttypes>
 
class CYapfT
 
	: public Ttypes::PfBase         ///< Instance of CYapfBaseT - main YAPF loop and support base class
src/pathfinder/yapf/yapf_costcache.hpp
Show inline comments
 
@@ -28,7 +28,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	 *  @return true if globally cached data were used or false if local data was used
 
	 */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
		return false;
 
@@ -36,7 +37,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	 *  Current cache implementation doesn't use that.
 
	 */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{
 
	}
 
@@ -71,7 +73,8 @@ protected:
 
public:
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	 *  @return true if globally cached data were used or false if local data was used
 
	 */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
		CacheKey key(n.GetKey());
 
@@ -81,7 +84,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	 *  Current cache implementation doesn't use that.
 
	 */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{
 
	}
 
@@ -93,7 +97,8 @@ public:
 
 *  of track layout changes and static notification function called whenever
 
 *  the track layout changes. It is implemented as base class because it needs
 
 *  to be shared between all rail YAPF types (one shared counter, one notification
 
 *  function. */
 
 *  function.
 
 */
 
struct CSegmentCostCacheBase
 
{
 
	static int   s_rail_change_counter;
 
@@ -113,7 +118,8 @@ struct CSegmentCostCacheBase
 
 *  be always the same (TileIndex + DiagDirection) that represent the beginning
 
 *  of the segment (origin tile and exit-dir from this tile).
 
 *  Different CYapfCachedCostT types can share the same type of CSegmentCostCacheT.
 
 *  Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example */
 
 *  Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example
 
 */
 
template <class Tsegment>
 
struct CSegmentCostCacheT
 
	: public CSegmentCostCacheBase
 
@@ -203,7 +209,8 @@ protected:
 
public:
 
	/**
 
	 * Called by YAPF to attach cached or local segment cost data to the given node.
 
	 *  @return true if globally cached data were used or false if local data was used */
 
	 *  @return true if globally cached data were used or false if local data was used
 
	 */
 
	FORCEINLINE bool PfNodeCacheFetch(Node& n)
 
	{
 
		if (!Yapf().CanUseGlobalCache(n)) {
 
@@ -218,7 +225,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to flush the cached segment cost data back into cache storage.
 
	 *  Current cache implementation doesn't use that. */
 
	 *  Current cache implementation doesn't use that.
 
	 */
 
	FORCEINLINE void PfNodeCacheFlush(Node& n)
 
	{
 
	}
src/pathfinder/yapf/yapf_costrail.hpp
Show inline comments
 
@@ -279,7 +279,8 @@ public:
 
	/**
 
	 * Called by YAPF to calculate the cost from the origin to the given node.
 
	 *  Calculates only the cost of given node, adds it to the parent node cost
 
	 *  and stores the result into Node::m_cost member */
 
	 *  and stores the result into Node::m_cost member
 
	 */
 
	FORCEINLINE bool PfCalcCost(Node &n, const TrackFollower *tf)
 
	{
 
		assert(!n.flags_u.flags_s.m_targed_seen);
src/pathfinder/yapf/yapf_destrail.hpp
Show inline comments
 
@@ -65,7 +65,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate
 
	 */
 
	FORCEINLINE bool PfCalcEstimate(Node& n)
 
	{
 
		n.m_estimate = n.m_cost;
 
@@ -105,7 +106,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate. */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate.
 
	 */
 
	FORCEINLINE bool PfCalcEstimate(Node& n)
 
	{
 
		n.m_estimate = n.m_cost;
 
@@ -185,7 +187,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate
 
	 */
 
	FORCEINLINE bool PfCalcEstimate(Node& n)
 
	{
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
src/pathfinder/yapf/yapf_rail.cpp
Show inline comments
 
@@ -204,7 +204,8 @@ public:
 
	/**
 
	 * Called by YAPF to move from the given node to the next tile. For each
 
	 *  reachable trackdir on the new tile creates new node, initializes it
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n) */
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n)
 
	 */
 
	inline void PfFollowNode(Node& old_node)
 
	{
 
		TrackFollower F(Yapf().GetVehicle());
 
@@ -299,7 +300,8 @@ public:
 
	/**
 
	 * Called by YAPF to move from the given node to the next tile. For each
 
	 *  reachable trackdir on the new tile creates new node, initializes it
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n) */
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n)
 
	 */
 
	inline void PfFollowNode(Node& old_node)
 
	{
 
		TrackFollower F(Yapf().GetVehicle(), Yapf().GetCompatibleRailTypes());
 
@@ -381,7 +383,8 @@ public:
 
	/**
 
	 * Called by YAPF to move from the given node to the next tile. For each
 
	 *  reachable trackdir on the new tile creates new node, initializes it
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n) */
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n)
 
	 */
 
	inline void PfFollowNode(Node& old_node)
 
	{
 
		TrackFollower F(Yapf().GetVehicle());
src/pathfinder/yapf/yapf_road.cpp
Show inline comments
 
@@ -98,7 +98,8 @@ public:
 
	/**
 
	 * Called by YAPF to calculate the cost from the origin to the given node.
 
	 *  Calculates only the cost of given node, adds it to the parent node cost
 
	 *  and stores the result into Node::m_cost member */
 
	 *  and stores the result into Node::m_cost member
 
	 */
 
	FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
 
	{
 
		int segment_cost = 0;
 
@@ -189,7 +190,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate
 
	 */
 
	FORCEINLINE bool PfCalcEstimate(Node& n)
 
	{
 
		n.m_estimate = n.m_cost;
 
@@ -258,7 +260,8 @@ public:
 

	
 
	/**
 
	 * Called by YAPF to calculate cost estimate. Calculates distance to the destination
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
 
	 *  adds it to the actual cost from origin and stores the sum to the Node::m_estimate
 
	 */
 
	inline bool PfCalcEstimate(Node& n)
 
	{
 
		static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
 
@@ -308,7 +311,8 @@ public:
 
	/**
 
	 * Called by YAPF to move from the given node to the next tile. For each
 
	 *  reachable trackdir on the new tile creates new node, initializes it
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n) */
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n)
 
	 */
 
	inline void PfFollowNode(Node& old_node)
 
	{
 
		TrackFollower F(Yapf().GetVehicle());
src/pathfinder/yapf/yapf_ship.cpp
Show inline comments
 
@@ -35,7 +35,8 @@ public:
 
	/**
 
	 * Called by YAPF to move from the given node to the next tile. For each
 
	 *  reachable trackdir on the new tile creates new node, initializes it
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n) */
 
	 *  and adds it to the open list by calling Yapf().AddNewNode(n)
 
	 */
 
	inline void PfFollowNode(Node& old_node)
 
	{
 
		TrackFollower F(Yapf().GetVehicle());
 
@@ -119,7 +120,8 @@ public:
 
	/**
 
	 * Called by YAPF to calculate the cost from the origin to the given node.
 
	 *  Calculates only the cost of given node, adds it to the parent node cost
 
	 *  and stores the result into Node::m_cost member */
 
	 *  and stores the result into Node::m_cost member
 
	 */
 
	FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
 
	{
 
		/* base tile cost depending on distance */
src/rail.h
Show inline comments
 
@@ -101,7 +101,8 @@ enum RailFenceOffset {
 
struct RailtypeInfo {
 
	/**
 
	 * Struct containing the main sprites. @note not all sprites are listed, but only
 
	 *  the ones used directly in the code */
 
	 *  the ones used directly in the code
 
	 */
 
	struct {
 
		SpriteID track_y;      ///< single piece of rail in Y direction, with ground
 
		SpriteID track_ns;     ///< two pieces of rail in North and South corner (East-West direction)
 
@@ -119,7 +120,8 @@ struct RailtypeInfo {
 

	
 
	/**
 
	 * struct containing the sprites for the rail GUI. @note only sprites referred to
 
	 * directly in the code are listed */
 
	 * directly in the code are listed
 
	 */
 
	struct {
 
		SpriteID build_ns_rail;      ///< button for building single rail in N-S direction
 
		SpriteID build_x_rail;       ///< button for building single rail in X direction
src/rail_cmd.cpp
Show inline comments
 
@@ -2158,7 +2158,8 @@ static void DrawTrackBits(TileInfo *ti, 
 
 * according to the side it is representing.
 
 * The addtion of 2 per enum is necessary in order to "jump" over the
 
 * green state sprite, all signal sprites being in pair,
 
 * starting with the off-red state */
 
 * starting with the off-red state
 
 */
 
enum SignalOffsets {
 
	SIGNAL_TO_SOUTHWEST =  0,
 
	SIGNAL_TO_NORTHEAST =  2,
 
@@ -2720,7 +2721,8 @@ int TicksToLeaveDepot(const Train *v)
 

	
 
/**
 
 * Tile callback routine when vehicle enters tile
 
 * @see vehicle_enter_tile_proc */
 
 * @see vehicle_enter_tile_proc
 
 */
 
static VehicleEnterTileStatus VehicleEnter_Track(Vehicle *u, TileIndex tile, int x, int y)
 
{
 
	/* this routine applies only to trains in depot tiles */
src/saveload/afterload.cpp
Show inline comments
 
@@ -2159,7 +2159,8 @@ bool AfterLoadGame()
 
 * XXX - We need to reset the vehicle position hash because with a non-empty
 
 * hash AfterLoadVehicles() will loop infinitely. We need AfterLoadVehicles()
 
 * to recalculate vehicle data as some NewGRF vehicle sets could have been
 
 * removed or added and changed statistics */
 
 * removed or added and changed statistics
 
 */
 
void ReloadNewGRFData()
 
{
 
	/* reload grf data */
src/saveload/airport_sl.cpp
Show inline comments
 
@@ -16,7 +16,8 @@
 

	
 
/**
 
 * Save and load the mapping between the airport id in the AirportSpec array
 
 * and the grf file it came from. */
 
 * and the grf file it came from.
 
 */
 
static const SaveLoad _airport_id_mapping_desc[] = {
 
	SLE_VAR(EntityIDMapping, grfid,         SLE_UINT32),
 
	SLE_VAR(EntityIDMapping, entity_id,     SLE_UINT8),
src/saveload/saveload.cpp
Show inline comments
 
@@ -1252,7 +1252,8 @@ static inline bool SlIsObjectValidInSave
 
/**
 
 * Are we going to load this variable when loading a savegame or not?
 
 * @note If the variable is skipped it is skipped in the savegame
 
 * bytestream itself as well, so there is no need to skip it somewhere else */
 
 * bytestream itself as well, so there is no need to skip it somewhere else
 
 */
 
static inline bool SlSkipVariableOnLoad(const SaveLoad *sld)
 
{
 
	if ((sld->conv & SLF_NETWORK_NO) && _sl.action != SLA_SAVE && _networking && !_network_server) {
 
@@ -1893,7 +1894,7 @@ static void WriteZlibLoop(z_streamp z, b
 
		 * 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]
 
		 **/
 
		 */
 
		r = deflate(z, mode);
 

	
 
		/* bytes were emitted? */
src/saveload/saveload.h
Show inline comments
 
@@ -100,7 +100,8 @@ enum ChunkType {
 
 * SLE_FILE_* gives the size(type) as it would be in the savegame and
 
 * SLE_VAR_* the size(type) as it is in memory during runtime. These are
 
 * the first 8 bits (0-3 SLE_FILE, 4-7 SLE_VAR).
 
 * Bits 8-15 are reserved for various flags as explained below */
 
 * Bits 8-15 are reserved for various flags as explained below
 
 */
 
enum VarTypes {
 
	/* 4 bits allocated a maximum of 16 types for NumberType */
 
	SLE_FILE_I8       = 0,
 
@@ -273,7 +274,8 @@ static inline bool CheckSavegameVersion(
 

	
 
/**
 
 * Checks if some version from/to combination falls within the range of the
 
 * active savegame version */
 
 * active savegame version
 
 */
 
static inline bool SlIsObjectCurrentlyValid(uint16 version_from, uint16 version_to)
 
{
 
	extern const uint16 SAVEGAME_VERSION;
 
@@ -318,7 +320,8 @@ static inline bool IsNumericType(VarType
 
 * Get the address of the variable. Which one to pick depends on the object
 
 * pointer. If it is NULL we are dealing with global variables so the address
 
 * is taken. If non-null only the offset is stored in the union and we need
 
 * to add this to the address of the object */
 
 * to add this to the address of the object
 
 */
 
static inline void *GetVariableAddress(const void *object, const SaveLoad *sld)
 
{
 
	return (byte*)(sld->global ? NULL : object) + (ptrdiff_t)sld->address;
src/settings.cpp
Show inline comments
 
@@ -100,7 +100,8 @@ static const char * const _list_group_na
 
 * @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
 
 * @return the integer index of the full-list, or -1 if not found */
 
 * @return the integer index of the full-list, or -1 if not found
 
 */
 
static int LookupOneOfMany(const char *many, const char *one, size_t onelen = 0)
 
{
 
	const char *s;
 
@@ -128,7 +129,8 @@ static int LookupOneOfMany(const char *m
 
 * @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
 
 * @return the 'fully' set integer, or -1 if a set is not found */
 
 * @return the 'fully' set integer, or -1 if a set is not found
 
 */
 
static uint32 LookupManyOfMany(const char *many, const char *str)
 
{
 
	const char *s;
 
@@ -159,7 +161,8 @@ static uint32 LookupManyOfMany(const cha
 
 * 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
 
 * @return returns the number of items found, or -1 on an error */
 
 * @return returns the number of items found, or -1 on an error
 
 */
 
int ParseIntList(const char *p, int *items, int maxitems)
 
{
 
	int n = 0; // number of items read so far
 
@@ -203,7 +206,8 @@ int ParseIntList(const char *p, int *ite
 
 * @param array pointer to the integer-arrays that will be filled
 
 * @param nelems the number of elements the array holds. Maximum is 64 elements
 
 * @param type the type of elements the array holds (eg INT8, UINT16, etc.)
 
 * @return return true on success and false on error */
 
 * @return return true on success and false on error
 
 */
 
static bool LoadIntList(const char *str, void *array, int nelems, VarType type)
 
{
 
	int items[64];
 
@@ -244,7 +248,8 @@ static bool LoadIntList(const char *str,
 
 * @param last last item to write to in the output buffer
 
 * @param array pointer to the integer-arrays that is read from
 
 * @param nelems the number of elements the array holds.
 
 * @param type the type of elements the array holds (eg INT8, UINT16, etc.) */
 
 * @param type the type of elements the array holds (eg INT8, UINT16, etc.)
 
 */
 
static void MakeIntList(char *buf, const char *last, const void *array, int nelems, VarType type)
 
{
 
	int i, v = 0;
 
@@ -270,7 +275,8 @@ static void MakeIntList(char *buf, const
 
 * @param buf output buffer where the string-representation will be stored
 
 * @param last last item to write to in the output buffer
 
 * @param many the full-domain string of possible values
 
 * @param id the value of the variable and whose string-representation must be found */
 
 * @param id the value of the variable and whose string-representation must be found
 
 */
 
static void MakeOneOfMany(char *buf, const char *last, const char *many, int id)
 
{
 
	int orig_id = id;
 
@@ -297,7 +303,8 @@ static void MakeOneOfMany(char *buf, con
 
 * @param last last item to write to in the output buffer
 
 * @param many the full-domain string of possible values
 
 * @param x the value of the variable and whose string-representation must
 
 *        be found in the bitmasked many string */
 
 *        be found in the bitmasked many string
 
 */
 
static void MakeManyOfMany(char *buf, const char *last, const char *many, uint32 x)
 
{
 
	const char *start;
 
@@ -329,7 +336,8 @@ static void MakeManyOfMany(char *buf, co
 
 * Convert a string representation (external) of a setting to the internal rep.
 
 * @param desc SettingDesc struct that holds all information about the variable
 
 * @param orig_str input string that will be parsed based on the type of desc
 
 * @return return the parsed value of the setting */
 
 * @return return the parsed value of the setting
 
 */
 
static const void *StringToVal(const SettingDescBase *desc, const char *orig_str)
 
{
 
	const char *str = orig_str == NULL ? "" : orig_str;
 
@@ -376,7 +384,8 @@ static const void *StringToVal(const Set
 
 * @param sd pointer to the 'information'-database of the variable
 
 * @param val signed long version of the new value
 
 * @pre SettingDesc is of type SDT_BOOLX, SDT_NUMX,
 
 * SDT_ONEOFMANY or SDT_MANYOFMANY. Other types are not supported as of now */
 
 * SDT_ONEOFMANY or SDT_MANYOFMANY. Other types are not supported as of now
 
 */
 
static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
 
{
 
	const SettingDescBase *sdb = &sd->desc;
 
@@ -428,7 +437,8 @@ static void Write_ValidateSetting(void *
 
 * @param sd pointer to SettingDesc structure whose internally pointed variables will
 
 *        be given values
 
 * @param grpname the group of the IniFile to search in for the new values
 
 * @param object pointer to the object been loaded */
 
 * @param object pointer to the object been loaded
 
 */
 
static void IniLoadSettings(IniFile *ini, const SettingDesc *sd, const char *grpname, void *object)
 
{
 
	IniGroup *group;
 
@@ -1176,7 +1186,8 @@ static void HandleOldDiffCustom(bool sav
 
 * tries to convert newly introduced news settings based on old ones
 
 * @param name pointer to the string defining name of the old news config
 
 * @param value pointer to the string defining value of the old news config
 
 * @returns true if conversion could have been made */
 
 * @returns true if conversion could have been made
 
 */
 
static bool ConvertOldNewsSetting(const char *name, const char *value)
 
{
 
	if (strcasecmp(name, "openclose") == 0) {
 
@@ -1920,7 +1931,8 @@ void IConsoleListSettings(const char *pr
 
 * Save and load handler for settings
 
 * @param osd SettingDesc struct containing all information
 
 * @param object can be either NULL in which case we load global variables or
 
 * a pointer to a struct which is getting saved */
 
 * a pointer to a struct which is getting saved
 
 */
 
static void LoadSettings(const SettingDesc *osd, void *object)
 
{
 
	for (; osd->save.cmd != SL_END; osd++) {
 
@@ -1936,7 +1948,8 @@ static void LoadSettings(const SettingDe
 
 * Loadhandler for a list of global variables
 
 * @param sdg pointer for the global variable list SettingDescGlobVarList
 
 * @note this is actually a stub for LoadSettings with the
 
 * object pointer set to NULL */
 
 * object pointer set to NULL
 
 */
 
static inline void LoadSettingsGlobList(const SettingDescGlobVarList *sdg)
 
{
 
	LoadSettings((const SettingDesc*)sdg, NULL);
 
@@ -1946,7 +1959,8 @@ static inline void LoadSettingsGlobList(
 
 * Save and load handler for settings
 
 * @param sd SettingDesc struct containing all information
 
 * @param object can be either NULL in which case we load global variables or
 
 * a pointer to a struct which is getting saved */
 
 * a pointer to a struct which is getting saved
 
 */
 
static void SaveSettings(const SettingDesc *sd, void *object)
 
{
 
	/* We need to write the CH_RIFF header, but unfortunately can't call
 
@@ -1967,7 +1981,8 @@ static void SaveSettings(const SettingDe
 
/**
 
 * Savehandler for a list of global variables
 
 * @note this is actually a stub for SaveSettings with the
 
 * object pointer set to NULL */
 
 * object pointer set to NULL
 
 */
 
static inline void SaveSettingsGlobList(const SettingDescGlobVarList *sdg)
 
{
 
	SaveSettings((const SettingDesc*)sdg, NULL);
src/settings_internal.h
Show inline comments
 
@@ -20,7 +20,8 @@
 
 * Convention/Type of settings. This is then further specified if necessary
 
 * with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
 
 * @see VarTypes
 
 * @see SettingDescBase */
 
 * @see SettingDescBase
 
 */
 
enum SettingDescTypeLong {
 
	/* 4 bytes allocated a maximum of 16 types for GenericType */
 
	SDT_BEGIN       = 0,
src/ship_cmd.cpp
Show inline comments
 
@@ -377,7 +377,8 @@ static void ShipArrivesAt(const Vehicle 
 
/**
 
 * returns the track to choose on the next tile, or -1 when it's better to
 
 * reverse. The tile given is the tile we are about to enter, enterdir is the
 
 * direction in which we are entering the tile */
 
 * direction in which we are entering the tile
 
 */
 
static Track ChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
 
{
 
	assert(IsValidDiagDirection(enterdir));
src/smallmap_gui.cpp
Show inline comments
 
@@ -65,7 +65,8 @@ static int _smallmap_industry_count; ///
 

	
 
/**
 
 * Macro for break marker in arrays of LegendAndColour.
 
 * It will have valid data, though */
 
 * It will have valid data, though
 
 */
 
#define MS(a, b) {a, b, {INVALID_INDUSTRYTYPE}, true, false, true}
 

	
 
/** Structure for holding relevant data for legends in small map */
 
@@ -152,7 +153,8 @@ static const LegendAndColour _legend_lan
 

	
 
/**
 
 * 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 indutry slots all filled up
 
 */
 
static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES + 1];
 
/* For connecting industry type to position in industries list(small map legend) */
 
static uint _industry_to_list_pos[NUM_INDUSTRYTYPES];
src/sortlist_type.h
Show inline comments
 
@@ -252,7 +252,8 @@ public:
 
	 *
 
	 * @param compare The function to compare two list items
 
	 * @return true if the list sequence has been altered
 
	 * */
 
	 *
 
	 */
 
	bool Sort(SortFunction *compare)
 
	{
 
		/* Do not sort if the resort bit is not set */
src/sound/allegro_s.cpp
Show inline comments
 
@@ -46,7 +46,8 @@ void SoundDriver_Allegro::MainLoop()
 

	
 
/**
 
 * There are multiple modules that might be using Allegro and
 
 * Allegro can only be initiated once. */
 
 * Allegro can only be initiated once.
 
 */
 
extern int _allegro_instance_count;
 

	
 
const char *SoundDriver_Allegro::Start(const char * const *parm)
src/spritecache.cpp
Show inline comments
 
@@ -407,7 +407,8 @@ void IncreaseSpriteLRU()
 

	
 
/**
 
 * Called when holes in the sprite cache should be removed.
 
 * That is accomplished by moving the cached data. */
 
 * That is accomplished by moving the cached data.
 
 */
 
static void CompactSpriteCache()
 
{
 
	MemBlock *s;
 
@@ -530,7 +531,8 @@ static void *AllocSprite(size_t mem_req)
 
 * @param requested requested sprite type
 
 * @param sc the currently known sprite cache for the requested sprite
 
 * @return fallback sprite
 
 * @note this function will do usererror() in the case the fallback sprite isn't available */
 
 * @note this function will do usererror() in the case the fallback sprite isn't available
 
 */
 
static void *HandleInvalidSpriteRequest(SpriteID sprite, SpriteType requested, SpriteCache *sc)
 
{
 
	static const char * const sprite_types[] = {
src/station.cpp
Show inline comments
 
@@ -142,7 +142,8 @@ RoadStop *Station::GetPrimaryRoadStop(co
 

	
 
/**
 
 * Called when new facility is built on the station. If it is the first facility
 
 * it initializes also 'xy' and 'random_bits' members */
 
 * it initializes also 'xy' and 'random_bits' members
 
 */
 
void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
 
{
 
	if (this->facilities == FACIL_NONE) {
src/station_gui.cpp
Show inline comments
 
@@ -1281,7 +1281,7 @@ static bool AddNearbyStation(TileIndex t
 
 * @param distant_join Search for adjacent stations (false) or stations fully
 
 *                     within station spread
 
 * @tparam T the type of station to look for
 
 **/
 
 */
 
template <class T>
 
static const T *FindStationsNearby(TileArea ta, bool distant_join)
 
{
src/strgen/strgen.cpp
Show inline comments
 
@@ -1194,7 +1194,8 @@ 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 */
 
 * does not already end with a seperator
 
 */
 
static inline char *mkpath(char *buf, size_t buflen, const char *path, const char *file)
 
{
 
	ttd_strlcpy(buf, path, buflen); // copy directory into buffer
src/string.cpp
Show inline comments
 
@@ -193,7 +193,8 @@ void str_strip_colours(char *str)
 
 * needed, look to r7271 where it was removed because it was broken when
 
 * using certain locales: eg in Turkish the uppercase 'I' was converted to
 
 * '?', so just revert to the old functionality
 
 * @param str string to convert */
 
 * @param str string to convert
 
 */
 
void strtolower(char *str)
 
{
 
	for (; *str != '\0'; str++) *str = tolower(*str);
 
@@ -296,7 +297,8 @@ int CDECL seprintf(char *str, const char
 
 * @param buf buffer to put the md5sum into
 
 * @param last last character of buffer (usually lastof(buf))
 
 * @param md5sum the md5sum itself
 
 * @return a pointer to the next character after the md5sum */
 
 * @return a pointer to the next character after the md5sum
 
 */
 
char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16])
 
{
 
	char *p = buf;
src/strings.cpp
Show inline comments
 
@@ -1387,7 +1387,8 @@ bool ReadLanguagePack(int lang_index)
 
 * and if none exist return the value for $LANG
 
 * @param param environment variable to check conditionally if default ones are not
 
 *        set. Pass NULL if you don't want additional checks.
 
 * @return return string containing current charset, or NULL if not-determinable */
 
 * @return return string containing current charset, or NULL if not-determinable
 
 */
 
const char *GetCurrentLocale(const char *param)
 
{
 
	const char *env;
src/table/airporttiles.h
Show inline comments
 
@@ -19,7 +19,8 @@
 

	
 
/**
 
 * All default airport tiles.
 
 * @see AirportTiles for a list of names. */
 
 * @see AirportTiles for a list of names.
 
 */
 
static const AirportTileSpec _origin_airporttile_specs[] = {
 
	/* 0..9 */
 
	AT_NOANIM,
src/table/elrail_data.h
Show inline comments
 
@@ -9,14 +9,16 @@
 

	
 
/**
 
 * @file elrail_data.h Stores all the data for overhead wire and pylon drawing.
 
 *  @see elrail.c */
 
 *  @see elrail.c
 
 */
 

	
 
#ifndef ELRAIL_DATA_H
 
#define ELRAIL_DATA_H
 

	
 
/**
 
 * Tile Location group.
 
 * This defines whether the X and or Y coordinate of a tile is even */
 
 * This defines whether the X and or Y coordinate of a tile is even
 
 */
 
enum TLG {
 
	XEVEN_YEVEN = 0,
 
	XEVEN_YODD  = 1,
 
@@ -28,7 +30,8 @@ enum TLG {
 
/**
 
 * When determining the pylon configuration on the edge, two tiles are taken
 
 * into account: the tile being drawn itself (the home tile, the one in
 
 * ti->tile), and the neighbouring tile */
 
 * ti->tile), and the neighbouring tile
 
 */
 
enum TileSource {
 
	TS_HOME      = 0,
 
	TS_NEIGHBOUR = 1,
 
@@ -49,7 +52,8 @@ static const byte AllowedPPPonPCP[DIAGDI
 
/**
 
 * Which of the PPPs are inside the tile. For the two PPPs on the tile border
 
 * the following system is used: if you rotate the PCP so that it is in the
 
 * north, the eastern PPP belongs to the tile. */
 
 * north, the eastern PPP belongs to the tile.
 
 */
 
static const byte OwnedPPPonPCP[DIAGDIR_END] = {
 
	1 << DIR_SE | 1 << DIR_S  | 1 << DIR_SW | 1 << DIR_W,
 
	1 << DIR_N  | 1 << DIR_SW | 1 << DIR_W  | 1 << DIR_NW,
 
@@ -72,7 +76,8 @@ static const DiagDirection PCPpositions[
 
 * Preferred points of each trackbit. Those are the ones perpendicular to the
 
 * track, plus the point in extension of the track (to mark end-of-track). PCPs
 
 * which are not on either end of the track are fully preferred.
 
 * @see PCPpositions */
 
 * @see PCPpositions
 
 */
 
static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
 
	{    // X
 
		1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE
 
@@ -114,7 +119,8 @@ static const byte PreferredPPPofTrackAtP
 
/**
 
 * In case we have a staight 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. */
 
 * we have exactly two PPPs.
 
 */
 
static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
 
	{   // Ignore group 1, X and Y tracks
 
		{     // X even, Y even
src/table/industry_land.h
Show inline comments
 
@@ -45,7 +45,8 @@ struct DrawIndustryCoordinates {
 
 * @param h height of the sprite
 
 * @param dz virtual height of the sprite
 
 * @param p this allows to specify a special drawing procedure.
 
 * @see DrawBuildingsTileStruct */
 
 * @see DrawBuildingsTileStruct
 
 */
 
#define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w, h, dz, p }
 

	
 
/** Structure for industry tiles drawing */
src/table/sprites.h
Show inline comments
 
@@ -1455,7 +1455,8 @@ enum Modifiers {
 
/**
 
 * Masks needed for sprite operations.
 
 * @note Do not modify this enum. Alter SpriteSetup instead
 
 * @see SpriteSetup */
 
 * @see SpriteSetup
 
 */
 
enum SpriteMasks {
 
	/** Maximum number of sprites that can be loaded at a given time. */
 
	MAX_SPRITES = 1 << SPRITE_WIDTH,
src/table/town_land.h
Show inline comments
 
@@ -21,7 +21,8 @@
 
 * @param h the height of the sprite
 
 * @param dz the virtual height of the sprite
 
 * @param p set to 1 if a lift is present ()
 
 * @see DrawBuildingsTileStruct */
 
 * @see DrawBuildingsTileStruct
 
 */
 
#define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w, h, dz, p}
 

	
 
/** structure of houses graphics*/
 
@@ -1828,7 +1829,8 @@ static const HouseSpec _original_house_s
 
	 * +-building_flags   |    |    |                                               |    |    |    |    |
 
	 * +-building_availability |    |                                               |    |    |    |    |
 
	 * +-cargoID accepted |    |    |                                               |    |    |    |    |
 
	 * |   |         |    |    |    |                                               |    |    |    |    | */
 
	 * |   |         |    |    |    |                                               |    |    |    |    |
 
	 */
 
	MS(1963, MAX_YEAR, 187, 150, STR_TOWN_BUILDING_NAME_TALL_OFFICE_BLOCK_1,      140,  70,   8,   3,   4,
 
	   TILE_SIZE_1x1,
 
	   HZ_TEMP | HZ_ZON5,
src/terraform_gui.cpp
Show inline comments
 
@@ -95,7 +95,7 @@ static void GenerateRockyArea(TileIndex 
 
 * @return Returns true if the action was found and handled, and false otherwise. This
 
 * allows for additional implements that are more local. For example X_Y drag
 
 * of convertrail which belongs in rail_gui.cpp and not terraform_gui.cpp
 
 **/
 
 */
 
bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile)
 
{
 
	if (!_settings_game.construction.freeform_edges) {
 
@@ -590,7 +590,8 @@ static OnButtonClick * const _editor_ter
 
/**
 
 * Callback function for the scenario editor 'reset landscape' confirmation window
 
 * @param w Window unused
 
 * @param confirmed boolean value, true when yes was clicked, false otherwise */
 
 * @param confirmed boolean value, true when yes was clicked, false otherwise
 
 */
 
static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
 
{
 
	if (confirmed) {
src/tgp.cpp
Show inline comments
 
@@ -206,7 +206,8 @@ static const int TGP_FREQUENCY_MAX = 6;
 

	
 
/**
 
 * Noise amplitudes (multiplied by 1024)
 
 * - indexed by "smoothness setting" and log2(frequency) */
 
 * - indexed by "smoothness setting" and log2(frequency)
 
 */
 
static const amplitude_t _amplitudes_by_smoothness_and_frequency[4][TGP_FREQUENCY_MAX + 1] = {
 
	/* lowest frequncy....  ...highest (every corner) */
 
	/* Very smooth */
 
@@ -842,7 +843,8 @@ static void HeightMapSmoothSlopes(height
 
 *  - water level adjusting
 
 *  - coast Smoothing
 
 *  - slope Smoothing
 
 *  - height histogram redistribution by sine wave transform */
 
 *  - height histogram redistribution by sine wave transform
 
 */
 
static void HeightMapNormalize()
 
{
 
	const amplitude_t water_percent = _water_percent[_settings_game.difficulty.quantity_sea_lakes];
src/tile_cmd.h
Show inline comments
 
@@ -135,7 +135,8 @@ typedef CommandCost TerraformTileProc(Ti
 

	
 
/**
 
 * Set of callback functions for performing tile operations of a given tile type.
 
 * @see TileType */
 
 * @see TileType
 
 */
 
struct TileTypeProcs {
 
	DrawTileProc *draw_tile_proc;                  ///< Called to render the tile and its contents to the screen
 
	GetSlopeZProc *get_slope_z_proc;
src/tile_map.cpp
Show inline comments
 
@@ -17,7 +17,8 @@
 
 * Return the slope of a given tile
 
 * @param tile Tile to compute slope of
 
 * @param h    If not \c NULL, pointer to storage of z height
 
 * @return Slope of the tile, except for the HALFTILE part */
 
 * @return Slope of the tile, except for the HALFTILE part
 
 */
 
Slope GetTileSlope(TileIndex tile, uint *h)
 
{
 
	assert(tile < MapSize());
 
@@ -62,7 +63,8 @@ Slope GetTileSlope(TileIndex tile, uint 
 
/**
 
 * Get bottom height of the tile
 
 * @param tile Tile to compute height of
 
 * @return Minimum height of the tile */
 
 * @return Minimum height of the tile
 
 */
 
uint GetTileZ(TileIndex tile)
 
{
 
	if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
 
@@ -78,7 +80,8 @@ uint GetTileZ(TileIndex tile)
 
/**
 
 * Get top height of the tile
 
 * @param t Tile to compute height of
 
 * @return Maximum height of the tile */
 
 * @return Maximum height of the tile
 
 */
 
uint GetTileMaxZ(TileIndex t)
 
{
 
	if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;
src/town.h
Show inline comments
 
@@ -166,7 +166,8 @@ enum TownRatingCheckType {
 
/**
 
 * This is the number of ticks between towns being processed for building new
 
 * houses or roads. This value originally came from the size of the town array
 
 * in TTD. */
 
 * in TTD.
 
 */
 
static const byte TOWN_GROWTH_FREQUENCY = 70;
 

	
 
/**
src/town_cmd.cpp
Show inline comments
 
@@ -2017,7 +2017,7 @@ static inline bool TownLayoutAllows2x2Ho
 
 * @param maxz all tiles should have the same height
 
 * @param noslope are slopes forbidden?
 
 * @param second diagdir from first tile to second tile
 
 **/
 
 */
 
static bool CheckTownBuild2House(TileIndex *tile, Town *t, uint maxz, bool noslope, DiagDirection second)
 
{
 
	/* 'tile' is already checked in BuildTownHouse() - CanBuildHouseHere() and slope test */
 
@@ -2042,7 +2042,7 @@ static bool CheckTownBuild2House(TileInd
 
 * @param t town
 
 * @param maxz all tiles should have the same height
 
 * @param noslope are slopes forbidden?
 
 **/
 
 */
 
static bool CheckTownBuild2x2House(TileIndex *tile, Town *t, uint maxz, bool noslope)
 
{
 
	TileIndex tile2 = *tile;
 
@@ -2628,7 +2628,8 @@ static void UpdateTownGrowRate(Town *t)
 

	
 
	/**
 
	 * Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the
 
	 * number of times towns are processed before a new building is built. */
 
	 * number of times towns are processed before a new building is built.
 
	 */
 
	static const uint16 _grow_count_values[2][6] = {
 
		{ 120, 120, 120, 100,  80,  60 }, // Fund new buildings has been activated
 
		{ 320, 420, 300, 220, 160, 100 }  // Normal values
src/train_cmd.cpp
Show inline comments
 
@@ -1970,7 +1970,8 @@ CommandCost CmdRefitRailVehicle(TileInde
 

	
 
/**
 
 * returns the tile of a depot to goto to. The given vehicle must not be
 
 * crashed! */
 
 * crashed!
 
 */
 
static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
 
{
 
	assert(!(v->vehstatus & VS_CRASHED));
src/unmovable_cmd.cpp
Show inline comments
 
@@ -42,7 +42,7 @@
 
 * @param type of unmovable (which is the index in _original_unmovable)
 
 * @pre type < UNMOVABLE_MAX
 
 * @return a pointer to the corresponding unmovable spec
 
 **/
 
 */
 
static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type)
 
{
 
	assert(type < UNMOVABLE_MAX);
src/vehicle.cpp
Show inline comments
 
@@ -1211,7 +1211,8 @@ void MarkSingleVehicleDirty(const Vehicl
 
/**
 
 * Get position information of a vehicle when moving one pixel in the direction it is facing
 
 * @param v Vehicle to move
 
 * @return Position information after the move */
 
 * @return Position information after the move
 
 */
 
GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v)
 
{
 
	static const int8 _delta_coord[16] = {
src/video/allegro_v.cpp
Show inline comments
 
@@ -408,7 +408,8 @@ static void PollEvent()
 

	
 
/**
 
 * There are multiple modules that might be using Allegro and
 
 * Allegro can only be initiated once. */
 
 * Allegro can only be initiated once.
 
 */
 
int _allegro_instance_count = 0;
 

	
 
const char *VideoDriver_Allegro::Start(const char * const *parm)
src/video/dedicated_v.cpp
Show inline comments
 
@@ -42,7 +42,8 @@
 

	
 
/**
 
 * Switches OpenTTD to a console app at run-time, instead of a PM app
 
 * Necessary to see stdout, etc. */
 
 * Necessary to see stdout, etc.
 
 */
 
static void OS2_SwitchToConsoleMode()
 
{
 
	PPIB pib;
src/viewport.cpp
Show inline comments
 
@@ -365,7 +365,8 @@ ViewPort *IsPtInWindowViewport(const Win
 
 * @param vp  Viewport that contains the (\a x, \a y) screen coordinate
 
 * @param x   Screen x coordinate
 
 * @param y   Screen y coordinate
 
 * @return Tile coordinate */
 
 * @return Tile coordinate
 
 */
 
static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
 
{
 
	Point pt;
 
@@ -456,7 +457,8 @@ Point GetTileZoomCenterWindow(bool in, W
 
 * @param w Window pointer to the window that has the zoom buttons
 
 * @param vp pointer to the viewport whose zoom-level the buttons represent
 
 * @param widget_zoom_in widget index for window with zoom-in button
 
 * @param widget_zoom_out widget index for window with zoom-out button */
 
 * @param widget_zoom_out widget index for window with zoom-out button
 
 */
 
void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out)
 
{
 
	w->SetWidgetDisabledState(widget_zoom_in, vp->zoom == ZOOM_LVL_MIN);
 
@@ -1426,7 +1428,8 @@ void ViewportDoDraw(const ViewPort *vp, 
 

	
 
/**
 
 * Make sure we don't draw a too big area at a time.
 
 * If we do, the sprite memory will overflow. */
 
 * If we do, the sprite memory will overflow.
 
 */
 
static void ViewportDrawChk(const ViewPort *vp, int left, int top, int right, int bottom)
 
{
 
	if (ScaleByZoom(bottom - top, vp->zoom) * ScaleByZoom(right - left, vp->zoom) > 180000) {
 
@@ -2089,7 +2092,8 @@ void VpSetPlaceSizingLimit(int limit)
 
/**
 
 * Highlights all tiles between a set of two tiles. Used in dock and tunnel placement
 
 * @param from TileIndex of the first tile to highlight
 
 * @param to TileIndex of the last tile to highlight */
 
 * @param to TileIndex of the last tile to highlight
 
 */
 
void VpSetPresizeRange(TileIndex from, TileIndex to)
 
{
 
	uint64 distance = DistanceManhattan(from, to) + 1;
 
@@ -2112,7 +2116,8 @@ static void VpStartPreSizing()
 

	
 
/**
 
 * returns information about the 2x1 piece to be build.
 
 * The lower bits (0-3) are the track type. */
 
 * The lower bits (0-3) are the track type.
 
 */
 
static HighLightStyle Check2x1AutoRail(int mode)
 
{
 
	int fxpy = _tile_fract_coords.x + _tile_fract_coords.y;
 
@@ -2155,7 +2160,8 @@ static HighLightStyle Check2x1AutoRail(i
 
 * @param style HighLightStyle dragging style
 
 * @param start_tile start tile of drag
 
 * @param end_tile end tile of drag
 
 * @return boolean value which when true means start/end should be swapped */
 
 * @return boolean value which when true means start/end should be swapped
 
 */
 
static bool SwapDirection(HighLightStyle style, TileIndex start_tile, TileIndex end_tile)
 
{
 
	uint start_x = TileX(start_tile);
 
@@ -2511,7 +2517,8 @@ static void CalcRaildirsDrawstyle(TileHi
 
 * @param x X coordinate of end of selection
 
 * @param y Y coordinate of end of selection
 
 * @param method modifies the way tiles are selected. Possible
 
 * methods are VPM_* in viewport.h */
 
 * methods are VPM_* in viewport.h
 
 */
 
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
 
{
 
	int sx, sy;
src/viewport_type.h
Show inline comments
 
@@ -84,7 +84,8 @@ DECLARE_ENUM_AS_BIT_SET(ViewportPlaceMet
 

	
 
/**
 
 * Drag and drop selection process, or, what to do with an area of land when
 
 * you've selected it. */
 
 * you've selected it.
 
 */
 
enum ViewportDragDropSelectionProcess {
 
	DDSP_DEMOLISH_AREA,        ///< Clear area
 
	DDSP_RAISE_AND_LEVEL_AREA, ///< Raise / level area
src/widget_type.h
Show inline comments
 
@@ -221,7 +221,8 @@ FORCEINLINE void NWidgetBase::StoreSizeP
 

	
 
/**
 
 * Base class for a resizable nested widget.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetResizeBase : public NWidgetBase {
 
public:
 
	NWidgetResizeBase(WidgetType tp, uint fill_x, uint fill_y);
 
@@ -260,7 +261,8 @@ DECLARE_ENUM_AS_BIT_SET(NWidgetDisplay)
 

	
 
/**
 
 * Base class for a 'real' widget.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetCore : public NWidgetResizeBase {
 
public:
 
	NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint16 widget_data, StringID tool_tip);
 
@@ -318,7 +320,8 @@ inline bool NWidgetCore::IsDisabled() co
 

	
 
/**
 
 * Baseclass for container widgets.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetContainer : public NWidgetBase {
 
public:
 
	NWidgetContainer(WidgetType tp);
 
@@ -403,7 +406,8 @@ protected:
 

	
 
/**
 
 * Horizontal container.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetHorizontal : public NWidgetPIPContainer {
 
public:
 
	NWidgetHorizontal(NWidContainerFlags flags = NC_NONE);
 
@@ -414,7 +418,8 @@ public:
 

	
 
/**
 
 * Horizontal container that doesn't change the direction of the widgets for RTL languages.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetHorizontalLTR : public NWidgetHorizontal {
 
public:
 
	NWidgetHorizontalLTR(NWidContainerFlags flags = NC_NONE);
 
@@ -424,7 +429,8 @@ public:
 

	
 
/**
 
 * Vertical container.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetVertical : public NWidgetPIPContainer {
 
public:
 
	NWidgetVertical(NWidContainerFlags flags = NC_NONE);
 
@@ -436,7 +442,8 @@ public:
 

	
 
/**
 
 * Spacer widget.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetSpacer : public NWidgetResizeBase {
 
public:
 
	NWidgetSpacer(int length, int height);
 
@@ -451,7 +458,8 @@ public:
 

	
 
/**
 
 * Nested widget with a child.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetBackground : public NWidgetCore {
 
public:
 
	NWidgetBackground(WidgetType tp, Colours colour, int index, NWidgetPIPContainer *child = NULL);
 
@@ -481,7 +489,8 @@ private:
 
 * If the #display_flags field contains the #ND_NO_TRANSPARENCY bit, the viewport will disable transparency.
 
 * Shading to grey-scale is controlled with the #ND_SHADE_GREY bit (used for B&W news papers), the #ND_SHADE_DIMMED gives dimmed colours (for colour news papers).
 
 * @todo Class derives from #NWidgetCore, but does not use #colour, #widget_data, or #tool_tip.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetViewport : public NWidgetCore {
 
public:
 
	NWidgetViewport(int index);
 
@@ -496,7 +505,8 @@ public:
 

	
 
/**
 
 * Leaf widget.
 
 * @ingroup NestedWidgets */
 
 * @ingroup NestedWidgets
 
 */
 
class NWidgetLeaf : public NWidgetCore {
 
public:
 
	NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip);
 
@@ -581,7 +591,8 @@ static FORCEINLINE uint ComputeMaxSize(u
 

	
 
/**
 
 * Widget part for storing data and tooltip information.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPartDataTip {
 
	uint16 data;      ///< Data value of the widget.
 
	StringID tooltip; ///< Tooltip of the widget.
 
@@ -589,7 +600,8 @@ struct NWidgetPartDataTip {
 

	
 
/**
 
 * Widget part for storing basic widget information.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPartWidget {
 
	Colours colour; ///< Widget colour.
 
	int16 index;    ///< Widget index in the widget array.
 
@@ -597,21 +609,24 @@ struct NWidgetPartWidget {
 

	
 
/**
 
 * Widget part for storing padding.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPartPaddings {
 
	uint8 top, right, bottom, left; ///< Paddings for all directions.
 
};
 

	
 
/**
 
 * Widget part for storing pre/inter/post spaces.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPartPIP {
 
	uint8 pre, inter, post; ///< Amount of space before/between/after child widgets.
 
};
 

	
 
/**
 
 * Widget part for storing minimal text line data.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPartTextLines {
 
	uint8 lines;   ///< Number of text lines.
 
	uint8 spacing; ///< Extra spacing around lines.
 
@@ -628,7 +643,8 @@ typedef NWidgetBase *NWidgetFunctionType
 

	
 
/**
 
 * Partial widget specification to allow NWidgets to be written nested.
 
 * @ingroup NestedWidgetParts */
 
 * @ingroup NestedWidgetParts
 
 */
 
struct NWidgetPart {
 
	WidgetType type;                         ///< Type of the part. @see NWidgetPartType.
 
	union {
src/window.cpp
Show inline comments
 
@@ -764,7 +764,8 @@ restart_search:
 
 * Delete all windows of a company. We identify windows of a company
 
 * by looking at the caption colour. If it is equal to the company ID
 
 * then we say the window belongs to the company and should be deleted
 
 * @param id company identifier */
 
 * @param id company identifier
 
 */
 
void DeleteCompanyWindows(CompanyID id)
 
{
 
	Window *w;
 
@@ -789,7 +790,8 @@ restart_search:
 
 * company in the case of a company merger. Do not change ownership of windows
 
 * that need to be deleted once takeover is complete
 
 * @param old_owner original owner of the window
 
 * @param new_owner the new owner of the window */
 
 * @param new_owner the new owner of the window
 
 */
 
void ChangeWindowOwner(Owner old_owner, Owner new_owner)
 
{
 
	Window *w;
 
@@ -822,7 +824,8 @@ static void BringWindowToFront(Window *w
 
 * The window gets unshaded if it was shaded, and a white border is drawn at its edges for a brief period of time to visualize its "activation".
 
 * @param cls WindowClass of the window to activate
 
 * @param number WindowNumber of the window to activate
 
 * @return a pointer to the window thus activated */
 
 * @return a pointer to the window thus activated
 
 */
 
Window *BringWindowToFrontById(WindowClass cls, WindowNumber number)
 
{
 
	Window *w = FindWindowById(cls, number);
 
@@ -1322,7 +1325,8 @@ Window::Window() : hscroll(false), vscro
 
 * at the topmost window, obviously and work our way down to the bottom
 
 * @param x position x to query
 
 * @param y position y to query
 
 * @return a pointer to the found window if any, NULL otherwise */
 
 * @return a pointer to the found window if any, NULL otherwise
 
 */
 
Window *FindWindowFromPt(int x, int y)
 
{
 
	Window *w;
 
@@ -1932,7 +1936,8 @@ static EventState HandleViewportScroll()
 
 * The function will return false when a child window of this window is a
 
 * modal-popup; function returns a false and child window gets a white border
 
 * @param w Window to bring on-top
 
 * @return false if the window has an active modal child, true otherwise */
 
 * @return false if the window has an active modal child, true otherwise
 
 */
 
static bool MaybeBringWindowToFront(Window *w)
 
{
 
	bool bring_to_front = false;
 
@@ -2564,7 +2569,8 @@ restart_search:
 
 * 'close' button is outside the gaming area. You cannot close it then; except
 
 * with this function. It closes all windows calling the standard function,
 
 * then, does a little hacked loop of closing all stickied windows. Note
 
 * that standard windows (status bar, etc.) are not stickied, so these aren't affected */
 
 * that standard windows (status bar, etc.) are not stickied, so these aren't affected
 
 */
 
void DeleteAllNonVitalWindows()
 
{
 
	Window *w;
0 comments (0 inline, 0 general)