diff --git a/src/blitter/40bpp_anim.cpp b/src/blitter/40bpp_anim.cpp index 65a5bcca31..866389644a 100644 --- a/src/blitter/40bpp_anim.cpp +++ b/src/blitter/40bpp_anim.cpp @@ -113,7 +113,7 @@ inline void Blitter_40bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel 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; - /* 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; for (int y = 0; y < bp->height; y++) { diff --git a/src/cargopacket.h b/src/cargopacket.h index f0983b0786..7432b65b58 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -184,7 +184,7 @@ public: /** * 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 - * 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. * @return Length this cargo has been in transit. */ diff --git a/src/cargotype.cpp b/src/cargotype.cpp index ace016ae32..c0def89dc4 100644 --- a/src/cargotype.cpp +++ b/src/cargotype.cpp @@ -44,7 +44,7 @@ CargoTypes _standard_cargo_mask; static std::vector _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 * 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) { /* During initialization, CargoSpec can be marked valid before the label has been set. */ 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; CargoSpec::label_map.emplace(cs.label, cs.Index()); diff --git a/src/cargotype.h b/src/cargotype.h index ba351e8819..e6d7fbddc4 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -85,7 +85,7 @@ struct CargoSpec { 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. 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 StringID name; ///< Name of this type of cargo. diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 3e14337311..428194261b 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -2334,7 +2334,7 @@ struct CompanyWindow : Window } 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); } } @@ -2377,7 +2377,7 @@ struct CompanyWindow : Window } 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); } } diff --git a/src/debug.h b/src/debug.h index d9ac37207e..8e4dc795ce 100644 --- a/src/debug.h +++ b/src/debug.h @@ -29,7 +29,7 @@ */ /** - * Ouptut a line of debugging information. + * Output a line of debugging 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 format_string The formatting string of the message. diff --git a/src/economy.cpp b/src/economy.cpp index a64a843b4b..ea9b094fb2 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -690,7 +690,7 @@ static void CompaniesGenStatistics() } 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; for (Company *c : Company::Iterate()) { diff --git a/src/fileio.cpp b/src/fileio.cpp index d55782425a..dd1856ef87 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -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 * being properly terminated. * 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. * @param buffer The buffer to read from. * @return The string data. diff --git a/src/gamelog.cpp b/src/gamelog.cpp index 805a4a0992..c99854a4af 100644 --- a/src/gamelog.cpp +++ b/src/gamelog.cpp @@ -176,7 +176,7 @@ void Gamelog::Print(std::function proc) /* virtual */ void LoggedChangeRevision::FormatTo(std::back_insert_iterator &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 {}, ", this->text, this->slver); diff --git a/src/gamelog_internal.h b/src/gamelog_internal.h index 1d9fdec3fe..c4c13ab121 100644 --- a/src/gamelog_internal.h +++ b/src/gamelog_internal.h @@ -17,7 +17,7 @@ * Information about the presence of a Grf at a certain point during gamelog history * Note about missing Grfs: * 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. */ struct GRFPresence { diff --git a/src/genworld.h b/src/genworld.h index d662bbb6c8..97bbdcfef1 100644 --- a/src/genworld.h +++ b/src/genworld.h @@ -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 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 GWAbortProc(); ///< Called when genworld is aborted diff --git a/src/gfx.cpp b/src/gfx.cpp index 6c48b9be10..1fef5755df 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1786,7 +1786,7 @@ void UpdateGUIZoom() /** * 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) * after resizing the application's window/buffer. */ diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index a6ab9758c0..d57445203e 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -149,7 +149,7 @@ int GroundVehicle::GetAcceleration() const AccelStatus mode = v->GetAccelerationStatus(); 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. */ int64_t force; if (speed > 0) { diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 2a51fb7b1c..7d648b2dc8 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1788,7 +1788,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, 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()) { for (auto &p : i->produced) { p.rate = ClampTo((RandomRange(256) + 128) * p.rate >> 8); diff --git a/src/industry_map.h b/src/industry_map.h index 2c3bf63f54..6a0714b8ad 100644 --- a/src/industry_map.h +++ b/src/industry_map.h @@ -180,7 +180,7 @@ inline void SetIndustryConstructionCounter(Tile tile, uint8_t value) /** * Reset the construction stage counter of the industry, * 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 * @pre IsTileType(tile, MP_INDUSTRY) */ diff --git a/src/landscape.cpp b/src/landscape.cpp index 147ab12e1c..9febbbe48a 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -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_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_SE: return (y + 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. * * 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. * * Tropic has a mechanism where water and tropic tiles in mountains grow diff --git a/src/league_gui.cpp b/src/league_gui.cpp index a48812706a..b03cb6f5dc 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -264,7 +264,7 @@ private: uint score_width; ///< The width of the score text uint header_height; ///< Height of the table header 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; /** diff --git a/src/map.cpp b/src/map.cpp index 322c3879a3..67fbd4da1e 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -152,7 +152,7 @@ uint DistanceManhattan(TileIndex t0, TileIndex t1) * Gets the 'Square' distance between the two given tiles. * The 'Square' distance is the square of the shortest (straight line) * 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 t1 the end tile * @return the distance diff --git a/src/map_func.h b/src/map_func.h index 9f34cb835b..370099b43f 100644 --- a/src/map_func.h +++ b/src/map_func.h @@ -539,7 +539,7 @@ inline TileIndexDiffC TileIndexToTileIndexDiffC(TileIndex tile_a, TileIndex tile /* 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 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 DistanceMaxPlusManhattan(TileIndex, TileIndex); ///< Max + Manhattan uint DistanceFromEdge(TileIndex); ///< shortest distance from any edge of the map diff --git a/src/network/core/http_winhttp.cpp b/src/network/core/http_winhttp.cpp index 11fa7bf5b7..11bf67d6f7 100644 --- a/src/network/core/http_winhttp.cpp +++ b/src/network/core/http_winhttp.cpp @@ -188,7 +188,7 @@ void NetworkHTTPRequest::WinHttpCallback(DWORD code, void *info, DWORD length) break; 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->finished = true; return; diff --git a/src/network/core/network_game_info.cpp b/src/network/core/network_game_info.cpp index 35be747e63..8a48c8bb4a 100644 --- a/src/network/core/network_game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -300,7 +300,7 @@ void DeserializeNetworkGameInfo(Packet &p, NetworkGameInfo &info, const GameInfo case 4: { /* 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. */ static_assert(std::numeric_limits::max() == NETWORK_MAX_GRF_COUNT); uint num_grfs = p.Recv_uint8(); diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp index 8e95f6c30e..ef43de7ed1 100644 --- a/src/network/core/packet.cpp +++ b/src/network/core/packet.cpp @@ -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. - * @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 { diff --git a/src/network/core/tcp_admin.h b/src/network/core/tcp_admin.h index e5d71cc0fa..74dca6128f 100644 --- a/src/network/core/tcp_admin.h +++ b/src/network/core/tcp_admin.h @@ -174,7 +174,7 @@ protected: * Send chat from the external source: * string Name of the source this message came from. * 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. * @param p The packet that was just received. * @return The state the network should have. diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp index 2c8b48f695..766a4894c3 100644 --- a/src/network/core/tcp_content.cpp +++ b/src/network/core/tcp_content.cpp @@ -142,7 +142,7 @@ bool NetworkContentSocketHandler::ReceivePackets() * 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, * 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. */ diff --git a/src/network/core/tcp_coordinator.h b/src/network/core/tcp_coordinator.h index a39d13748c..dd14d8b34a 100644 --- a/src/network/core/tcp_coordinator.h +++ b/src/network/core/tcp_coordinator.h @@ -227,7 +227,7 @@ protected: /** * 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 - * 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 * interface that connects to the Internet (e.g., once for IPv4 and once * for IPv6). diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index 14237fdac1..1752fee3fc 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -372,7 +372,7 @@ protected: * Sends a chat-packet for external source to the client: * string Name of the source this message came from. * 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). * @param p The packet that was just received. */ diff --git a/src/network/network.cpp b/src/network/network.cpp index ed8fd1b4a4..d530fcac39 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -804,7 +804,7 @@ bool NetworkClientConnectGame(const std::string &connection_string, CompanyID de } else { /* When already playing a game, first go back to the main menu. This * 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. */ _switch_mode = SM_JOIN_GAME; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 5cdc45ba5c..c0edb4d4bc 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -321,7 +321,7 @@ struct ContentListFilterData { /** Filter criteria for NetworkContentListWindow. */ 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 }; diff --git a/src/network/network_coordinator.cpp b/src/network/network_coordinator.cpp index 841568b806..b8ba523ee5 100644 --- a/src/network/network_coordinator.cpp +++ b/src/network/network_coordinator.cpp @@ -250,7 +250,7 @@ bool ClientNetworkCoordinatorSocketHandler::Receive_GC_LISTING(Packet &p) ClearGRFConfigList(item->info.grfconfig); /* Read the NetworkGameInfo from the packet. */ DeserializeNetworkGameInfo(p, item->info, &this->newgrf_lookup_table); - /* Check for compatability with the client. */ + /* Check for compatibility with the client. */ CheckGameCompatibility(item->info); /* Mark server as online. */ item->status = NGLS_ONLINE; diff --git a/src/network/network_query.cpp b/src/network/network_query.cpp index 6ba97d5fbd..a648ebde30 100644 --- a/src/network/network_query.cpp +++ b/src/network/network_query.cpp @@ -123,7 +123,7 @@ NetworkRecvStatus QueryNetworkGameSocketHandler::Receive_SERVER_GAME_INFO(Packet ClearGRFConfigList(item->info.grfconfig); /* Retrieve the NetworkGameInfo from the packet. */ DeserializeNetworkGameInfo(p, item->info); - /* Check for compatability with the client. */ + /* Check for compatibility with the client. */ CheckGameCompatibility(item->info); /* Ensure we consider the server online. */ item->status = NGLS_ONLINE; diff --git a/src/network/network_query.h b/src/network/network_query.h index 59db813f65..9a58a19573 100644 --- a/src/network/network_query.h +++ b/src/network/network_query.h @@ -12,7 +12,7 @@ #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 { private: static std::vector> queries; ///< Pending queries. @@ -32,7 +32,7 @@ protected: 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 connection_string The connection string of the server. */ diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index f3f884a3d5..236f2718d2 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -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. */ if (this->status == STATUS_MAP) { /* 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. * @param source Name of the source this message came from. * @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. */ 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. * @param source Name of the source this message came from. * @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. */ 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[] = { "inactive", "authorizing", - "identifing client", + "identifying client", "checking NewGRFs", "authorized", "waiting", diff --git a/src/network/network_turn.cpp b/src/network/network_turn.cpp index 6626ae057d..02de66ab9e 100644 --- a/src/network/network_turn.cpp +++ b/src/network/network_turn.cpp @@ -91,7 +91,7 @@ void ClientNetworkTurnSocketHandler::Connect() * Not until you run Connect() on the resulting instance will it start setting * up the TURN connection. * @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 connection_string Connection string of the TURN server. * @return The handler for this TURN connection. diff --git a/src/newgrf.cpp b/src/newgrf.cpp index cb87315c06..3579ffc3ea 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4226,7 +4226,7 @@ static ChangeInfoResult ObjectChangeInfo(uint first, uint last, int prop, ByteRe } break; - case 0x0D: // Build cost multipler + case 0x0D: // Build cost multiplier spec->build_cost_multiplier = buf.ReadByte(); spec->clear_cost_multiplier = spec->build_cost_multiplier; break; diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp index 22fe34cdd4..c0dc43b49a 100644 --- a/src/newgrf_cargo.cpp +++ b/src/newgrf_cargo.cpp @@ -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) { - /* 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.. */ std::span cargo_list; if (grffile->grf_version < 7 && !usebit) { diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index e051ba8f7b..e9197782e5 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -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() { diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index 2043599d01..0924d86314 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -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 { 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) { case 0x40: return TOWN_HOUSE_COMPLETED | this->view << 2; /* Construction stage. */ case 0x41: return 0; diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index c6e2bf1d00..02f2531484 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -193,7 +193,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t param_setID, uint8_ /* Distance to the nearest water/land tile */ 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(DistanceSquare(this->industry->town->xy, this->tile)); /* 32 random bits */ @@ -294,7 +294,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t param_setID, uint8_ TileIndex tile = GetNearbyTile(parameter, this->tile, true); return GetTownRadiusGroup(this->industry->town, tile) << 16 | ClampTo(DistanceManhattan(tile, this->industry->town->xy)); } - /* Get square of Euclidian distance of closest town */ + /* Get square of Euclidean distance of closest town */ case 0x66: { if (this->tile == INVALID_TILE) break; TileIndex tile = GetNearbyTile(parameter, this->tile, true); diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp index 18a1122fdd..ff093f737d 100644 --- a/src/newgrf_object.cpp +++ b/src/newgrf_object.cpp @@ -327,7 +327,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(uint8_t local_id, uint32_t /* Get town zone and Manhattan distance of closest town */ case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | ClampTo(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); /* Object colour */ diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp index a091368fbb..4014fabfc9 100644 --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -106,7 +106,7 @@ uint32_t RoadStopScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] u return t != nullptr ? (GetTownRadiusGroup(t, this->tile) << 16 | ClampTo(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: { if (this->tile == INVALID_TILE) return 0; const Town *t = (this->st == nullptr) ? ClosestTownFromTile(this->tile, UINT_MAX) : this->st->town; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 9599e1b8da..9daaec965f 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -52,7 +52,7 @@ static NewsContainer _news; ///< List of news, with newest items at the start. /** * Forced news item. * Users can force an item by accessing the history or "last message". - * If the message being shown was forced by the user, 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. */ 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 */ _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) { DeleteNewsItem(std::prev(std::end(_news))); } diff --git a/src/os/macosx/font_osx.h b/src/os/macosx/font_osx.h index ac729abd2d..2ba91d485d 100644 --- a/src/os/macosx/font_osx.h +++ b/src/os/macosx/font_osx.h @@ -16,7 +16,7 @@ #include class CoreTextFontCache : public TrueTypeFontCache { - CFAutoRelease font_desc; ///< Font descriptor exlcuding font size. + CFAutoRelease font_desc; ///< Font descriptor excluding font size. CFAutoRelease font; ///< CoreText font handle. std::string font_name; ///< Cached font name. diff --git a/src/os/macosx/string_osx.cpp b/src/os/macosx/string_osx.cpp index bca3e8e567..2153635d1e 100644 --- a/src/os/macosx/string_osx.cpp +++ b/src/os/macosx/string_osx.cpp @@ -196,7 +196,7 @@ static CTRunDelegateCallbacks _sprite_font_callback = { 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) { CFAutoRelease 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()); CFAttributedStringSetAttribute(str.get(), CFRangeMake(c, 1), kCTRunDelegateAttributeName, del.get()); } diff --git a/src/palette.cpp b/src/palette.cpp index ca1dfbfe4c..96ab905d83 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -30,7 +30,7 @@ static std::recursive_mutex _palette_mutex; ///< To coordinate access to _cur_pa * a smaller lookup table. * * 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 * distance calculations, and is therefore slower. diff --git a/src/pathfinder/water_regions.cpp b/src/pathfinder/water_regions.cpp index 00b6bae494..58aea0979c 100644 --- a/src/pathfinder/water_regions.cpp +++ b/src/pathfinder/water_regions.cpp @@ -331,10 +331,10 @@ void InvalidateWaterRegion(TileIndex tile) * Calls the provided callback function for all water region patches * accessible from one particular side of the starting patch. * @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 callback The function that will be called for each neighbor that is found + * @param side Side of the water region to look for neighbouring patches of water + * @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; @@ -346,15 +346,15 @@ static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatch 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); /* 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) - & neighboring_region.GetEdgeTraversabilityBits(opposite_side); + & neighbouring_region.GetEdgeTraversabilityBits(opposite_side); 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 return; } @@ -369,10 +369,10 @@ static inline void VisitAdjacentWaterRegionPatchNeighbors(const WaterRegionPatch const TWaterRegionPatchLabel current_label = current_region.GetLabel(current_edge_tile); if (current_label != water_region_patch.label) continue; - const TileIndex neighbor_edge_tile = GetEdgeTileCoordinate(nx, ny, opposite_side, x_or_y); - const TWaterRegionPatchLabel neighbor_label = neighboring_region.GetLabel(neighbor_edge_tile); - assert(neighbor_label != INVALID_WATER_REGION_PATCH); - if (std::ranges::find(unique_labels, neighbor_label) == unique_labels.end()) unique_labels.push_back(neighbor_label); + const TileIndex neighbour_edge_tile = GetEdgeTileCoordinate(nx, ny, opposite_side, x_or_y); + const TWaterRegionPatchLabel neighbour_label = neighbouring_region.GetLabel(neighbour_edge_tile); + assert(neighbour_label != INVALID_WATER_REGION_PATCH); + 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 }); } @@ -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 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; const WaterRegion current_region = GetUpdatedWaterRegion(water_region_patch.x, water_region_patch.y); /* 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()) { for (const TileIndex tile : current_region) { if (GetWaterRegionPatchInfo(tile) == water_region_patch && IsAqueductTile(tile)) { diff --git a/src/pathfinder/water_regions.h b/src/pathfinder/water_regions.h index c116ff1a3f..3cccc6dc37 100644 --- a/src/pathfinder/water_regions.h +++ b/src/pathfinder/water_regions.h @@ -57,7 +57,7 @@ WaterRegionPatchDesc GetWaterRegionPatchInfo(TileIndex tile); void InvalidateWaterRegion(TileIndex tile); using TVisitWaterRegionPatchCallBack = std::function; -void VisitWaterRegionPatchNeighbors(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback); +void VisitWaterRegionPatchNeighbours(const WaterRegionPatchDesc &water_region_patch, TVisitWaterRegionPatchCallBack &callback); void AllocateWaterRegions(); diff --git a/src/pathfinder/yapf/yapf_rail.cpp b/src/pathfinder/yapf/yapf_rail.cpp index b049b4871c..93ce81801e 100644 --- a/src/pathfinder/yapf/yapf_rail.cpp +++ b/src/pathfinder/yapf/yapf_rail.cpp @@ -114,7 +114,7 @@ private: 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) { if (IsRailStationTile(tile)) { diff --git a/src/pathfinder/yapf/yapf_ship_regions.cpp b/src/pathfinder/yapf/yapf_ship_regions.cpp index dab1045d96..e27d063634 100644 --- a/src/pathfinder/yapf/yapf_ship_regions.cpp +++ b/src/pathfinder/yapf/yapf_ship_regions.cpp @@ -16,7 +16,7 @@ #include "../../safeguards.h" -constexpr int DIRECT_NEIGHBOR_COST = 100; +constexpr int DIRECT_NEIGHBOUR_COST = 100; constexpr int NODES_PER_REGION = 4; constexpr int MAX_NUMBER_OF_NODES = 65536; @@ -35,7 +35,7 @@ struct CYapfRegionPatchNodeKey { 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. */ @@ -170,7 +170,7 @@ public: node.Set(&old_node, water_region_patch); 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 '^'; } diff --git a/src/road.cpp b/src/road.cpp index b4858401c5..f73ec6c99c 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -48,9 +48,9 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) { if (!IsValidTile(tile)) return ROAD_NONE; 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); /* If the roadbit is in the current plan */ @@ -58,8 +58,8 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) bool connective = false; const RoadBits mirrored_rb = MirrorRoadBits(target_rb); - if (IsValidTile(neighbor_tile)) { - switch (GetTileType(neighbor_tile)) { + if (IsValidTile(neighbour_tile)) { + switch (GetTileType(neighbour_tile)) { /* Always connective ones */ case MP_CLEAR: case MP_TREES: connective = true; @@ -69,24 +69,24 @@ RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb) case MP_TUNNELBRIDGE: case MP_STATION: case MP_ROAD: - if (IsNormalRoadTile(neighbor_tile)) { + if (IsNormalRoadTile(neighbour_tile)) { /* Always connective */ connective = true; } 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 */ - connective = (neighbor_rb & mirrored_rb) != ROAD_NONE; + connective = (neighbour_rb & mirrored_rb) != ROAD_NONE; } break; case MP_RAILWAY: - connective = IsPossibleCrossing(neighbor_tile, DiagDirToAxis(dir)); + connective = IsPossibleCrossing(neighbour_tile, DiagDirToAxis(dir)); break; case MP_WATER: /* Check for real water tile */ - connective = !IsWater(neighbor_tile); + connective = !IsWater(neighbour_tile); break; /* 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; } } diff --git a/src/saveload/oldloader.h b/src/saveload/oldloader.h index 031e86e4d5..2c9fdbaca3 100644 --- a/src/saveload/oldloader.h +++ b/src/saveload/oldloader.h @@ -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 . */ -/** @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 #define OLDLOADER_H diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 3cddab29b1..7ca7b815f4 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -501,7 +501,7 @@ static Town *RemapTown(TileIndex fallback) /* In some cases depots, industries and stations could refer to a missing town. */ Town *t = Town::GetIfValid(RemapTownIndex(_old_town_index)); 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. */ RebuildTownKdtree(); t = CalcClosestTownFromTile(fallback); diff --git a/src/script/api/script_event_types.cpp b/src/script/api/script_event_types.cpp index b71b307e83..034684c806 100644 --- a/src/script/api/script_event_types.cpp +++ b/src/script/api/script_event_types.cpp @@ -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 json The JSON part to convert to Squirrel. */ diff --git a/src/script/api/script_objecttype.hpp b/src/script/api/script_objecttype.hpp index 9a5c47278f..85b7011dc0 100644 --- a/src/script/api/script_objecttype.hpp +++ b/src/script/api/script_objecttype.hpp @@ -46,7 +46,7 @@ public: /** * Build an object of the specified type. * @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. * @pre IsValidObjectType(object_type). * @return True if the object was successfully build. diff --git a/src/script/api/script_road.hpp b/src/script/api/script_road.hpp index 04537dbbf7..50a474c668 100644 --- a/src/script/api/script_road.hpp +++ b/src/script/api/script_road.hpp @@ -72,8 +72,8 @@ public: * Type of road station. */ enum RoadVehicleType { - ROADVEHTYPE_BUS, ///< Build objects useable for busses and passenger trams - ROADVEHTYPE_TRUCK, ///< Build objects useable for trucks and cargo trams + ROADVEHTYPE_BUS, ///< Build objects usable for busses and passenger trams + ROADVEHTYPE_TRUCK, ///< Build objects usable for trucks and cargo trams }; /** diff --git a/src/script/api/script_story_page.hpp b/src/script/api/script_story_page.hpp index 9e278ba646..5d77d05178 100644 --- a/src/script/api/script_story_page.hpp +++ b/src/script/api/script_story_page.hpp @@ -50,7 +50,7 @@ public: 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_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. }; /** diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 2e6c9db0c5..96f829735e 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -167,7 +167,7 @@ static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance) const WaterRegionPatchDesc current_node = patches_to_search.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) { /* 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 || @@ -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. */ diff --git a/src/sprite.h b/src/sprite.h index fe55acc1c6..f193302993 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -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 * @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. * * @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 - * @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. * * @param image The sprite to draw diff --git a/src/station_base.h b/src/station_base.h index 8df7d4ab22..1e11e1e1de 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -612,7 +612,7 @@ void RebuildStationKdtree(); /** * 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 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 diff --git a/src/stdafx.h b/src/stdafx.h index b689aeeb57..e9d897c4ba 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -194,7 +194,7 @@ /* * 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 * added to the code base. * Take for example the savegame called "Wentbourne", when running this game diff --git a/src/story_base.h b/src/story_base.h index dd6ede0859..235115f378 100644 --- a/src/story_base.h +++ b/src/story_base.h @@ -33,7 +33,7 @@ enum StoryPageElementType : uint8_t { SPET_GOAL, ///< An element that references a goal. 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_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, INVALID_SPET = 0xFF, }; diff --git a/src/table/settings/old_gameopt_settings.ini b/src/table/settings/old_gameopt_settings.ini index 9910a55f08..8cf1299ab9 100644 --- a/src/table/settings/old_gameopt_settings.ini +++ b/src/table/settings/old_gameopt_settings.ini @@ -8,7 +8,7 @@ ; under "gameopts" in the configuration file, but no longer are. Most of these ; 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 ; from the configuration file afterwards. Those that are still supported will ; be saved in their new place. diff --git a/src/tests/mock_environment.h b/src/tests/mock_environment.h index 470914d002..e1bc82dc4f 100644 --- a/src/tests/mock_environment.h +++ b/src/tests/mock_environment.h @@ -13,7 +13,7 @@ #include "mock_fontcache.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 { public: static MockEnvironment &Instance() diff --git a/src/tests/string_func.cpp b/src/tests/string_func.cpp index a88c0d19c9..49d9b1a5c9 100644 --- a/src/tests/string_func.cpp +++ b/src/tests/string_func.cpp @@ -431,7 +431,7 @@ static void ComposePart(std::back_insert_iterator &output, const st 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 static std::string Compose(Args &&... args) { diff --git a/src/tests/strings_func.cpp b/src/tests/strings_func.cpp index f82cdd92be..119bdfb79e 100644 --- a/src/tests/strings_func.cpp +++ b/src/tests/strings_func.cpp @@ -45,7 +45,7 @@ TEST_CASE("HaveDParamChanged") SetDParamStr(1, "some string"); 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); CHECK(HaveDParamChanged(backup) == false); diff --git a/src/tests/test_network_crypto.cpp b/src/tests/test_network_crypto.cpp index 9ca796b825..be28d486d5 100644 --- a/src/tests/test_network_crypto.cpp +++ b/src/tests/test_network_crypto.cpp @@ -261,11 +261,11 @@ TEST_CASE("Encryption handling") MockNetworkSocketHandler server_socket_handler(server.CreateClientToServerEncryptionHandler(), server.CreateServerToClientEncryptionHandler()); 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); } - SECTION("Encyption happening server -> client") { + SECTION("Encryption happening server -> client") { CheckEncryption(&server_socket_handler, &client_socket_handler); } diff --git a/src/tgp.cpp b/src/tgp.cpp index 74ee70b031..39a86b1435 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -658,7 +658,7 @@ static void HeightMapCurves(uint level) /* 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); - /* Readd sea level */ + /* Re-add sea level */ *h += I2H(1); } } @@ -799,10 +799,10 @@ static void HeightMapSmoothCoastInDirection(int org_x, int org_y, int dir_x, int /* Coast found? */ 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; - /* 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; } diff --git a/src/tile_map.cpp b/src/tile_map.cpp index 54cfc8ebd2..2b8bba3a7f 100644 --- a/src/tile_map.cpp +++ b/src/tile_map.cpp @@ -13,7 +13,7 @@ #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 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. diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index e8da7ae878..b8c9847447 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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 tpe The town production effect. * @param rate The town's product rate for this production. * @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]) { 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. * 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)) { - TownGenerateCargoBinominal(t, TPE_PASSENGERS, hs->population, stations); - TownGenerateCargoBinominal(t, TPE_MAIL, hs->mail_generation, stations); + TownGenerateCargoBinomial(t, TPE_PASSENGERS, hs->population, stations); + TownGenerateCargoBinomial(t, TPE_MAIL, hs->mail_generation, stations); } break; @@ -1038,7 +1038,7 @@ bool CheckTownRoadTypes() * @param dist_multi The distance multiplier. * @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; @@ -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); - 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 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. - * 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 * add another house. * @@ -1213,7 +1213,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile) /* We can't look further than that. */ 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 */ for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { @@ -1230,7 +1230,7 @@ static bool GrowTownWithExtraHouse(Town *t, TileIndex tile) break; } - /* If there are enough neighbors stop here */ + /* If there are enough neighbours stop here */ if (counter >= 3) { if (TryBuildTownHouse(t, tile)) { _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. */ 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::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) { cost = Command::Do(DC_AUTO | DC_NO_WATER, subtile); if (!cost.Succeeded()) return cost; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 78eb185e5d..d52e36ed5b 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -87,7 +87,7 @@ private: StringID action_tooltips[TACT_COUNT]; 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. diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 6e1f842874..9929084052 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -772,7 +772,7 @@ uint32_t Vehicle::GetGRFID() const /** * Shift all dates by given interval. * 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) { diff --git a/src/video/cocoa/cocoa_ogl.mm b/src/video/cocoa/cocoa_ogl.mm index fd458056cd..415b950787 100644 --- a/src/video/cocoa/cocoa_ogl.mm +++ b/src/video/cocoa/cocoa_ogl.mm @@ -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. */ -/** 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 void *dl = nullptr; diff --git a/src/video/sdl2_opengl_v.cpp b/src/video/sdl2_opengl_v.cpp index 6c3fb5d430..21d9b342a9 100644 --- a/src/video/sdl2_opengl_v.cpp +++ b/src/video/sdl2_opengl_v.cpp @@ -42,7 +42,7 @@ 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) { return reinterpret_cast(SDL_GL_GetProcAddress(proc)); diff --git a/src/viewport.cpp b/src/viewport.cpp index 6b38029f1b..8785ded2dc 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1515,7 +1515,7 @@ static void ViewportAddKdtreeSigns(DrawPixelInfo *dpi) * @param center the (preferred) center of the viewport sign * @param top the new top of 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) { @@ -1607,7 +1607,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv) sprite_list.sort(); std::vector 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 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 * 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 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. * 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. diff --git a/src/viewport_sprite_sorter_sse4.cpp b/src/viewport_sprite_sorter_sse4.cpp index 4f7de754ff..a5ce747dc1 100644 --- a/src/viewport_sprite_sorter_sse4.cpp +++ b/src/viewport_sprite_sorter_sse4.cpp @@ -56,7 +56,7 @@ void ViewportSortParentSpritesSSE41(ParentSpriteToSortVector *psdv) sprite_list.sort(); std::vector 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 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 * 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 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. * 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. diff --git a/src/widget_type.h b/src/widget_type.h index 0394abec1e..5d7d297206 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -89,7 +89,7 @@ enum WidgetType : uint8_t { WPT_TEXTSTYLE, ///< Widget part for specifying text colour. WPT_ALIGNMENT, ///< Widget part for specifying text/image alignment. 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_FUNCTION, ///< Widget part for calling a user function. @@ -479,7 +479,7 @@ public: NWidgetBase *GetWidgetOfType(WidgetType tp) override; protected: - std::vector> children; ///< Child widgets in contaier. + std::vector> children; ///< Child widgets in container. }; /** 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. - * #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. * * 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 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. - * @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 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. * - #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). * Below the last child widget, use an #EndContainer part. This part should be aligned with the #NWidget part that started the container. * diff --git a/src/window_gui.h b/src/window_gui.h index 836637c16c..5ba278a263 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -60,7 +60,7 @@ public: int vsep_wide; ///< Wide vertical spacing. int hsep_normal; ///< Normal 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 WidgetDimensions scaled; ///< Widget dimensions scaled for current zoom level. @@ -899,7 +899,7 @@ public: /** * Iterable ensemble of all valid Windows - * @tparam Tfront Wether we iterate from front + * @tparam Tfront Whether we iterate from front */ template struct AllWindows {