(svn r20286) -Codechange: Unify end of doxygen comments.

pull/155/head
frosch 14 years ago
parent 971691b691
commit c18839704b

@ -218,7 +218,7 @@ public:
/** /**
* Keep all items with this value. * Keep all items with this value.
* @param value the value to keep. * @param value the value to keep.
**/ */
void KeepValue(int32 value); void KeepValue(int32 value);
/** /**

@ -9,7 +9,8 @@
/** /**
* @file aircraft_cmd.cpp * @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 "stdafx.h"
#include "aircraft.h" #include "aircraft.h"
@ -73,7 +74,8 @@ void Aircraft::UpdateDeltaXY(Direction direction)
/** /**
* this maps the terminal to its corresponding state and block flag * 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_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}; 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 Aircraft *v)
/** /**
* Check if given vehicle has a goto hangar in his orders * Check if given vehicle has a goto hangar in his orders
* @param v vehicle to inquiry * @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) static bool HaveHangarInOrderList(Aircraft *v)
{ {
const Order *order; const Order *order;

@ -230,7 +230,8 @@ AirportFTAClass::~AirportFTAClass()
/** /**
* Get the number of elements of a source Airport state automata * Get the number of elements of a source Airport state automata
* Since it is actually just a big array of AirportFTA types, we only * 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) static uint16 AirportGetNofElements(const AirportFTAbuildup *apFA)
{ {
uint16 nofelements = 0; uint16 nofelements = 0;
@ -249,7 +250,8 @@ static uint16 AirportGetNofElements(const AirportFTAbuildup *apFA)
/** /**
* We calculate the terminal/helipod count based on the data passed to us * 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 * 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) static byte AirportGetTerminalCount(const byte *terminals, byte *groups)
{ {
byte nof_terminals = 0; byte nof_terminals = 0;

@ -20,7 +20,8 @@ INSTANTIATE_POOL_METHODS(EngineRenew)
/** /**
* Retrieves the EngineRenew that specifies the replacement of the given * 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) static EngineRenew *GetEngineReplacement(EngineRenewList erl, EngineID engine, GroupID group)
{ {
EngineRenew *er = (EngineRenew *)erl; EngineRenew *er = (EngineRenew *)erl;

@ -81,7 +81,8 @@ struct MakeEnumPropsT {
* compiler type - checking causes errors like: * compiler type - checking causes errors like:
* 'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when * '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 * 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; template <typename Tenum_t> struct TinyEnumT;
/** The general declaration of TinyEnumT<> (above) */ /** The general declaration of TinyEnumT<> (above) */

