mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-15 23:29:42 +00:00
Codechange: Make some variables and constants documentation comments recognised by doxygen.
This commit is contained in:
committed by
rubidium42
parent
7a6b7fb1f0
commit
21bee91fa7
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
+2
-3
@@ -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<GUIBridgeList::SortFunction * const> sorter_funcs;
|
||||
static const std::initializer_list<GUIBridgeList::SortFunction * const> sorter_funcs; ///< Functions to sort bridges.
|
||||
|
||||
/* Internal variables */
|
||||
TileIndex start_tile = INVALID_TILE;
|
||||
TileIndex end_tile = INVALID_TILE;
|
||||
TransportType transport_type = INVALID_TRANSPORT;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
#include "console_type.h"
|
||||
#include "core/format.hpp"
|
||||
|
||||
/* console modes */
|
||||
/** Console modes. */
|
||||
extern IConsoleModes _iconsole_mode;
|
||||
|
||||
/* console functions */
|
||||
|
||||
+1
-1
@@ -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<std::string> _iconsole_history;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ void SetPriceBaseMultiplier(Price price, int factor);
|
||||
extern const EnumClassIndexContainer<std::array<ScoreInfo, to_underlying(ScoreID::End)>, ScoreID> _score_info;
|
||||
extern TypedIndexContainer<std::array<EnumClassIndexContainer<std::array<int64_t, to_underlying(ScoreID::End)>, 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);
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public:
|
||||
std::vector<BadgeID> badges{};
|
||||
|
||||
private:
|
||||
/* Vehicle-type specific information. */
|
||||
/** Vehicle-type specific information. */
|
||||
std::variant<std::monostate, RailVehicleInfo, RoadVehicleInfo, ShipVehicleInfo, AircraftVehicleInfo> vehicle_info{};
|
||||
|
||||
public:
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+11
-8
@@ -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<double>(INT64_MAX - 512); ///< The biggest double that when cast to int64_t still fits in a int64_t.
|
||||
static_assert(static_cast<int64_t>(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{};
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
@@ -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<GUIIndustryList::SortFunction * const> sorter_funcs;
|
||||
static const std::initializer_list<GUIIndustryList::SortFunction * const> 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).
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -149,8 +149,8 @@ template <class Titem, int Thash_bits_>
|
||||
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:
|
||||
/**
|
||||
|
||||
+5
-3
@@ -18,18 +18,20 @@
|
||||
#include "safeguards.h"
|
||||
|
||||
struct MixerChannel {
|
||||
/* pointer to allocated buffer memory */
|
||||
/** Pointer to allocated buffer memory. */
|
||||
std::shared_ptr<std::vector<std::byte>> 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;
|
||||
};
|
||||
|
||||
@@ -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<GUIGameServerList::SortFunction * const> sorter_funcs;
|
||||
/** Functions for filtering servers. */
|
||||
static const std::initializer_list<GUIGameServerList::FilterFunction * const> 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
|
||||
|
||||
@@ -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<const SpriteGroup *, MAX_SPRITEGROUP + 1> spritegroups{};
|
||||
|
||||
/** Clear temporary data before processing the next file in the current loading stage */
|
||||
|
||||
+2
-2
@@ -1887,7 +1887,7 @@ std::unique_ptr<NWidgetBase> NewGRFDisplay()
|
||||
return std::make_unique<NWidgetNewGRFDisplay>(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<NWidgetPart> _nested_newgrf_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
|
||||
@@ -1904,7 +1904,7 @@ static constexpr std::initializer_list<NWidgetPart> _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,
|
||||
|
||||
@@ -188,10 +188,10 @@ struct DeterministicSpriteGroup : SpecializedSpriteGroup<DeterministicSpriteGrou
|
||||
std::vector<DeterministicSpriteGroupAdjust> adjusts{};
|
||||
std::vector<DeterministicSpriteGroupRange> 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;
|
||||
|
||||
+8
-8
@@ -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<NWidgetPart> _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<NWidgetPart> _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<NWidgetPart> _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<NWidgetPart> _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<NWidgetPart> _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)
|
||||
{
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+4
-4
@@ -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.
|
||||
|
||||
+6
-1
@@ -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<uint8_t, 1U << (PALETTE_BITS * 3)>;
|
||||
static PaletteLookup _palette_lookup{};
|
||||
/** @} */
|
||||
|
||||
/** @{
|
||||
* Reshade lookup table. */
|
||||
using ReshadeLookup = std::array<uint8_t, 1U << PALETTE_BITS>;
|
||||
static ReshadeLookup _reshade_lookup{};
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Reduce bits per channel to PALETTE_BITS, and place value in the middle of the reduced range.
|
||||
|
||||
@@ -49,9 +49,9 @@ class WaterRegionData {
|
||||
friend class WaterRegion;
|
||||
|
||||
std::array<WaterRegionTraversabilityBits, DIAGDIR_END> edge_traversability_bits{};
|
||||
std::unique_ptr<WaterRegionPatchLabelArray> 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<WaterRegionPatchLabelArray> 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...
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 Types>
|
||||
class CYapfDestinationTileWaterT {
|
||||
|
||||
@@ -35,7 +35,7 @@ enum class EndSegmentReason : uint8_t {
|
||||
};
|
||||
using EndSegmentReasons = EnumBitSet<EndSegmentReason, uint16_t>;
|
||||
|
||||
/* 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,
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+11
-4
@@ -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;
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -68,10 +68,12 @@ public:
|
||||
|
||||
std::vector<Industry::AcceptedCargo> &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<CargoType, INDUSTRY_NUM_INPUTS> old_cargo;
|
||||
static inline std::array<uint16_t, INDUSTRY_NUM_INPUTS> old_waiting;
|
||||
static inline std::array<TimerGameEconomy::Date, INDUSTRY_NUM_INPUTS> old_last_accepted;
|
||||
/** @} */
|
||||
|
||||
static void ResetOldStructure()
|
||||
{
|
||||
@@ -127,7 +129,8 @@ public:
|
||||
|
||||
std::vector<Industry::ProducedCargo> &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<CargoType, INDUSTRY_NUM_OUTPUTS> old_cargo;
|
||||
static inline std::array<uint16_t, INDUSTRY_NUM_OUTPUTS> old_waiting;
|
||||
static inline std::array<uint8_t, INDUSTRY_NUM_OUTPUTS> old_rate;
|
||||
@@ -135,6 +138,7 @@ public:
|
||||
static inline std::array<uint16_t, INDUSTRY_NUM_OUTPUTS> old_this_month_transported;
|
||||
static inline std::array<uint16_t, INDUSTRY_NUM_OUTPUTS> old_last_month_production;
|
||||
static inline std::array<uint16_t, INDUSTRY_NUM_OUTPUTS> old_last_month_transported;
|
||||
/** @} */
|
||||
|
||||
static void ResetOldStructure()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -846,9 +846,11 @@ public:
|
||||
|
||||
class SlVehicleRoadVeh : public DefaultSaveLoadHandler<SlVehicleRoadVeh, Vehicle> {
|
||||
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<Trackdir> rv_path_td;
|
||||
static inline std::vector<TileIndex> rv_path_tile;
|
||||
/** @} */
|
||||
|
||||
static inline const SaveLoad description[] = {
|
||||
SLEG_STRUCT("common", SlVehicleCommon),
|
||||
|
||||
@@ -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<std::string> ScaleMarkFunc(int, int, int value)
|
||||
{
|
||||
|
||||
+3
-1
@@ -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 {
|
||||
|
||||
+3
-3
@@ -54,9 +54,9 @@ static const TrackdirBits _enterdir_to_trackdirbits[DIAGDIR_END] = {
|
||||
template <typename Tdir, uint items>
|
||||
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 {
|
||||
|
||||
+2
-2
@@ -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) :
|
||||
|
||||
+1
-1
@@ -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<std::is_same_v<P, std::nullptr_t>, P, P&>;
|
||||
const SortParameterReference params;
|
||||
const SortParameterReference params; ///< @copydoc SortParameterReference
|
||||
|
||||
/**
|
||||
* Check if the list is sortable
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/* Default of 4MB spritecache */
|
||||
/** Default of 4MB spritecache. */
|
||||
uint _sprite_cache_size = 4;
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -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<GUIStationList::SortFunction * const> sorter_funcs;
|
||||
static const std::initializer_list<GUIStationList::SortFunction * const> sorter_funcs; ///< Functions to sort stations.
|
||||
|
||||
FilterState filter{};
|
||||
GUIStationList stations{filter.cargoes};
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ struct CmdPair {
|
||||
|
||||
struct ParsedCommandStruct {
|
||||
std::vector<CmdPair> non_consuming_commands;
|
||||
std::array<const CmdStruct*, 32> consuming_commands{ nullptr }; // ordered by param #
|
||||
std::array<const CmdStruct*, 32> consuming_commands{ nullptr }; ///< Ordered by param #.
|
||||
};
|
||||
|
||||
const CmdStruct *TranslateCmdForCompare(const CmdStruct *a);
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
@@ -375,7 +375,7 @@ static const std::initializer_list<AirportTileLayout> _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),
|
||||
|
||||
@@ -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 },
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
+14
-9
@@ -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},
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
+40
-40
@@ -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))
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -45,7 +45,7 @@ class CalendarTime : public TimerGameConst<struct Calendar> {
|
||||
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 */
|
||||
|
||||
+3
-1
@@ -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.
|
||||
|
||||
|
||||
+4
-5
@@ -718,16 +718,16 @@ static constexpr std::initializer_list<NWidgetPart> _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<GUITownList::SortFunction * const> sorter_funcs;
|
||||
static const std::initializer_list<GUITownList::SortFunction * const> 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<StringID, NUM_HOUSE_ZONES> zone_names = {
|
||||
STR_HOUSE_PICKER_CLASS_ZONE1,
|
||||
STR_HOUSE_PICKER_CLASS_ZONE2,
|
||||
|
||||
+24
-10
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -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 {
|
||||
|
||||
+12
-1
@@ -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,
|
||||
};
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+4
-2
@@ -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 {
|
||||
|
||||
@@ -94,7 +94,7 @@ static void CloseWindowsConsoleThread()
|
||||
|
||||
static std::unique_ptr<uint8_t[]> _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);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
/* Extra Viewport Window Stuff */
|
||||
/** Extra viewport window widgets. */
|
||||
static constexpr std::initializer_list<NWidgetPart> _nested_extra_viewport_widgets = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user