1
0
Fork 0

Cleanup: Fix various spelling errors

pull/13522/head
Jonathan G Rennison 2025-02-12 17:18:02 +00:00 committed by rubidium42
parent 4d0682d034
commit d06b371254
76 changed files with 132 additions and 132 deletions

View File

@ -113,7 +113,7 @@ inline void Blitter_40bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
assert(VideoDriver::GetInstance()->GetAnimBuffer() != nullptr); assert(VideoDriver::GetInstance()->GetAnimBuffer() != nullptr);
uint8_t *anim = VideoDriver::GetInstance()->GetAnimBuffer() + ((uint32_t *)bp->dst - (uint32_t *)_screen.dst_ptr) + bp->top * bp->pitch + bp->left; uint8_t *anim = VideoDriver::GetInstance()->GetAnimBuffer() + ((uint32_t *)bp->dst - (uint32_t *)_screen.dst_ptr) + bp->top * bp->pitch + bp->left;
/* store so we don't have to access it via bp everytime (compiler assumes pointer aliasing) */ /* store so we don't have to access it via bp every time (compiler assumes pointer aliasing) */
const uint8_t *remap = bp->remap; const uint8_t *remap = bp->remap;
for (int y = 0; y < bp->height; y++) { for (int y = 0; y < bp->height; y++) {

View File

@ -184,7 +184,7 @@ public:
/** /**
* Gets the number of cargo aging periods this cargo has been in transit. * Gets the number of cargo aging periods this cargo has been in transit.
* By default a period is 2.5 days (CARGO_AGING_TICKS = 185 ticks), however * By default a period is 2.5 days (CARGO_AGING_TICKS = 185 ticks), however
* vehicle NewGRFs can overide the length of the cargo aging period. The * vehicle NewGRFs can override the length of the cargo aging period. The
* value is capped at UINT16_MAX. * value is capped at UINT16_MAX.
* @return Length this cargo has been in transit. * @return Length this cargo has been in transit.
*/ */

View File

@ -44,7 +44,7 @@ CargoTypes _standard_cargo_mask;
static std::vector<CargoLabel> _default_cargo_labels; static std::vector<CargoLabel> _default_cargo_labels;
/** /**
* Default cargo translation for upto version 7 NewGRFs. * Default cargo translation for up to version 7 NewGRFs.
* This maps the original 12 cargo slots to their original label. If a climate dependent cargo is not present it will * This maps the original 12 cargo slots to their original label. If a climate dependent cargo is not present it will
* map to CT_INVALID. For default cargoes this ends up as a 1:1 mapping via climate slot -> label -> cargo type. * map to CT_INVALID. For default cargoes this ends up as a 1:1 mapping via climate slot -> label -> cargo type.
*/ */
@ -137,7 +137,7 @@ void BuildCargoLabelMap()
for (const CargoSpec &cs : CargoSpec::array) { for (const CargoSpec &cs : CargoSpec::array) {
/* During initialization, CargoSpec can be marked valid before the label has been set. */ /* During initialization, CargoSpec can be marked valid before the label has been set. */
if (!cs.IsValid() || cs.label == CargoLabel{} || cs.label == CT_INVALID) continue; if (!cs.IsValid() || cs.label == CargoLabel{} || cs.label == CT_INVALID) continue;
/* Label already exists, don't addd again. */ /* Label already exists, don't add again. */
if (CargoSpec::label_map.count(cs.label) != 0) continue; if (CargoSpec::label_map.count(cs.label) != 0) continue;
CargoSpec::label_map.emplace(cs.label, cs.Index()); CargoSpec::label_map.emplace(cs.label, cs.Index());

View File

@ -85,7 +85,7 @@ struct CargoSpec {
bool is_freight; ///< Cargo type is considered to be freight (affects train freight multiplier). bool is_freight; ///< Cargo type is considered to be freight (affects train freight multiplier).
TownAcceptanceEffect town_acceptance_effect; ///< The effect that delivering this cargo type has on towns. Also affects destination of subsidies. TownAcceptanceEffect town_acceptance_effect; ///< The effect that delivering this cargo type has on towns. Also affects destination of subsidies.
TownProductionEffect town_production_effect = INVALID_TPE; ///< The effect on town cargo production. TownProductionEffect town_production_effect = INVALID_TPE; ///< The effect on town cargo production.
uint16_t town_production_multiplier = TOWN_PRODUCTION_DIVISOR; ///< Town production multipler, if commanded by TownProductionEffect. uint16_t town_production_multiplier = TOWN_PRODUCTION_DIVISOR; ///< Town production multiplier, if commanded by TownProductionEffect.
CargoCallbackMasks callback_mask; ///< Bitmask of cargo callbacks that have to be called CargoCallbackMasks callback_mask; ///< Bitmask of cargo callbacks that have to be called
StringID name; ///< Name of this type of cargo. StringID name; ///< Name of this type of cargo.

View File

@ -2334,7 +2334,7 @@ struct CompanyWindow : Window
} }
if (y == r.top) { if (y == r.top) {
/* No String was emited before, so there must be no vehicles at all. */ /* No String was emitted before, so there must be no vehicles at all. */
DrawString(r.left, r.right, y, STR_COMPANY_VIEW_VEHICLES_NONE); DrawString(r.left, r.right, y, STR_COMPANY_VIEW_VEHICLES_NONE);
} }
} }
@ -2377,7 +2377,7 @@ struct CompanyWindow : Window
} }
if (y == r.top) { if (y == r.top) {
/* No String was emited before, so there must be no infrastructure at all. */ /* No String was emitted before, so there must be no infrastructure at all. */
DrawString(r.left, r.right, y, STR_COMPANY_VIEW_INFRASTRUCTURE_NONE); DrawString(r.left, r.right, y, STR_COMPANY_VIEW_INFRASTRUCTURE_NONE);
} }
} }

View File

