diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 0b7b9778a9..e8869f97c1 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -84,7 +84,7 @@ static void PlaceAirport(TileIndex tile) /** Airport build toolbar window handler. */ struct BuildAirToolbarWindow : Window { - WidgetID last_user_action = INVALID_WIDGET; // Last started user action. + WidgetID last_user_action = INVALID_WIDGET; ///< Last started user action. BuildAirToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc) { diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index ac78f62d6d..9b07620a3e 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -504,7 +504,7 @@ static CommandCost ReplaceFreeUnit(Vehicle **single_unit, DoCommandFlags flags, struct ReplaceChainItem { Vehicle *old_veh; ///< Old vehicle to replace. Vehicle *new_veh; ///< Replacement vehicle, or nullptr if no replacement. - Money cost; /// Cost of buying and refitting replacement. + Money cost; ///< Cost of buying and refitting replacement. /** * Create a new item. diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index a8423f3c08..e36ab33d99 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -74,15 +74,14 @@ private: /* Runtime saved values */ static Listing last_sorting; ///< Last setting of the sort. - /* Constants for sorting the bridges */ + /** Strings describing how bridges are sorted. */ static inline const StringID sorter_names[] = { STR_SORT_BY_NUMBER, STR_SORT_BY_COST, STR_SORT_BY_MAX_SPEED, }; - static const std::initializer_list sorter_funcs; + static const std::initializer_list sorter_funcs; ///< Functions to sort bridges. - /* Internal variables */ TileIndex start_tile = INVALID_TILE; TileIndex end_tile = INVALID_TILE; TransportType transport_type = INVALID_TRANSPORT; diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 30ca767757..5fac9830aa 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -127,7 +127,7 @@ static bool EngineIntroDateSorter(const GUIEngineListItem &a, const GUIEngineLis return _engine_sort_direction ? r > 0 : r < 0; } -/* cached values for EngineNameSorter to spare many GetString() calls */ +/** Cached values for EngineNameSorter to spare many GetString() calls. */ static EngineID _last_engine[2] = { EngineID::Invalid(), EngineID::Invalid() }; /** Determines order of engines by name. @copydoc GUIList::Sorter */ diff --git a/src/company_gui.cpp b/src/company_gui.cpp index ce71a0f036..c35e9b9b14 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -584,7 +584,7 @@ void ShowCompanyFinances(CompanyID company) new CompanyFinancesWindow(_company_finances_desc, company); } -/* Association of liveries to livery classes */ +/** Association of liveries to livery classes. */ static const LiveryClass _livery_class[LS_END] = { LC_OTHER, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, LC_RAIL, diff --git a/src/console_func.h b/src/console_func.h index 3f80032bd4..e10157c5f0 100644 --- a/src/console_func.h +++ b/src/console_func.h @@ -13,7 +13,7 @@ #include "console_type.h" #include "core/format.hpp" -/* console modes */ +/** Console modes. */ extern IConsoleModes _iconsole_mode; /* console functions */ diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 196a5a5efb..b211568f2c 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -106,7 +106,7 @@ private: } }; -/* ** main console cmd buffer ** */ +/** Main console cmd buffer. */ static Textbuf _iconsole_cmdline(ICON_CMDLN_SIZE); static ConsoleAutoCompletion _iconsole_tab_completion(&_iconsole_cmdline); static std::deque _iconsole_history; diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index b8a7de09be..3bbbe2a228 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -74,7 +74,7 @@ struct EMPTY_BASES PoolID : PoolIDBase { constexpr bool operator==(const size_t &rhs) const { return this->value == rhs; } constexpr auto operator<=>(const size_t &rhs) const { return this->value <=> rhs; } private: - /* Do not explicitly initialize. */ + /** The bare storage. @warning Do not explicitly initialize. */ TBaseType value; }; diff --git a/src/economy_func.h b/src/economy_func.h index 012004750d..97adfe9708 100644 --- a/src/economy_func.h +++ b/src/economy_func.h @@ -25,7 +25,7 @@ void SetPriceBaseMultiplier(Price price, int factor); extern const EnumClassIndexContainer, ScoreID> _score_info; extern TypedIndexContainer, ScoreID>, MAX_COMPANIES>, CompanyID> _score_part; extern Economy _economy; -/* Prices and also the fractional part. */ +/** Prices and also the fractional part. */ extern Prices _price; int UpdateCompanyRatingAndValue(Company *c, bool update); diff --git a/src/engine_base.h b/src/engine_base.h index a7fd846d75..678f169b8e 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -73,7 +73,7 @@ public: std::vector badges{}; private: - /* Vehicle-type specific information. */ + /** Vehicle-type specific information. */ std::variant vehicle_info{}; public: diff --git a/src/fios.cpp b/src/fios.cpp index eb1db91ddb..748ffed6e5 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -25,7 +25,6 @@ #include "safeguards.h" -/* Variables to display file lists */ static std::string *_fios_path = nullptr; SortingBits _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING; diff --git a/src/fios.h b/src/fios.h index 980e47f55e..22793942a4 100644 --- a/src/fios.h +++ b/src/fios.h @@ -98,7 +98,6 @@ enum SortingBits : uint8_t { }; DECLARE_ENUM_AS_BIT_SET(SortingBits) -/* Variables to display file lists */ extern SortingBits _savegame_sort_order; void ShowSaveLoadDialog(AbstractFileType abstract_filetype, SaveLoadOperation fop); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 312f5dd3f8..8e9dbf1839 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -325,7 +325,7 @@ private: static const uint EDITBOX_MAX_SIZE = 50; QueryString filename_editbox; ///< Filename editbox. - AbstractFileType abstract_filetype{}; /// Type of file to select. + AbstractFileType abstract_filetype{}; ///< Type of file to select. SaveLoadOperation fop{}; ///< File operation to perform. FileList fios_items{}; ///< Item list. FiosItem o_dir{}; ///< Original dir (home dir for this browser) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 566aaeea29..cf9a2c6cb0 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -37,12 +37,12 @@ #include "safeguards.h" -/* Bitmasks of company and cargo indices that shouldn't be drawn. */ +/** Bitmasks of company and cargo indices that shouldn't be drawn. */ static CompanyMask _legend_excluded_companies; /* Apparently these don't play well with enums. */ -static const OverflowSafeInt64 INVALID_DATAPOINT(INT64_MAX); // Value used for a datapoint that shouldn't be drawn. -static const uint INVALID_DATAPOINT_POS = UINT_MAX; // Used to determine if the previous point was drawn. +static const OverflowSafeInt64 INVALID_DATAPOINT(INT64_MAX); ///< Value used for a datapoint that shouldn't be drawn. +static const uint INVALID_DATAPOINT_POS = UINT_MAX; ///< Used to determine if the previous point was drawn. constexpr double INT64_MAX_IN_DOUBLE = static_cast(INT64_MAX - 512); ///< The biggest double that when cast to int64_t still fits in a int64_t. static_assert(static_cast(INT64_MAX_IN_DOUBLE) < INT64_MAX); @@ -213,17 +213,20 @@ protected: uint8_t num_on_x_axis = 0; uint8_t num_vert_lines = GRAPH_NUM_MONTHS; - /* The starting month and year that values are plotted against. */ - TimerGameEconomy::Month month{}; - TimerGameEconomy::Year year{}; + TimerGameEconomy::Month month{}; ///< The starting month that values are plotted against. + TimerGameEconomy::Year year{}; ///< The starting year that values are plotted against. uint8_t month_increment = 3; ///< month increment between vertical lines. must be divisor of 12. bool draw_dates = true; ///< Should we draw months and years on the time axis? - /* These values are used if the graph is being plotted against values - * rather than the dates specified by month and year. */ + /** + * These values are used if the graph is being plotted against values + * rather than the dates specified by month and year. + * @{ + */ bool x_values_reversed = true; int16_t x_values_increment = ECONOMY_QUARTER_MINUTES; + /** @} */ StringID format_str_y_axis{}; diff --git a/src/heightmap.cpp b/src/heightmap.cpp index 39865b3333..ae0c193454 100644 --- a/src/heightmap.cpp +++ b/src/heightmap.cpp @@ -35,7 +35,7 @@ */ static const uint MAX_HEIGHTMAP_SIDE_LENGTH_IN_PIXELS = 2 * MAX_MAP_SIZE; -/* +/** * Maximum size in pixels of the heightmap image. */ static const uint MAX_HEIGHTMAP_SIZE_PIXELS = 256 << 20; // ~256 million diff --git a/src/industry.h b/src/industry.h index 5aabd9777c..6217f9a90a 100644 --- a/src/industry.h +++ b/src/industry.h @@ -78,8 +78,8 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> { }; struct AcceptedHistory { - uint16_t accepted = 0; /// Total accepted. - uint16_t waiting = 0; /// Average waiting. + uint16_t accepted = 0; ///< Total accepted. + uint16_t waiting = 0; ///< Average waiting. }; struct AcceptedCargo { diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 632f74f8e1..e295cd3c0d 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1322,14 +1322,14 @@ protected: /* Runtime saved values */ static Listing last_sorting; - /* Constants for sorting industries */ + /** Strings describing how industries are sorted. */ static inline const StringID sorter_names[] = { STR_SORT_BY_NAME, STR_SORT_BY_TYPE, STR_SORT_BY_PRODUCTION, STR_SORT_BY_TRANSPORTED, }; - static const std::initializer_list sorter_funcs; + static const std::initializer_list sorter_funcs; ///< Functions to sort industries. GUIIndustryList industries{IndustryDirectoryWindow::produced_cargo_filter}; Scrollbar *vscroll{}; @@ -2008,7 +2008,7 @@ struct CargoesField { bool left_align; ///< Align all cargo texts to the left (else align to the right). } cargo_label; ///< Label data (for #CFT_CARGO_LABEL). StringID header; ///< Header text (for #CFT_HEADER). - } u{}; // Data for each type. + } u{}; ///< Data for each type. /** * Make one of the empty fields (#CFT_EMPTY or #CFT_SMALL_EMPTY). diff --git a/src/industrytype.h b/src/industrytype.h index f10812f24f..3136d06251 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -176,7 +176,6 @@ const IndustrySpec *GetIndustrySpec(IndustryType thistype); ///< Array of ind const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx); ///< Array of industry tiles data void ResetIndustries(); -/* writable arrays of specs */ extern IndustrySpec _industry_specs[NUM_INDUSTRYTYPES]; extern IndustryTileSpec _industry_tile_specs[NUM_INDUSTRYTILES]; diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h index 1e637587e6..5968805aa5 100644 --- a/src/linkgraph/linkgraphjob.h +++ b/src/linkgraph/linkgraphjob.h @@ -378,12 +378,13 @@ public: protected: - /* + /** @{ * Some boundaries to clamp against in order to avoid integer overflows. */ static constexpr int PATH_CAP_MULTIPLIER = 16; static constexpr int PATH_CAP_MIN_FREE = (INT_MIN + 1) / PATH_CAP_MULTIPLIER; static constexpr int PATH_CAP_MAX_FREE = (INT_MAX - 1) / PATH_CAP_MULTIPLIER; + /** @} */ uint distance = 0; ///< Sum(distance of all legs up to this one). uint capacity = 0; ///< This capacity is min(capacity) fom all edges. diff --git a/src/misc/hashtable.hpp b/src/misc/hashtable.hpp index 82e448bb2a..f44cfbd852 100644 --- a/src/misc/hashtable.hpp +++ b/src/misc/hashtable.hpp @@ -149,8 +149,8 @@ template class HashTable { public: typedef typename Titem::Key Tkey; // make Titem::Key a property of HashTable - static constexpr int HASH_BITS = Thash_bits_; // publish num of hash bits - static constexpr int CAPACITY = 1 << HASH_BITS; // and num of slots 2^bits + static constexpr int HASH_BITS = Thash_bits_; ///< Publish num of hash bits. + static constexpr int CAPACITY = 1 << HASH_BITS; ///< And num of slots 2^bits. protected: /** diff --git a/src/mixer.cpp b/src/mixer.cpp index 9ae09510ce..12fe4ecd95 100644 --- a/src/mixer.cpp +++ b/src/mixer.cpp @@ -18,18 +18,20 @@ #include "safeguards.h" struct MixerChannel { - /* pointer to allocated buffer memory */ + /** Pointer to allocated buffer memory. */ std::shared_ptr> memory; - /* current position in memory */ + /** Current position in memory. */ uint32_t pos; uint32_t frac_pos; uint32_t frac_speed; uint32_t samples_left; - /* Mixing volume */ + /** @{ + * Mixing volume. */ int volume_left; int volume_right; + /** @} */ bool is16bit; }; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 32eb2eddda..f6dd9950ae 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -175,11 +175,12 @@ public: class NetworkGameWindow : public Window { protected: - /* Runtime saved values */ + /** Runtime saved values. */ static Listing last_sorting; - /* Constants for sorting servers */ + /** Functions for sorting servers. */ static const std::initializer_list sorter_funcs; + /** Functions for filtering servers. */ static const std::initializer_list filter_funcs; NetworkGame *server = nullptr; ///< Selected server. @@ -191,8 +192,8 @@ protected: QueryString filter_editbox; ///< Editbox for filter on servers. bool searched_internet = false; ///< Did we ever press "Search Internet" button? - Dimension lock{}; /// Dimension of lock icon. - Dimension blot{}; /// Dimension of compatibility icon. + Dimension lock{}; ///< Dimension of lock icon. + Dimension blot{}; ///< Dimension of compatibility icon. /** * (Re)build the GUI network game list (a.k.a. this->servers) as some diff --git a/src/newgrf/newgrf_internal.h b/src/newgrf/newgrf_internal.h index 287d513b45..8cb96b826f 100644 --- a/src/newgrf/newgrf_internal.h +++ b/src/newgrf/newgrf_internal.h @@ -71,7 +71,7 @@ public: /* Kind of return values when processing certain actions */ int skip_sprites; ///< Number of pseudo sprites to skip before processing the next one. (-1 to skip to end of file) - /* Currently referenceable spritegroups */ + /** Currently referenceable spritegroups. */ std::array spritegroups{}; /** Clear temporary data before processing the next file in the current loading stage */ diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 63e9d44307..4c742e197c 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1887,7 +1887,7 @@ std::unique_ptr NewGRFDisplay() return std::make_unique(std::move(avs), std::move(acs), std::move(inf)); } -/* Widget definition of the manage newgrfs window */ +/** Widget definition of the manage newgrfs window. */ static constexpr std::initializer_list _nested_newgrf_widgets = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -1904,7 +1904,7 @@ static constexpr std::initializer_list _nested_newgrf_widgets = { EndContainer(), }; -/* Window definition of the manage newgrfs window */ +/** Window definition of the manage newgrfs window. */ static WindowDesc _newgrf_desc( WDP_CENTER, "settings_newgrf", 300, 263, WC_GAME_OPTIONS, WC_NONE, diff --git a/src/newgrf_spritegroup.h b/src/newgrf_spritegroup.h index 15bef80540..3de0d70927 100644 --- a/src/newgrf_spritegroup.h +++ b/src/newgrf_spritegroup.h @@ -188,10 +188,10 @@ struct DeterministicSpriteGroup : SpecializedSpriteGroup adjusts{}; std::vector ranges{}; // Dynamically allocated - /* Dynamically allocated, this is the sole owner */ + /** Dynamically allocated, this is the sole owner. */ DeterministicSpriteGroupResult default_result; - const SpriteGroup *error_group = nullptr; // was first range, before sorting ranges + const SpriteGroup *error_group = nullptr; ///< Was first range, before sorting ranges. protected: ResolverResult Resolve(ResolverObject &object) const override; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 96675a2c16..0fc91ae43a 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -101,7 +101,7 @@ static TileIndex GetReferenceTile(const NewsReference &reference) return std::visit(visitor{}, reference); } -/* Normal news items. */ +/** Normal news items. */ static constexpr std::initializer_list _nested_normal_news_widgets = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -133,7 +133,7 @@ static WindowDesc _normal_news_desc( _nested_normal_news_widgets ); -/* New vehicles news items. */ +/** New vehicles news items. */ static constexpr std::initializer_list _nested_vehicle_news_widgets = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -181,7 +181,7 @@ static WindowDesc _vehicle_news_desc( _nested_vehicle_news_widgets ); -/* Company news items. */ +/** Company news items. */ static constexpr std::initializer_list _nested_company_news_widgets = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -226,7 +226,7 @@ static WindowDesc _company_news_desc( _nested_company_news_widgets ); -/* Thin news items. */ +/** Thin news items. */ static constexpr std::initializer_list _nested_thin_news_widgets = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -260,7 +260,7 @@ static WindowDesc _thin_news_desc( _nested_thin_news_widgets ); -/* Small news items. */ +/** Small news items. */ static constexpr std::initializer_list _nested_small_news_widgets = { /* Caption + close box. The caption is not WWT_CAPTION as the window shall not be moveable and so on. */ NWidget(NWID_HORIZONTAL), @@ -1212,10 +1212,10 @@ static void DrawNewsString(uint left, uint right, int y, TextColour colour, cons } struct MessageHistoryWindow : Window { - int line_height = 0; /// < Height of a single line in the news history window including spacing. - int date_width = 0; /// < Width needed for the date part. + int line_height = 0; ///< Height of a single line in the news history window including spacing. + int date_width = 0; ///< Width needed for the date part. - Scrollbar *vscroll = nullptr; + Scrollbar *vscroll = nullptr; ///< Cache of the vertical scrollbar. MessageHistoryWindow(WindowDesc &desc) : Window(desc) { diff --git a/src/news_type.h b/src/news_type.h index 9c2bf2e25f..9e77c0e598 100644 --- a/src/news_type.h +++ b/src/news_type.h @@ -140,7 +140,7 @@ struct NewsItem { TimerGameEconomy::Date economy_date; ///< Economy date of the news item, never shown but used to calculate age NewsType type; ///< Type of the news AdviceType advice_type; ///< The type of advice, to be able to remove specific advices later on. - NewsStyle style; /// Window style for the news. + NewsStyle style; ///< Window style for the news. NewsFlags flags; ///< NewsFlags bits @see NewsFlag NewsReference ref1; ///< Reference 1 to some object: Used for a possible viewport, scrolling after clicking on the news, and for deleting the news when the object is deleted. diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index a45fd9d914..9151775e8c 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -209,11 +209,11 @@ struct OskWindow : public Window { } }; -static const int HALF_KEY_WIDTH = 7; // Width of 1/2 key in pixels. -static const int INTER_KEY_SPACE = 2; // Number of pixels between two keys. +static const int HALF_KEY_WIDTH = 7; ///< Width of 1/2 key in pixels. +static const int INTER_KEY_SPACE = 2; ///< Number of pixels between two keys. -static const int TOP_KEY_PADDING = 2; // Vertical padding for the top row of keys. -static const int KEY_PADDING = 6; // Vertical padding for remaining key rows. +static const int TOP_KEY_PADDING = 2; ///< Vertical padding for the top row of keys. +static const int KEY_PADDING = 6; ///< Vertical padding for remaining key rows. /** * Add a key widget to a row of the keyboard. diff --git a/src/palette.cpp b/src/palette.cpp index eba6a5378d..67b017ca9a 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -40,12 +40,17 @@ const uint PALETTE_SHIFT = 8 - PALETTE_BITS; const uint PALETTE_BITS_MASK = ((1U << PALETTE_BITS) - 1) << PALETTE_SHIFT; const uint PALETTE_BITS_OR = (1U << (PALETTE_SHIFT - 1)); -/* Palette and reshade lookup table. */ +/** @{ + * Palette lookup table. */ using PaletteLookup = std::array; static PaletteLookup _palette_lookup{}; +/** @} */ +/** @{ + * Reshade lookup table. */ using ReshadeLookup = std::array; static ReshadeLookup _reshade_lookup{}; +/** @} */ /** * Reduce bits per channel to PALETTE_BITS, and place value in the middle of the reduced range. diff --git a/src/pathfinder/water_regions.cpp b/src/pathfinder/water_regions.cpp index 991db3cee5..83f79bdc8c 100644 --- a/src/pathfinder/water_regions.cpp +++ b/src/pathfinder/water_regions.cpp @@ -49,9 +49,9 @@ class WaterRegionData { friend class WaterRegion; std::array edge_traversability_bits{}; - std::unique_ptr tile_patch_labels; // Tile patch labels, this may be nullptr in the following trivial cases: region is invalid, region is only land (0 patches), region is only water (1 patch) + std::unique_ptr tile_patch_labels; ///< Tile patch labels, this may be nullptr in the following trivial cases: region is invalid, region is only land (0 patches), region is only water (1 patch). bool has_cross_region_aqueducts = false; - WaterRegionPatchLabel::BaseType number_of_patches{0}; // 0 = no water, 1 = one single patch of water, etc... + WaterRegionPatchLabel::BaseType number_of_patches{0}; ///< 0 = no water, 1 = one single patch of water, etc... }; /** diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp index c5da79acf7..7334560e98 100644 --- a/src/pathfinder/yapf/yapf_ship.cpp +++ b/src/pathfinder/yapf/yapf_ship.cpp @@ -19,9 +19,9 @@ #include "../../safeguards.h" constexpr int NUMBER_OR_WATER_REGIONS_LOOKAHEAD = 4; -constexpr int MAX_SHIP_PF_NODES = (NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1) * WATER_REGION_NUMBER_OF_TILES * 4; // 4 possible exit dirs per tile. +constexpr int MAX_SHIP_PF_NODES = (NUMBER_OR_WATER_REGIONS_LOOKAHEAD + 1) * WATER_REGION_NUMBER_OF_TILES * 4; ///< 4 possible exit dirs per tile. -constexpr int SHIP_LOST_PATH_LENGTH = 8; // The length of the (aimless) path assigned when a ship is lost. +constexpr int SHIP_LOST_PATH_LENGTH = 8; ///< The length of the (aimless) path assigned when a ship is lost. template class CYapfDestinationTileWaterT { diff --git a/src/pathfinder/yapf/yapf_type.hpp b/src/pathfinder/yapf/yapf_type.hpp index aeb53f9fec..d122f0d504 100644 --- a/src/pathfinder/yapf/yapf_type.hpp +++ b/src/pathfinder/yapf/yapf_type.hpp @@ -35,7 +35,7 @@ enum class EndSegmentReason : uint8_t { }; using EndSegmentReasons = EnumBitSet; -/* What reasons mean that the target can be found and needs to be detected. */ +/** What reasons mean that the target can be found and needs to be detected. */ static constexpr EndSegmentReasons ESRF_POSSIBLE_TARGET = { EndSegmentReason::Depot, EndSegmentReason::Waypoint, @@ -43,7 +43,7 @@ static constexpr EndSegmentReasons ESRF_POSSIBLE_TARGET = { EndSegmentReason::SafeTile, }; -/* What reasons can be stored back into cached segment. */ +/** What reasons can be stored back into cached segment. */ static constexpr EndSegmentReasons ESRF_CACHED_MASK = { EndSegmentReason::DeadEnd, EndSegmentReason::RailType, @@ -56,7 +56,7 @@ static constexpr EndSegmentReasons ESRF_CACHED_MASK = { EndSegmentReason::SafeTile, }; -/* Reasons to abort pathfinding in this direction. */ +/** Reasons to abort pathfinding in this direction. */ static constexpr EndSegmentReasons ESRF_ABORT_PF_MASK = { EndSegmentReason::DeadEnd, EndSegmentReason::PathTooLong, diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 1765d03fef..4ae26d3c68 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -2058,7 +2058,7 @@ static void DrawTrackDetails(const TileInfo *ti, const RailTypeInfo *rti, Palett } /* SubSprite for drawing the track halftile of 'three-corners-raised'-sloped rail sprites. */ -static const int INF = 1000; // big number compared to tilesprite size +static const int INF = 1000; ///< Big number compared to tilesprite size. static const SubSprite _halftile_sub_sprite[4] = { { -INF , -INF , 32 - 33, INF }, // CORNER_W, clip 33 pixels from right { -INF , 0 + 7, INF , INF }, // CORNER_S, clip 7 pixels from top diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index f575b8b719..06b92c0d5a 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -2121,7 +2121,7 @@ static bool ClickTile_Road(TileIndex tile) return true; } -/* Converts RoadBits to TrackBits */ +/** Converts %RoadBits to %TrackBits. */ static const TrackBits _road_trackbits[16] = { TRACK_BIT_NONE, // ROAD_NONE TRACK_BIT_NONE, // ROAD_NW diff --git a/src/roadveh.h b/src/roadveh.h index 4fb68159ec..de79da0bb3 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -57,21 +57,28 @@ enum RoadVehicleStates : uint8_t { RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09, ///< Only bits 0 and 3 are used to encode the trackdir for road stops }; -/** State information about the Road Vehicle controller */ +/** @name State information about the Road Vehicle controller. + * @{ */ static const uint RDE_NEXT_TILE = 0x80; ///< We should enter the next tile static const uint RDE_TURNED = 0x40; ///< We just finished turning +/** @} */ -/* Start frames for when a vehicle enters a tile/changes its state. +/** + * @name Start frames for when a vehicle enters a tile/changes its state. * The start frame is different for vehicles that turned around or * are leaving the depot as the do not start at the edge of the tile. * For trams there are a few different start frames as there are two - * places where trams can turn. */ + * places where trams can turn. + * @{ + */ static const uint RVC_DEFAULT_START_FRAME = 0; static const uint RVC_TURN_AROUND_START_FRAME = 1; static const uint RVC_DEPOT_START_FRAME = 6; static const uint RVC_START_FRAME_AFTER_LONG_TRAM = 21; static const uint RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16; -/* Stop frame for a vehicle in a drive-through stop */ +/** @} */ + +/** Stop frame for a vehicle in a drive-through stop. */ static const uint RVC_DRIVE_THROUGH_STOP_FRAME = 11; static const uint RVC_DEPOT_STOP_FRAME = 11; diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp index cd6fc42c7a..a6c2a77c23 100644 --- a/src/saveload/company_sl.cpp +++ b/src/saveload/company_sl.cpp @@ -487,7 +487,7 @@ public: void LoadCheck(CompanyProperties *cprops) const override { this->Load(cprops); } }; -/* Save/load of companies */ +/** Save/load of companies. */ static const SaveLoad _company_desc[] = { SLE_VAR(CompanyProperties, name_2, SLE_UINT32), SLE_VAR(CompanyProperties, name_1, SLE_STRINGID), diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp index 0a61395c75..3fd3b75e90 100644 --- a/src/saveload/industry_sl.cpp +++ b/src/saveload/industry_sl.cpp @@ -68,10 +68,12 @@ public: std::vector &GetVector(Industry *i) const override { return i->accepted; } - /* Old array structure used by INDYChunkHandler for savegames before SLV_INDUSTRY_CARGO_REORGANISE. */ + /** @{ + * Old array structures used by INDYChunkHandler for savegames before SLV_INDUSTRY_CARGO_REORGANISE. */ static inline std::array old_cargo; static inline std::array old_waiting; static inline std::array old_last_accepted; + /** @} */ static void ResetOldStructure() { @@ -127,7 +129,8 @@ public: std::vector &GetVector(Industry *i) const override { return i->produced; } - /* Old array structure used by INDYChunkHandler for savegames before SLV_INDUSTRY_CARGO_REORGANISE. */ + /** @{ + * Old array structures used by INDYChunkHandler for savegames before SLV_INDUSTRY_CARGO_REORGANISE. */ static inline std::array old_cargo; static inline std::array old_waiting; static inline std::array old_rate; @@ -135,6 +138,7 @@ public: static inline std::array old_this_month_transported; static inline std::array old_last_month_production; static inline std::array old_last_month_transported; + /** @} */ static void ResetOldStructure() { diff --git a/src/saveload/misc_sl.cpp b/src/saveload/misc_sl.cpp index 5e6fdd076b..c68577a027 100644 --- a/src/saveload/misc_sl.cpp +++ b/src/saveload/misc_sl.cpp @@ -30,10 +30,12 @@ extern TileIndex _cur_tileloop_tile; extern uint16_t _disaster_delay; extern uint8_t _trees_tick_ctr; -/* Keep track of current game position */ +/** @{ + * Keep track of current game position. */ int _saved_scrollpos_x; int _saved_scrollpos_y; ZoomLevel _saved_scrollpos_zoom; +/** @} */ void SaveViewportBeforeSaveGame() { diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index 1ed40a60f2..6036e05601 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -846,9 +846,11 @@ public: class SlVehicleRoadVeh : public DefaultSaveLoadHandler { public: - /* RoadVehicle path is stored in std::pair which cannot be directly saved. */ + /** @{ + * RoadVehicle path is stored in std::pair which cannot be directly saved. */ static inline std::vector rv_path_td; static inline std::vector rv_path_tile; + /** @} */ static inline const SaveLoad description[] = { SLEG_STRUCT("common", SlVehicleCommon), diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 1c8d3961ed..965296b5b3 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -173,8 +173,8 @@ static void AddCustomRefreshRates() std::copy(monitor_rates.begin(), monitor_rates.end(), std::inserter(_refresh_rates, _refresh_rates.end())); } -static const int SCALE_NMARKS = (MAX_INTERFACE_SCALE - MIN_INTERFACE_SCALE) / 25 + 1; // Show marks at 25% increments -static const int VOLUME_NMARKS = 9; // Show 5 values and 4 empty marks. +static const int SCALE_NMARKS = (MAX_INTERFACE_SCALE - MIN_INTERFACE_SCALE) / 25 + 1; ///< Show marks at 25% increments. +static const int VOLUME_NMARKS = 9; ///< Show 5 values and 4 empty marks. static std::optional ScaleMarkFunc(int, int, int value) { diff --git a/src/settings_type.h b/src/settings_type.h index fc81e32daf..ebadd297c2 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -25,7 +25,8 @@ #include "signal_type.h" #include "timetable.h" -/* Used to validate sizes of "max" value in settings. */ +/** @{ + * Used to validate sizes of "max" value in settings. */ const size_t MAX_SLE_UINT8 = UINT8_MAX; const size_t MAX_SLE_UINT16 = UINT16_MAX; const size_t MAX_SLE_UINT32 = UINT32_MAX; @@ -34,6 +35,7 @@ const size_t MAX_SLE_INT8 = INT8_MAX; const size_t MAX_SLE_INT16 = INT16_MAX; const size_t MAX_SLE_INT32 = INT32_MAX; const size_t MAX_SLE_INT = INT_MAX; +/** @} */ /** Settings profiles and highscore tables. */ enum SettingsProfile : uint8_t { diff --git a/src/signal.cpp b/src/signal.cpp index a714a27f25..de63a04698 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -54,9 +54,9 @@ static const TrackdirBits _enterdir_to_trackdirbits[DIAGDIR_END] = { template struct SmallSet { private: - uint n = 0; // actual number of units - bool overflowed = false; // did we try to overflow the set? - const std::string_view name; // name, used for debugging purposes... + uint n = 0; ///< Actual number of units. + bool overflowed = false; ///< Did we try to overflow the set? + const std::string_view name; ///< Name, used for debugging purposes... /** Element of set */ struct SSdata { diff --git a/src/signs_base.h b/src/signs_base.h index b183ea5588..874e20d0fe 100644 --- a/src/signs_base.h +++ b/src/signs_base.h @@ -24,8 +24,8 @@ struct Sign : SignPool::PoolItem<&_sign_pool> { int32_t x = 0; int32_t y = 0; int32_t z = 0; - Owner owner = INVALID_OWNER; // Placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games. - Colours text_colour = COLOUR_WHITE; // Colour of the sign's text. Only relevant for OWNER_DEITY. + Owner owner = INVALID_OWNER; ///< Placed by this company. Anyone can delete them though. OWNER_NONE for gray signs from old games. + Colours text_colour = COLOUR_WHITE; ///< Colour of the sign's text. Only relevant for OWNER_DEITY. Sign(SignID index) : SignPool::PoolItem<&_sign_pool>(index) {} Sign(SignID index, Owner owner, int32_t x, int32_t y, int32_t z, const std::string &name) : diff --git a/src/sortlist_type.h b/src/sortlist_type.h index ad2c3668d3..fa2ce11377 100644 --- a/src/sortlist_type.h +++ b/src/sortlist_type.h @@ -80,7 +80,7 @@ protected: /* If sort parameters are used then params must be a reference, however if not then params cannot be a reference as * it will not be able to reference anything. */ using SortParameterReference = std::conditional_t, P, P&>; - const SortParameterReference params; + const SortParameterReference params; ///< @copydoc SortParameterReference /** * Check if the list is sortable diff --git a/src/soundloader_opus.cpp b/src/soundloader_opus.cpp index ce311de544..c91119d941 100644 --- a/src/soundloader_opus.cpp +++ b/src/soundloader_opus.cpp @@ -27,11 +27,13 @@ public: static constexpr uint16_t OPUS_SAMPLE_RATE = 48000; ///< OpusFile always decodes at 48kHz. static constexpr uint8_t OPUS_SAMPLE_BITS = 16; ///< OpusFile op_read() uses 16 bits per sample. - /* For good results, you will need at least 57 bytes (for a pure Opus-only stream). */ + /** For good results, you will need at least 57 bytes (for a pure Opus-only stream). */ static constexpr size_t MIN_OPUS_FILE_SIZE = 57U; - /* It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (5760 values per channel). - * Smaller buffers will simply return less data, possibly consuming more memory to buffer the data internally. */ + /** + * It is recommended that this be large enough for at least 120 ms of data at 48 kHz per channel (5760 values per channel). + * Smaller buffers will simply return less data, possibly consuming more memory to buffer the data internally. + */ static constexpr size_t DECODE_BUFFER_SAMPLES = 5760 * 2; static constexpr size_t DECODE_BUFFER_BYTES = DECODE_BUFFER_SAMPLES * sizeof(opus_int16); diff --git a/src/sprite.h b/src/sprite.h index 24aeeb2922..61fdf54992 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -89,7 +89,7 @@ struct DrawTileSpriteSpan : DrawTileSprites { struct DrawBuildingsTileStruct : SpriteBounds { PalSpriteID ground; PalSpriteID building; - uint8_t draw_proc; // this allows to specify a special drawing procedure. + uint8_t draw_proc; ///< This allows to specify a special drawing procedure. }; void DrawCommonTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32_t orig_offset, uint32_t newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned); diff --git a/src/spritecache.cpp b/src/spritecache.cpp index 562756d31f..e7745ad124 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -25,7 +25,7 @@ #include "safeguards.h" -/* Default of 4MB spritecache */ +/** Default of 4MB spritecache. */ uint _sprite_cache_size = 4; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 38f5cd1c9f..d0c49fcafb 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -276,7 +276,7 @@ protected: ALL_CARGOTYPES, }; - /* Constants for sorting stations */ + /** Strings describing how stations are sorted. */ static inline const StringID sorter_names[] = { STR_SORT_BY_NAME, STR_SORT_BY_FACILITY, @@ -285,7 +285,7 @@ protected: STR_SORT_BY_RATING_MAX, STR_SORT_BY_RATING_MIN, }; - static const std::initializer_list sorter_funcs; + static const std::initializer_list sorter_funcs; ///< Functions to sort stations. FilterState filter{}; GUIStationList stations{filter.cargoes}; diff --git a/src/strgen/strgen.h b/src/strgen/strgen.h index fd6dc9ca85..429fdb6801 100644 --- a/src/strgen/strgen.h +++ b/src/strgen/strgen.h @@ -144,7 +144,7 @@ struct CmdPair { struct ParsedCommandStruct { std::vector non_consuming_commands; - std::array consuming_commands{ nullptr }; // ordered by param # + std::array consuming_commands{ nullptr }; ///< Ordered by param #. }; const CmdStruct *TranslateCmdForCompare(const CmdStruct *a); diff --git a/src/strings.cpp b/src/strings.cpp index cd072177ef..ec49c8d94b 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -265,7 +265,7 @@ static void FormatString(StringBuilder &builder, std::string_view str, std::span } struct LanguagePack : public LanguagePackHeader { - char data[]; // list of strings + char data[]; ///< List of strings. }; struct LanguagePackDeleter { diff --git a/src/table/airport_defaults.h b/src/table/airport_defaults.h index 781645f4e8..734e2737f0 100644 --- a/src/table/airport_defaults.h +++ b/src/table/airport_defaults.h @@ -375,7 +375,7 @@ static const std::initializer_list _tile_table_helistation = AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _airport_depots_##ap_name, \ size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true) -/* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */ +/** The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level. */ extern const AirportSpec _origin_airport_specs[] = { AS(country, 4, 3, 0, 1959, 4, 3, 7, ATP_TTDP_SMALL, APC_SMALL, STR_AIRPORT_SMALL, SPR_AIRPORT_PREVIEW_SMALL), AS(city, 6, 6, 1955, CalendarTime::MAX_YEAR, 5, 5, 24, ATP_TTDP_LARGE, APC_LARGE, STR_AIRPORT_CITY, SPR_AIRPORT_PREVIEW_LARGE), diff --git a/src/table/autorail.h b/src/table/autorail.h index 71a038d77f..d588fd3287 100644 --- a/src/table/autorail.h +++ b/src/table/autorail.h @@ -18,8 +18,10 @@ /* mark invalid tiles red */ #define RED(c) -c -/* table maps each of the six rail directions and tileh combinations to a sprite - * invalid entries are required to make sure that this array can be quickly accessed */ +/** + * Table maps each of the six rail directions and tileh combinations to a sprite. + * Invalid entries are required to make sure that this array can be quickly accessed. + */ static const int _AutorailTilehSprite[][6] = { /* type 0 1 2 3 4 5 */ { 0, 8, 16, 25, 34, 42 }, // tileh = 0 @@ -57,8 +59,7 @@ static const int _AutorailTilehSprite[][6] = { #undef RED -/* maps each pixel of a tile (16x16) to a selection type - * (0,0) is the top corner, (16,16) the bottom corner */ +/** Maps each pixel of a tile (16x16) to a selection type (0,0) is the top corner, (16,16) the bottom corner. */ static const HighLightStyle _autorail_piece[][16] = { { HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR }, { HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_HU, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_X, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR, HT_DIR_VR }, diff --git a/src/table/bridge_land.h b/src/table/bridge_land.h index cfab1fecf9..9717c7faf9 100644 --- a/src/table/bridge_land.h +++ b/src/table/bridge_land.h @@ -37,13 +37,13 @@ # define MW(a) {a, PALETTE_TO_STRUCT_WHITE} # define MC(a) {a, PALETTE_TO_STRUCT_CONCRETE} -/* Sprite table for middle part of aqueduct. */ +/** Sprite table for middle part of aqueduct. */ static const PalSpriteID _aqueduct_sprite_table_middle[] = { {SPR_AQUEDUCT_MIDDLE_X, PAL_NONE}, {0x0, PAL_NONE}, {SPR_AQUEDUCT_PILLAR_X, PAL_NONE}, {0x0, PAL_NONE}, // AXIS_X {SPR_AQUEDUCT_MIDDLE_Y, PAL_NONE}, {0x0, PAL_NONE}, {SPR_AQUEDUCT_PILLAR_Y, PAL_NONE}, {0x0, PAL_NONE}, // AIXS_Y }; -/* Sprite table for head part of aqueduct. */ +/** Sprite table for head part of aqueduct. */ static const PalSpriteID _aqueduct_sprite_table_heads[] = { {SPR_AQUEDUCT_RAMP_SW, PAL_NONE}, {SPR_AQUEDUCT_RAMP_SE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NW, PAL_NONE}, }; diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h index 008faa9043..97631b655b 100644 --- a/src/table/elrail_data.h +++ b/src/table/elrail_data.h @@ -202,7 +202,7 @@ static const Directions _disallowed_ppp_of_track_at_pcp[TRACK_END][DIAGDIR_END] {{DIR_S, DIR_N}, {DIR_S, DIR_N}, {}, {}, }, // RIGHT }; -/* This array stores which track bits can meet at a tile edge */ +/** This array stores which track bits can meet at a tile edge. */ static const Track _tracks_at_pcp[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { {TRACK_X, TRACK_X, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, @@ -210,8 +210,7 @@ static const Track _tracks_at_pcp[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { {TRACK_Y, TRACK_Y, TRACK_UPPER, TRACK_LOWER, TRACK_LEFT, TRACK_RIGHT}, }; -/* takes each of the 6 track bits from the array above and - * assigns it to the home tile or neighbour tile */ +/** Takes each of the 6 track bits from the array above and assigns it to the home tile or neighbour tile. */ static const TileSource _track_source_tile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME }, {TS_HOME, TS_NEIGHBOUR, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME }, @@ -219,7 +218,7 @@ static const TileSource _track_source_tile[DIAGDIR_END][NUM_TRACKS_AT_PCP] = { {TS_HOME, TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR, TS_HOME , TS_NEIGHBOUR}, }; -/* Several PPPs maybe exist, here they are sorted in order of preference. */ +/** Several PPPs maybe exist, here they are sorted in order of preference. */ static const Direction _ppp_order[DIAGDIR_END][TLG_END][DIR_END] = { // X - Y { // PCP 0 {DIR_NE, DIR_NW, DIR_SE, DIR_SW, DIR_N, DIR_E, DIR_S, DIR_W}, // evn - evn @@ -243,12 +242,16 @@ static const Direction _ppp_order[DIAGDIR_END][TLG_END][DIR_END] = { // X - {DIR_SW, DIR_SE, DIR_NE, DIR_NW, DIR_N, DIR_W, DIR_S, DIR_E}, // odd - odd } }; -/* Geometric placement of the PCP relative to the tile origin */ +/** @{ + * Geometric placement of the PCP relative to the tile origin. */ static const int8_t _x_pcp_offsets[DIAGDIR_END] = {0, 8, 16, 8}; static const int8_t _y_pcp_offsets[DIAGDIR_END] = {8, 16, 8, 0}; -/* Geometric placement of the PPP relative to the PCP*/ +/** @} */ +/** @{ + * Geometric placement of the PPP relative to the PCP.*/ static const int8_t _x_ppp_offsets[DIR_END] = {-2, -4, -2, 0, 2, 4, 2, 0}; static const int8_t _y_ppp_offsets[DIR_END] = {-2, 0, 2, 4, 2, 0, -2, -4}; +/** @} */ /** * Offset for pylon sprites from the base pylon sprite. @@ -264,7 +267,7 @@ enum PylonSpriteOffset : uint8_t { PSO_NS_E, }; -/* The type of pylon to draw at each PPP */ +/** The type of pylon to draw at each PPP. */ static const uint8_t _pylon_sprites[] = { PSO_EW_N, PSO_Y_NE, @@ -468,12 +471,14 @@ enum RailCatenarySprite : uint8_t { INVALID_CATENARY = 0xFF }; -/* Selects a Wire (with white and grey ends) depending on whether: +/** + * Selects a Wire (with white and grey ends) depending on whether: * a) none (should never happen) * b) the first * c) the second * d) both - * PCP exists.*/ + * PCP exists. + */ static const RailCatenarySprite _rail_wires[5][TRACK_END][4] = { { // Tileh == 0 {INVALID_CATENARY, WIRE_X_FLAT_NE, WIRE_X_FLAT_SW, WIRE_X_FLAT_BOTH}, diff --git a/src/table/industry_land.h b/src/table/industry_land.h index 3de1ef75cd..8e7e3a8e75 100644 --- a/src/table/industry_land.h +++ b/src/table/industry_land.h @@ -752,7 +752,7 @@ static const DrawBuildingsTileStruct _industry_draw_tile_data[NEW_INDUSTRYTILEOF }; #undef M -/* this is ONLY used for Sugar Mine*/ +/** This is ONLY used for Sugar Mine.*/ static const DrawIndustryAnimationStruct _draw_industry_spec1[96] = { { 8, 4, 0, 0}, { 6, 0, 1, 0}, @@ -852,7 +852,7 @@ static const DrawIndustryAnimationStruct _draw_industry_spec1[96] = { { 10, 4, 0, 4}, }; -/* this is ONLY used for Sugar Mine*/ +/** This is ONLY used for Sugar Mine.*/ static const DrawIndustryCoordinates _drawtile_proc1[5] = { {22, 73}, {17, 70}, @@ -923,7 +923,7 @@ static const DrawIndustryAnimationStruct _industry_anim_offs_toys[] = { }; #undef MD -/* this is ONLY used for Toffee Quarry*/ +/** This is ONLY used for Toffee Quarry.*/ static const uint8_t _industry_anim_offs_toffee[] = { 255, 0, 0, 0, 2, 4, 6, 8, 10, 9, 7, 5, 3, 1, 255, 0, 0, 0, 2, 4, @@ -934,7 +934,7 @@ static const uint8_t _industry_anim_offs_toffee[] = { 2, 4, 6, 8, 10, 9, 7, 5, 3, 1 }; -/* this is ONLY used for the Bubble Generator*/ +/** This is ONLY used for the Bubble Generator.*/ static const uint8_t _industry_anim_offs_bubbles[] = { 68, 69, 71, 74, 77, 80, 83, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, diff --git a/src/table/road_land.h b/src/table/road_land.h index a9547548ae..d31fc8cefa 100644 --- a/src/table/road_land.h +++ b/src/table/road_land.h @@ -34,8 +34,10 @@ static const DrawTileSpriteSpan _road_depot[] = { { {0xA4A, PAL_NONE}, _road_depot_NW } }; -/* Sprite layout for level crossings. The SpriteIDs are actually offsets - * from the base SpriteID returned from the NewGRF sprite resolver. */ +/** + * Sprite layout for level crossings. + * The SpriteIDs are actually offsets from the base SpriteID returned from the NewGRF sprite resolver. + */ static const DrawTileSeqStruct _crossing_layout_ALL[] = { TILE_SEQ_LINE(2, PAL_NONE, 0, 0, 3, 3) TILE_SEQ_LINE(4, PAL_NONE, 0, 13, 3, 3) diff --git a/src/table/signal_data.h b/src/table/signal_data.h index 4c1404cce0..ab68fe19ff 100644 --- a/src/table/signal_data.h +++ b/src/table/signal_data.h @@ -8,22 +8,19 @@ /** @file signal_data.h Data related to rail signals. */ /* XXX: Below 3 tables store duplicate data. Maybe remove some? */ -/* Maps a trackdir to the bit that stores its status in the map arrays, in the - * direction along with the trackdir */ +/** Maps a trackdir to the bit that stores its status in the map arrays, in the direction along with the trackdir. */ extern const uint8_t _signal_along_trackdir[TRACKDIR_END] = { 0x8, 0x8, 0x8, 0x2, 0x4, 0x1, 0, 0, 0x4, 0x4, 0x4, 0x1, 0x8, 0x2 }; -/* Maps a trackdir to the bit that stores its status in the map arrays, in the - * direction against the trackdir */ +/** Maps a trackdir to the bit that stores its status in the map arrays, in the direction against the trackdir. */ extern const uint8_t _signal_against_trackdir[TRACKDIR_END] = { 0x4, 0x4, 0x4, 0x1, 0x8, 0x2, 0, 0, 0x8, 0x8, 0x8, 0x2, 0x4, 0x1 }; -/* Maps a Track to the bits that store the status of the two signals that can - * be present on the given track */ +/** Maps a Track to the bits that store the status of the two signals that can be present on the given track. */ extern const uint8_t _signal_on_track[] = { 0xC, 0xC, 0xC, 0x3, 0xC, 0x3 }; diff --git a/src/table/station_land.h b/src/table/station_land.h index 42055d52a4..313cacd6c0 100644 --- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -328,18 +328,18 @@ static const DrawTileSeqStruct _station_display_datas_81[] = { TILE_SEQ_LINE( 4, 0, 0, 8, 16, 8, SPR_DOCK_FLAT_Y | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* Buoy, which will _always_ drown under the ship */ +/** Buoy, which will _always_ drown under the ship. */ static const DrawTileSeqStruct _station_display_datas_82[] = { TILE_SEQ_LINE( 4, -1, 0, 0, 0, 0, SPR_IMG_BUOY) }; -/* control tower without fence */ +/** Control tower without fence. */ static const DrawTileSeqStruct _station_display_tower[] = { TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_TOWER | (1U << PALETTE_MODIFIER_COLOUR)) // control tower }; -/* turning radar with fences on north -- needs 12 tiles - *BEGIN */ +/** @{ + * Turning radar with fences on north -- needs 12 tiles. */ static const DrawTileSeqStruct _station_display_radar_1_fence_ne[] = { TILE_SEQ_LINE(7, 7, 0, 2, 2, 8, SPR_AIRPORT_RADAR_1) // turning radar TILE_SEQ_LINE(0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) @@ -399,131 +399,131 @@ static const DrawTileSeqStruct _station_display_radar_12_fence_ne[] = { TILE_SEQ_LINE(7, 7, 0, 2, 2, 8, SPR_AIRPORT_RADAR_C) TILE_SEQ_LINE(0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* END */ +/** @} */ -/* helipad for international airport */ +/** Helipad for international airport. */ static const DrawTileSeqStruct _station_display_helipad_fence_sw[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences bottom }; -/* helipad for commuter airport */ +/** Helipad for commuter airport. */ static const DrawTileSeqStruct _station_display_helipad_fence_nw[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences left }; -/* helipad for continental airport */ +/** Helipad for continental airport. */ static const DrawTileSeqStruct _station_display_helipad[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) }; -/* asphalt tile with fences in north and south */ +/** Asphalt tile with fences in north and south. */ static const DrawTileSeqStruct _station_display_fence_ne_sw[] = { TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* runway tiles with 2 corner fences */ +/** Runway tiles with 2 corner fences. */ static const DrawTileSeqStruct _station_display_fence_nw_sw[] = { TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west }; -/* runway tiles with 2 corner fences */ +/** Runway tiles with 2 corner fences. */ static const DrawTileSeqStruct _station_display_fence_se_sw[] = { TILE_SEQ_GROUND(15, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_GROUND( 0, 15, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* runway tiles with 2 corner fences */ +/** Runway tiles with 2 corner fences. */ static const DrawTileSeqStruct _station_display_fence_ne_nw[] = { TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east }; -/* runway tiles with 2 corner fences */ +/** Runway tiles with 2 corner fences. */ static const DrawTileSeqStruct _station_display_fence_ne_se[] = { TILE_SEQ_GROUND( 0, 0, 0, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east TILE_SEQ_GROUND( 0, 15, 0, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* helipad tiles with 2 corner fences top+right */ +/** Helipad tiles with 2 corner fences top+right. */ static const DrawTileSeqStruct _station_display_helipad_fence_NE_SE[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* helidepot office with fences top + left */ +/** Helidepot office with fences top + left. */ static const DrawTileSeqStruct _station_display_low_building_fence_ne_nw[] = { TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences left TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* West facing hangar */ +/** West facing hangar. */ static const DrawTileSeqStruct _station_display_hangar_sw[] = { TILE_SEQ_LINE(14, 0, 0, 2, 17, 28, SPR_NEWHANGAR_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 0, 0, 2, 17, 28, SPR_NEWHANGAR_W_WALL | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* North facing hangar */ +/** North facing hangar. */ static const DrawTileSeqStruct _station_display_hangar_nw[] = { TILE_SEQ_LINE(14, 0, 0, 2, 16, 28, SPR_NEWHANGAR_N | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* East facing hangar */ +/** East facing hangar. */ static const DrawTileSeqStruct _station_display_hangar_ne[] = { TILE_SEQ_LINE(14, 0, 0, 2, 16, 28, SPR_NEWHANGAR_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* helipad for district airport NS */ +/** Helipad for district airport NS. */ static const DrawTileSeqStruct _station_display_helipad_fence_se_sw[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences bottom TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences right }; -/* helipad for district airport NS */ +/** Helipad for district airport NS. */ static const DrawTileSeqStruct _station_display_helipad_fence_se[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* helidepot office with fence north */ +/** Helidepot office with fence north. */ static const DrawTileSeqStruct _station_display_low_building_fence_nw[] = { TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* helidepot office with fence east */ +/** Helidepot office with fence east. */ static const DrawTileSeqStruct _station_display_low_building_fence_ne[] = { TILE_SEQ_LINE( 0, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences east TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* helidepot office with fence west */ +/** Helidepot office with fence west. */ static const DrawTileSeqStruct _station_display_low_building_fence_sw[] = { TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* helidepot office with fence south */ +/** Helidepot office with fence south. */ static const DrawTileSeqStruct _station_display_low_building_fence_se[] = { TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* helipad for district airport EW*/ +/** Helipad for district airport EW.*/ static const DrawTileSeqStruct _station_display_helipad_fence_nw_sw[] = { TILE_SEQ_LINE(10, 6, 0, 0, 0, 0, SPR_AIRPORT_HELIPAD) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north }; -/* turning radar with fences on south -- needs 12 tiles - *BEGIN */ +/** @{ + * Turning radar with fences on south -- needs 12 tiles. */ static const DrawTileSeqStruct _station_display_radar_1_fence_se[] = { TILE_SEQ_LINE( 7, 7, 0, 2, 2, 8, SPR_AIRPORT_RADAR_1) // turning radar TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south @@ -583,74 +583,74 @@ static const DrawTileSeqStruct _station_display_radar_12_fence_se[] = { TILE_SEQ_LINE( 7, 7, 0, 2, 2, 8, SPR_AIRPORT_RADAR_C) TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* END */ +/** @} */ -/* helipad for helistation */ +/** Helipad for helistation. */ static const DrawTileSeqStruct _station_display_newhelipad_fence_se_sw[] = { TILE_SEQ_LINE( 0, 1, 2, 0, 0, 0, SPR_NEWHELIPAD) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_LINE( 0, 15, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences south }; -/* helipad for helistation */ +/** Helipad for helistation. */ static const DrawTileSeqStruct _station_display_newhelipad_fence_nw_sw[] = { TILE_SEQ_LINE( 0, 1, 2, 0, 0, 0, SPR_NEWHELIPAD) TILE_SEQ_LINE(15, 0, 0, 1, 16, 6, SPR_AIRPORT_FENCE_Y | (1U << PALETTE_MODIFIER_COLOUR)) // fences west TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north }; -/* helipad for helistation */ +/** Helipad for helistation. */ static const DrawTileSeqStruct _station_display_newhelipad_fence_nw[] = { TILE_SEQ_LINE( 0, 1, 2, 0, 0, 0, SPR_NEWHELIPAD) TILE_SEQ_LINE( 0, 0, 0, 16, 1, 6, SPR_AIRPORT_FENCE_X | (1U << PALETTE_MODIFIER_COLOUR)) // fences north }; -/* helidepot office without fence */ +/** Helidepot office without fence. */ static const DrawTileSeqStruct _station_display_low_building[] = { TILE_SEQ_LINE( 3, 3, 0, 10, 10, 60, SPR_AIRPORT_HELIDEPOT_OFFICE | (1U << PALETTE_MODIFIER_COLOUR)) // helidepot office }; -/* half grass half SPR_AIRPORT_APRON */ +/** Half grass half SPR_AIRPORT_APRON. */ static const DrawTileSeqStruct _station_display_grass_west[] = { TILE_SEQ_LINE(0, 0, 0, 0, 0, 0, SPR_GRASS_LEFT) }; -/* half grass half SPR_AIRPORT_APRON */ +/** Half grass half SPR_AIRPORT_APRON. */ static const DrawTileSeqStruct _station_display_grass_east[] = { TILE_SEQ_LINE(0, 0, 0, 0, 0, 0, SPR_GRASS_RIGHT) }; -/* drive-through truck stop X */ +/** Drive-through truck stop X. */ static const DrawTileSeqStruct _station_display_datas_0168[] = { TILE_SEQ_LINE( 0, 0, 0, 16, 3, 16, SPR_TRUCK_STOP_DT_X_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 13, 0, 16, 3, 16, SPR_TRUCK_STOP_DT_X_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* drive-through truck stop Y */ +/** Drive-through truck stop Y. */ static const DrawTileSeqStruct _station_display_datas_0169[] = { TILE_SEQ_LINE(13, 0, 0, 3, 16, 16, SPR_TRUCK_STOP_DT_Y_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 0, 0, 3, 16, 16, SPR_TRUCK_STOP_DT_Y_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* drive-through bus stop X */ +/** Drive-through bus stop X. */ static const DrawTileSeqStruct _station_display_datas_0170[] = { TILE_SEQ_LINE( 0, 0, 0, 16, 3, 16, SPR_BUS_STOP_DT_X_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 13, 0, 16, 3, 16, SPR_BUS_STOP_DT_X_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* drive-through bus stop Y */ +/** Drive-through bus stop Y. */ static const DrawTileSeqStruct _station_display_datas_0171[] = { TILE_SEQ_LINE(13, 0, 0, 3, 16, 16, SPR_BUS_STOP_DT_Y_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 0, 0, 3, 16, 16, SPR_BUS_STOP_DT_Y_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* road waypoint X */ +/** Road waypoint X. */ static const DrawTileSeqStruct _station_display_datas_road_waypoint_X[] = { TILE_SEQ_LINE( 0, 0, 0, 16, 3, 16, SPR_ROAD_WAYPOINT_X_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 13, 0, 16, 3, 16, SPR_ROAD_WAYPOINT_X_E | (1U << PALETTE_MODIFIER_COLOUR)) }; -/* road waypoint Y */ +/** Road waypoint Y. */ static const DrawTileSeqStruct _station_display_datas_road_waypoint_Y[] = { TILE_SEQ_LINE(13, 0, 0, 3, 16, 16, SPR_ROAD_WAYPOINT_Y_W | (1U << PALETTE_MODIFIER_COLOUR)) TILE_SEQ_LINE( 0, 0, 0, 3, 16, 16, SPR_ROAD_WAYPOINT_Y_E | (1U << PALETTE_MODIFIER_COLOUR)) diff --git a/src/table/townname.h b/src/table/townname.h index da572151ea..e5fb8a8205 100644 --- a/src/table/townname.h +++ b/src/table/townname.h @@ -1715,7 +1715,7 @@ enum CzechPattern : uint8_t { CZP_PRIVL }; -/* [CzechGender][CzechPattern] - suffixes for adjectives */ +/** [CzechGender][CzechPattern] - suffixes for adjectives. */ static const std::string_view _name_czech_patmod[][3] = { /* CZG_SMASC */ { "\u00ed", "\u00fd", "uv" }, /* CZG_SFEM */ { "\u00ed", "\u00e1", "ova" }, @@ -1761,7 +1761,7 @@ struct CzechNameAdj { std::string_view name; }; -/* Some of items which should be common are doubled. */ +/** Adjectives for Czech town names. @note Some of items which should be common are doubled. */ static const CzechNameAdj _name_czech_adj[] = { { CZP_JARNI, CZC_ANY, "Horn" }, { CZP_JARNI, CZC_ANY, "Horn" }, @@ -1813,7 +1813,7 @@ static const CzechNameAdj _name_czech_adj[] = { { CZP_PRIVL, CZC_ANY, "Sud" }, }; -/* Considered a stem for choose/allow matching purposes. */ +/** Considered a stem for choose/allow matching purposes. */ static const CzechNameSubst _name_czech_subst_full[] = { { CZG_SMASC, CZA_ALL, CzechChooseFlag::Colour, "Sedlec" }, { CZG_SMASC, CZA_ALL, CzechChooseFlag::Colour, "Brod" }, @@ -1833,7 +1833,7 @@ static const CzechNameSubst _name_czech_subst_full[] = { { CZG_PNEUT, CZA_ALL, CzechChooseFlag::Colour, "Pole" }, }; -/* TODO: More stems needed. --pasky */ +/** Beginnings for Czech town names. */ static const CzechNameSubst _name_czech_subst_stem[] = { { CZG_SMASC, { CzechAllowFlag::Middle }, CzechChooseFlag::Colour, "Kostel" }, { CZG_SMASC, { CzechAllowFlag::Middle }, CzechChooseFlag::Colour, "Kl\u00e1\u0161ter" }, @@ -1879,14 +1879,14 @@ static const CzechNameSubst _name_czech_subst_stem[] = { { CZG_FREE, { CzechAllowFlag::Middle, CzechAllowFlag::Long}, {}, "Lip" }, }; -/* Optional postfix inserted between stem and ending. */ +/** Optional postfix inserted between stem and ending. */ static const std::string_view _name_czech_subst_postfix[] = { "av", "an", "at", "ov", "on", "ot", "ev", "en", "et", }; -/* This array must have the both neutral genders at the end! */ +/** Endings for Czech town names. @important This array must have the both neutral genders at the end! */ static const CzechNameSubst _name_czech_subst_ending[] = { { CZG_SMASC, {CzechAllowFlag::Short, CzechAllowFlag::Middle }, CZC_ANY, "ec" }, { CZG_SMASC, {CzechAllowFlag::Short, CzechAllowFlag::Middle }, CZC_ANY, "\u00edn" }, diff --git a/src/table/track_data.h b/src/table/track_data.h index ceb0910beb..7a4794c299 100644 --- a/src/table/track_data.h +++ b/src/table/track_data.h @@ -7,8 +7,9 @@ /** @file track_data.h Data related to rail tracks. */ -/* Maps a diagonal direction to the all trackdirs that are connected to any - * track entering in this direction (including those making 90 degree turns) +/** + * Maps a diagonal direction to the all trackdirs that are connected to any + * track entering in this direction (including those making 90 degree turns). */ extern const TrackdirBits _exitdir_reaches_trackdirs[] = { TRACKDIR_BIT_X_NE | TRACKDIR_BIT_LOWER_E | TRACKDIR_BIT_LEFT_N, // DIAGDIR_NE @@ -22,7 +23,7 @@ extern const Trackdir _next_trackdir[TRACKDIR_END] = { TRACKDIR_X_SW, TRACKDIR_Y_NW, TRACKDIR_LOWER_W, TRACKDIR_UPPER_W, TRACKDIR_RIGHT_N, TRACKDIR_LEFT_N }; -/* Maps a trackdir to all trackdirs that make 90 deg turns with it. */ +/** Maps a trackdir to all trackdirs that make 90 deg turns with it. */ extern const TrackdirBits _track_crosses_trackdirs[TRACK_END] = { TRACKDIR_BIT_Y_SE | TRACKDIR_BIT_Y_NW, // TRACK_X TRACKDIR_BIT_X_NE | TRACKDIR_BIT_X_SW, // TRACK_Y @@ -32,7 +33,7 @@ extern const TrackdirBits _track_crosses_trackdirs[TRACK_END] = { TRACKDIR_BIT_UPPER_W | TRACKDIR_BIT_UPPER_E | TRACKDIR_BIT_LOWER_W | TRACKDIR_BIT_LOWER_E // TRACK_RIGHT }; -/* Maps a track to all tracks that make 90 deg turns with it. */ +/** Maps a track to all tracks that make 90 deg turns with it. */ extern const TrackBits _track_crosses_tracks[] = { TRACK_BIT_Y, // TRACK_X TRACK_BIT_X, // TRACK_Y @@ -42,8 +43,7 @@ extern const TrackBits _track_crosses_tracks[] = { TRACK_BIT_HORZ // TRACK_RIGHT }; -/* Maps a trackdir to the (4-way) direction the tile is exited when following - * that trackdir */ +/** Maps a trackdir to the (4-way) direction the tile is exited when following that trackdir. */ extern const DiagDirection _trackdir_to_exitdir[TRACKDIR_END] = { DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_SE, DIAGDIR_SW, DIAGDIR_SE, DIAGDIR_NE, DIAGDIR_NE, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NW, DIAGDIR_SW, DIAGDIR_NW, DIAGDIR_NE, diff --git a/src/table/train_sprites.h b/src/table/train_sprites.h index 4fe7b53a83..205d37fa9d 100644 --- a/src/table/train_sprites.h +++ b/src/table/train_sprites.h @@ -20,8 +20,7 @@ static const SpriteID _engine_sprite_base[] = { 0x0B31, 0x0B35, }; -/* For how many directions do we have sprites? (8 or 4; if 4, the other 4 - * directions are symmetric. */ +/** For how many directions do we have sprites? (8 or 4; if 4, the other 4 directions are symmetric. */ static const uint8_t _engine_sprite_and[] = { 7, 7, 7, 7, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, @@ -35,7 +34,7 @@ static const uint8_t _engine_sprite_and[] = { 3, 3, }; -/* Non-zero for multihead trains. */ +/** Non-zero for multihead trains. */ static const uint8_t _engine_sprite_add[] = { 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 4, 0, 0, 0, 0, diff --git a/src/timer/timer_game_calendar.h b/src/timer/timer_game_calendar.h index 6448db2d89..2bdd55fc14 100644 --- a/src/timer/timer_game_calendar.h +++ b/src/timer/timer_game_calendar.h @@ -45,7 +45,7 @@ class CalendarTime : public TimerGameConst { public: static constexpr int DEF_MINUTES_PER_YEAR = 12; static constexpr int FROZEN_MINUTES_PER_YEAR = 0; - static constexpr int MAX_MINUTES_PER_YEAR = 10080; // One week of real time. The actual max that doesn't overflow TimerGameCalendar::sub_date_fract is 10627, but this is neater. + static constexpr int MAX_MINUTES_PER_YEAR = 10080; ///< One week of real time. The actual max that doesn't overflow TimerGameCalendar::sub_date_fract is 10627, but this is neater. }; #endif /* TIMER_GAME_CALENDAR_H */ diff --git a/src/town.h b/src/town.h index 6ab3922b8c..e17ad94337 100644 --- a/src/town.h +++ b/src/town.h @@ -65,12 +65,14 @@ struct Town : TownPool::PoolItem<&_town_pool> { TownCache cache{}; ///< Container for all cacheable data. - /* Town name */ + /** @name Town name. + * @{ */ uint32_t townnamegrfid = 0; uint16_t townnametype = 0; uint32_t townnameparts = 0; std::string name{}; ///< Custom town name. If empty, the town was not renamed and uses the generated name. mutable std::string cached_name{}; ///< NOSAVE: Cache of the resolved name of the town, if not using a custom town name + /** @} */ TownFlags flags{}; ///< See #TownFlags. diff --git a/src/town_gui.cpp b/src/town_gui.cpp index f64ad6e126..336434a441 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -718,16 +718,16 @@ static constexpr std::initializer_list _nested_town_directory_widge /** Town directory window class. */ struct TownDirectoryWindow : public Window { private: - /* Runtime saved values */ + /** Retains sorting setting when closing the window. */ static Listing last_sorting; - /* Constants for sorting towns */ + /** Strings describing how towns are sorted. */ static inline const StringID sorter_names[] = { STR_SORT_BY_NAME, STR_SORT_BY_POPULATION, STR_SORT_BY_RATING, }; - static const std::initializer_list sorter_funcs; + static const std::initializer_list sorter_funcs; ///< Functions to sort towns. StringFilter string_filter{}; ///< Filter for towns QueryString townname_editbox; ///< Filter editbox @@ -1479,8 +1479,7 @@ public: static inline int sel_type; ///< Currently selected HouseID. static inline int sel_view; ///< Currently selected 'view'. This is not controllable as its based on random data. - /* Houses do not have classes like NewGRFClass. We'll make up fake classes based on town zone - * availability instead. */ + /** Houses do not have classes like NewGRFClass. We'll make up fake classes based on town zone availability instead. */ static inline const std::array zone_names = { STR_HOUSE_PICKER_CLASS_ZONE1, STR_HOUSE_PICKER_CLASS_ZONE2, diff --git a/src/vehicle.cpp b/src/vehicle.cpp index af155dbeea..8681f34622 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -65,13 +65,17 @@ #include "safeguards.h" -/* Number of bits in the hash to use from each vehicle coord */ +/** @{ + * Number of bits in the hash to use from each vehicle coord. */ static const uint GEN_HASHX_BITS = 6; static const uint GEN_HASHY_BITS = 6; +/** @} */ -/* Size of each hash bucket */ +/** @{ + * Size of each hash bucket. */ static const uint GEN_HASHX_BUCKET_BITS = 7; static const uint GEN_HASHY_BUCKET_BITS = 6; +/** @} */ /* Compute hash for vehicle coord */ static inline uint GetViewportHashX(int x) @@ -89,18 +93,23 @@ static inline uint GetViewportHash(int x, int y) return GetViewportHashX(x) + GetViewportHashY(y); } -/* Maximum size until hash repeats */ +/** @{ + * Maximum size until hash repeats. */ static const uint GEN_HASHX_SIZE = 1 << (GEN_HASHX_BUCKET_BITS + GEN_HASHX_BITS + ZOOM_BASE_SHIFT); static const uint GEN_HASHY_SIZE = 1 << (GEN_HASHY_BUCKET_BITS + GEN_HASHY_BITS + ZOOM_BASE_SHIFT); +/** @} */ -/* Increments to reach next bucket in hash table */ +/** @{ + * Increments to reach next bucket in hash table. */ static const uint GEN_HASHX_INC = 1; static const uint GEN_HASHY_INC = 1 << GEN_HASHX_BITS; +/** @} */ -/* Mask to wrap-around buckets */ +/** @{ + * Mask to wrap-around buckets. */ static const uint GEN_HASHX_MASK = (1 << GEN_HASHX_BITS) - 1; static const uint GEN_HASHY_MASK = ((1 << GEN_HASHY_BITS) - 1) << GEN_HASHX_BITS; - +/** @} */ /** The pool with all our precious vehicles. */ VehiclePool _vehicle_pool("Vehicle"); @@ -381,15 +390,20 @@ Vehicle::Vehicle(VehicleID index, VehicleType type) : VehiclePool::PoolItem<&_ve this->last_loading_station = StationID::Invalid(); } -/* Size of the hash, 6 = 64 x 64, 7 = 128 x 128. Larger sizes will (in theory) reduce hash - * lookup times at the expense of memory usage. */ +/** @{ + * Size of the hash, 6 = 64 x 64, 7 = 128 x 128. + * Larger sizes will (in theory) reduce hash lookup times at the expense of memory usage. + */ constexpr uint TILE_HASH_BITS = 7; constexpr uint TILE_HASH_SIZE = 1 << TILE_HASH_BITS; constexpr uint TILE_HASH_MASK = TILE_HASH_SIZE - 1; constexpr uint TOTAL_TILE_HASH_SIZE = 1 << (TILE_HASH_BITS * 2); +/** @} */ -/* Resolution of the hash, 0 = 1*1 tile, 1 = 2*2 tiles, 2 = 4*4 tiles, etc. - * Profiling results show that 0 is fastest. */ +/** + * Resolution of the hash, 0 = 1*1 tile, 1 = 2*2 tiles, 2 = 4*4 tiles, etc. + * Profiling results show that 0 is fastest. + */ constexpr uint TILE_HASH_RES = 0; /** diff --git a/src/vehicle_base.h b/src/vehicle_base.h index cde4bfd1bb..dc73de3dc0 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -25,8 +25,8 @@ #include "saveload/saveload.h" #include "timer/timer_game_calendar.h" -const uint TILE_AXIAL_DISTANCE = 192; // Logical length of the tile in any DiagDirection used in vehicle movement. -const uint TILE_CORNER_DISTANCE = 128; // Logical length of the tile corner crossing in any non-diagonal direction used in vehicle movement. +const uint TILE_AXIAL_DISTANCE = 192; ///< Logical length of the tile in any DiagDirection used in vehicle movement. +const uint TILE_CORNER_DISTANCE = 128; ///< Logical length of the tile corner crossing in any non-diagonal direction used in vehicle movement. /** Vehicle state bits in #Vehicle::vehstatus. */ enum class VehState : uint8_t { diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 3b5dffc772..95a7cfa317 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -43,7 +43,12 @@ #include "safeguards.h" -/* Tables used in vehicle_func.h to find the right error message for a certain vehicle type */ +/** + * @name Tables used to find the right error message for a certain vehicle type. + * @see vehicle_func.h + * @{ + */ +/** When can't buy such vehicle. */ const StringID _veh_build_msg_table[] = { STR_ERROR_CAN_T_BUY_TRAIN, STR_ERROR_CAN_T_BUY_ROAD_VEHICLE, @@ -51,6 +56,7 @@ const StringID _veh_build_msg_table[] = { STR_ERROR_CAN_T_BUY_AIRCRAFT, }; +/** When can't sell such vehicle. */ const StringID _veh_sell_msg_table[] = { STR_ERROR_CAN_T_SELL_TRAIN, STR_ERROR_CAN_T_SELL_ROAD_VEHICLE, @@ -58,6 +64,7 @@ const StringID _veh_sell_msg_table[] = { STR_ERROR_CAN_T_SELL_AIRCRAFT, }; +/** When can't sell all vehicles in depot. */ const StringID _veh_sell_all_msg_table[] = { STR_ERROR_CAN_T_SELL_ALL_TRAIN, STR_ERROR_CAN_T_SELL_ALL_ROAD_VEHICLE, @@ -65,6 +72,7 @@ const StringID _veh_sell_all_msg_table[] = { STR_ERROR_CAN_T_SELL_ALL_AIRCRAFT, }; +/** When can't autoreplace such vehicle. */ const StringID _veh_autoreplace_msg_table[] = { STR_ERROR_CAN_T_AUTOREPLACE_TRAIN, STR_ERROR_CAN_T_AUTOREPLACE_ROAD_VEHICLE, @@ -72,6 +80,7 @@ const StringID _veh_autoreplace_msg_table[] = { STR_ERROR_CAN_T_AUTOREPLACE_AIRCRAFT, }; +/** When can't refit such vehicle. */ const StringID _veh_refit_msg_table[] = { STR_ERROR_CAN_T_REFIT_TRAIN, STR_ERROR_CAN_T_REFIT_ROAD_VEHICLE, @@ -79,12 +88,14 @@ const StringID _veh_refit_msg_table[] = { STR_ERROR_CAN_T_REFIT_AIRCRAFT, }; +/** When can't send to depot such vehicle. */ const StringID _send_to_depot_msg_table[] = { STR_ERROR_CAN_T_SEND_TRAIN_TO_DEPOT, STR_ERROR_CAN_T_SEND_ROAD_VEHICLE_TO_DEPOT, STR_ERROR_CAN_T_SEND_SHIP_TO_DEPOT, STR_ERROR_CAN_T_SEND_AIRCRAFT_TO_HANGAR, }; +/** @} */ /** diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 7e70041d2d..30b892b0ae 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -550,7 +550,7 @@ DropDownList BaseVehicleListWindow::BuildActionDropdownList(bool show_autoreplac return list; } -/* cached values for VehicleNameSorter to spare many GetString() calls */ +/** Cached values for VehicleNameSorter to spare many GetString() calls. */ static const Vehicle *_last_vehicle[2] = { nullptr, nullptr }; void BaseVehicleListWindow::SortVehicleList() @@ -2917,10 +2917,12 @@ static const ZoomLevel _vehicle_view_zoom_levels[] = { ZoomLevel::Aircraft, }; -/* Constants for geometry of vehicle view viewport */ +/** @{ + * Constants for geometry of vehicle view viewport. */ static const int VV_INITIAL_VIEWPORT_WIDTH = 226; static const int VV_INITIAL_VIEWPORT_HEIGHT = 84; static const int VV_INITIAL_VIEWPORT_HEIGHT_TRAIN = 102; +/** @} */ /** Command indices for the _vehicle_command_translation_table. */ enum VehicleCommandTranslation : uint8_t { diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index ef7f12b654..8d78f7bf59 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -94,7 +94,7 @@ static void CloseWindowsConsoleThread() static std::unique_ptr _dedicated_video_mem; -/* Whether a fork has been done. */ +/** Whether a fork has been done. */ bool _dedicated_forks; extern bool SafeLoad(const std::string &filename, SaveLoadOperation fop, DetailedFileType dft, GameMode newgm, Subdirectory subdir, struct LoadFilter *lf = nullptr); diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index 20e447c497..06930ae47a 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -22,7 +22,7 @@ #include "safeguards.h" -/* Extra Viewport Window Stuff */ +/** Extra viewport window widgets. */ static constexpr std::initializer_list _nested_extra_viewport_widgets = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), diff --git a/src/window.cpp b/src/window.cpp index 2bfe14d9d0..763d9c1425 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -77,9 +77,9 @@ WindowList _z_windows; /** If false, highlight is white, otherwise the by the widget defined colour. */ bool _window_highlight_colour = false; -/* +/** * Window that currently has focus. - The main purpose is to generate - * #FocusLost events, not to give next window in z-order focus when a + * #Window::OnFocusLost events, not to give next window in z-order focus when a * window is closed. */ Window *_focused_window;