@ -62,7 +62,7 @@ CurrencySpec _currency_specs[NUM_CURRENCY];
* out of the TTDPatch_To_OTTDIndex array that will follow * out of the TTDPatch_To_OTTDIndex array that will follow
* Every currency used by Ottd is there, just in case TTDPatch will * Every currency used by Ottd is there, just in case TTDPatch will
* add those missing in its code * add those missing in its code
**/ */
enum Currencies { enum Currencies {
CURR_GBP, CURR_GBP,
CURR_USD, CURR_USD,
@ -99,7 +99,7 @@ enum Currencies {
* compared to TTDPatch's ones. * compared to TTDPatch's ones.
* When a grf sends currencies, they are based on the order defined by TTDPatch. * When a grf sends currencies, they are based on the order defined by TTDPatch.
* So, we must reindex them to our own order. * So, we must reindex them to our own order.
**/ */
const byte TTDPatch_To_OTTDIndex[] = const byte TTDPatch_To_OTTDIndex[] =
{ {
CURR_GBP, CURR_GBP,
@ -130,7 +130,7 @@ const byte TTDPatch_To_OTTDIndex[] =
* Only called from newgrf.cpp * Only called from newgrf.cpp
* @param grfcurr_id currency id coming from newgrf * @param grfcurr_id currency id coming from newgrf
* @return the corrected index * @return the corrected index
**/ */
byte GetNewgrfCurrencyIdConverted(byte grfcurr_id) byte GetNewgrfCurrencyIdConverted(byte grfcurr_id)
{ {
return (grfcurr_id >= lengthof(TTDPatch_To_OTTDIndex)) ? grfcurr_id : TTDPatch_To_OTTDIndex[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 * Verify if the currency chosen by the user is about to be converted to Euro
**/ */
void CheckSwitchToEuro() void CheckSwitchToEuro()
{ {
if (_currency_specs[_settings_game.locale.currency].to_euro != CF_NOEURO && 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 * if ever it is flagged to true. In which case, the total size of the memory to move
* will be one currency spec less, thus preserving the custom curreny from been * will be one currency spec less, thus preserving the custom curreny from been
* overwritten. * overwritten.
**/ */
void ResetCurrencies(bool preserve_custom) void ResetCurrencies(bool preserve_custom)
{ {
memcpy(&_currency_specs, &origin_currency_specs, sizeof(origin_currency_specs) - (preserve_custom ? sizeof(_custom_currency) : 0)); memcpy(&_currency_specs, &origin_currency_specs, sizeof(origin_currency_specs) - (preserve_custom ? sizeof(_custom_currency) : 0));

@ -161,7 +161,8 @@ static void TrainDepotMoveVehicle(const Vehicle *wagon, VehicleID sel, const Veh
/** /**
* Array containing the cell size in pixels of the #DEPOT_WIDGET_MATRIX widget for each vehicle type. * 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 Dimension _base_block_sizes[4];
static void InitBlocksizeForShipAircraft(VehicleType type) static void InitBlocksizeForShipAircraft(VehicleType type)
@ -197,7 +198,8 @@ static void InitBlocksizeForShipAircraft(VehicleType type)
/** /**
* 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. * 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() void InitDepotWindowBlockSizes()
{ {
_base_block_sizes[VEH_TRAIN].width = 0; _base_block_sizes[VEH_TRAIN].width = 0;

@ -131,7 +131,8 @@ static void DisasterVehicleUpdateImage(DisasterVehicle *v)
/** /**
* Initialize a disaster vehicle. These vehicles are of type VEH_DISASTER, are unclickable * 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) static void InitializeDisasterVehicle(DisasterVehicle *v, int x, int y, byte z, Direction direction, byte subtype)
{ {
v->x_pos = x; v->x_pos = x;
@ -674,7 +675,8 @@ typedef void DisasterInitProc();
/** /**
* Zeppeliner which crashes on a small airport if one found, * 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() static void Disaster_Zeppeliner_Init()
{ {
if (!Vehicle::CanAllocateItem(2)) return; 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 * 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() static void Disaster_Small_Ufo_Init()
{ {
if (!Vehicle::CanAllocateItem(2)) return; 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 * 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() static void Disaster_CoalMine_Init()
{ {
int index = GB(Random(), 0, 4); int index = GB(Random(), 0, 4);

@ -162,7 +162,8 @@ Money CalculateCompanyValue(const Company *c, bool including_loan)
* @param update the economy with calculated score * @param update the economy with calculated score
* @param c company been evaluated * @param c company been evaluated
* @return actual score of this company * @return actual score of this company
* */ *
*/
int UpdateCompanyRatingAndValue(Company *c, bool update) int UpdateCompanyRatingAndValue(Company *c, bool update)
{ {
Owner owner = c->index; Owner owner = c->index;

@ -15,7 +15,8 @@
* *
* After that it outputs the contents of an include files (endian.h) * After that it outputs the contents of an include files (endian.h)
* that says or TTD_LITTLE_ENDIAN, or TTD_BIG_ENDIAN. Makefile takes * 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 <stdio.h>
#include <string.h> #include <string.h>

@ -40,7 +40,8 @@ EngineOverrideManager _engine_mngr;
/** /**
* Year that engine aging stops. Engines will not reduce in reliability * 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; static Year _year_engine_aging_stops;
/** Number of engines of each vehicle type in original engine data */ /** Number of engines of each vehicle type in original engine data */

@ -698,7 +698,8 @@ static const WindowDesc _save_dialog_desc(
/** /**
* These values are used to convert the file/operations mode into a corresponding file type. * 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[] = { static const FileType _file_modetotype[] = {
FT_SAVEGAME, ///< used for SLD_LOAD_GAME FT_SAVEGAME, ///< used for SLD_LOAD_GAME
FT_SCENARIO, ///< used for SLD_LOAD_SCENARIO FT_SCENARIO, ///< used for SLD_LOAD_SCENARIO

@ -44,7 +44,8 @@ static const byte SHADOW_COLOUR = 2;
/** /**
* Get the font loaded into a Freetype face by using a font-name. * 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 #ifdef WIN32
#include <windows.h> #include <windows.h>
#include <shlobj.h> /* SHGetFolderPath */ #include <shlobj.h> /* SHGetFolderPath */

@ -970,7 +970,8 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
* but not every possible combination * but not every possible combination
* @param str string to calculate pixel-width * @param str string to calculate pixel-width
* @param start_fontsize Fontsize to start the text with * @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) Dimension GetStringBoundingBox(const char *str, FontSize start_fontsize)
{ {
FontSize size = start_fontsize; FontSize size = start_fontsize;
@ -1726,7 +1727,8 @@ void MarkWholeScreenDirty()
* offset from the calling window coordinates * offset from the calling window coordinates
* @return return false if the requested rectangle is not possible with the * @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 * 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) bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
{ {
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();

@ -220,7 +220,8 @@ static const WindowDesc _endgame_desc(
/** /**
* Show the highscore table for a given difficulty. When called from * Show the highscore table for a given difficulty. When called from
* endgame ranking is set to the top5 element that was newly added * 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) void ShowHighscoreTable(int difficulty, int8 ranking)
{ {
DeleteWindowByClass(WC_HIGHSCORE); DeleteWindowByClass(WC_HIGHSCORE);
@ -229,7 +230,8 @@ void ShowHighscoreTable(int difficulty, int8 ranking)
/** /**
* Show the endgame victory screen in 2050. Update the new highscore * Show the endgame victory screen in 2050. Update the new highscore
* if it was high enough */ * if it was high enough
*/
void ShowEndGameChart() void ShowEndGameChart()
{ {
/* Dedicated server doesn't need the highscore window and neither does -v null. */ /* Dedicated server doesn't need the highscore window and neither does -v null. */

@ -20,7 +20,8 @@
/** /**
* Simple value that indicates the house has reached the final stage of * Simple value that indicates the house has reached the final stage of
* construction. */ * construction.
*/
static const byte TOWN_HOUSE_COMPLETED = 3; static const byte TOWN_HOUSE_COMPLETED = 3;
static const uint HOUSE_NO_CLASS = 0; static const uint HOUSE_NO_CLASS = 0;
@ -30,7 +31,8 @@ static const HouseID INVALID_HOUSE_ID = 0xFFFF;
/** /**
* There can only be as many classes as there are new houses, plus one for * 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; static const uint HOUSE_CLASS_MAX = HOUSE_MAX - NEW_HOUSE_OFFSET + 1;
enum BuildingFlags { enum BuildingFlags {

@ -66,7 +66,8 @@ IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES];
* This function initialize the spec arrays of both * This function initialize the spec arrays of both
* industry and industry tiles. * industry and industry tiles.
* It adjusts the enabling of the industry too, based on climate availability. * 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() void ResetIndustries()
{ {
memset(&_industry_specs, 0, sizeof(_industry_specs)); memset(&_industry_specs, 0, sizeof(_industry_specs));
@ -93,7 +94,7 @@ void ResetIndustries()
* @param tile that is queried * @param tile that is queried
* @pre IsTileType(tile, MP_INDUSTRY) * @pre IsTileType(tile, MP_INDUSTRY)
* @return general type for this industry, as defined in industry.h * @return general type for this industry, as defined in industry.h
**/ */
IndustryType GetIndustryType(TileIndex tile) IndustryType GetIndustryType(TileIndex tile)
{ {
assert(IsTileType(tile, MP_INDUSTRY)); assert(IsTileType(tile, MP_INDUSTRY));
@ -110,7 +111,7 @@ IndustryType GetIndustryType(TileIndex tile)
* @param thistype of industry (which is the index in _industry_specs) * @param thistype of industry (which is the index in _industry_specs)
* @pre thistype < NUM_INDUSTRYTYPES * @pre thistype < NUM_INDUSTRYTYPES
* @return a pointer to the corresponding industry spec * @return a pointer to the corresponding industry spec
**/ */
const IndustrySpec *GetIndustrySpec(IndustryType thistype) const IndustrySpec *GetIndustrySpec(IndustryType thistype)
{ {
assert(thistype < NUM_INDUSTRYTYPES); assert(thistype < NUM_INDUSTRYTYPES);
@ -124,7 +125,7 @@ const IndustrySpec *GetIndustrySpec(IndustryType thistype)
* @param gfx of industrytile (which is the index in _industry_tile_specs) * @param gfx of industrytile (which is the index in _industry_tile_specs)
* @pre gfx < INVALID_INDUSTRYTILE * @pre gfx < INVALID_INDUSTRYTILE
* @return a pointer to the corresponding industrytile spec * @return a pointer to the corresponding industrytile spec
**/ */
const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx) const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx)
{ {
assert(gfx < INVALID_INDUSTRYTILE); assert(gfx < INVALID_INDUSTRYTILE);
@ -1535,7 +1536,8 @@ static CommandCost CheckIfFarEnoughFromConflictingIndustry(TileIndex tile, int t
/** /**
* Production level maximum, minimum and default values. * Production level maximum, minimum and default values.
* It is not a value been really used in order to change, but rather an indicator * 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 { enum ProductionLevels {
PRODLEVEL_CLOSURE = 0x00, ///< signal set to actually close the industry PRODLEVEL_CLOSURE = 0x00, ///< signal set to actually close the industry
PRODLEVEL_MINIMUM = 0x04, ///< below this level, the industry is set to be closing PRODLEVEL_MINIMUM = 0x04, ///< below this level, the industry is set to be closing

@ -48,7 +48,8 @@ extern const TileTypeProcs
/** /**
* Tile callback functions for each type of tile. * Tile callback functions for each type of tile.
* @ingroup TileCallbackGroup * @ingroup TileCallbackGroup
* @see TileType */ * @see TileType
*/
const TileTypeProcs * const _tile_type_procs[16] = { const TileTypeProcs * const _tile_type_procs[16] = {
&_tile_type_clear_procs, ///< Callback functions for MP_CLEAR tiles &_tile_type_clear_procs, ///< Callback functions for MP_CLEAR tiles
&_tile_type_rail_procs, ///< Callback functions for MP_RAILWAY tiles &_tile_type_rail_procs, ///< Callback functions for MP_RAILWAY tiles
@ -75,7 +76,8 @@ extern const byte _slope_to_sprite_offset[32] = {
* If it is \c NULL, a static snowline height is used, as set by \c _settings_game.game_creation.snow_line. * 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 * Otherwise it points to a table loaded from a newGRF file, that describes the variable snowline
* @ingroup SnowLineGroup * @ingroup SnowLineGroup
* @see GetSnowLine() GameCreationSettings */ * @see GetSnowLine() GameCreationSettings
*/
static SnowLine *_snow_line = NULL; static SnowLine *_snow_line = NULL;
/** /**

@ -20,7 +20,8 @@ static const uint SNOW_LINE_DAYS = 32; ///< Number of days in each month in th
/** /**
* Structure describing the height of the snow line each day of the year * Structure describing the height of the snow line each day of the year
* @ingroup SnowLineGroup */ * @ingroup SnowLineGroup
*/
struct SnowLine { struct SnowLine {
byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]; ///< Height of the snow line each day of the year 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 byte highest_value; ///< Highest snow line of the year

@ -17,7 +17,8 @@
/** /**
* Flexible array with size limit. Implemented as fixed size * 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> template <class T, uint B = 1024, uint N = B>
class SmallArray { class SmallArray {
protected: protected:

@ -105,7 +105,8 @@ protected:
/** /**
* Return header pointer to the static BlobHeader with * Return header pointer to the static BlobHeader with
* both items and capacity containing zero */ * both items and capacity containing zero
*/
static FORCEINLINE BlobHeader *Zero() static FORCEINLINE BlobHeader *Zero()
{ {
return const_cast<BlobHeader *>(&ByteBlob::hdrEmpty[1]); return const_cast<BlobHeader *>(&ByteBlob::hdrEmpty[1]);
@ -235,7 +236,8 @@ public:
/** /**
* Reallocate if there is no free space for num_bytes bytes. * 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) FORCEINLINE byte *Prepare(size_t num_bytes)
{ {
size_t new_size = Length() + num_bytes; size_t new_size = Length() + num_bytes;
@ -245,7 +247,8 @@ public:
/** /**
* Increase Length() by num_bytes. * 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) FORCEINLINE byte *Append(size_t num_bytes)
{ {
byte *pNewData = Prepare(num_bytes); byte *pNewData = Prepare(num_bytes);
@ -297,7 +300,8 @@ public:
* 1. When adding new item(s) it automatically grows capacity if needed. * 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. * 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). * 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> template <typename T>
class CBlobT : public ByteBlob { class CBlobT : public ByteBlob {
/* make template arguments public: */ /* 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 * 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) FORCEINLINE T *MakeFreeSpace(size_t num_items)
{ {
return (T*)base::Prepare(num_items * type_size); return (T*)base::Prepare(num_items * type_size);

@ -18,7 +18,8 @@
* fixed size array * fixed size array
* Upon construction it preallocates fixed size block of memory * Upon construction it preallocates fixed size block of memory
* for all items, but doesn't construct them. Item's construction * for all items, but doesn't construct them. Item's construction
* is delayed. */ * is delayed.
*/
template <class T, uint C> template <class T, uint C>
struct FixedSizeArray { struct FixedSizeArray {
protected: protected:
@ -35,7 +36,8 @@ protected:
/** /**
* the only member of fixed size array is pointer to the block * 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; T *data;
/** return reference to the array header (non-const) */ /** return reference to the array header (non-const) */

@ -139,7 +139,8 @@ public:
protected: protected:
/** /**
* each slot contains pointer to the first item in the list, * 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; typedef CHashTableSlotT<Titem_> Slot;
Slot *m_slots; // here we store our data (array of blobs) Slot *m_slots; // here we store our data (array of blobs)

@ -1096,7 +1096,8 @@ bool MoveTextBufferPos(Textbuf *tb, int navmode)
* @param maxsize maximum size in bytes, including terminating '\0' * @param maxsize maximum size in bytes, including terminating '\0'
* @param maxwidth maximum length in pixels of this buffer. If reached, buffer * @param maxwidth maximum length in pixels of this buffer. If reached, buffer
* cannot grow, even if maxsize would allow because there is space. Width * 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) void InitializeTextBuffer(Textbuf *tb, char *buf, uint16 maxsize, uint16 maxwidth)
{ {
assert(maxsize != 0); assert(maxsize != 0);

@ -21,7 +21,8 @@ static MIDI *_midi = NULL;
/** /**
* There are multiple modules that might be using Allegro and * 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; extern int _allegro_instance_count;
const char *MusicDriver_Allegro::Start(const char * const *param) const char *MusicDriver_Allegro::Start(const char * const *param)

@ -37,7 +37,8 @@ struct Packet {
/** /**
* The size of the whole packet for received packets. For packets * The size of the whole packet for received packets. For packets
* that will be sent, the value is filled in just before the * that will be sent, the value is filled in just before the
* actual transmission. */ * actual transmission.
*/
PacketSize size; PacketSize size;
/** The current read/write position in the packet */ /** The current read/write position in the packet */
PacketSize pos; PacketSize pos;

@ -477,7 +477,8 @@ static void CheckPauseOnJoin()
* *
* connection_string will be re-terminated to seperate out the hostname, and company and port will * 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 * 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) void ParseConnectionString(const char **company, const char **port, char *connection_string)
{ {
bool ipv6 = (strchr(connection_string, ':') != strrchr(connection_string, ':')); bool ipv6 = (strchr(connection_string, ':') != strrchr(connection_string, ':'));

@ -72,7 +72,8 @@ static void NetworkGameListHandleDelayedInsert()
* return the existing item instead of adding it again * return the existing item instead of adding it again
* @param address the address of the to-be added item * @param address the address of the to-be added item
* @param port the port the server is running on * @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) NetworkGameList *NetworkGameListAddItem(NetworkAddress address)
{ {
const char *hostname = address.GetHostname(); const char *hostname = address.GetHostname();
@ -110,7 +111,8 @@ NetworkGameList *NetworkGameListAddItem(NetworkAddress address)
/** /**
* Remove an item from the gamelist linked list * 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) void NetworkGameListRemoveItem(NetworkGameList *remove)
{ {
NetworkGameList *prev_item = NULL; NetworkGameList *prev_item = NULL;

@ -67,7 +67,8 @@ void SortNetworkLanguages()
/** /**
* Update the network new window because a new server is * Update the network new window because a new server is
* found on the network. * found on the network.
* @param unselect unselect the currently selected item */ * @param unselect unselect the currently selected item
*/
void UpdateNetworkGameWindow(bool unselect) void UpdateNetworkGameWindow(bool unselect)
{ {
InvalidateWindowData(WC_NETWORK_WINDOW, 0, unselect ? 1 : 0); InvalidateWindowData(WC_NETWORK_WINDOW, 0, unselect ? 1 : 0);
@ -283,7 +284,8 @@ protected:
/** /**
* Sort servers by the amount of clients online on a * Sort servers by the amount of clients online on a
* server. If the two servers have the same amount, the one with the * 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) static int CDECL NGameClientSorter(NetworkGameList * const *a, NetworkGameList * const *b)
{ {
/* Reverse as per default we are interested in most-clients first */ /* 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 * 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) 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) */ /* The servers we do not know anything about (the ones that did not reply) should be at the bottom) */

@ -1773,7 +1773,7 @@ void NetworkServerUpdateCompanyPassworded(CompanyID company_id, bool passworded)
* @param client_id id of the client we want to move. * @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. * @param company_id id of the company we want to move the client to.
* @return void * @return void
**/ */
void NetworkServerDoMove(ClientID client_id, CompanyID company_id) void NetworkServerDoMove(ClientID client_id, CompanyID company_id)
{ {
/* Only allow non-dedicated servers and normal clients to be moved */ /* Only allow non-dedicated servers and normal clients to be moved */

@ -230,7 +230,8 @@ static GRFLineToSpriteOverride _grf_line_to_action6_sprite_override;
* loading/parsing grf files, not for runtime debug messages as there * loading/parsing grf files, not for runtime debug messages as there
* is no file information available during that time. * is no file information available during that time.
* @param severity debugging severity level, see debug.h * @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, ...) void CDECL grfmsg(int severity, const char *str, ...)
{ {
char buf[1024]; char buf[1024];
@ -6797,7 +6798,8 @@ static void InitNewGRFFile(const GRFConfig *config, int sprite_offset)
/** /**
* List of what cargo labels are refittable for the given the vehicle-type. * 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[] = { static const CargoLabel _default_refitmasks_rail[] = {
'PASS', 'COAL', 'MAIL', 'LVST', 'GOOD', 'GRAI', 'WHEA', 'MAIZ', 'WOOD', 'PASS', 'COAL', 'MAIL', 'LVST', 'GOOD', 'GRAI', 'WHEA', 'MAIZ', 'WOOD',
'IORE', 'STEL', 'VALU', 'GOLD', 'DIAM', 'PAPR', 'FOOD', 'FRUT', 'CORE', '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 * 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 * 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 * 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() static void FinaliseHouseArray()
{ {
/* If there are no houses with start dates before 1930, then all houses /* 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 * 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 * 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() static void FinaliseIndustriesArray()
{ {
const GRFFile * const *end = _grf_files.End(); const GRFFile * const *end = _grf_files.End();

@ -45,7 +45,8 @@ enum CallbackID {
/** /**
* Refit capacity, the passed vehicle needs to have its ->cargo_type set to * 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 CBID_VEHICLE_REFIT_CAPACITY = 0x15, // 15 bit callback
/** Builds articulated engines for trains and RVs. */ /** 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 * 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, CBID_VEHICLE_ADDITIONAL_TEXT = 0x23,
/** Called when building a station to customize the tile layout */ /** 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 * 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 CBID_VEHICLE_COLOUR_MAPPING = 0x2D, // 15 bit callback
/** Called to determine how much cargo a town building produces. */ /** 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 * 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 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). */ /** 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 * 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 CBID_VEHICLE_MODIFY_PROPERTY = 0x36, // 8/15 bit depends on queried property
/** Called to determine text to display after cargo name */ /** Called to determine text to display after cargo name */

@ -18,7 +18,8 @@
/** /**
* List of different canal 'features'. * 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 { enum CanalFeature {
CF_WATERSLOPE, CF_WATERSLOPE,
CF_LOCKS, CF_LOCKS,

@ -294,7 +294,8 @@ void IndustryTileOverrideManager::SetEntitySpec(const IndustryTileSpec *its)
* @param tile TileIndex of the tile been queried * @param tile TileIndex of the tile been queried
* @param upper_halftile If true, query upper halftile in case of rail tiles. * @param upper_halftile If true, query upper halftile in case of rail tiles.
* @return value corresponding to the grf expected format: * @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) uint32 GetTerrainType(TileIndex tile, bool upper_halftile)
{ {
switch (_settings_game.game_creation.landscape) { switch (_settings_game.game_creation.landscape) {

@ -323,7 +323,8 @@ void ClearGRFConfigList(GRFConfig **config)
* @param dst pointer to destination list * @param dst pointer to destination list
* @param src pointer to source list values * @param src pointer to source list values
* @param init_only the copied GRF will be processed up to GLS_INIT * @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) GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only)
{ {
/* Clear destination as it will be overwritten */ /* Clear destination as it will be overwritten */
@ -388,7 +389,8 @@ void AppendStaticGRFConfigs(GRFConfig **dst)
/** /**
* Appends an element to a list of GRFs * Appends an element to a list of GRFs
* @param dst the head of the list to add to * @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) void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el)
{ {
GRFConfig **tail = dst; 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 * <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 * 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 * <li> GLC_NOT_FOUND: For one or more GRF's no match was found at all
* </ul> */ * </ul>
*/
GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig) GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig)
{ {
GRFListCompatibility res = GLC_ALL_GOOD; GRFListCompatibility res = GLC_ALL_GOOD;

@ -1531,7 +1531,8 @@ static void NewGRFConfirmationCallback(Window *w, bool confirmed)
* @param show_params show information about what parameters are set for the grf files * @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 * @param exec_changes if changes are made to the list (editable is true), apply these
* changes immediately or only update the list * 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) void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFConfig **config)
{ {
DeleteWindowByClass(WC_GAME_OPTIONS); DeleteWindowByClass(WC_GAME_OPTIONS);

@ -161,7 +161,8 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
* @param variable that is queried * @param variable that is queried
* @param parameter unused * @param parameter unused
* @param available will return false if ever the variable asked for does not exist * @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) uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
{ {
const Industry *industry = object->u.industry.ind; const Industry *industry = object->u.industry.ind;

@ -19,7 +19,8 @@
* @param parameter unused * @param parameter unused
* @param available will return false if ever the variable asked for does not exist * @param available will return false if ever the variable asked for does not exist
* @param t is of course the town we are inquiring * @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) uint32 TownGetVariable(byte variable, byte parameter, bool *available, const Town *t)
{ {
switch (variable) { switch (variable) {

@ -45,7 +45,8 @@ static NewsItem *_latest_news = NULL; ///< tail of news items queue
* Forced news item. * Forced news item.
* Users can force an item by accessing the history or "last message". * 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 * 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 static const NewsItem *_forced_news = NULL; ///< item the user has asked for
/** Current news item (last item shown regularly). */ /** Current news item (last item shown regularly). */

@ -1276,7 +1276,8 @@ void StateGameLoop()
/** /**
* Create an autosave. The default name is "autosave#.sav". However with * 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() static void DoAutosave()
{ {
char buf[MAX_PATH]; char buf[MAX_PATH];

@ -314,13 +314,15 @@ public:
/** /**
* Get number of orders in the order list. * 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; } inline VehicleOrderID GetNumOrders() const { return this->num_orders; }
/** /**
* Insert a new order into the order chain. * Insert a new order into the order chain.
* @param new_order is the order to insert into the 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); void InsertOrderAt(Order *new_order, int index);
/** /**
@ -332,7 +334,8 @@ public:
/** /**
* Move an order to another position within the order list. * Move an order to another position within the order list.
* @param from is the zero-based position of the order to move. * @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); void MoveOrder(int from, int to);
/** /**

@ -129,7 +129,8 @@ const char *GetCurrentLocale(const char *param);
/** /**
* Try and try to decipher the current locale from environmental * Try and try to decipher the current locale from environmental
* variables. MacOSX is hardcoded, other OS's are dynamic. If no suitable * 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() static const char *GetLocalCode()
{ {
#if defined(__APPLE__) #if defined(__APPLE__)
@ -178,7 +179,8 @@ static const char *convert_tofrom_fs(iconv_t convd, const char *name)
/** /**
* Convert from OpenTTD's encoding to that of the local environment * Convert from OpenTTD's encoding to that of the local environment
* @param name pointer to a valid string that will be converted * @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) const char *OTTD2FS(const char *name)
{ {
static iconv_t convd = (iconv_t)(-1); 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 * Convert to OpenTTD's encoding from that of the local environment
* @param name pointer to a valid string that will be converted * @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) const char *FS2OTTD(const char *name)
{ {
static iconv_t convd = (iconv_t)(-1); static iconv_t convd = (iconv_t)(-1);

@ -44,7 +44,8 @@ bool MyShowCursor(bool show)
/** /**
* Helper function needed by dynamically loading libraries * Helper function needed by dynamically loading libraries
* XXX: Hurray for MS only having an ANSI GetProcAddress function * 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) bool LoadLibraryList(Function proc[], const char *dll)
{ {
while (*dll != '\0') { 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) * @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 * @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 * @see the current code-page comes from video\win32_v.cpp, event-notification
* WM_INPUTLANGCHANGE */ * WM_INPUTLANGCHANGE
*/
const char *FS2OTTD(const TCHAR *name) const char *FS2OTTD(const TCHAR *name)
{ {
static char utf8_buf[512]; 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) * @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 * @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 * @see the current code-page comes from video\win32_v.cpp, event-notification
* WM_INPUTLANGCHANGE */ * WM_INPUTLANGCHANGE
*/
const TCHAR *OTTD2FS(const char *name) const TCHAR *OTTD2FS(const char *name)
{ {
static TCHAR system_buf[512]; 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 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 utf8_buf pointer to a valid buffer that will receive the converted string
* @param buflen length in characters of the receiving buffer * @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) 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); 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 *name, char *utf8_buf, size_t buflen)
* @param utf16_buf pointer to a valid wide-char buffer that will receive the * @param utf16_buf pointer to a valid wide-char buffer that will receive the
* converted string * converted string
* @param buflen length in wide characters of the receiving buffer * @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) 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); int len = MultiByteToWideChar(CP_UTF8, 0, name, -1, utf16_buf, (int)buflen);
@ -674,7 +679,8 @@ wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen)
* Our very own SHGetFolderPath function for support of windows operating * Our very own SHGetFolderPath function for support of windows operating
* systems that don't have this function (eg Win9x, etc.). We try using the * 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 * 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) HRESULT OTTDSHGetFolderPath(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR pszPath)
{ {
static HRESULT (WINAPI *SHGetFolderPath)(HWND, int, HANDLE, DWORD, LPTSTR) = NULL; static HRESULT (WINAPI *SHGetFolderPath)(HWND, int, HANDLE, DWORD, LPTSTR) = NULL;

@ -24,7 +24,8 @@
/** /**
* Track follower helper template class (can serve pathfinders and vehicle * Track follower helper template class (can serve pathfinders and vehicle
* controllers). See 6 different typedefs below for 3 different transport * 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> template <TransportType Ttr_type_, typename VehicleType, bool T90deg_turns_allowed_ = true, bool Tmask_reserved_tracks = false>
struct CFollowTrackT struct CFollowTrackT
{ {
@ -113,7 +114,8 @@ struct CFollowTrackT
/** /**
* main follower routine. Fills all members and return true on success. * 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) inline bool Follow(TileIndex old_tile, Trackdir old_td)
{ {
m_old_tile = old_tile; m_old_tile = old_tile;

@ -100,7 +100,8 @@ void init_InsSort(Queue *q);
/** /**
* Initializes a binary heap and allocates internal memory for maximum of * 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); 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 * 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 * 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); void *Hash_Delete(Hash *h, uint key1, uint key2);
/** /**
* Sets the value associated with the given key pair to the given value. * 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); 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 * 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); void *Hash_Get(const Hash *h, uint key1, uint key2);
/* Call these function to create/destroy a hash */ /* Call these function to create/destroy a hash */
/** /**
* Builds a new hash in an existing struct. Make sure that hash() always * 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); 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 * Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash

@ -181,7 +181,8 @@ bad:;
/** /**
* returns the track to choose on the next tile, or -1 when it's better to * 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 * 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) Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
{ {
assert(IsValidDiagDirection(enterdir)); assert(IsValidDiagDirection(enterdir));

@ -19,7 +19,8 @@
/** /**
* Hash table based node list multi-container class. * Hash table based node list multi-container class.
* Implements open list, closed list and priority queue for A-star * 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_> template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
class CNodeList_HashTableT { class CNodeList_HashTableT {
public: public:

@ -116,7 +116,8 @@ public:
* - the destination was found * - the destination was found
* - or the open list is empty (no route to destination). * - or the open list is empty (no route to destination).
* - or the maximum amount of loops reached - m_max_search_nodes (default = 10000) * - 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) inline bool FindPath(const VehicleType *v)
{ {
m_veh = v; m_veh = v;
@ -223,7 +224,8 @@ public:
/** /**
* AddNewNode() - called by Tderived::PfFollowNode() for each child node. * 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) void AddNewNode(Node &n, const TrackFollower &tf)
{ {
/* evaluate the node */ /* evaluate the node */

@ -148,7 +148,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) inline bool PfCalcEstimate(Node& n)
{ {
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0}; 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 * YAPF template that uses Ttypes template argument to determine all YAPF
* components (base classes) from which the actual YAPF is composed. * components (base classes) from which the actual YAPF is composed.
* For example classes consult: CYapfRail_TypesT template and its instantiations: * 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> template <class Ttypes>
class CYapfT class CYapfT
: public Ttypes::PfBase ///< Instance of CYapfBaseT - main YAPF loop and support base class : public Ttypes::PfBase ///< Instance of CYapfBaseT - main YAPF loop and support base class

@ -28,7 +28,8 @@ public:
/** /**
* Called by YAPF to attach cached or local segment cost data to the given node. * 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) FORCEINLINE bool PfNodeCacheFetch(Node& n)
{ {
return false; return false;
@ -36,7 +37,8 @@ public:
/** /**
* Called by YAPF to flush the cached segment cost data back into cache storage. * 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) FORCEINLINE void PfNodeCacheFlush(Node& n)
{ {
} }
@ -71,7 +73,8 @@ protected:
public: public:
/** /**
* Called by YAPF to attach cached or local segment cost data to the given node. * 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) FORCEINLINE bool PfNodeCacheFetch(Node& n)
{ {
CacheKey key(n.GetKey()); CacheKey key(n.GetKey());
@ -81,7 +84,8 @@ public:
/** /**
* Called by YAPF to flush the cached segment cost data back into cache storage. * 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) FORCEINLINE void PfNodeCacheFlush(Node& n)
{ {
} }
@ -93,7 +97,8 @@ public:
* of track layout changes and static notification function called whenever * of track layout changes and static notification function called whenever
* the track layout changes. It is implemented as base class because it needs * 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 * to be shared between all rail YAPF types (one shared counter, one notification
* function. */ * function.
*/
struct CSegmentCostCacheBase struct CSegmentCostCacheBase
{ {
static int s_rail_change_counter; static int s_rail_change_counter;
@ -113,7 +118,8 @@ struct CSegmentCostCacheBase
* be always the same (TileIndex + DiagDirection) that represent the beginning * be always the same (TileIndex + DiagDirection) that represent the beginning
* of the segment (origin tile and exit-dir from this tile). * of the segment (origin tile and exit-dir from this tile).
* Different CYapfCachedCostT types can share the same type of CSegmentCostCacheT. * 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> template <class Tsegment>
struct CSegmentCostCacheT struct CSegmentCostCacheT
: public CSegmentCostCacheBase : public CSegmentCostCacheBase
@ -203,7 +209,8 @@ protected:
public: public:
/** /**
* Called by YAPF to attach cached or local segment cost data to the given node. * 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) FORCEINLINE bool PfNodeCacheFetch(Node& n)
{ {
if (!Yapf().CanUseGlobalCache(n)) { if (!Yapf().CanUseGlobalCache(n)) {
@ -218,7 +225,8 @@ public:
/** /**
* Called by YAPF to flush the cached segment cost data back into cache storage. * 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) FORCEINLINE void PfNodeCacheFlush(Node& n)
{ {
} }

@ -279,7 +279,8 @@ public:
/** /**
* Called by YAPF to calculate the cost from the origin to the given node. * 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 * 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) FORCEINLINE bool PfCalcCost(Node &n, const TrackFollower *tf)
{ {
assert(!n.flags_u.flags_s.m_targed_seen); assert(!n.flags_u.flags_s.m_targed_seen);

@ -65,7 +65,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) FORCEINLINE bool PfCalcEstimate(Node& n)
{ {
n.m_estimate = n.m_cost; n.m_estimate = n.m_cost;
@ -105,7 +106,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) FORCEINLINE bool PfCalcEstimate(Node& n)
{ {
n.m_estimate = n.m_cost; n.m_estimate = n.m_cost;
@ -185,7 +187,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) FORCEINLINE bool PfCalcEstimate(Node& n)
{ {
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0}; static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};

@ -204,7 +204,8 @@ public:
/** /**
* Called by YAPF to move from the given node to the next tile. For each * 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 * 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) inline void PfFollowNode(Node& old_node)
{ {
TrackFollower F(Yapf().GetVehicle()); TrackFollower F(Yapf().GetVehicle());
@ -299,7 +300,8 @@ public:
/** /**
* Called by YAPF to move from the given node to the next tile. For each * 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 * 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) inline void PfFollowNode(Node& old_node)
{ {
TrackFollower F(Yapf().GetVehicle(), Yapf().GetCompatibleRailTypes()); 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 * 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 * 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) inline void PfFollowNode(Node& old_node)
{ {
TrackFollower F(Yapf().GetVehicle()); TrackFollower F(Yapf().GetVehicle());

@ -98,7 +98,8 @@ public:
/** /**
* Called by YAPF to calculate the cost from the origin to the given node. * 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 * 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) FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
{ {
int segment_cost = 0; int segment_cost = 0;
@ -189,7 +190,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) FORCEINLINE bool PfCalcEstimate(Node& n)
{ {
n.m_estimate = n.m_cost; n.m_estimate = n.m_cost;
@ -258,7 +260,8 @@ public:
/** /**
* Called by YAPF to calculate cost estimate. Calculates distance to the destination * 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) inline bool PfCalcEstimate(Node& n)
{ {
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0}; 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 * 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 * 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) inline void PfFollowNode(Node& old_node)
{ {
TrackFollower F(Yapf().GetVehicle()); TrackFollower F(Yapf().GetVehicle());

@ -35,7 +35,8 @@ public:
/** /**
* Called by YAPF to move from the given node to the next tile. For each * 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 * 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) inline void PfFollowNode(Node& old_node)
{ {
TrackFollower F(Yapf().GetVehicle()); TrackFollower F(Yapf().GetVehicle());
@ -119,7 +120,8 @@ public:
/** /**
* Called by YAPF to calculate the cost from the origin to the given node. * 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 * 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) FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
{ {
/* base tile cost depending on distance */ /* base tile cost depending on distance */

@ -101,7 +101,8 @@ enum RailFenceOffset {
struct RailtypeInfo { struct RailtypeInfo {
/** /**
* Struct containing the main sprites. @note not all sprites are listed, but only * 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 { struct {
SpriteID track_y; ///< single piece of rail in Y direction, with ground 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) 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 * 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 { struct {
SpriteID build_ns_rail; ///< button for building single rail in N-S direction 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 SpriteID build_x_rail; ///< button for building single rail in X direction

@ -2158,7 +2158,8 @@ static void DrawTrackBits(TileInfo *ti, TrackBits track)
* according to the side it is representing. * according to the side it is representing.
* The addtion of 2 per enum is necessary in order to "jump" over the * The addtion of 2 per enum is necessary in order to "jump" over the
* green state sprite, all signal sprites being in pair, * green state sprite, all signal sprites being in pair,
* starting with the off-red state */ * starting with the off-red state
*/
enum SignalOffsets { enum SignalOffsets {
SIGNAL_TO_SOUTHWEST = 0, SIGNAL_TO_SOUTHWEST = 0,
SIGNAL_TO_NORTHEAST = 2, SIGNAL_TO_NORTHEAST = 2,
@ -2720,7 +2721,8 @@ int TicksToLeaveDepot(const Train *v)
/** /**
* Tile callback routine when vehicle enters tile * 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) static VehicleEnterTileStatus VehicleEnter_Track(Vehicle *u, TileIndex tile, int x, int y)
{ {
/* this routine applies only to trains in depot tiles */ /* this routine applies only to trains in depot tiles */

@ -2159,7 +2159,8 @@ bool AfterLoadGame()
* XXX - We need to reset the vehicle position hash because with a non-empty * XXX - We need to reset the vehicle position hash because with a non-empty
* hash AfterLoadVehicles() will loop infinitely. We need AfterLoadVehicles() * hash AfterLoadVehicles() will loop infinitely. We need AfterLoadVehicles()
* to recalculate vehicle data as some NewGRF vehicle sets could have been * 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() void ReloadNewGRFData()
{ {
/* reload grf data */ /* reload grf data */

@ -16,7 +16,8 @@
/** /**
* Save and load the mapping between the airport id in the AirportSpec array * 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[] = { static const SaveLoad _airport_id_mapping_desc[] = {
SLE_VAR(EntityIDMapping, grfid, SLE_UINT32), SLE_VAR(EntityIDMapping, grfid, SLE_UINT32),
SLE_VAR(EntityIDMapping, entity_id, SLE_UINT8), SLE_VAR(EntityIDMapping, entity_id, SLE_UINT8),

@ -1252,7 +1252,8 @@ static inline bool SlIsObjectValidInSavegame(const SaveLoad *sld)
/** /**
* Are we going to load this variable when loading a savegame or not? * 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 * @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) static inline bool SlSkipVariableOnLoad(const SaveLoad *sld)
{ {
if ((sld->conv & SLF_NETWORK_NO) && _sl.action != SLA_SAVE && _networking && !_network_server) { if ((sld->conv & SLF_NETWORK_NO) && _sl.action != SLA_SAVE && _networking && !_network_server) {
@ -1893,7 +1894,7 @@ static void WriteZlibLoop(z_streamp z, byte *p, size_t len, int mode)
* According to the author of zlib it is not a bug and it won't be fixed. * 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 * http://groups.google.com/group/comp.compression/browse_thread/thread/b154b8def8c2a3ef/cdf9b8729ce17ee2
* [Mark Adler, Feb 24 2004, 'zlib-1.2.1 valgrind warnings' in the newgroup comp.compression] * [Mark Adler, Feb 24 2004, 'zlib-1.2.1 valgrind warnings' in the newgroup comp.compression]
**/ */
r = deflate(z, mode); r = deflate(z, mode);
/* bytes were emitted? */ /* bytes were emitted? */

@ -100,7 +100,8 @@ enum ChunkType {
* SLE_FILE_* gives the size(type) as it would be in the savegame and * 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 * 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). * 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 { enum VarTypes {
/* 4 bits allocated a maximum of 16 types for NumberType */ /* 4 bits allocated a maximum of 16 types for NumberType */
SLE_FILE_I8 = 0, SLE_FILE_I8 = 0,
@ -273,7 +274,8 @@ static inline bool CheckSavegameVersion(uint16 version)
/** /**
* Checks if some version from/to combination falls within the range of the * 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) static inline bool SlIsObjectCurrentlyValid(uint16 version_from, uint16 version_to)
{ {
extern const uint16 SAVEGAME_VERSION; extern const uint16 SAVEGAME_VERSION;
@ -318,7 +320,8 @@ static inline bool IsNumericType(VarType conv)
* Get the address of the variable. Which one to pick depends on the object * 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 * 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 * 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) static inline void *GetVariableAddress(const void *object, const SaveLoad *sld)
{ {
return (byte*)(sld->global ? NULL : object) + (ptrdiff_t)sld->address; return (byte*)(sld->global ? NULL : object) + (ptrdiff_t)sld->address;

@ -100,7 +100,8 @@ static const char * const _list_group_names[] = {
* @param many full domain of values the ONEofMANY setting can have * @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 one the current value of the setting for which a value needs found
* @param onelen force calculation of the *one parameter * @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) static int LookupOneOfMany(const char *many, const char *one, size_t onelen = 0)
{ {
const char *s; const char *s;
@ -128,7 +129,8 @@ static int LookupOneOfMany(const char *many, const char *one, size_t onelen = 0)
* @param many full domain of values the MANYofMANY setting can have * @param many full domain of values the MANYofMANY setting can have
* @param str the current string value of the setting, each individual * @param str the current string value of the setting, each individual
* of seperated by a whitespace,tab or | character * 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) static uint32 LookupManyOfMany(const char *many, const char *str)
{ {
const char *s; const char *s;
@ -159,7 +161,8 @@ static uint32 LookupManyOfMany(const char *many, const char *str)
* comma or a space character * comma or a space character
* @param items pointer to the integerlist-array that will be filled with values * @param items pointer to the integerlist-array that will be filled with values
* @param maxitems the maximum number of elements the integerlist-array has * @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 ParseIntList(const char *p, int *items, int maxitems)
{ {
int n = 0; // number of items read so far int n = 0; // number of items read so far
@ -203,7 +206,8 @@ int ParseIntList(const char *p, int *items, int maxitems)
* @param array pointer to the integer-arrays that will be filled * @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 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.) * @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) static bool LoadIntList(const char *str, void *array, int nelems, VarType type)
{ {
int items[64]; int items[64];
@ -244,7 +248,8 @@ static bool LoadIntList(const char *str, void *array, int nelems, VarType type)
* @param last last item to write to in the output buffer * @param last last item to write to in the output buffer
* @param array pointer to the integer-arrays that is read from * @param array pointer to the integer-arrays that is read from
* @param nelems the number of elements the array holds. * @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) static void MakeIntList(char *buf, const char *last, const void *array, int nelems, VarType type)
{ {
int i, v = 0; int i, v = 0;
@ -270,7 +275,8 @@ static void MakeIntList(char *buf, const char *last, const void *array, int nele
* @param buf output buffer where the string-representation will be stored * @param buf output buffer where the string-representation will be stored
* @param last last item to write to in the output buffer * @param last last item to write to in the output buffer
* @param many the full-domain string of possible values * @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) static void MakeOneOfMany(char *buf, const char *last, const char *many, int id)
{ {
int orig_id = id; int orig_id = id;
@ -297,7 +303,8 @@ static void MakeOneOfMany(char *buf, const char *last, const char *many, int id)
* @param last last item to write to in the output buffer * @param last last item to write to in the output buffer
* @param many the full-domain string of possible values * @param many the full-domain string of possible values
* @param x the value of the variable and whose string-representation must * @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) static void MakeManyOfMany(char *buf, const char *last, const char *many, uint32 x)
{ {
const char *start; const char *start;
@ -329,7 +336,8 @@ static void MakeManyOfMany(char *buf, const char *last, const char *many, uint32
* Convert a string representation (external) of a setting to the internal rep. * Convert a string representation (external) of a setting to the internal rep.
* @param desc SettingDesc struct that holds all information about the variable * @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 * @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) static const void *StringToVal(const SettingDescBase *desc, const char *orig_str)
{ {
const char *str = orig_str == NULL ? "" : orig_str; const char *str = orig_str == NULL ? "" : orig_str;
@ -376,7 +384,8 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str
* @param sd pointer to the 'information'-database of the variable * @param sd pointer to the 'information'-database of the variable
* @param val signed long version of the new value * @param val signed long version of the new value
* @pre SettingDesc is of type SDT_BOOLX, SDT_NUMX, * @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) static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
{ {
const SettingDescBase *sdb = &sd->desc; const SettingDescBase *sdb = &sd->desc;
@ -428,7 +437,8 @@ static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
* @param sd pointer to SettingDesc structure whose internally pointed variables will * @param sd pointer to SettingDesc structure whose internally pointed variables will
* be given values * be given values
* @param grpname the group of the IniFile to search in for the new 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) static void IniLoadSettings(IniFile *ini, const SettingDesc *sd, const char *grpname, void *object)
{ {
IniGroup *group; IniGroup *group;
@ -1176,7 +1186,8 @@ static void HandleOldDiffCustom(bool savegame)
* tries to convert newly introduced news settings based on old ones * 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 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 * @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) static bool ConvertOldNewsSetting(const char *name, const char *value)
{ {
if (strcasecmp(name, "openclose") == 0) { if (strcasecmp(name, "openclose") == 0) {
@ -1920,7 +1931,8 @@ void IConsoleListSettings(const char *prefilter)
* Save and load handler for settings * Save and load handler for settings
* @param osd SettingDesc struct containing all information * @param osd SettingDesc struct containing all information
* @param object can be either NULL in which case we load global variables or * @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) static void LoadSettings(const SettingDesc *osd, void *object)
{ {
for (; osd->save.cmd != SL_END; osd++) { for (; osd->save.cmd != SL_END; osd++) {
@ -1936,7 +1948,8 @@ static void LoadSettings(const SettingDesc *osd, void *object)
* Loadhandler for a list of global variables * Loadhandler for a list of global variables
* @param sdg pointer for the global variable list SettingDescGlobVarList * @param sdg pointer for the global variable list SettingDescGlobVarList
* @note this is actually a stub for LoadSettings with the * @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) static inline void LoadSettingsGlobList(const SettingDescGlobVarList *sdg)
{ {
LoadSettings((const SettingDesc*)sdg, NULL); LoadSettings((const SettingDesc*)sdg, NULL);
@ -1946,7 +1959,8 @@ static inline void LoadSettingsGlobList(const SettingDescGlobVarList *sdg)
* Save and load handler for settings * Save and load handler for settings
* @param sd SettingDesc struct containing all information * @param sd SettingDesc struct containing all information
* @param object can be either NULL in which case we load global variables or * @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) static void SaveSettings(const SettingDesc *sd, void *object)
{ {
/* We need to write the CH_RIFF header, but unfortunately can't call /* We need to write the CH_RIFF header, but unfortunately can't call
@ -1967,7 +1981,8 @@ static void SaveSettings(const SettingDesc *sd, void *object)
/** /**
* Savehandler for a list of global variables * Savehandler for a list of global variables
* @note this is actually a stub for SaveSettings with the * @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) static inline void SaveSettingsGlobList(const SettingDescGlobVarList *sdg)
{ {
SaveSettings((const SettingDesc*)sdg, NULL); SaveSettings((const SettingDesc*)sdg, NULL);

@ -20,7 +20,8 @@
* Convention/Type of settings. This is then further specified if necessary * Convention/Type of settings. This is then further specified if necessary
* with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h * with the SLE_ (SLE_VAR/SLE_FILE) enums in saveload.h
* @see VarTypes * @see VarTypes
* @see SettingDescBase */ * @see SettingDescBase
*/
enum SettingDescTypeLong { enum SettingDescTypeLong {
/* 4 bytes allocated a maximum of 16 types for GenericType */ /* 4 bytes allocated a maximum of 16 types for GenericType */
SDT_BEGIN = 0, SDT_BEGIN = 0,

@ -377,7 +377,8 @@ static void ShipArrivesAt(const Vehicle *v, Station *st)
/** /**
* returns the track to choose on the next tile, or -1 when it's better to * 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 * 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) static Track ChooseShipTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
{ {
assert(IsValidDiagDirection(enterdir)); assert(IsValidDiagDirection(enterdir));

@ -65,7 +65,8 @@ static int _smallmap_industry_count; ///< Number of used industries
/** /**
* Macro for break marker in arrays of LegendAndColour. * 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} #define MS(a, b) {a, b, {INVALID_INDUSTRYTYPE}, true, false, true}
/** Structure for holding relevant data for legends in small map */ /** Structure for holding relevant data for legends in small map */
@ -152,7 +153,8 @@ static const LegendAndColour _legend_land_owners[] = {
/** /**
* Allow room for all industries, plus a terminator entry * 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]; static LegendAndColour _legend_from_industries[NUM_INDUSTRYTYPES + 1];
/* For connecting industry type to position in industries list(small map legend) */ /* For connecting industry type to position in industries list(small map legend) */
static uint _industry_to_list_pos[NUM_INDUSTRYTYPES]; static uint _industry_to_list_pos[NUM_INDUSTRYTYPES];

@ -252,7 +252,8 @@ public:
* *
* @param compare The function to compare two list items * @param compare The function to compare two list items
* @return true if the list sequence has been altered * @return true if the list sequence has been altered
* */ *
*/
bool Sort(SortFunction *compare) bool Sort(SortFunction *compare)
{ {
/* Do not sort if the resort bit is not set */ /* Do not sort if the resort bit is not set */

@ -46,7 +46,8 @@ void SoundDriver_Allegro::MainLoop()
/** /**
* There are multiple modules that might be using Allegro and * 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; extern int _allegro_instance_count;
const char *SoundDriver_Allegro::Start(const char * const *parm) const char *SoundDriver_Allegro::Start(const char * const *parm)

@ -407,7 +407,8 @@ void IncreaseSpriteLRU()
/** /**
* Called when holes in the sprite cache should be removed. * 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() static void CompactSpriteCache()
{ {
MemBlock *s; MemBlock *s;
@ -530,7 +531,8 @@ static void *AllocSprite(size_t mem_req)
* @param requested requested sprite type * @param requested requested sprite type
* @param sc the currently known sprite cache for the requested sprite * @param sc the currently known sprite cache for the requested sprite
* @return fallback 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 void *HandleInvalidSpriteRequest(SpriteID sprite, SpriteType requested, SpriteCache *sc)
{ {
static const char * const sprite_types[] = { static const char * const sprite_types[] = {

@ -142,7 +142,8 @@ RoadStop *Station::GetPrimaryRoadStop(const RoadVehicle *v) const
/** /**
* Called when new facility is built on the station. If it is the first facility * 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) void Station::AddFacility(StationFacility new_facility_bit, TileIndex facil_xy)
{ {
if (this->facilities == FACIL_NONE) { if (this->facilities == FACIL_NONE) {

@ -1281,7 +1281,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data)
* @param distant_join Search for adjacent stations (false) or stations fully * @param distant_join Search for adjacent stations (false) or stations fully
* within station spread * within station spread
* @tparam T the type of station to look for * @tparam T the type of station to look for
**/ */
template <class T> template <class T>
static const T *FindStationsNearby(TileArea ta, bool distant_join) static const T *FindStationsNearby(TileArea ta, bool distant_join)
{ {

@ -1194,7 +1194,8 @@ static inline void ottd_mkdir(const char *directory)
/** /**
* Create a path consisting of an already existing path, a possible * Create a path consisting of an already existing path, a possible
* path seperator and the filename. The seperator is only appended if the path * 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) static inline char *mkpath(char *buf, size_t buflen, const char *path, const char *file)
{ {
ttd_strlcpy(buf, path, buflen); // copy directory into buffer ttd_strlcpy(buf, path, buflen); // copy directory into buffer

@ -193,7 +193,8 @@ void str_strip_colours(char *str)
* needed, look to r7271 where it was removed because it was broken when * 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 * using certain locales: eg in Turkish the uppercase 'I' was converted to
* '?', so just revert to the old functionality * '?', so just revert to the old functionality
* @param str string to convert */ * @param str string to convert
*/
void strtolower(char *str) void strtolower(char *str)
{ {
for (; *str != '\0'; str++) *str = tolower(*str); for (; *str != '\0'; str++) *str = tolower(*str);
@ -296,7 +297,8 @@ int CDECL seprintf(char *str, const char *last, const char *format, ...)
* @param buf buffer to put the md5sum into * @param buf buffer to put the md5sum into
* @param last last character of buffer (usually lastof(buf)) * @param last last character of buffer (usually lastof(buf))
* @param md5sum the md5sum itself * @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 *md5sumToString(char *buf, const char *last, const uint8 md5sum[16])
{ {
char *p = buf; char *p = buf;

@ -1387,7 +1387,8 @@ bool ReadLanguagePack(int lang_index)
* and if none exist return the value for $LANG * and if none exist return the value for $LANG
* @param param environment variable to check conditionally if default ones are not * @param param environment variable to check conditionally if default ones are not
* set. Pass NULL if you don't want additional checks. * 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 *GetCurrentLocale(const char *param)
{ {
const char *env; const char *env;

@ -19,7 +19,8 @@
/** /**
* All default airport tiles. * All default airport tiles.
* @see AirportTiles for a list of names. */ * @see AirportTiles for a list of names.
*/
static const AirportTileSpec _origin_airporttile_specs[] = { static const AirportTileSpec _origin_airporttile_specs[] = {
/* 0..9 */ /* 0..9 */
AT_NOANIM, AT_NOANIM,

@ -9,14 +9,16 @@
/** /**
* @file elrail_data.h Stores all the data for overhead wire and pylon drawing. * @file elrail_data.h Stores all the data for overhead wire and pylon drawing.
* @see elrail.c */ * @see elrail.c
*/
#ifndef ELRAIL_DATA_H #ifndef ELRAIL_DATA_H
#define ELRAIL_DATA_H #define ELRAIL_DATA_H
/** /**
* Tile Location group. * 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 { enum TLG {
XEVEN_YEVEN = 0, XEVEN_YEVEN = 0,
XEVEN_YODD = 1, XEVEN_YODD = 1,
@ -28,7 +30,8 @@ enum TLG {
/** /**
* When determining the pylon configuration on the edge, two tiles are taken * 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 * 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 { enum TileSource {
TS_HOME = 0, TS_HOME = 0,
TS_NEIGHBOUR = 1, TS_NEIGHBOUR = 1,
@ -49,7 +52,8 @@ static const byte AllowedPPPonPCP[DIAGDIR_END] = {
/** /**
* Which of the PPPs are inside the tile. For the two PPPs on the tile border * 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 * 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] = { static const byte OwnedPPPonPCP[DIAGDIR_END] = {
1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W, 1 << DIR_SE | 1 << DIR_S | 1 << DIR_SW | 1 << DIR_W,
1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW, 1 << DIR_N | 1 << DIR_SW | 1 << DIR_W | 1 << DIR_NW,
@ -72,7 +76,8 @@ static const DiagDirection PCPpositions[TRACK_END][2] = {
* Preferred points of each trackbit. Those are the ones perpendicular to the * 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 * 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. * which are not on either end of the track are fully preferred.
* @see PCPpositions */ * @see PCPpositions
*/
static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = { static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
{ // X { // X
1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE 1 << DIR_NE | 1 << DIR_SE | 1 << DIR_NW, // NE
@ -114,7 +119,8 @@ static const byte PreferredPPPofTrackAtPCP[TRACK_END][DIAGDIR_END] = {
/** /**
* In case we have a staight line, we place pylon only every two tiles, * 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 * 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] = { static const byte IgnoredPCP[NUM_IGNORE_GROUPS][TLG_END][DIAGDIR_END] = {
{ // Ignore group 1, X and Y tracks { // Ignore group 1, X and Y tracks
{ // X even, Y even { // X even, Y even

@ -45,7 +45,8 @@ struct DrawIndustryCoordinates {
* @param h height of the sprite * @param h height of the sprite
* @param dz virtual height of the sprite * @param dz virtual height of the sprite
* @param p this allows to specify a special drawing procedure. * @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 } #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 */ /** Structure for industry tiles drawing */

@ -1455,7 +1455,8 @@ enum Modifiers {
/** /**
* Masks needed for sprite operations. * Masks needed for sprite operations.
* @note Do not modify this enum. Alter SpriteSetup instead * @note Do not modify this enum. Alter SpriteSetup instead
* @see SpriteSetup */ * @see SpriteSetup
*/
enum SpriteMasks { enum SpriteMasks {
/** Maximum number of sprites that can be loaded at a given time. */ /** Maximum number of sprites that can be loaded at a given time. */
MAX_SPRITES = 1 << SPRITE_WIDTH, MAX_SPRITES = 1 << SPRITE_WIDTH,

@ -21,7 +21,8 @@
* @param h the height of the sprite * @param h the height of the sprite
* @param dz the virtual height of the sprite * @param dz the virtual height of the sprite
* @param p set to 1 if a lift is present () * @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} #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*/ /** structure of houses graphics*/
@ -1828,7 +1829,8 @@ static const HouseSpec _original_house_specs[] = {
* +-building_flags | | | | | | | | * +-building_flags | | | | | | | |
* +-building_availability | | | | | | | * +-building_availability | | | | | | |
* +-cargoID accepted | | | | | | | | * +-cargoID accepted | | | | | | | |
* | | | | | | | | | | | */ * | | | | | | | | | | |
*/
MS(1963, MAX_YEAR, 187, 150, STR_TOWN_BUILDING_NAME_TALL_OFFICE_BLOCK_1, 140, 70, 8, 3, 4, MS(1963, MAX_YEAR, 187, 150, STR_TOWN_BUILDING_NAME_TALL_OFFICE_BLOCK_1, 140, 70, 8, 3, 4,
TILE_SIZE_1x1, TILE_SIZE_1x1,
HZ_TEMP | HZ_ZON5, HZ_TEMP | HZ_ZON5,

@ -95,7 +95,7 @@ static void GenerateRockyArea(TileIndex end, TileIndex start)
* @return Returns true if the action was found and handled, and false otherwise. This * @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 * 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 * of convertrail which belongs in rail_gui.cpp and not terraform_gui.cpp
**/ */
bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile) bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile)
{ {
if (!_settings_game.construction.freeform_edges) { if (!_settings_game.construction.freeform_edges) {
@ -590,7 +590,8 @@ static OnButtonClick * const _editor_terraform_button_proc[] = {
/** /**
* Callback function for the scenario editor 'reset landscape' confirmation window * Callback function for the scenario editor 'reset landscape' confirmation window
* @param w Window unused * @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) static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed)
{ {
if (confirmed) { if (confirmed) {

@ -206,7 +206,8 @@ static const int TGP_FREQUENCY_MAX = 6;
/** /**
* Noise amplitudes (multiplied by 1024) * 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] = { static const amplitude_t _amplitudes_by_smoothness_and_frequency[4][TGP_FREQUENCY_MAX + 1] = {
/* lowest frequncy.... ...highest (every corner) */ /* lowest frequncy.... ...highest (every corner) */
/* Very smooth */ /* Very smooth */
@ -842,7 +843,8 @@ static void HeightMapSmoothSlopes(height_t dh_max)
* - water level adjusting * - water level adjusting
* - coast Smoothing * - coast Smoothing
* - slope Smoothing * - slope Smoothing
* - height histogram redistribution by sine wave transform */ * - height histogram redistribution by sine wave transform
*/
static void HeightMapNormalize() static void HeightMapNormalize()
{ {
const amplitude_t water_percent = _water_percent[_settings_game.difficulty.quantity_sea_lakes]; const amplitude_t water_percent = _water_percent[_settings_game.difficulty.quantity_sea_lakes];

@ -135,7 +135,8 @@ typedef CommandCost TerraformTileProc(TileIndex tile, DoCommandFlag flags, uint
/** /**
* Set of callback functions for performing tile operations of a given tile type. * Set of callback functions for performing tile operations of a given tile type.
* @see TileType */ * @see TileType
*/
struct TileTypeProcs { struct TileTypeProcs {
DrawTileProc *draw_tile_proc; ///< Called to render the tile and its contents to the screen DrawTileProc *draw_tile_proc; ///< Called to render the tile and its contents to the screen
GetSlopeZProc *get_slope_z_proc; GetSlopeZProc *get_slope_z_proc;

@ -17,7 +17,8 @@
* Return the slope of a given tile * Return the slope of a given tile
* @param tile Tile to compute slope of * @param tile Tile to compute slope of
* @param h If not \c NULL, pointer to storage of z height * @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) Slope GetTileSlope(TileIndex tile, uint *h)
{ {
assert(tile < MapSize()); assert(tile < MapSize());
@ -62,7 +63,8 @@ Slope GetTileSlope(TileIndex tile, uint *h)
/** /**
* Get bottom height of the tile * Get bottom height of the tile
* @param tile Tile to compute height of * @param tile Tile to compute height of
* @return Minimum height of the tile */ * @return Minimum height of the tile
*/
uint GetTileZ(TileIndex tile) uint GetTileZ(TileIndex tile)
{ {
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0; if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) return 0;
@ -78,7 +80,8 @@ uint GetTileZ(TileIndex tile)
/** /**
* Get top height of the tile * Get top height of the tile
* @param t Tile to compute height of * @param t Tile to compute height of
* @return Maximum height of the tile */ * @return Maximum height of the tile
*/
uint GetTileMaxZ(TileIndex t) uint GetTileMaxZ(TileIndex t)
{ {
if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0; if (TileX(t) == MapMaxX() || TileY(t) == MapMaxY()) return 0;

@ -166,7 +166,8 @@ enum TownRatingCheckType {
/** /**
* This is the number of ticks between towns being processed for building new * 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 * 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; static const byte TOWN_GROWTH_FREQUENCY = 70;
/** /**

@ -2017,7 +2017,7 @@ static inline bool TownLayoutAllows2x2HouseHere(Town *t, TileIndex tile)
* @param maxz all tiles should have the same height * @param maxz all tiles should have the same height
* @param noslope are slopes forbidden? * @param noslope are slopes forbidden?
* @param second diagdir from first tile to second tile * @param second diagdir from first tile to second tile
**/ */
static bool CheckTownBuild2House(TileIndex *tile, Town *t, uint maxz, bool noslope, DiagDirection second) static bool CheckTownBuild2House(TileIndex *tile, Town *t, uint maxz, bool noslope, DiagDirection second)
{ {
/* 'tile' is already checked in BuildTownHouse() - CanBuildHouseHere() and slope test */ /* 'tile' is already checked in BuildTownHouse() - CanBuildHouseHere() and slope test */
@ -2042,7 +2042,7 @@ static bool CheckTownBuild2House(TileIndex *tile, Town *t, uint maxz, bool noslo
* @param t town * @param t town
* @param maxz all tiles should have the same height * @param maxz all tiles should have the same height
* @param noslope are slopes forbidden? * @param noslope are slopes forbidden?
**/ */
static bool CheckTownBuild2x2House(TileIndex *tile, Town *t, uint maxz, bool noslope) static bool CheckTownBuild2x2House(TileIndex *tile, Town *t, uint maxz, bool noslope)
{ {
TileIndex tile2 = *tile; TileIndex tile2 = *tile;
@ -2628,7 +2628,8 @@ static void UpdateTownGrowRate(Town *t)
/** /**
* Towns are processed every TOWN_GROWTH_FREQUENCY ticks, and this is the * 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] = { static const uint16 _grow_count_values[2][6] = {
{ 120, 120, 120, 100, 80, 60 }, // Fund new buildings has been activated { 120, 120, 120, 100, 80, 60 }, // Fund new buildings has been activated
{ 320, 420, 300, 220, 160, 100 } // Normal values { 320, 420, 300, 220, 160, 100 } // Normal values

@ -1970,7 +1970,8 @@ CommandCost CmdRefitRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1,
/** /**
* returns the tile of a depot to goto to. The given vehicle must not be * 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) static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
{ {
assert(!(v->vehstatus & VS_CRASHED)); assert(!(v->vehstatus & VS_CRASHED));

@ -42,7 +42,7 @@
* @param type of unmovable (which is the index in _original_unmovable) * @param type of unmovable (which is the index in _original_unmovable)
* @pre type < UNMOVABLE_MAX * @pre type < UNMOVABLE_MAX
* @return a pointer to the corresponding unmovable spec * @return a pointer to the corresponding unmovable spec
**/ */
static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type) static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type)
{ {
assert(type < UNMOVABLE_MAX); assert(type < UNMOVABLE_MAX);

@ -1211,7 +1211,8 @@ void MarkSingleVehicleDirty(const Vehicle *v)
/** /**
* Get position information of a vehicle when moving one pixel in the direction it is facing * Get position information of a vehicle when moving one pixel in the direction it is facing
* @param v Vehicle to move * @param v Vehicle to move
* @return Position information after the move */ * @return Position information after the move
*/
GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v) GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v)
{ {
static const int8 _delta_coord[16] = { static const int8 _delta_coord[16] = {

@ -408,7 +408,8 @@ static void PollEvent()
/** /**
* There are multiple modules that might be using Allegro and * 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; int _allegro_instance_count = 0;
const char *VideoDriver_Allegro::Start(const char * const *parm) const char *VideoDriver_Allegro::Start(const char * const *parm)

@ -42,7 +42,8 @@
/** /**
* Switches OpenTTD to a console app at run-time, instead of a PM app * 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() static void OS2_SwitchToConsoleMode()
{ {
PPIB pib; PPIB pib;

@ -365,7 +365,8 @@ ViewPort *IsPtInWindowViewport(const Window *w, int x, int y)
* @param vp Viewport that contains the (\a x, \a y) screen coordinate * @param vp Viewport that contains the (\a x, \a y) screen coordinate
* @param x Screen x coordinate * @param x Screen x coordinate
* @param y Screen y coordinate * @param y Screen y coordinate
* @return Tile coordinate */ * @return Tile coordinate
*/
static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y) static Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y)
{ {
Point pt; Point pt;
@ -456,7 +457,8 @@ Point GetTileZoomCenterWindow(bool in, Window * w)
* @param w Window pointer to the window that has the zoom buttons * @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 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_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) 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); w->SetWidgetDisabledState(widget_zoom_in, vp->zoom == ZOOM_LVL_MIN);
@ -1426,7 +1428,8 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom
/** /**
* Make sure we don't draw a too big area at a time. * 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) 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) { 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 * 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 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) void VpSetPresizeRange(TileIndex from, TileIndex to)
{ {
uint64 distance = DistanceManhattan(from, to) + 1; uint64 distance = DistanceManhattan(from, to) + 1;
@ -2112,7 +2116,8 @@ static void VpStartPreSizing()
/** /**
* returns information about the 2x1 piece to be build. * 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) static HighLightStyle Check2x1AutoRail(int mode)
{ {
int fxpy = _tile_fract_coords.x + _tile_fract_coords.y; int fxpy = _tile_fract_coords.x + _tile_fract_coords.y;
@ -2155,7 +2160,8 @@ static HighLightStyle Check2x1AutoRail(int mode)
* @param style HighLightStyle dragging style * @param style HighLightStyle dragging style
* @param start_tile start tile of drag * @param start_tile start tile of drag
* @param end_tile end 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) static bool SwapDirection(HighLightStyle style, TileIndex start_tile, TileIndex end_tile)
{ {
uint start_x = TileX(start_tile); uint start_x = TileX(start_tile);
@ -2511,7 +2517,8 @@ static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int meth
* @param x X coordinate of end of selection * @param x X coordinate of end of selection
* @param y Y coordinate of end of selection * @param y Y coordinate of end of selection
* @param method modifies the way tiles are selected. Possible * @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) void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
{ {
int sx, sy; int sx, sy;

@ -84,7 +84,8 @@ DECLARE_ENUM_AS_BIT_SET(ViewportPlaceMethod)
/** /**
* Drag and drop selection process, or, what to do with an area of land when * 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 { enum ViewportDragDropSelectionProcess {
DDSP_DEMOLISH_AREA, ///< Clear area DDSP_DEMOLISH_AREA, ///< Clear area
DDSP_RAISE_AND_LEVEL_AREA, ///< Raise / level area DDSP_RAISE_AND_LEVEL_AREA, ///< Raise / level area

@ -221,7 +221,8 @@ FORCEINLINE void NWidgetBase::StoreSizePosition(SizingType sizing, uint x, uint
/** /**
* Base class for a resizable nested widget. * Base class for a resizable nested widget.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetResizeBase : public NWidgetBase { class NWidgetResizeBase : public NWidgetBase {
public: public:
NWidgetResizeBase(WidgetType tp, uint fill_x, uint fill_y); 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. * Base class for a 'real' widget.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetCore : public NWidgetResizeBase { class NWidgetCore : public NWidgetResizeBase {
public: public:
NWidgetCore(WidgetType tp, Colours colour, uint fill_x, uint fill_y, uint16 widget_data, StringID tool_tip); 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() const
/** /**
* Baseclass for container widgets. * Baseclass for container widgets.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetContainer : public NWidgetBase { class NWidgetContainer : public NWidgetBase {
public: public:
NWidgetContainer(WidgetType tp); NWidgetContainer(WidgetType tp);
@ -403,7 +406,8 @@ protected:
/** /**
* Horizontal container. * Horizontal container.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetHorizontal : public NWidgetPIPContainer { class NWidgetHorizontal : public NWidgetPIPContainer {
public: public:
NWidgetHorizontal(NWidContainerFlags flags = NC_NONE); NWidgetHorizontal(NWidContainerFlags flags = NC_NONE);
@ -414,7 +418,8 @@ public:
/** /**
* Horizontal container that doesn't change the direction of the widgets for RTL languages. * Horizontal container that doesn't change the direction of the widgets for RTL languages.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetHorizontalLTR : public NWidgetHorizontal { class NWidgetHorizontalLTR : public NWidgetHorizontal {
public: public:
NWidgetHorizontalLTR(NWidContainerFlags flags = NC_NONE); NWidgetHorizontalLTR(NWidContainerFlags flags = NC_NONE);
@ -424,7 +429,8 @@ public:
/** /**
* Vertical container. * Vertical container.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetVertical : public NWidgetPIPContainer { class NWidgetVertical : public NWidgetPIPContainer {
public: public:
NWidgetVertical(NWidContainerFlags flags = NC_NONE); NWidgetVertical(NWidContainerFlags flags = NC_NONE);
@ -436,7 +442,8 @@ public:
/** /**
* Spacer widget. * Spacer widget.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetSpacer : public NWidgetResizeBase { class NWidgetSpacer : public NWidgetResizeBase {
public: public:
NWidgetSpacer(int length, int height); NWidgetSpacer(int length, int height);
@ -451,7 +458,8 @@ public:
/** /**
* Nested widget with a child. * Nested widget with a child.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetBackground : public NWidgetCore { class NWidgetBackground : public NWidgetCore {
public: public:
NWidgetBackground(WidgetType tp, Colours colour, int index, NWidgetPIPContainer *child = NULL); 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. * 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). * 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. * @todo Class derives from #NWidgetCore, but does not use #colour, #widget_data, or #tool_tip.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetViewport : public NWidgetCore { class NWidgetViewport : public NWidgetCore {
public: public:
NWidgetViewport(int index); NWidgetViewport(int index);
@ -496,7 +505,8 @@ public:
/** /**
* Leaf widget. * Leaf widget.
* @ingroup NestedWidgets */ * @ingroup NestedWidgets
*/
class NWidgetLeaf : public NWidgetCore { class NWidgetLeaf : public NWidgetCore {
public: public:
NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip); NWidgetLeaf(WidgetType tp, Colours colour, int index, uint16 data, StringID tip);
@ -581,7 +591,8 @@ static FORCEINLINE uint ComputeMaxSize(uint base, uint max_space, uint step)
/** /**
* Widget part for storing data and tooltip information. * Widget part for storing data and tooltip information.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPartDataTip { struct NWidgetPartDataTip {
uint16 data; ///< Data value of the widget. uint16 data; ///< Data value of the widget.
StringID tooltip; ///< Tooltip of the widget. StringID tooltip; ///< Tooltip of the widget.
@ -589,7 +600,8 @@ struct NWidgetPartDataTip {
/** /**
* Widget part for storing basic widget information. * Widget part for storing basic widget information.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPartWidget { struct NWidgetPartWidget {
Colours colour; ///< Widget colour. Colours colour; ///< Widget colour.
int16 index; ///< Widget index in the widget array. int16 index; ///< Widget index in the widget array.
@ -597,21 +609,24 @@ struct NWidgetPartWidget {
/** /**
* Widget part for storing padding. * Widget part for storing padding.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPartPaddings { struct NWidgetPartPaddings {
uint8 top, right, bottom, left; ///< Paddings for all directions. uint8 top, right, bottom, left; ///< Paddings for all directions.
}; };
/** /**
* Widget part for storing pre/inter/post spaces. * Widget part for storing pre/inter/post spaces.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPartPIP { struct NWidgetPartPIP {
uint8 pre, inter, post; ///< Amount of space before/between/after child widgets. uint8 pre, inter, post; ///< Amount of space before/between/after child widgets.
}; };
/** /**
* Widget part for storing minimal text line data. * Widget part for storing minimal text line data.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPartTextLines { struct NWidgetPartTextLines {
uint8 lines; ///< Number of text lines. uint8 lines; ///< Number of text lines.
uint8 spacing; ///< Extra spacing around lines. uint8 spacing; ///< Extra spacing around lines.
@ -628,7 +643,8 @@ typedef NWidgetBase *NWidgetFunctionType(int *biggest_index);
/** /**
* Partial widget specification to allow NWidgets to be written nested. * Partial widget specification to allow NWidgets to be written nested.
* @ingroup NestedWidgetParts */ * @ingroup NestedWidgetParts
*/
struct NWidgetPart { struct NWidgetPart {
WidgetType type; ///< Type of the part. @see NWidgetPartType. WidgetType type; ///< Type of the part. @see NWidgetPartType.
union { union {

@ -764,7 +764,8 @@ restart_search:
* Delete all windows of a company. We identify windows of a company * 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 * 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 * 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) void DeleteCompanyWindows(CompanyID id)
{ {
Window *w; Window *w;
@ -789,7 +790,8 @@ restart_search:
* company in the case of a company merger. Do not change ownership of windows * company in the case of a company merger. Do not change ownership of windows
* that need to be deleted once takeover is complete * that need to be deleted once takeover is complete
* @param old_owner original owner of the window * @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) void ChangeWindowOwner(Owner old_owner, Owner new_owner)
{ {
Window *w; 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". * 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 cls WindowClass of the window to activate
* @param number WindowNumber 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 *BringWindowToFrontById(WindowClass cls, WindowNumber number)
{ {
Window *w = FindWindowById(cls, number); Window *w = FindWindowById(cls, number);
@ -1322,7 +1325,8 @@ Window::Window() : hscroll(false), vscroll(true), vscroll2(true)
* at the topmost window, obviously and work our way down to the bottom * at the topmost window, obviously and work our way down to the bottom
* @param x position x to query * @param x position x to query
* @param y position y 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 *FindWindowFromPt(int x, int y)
{ {
Window *w; Window *w;
@ -1932,7 +1936,8 @@ static EventState HandleViewportScroll()
* The function will return false when a child window of this window is a * 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 * modal-popup; function returns a false and child window gets a white border
* @param w Window to bring on-top * @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) static bool MaybeBringWindowToFront(Window *w)
{ {
bool bring_to_front = false; bool bring_to_front = false;
@ -2564,7 +2569,8 @@ restart_search:
* 'close' button is outside the gaming area. You cannot close it then; except * 'close' button is outside the gaming area. You cannot close it then; except
* with this function. It closes all windows calling the standard function, * with this function. It closes all windows calling the standard function,
* then, does a little hacked loop of closing all stickied windows. Note * 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() void DeleteAllNonVitalWindows()
{ {
Window *w; Window *w;

Loading…
Cancel
Save