@ -29,7 +29,7 @@
*/ */
/** /**
* Ouptut a line of debugging information. * Output a line of debugging information.
* @param category The category of debug information. * @param category The category of debug information.
* @param level The maximum debug level this message should be shown at. When the debug level for this category is set lower, then the message will not be shown. * @param level The maximum debug level this message should be shown at. When the debug level for this category is set lower, then the message will not be shown.
* @param format_string The formatting string of the message. * @param format_string The formatting string of the message.

View File

@ -690,7 +690,7 @@ static void CompaniesGenStatistics()
} }
cur_company.Restore(); cur_company.Restore();
/* Only run the economic statics and update company stats every 3rd economy month (1st of quarter). */ /* Only run the economic statistics and update company stats every 3rd economy month (1st of quarter). */
if (!HasBit(1 << 0 | 1 << 3 | 1 << 6 | 1 << 9, TimerGameEconomy::month)) return; if (!HasBit(1 << 0 | 1 << 3 | 1 << 6 | 1 << 9, TimerGameEconomy::month)) return;
for (Company *c : Company::Iterate()) { for (Company *c : Company::Iterate()) {

View File

@ -426,7 +426,7 @@ bool TarScanner::AddFile(Subdirectory sd, const std::string &filename)
* header contains garbage and is malicious. So, we cannot rely on the string * header contains garbage and is malicious. So, we cannot rely on the string
* being properly terminated. * being properly terminated.
* As such, do not use strlen to determine the actual length (explicitly or * As such, do not use strlen to determine the actual length (explicitly or
* implictly via the std::string constructor), but pass the buffer bounds * implicitly via the std::string constructor), but pass the buffer bounds
* explicitly. * explicitly.
* @param buffer The buffer to read from. * @param buffer The buffer to read from.
* @return The string data. * @return The string data.

View File

@ -176,7 +176,7 @@ void Gamelog::Print(std::function<void(const std::string &)> proc)
/* virtual */ void LoggedChangeRevision::FormatTo(std::back_insert_iterator<std::string> &output_iterator, GrfIDMapping &, GamelogActionType) /* virtual */ void LoggedChangeRevision::FormatTo(std::back_insert_iterator<std::string> &output_iterator, GrfIDMapping &, GamelogActionType)
{ {
/* The game was loaded in a diffferent version than before. */ /* The game was loaded in a different version than before. */
fmt::format_to(output_iterator, "Revision text changed to {}, savegame version {}, ", fmt::format_to(output_iterator, "Revision text changed to {}, savegame version {}, ",
this->text, this->slver); this->text, this->slver);

View File

@ -17,7 +17,7 @@
* Information about the presence of a Grf at a certain point during gamelog history * Information about the presence of a Grf at a certain point during gamelog history
* Note about missing Grfs: * Note about missing Grfs:
* Changes to missing Grfs are not logged including manual removal of the Grf. * Changes to missing Grfs are not logged including manual removal of the Grf.
* So if the gamelog tells a Grf is missing we do not know whether it was readded or completely removed * So if the gamelog tells a Grf is missing we do not know whether it was re-added or completely removed
* at some later point. * at some later point.
*/ */
struct GRFPresence { struct GRFPresence {

View File

@ -52,7 +52,7 @@ static const uint CUSTOM_SEA_LEVEL_MAX_PERCENTAGE = 90; ///< Maximum percentag
static constexpr uint MAP_HEIGHT_LIMIT_ORIGINAL = 15; ///< Original map height limit. static constexpr uint MAP_HEIGHT_LIMIT_ORIGINAL = 15; ///< Original map height limit.
static const uint MAP_HEIGHT_LIMIT_AUTO_MINIMUM = 30; ///< When map height limit is auto, make this the lowest possible map height limit. static const uint MAP_HEIGHT_LIMIT_AUTO_MINIMUM = 30; ///< When map height limit is auto, make this the lowest possible map height limit.
static const uint MAP_HEIGHT_LIMIT_AUTO_CEILING_ROOM = 15; ///< When map height limit is auto, the map height limit will be the higest peak plus this value. static const uint MAP_HEIGHT_LIMIT_AUTO_CEILING_ROOM = 15; ///< When map height limit is auto, the map height limit will be the highest peak plus this value.
typedef void GWDoneProc(); ///< Procedure called when the genworld process finishes typedef void GWDoneProc(); ///< Procedure called when the genworld process finishes
typedef void GWAbortProc(); ///< Called when genworld is aborted typedef void GWAbortProc(); ///< Called when genworld is aborted

View File

@ -1786,7 +1786,7 @@ void UpdateGUIZoom()
/** /**
* Resolve GUI zoom level and adjust GUI to new zoom, if auto-suggestion is requested. * Resolve GUI zoom level and adjust GUI to new zoom, if auto-suggestion is requested.
* @param automatic Set if the change is occuring due to OS DPI scaling being changed. * @param automatic Set if the change is occurring due to OS DPI scaling being changed.
* @returns true when the zoom level has changed, caller must call ReInitAllWindows(true) * @returns true when the zoom level has changed, caller must call ReInitAllWindows(true)
* after resizing the application's window/buffer. * after resizing the application's window/buffer.
*/ */

View File

@ -149,7 +149,7 @@ int GroundVehicle<T, Type>::GetAcceleration() const
AccelStatus mode = v->GetAccelerationStatus(); AccelStatus mode = v->GetAccelerationStatus();
const int max_te = this->gcache.cached_max_te; // [N] const int max_te = this->gcache.cached_max_te; // [N]
/* Constructued from power, with need to multiply by 18 and assuming /* Constructed from power, with need to multiply by 18 and assuming
* low speed, it needs to be a 64 bit integer too. */ * low speed, it needs to be a 64 bit integer too. */
int64_t force; int64_t force;
if (speed > 0) { if (speed > 0) {

View File

@ -1788,7 +1788,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
a.cargo = indspec->accepts_cargo[index]; a.cargo = indspec->accepts_cargo[index];
} }
/* Randomize inital production if non-original economy is used and there are no production related callbacks. */ /* Randomize initial production if non-original economy is used and there are no production related callbacks. */
if (!indspec->UsesOriginalEconomy()) { if (!indspec->UsesOriginalEconomy()) {
for (auto &p : i->produced) { for (auto &p : i->produced) {
p.rate = ClampTo<uint8_t>((RandomRange(256) + 128) * p.rate >> 8); p.rate = ClampTo<uint8_t>((RandomRange(256) + 128) * p.rate >> 8);

View File

@ -180,7 +180,7 @@ inline void SetIndustryConstructionCounter(Tile tile, uint8_t value)
/** /**
* Reset the construction stage counter of the industry, * Reset the construction stage counter of the industry,
* as well as the completion bit. * as well as the completion bit.
* In fact, it is the same as restarting construction frmo ground up * In fact, it is the same as restarting construction from the ground up.
* @param tile the tile to query * @param tile the tile to query
* @pre IsTileType(tile, MP_INDUSTRY) * @pre IsTileType(tile, MP_INDUSTRY)
*/ */

View File

@ -260,7 +260,7 @@ uint GetPartialPixelZ(int x, int y, Slope corners)
case SLOPE_S: return x + y >= (int)TILE_SIZE ? (1 + x + y - TILE_SIZE) >> 1 : 0; case SLOPE_S: return x + y >= (int)TILE_SIZE ? (1 + x + y - TILE_SIZE) >> 1 : 0;
case SLOPE_W: return x >= y ? (x - y) >> 1 : 0; case SLOPE_W: return x >= y ? (x - y) >> 1 : 0;
/* Two corners next to eachother are up. */ /* Two corners next to each other are up. */
case SLOPE_NE: return (TILE_SIZE - x) >> 1; case SLOPE_NE: return (TILE_SIZE - x) >> 1;
case SLOPE_SE: return (y + 1) >> 1; case SLOPE_SE: return (y + 1) >> 1;
case SLOPE_SW: return (x + 1) >> 1; case SLOPE_SW: return (x + 1) >> 1;
@ -1433,7 +1433,7 @@ static void CreateRivers()
* Calculate what height would be needed to cover N% of the landmass. * Calculate what height would be needed to cover N% of the landmass.
* *
* The function allows both snow and desert/tropic line to be calculated. It * The function allows both snow and desert/tropic line to be calculated. It
* tries to find the closests height which covers N% of the landmass; it can * tries to find the closest height which covers N% of the landmass; it can
* be below or above it. * be below or above it.
* *
* Tropic has a mechanism where water and tropic tiles in mountains grow * Tropic has a mechanism where water and tropic tiles in mountains grow

View File

@ -264,7 +264,7 @@ private:
uint score_width; ///< The width of the score text uint score_width; ///< The width of the score text
uint header_height; ///< Height of the table header uint header_height; ///< Height of the table header
int line_height; ///< Height of the text lines int line_height; ///< Height of the text lines
Dimension icon_size; ///< Dimenion of the company icon. Dimension icon_size; ///< Dimension of the company icon.
std::string title; std::string title;
/** /**

View File

@ -152,7 +152,7 @@ uint DistanceManhattan(TileIndex t0, TileIndex t1)
* Gets the 'Square' distance between the two given tiles. * Gets the 'Square' distance between the two given tiles.
* The 'Square' distance is the square of the shortest (straight line) * The 'Square' distance is the square of the shortest (straight line)
* distance between the two tiles. * distance between the two tiles.
* Also known as euclidian- or L2-Norm squared. * Also known as Euclidean- or L2-Norm squared.
* @param t0 the start tile * @param t0 the start tile
* @param t1 the end tile * @param t1 the end tile
* @return the distance * @return the distance

View File

@ -539,7 +539,7 @@ inline TileIndexDiffC TileIndexToTileIndexDiffC(TileIndex tile_a, TileIndex tile
/* Functions to calculate distances */ /* Functions to calculate distances */
uint DistanceManhattan(TileIndex, TileIndex); ///< also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads) uint DistanceManhattan(TileIndex, TileIndex); ///< also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads)
uint DistanceSquare(TileIndex, TileIndex); ///< euclidian- or L2-Norm squared uint DistanceSquare(TileIndex, TileIndex); ///< Euclidean- or L2-Norm squared
uint DistanceMax(TileIndex, TileIndex); ///< also known as L-Infinity-Norm uint DistanceMax(TileIndex, TileIndex); ///< also known as L-Infinity-Norm
uint DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan uint DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan
uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map

View File

@ -188,7 +188,7 @@ void NetworkHTTPRequest::WinHttpCallback(DWORD code, void *info, DWORD length)
break; break;
default: default:
Debug(net, 0, "HTTP request failed: unexepected callback code 0x{:x}", code); Debug(net, 0, "HTTP request failed: unexpected callback code 0x{:x}", code);
this->callback.OnFailure(); this->callback.OnFailure();
this->finished = true; this->finished = true;
return; return;

View File

@ -300,7 +300,7 @@ void DeserializeNetworkGameInfo(Packet &p, NetworkGameInfo &info, const GameInfo
case 4: { case 4: {
/* Ensure that the maximum number of NewGRFs and the field in the network /* Ensure that the maximum number of NewGRFs and the field in the network
* protocol are matched to eachother. If that is not the case anymore a * protocol are matched to each other. If that is not the case anymore a
* check must be added to ensure the received data is still valid. */ * check must be added to ensure the received data is still valid. */
static_assert(std::numeric_limits<uint8_t>::max() == NETWORK_MAX_GRF_COUNT); static_assert(std::numeric_limits<uint8_t>::max() == NETWORK_MAX_GRF_COUNT);
uint num_grfs = p.Recv_uint8(); uint num_grfs = p.Recv_uint8();

View File

@ -442,7 +442,7 @@ std::string Packet::Recv_string(size_t length, StringValidationSettings settings
/** /**
* Get the amount of bytes that are still available for the Transfer functions. * Get the amount of bytes that are still available for the Transfer functions.
* @return The number of bytes that still have to be transfered. * @return The number of bytes that still have to be transferred.
*/ */
size_t Packet::RemainingBytesToTransfer() const size_t Packet::RemainingBytesToTransfer() const
{ {

View File

@ -174,7 +174,7 @@ protected:
* Send chat from the external source: * Send chat from the external source:
* string Name of the source this message came from. * string Name of the source this message came from.
* uint16_t TextColour to use for the message. * uint16_t TextColour to use for the message.
* string Name of the user who sent the messsage. * string Name of the user who sent the message.
* string Message. * string Message.
* @param p The packet that was just received. * @param p The packet that was just received.
* @return The state the network should have. * @return The state the network should have.

View File

@ -142,7 +142,7 @@ bool NetworkContentSocketHandler::ReceivePackets()
* As a result, we simple handle an arbitrary number of packets in one cycle, * As a result, we simple handle an arbitrary number of packets in one cycle,
* and let the rest be handled in subsequent cycles. These are ran, almost, * and let the rest be handled in subsequent cycles. These are ran, almost,
* immediately after this cycle so in speed it does not matter much, except * immediately after this cycle so in speed it does not matter much, except
* that the user inferface will appear better responding. * that the user interface will appear better responding.
* *
* What arbitrary number to choose is the ultimate question though. * What arbitrary number to choose is the ultimate question though.
*/ */

View File

@ -227,7 +227,7 @@ protected:
/** /**
* Game Coordinator requests the client/server to do a STUN request to the * Game Coordinator requests the client/server to do a STUN request to the
* STUN server. Important is to remember the local port these STUN requests * STUN server. Important is to remember the local port these STUN requests
* are sent from, as this will be needed for later conenctions too. * are sent from, as this will be needed for later connections too.
* The client/server should do multiple STUN requests for every available * The client/server should do multiple STUN requests for every available
* interface that connects to the Internet (e.g., once for IPv4 and once * interface that connects to the Internet (e.g., once for IPv4 and once
* for IPv6). * for IPv6).

View File

@ -372,7 +372,7 @@ protected:
* Sends a chat-packet for external source to the client: * Sends a chat-packet for external source to the client:
* string Name of the source this message came from. * string Name of the source this message came from.
* uint16_t TextColour to use for the message. * uint16_t TextColour to use for the message.
* string Name of the user who sent the messsage. * string Name of the user who sent the message.
* string Message (max NETWORK_CHAT_LENGTH). * string Message (max NETWORK_CHAT_LENGTH).
* @param p The packet that was just received. * @param p The packet that was just received.
*/ */

View File

@ -804,7 +804,7 @@ bool NetworkClientConnectGame(const std::string &connection_string, CompanyID de
} else { } else {
/* When already playing a game, first go back to the main menu. This /* When already playing a game, first go back to the main menu. This
* disconnects the user from the current game, meaning we can safely * disconnects the user from the current game, meaning we can safely
* load in the new. After all, there is little point in continueing to * load in the new. After all, there is little point in continuing to
* play on a server if we are connecting to another one. * play on a server if we are connecting to another one.
*/ */
_switch_mode = SM_JOIN_GAME; _switch_mode = SM_JOIN_GAME;

View File

@ -321,7 +321,7 @@ struct ContentListFilterData {
/** Filter criteria for NetworkContentListWindow. */ /** Filter criteria for NetworkContentListWindow. */
enum ContentListFilterCriteria : uint8_t { enum ContentListFilterCriteria : uint8_t {
CONTENT_FILTER_TEXT = 0, ///< Filter by query sting CONTENT_FILTER_TEXT = 0, ///< Filter by query string
CONTENT_FILTER_TYPE_OR_SELECTED,///< Filter by being of displayed type or selected for download CONTENT_FILTER_TYPE_OR_SELECTED,///< Filter by being of displayed type or selected for download
}; };

View File

@ -250,7 +250,7 @@ bool ClientNetworkCoordinatorSocketHandler::Receive_GC_LISTING(Packet &p)
ClearGRFConfigList(item->info.grfconfig); ClearGRFConfigList(item->info.grfconfig);
/* Read the NetworkGameInfo from the packet. */ /* Read the NetworkGameInfo from the packet. */
DeserializeNetworkGameInfo(p, item->info, &this->newgrf_lookup_table); DeserializeNetworkGameInfo(p, item->info, &this->newgrf_lookup_table);
/* Check for compatability with the client. */ /* Check for compatibility with the client. */
CheckGameCompatibility(item->info); CheckGameCompatibility(item->info);
/* Mark server as online. */ /* Mark server as online. */
item->status = NGLS_ONLINE; item->status = NGLS_ONLINE;

View File

@ -123,7 +123,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_GAME_INFO(Packet
ClearGRFConfigList(item->info.grfconfig); ClearGRFConfigList(item->info.grfconfig);
/* Retrieve the NetworkGameInfo from the packet. */ /* Retrieve the NetworkGameInfo from the packet. */
DeserializeNetworkGameInfo(p, item->info); DeserializeNetworkGameInfo(p, item->info);
/* Check for compatability with the client. */ /* Check for compatibility with the client. */
CheckGameCompatibility(item->info); CheckGameCompatibility(item->info);
/* Ensure we consider the server online. */ /* Ensure we consider the server online. */
item->status = NGLS_ONLINE; item->status = NGLS_ONLINE;

View File

@ -12,7 +12,7 @@
#include "network_internal.h" #include "network_internal.h"
/** Class for handling the client side of quering a game server. */ /** Class for handling the client side of querying a game server. */
class QueryNetworkGameSocketHandler : public NetworkGameSocketHandler { class QueryNetworkGameSocketHandler : public NetworkGameSocketHandler {
private: private:
static std::vector<std::unique_ptr<QueryNetworkGameSocketHandler>> queries; ///< Pending queries. static std::vector<std::unique_ptr<QueryNetworkGameSocketHandler>> queries; ///< Pending queries.
@ -32,7 +32,7 @@ protected:
public: public:
/** /**
* Create a new socket for the client side of quering game server. * Create a new socket for the client side of querying game server.
* @param s The socket to connect with. * @param s The socket to connect with.
* @param connection_string The connection string of the server. * @param connection_string The connection string of the server.
*/ */

View File

@ -256,7 +256,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::CloseConnection(NetworkRecvSta
} }
} }
/* If we were transfering a map to this client, stop the savegame creation /* If we were transferring a map to this client, stop the savegame creation
* process and queue the next client to receive the map. */ * process and queue the next client to receive the map. */
if (this->status == STATUS_MAP) { if (this->status == STATUS_MAP) {
/* Ensure the saving of the game is stopped too. */ /* Ensure the saving of the game is stopped too. */
@ -697,7 +697,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendChat(NetworkAction action,
* Send a chat message from external source. * Send a chat message from external source.
* @param source Name of the source this message came from. * @param source Name of the source this message came from.
* @param colour TextColour to use for the message. * @param colour TextColour to use for the message.
* @param user Name of the user who sent the messsage. * @param user Name of the user who sent the message.
* @param msg The actual message. * @param msg The actual message.
*/ */
NetworkRecvStatus ServerNetworkGameSocketHandler::SendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg) NetworkRecvStatus ServerNetworkGameSocketHandler::SendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg)
@ -1363,7 +1363,7 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
* Send a chat message from external source. * Send a chat message from external source.
* @param source Name of the source this message came from. * @param source Name of the source this message came from.
* @param colour TextColour to use for the message. * @param colour TextColour to use for the message.
* @param user Name of the user who sent the messsage. * @param user Name of the user who sent the message.
* @param msg The actual message. * @param msg The actual message.
*/ */
void NetworkServerSendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg) void NetworkServerSendExternalChat(const std::string &source, TextColour colour, const std::string &user, const std::string &msg)
@ -1926,7 +1926,7 @@ void NetworkServerShowStatusToConsole()
static const char * const stat_str[] = { static const char * const stat_str[] = {
"inactive", "inactive",
"authorizing", "authorizing",
"identifing client", "identifying client",
"checking NewGRFs", "checking NewGRFs",
"authorized", "authorized",
"waiting", "waiting",

View File

@ -91,7 +91,7 @@ void ClientNetworkTurnSocketHandler::Connect()
* Not until you run Connect() on the resulting instance will it start setting * Not until you run Connect() on the resulting instance will it start setting
* up the TURN connection. * up the TURN connection.
* @param token The token as received from the Game Coordinator. * @param token The token as received from the Game Coordinator.
* @param tracking_number The tracking number as recieved from the Game Coordinator. * @param tracking_number The tracking number as received from the Game Coordinator.
* @param ticket The ticket as received from the Game Coordinator. * @param ticket The ticket as received from the Game Coordinator.
* @param connection_string Connection string of the TURN server. * @param connection_string Connection string of the TURN server.
* @return The handler for this TURN connection. * @return The handler for this TURN connection.

View File

@ -4226,7 +4226,7 @@ static ChangeInfoResult ObjectChangeInfo(uint first, uint last, int prop, ByteRe
} }
break; break;
case 0x0D: // Build cost multipler case 0x0D: // Build cost multiplier
spec->build_cost_multiplier = buf.ReadByte(); spec->build_cost_multiplier = buf.ReadByte();
spec->clear_cost_multiplier = spec->build_cost_multiplier; spec->clear_cost_multiplier = spec->build_cost_multiplier;
break; break;

View File

@ -79,7 +79,7 @@ uint16_t GetCargoCallback(CallbackID callback, uint32_t param1, uint32_t param2,
*/ */
CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit) CargoType GetCargoTranslation(uint8_t cargo, const GRFFile *grffile, bool usebit)
{ {
/* We can't use GetCargoTranslationTable here as the usebit flag changes behviour. */ /* We can't use GetCargoTranslationTable here as the usebit flag changes behaviour. */
/* Pre-version 7 uses the bitnum lookup from (standard in v8) instead of climate dependent in some places.. */ /* Pre-version 7 uses the bitnum lookup from (standard in v8) instead of climate dependent in some places.. */
std::span<const CargoLabel> cargo_list; std::span<const CargoLabel> cargo_list;
if (grffile->grf_version < 7 && !usebit) { if (grffile->grf_version < 7 && !usebit) {

View File

@ -1327,7 +1327,7 @@ static bool EnginePreSort(const EngineID &a, const EngineID &b)
} }
/** /**
* Deternine default engine sorting and execute recorded ListOrderChanges from AlterVehicleListOrder. * Determine default engine sorting and execute recorded ListOrderChanges from AlterVehicleListOrder.
*/ */
void CommitVehicleListOrderChanges() void CommitVehicleListOrderChanges()
{ {

View File

@ -373,7 +373,7 @@ static uint32_t GetDistanceFromNearbyHouse(uint8_t parameter, TileIndex tile, Ho
/* virtual */ uint32_t HouseScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const /* virtual */ uint32_t HouseScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const
{ {
if (this->tile == INVALID_TILE) { if (this->tile == INVALID_TILE) {
/* House does not yet exist, nor is it being planned to exist. Provide some default values intead. */ /* House does not yet exist, nor is it being planned to exist. Provide some default values instead. */
switch (variable) { switch (variable) {
case 0x40: return TOWN_HOUSE_COMPLETED | this->view << 2; /* Construction stage. */ case 0x40: return TOWN_HOUSE_COMPLETED | this->view << 2; /* Construction stage. */
case 0x41: return 0; case 0x41: return 0;

View File

@ -193,7 +193,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t param_setID, uint8_
/* Distance to the nearest water/land tile */ /* Distance to the nearest water/land tile */
case 0x8B: return GetClosestWaterDistance(this->tile, !GetIndustrySpec(this->industry->type)->behaviour.Test(IndustryBehaviour::BuiltOnWater)); case 0x8B: return GetClosestWaterDistance(this->tile, !GetIndustrySpec(this->industry->type)->behaviour.Test(IndustryBehaviour::BuiltOnWater));
/* Square of Euclidian distance from town */ /* Square of Euclidean distance from town */
case 0x8D: return ClampTo<uint16_t>(DistanceSquare(this->industry->town->xy, this->tile)); case 0x8D: return ClampTo<uint16_t>(DistanceSquare(this->industry->town->xy, this->tile));
/* 32 random bits */ /* 32 random bits */
@ -294,7 +294,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t param_setID, uint8_
TileIndex tile = GetNearbyTile(parameter, this->tile, true); TileIndex tile = GetNearbyTile(parameter, this->tile, true);
return GetTownRadiusGroup(this->industry->town, tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(tile, this->industry->town->xy)); return GetTownRadiusGroup(this->industry->town, tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(tile, this->industry->town->xy));
} }
/* Get square of Euclidian distance of closest town */ /* Get square of Euclidean distance of closest town */
case 0x66: { case 0x66: {
if (this->tile == INVALID_TILE) break; if (this->tile == INVALID_TILE) break;
TileIndex tile = GetNearbyTile(parameter, this->tile, true); TileIndex tile = GetNearbyTile(parameter, this->tile, true);

View File

@ -327,7 +327,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t local_id, uint32_t
/* Get town zone and Manhattan distance of closest town */ /* Get town zone and Manhattan distance of closest town */
case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(this->tile, t->xy)); case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(this->tile, t->xy));
/* Get square of Euclidian distance of closest town */ /* Get square of Euclidean distance of closest town */
case 0x46: return DistanceSquare(this->tile, t->xy); case 0x46: return DistanceSquare(this->tile, t->xy);
/* Object colour */ /* Object colour */

View File

@ -106,7 +106,7 @@ uint32_t RoadStopScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] u
return t != nullptr ? (GetTownRadiusGroup(t, this->tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(this->tile, t->xy))) : HZB_TOWN_EDGE << 16; return t != nullptr ? (GetTownRadiusGroup(t, this->tile) << 16 | ClampTo<uint16_t>(DistanceManhattan(this->tile, t->xy))) : HZB_TOWN_EDGE << 16;
} }
/* Get square of Euclidian distance of closest town */ /* Get square of Euclidean distance of closest town */
case 0x46: { case 0x46: {
if (this->tile == INVALID_TILE) return 0; if (this->tile == INVALID_TILE) return 0;
const Town *t = (this->st == nullptr) ? ClosestTownFromTile(this->tile, UINT_MAX) : this->st->town; const Town *t = (this->st == nullptr) ? ClosestTownFromTile(this->tile, UINT_MAX) : this->st->town;

View File

@ -52,7 +52,7 @@ static NewsContainer _news; ///< List of news, with newest items at the start.
/** /**
* Forced news item. * Forced news item.
* Users can force an item by accessing the history or "last message". * Users can force an item by accessing the history or "last message".
* If the message being shown was forced by the user, an iterater is stored * If the message being shown was forced by the user, an iterator is stored
* in _forced_news. Otherwise, \a _forced_news variable is the end of \a _news. * in _forced_news. Otherwise, \a _forced_news variable is the end of \a _news.
*/ */
static NewsIterator _forced_news = std::end(_news); static NewsIterator _forced_news = std::end(_news);
@ -903,7 +903,7 @@ void AddNewsItem(StringID string, NewsType type, NewsStyle style, NewsFlags flag
/* Create new news item node */ /* Create new news item node */
_news.emplace_front(string, type, style, flags, reftype1, ref1, reftype2, ref2, std::move(data), advice_type); _news.emplace_front(string, type, style, flags, reftype1, ref1, reftype2, ref2, std::move(data), advice_type);
/* Keep the number of stored news items to a managable number */ /* Keep the number of stored news items to a manageable number */
if (std::size(_news) > MAX_NEWS_AMOUNT) { if (std::size(_news) > MAX_NEWS_AMOUNT) {
DeleteNewsItem(std::prev(std::end(_news))); DeleteNewsItem(std::prev(std::end(_news)));
} }

View File

@ -16,7 +16,7 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
class CoreTextFontCache : public TrueTypeFontCache { class CoreTextFontCache : public TrueTypeFontCache {
CFAutoRelease<CTFontDescriptorRef> font_desc; ///< Font descriptor exlcuding font size. CFAutoRelease<CTFontDescriptorRef> font_desc; ///< Font descriptor excluding font size.
CFAutoRelease<CTFontRef> font; ///< CoreText font handle. CFAutoRelease<CTFontRef> font; ///< CoreText font handle.
std::string font_name; ///< Cached font name. std::string font_name; ///< Cached font name.

View File

@ -196,7 +196,7 @@ static CTRunDelegateCallbacks _sprite_font_callback = {
for (ssize_t c = last; c < position; c++) { for (ssize_t c = last; c < position; c++) {
if (buff[c] >= SCC_SPRITE_START && buff[c] <= SCC_SPRITE_END && font->fc->MapCharToGlyph(buff[c], false) == 0) { if (buff[c] >= SCC_SPRITE_START && buff[c] <= SCC_SPRITE_END && font->fc->MapCharToGlyph(buff[c], false) == 0) {
CFAutoRelease<CTRunDelegateRef> del(CTRunDelegateCreate(&_sprite_font_callback, (void *)(size_t)(buff[c] | (font->fc->GetSize() << 24)))); CFAutoRelease<CTRunDelegateRef> del(CTRunDelegateCreate(&_sprite_font_callback, (void *)(size_t)(buff[c] | (font->fc->GetSize() << 24))));
/* According to the offical documentation, if a run delegate is used, the char should always be 0xFFFC. */ /* According to the official documentation, if a run delegate is used, the char should always be 0xFFFC. */
CFAttributedStringReplaceString(str.get(), CFRangeMake(c, 1), replacment_str.get()); CFAttributedStringReplaceString(str.get(), CFRangeMake(c, 1), replacment_str.get());
CFAttributedStringSetAttribute(str.get(), CFRangeMake(c, 1), kCTRunDelegateAttributeName, del.get()); CFAttributedStringSetAttribute(str.get(), CFRangeMake(c, 1), kCTRunDelegateAttributeName, del.get());
} }

View File

@ -30,7 +30,7 @@ static std::recursive_mutex _palette_mutex; ///< To coordinate access to _cur_pa
* a smaller lookup table. * a smaller lookup table.
* *
* 6 bpc is chosen as this results in a palette lookup table of 256KiB with adequate fidelty. * 6 bpc is chosen as this results in a palette lookup table of 256KiB with adequate fidelty.
* In constract, a 5 bpc lookup table would be 32KiB, and 7 bpc would be 2MiB. * In contrast, a 5 bpc lookup table would be 32KiB, and 7 bpc would be 2MiB.
* *
* Values in the table are filled as they are first encountered -- larger lookup table means more colour * Values in the table are filled as they are first encountered -- larger lookup table means more colour
* distance calculations, and is therefore slower. * distance calculations, and is therefore slower.

View File

@ -331,10 +331,10 @@ void InvalidateWaterRegion(TileIndex tile)
* Calls the provided callback function for all water region patches * Calls the provided callback function for all water region patches
* accessible from one particular side of the starting patch. * accessible from one particular side of the starting patch.
* @param water_region_patch Water patch within the water region to start searching from * @param water_region_patch Water patch within the water region to start searching from
* @param side Side of the water region to look for neigboring patches of water * @param side Side of the water region to look for neighbouring patches of water
* @param callback The function that will be called for each neighbor that is found * @param callback The function that will be called for each neighbour that is found
*/ */
static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatchDesc &water_region_patch, DiagDirection side, TVisitWaterRegionPatchCallBack &func) static inline void VisitAdjacentWaterRegionPatchNeighbours(const WaterRegionPatchDesc &water_region_patch, DiagDirection side, TVisitWaterRegionPatchCallBack &func)
{ {
if (water_region_patch.label == INVALID_WATER_REGION_PATCH) return; if (water_region_patch.label == INVALID_WATER_REGION_PATCH) return;
@ -346,15 +346,15 @@ static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatch
if (nx < 0 || ny < 0 || nx >= GetWaterRegionMapSizeX() || ny >= GetWaterRegionMapSizeY()) return; if (nx < 0 || ny < 0 || nx >= GetWaterRegionMapSizeX() || ny >= GetWaterRegionMapSizeY()) return;
const WaterRegion neighboring_region = GetUpdatedWaterRegion(nx, ny); const WaterRegion neighbouring_region = GetUpdatedWaterRegion(nx, ny);
const DiagDirection opposite_side = ReverseDiagDir(side); const DiagDirection opposite_side = ReverseDiagDir(side);
/* Indicates via which local x or y coordinates (depends on the "side" parameter) we can cross over into the adjacent region. */ /* Indicates via which local x or y coordinates (depends on the "side" parameter) we can cross over into the adjacent region. */
const TWaterRegionTraversabilityBits traversability_bits = current_region.GetEdgeTraversabilityBits(side) const TWaterRegionTraversabilityBits traversability_bits = current_region.GetEdgeTraversabilityBits(side)
& neighboring_region.GetEdgeTraversabilityBits(opposite_side); & neighbouring_region.GetEdgeTraversabilityBits(opposite_side);
if (traversability_bits == 0) return; if (traversability_bits == 0) return;
if (current_region.NumberOfPatches() == 1 && neighboring_region.NumberOfPatches() == 1) { if (current_region.NumberOfPatches() == 1 && neighbouring_region.NumberOfPatches() == 1) {
func(WaterRegionPatchDesc{ nx, ny, FIRST_REGION_LABEL }); // No further checks needed because we know there is just one patch for both adjacent regions func(WaterRegionPatchDesc{ nx, ny, FIRST_REGION_LABEL }); // No further checks needed because we know there is just one patch for both adjacent regions
return; return;
} }
@ -369,10 +369,10 @@ static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatch
const TWaterRegionPatchLabel current_label = current_region.GetLabel(current_edge_tile); const TWaterRegionPatchLabel current_label = current_region.GetLabel(current_edge_tile);
if (current_label != water_region_patch.label) continue; if (current_label != water_region_patch.label) continue;
const TileIndex neighbor_edge_tile = GetEdgeTileCoordinate(nx, ny, opposite_side, x_or_y); const TileIndex neighbour_edge_tile = GetEdgeTileCoordinate(nx, ny, opposite_side, x_or_y);
const TWaterRegionPatchLabel neighbor_label = neighboring_region.GetLabel(neighbor_edge_tile); const TWaterRegionPatchLabel neighbour_label = neighbouring_region.GetLabel(neighbour_edge_tile);
assert(neighbor_label != INVALID_WATER_REGION_PATCH); assert(neighbour_label != INVALID_WATER_REGION_PATCH);
if (std::ranges::find(unique_labels, neighbor_label) == unique_labels.end()) unique_labels.push_back(neighbor_label); if (std::ranges::find(unique_labels, neighbour_label) == unique_labels.end()) unique_labels.push_back(neighbour_label);
} }
for (TWaterRegionPatchLabel unique_label : unique_labels) func(WaterRegionPatchDesc{ nx, ny, unique_label }); for (TWaterRegionPatchLabel unique_label : unique_labels) func(WaterRegionPatchDesc{ nx, ny, unique_label });
} }
@ -383,16 +383,16 @@ static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatch
* @param water_region_patch Water patch within the water region to start searching from * @param water_region_patch Water patch within the water region to start searching from
* @param callback The function that will be called for each accessible water patch that is found * @param callback The function that will be called for each accessible water patch that is found
*/ */
void VisitWaterRegionPatchNeighbors(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback) void VisitWaterRegionPatchNeighbours(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback)
{ {
if (water_region_patch.label == INVALID_WATER_REGION_PATCH) return; if (water_region_patch.label == INVALID_WATER_REGION_PATCH) return;
const WaterRegion current_region = GetUpdatedWaterRegion(water_region_patch.x, water_region_patch.y); const WaterRegion current_region = GetUpdatedWaterRegion(water_region_patch.x, water_region_patch.y);
/* Visit adjacent water region patches in each cardinal direction */ /* Visit adjacent water region patches in each cardinal direction */
for (DiagDirection side = DIAGDIR_BEGIN; side < DIAGDIR_END; side++) VisitAdjacentWaterRegionPatchNeighbors(water_region_patch, side, callback); for (DiagDirection side = DIAGDIR_BEGIN; side < DIAGDIR_END; side++) VisitAdjacentWaterRegionPatchNeighbours(water_region_patch, side, callback);
/* Visit neigboring water patches accessible via cross-region aqueducts */ /* Visit neighbouring water patches accessible via cross-region aqueducts */
if (current_region.HasCrossRegionAqueducts()) { if (current_region.HasCrossRegionAqueducts()) {
for (const TileIndex tile : current_region) { for (const TileIndex tile : current_region) {
if (GetWaterRegionPatchInfo(tile) == water_region_patch && IsAqueductTile(tile)) { if (GetWaterRegionPatchInfo(tile) == water_region_patch && IsAqueductTile(tile)) {

View File

@ -57,7 +57,7 @@ WaterRegionPatchDesc GetWaterRegionPatchInfo(TileIndex tile);
void InvalidateWaterRegion(TileIndex tile); void InvalidateWaterRegion(TileIndex tile);
using TVisitWaterRegionPatchCallBack = std::function<void(const WaterRegionPatchDesc &)>; using TVisitWaterRegionPatchCallBack = std::function<void(const WaterRegionPatchDesc &)>;
void VisitWaterRegionPatchNeighbors(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback); void VisitWaterRegionPatchNeighbours(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback);
void AllocateWaterRegions(); void AllocateWaterRegions();

View File

@ -114,7 +114,7 @@ private:
return tile != this->res_dest_tile || td != this->res_dest_td; return tile != this->res_dest_tile || td != this->res_dest_td;
} }
/** Unreserve a single track/platform. Stops when the previous failer is reached. */ /** Unreserve a single track/platform. Stops when the previous failure is reached. */
bool UnreserveSingleTrack(TileIndex tile, Trackdir td) bool UnreserveSingleTrack(TileIndex tile, Trackdir td)
{ {
if (IsRailStationTile(tile)) { if (IsRailStationTile(tile)) {

View File

@ -16,7 +16,7 @@
#include "../../safeguards.h" #include "../../safeguards.h"
constexpr int DIRECT_NEIGHBOR_COST = 100; constexpr int DIRECT_NEIGHBOUR_COST = 100;
constexpr int NODES_PER_REGION = 4; constexpr int NODES_PER_REGION = 4;
constexpr int MAX_NUMBER_OF_NODES = 65536; constexpr int MAX_NUMBER_OF_NODES = 65536;
@ -35,7 +35,7 @@ struct CYapfRegionPatchNodeKey {
inline uint ManhattanDistance(const CYapfRegionPatchNodeKey &a, const CYapfRegionPatchNodeKey &b) inline uint ManhattanDistance(const CYapfRegionPatchNodeKey &a, const CYapfRegionPatchNodeKey &b)
{ {
return (std::abs(a.water_region_patch.x - b.water_region_patch.x) + std::abs(a.water_region_patch.y - b.water_region_patch.y)) * DIRECT_NEIGHBOR_COST; return (std::abs(a.water_region_patch.x - b.water_region_patch.x) + std::abs(a.water_region_patch.y - b.water_region_patch.y)) * DIRECT_NEIGHBOUR_COST;
} }
/** Yapf Node for water regions. */ /** Yapf Node for water regions. */
@ -170,7 +170,7 @@ public:
node.Set(&old_node, water_region_patch); node.Set(&old_node, water_region_patch);
Yapf().AddNewNode(node, TrackFollower{}); Yapf().AddNewNode(node, TrackFollower{});
}; };
VisitWaterRegionPatchNeighbors(old_node.key.water_region_patch, visitFunc); VisitWaterRegionPatchNeighbours(old_node.key.water_region_patch, visitFunc);
} }
inline char TransportTypeChar() const { return '^'; } inline char TransportTypeChar() const { return '^'; }

View File

@ -48,9 +48,9 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
{ {
if (!IsValidTile(tile)) return ROAD_NONE; if (!IsValidTile(tile)) return ROAD_NONE;
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
const TileIndex neighbor_tile = TileAddByDiagDir(tile, dir); const TileIndex neighbour_tile = TileAddByDiagDir(tile, dir);
/* Get the Roadbit pointing to the neighbor_tile */ /* Get the Roadbit pointing to the neighbour_tile */
const RoadBits target_rb = DiagDirToRoadBits(dir); const RoadBits target_rb = DiagDirToRoadBits(dir);
/* If the roadbit is in the current plan */ /* If the roadbit is in the current plan */
@ -58,8 +58,8 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
bool connective = false; bool connective = false;
const RoadBits mirrored_rb = MirrorRoadBits(target_rb); const RoadBits mirrored_rb = MirrorRoadBits(target_rb);
if (IsValidTile(neighbor_tile)) { if (IsValidTile(neighbour_tile)) {
switch (GetTileType(neighbor_tile)) { switch (GetTileType(neighbour_tile)) {
/* Always connective ones */ /* Always connective ones */
case MP_CLEAR: case MP_TREES: case MP_CLEAR: case MP_TREES:
connective = true; connective = true;
@ -69,24 +69,24 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
case MP_TUNNELBRIDGE: case MP_TUNNELBRIDGE:
case MP_STATION: case MP_STATION:
case MP_ROAD: case MP_ROAD:
if (IsNormalRoadTile(neighbor_tile)) { if (IsNormalRoadTile(neighbour_tile)) {
/* Always connective */ /* Always connective */
connective = true; connective = true;
} else { } else {
const RoadBits neighbor_rb = GetAnyRoadBits(neighbor_tile, RTT_ROAD) | GetAnyRoadBits(neighbor_tile, RTT_TRAM); const RoadBits neighbour_rb = GetAnyRoadBits(neighbour_tile, RTT_ROAD) | GetAnyRoadBits(neighbour_tile, RTT_TRAM);
/* Accept only connective tiles */ /* Accept only connective tiles */
connective = (neighbor_rb & mirrored_rb) != ROAD_NONE; connective = (neighbour_rb & mirrored_rb) != ROAD_NONE;
} }
break; break;
case MP_RAILWAY: case MP_RAILWAY:
connective = IsPossibleCrossing(neighbor_tile, DiagDirToAxis(dir)); connective = IsPossibleCrossing(neighbour_tile, DiagDirToAxis(dir));
break; break;
case MP_WATER: case MP_WATER:
/* Check for real water tile */ /* Check for real water tile */
connective = !IsWater(neighbor_tile); connective = !IsWater(neighbour_tile);
break; break;
/* The definitely not connective ones */ /* The definitely not connective ones */
@ -94,7 +94,7 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb)
} }
} }
/* If the neighbor tile is inconnective, remove the planned road connection to it */ /* If the neighbour tile is inconnective, remove the planned road connection to it */
if (!connective) org_rb ^= target_rb; if (!connective) org_rb ^= target_rb;
} }
} }

View File

@ -5,7 +5,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** @file oldloader.h Declarations of strctures and function used in loader of old savegames */ /** @file oldloader.h Declarations of structures and functions used in loader of old savegames */
#ifndef OLDLOADER_H #ifndef OLDLOADER_H
#define OLDLOADER_H #define OLDLOADER_H

View File

@ -501,7 +501,7 @@ static Town *RemapTown(TileIndex fallback)
/* In some cases depots, industries and stations could refer to a missing town. */ /* In some cases depots, industries and stations could refer to a missing town. */
Town *t = Town::GetIfValid(RemapTownIndex(_old_town_index)); Town *t = Town::GetIfValid(RemapTownIndex(_old_town_index));
if (t == nullptr) { if (t == nullptr) {
/* In case the town that was refered to does not exist, find the closest. /* In case the town that was referred to does not exist, find the closest.
* However, this needs the kd-tree to be present. */ * However, this needs the kd-tree to be present. */
RebuildTownKdtree(); RebuildTownKdtree();
t = CalcClosestTownFromTile(fallback); t = CalcClosestTownFromTile(fallback);

View File

@ -122,7 +122,7 @@ ScriptEventAdminPort::ScriptEventAdminPort(const std::string &json) :
{ {
} }
/** /**
* Convert a JSON part fo Squirrel. * Convert a JSON part for Squirrel.
* @param vm The VM used. * @param vm The VM used.
* @param json The JSON part to convert to Squirrel. * @param json The JSON part to convert to Squirrel.
*/ */

View File

@ -46,7 +46,7 @@ public:
/** /**
* Build an object of the specified type. * Build an object of the specified type.
* @param object_type The type of the object to build. * @param object_type The type of the object to build.
* @param view The view for teh object. * @param view The view for the object.
* @param tile The tile to build the object on. * @param tile The tile to build the object on.
* @pre IsValidObjectType(object_type). * @pre IsValidObjectType(object_type).
* @return True if the object was successfully build. * @return True if the object was successfully build.

View File

@ -72,8 +72,8 @@ public:
* Type of road station. * Type of road station.
*/ */
enum RoadVehicleType { enum RoadVehicleType {
ROADVEHTYPE_BUS, ///< Build objects useable for busses and passenger trams ROADVEHTYPE_BUS, ///< Build objects usable for busses and passenger trams
ROADVEHTYPE_TRUCK, ///< Build objects useable for trucks and cargo trams ROADVEHTYPE_TRUCK, ///< Build objects usable for trucks and cargo trams
}; };
/** /**

View File

@ -50,7 +50,7 @@ public:
SPET_GOAL = ::SPET_GOAL, ///< An element that displays a goal. SPET_GOAL = ::SPET_GOAL, ///< An element that displays a goal.
SPET_BUTTON_PUSH = ::SPET_BUTTON_PUSH, ///< A push button that triggers an immediate event. SPET_BUTTON_PUSH = ::SPET_BUTTON_PUSH, ///< A push button that triggers an immediate event.
SPET_BUTTON_TILE = ::SPET_BUTTON_TILE, ///< A button that allows the player to select a tile, and triggers an event with the tile. SPET_BUTTON_TILE = ::SPET_BUTTON_TILE, ///< A button that allows the player to select a tile, and triggers an event with the tile.
SPET_BUTTON_VEHICLE = ::SPET_BUTTON_VEHICLE, ///< A button that allows the player to select a vehicle, and triggers an event wih the vehicle. SPET_BUTTON_VEHICLE = ::SPET_BUTTON_VEHICLE, ///< A button that allows the player to select a vehicle, and triggers an event with the vehicle.
}; };
/** /**

View File

@ -167,7 +167,7 @@ static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance)
const WaterRegionPatchDesc current_node = patches_to_search.front(); const WaterRegionPatchDesc current_node = patches_to_search.front();
patches_to_search.pop_front(); patches_to_search.pop_front();
/* Add neighbors of the current patch to the search queue. */ /* Add neighbours of the current patch to the search queue. */
TVisitWaterRegionPatchCallBack visitFunc = [&](const WaterRegionPatchDesc &water_region_patch) { TVisitWaterRegionPatchCallBack visitFunc = [&](const WaterRegionPatchDesc &water_region_patch) {
/* Note that we check the max distance per axis, not the total distance. */ /* Note that we check the max distance per axis, not the total distance. */
if (std::abs(water_region_patch.x - start_patch.x) > max_region_distance || if (std::abs(water_region_patch.x - start_patch.x) > max_region_distance ||
@ -180,7 +180,7 @@ static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance)
} }
}; };
VisitWaterRegionPatchNeighbors(current_node, visitFunc); VisitWaterRegionPatchNeighbours(current_node, visitFunc);
} }
/* Step 2: Find the closest depot within the reachable Water Region Patches. */ /* Step 2: Find the closest depot within the reachable Water Region Patches. */

View File

@ -138,7 +138,7 @@ inline void DrawNewGRFTileSeqInGUI(int x, int y, const DrawTileSprites *dts, uin
/** /**
* Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layout entry * Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layout entry
* @note for ground sprites use #GroundSpritePaletteTransform * @note for ground sprites use #GroundSpritePaletteTransform
* @note Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set * @note Not usable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set
* when to use the default palette. * when to use the default palette.
* *
* @param image The sprite to draw * @param image The sprite to draw
@ -157,7 +157,7 @@ inline PaletteID SpriteLayoutPaletteTransform(SpriteID image, PaletteID pal, Pal
/** /**
* Applies PALETTE_MODIFIER_COLOUR to a palette entry of a ground sprite * Applies PALETTE_MODIFIER_COLOUR to a palette entry of a ground sprite
* @note Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set * @note Not usable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set
* when to use the default palette. * when to use the default palette.
* *
* @param image The sprite to draw * @param image The sprite to draw

View File

@ -612,7 +612,7 @@ void RebuildStationKdtree();
/** /**
* Call a function on all stations that have any part of the requested area within their catchment. * Call a function on all stations that have any part of the requested area within their catchment.
* @tparam Func The type of funcion to call * @tparam Func The type of function to call
* @param area The TileArea to check * @param area The TileArea to check
* @param func The function to call, must take two parameters: Station* and TileIndex and return true * @param func The function to call, must take two parameters: Station* and TileIndex and return true
* if coverage of that tile is acceptable for a given station or false if search should continue * if coverage of that tile is acceptable for a given station or false if search should continue

View File

@ -194,7 +194,7 @@
/* /*
* When making a (pure) debug build, the compiler will by default disable * When making a (pure) debug build, the compiler will by default disable
* inlining of functions. This has a detremental effect on the performance of * inlining of functions. This has a detrimental effect on the performance of
* debug builds, especially when more and more trivial (wrapper) functions get * debug builds, especially when more and more trivial (wrapper) functions get
* added to the code base. * added to the code base.
* Take for example the savegame called "Wentbourne", when running this game * Take for example the savegame called "Wentbourne", when running this game

View File

@ -33,7 +33,7 @@ enum StoryPageElementType : uint8_t {
SPET_GOAL, ///< An element that references a goal. SPET_GOAL, ///< An element that references a goal.
SPET_BUTTON_PUSH, ///< A push button that triggers an immediate event. SPET_BUTTON_PUSH, ///< A push button that triggers an immediate event.
SPET_BUTTON_TILE, ///< A button that allows the player to select a tile, and triggers an event with the tile. SPET_BUTTON_TILE, ///< A button that allows the player to select a tile, and triggers an event with the tile.
SPET_BUTTON_VEHICLE, ///< A button that allows the player to select a vehicle, and triggers an event wih the vehicle. SPET_BUTTON_VEHICLE, ///< A button that allows the player to select a vehicle, and triggers an event with the vehicle.
SPET_END, SPET_END,
INVALID_SPET = 0xFF, INVALID_SPET = 0xFF,
}; };

View File

@ -8,7 +8,7 @@
; under "gameopts" in the configuration file, but no longer are. Most of these ; under "gameopts" in the configuration file, but no longer are. Most of these
; are now moved to other places. ; are now moved to other places.
; ;
; For backwards compatability, this file dictates how both were saved. When ; For backwards compatibility, this file dictates how both were saved. When
; a configuration files contains these entries, they are read once, and removed ; a configuration files contains these entries, they are read once, and removed
; from the configuration file afterwards. Those that are still supported will ; from the configuration file afterwards. Those that are still supported will
; be saved in their new place. ; be saved in their new place.

View File

@ -13,7 +13,7 @@
#include "mock_fontcache.h" #include "mock_fontcache.h"
#include "mock_spritecache.h" #include "mock_spritecache.h"
/** Singleton class to set up the mock environemnt once. */ /** Singleton class to set up the mock environment once. */
class MockEnvironment { class MockEnvironment {
public: public:
static MockEnvironment &Instance() static MockEnvironment &Instance()

View File

@ -431,7 +431,7 @@ static void ComposePart(std::back_insert_iterator<std::string> &output, const st
for (const auto &c : value) *output = c; for (const auto &c : value) *output = c;
} }
/* Helper to compose a string from unicde or string parts. */ /* Helper to compose a string from unicode or string parts. */
template <typename... Args> template <typename... Args>
static std::string Compose(Args &&... args) static std::string Compose(Args &&... args)
{ {

View File

@ -45,7 +45,7 @@ TEST_CASE("HaveDParamChanged")
SetDParamStr(1, "some string"); SetDParamStr(1, "some string");
CHECK(HaveDParamChanged(backup) == false); CHECK(HaveDParamChanged(backup) == false);
/* Changing paramter 2 should not have any effect, as the backup is only 2 long. */ /* Changing parameter 2 should not have any effect, as the backup is only 2 long. */
SetDParam(2, 3); SetDParam(2, 3);
CHECK(HaveDParamChanged(backup) == false); CHECK(HaveDParamChanged(backup) == false);

View File

@ -261,11 +261,11 @@ TEST_CASE("Encryption handling")
MockNetworkSocketHandler server_socket_handler(server.CreateClientToServerEncryptionHandler(), server.CreateServerToClientEncryptionHandler()); MockNetworkSocketHandler server_socket_handler(server.CreateClientToServerEncryptionHandler(), server.CreateServerToClientEncryptionHandler());
MockNetworkSocketHandler client_socket_handler(client.CreateServerToClientEncryptionHandler(), client.CreateClientToServerEncryptionHandler()); MockNetworkSocketHandler client_socket_handler(client.CreateServerToClientEncryptionHandler(), client.CreateClientToServerEncryptionHandler());
SECTION("Encyption happening client -> server") { SECTION("Encryption happening client -> server") {
CheckEncryption(&client_socket_handler, &server_socket_handler); CheckEncryption(&client_socket_handler, &server_socket_handler);
} }
SECTION("Encyption happening server -> client") { SECTION("Encryption happening server -> client") {
CheckEncryption(&server_socket_handler, &client_socket_handler); CheckEncryption(&server_socket_handler, &client_socket_handler);
} }

View File

@ -658,7 +658,7 @@ static void HeightMapCurves(uint level)
/* Apply interpolation of curve map results. */ /* Apply interpolation of curve map results. */
*h = (Height)((ht[corner_a] * yri + ht[corner_b] * yr) * xri + (ht[corner_c] * yri + ht[corner_d] * yr) * xr); *h = (Height)((ht[corner_a] * yri + ht[corner_b] * yr) * xri + (ht[corner_c] * yri + ht[corner_d] * yr) * xr);
/* Readd sea level */ /* Re-add sea level */
*h += I2H(1); *h += I2H(1);
} }
} }
@ -799,10 +799,10 @@ static void HeightMapSmoothCoastInDirection(int org_x, int org_y, int dir_x, int
/* Coast found? */ /* Coast found? */
if (_height_map.height(x, y) >= I2H(1)) break; if (_height_map.height(x, y) >= I2H(1)) break;
/* Coast found in the neighborhood? */ /* Coast found in the neighbourhood? */
if (IsValidXY(x + dir_y, y + dir_x) && _height_map.height(x + dir_y, y + dir_x) > 0) break; if (IsValidXY(x + dir_y, y + dir_x) && _height_map.height(x + dir_y, y + dir_x) > 0) break;
/* Coast found in the neighborhood on the other side */ /* Coast found in the neighbourhood on the other side */
if (IsValidXY(x - dir_y, y - dir_x) && _height_map.height(x - dir_y, y - dir_x) > 0) break; if (IsValidXY(x - dir_y, y - dir_x) && _height_map.height(x - dir_y, y - dir_x) > 0) break;
} }

View File

@ -13,7 +13,7 @@
#include "safeguards.h" #include "safeguards.h"
/** /**
* Get a tile's slope given the heigh of its four corners. * Get a tile's slope given the height of its four corners.
* @param hnorth The height at the northern corner in the same unit as TileHeight. * @param hnorth The height at the northern corner in the same unit as TileHeight.
* @param hwest The height at the western corner in the same unit as TileHeight. * @param hwest The height at the western corner in the same unit as TileHeight.
* @param heast The height at the eastern corner in the same unit as TileHeight. * @param heast The height at the eastern corner in the same unit as TileHeight.

View File

@ -573,13 +573,13 @@ static void TownGenerateCargoOriginal(Town *t, TownProductionEffect tpe, uint8_t
} }
/** /**
* Generate cargo for a house using the binominal algorithm. * Generate cargo for a house using the binomial algorithm.
* @param t The current town. * @param t The current town.
* @param tpe The town production effect. * @param tpe The town production effect.
* @param rate The town's product rate for this production. * @param rate The town's product rate for this production.
* @param stations Available stations for this house. * @param stations Available stations for this house.
*/ */
static void TownGenerateCargoBinominal(Town *t, TownProductionEffect tpe, uint8_t rate, StationFinder &stations) static void TownGenerateCargoBinomial(Town *t, TownProductionEffect tpe, uint8_t rate, StationFinder &stations)
{ {
for (const CargoSpec *cs : CargoSpec::town_production_cargoes[tpe]) { for (const CargoSpec *cs : CargoSpec::town_production_cargoes[tpe]) {
CargoType cargo_type = cs->Index(); CargoType cargo_type = cs->Index();
@ -659,8 +659,8 @@ static void TileLoop_Town(TileIndex tile)
/* Reduce generation rate to a 1/4, using tile bits to spread out distribution. /* Reduce generation rate to a 1/4, using tile bits to spread out distribution.
* As tick counter is incremented by 256 between each call, we ignore the lower 8 bits. */ * As tick counter is incremented by 256 between each call, we ignore the lower 8 bits. */
if (GB(TimerGameTick::counter, 8, 2) == GB(tile.base(), 0, 2)) { if (GB(TimerGameTick::counter, 8, 2) == GB(tile.base(), 0, 2)) {
TownGenerateCargoBinominal(t, TPE_PASSENGERS, hs->population, stations); TownGenerateCargoBinomial(t, TPE_PASSENGERS, hs->population, stations);
TownGenerateCargoBinominal(t, TPE_MAIL, hs->mail_generation, stations); TownGenerateCargoBinomial(t, TPE_MAIL, hs->mail_generation, stations);
} }
break; break;
@ -1038,7 +1038,7 @@ bool CheckTownRoadTypes()
* @param dist_multi The distance multiplier. * @param dist_multi The distance multiplier.
* @return true if there is a parallel road. * @return true if there is a parallel road.
*/ */
static bool IsNeighborRoadTile(TileIndex tile, const DiagDirection dir, uint dist_multi) static bool IsNeighbourRoadTile(TileIndex tile, const DiagDirection dir, uint dist_multi)
{ {
if (!IsValidTile(tile)) return false; if (!IsValidTile(tile)) return false;
@ -1092,7 +1092,7 @@ static bool IsRoadAllowedHere(Town *t, TileIndex tile, DiagDirection dir)
} }
Slope cur_slope = _settings_game.construction.build_on_slopes ? std::get<0>(GetFoundationSlope(tile)) : GetTileSlope(tile); Slope cur_slope = _settings_game.construction.build_on_slopes ? std::get<0>(GetFoundationSlope(tile)) : GetTileSlope(tile);
bool ret = !IsNeighborRoadTile(tile, dir, t->layout == TL_ORIGINAL ? 1 : 2); bool ret = !IsNeighbourRoadTile(tile, dir, t->layout == TL_ORIGINAL ? 1 : 2);
if (cur_slope == SLOPE_FLAT) return ret; if (cur_slope == SLOPE_FLAT) return ret;
/* If the tile is not a slope in the right direction, then /* If the tile is not a slope in the right direction, then
@ -1200,7 +1200,7 @@ static RoadBits GetTownRoadGridElement(Town *t, TileIndex tile, DiagDirection di
/** /**
* Grows the town with an extra house. * Grows the town with an extra house.
* Check if there are enough neighbor house tiles * Check if there are enough neighbour house tiles
* next to the current tile. If there are enough * next to the current tile. If there are enough
* add another house. * add another house.
* *
@ -1213,7 +1213,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile)
/* We can't look further than that. */ /* We can't look further than that. */
if (DistanceFromEdge(tile) == 0) return false; if (DistanceFromEdge(tile) == 0) return false;
uint counter = 0; // counts the house neighbor tiles uint counter = 0; // counts the house neighbour tiles
/* Check the tiles E,N,W and S of the current tile for houses */ /* Check the tiles E,N,W and S of the current tile for houses */
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
@ -1230,7 +1230,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile)
break; break;
} }
/* If there are enough neighbors stop here */ /* If there are enough neighbours stop here */
if (counter >= 3) { if (counter >= 3) {
if (TryBuildTownHouse(t, tile)) { if (TryBuildTownHouse(t, tile)) {
_grow_town_result = GROWTH_SUCCEED; _grow_town_result = GROWTH_SUCCEED;
@ -1995,7 +1995,7 @@ void UpdateTownRadius(Town *t)
} }
/** /**
* Update the maximum amount of montly passengers and mail for a town, based on its population. * Update the maximum amount of monthly passengers and mail for a town, based on its population.
* @param t The town to update. * @param t The town to update.
*/ */
void UpdateTownMaxPass(Town *t) void UpdateTownMaxPass(Town *t)
@ -2934,7 +2934,7 @@ CommandCost CmdPlaceHouse(DoCommandFlag flags, TileIndex tile, HouseID house, bo
if (hs->building_flags.Test(BuildingFlag::Size2x1)) ta.Add(TileAddByDiagDir(tile, DIAGDIR_SW)); if (hs->building_flags.Test(BuildingFlag::Size2x1)) ta.Add(TileAddByDiagDir(tile, DIAGDIR_SW));
if (hs->building_flags.Test(BuildingFlag::Size1x2)) ta.Add(TileAddByDiagDir(tile, DIAGDIR_SE)); if (hs->building_flags.Test(BuildingFlag::Size1x2)) ta.Add(TileAddByDiagDir(tile, DIAGDIR_SE));
/* Check additonal tiles covered by this house. */ /* Check additional tiles covered by this house. */
for (const TileIndex &subtile : ta) { for (const TileIndex &subtile : ta) {
cost = Command<CMD_LANDSCAPE_CLEAR>::Do(DC_AUTO | DC_NO_WATER, subtile); cost = Command<CMD_LANDSCAPE_CLEAR>::Do(DC_AUTO | DC_NO_WATER, subtile);
if (!cost.Succeeded()) return cost; if (!cost.Succeeded()) return cost;

View File

@ -87,7 +87,7 @@ private:
StringID action_tooltips[TACT_COUNT]; StringID action_tooltips[TACT_COUNT];
Dimension icon_size; ///< Dimensions of company icon Dimension icon_size; ///< Dimensions of company icon
Dimension exclusive_size; ///< Dimensions of exlusive icon Dimension exclusive_size; ///< Dimensions of exclusive icon
/** /**
* Get the position of the Nth set bit. * Get the position of the Nth set bit.

View File

@ -772,7 +772,7 @@ uint32_t Vehicle::GetGRFID() const
/** /**
* Shift all dates by given interval. * Shift all dates by given interval.
* This is useful if the date has been modified with the cheat menu. * This is useful if the date has been modified with the cheat menu.
* @param interval Number of days to be added or substracted. * @param interval Number of days to be added or subtracted.
*/ */
void Vehicle::ShiftDates(TimerGameEconomy::Date interval) void Vehicle::ShiftDates(TimerGameEconomy::Date interval)
{ {

View File

@ -48,7 +48,7 @@ static Palette _local_palette; ///< Current palette to use for drawing.
* Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information. * Read http://developer.apple.com/releasenotes/Cocoa/Objective-C++.html for more information.
*/ */
/** Platform-specific callback to get an OpenGL funtion pointer. */ /** Platform-specific callback to get an OpenGL function pointer. */
static OGLProc GetOGLProcAddressCallback(const char *proc) static OGLProc GetOGLProcAddressCallback(const char *proc)
{ {
static void *dl = nullptr; static void *dl = nullptr;

View File

@ -42,7 +42,7 @@
static FVideoDriver_SDL_OpenGL iFVideoDriver_SDL_OpenGL; static FVideoDriver_SDL_OpenGL iFVideoDriver_SDL_OpenGL;
/** Platform-specific callback to get an OpenGL funtion pointer. */ /** Platform-specific callback to get an OpenGL function pointer. */
static OGLProc GetOGLProcAddressCallback(const char *proc) static OGLProc GetOGLProcAddressCallback(const char *proc)
{ {
return reinterpret_cast<OGLProc>(SDL_GL_GetProcAddress(proc)); return reinterpret_cast<OGLProc>(SDL_GL_GetProcAddress(proc));

View File

@ -1515,7 +1515,7 @@ static void ViewportAddKdtreeSigns(DrawPixelInfo *dpi)
* @param center the (preferred) center of the viewport sign * @param center the (preferred) center of the viewport sign
* @param top the new top of the sign * @param top the new top of the sign
* @param str the string to show in the sign * @param str the string to show in the sign
* @param str_small the string to show when zoomed out. If the string is emtpy then the \a str is used. * @param str_small the string to show when zoomed out. If the string is empty then the \a str is used.
*/ */
void ViewportSign::UpdatePosition(int center, int top, std::string_view str, std::string_view str_small) void ViewportSign::UpdatePosition(int center, int top, std::string_view str, std::string_view str_small)
{ {
@ -1607,7 +1607,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
sprite_list.sort(); sprite_list.sort();
std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list
auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preciding sprite auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preceding sprite
auto out = psdv->begin(); // Iterator to output sorted sprites auto out = psdv->begin(); // Iterator to output sorted sprites
while (!sprite_order.empty()) { while (!sprite_order.empty()) {
@ -1630,7 +1630,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
/* We only need sprites with xmin <= s->xmax && ymin <= s->ymax && zmin <= s->zmax /* We only need sprites with xmin <= s->xmax && ymin <= s->ymax && zmin <= s->zmax
* So by iterating sprites with xmin + ymin <= s->xmax + s->ymax * So by iterating sprites with xmin + ymin <= s->xmax + s->ymax
* we get all we need and some more that we filter out later. * we get all we need and some more that we filter out later.
* We don't include zmin into the sum as there are usually more neighbors on x and y than z * We don't include zmin into the sum as there are usually more neighbours on x and y than z
* so including it will actually increase the amount of false positives. * so including it will actually increase the amount of false positives.
* Also min coordinates can be > max so using max(xmin, xmax) + max(ymin, ymax) * Also min coordinates can be > max so using max(xmin, xmax) + max(ymin, ymax)
* to ensure that we iterate the current sprite as we need to remove it from the list. * to ensure that we iterate the current sprite as we need to remove it from the list.

View File

@ -56,7 +56,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv)
sprite_list.sort(); sprite_list.sort();
std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list std::vector<ParentSpriteToDraw *> preceding; // Temporarily stores sprites that precede current and their position in the list
auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preciding sprite auto preceding_prev = sprite_list.begin(); // Store iterator in case we need to delete a single preceding sprite
auto out = psdv->begin(); // Iterator to output sorted sprites auto out = psdv->begin(); // Iterator to output sorted sprites
while (!sprite_order.empty()) { while (!sprite_order.empty()) {
@ -79,7 +79,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv)
/* We only need sprites with xmin <= s->xmax && ymin <= s->ymax && zmin <= s->zmax /* We only need sprites with xmin <= s->xmax && ymin <= s->ymax && zmin <= s->zmax
* So by iterating sprites with xmin + ymin <= s->xmax + s->ymax * So by iterating sprites with xmin + ymin <= s->xmax + s->ymax
* we get all we need and some more that we filter out later. * we get all we need and some more that we filter out later.
* We don't include zmin into the sum as there are usually more neighbors on x and y than z * We don't include zmin into the sum as there are usually more neighbours on x and y than z
* so including it will actually increase the amount of false positives. * so including it will actually increase the amount of false positives.
* Also min coordinates can be > max so using max(xmin, xmax) + max(ymin, ymax) * Also min coordinates can be > max so using max(xmin, xmax) + max(ymin, ymax)
* to ensure that we iterate the current sprite as we need to remove it from the list. * to ensure that we iterate the current sprite as we need to remove it from the list.

View File

@ -89,7 +89,7 @@ enum WidgetType : uint8_t {
WPT_TEXTSTYLE, ///< Widget part for specifying text colour. WPT_TEXTSTYLE, ///< Widget part for specifying text colour.
WPT_ALIGNMENT, ///< Widget part for specifying text/image alignment. WPT_ALIGNMENT, ///< Widget part for specifying text/image alignment.
WPT_SCROLLBAR, ///< Widget part for attaching a scrollbar. WPT_SCROLLBAR, ///< Widget part for attaching a scrollbar.
WPT_ASPECT, ///< Widget part for sepcifying aspect ratio. WPT_ASPECT, ///< Widget part for specifying aspect ratio.
WPT_ATTRIBUTE_END, ///< End marker for attribute NWidgetPart types. WPT_ATTRIBUTE_END, ///< End marker for attribute NWidgetPart types.
WPT_FUNCTION, ///< Widget part for calling a user function. WPT_FUNCTION, ///< Widget part for calling a user function.
@ -479,7 +479,7 @@ public:
NWidgetBase *GetWidgetOfType(WidgetType tp) override; NWidgetBase *GetWidgetOfType(WidgetType tp) override;
protected: protected:
std::vector<std::unique_ptr<NWidgetBase>> children; ///< Child widgets in contaier. std::vector<std::unique_ptr<NWidgetBase>> children; ///< Child widgets in container.
}; };
/** Display planes with zero size for #NWidgetStacked. */ /** Display planes with zero size for #NWidgetStacked. */
@ -493,7 +493,7 @@ enum StackedZeroSizePlanes : int {
/** /**
* Stacked widgets, widgets all occupying the same space in the window. * Stacked widgets, widgets all occupying the same space in the window.
* #NWID_SELECTION allows for selecting one of several panels (planes) to tbe displayed. All planes must have the same size. * #NWID_SELECTION allows for selecting one of several panels (planes) to be displayed. All planes must have the same size.
* Since all planes are also initialized, switching between different planes can be done while the window is displayed. * Since all planes are also initialized, switching between different planes can be done while the window is displayed.
* *
* There are also a number of special planes (defined in #StackedZeroSizePlanes) that have zero size in one direction (and are stretchable in * There are also a number of special planes (defined in #StackedZeroSizePlanes) that have zero size in one direction (and are stretchable in
@ -874,7 +874,7 @@ public:
* @param widget Widget number of the widget clicked in. * @param widget Widget number of the widget clicked in.
* @param padding Amount of empty space between the widget edge and the top of the first row. Default value is \c 0. * @param padding Amount of empty space between the widget edge and the top of the first row. Default value is \c 0.
* @param line_height Height of a single row. A negative value means using the vertical resize step of the widget. * @param line_height Height of a single row. A negative value means using the vertical resize step of the widget.
* @return Iterator to the element clicked at. If clicked at a wrong position, returns as interator to the end of the container. * @return Iterator to the element clicked at. If clicked at a wrong position, returns an iterator to the end of the container.
*/ */
template <typename Tcontainer> template <typename Tcontainer>
auto GetScrolledItemFromWidget(Tcontainer &container, int clickpos, const Window * const w, WidgetID widget, int padding = 0, int line_height = -1) const auto GetScrolledItemFromWidget(Tcontainer &container, int clickpos, const Window * const w, WidgetID widget, int padding = 0, int line_height = -1) const
@ -978,7 +978,7 @@ inline uint ComputeMaxSize(uint base, uint max_space, uint step)
* - #SetPadding Define additional padding around the container. * - #SetPadding Define additional padding around the container.
* - #SetPIP Set additional pre/inter/post child widget space. * - #SetPIP Set additional pre/inter/post child widget space.
* . * .
* Underneath these properties, all child widgets of the container must be defined. To denote that they are childs, add an indent before the nested widget parts of * Underneath these properties, all child widgets of the container must be defined. To denote that they are children, add an indent before the nested widget parts of
* the child widgets (it has no meaning for the compiler but it makes the widget parts easier to read). * the child widgets (it has no meaning for the compiler but it makes the widget parts easier to read).
* Below the last child widget, use an #EndContainer part. This part should be aligned with the #NWidget part that started the container. * Below the last child widget, use an #EndContainer part. This part should be aligned with the #NWidget part that started the container.
* *

View File

@ -60,7 +60,7 @@ public:
int vsep_wide; ///< Wide vertical spacing. int vsep_wide; ///< Wide vertical spacing.
int hsep_normal; ///< Normal horizontal spacing. int hsep_normal; ///< Normal horizontal spacing.
int hsep_wide; ///< Wide horizontal spacing. int hsep_wide; ///< Wide horizontal spacing.
int hsep_indent; ///< Width of identation for tree layouts. int hsep_indent; ///< Width of indentation for tree layouts.
static const WidgetDimensions unscaled; ///< Unscaled widget dimensions. static const WidgetDimensions unscaled; ///< Unscaled widget dimensions.
static WidgetDimensions scaled; ///< Widget dimensions scaled for current zoom level. static WidgetDimensions scaled; ///< Widget dimensions scaled for current zoom level.
@ -899,7 +899,7 @@ public:
/** /**
* Iterable ensemble of all valid Windows * Iterable ensemble of all valid Windows
* @tparam Tfront Wether we iterate from front * @tparam Tfront Whether we iterate from front
*/ */
template <bool Tfront> template <bool Tfront>
struct AllWindows { struct AllWindows {