Codefix: typos in comments and strings

This commit is contained in:
Rubidium
2025-08-31 09:28:04 +02:00
committed by rubidium42
parent 4fb749886a
commit 7c0f69a8fe
78 changed files with 135 additions and 135 deletions

View File

@@ -1674,7 +1674,7 @@ static void AircraftEventHandler_Flying(Aircraft *v, const AirportFTAClass *apc)
if (current->heading == landingtype) {
/* save speed before, since if AirportHasBlock is false, it resets them to 0
* we don't want that for plane in air
* hack for speed thingie */
* hack for speed thingy */
uint16_t tcur_speed = v->cur_speed;
uint16_t tsubspeed = v->subspeed;
if (!AirportHasBlock(v, current, apc)) {

View File

@@ -435,7 +435,7 @@ static CommandCost CopyHeadSpecificThings(Vehicle *old_head, Vehicle *new_head,
/* Last do those things which do never fail (resp. we do not care about), but which are not undo-able */
if (cost.Succeeded() && old_head != new_head && flags.Test(DoCommandFlag::Execute)) {
/* Copy other things which cannot be copied by a command and which shall not stay resetted from the build vehicle command */
/* Copy other things which cannot be copied by a command and which shall not stay reset from the build vehicle command */
new_head->CopyVehicleConfigAndStatistics(old_head);
GroupStatistics::AddProfitLastYear(new_head);

View File

@@ -562,8 +562,8 @@ public:
this->HandleButtonClick(WID_RV_START_REPLACE);
ReplaceClick_StartReplace(false);
} else {
bool replacment_when_old = EngineHasReplacementWhenOldForCompany(Company::Get(_local_company), this->sel_engine[0], this->sel_group);
ShowDropDownMenu(this, _start_replace_dropdown, replacment_when_old ? 1 : 0, WID_RV_START_REPLACE, !this->replace_engines ? 1 << 1 : 0, 0);
bool replacement_when_old = EngineHasReplacementWhenOldForCompany(Company::Get(_local_company), this->sel_engine[0], this->sel_group);
ShowDropDownMenu(this, _start_replace_dropdown, replacement_when_old ? 1 : 0, WID_RV_START_REPLACE, !this->replace_engines ? 1 << 1 : 0, 0);
}
break;
}

View File

@@ -243,7 +243,7 @@ struct SpecializedStation : public BaseStation {
/**
* Gets station with given index
* @return pointer to station with given index casted to T *
* @return pointer to station with given index cast to T *
*/
static inline T *Get(auto index)
{

View File

@@ -571,7 +571,7 @@ public:
}
/**
* Returns sum of cargo still available for loading at the sation.
* Returns sum of cargo still available for loading at the station.
* (i.e. not counting cargo which is already reserved for loading)
* @return Cargo on board the vehicle.
*/

View File

@@ -24,7 +24,7 @@ struct GRFFile;
class CommandCost {
Money cost; ///< The cost of this action
StringID message; ///< Warning message for when success is unset
ExpensesType expense_type; ///< the type of expence as shown on the finances view
ExpensesType expense_type; ///< the type of expense as shown on the finances view
bool success; ///< Whether the command went fine up to this moment
Owner owner = CompanyID::Invalid(); ///< Originator owner of error.
StringID extra_message = INVALID_STRING_ID; ///< Additional warning message for when success is unset

View File

@@ -196,7 +196,7 @@ static bool IsValidCompanyManagerFace(CompanyManagerFace cmf)
return true;
}
static CompanyMask _dirty_company_finances{}; ///< Bitmask of compamy finances that should be marked dirty.
static CompanyMask _dirty_company_finances{}; ///< Bitmask of company finances that should be marked dirty.
/**
* Mark all finance windows owned by a company as needing a refresh.
@@ -1512,7 +1512,7 @@ std::optional<CompanyManagerFace> ParseCompanyManagerFaceCode(std::string_view s
auto bits = consumer.TryReadIntegerBase<uint32_t>(10, true);
if (!bits.has_value() || consumer.AnyBytesLeft()) return std::nullopt;
/* Ensure style laberl is valid. */
/* Ensure style label is valid. */
auto style = FindCompanyManagerFaceLabel(label);
if (!style.has_value()) return std::nullopt;

View File

@@ -74,7 +74,7 @@ public:
[[nodiscard]] size_type GetBytesLeft() const noexcept { return this->src.size() - this->position; }
/**
* Check wheter any bytes were already read.
* Check whether any bytes were already read.
*/
[[nodiscard]] bool AnyBytesRead() const noexcept { return this->position > 0; }
/**
@@ -543,12 +543,12 @@ public:
void Skip(size_type len);
/**
* Find first occurence of 'str'.
* Find first occurrence of 'str'.
* @return Offset from current reader position. 'npos' if no match found.
*/
[[nodiscard]] size_type Find(std::string_view str) const;
/**
* Find first occurence of 8-bit char 'c'.
* Find first occurrence of 8-bit char 'c'.
* @return Offset from current reader position. 'npos' if no match found.
*/
[[nodiscard]] size_type FindChar(char c) const
@@ -556,18 +556,18 @@ public:
return this->Find({&c, 1});
}
/**
* Find first occurence of UTF-8 char 'c'.
* Find first occurrence of UTF-8 char 'c'.
* @return Offset from current reader position. 'npos' if no match found.
*/
[[nodiscard]] size_type FindUtf8(char32_t c) const;
/**
* Find first occurence of any 8-bit char in 'chars'.
* Find first occurrence of any 8-bit char in 'chars'.
* @return Offset from current reader position. 'npos' if no match found.
*/
[[nodiscard]] size_type FindCharIn(std::string_view chars) const;
/**
* Find first occurence of any 8-bit char not in 'chars'.
* Find first occurrence of any 8-bit char not in 'chars'.
* @return Offset from current reader position. 'npos' if no match found.
*/
[[nodiscard]] size_type FindCharNotIn(std::string_view chars) const;

View File

@@ -44,7 +44,7 @@ enum Currencies : uint8_t {
CURRENCY_NLG, ///< Dutch Gulden
CURRENCY_NOK, ///< Norwegian Krone
CURRENCY_PLN, ///< Polish Zloty
CURRENCY_RON, ///< Romenian Leu
CURRENCY_RON, ///< Romanian Leu
CURRENCY_RUR, ///< Russian Rouble
CURRENCY_SIT, ///< Slovenian Tolar
CURRENCY_SEK, ///< Swedish Krona

View File

@@ -17,7 +17,7 @@ enum EffectVehicleType : uint8_t {
EV_CHIMNEY_SMOKE = 0, ///< Smoke of power plant (industry).
EV_STEAM_SMOKE = 1, ///< Smoke of steam engines.
EV_DIESEL_SMOKE = 2, ///< Smoke of diesel engines.
EV_ELECTRIC_SPARK = 3, ///< Sparcs of electric engines.
EV_ELECTRIC_SPARK = 3, ///< Sparks of electric engines.
EV_CRASH_SMOKE = 4, ///< Smoke of disasters.
EV_EXPLOSION_LARGE = 5, ///< Various explosions.
EV_BREAKDOWN_SMOKE = 6, ///< Smoke of broken vehicles except aircraft.

View File

@@ -524,7 +524,7 @@ void EngineOverrideManager::ResetToDefaultMapping()
* @param grf_local_id The local id in the newgrf
* @param grfid The GrfID that defines the scope of grf_local_id.
* If a newgrf overrides the engines of another newgrf, the "scope grfid" is the ID of the overridden newgrf.
* If dynnamic_engines is disabled, all newgrf share the same ID scope identified by INVALID_GRFID.
* If dynamic_engines is disabled, all newgrf share the same ID scope identified by INVALID_GRFID.
* @return The engine ID if present, or EngineID::Invalid() if not.
*/
EngineID EngineOverrideManager::GetID(VehicleType type, uint16_t grf_local_id, uint32_t grfid)
@@ -542,7 +542,7 @@ EngineID EngineOverrideManager::GetID(VehicleType type, uint16_t grf_local_id, u
* @param grf_local_id The local id in the newgrf
* @param grfid The GrfID that defines the scope of grf_local_id.
* If a newgrf overrides the engines of another newgrf, the "scope grfid" is the ID of the overridden newgrf.
* If dynnamic_engines is disabled, all newgrf share the same ID scope identified by INVALID_GRFID.
* If dynamic_engines is disabled, all newgrf share the same ID scope identified by INVALID_GRFID.
* @param static_access Whether to actually reserve the EngineID.
* @return The engine ID if present and now reserved, or EngineID::Invalid() if not.
*/

View File

@@ -212,7 +212,7 @@ struct EngineIDMappingKeyProjection {
/**
* Stores the mapping of EngineID to the internal id of newgrfs.
* Note: This is not part of Engine, as the data in the EngineOverrideManager and the engine pool get resetted in different cases.
* Note: This is not part of Engine, as the data in the EngineOverrideManager and the engine pool get reset in different cases.
*/
struct EngineOverrideManager {
std::array<std::vector<EngineIDMapping>, VEH_COMPANY_END> mappings;

View File

@@ -455,7 +455,7 @@ void LoadTownData()
default: NOT_REACHED();
}
TownID town_id; // The TownID of the town in OpenTTD. Not imported, but set during the founding proceess and stored here for convenience.
TownID town_id; // The TownID of the town in OpenTTD. Not imported, but set during the founding process and stored here for convenience.
/* Try founding on the target tile, and if that doesn't work, find the nearest suitable tile up to 16 tiles away.
* The target might be on water, blocked somehow, or on a steep slope that can't be terraformed by the founding command. */
for (auto tile : SpiralTileSequence(target_tile, 16, 0, 0)) {

View File

@@ -850,7 +850,7 @@ int DrawStringMultiLine(int left, int right, int top, int bottom, StringID str,
/**
* Draw a multiline string, possibly over multiple lines, if the region is within the current display clipping area.
* @note With clipping, it is not possible to determine how tall the rendered text will be, as it's not layouted.
* Regulard DrawStringMultiLine must be used if the height needs to be known.
* Regular DrawStringMultiLine must be used if the height needs to be known.
*
* @param left The left most position to draw on.
* @param right The right most position to draw on.

View File

@@ -1602,7 +1602,7 @@ struct PerformanceRatingDetailWindow : Window {
/* Draw it */
DrawString(this->bar_left, this->bar_right, text_top, GetString(STR_PERFORMANCE_DETAIL_PERCENT, Clamp<int64_t>(val, 0, needed) * 100 / needed), TC_FROMSTRING, SA_HOR_CENTER);
/* SCORE_LOAN is inversed */
/* SCORE_LOAN is inverted */
if (score_type == SCORE_LOAN) val = needed - val;
/* Draw the amount we have against what is needed

View File

@@ -96,7 +96,7 @@ uint16_t GroupStatistics::GetNumEngines(EngineID engine) const
}
/**
* Returns the GroupStatistic for the ALL_GROUPO of a vehicle type.
* Returns the GroupStatistic for the ALL_GROUP of a vehicle type.
* @param v Vehicle.
* @return GroupStatistics for the ALL_GROUP of the vehicle type.
*/

View File

@@ -15,7 +15,7 @@
#include "settings_type.h"
struct HighScore {
std::string name; ///< The name of the companyy and president.
std::string name; ///< The name of the company and president.
StringID title = INVALID_STRING_ID; ///< NOSAVE, has troubles with changing string-numbers.
uint16_t score = 0; ///< The score for this high score. Do NOT change type, will break hs.dat
};

View File

@@ -701,7 +701,7 @@ static void AnimateTile_Industry(TileIndex tile)
if ((TimerGameTick::counter & 1) == 0) AnimateSugarSieve(tile);
break;
case GFX_TOFFEE_QUARY:
case GFX_TOFFEE_QUARRY:
if ((TimerGameTick::counter & 3) == 0) AnimateToffeeQuarry(tile);
break;
@@ -793,7 +793,7 @@ static void MakeIndustryTileBigger(TileIndex tile)
case GFX_TOY_FACTORY:
case GFX_BUBBLE_CATCHER:
case GFX_TOFFEE_QUARY:
case GFX_TOFFEE_QUARRY:
SetAnimationFrame(tile, 0);
SetIndustryAnimationLoop(tile, 0);
break;
@@ -938,7 +938,7 @@ static void TileLoop_Industry(TileIndex tile)
TileLoopIndustry_BubbleGenerator(tile);
break;
case GFX_TOFFEE_QUARY:
case GFX_TOFFEE_QUARRY:
AddAnimatedTile(tile);
break;

View File

@@ -49,7 +49,7 @@ enum IndustryGraphics : uint8_t {
GFX_PLASTIC_FOUNTAIN_ANIMATED_8 = 155,
GFX_BUBBLE_GENERATOR = 161,
GFX_BUBBLE_CATCHER = 162,
GFX_TOFFEE_QUARY = 165,
GFX_TOFFEE_QUARRY = 165,
GFX_SUGAR_MINE_SIEVE = 174,
GFX_WATERTILE_SPECIALCHECK = 255, ///< not really a tile, but rather a very special check
};

View File

@@ -28,7 +28,7 @@ INSTANTIATE_POOL_METHODS(LinkGraphJob)
/**
* Create a link graph job from a link graph. The link graph will be copied so
* that the calculations don't interfer with the normal operations on the
* that the calculations don't interfere with the normal operations on the
* original. The job is immediately started.
* @param orig Original LinkGraph to be copied.
*/

View File

@@ -201,7 +201,7 @@ enum GlobalHotKeys : int32_t {
GHK_TOGGLE_TRANSPARENCY,
GHK_TOGGLE_INVISIBILITY = GHK_TOGGLE_TRANSPARENCY + 9,
GHK_TRANSPARENCY_TOOLBAR = GHK_TOGGLE_INVISIBILITY + 8,
GHK_TRANSPARANCY,
GHK_TRANSPARENCY,
GHK_CHAT,
GHK_CHAT_ALL,
GHK_CHAT_COMPANY,
@@ -382,7 +382,7 @@ struct MainWindow : Window
ShowTransparencyToolbar();
break;
case GHK_TRANSPARANCY:
case GHK_TRANSPARENCY:
ResetRestoreAllTransparency();
break;
@@ -515,7 +515,7 @@ struct MainWindow : Window
Hotkey('7' | WKC_CTRL | WKC_SHIFT, "invisibility_structures", GHK_TOGGLE_INVISIBILITY + 6),
Hotkey('8' | WKC_CTRL | WKC_SHIFT, "invisibility_catenary", GHK_TOGGLE_INVISIBILITY + 7),
Hotkey('X' | WKC_CTRL, "transparency_toolbar", GHK_TRANSPARENCY_TOOLBAR),
Hotkey('X', "toggle_transparency", GHK_TRANSPARANCY),
Hotkey('X', "toggle_transparency", GHK_TRANSPARENCY),
Hotkey({WKC_RETURN, 'T'}, "chat", GHK_CHAT),
Hotkey({WKC_SHIFT | WKC_RETURN, WKC_SHIFT | 'T'}, "chat_all", GHK_CHAT_ALL),
Hotkey({WKC_CTRL | WKC_RETURN, WKC_CTRL | 'T'}, "chat_company", GHK_CHAT_COMPANY),

View File

@@ -10,7 +10,7 @@
#ifndef MUSIC_MIDI_H
#define MUSIC_MIDI_H
/** Header of a Stanard MIDI File */
/** Header of a Standard MIDI File */
struct SMFHeader {
uint16_t format;
uint16_t tracks;
@@ -73,7 +73,7 @@ enum MidiController : uint8_t {
MIDICT_GENERAL4 = 19,
/* Offset from MSB to LSB of continuous controllers */
MIDICTOFS_HIGHRES = 32,
/* Stanard continuous controllers (LSB control) */
/* Standard continuous controllers (LSB control) */
MIDICT_BANKSELECT_LO = MIDICTOFS_HIGHRES + MIDICT_BANKSELECT,
MIDICT_MODWHEEL_LO = MIDICTOFS_HIGHRES + MIDICT_MODWHEEL,
MIDICT_BREATH_LO = MIDICTOFS_HIGHRES + MIDICT_BREATH,

View File

@@ -262,7 +262,7 @@ SOCKET NetworkAddress::Resolve(int family, int socktype, int flags, SocketList *
std::copy_n(reinterpret_cast<const std::byte *>(runp->ai_addr), runp->ai_addrlen, reinterpret_cast<std::byte *>(&this->address));
#ifdef __EMSCRIPTEN__
/* Emscripten doesn't zero sin_zero, but as we compare addresses
* to see if they are the same address, we need them to be zero'd.
* to see if they are the same address, we need them to be zeroed.
* Emscripten is, as far as we know, the only OS not doing this.
*
* https://github.com/emscripten-core/emscripten/issues/12998

View File

@@ -159,7 +159,7 @@ void NetworkHTTPRequest::WinHttpCallback(DWORD code, void *info, DWORD length)
DWORD size = *(DWORD *)info;
/* Next step: read the data in a temporary allocated buffer.
* The buffer will be free'd by OnReceiveData() in the next step. */
* The buffer will be freed by OnReceiveData() in the next step. */
char *buffer = size == 0 ? nullptr : new char[size];
WinHttpReadData(this->request, buffer, size, 0);
} break;
@@ -278,7 +278,7 @@ bool NetworkHTTPRequest::Receive()
/**
* Destructor of the HTTP request.
*
* Makes sure all handlers are closed, and all memory is free'd.
* Makes sure all handlers are closed, and all memory is freed.
*/
NetworkHTTPRequest::~NetworkHTTPRequest()
{

View File

@@ -42,7 +42,7 @@ NetworkServerGameInfo _network_game_info; ///< Information about our game.
/**
* Get the network version string used by this build.
* The returned string is guaranteed to be at most NETWORK_REVISON_LENGTH bytes including '\0' terminator.
* The returned string is guaranteed to be at most NETWORK_REVISION_LENGTH bytes including '\0' terminator.
*/
std::string_view GetNetworkRevisionString()
{

View File

@@ -109,7 +109,7 @@ ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler()
}
/**
* Handle the acception of a connection.
* Handle the acceptance of a connection.
* @param s The socket of the new connection.
* @param address The address of the peer.
*/

View File

@@ -1117,7 +1117,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_MOVE(Packet &p)
ClientID client_id = (ClientID)p.Recv_uint32();
CompanyID company_id = (CompanyID)p.Recv_uint8();
Debug(net, 9, "Client::Receive_SERVER_MOVE(): client_id={}, comapny_id={}", client_id, company_id);
Debug(net, 9, "Client::Receive_SERVER_MOVE(): client_id={}, company_id={}", client_id, company_id);
if (client_id == 0) {
/* definitely an invalid client id, debug message and do nothing. */

View File

@@ -656,7 +656,7 @@ void ClientNetworkCoordinatorSocketHandler::CloseTurnHandler(std::string_view to
turn_it->second->CloseSocket();
/* We don't remove turn_handler here, as we can be called from within that
* turn_handler instance, so our object cannot be free'd yet. Instead, we
* turn_handler instance, so our object cannot be freed yet. Instead, we
* check later if the connection is closed, and free the object then. */
}

View File

@@ -92,7 +92,7 @@ bool X25519DerivedKeys::Exchange(const X25519PublicKey &peer_public_key, X25519K
}
/**
* Encryption handler implementation for monocypther encryption after a X25519 key exchange.
* Encryption handler implementation for monocypher encryption after a X25519 key exchange.
*/
class X25519EncryptionHandler : public NetworkEncryptionHandler {
private:

View File

@@ -1428,7 +1428,7 @@ private:
}
/**
* Crete new company button is clicked.
* Create new company button is clicked.
* @param w The instance of this window.
* @param pt The point where this button was clicked.
*/
@@ -1621,7 +1621,7 @@ public:
{
this->RebuildList();
/* Currently server information is not sync'd to clients, so we cannot show it on clients. */
/* Currently server information is not synced to clients, so we cannot show it on clients. */
this->GetWidget<NWidgetStacked>(WID_CL_SERVER_SELECTOR)->SetDisplayedPlane(_network_server ? 0 : SZSP_HORIZONTAL);
this->SetWidgetDisabledState(WID_CL_SERVER_NAME_EDIT, !_network_server);
}
@@ -2065,7 +2065,7 @@ struct NetworkJoinStatusWindow : Window {
}
[[fallthrough]];
default: // Waiting is 15%, so the resting receivement of map is maximum 70%
default: // Waiting is 15%, so the remaining downloading of the map is maximum 70%
progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
break;
}

View File

@@ -1444,7 +1444,7 @@ static void ActivateOldShore()
}
/**
* Replocate the old tram depot sprites to the new position, if no new ones were loaded.
* Relocate the old tram depot sprites to the new position, if no new ones were loaded.
*/
static void ActivateOldTramDepot()
{

View File

@@ -142,7 +142,7 @@ static ChangeInfoResult CargoReserveInfo(uint first, uint last, int prop, ByteRe
cs->callback_mask = static_cast<CargoCallbackMasks>(buf.ReadByte());
break;
case 0x1D: // Vehicle capacity muliplier
case 0x1D: // Vehicle capacity multiplier
cs->multiplier = std::max<uint16_t>(1u, buf.ReadWord());
break;

View File

@@ -472,7 +472,7 @@ bool GetGlobalVariable(uint8_t param, uint32_t *value, const GRFFile *grffile)
/* skip elrail multiplier - disabled */
SB(*value, 8, 8, GetRailTypeInfo(RAILTYPE_MONO)->cost_multiplier); // monorail
} else {
SB(*value, 8, 8, GetRailTypeInfo(RAILTYPE_ELECTRIC)->cost_multiplier); // electified railway
SB(*value, 8, 8, GetRailTypeInfo(RAILTYPE_ELECTRIC)->cost_multiplier); // electrified railway
/* Skip monorail multiplier - no space in result */
}
SB(*value, 16, 8, GetRailTypeInfo(RAILTYPE_MAGLEV)->cost_multiplier); // maglev

View File

@@ -418,7 +418,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint first, uint last, int prop, By
IndustryTileLayoutTile &it = layout.emplace_back();
it.ti.x = buf.ReadByte(); // Offsets from northermost tile
it.ti.x = buf.ReadByte(); // Offsets from northernmost tile
++bytes_read;
if (it.ti.x == 0xFE && k == 0) {

View File

@@ -44,7 +44,7 @@ void InitializePatchFlags()
| (1U << 0x09) // trainrefit
| (0U << 0x0B) // subsidiaries
| ((_settings_game.order.gradual_loading ? 1U : 0U) << 0x0C) // gradualloading
| (1U << 0x12) // unifiedmaglevmode - set bit 0 mode. Not revelant to OTTD
| (1U << 0x12) // unifiedmaglevmode - set bit 0 mode. Not relevant to OTTD
| (1U << 0x13) // unifiedmaglevmode - set bit 1 mode
| (1U << 0x14) // bridgespeedlimits
| (1U << 0x16) // eternalgame
@@ -55,7 +55,7 @@ void InitializePatchFlags()
| ((_settings_game.construction.train_signal_side == 1 ? 1U : 0U) << 0x1B) // signalsontrafficside
| ((_settings_game.vehicle.disable_elrails ? 0U : 1U) << 0x1C); // electrifiedrailway
_ttdpatch_flags[2] = (1U << 0x01) // loadallgraphics - obsolote
_ttdpatch_flags[2] = (1U << 0x01) // loadallgraphics - obsolete
| (1U << 0x03) // semaphores
| (1U << 0x0A) // newobjects
| (0U << 0x0B) // enhancedgui

View File

@@ -15,7 +15,7 @@
/** The type of action 5 type. */
enum Action5BlockType : uint8_t {
A5BLOCK_FIXED, ///< Only allow replacing a whole block of sprites. (TTDP compatible)
A5BLOCK_ALLOW_OFFSET, ///< Allow replacing any subset by specifiing an offset.
A5BLOCK_ALLOW_OFFSET, ///< Allow replacing any subset by specifying an offset.
A5BLOCK_INVALID, ///< unknown/not-implemented type
};

View File

@@ -363,7 +363,7 @@ DropDownList BuildBadgeClassConfigurationList(const GUIBadgeClasses &gui_classes
* Toggle badge class visibility.
* @param feature Feature being used.
* @param class_badge Class badge.
* @param click Dropdown click reuslt.
* @param click Dropdown click result.
*/
static void BadgeClassToggleVisibility(GrfSpecFeature feature, Badge &class_badge, int click_result, BadgeFilterChoices &choices)
{
@@ -570,7 +570,7 @@ void ResetBadgeFilter(BadgeFilterChoices &choices, BadgeClassID badge_class_inde
/**
* Set badge filter choice for a class.
* @param choides Badge filter choides.
* @param choices Badge filter choices.
* @param badge_index Badge to set. The badge class is inferred from the badge.
* @note if the badge_index is invalid, the filter will be reset instead.
*/

View File

@@ -6,7 +6,7 @@
*/
/**
* @file newgrf_commons.h This file simplyfies and embeds a common mechanism of
* @file newgrf_commons.h This file simplifies and embeds a common mechanism of
* loading/saving and mapping of grf entities.
*/

View File

@@ -246,7 +246,7 @@ enum TTDPAircraftMovementActions : uint8_t {
AMA_TTDP_PAD1_TO_TAKEOFF,
AMA_TTDP_PAD2_TO_TAKEOFF,
AMA_TTDP_PAD3_TO_TAKEOFF,
AMA_TTDP_HANGAR_TO_TAKOFF,
AMA_TTDP_HANGAR_TO_TAKEOFF,
AMA_TTDP_LANDING_TO_HANGAR,
AMA_TTDP_IN_FLIGHT,
};
@@ -1243,7 +1243,7 @@ int GetEngineProperty(EngineID engine, PropertyID property, int orig_value, cons
}
/**
* Test for vehicle build probablity type.
* Test for vehicle build probability type.
* @param v Vehicle whose build probability to test.
* @param type Build probability type to test for.
* @returns True or false depending on the probability result, or std::nullopt if the callback failed.

View File

@@ -1771,7 +1771,7 @@ void ShowOrdersWindow(const Vehicle *v)
/* Using a different WindowDescs for _local_company causes problems.
* Due to this we have to close order windows in ChangeWindowOwner/CloseCompanyWindows,
* because we cannot change switch the WindowDescs and keeping the old WindowDesc results
* in crashed due to missing widges.
* in crashed due to missing widget.
* TODO Rewrite the order GUI to not use different WindowDescs.
*/
if (v->owner != _local_company) {

View File

@@ -170,8 +170,8 @@ static const CTRunDelegateCallbacks _sprite_font_callback = {
CFAutoRelease<CFStringRef> base(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buff, length, kCFAllocatorNull));
CFAttributedStringReplaceString(str.get(), CFRangeMake(0, 0), base.get());
const UniChar replacment_char = 0xFFFC;
CFAutoRelease<CFStringRef> replacment_str(CFStringCreateWithCharacters(kCFAllocatorDefault, &replacment_char, 1));
const UniChar replacement_char = 0xFFFC;
CFAutoRelease<CFStringRef> replacement_str(CFStringCreateWithCharacters(kCFAllocatorDefault, &replacement_char, 1));
/* Apply font and colour ranges to our string. This is important to make sure
* that we get proper glyph boundaries on style changes. */
@@ -199,7 +199,7 @@ static const CTRunDelegateCallbacks _sprite_font_callback = {
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))));
/* 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), replacement_str.get());
CFAttributedStringSetAttribute(str.get(), CFRangeMake(c, 1), kCTRunDelegateAttributeName, del.get());
}
}
@@ -253,7 +253,7 @@ CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font
CTRunGetGlyphs(run, CFRangeMake(0, 0), gl.get());
for (size_t i = 0; i < this->glyphs.size(); i++) {
if (buff[this->glyph_to_char[i]] >= SCC_SPRITE_START && buff[this->glyph_to_char[i]] <= SCC_SPRITE_END && (gl[i] == 0 || gl[i] == 3)) {
/* A glyph of 0 indidicates not found, while apparently 3 is what char 0xFFFC maps to. */
/* A glyph of 0 indicates not found, while apparently 3 is what char 0xFFFC maps to. */
this->glyphs[i] = font->fc->MapCharToGlyph(buff[this->glyph_to_char[i]]);
this->positions.emplace_back(pts[i].x, pts[i].x + advs[i].width - 1, (font->fc->GetHeight() - ScaleSpriteTrad(FontCache::GetDefaultFontHeight(font->fc->GetSize()))) / 2); // Align sprite font to centre
} else {

View File

@@ -29,7 +29,7 @@ static std::recursive_mutex _palette_mutex; ///< To coordinate access to _cur_pa
* PALETTE_BITS reduces the bits-per-channel of 32bpp graphics data to allow faster palette lookups from
* 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 fidelity.
* 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

View File

@@ -404,7 +404,7 @@ public:
TileArea non_cached_area = v->IsBus() ? st->bus_station : st->truck_station;
non_cached_area.Expand(YAPF_ROADVEH_PATH_CACHE_DESTINATION_LIMIT);
/* Find the first tile not contained by the non-cachable area, and remove from the cache. */
/* Find the first tile not contained by the non-cacheable area, and remove from the cache. */
auto it = std::find_if(std::begin(path_cache), std::end(path_cache), [&non_cached_area](const auto &pc) { return !non_cached_area.Contains(pc.tile); });
path_cache.erase(std::begin(path_cache), it);
}

View File

@@ -178,7 +178,7 @@ public:
static constexpr int PREVIEW_LEFT = 31; ///< Offset from left edge to draw preview.
static constexpr int PREVIEW_BOTTOM = 31; ///< Offset from bottom edge to draw preview.
static constexpr int STEP_PREVIEW_HEIGHT = 16; ///< Step for decreasing or increase preivew button height.
static constexpr int STEP_PREVIEW_HEIGHT = 16; ///< Step for decreasing or increase preview button height.
static constexpr int MAX_PREVIEW_HEIGHT = PREVIEW_HEIGHT * 3; ///< Maximum height of each preview button.
static constexpr uint EDITBOX_MAX_SIZE = 16; ///< The maximum number of characters for the filter edit box.

View File

@@ -24,7 +24,7 @@ class RandomAccessFile {
static constexpr int BUFFER_SIZE = 512;
std::string filename; ///< Full name of the file; relative path to subdir plus the extension of the file.
std::string simplified_filename; ///< Simplified lowecase name of the file; only the name, no path or extension.
std::string simplified_filename; ///< Simplified lowercase name of the file; only the name, no path or extension.
std::optional<FileHandle> file_handle; ///< File handle of the open file.
size_t pos; ///< Position in the file of the end of the read buffer.

View File

@@ -794,7 +794,7 @@ CommandCost CmdBuildRoad(DoCommandFlags flags, TileIndex tile, RoadBits pieces,
case MP_TUNNELBRIDGE: {
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) goto do_clear;
/* Only allow building the outern roadbit, so building long roads stops at existing bridges */
/* Only allow building the outer roadbit, so building long roads stops at existing bridges */
if (MirrorRoadBits(DiagDirToRoadBits(GetTunnelBridgeDirection(tile))) != pieces) goto do_clear;
if (HasTileRoadType(tile, rtt)) return CommandCost(STR_ERROR_ALREADY_BUILT);
/* Don't allow adding roadtype to the bridge/tunnel when vehicles are already driving on it */

View File

@@ -1712,7 +1712,7 @@ static void CheckIfRoadVehNeedsService(RoadVehicle *v)
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
}
/** Calandar day handler */
/** Calander day handler */
void RoadVehicle::OnNewCalendarDay()
{
if (!this->IsFrontEngine()) return;

View File

@@ -3035,7 +3035,7 @@ bool AfterLoadGame()
/* Fix articulated road vehicles.
* Some curves were shorter than other curves.
* Now they have the same length, but that means that trailing articulated parts will
* take longer to go through the curve than the parts in front which already left the courve.
* take longer to go through the curve than the parts in front which already left the curve.
* So, make articulated parts catch up. */
bool roadside = _settings_game.vehicle.road_side == 1;
std::vector<uint> skip_frames;

View File

@@ -932,7 +932,7 @@ static bool LoadOldCompanyEconomy(LoadgameState &ls, int)
if (!LoadChunk(ls, &c->cur_economy, _company_economy_chunk)) return false;
/* Don't ask, but the number in TTD(Patch) are inversed to OpenTTD */
/* Don't ask, but the number in TTD(Patch) are inverted to OpenTTD */
c->cur_economy.income = -c->cur_economy.income;
c->cur_economy.expenses = -c->cur_economy.expenses;

View File

@@ -285,7 +285,7 @@ static bool MakeLargeWorldScreenshot(ScreenshotType t, uint32_t width = 0, uint3
}
/**
* Callback for generating a heightmap. Supports 8bpp grayscale only.
* Callback for generating a heightmap. Supports 8bpp greyscale only.
* @param buffer Destination buffer.
* @param y Line number of the first line to write.
* @param n Number of lines to write.

View File

@@ -354,7 +354,7 @@ ScriptObject::DisableDoCommandScope::DisableDoCommandScope()
/* static */ SQInteger ScriptObject::Constructor(HSQUIRRELVM)
{
throw Script_FatalError("This class is not instantiable");
throw Script_FatalError("This class is not instantiatable");
}
/* static */ SQInteger ScriptObject::_cloned(HSQUIRRELVM vm)

View File

@@ -55,7 +55,7 @@ private:
};
/**
* Uper-parent object of all API classes. You should never use this class in
* Upper-parent object of all API classes. You should never use this class in
* your script, as it doesn't publish any public functions. It is used
* internally to have a common place to handle general things, like internal
* command processing, and command-validation checks.
@@ -143,7 +143,7 @@ public:
static void InitializeRandomizers();
/**
* Used when trying to instanciate ScriptObject from squirrel.
* Used when trying to instantiate ScriptObject from squirrel.
*/
static SQInteger Constructor(HSQUIRRELVM);

View File

@@ -93,7 +93,7 @@ public:
OC_RELIABILITY = ::OCV_RELIABILITY, ///< Skip based on the reliability, value is percent (0..100).
OC_MAX_RELIABILITY = ::OCV_MAX_RELIABILITY, ///< Skip based on the maximum reliability. Value in percent
OC_MAX_SPEED = ::OCV_MAX_SPEED, ///< Skip based on the maximum speed, value is in OpenTTD's internal speed unit, see ScriptEngine::GetMaxSpeed.
OC_AGE = ::OCV_AGE, ///< Skip based on the age, value is in calender-years. @see \ref ScriptCalendarTime
OC_AGE = ::OCV_AGE, ///< Skip based on the age, value is in calendar-years. @see \ref ScriptCalendarTime
OC_REQUIRES_SERVICE = ::OCV_REQUIRES_SERVICE, ///< Skip when the vehicle requires service, no value.
OC_UNCONDITIONALLY = ::OCV_UNCONDITIONALLY, ///< Always skip, no compare function, no value.
OC_REMAINING_LIFETIME = ::OCV_REMAINING_LIFETIME, ///< Skip based on the remaining lifetime in calendar-years. @see \ref ScriptCalendarTime

View File

@@ -282,7 +282,7 @@ public:
/**
* Opens the Story Book if not yet open and selects the given page.
* @param story_page_id The story page to update. If it is a global page, clients of all
* companies are affecetd. Otherwise only the clients of the company which the page belongs
* companies are affected. Otherwise only the clients of the company which the page belongs
* to are affected.
* @return True if the action succeeded.
* @pre ScriptCompanyMode::IsDeity().

View File

@@ -50,7 +50,7 @@ public:
/**
* Create a new subsidy.
* @param cargo_type The type of cargo to cary for the subsidy.
* @param cargo_type The type of cargo to carry for the subsidy.
* @param from_type The type of the subsidy on the 'from' side.
* @param from_id The ID of the 'from' side.
* @param to_type The type of the subsidy on the 'to' side.

View File

@@ -415,7 +415,7 @@ public:
* Raise the given corners of the tile. The corners can be combined,
* for example: SLOPE_N | SLOPE_W (= SLOPE_NW) will raise the west and the north corner.
* @note The corners will be modified in the order west (first), south, east, north (last).
* Changing one corner might cause another corner to be changed too. So modifiing
* Changing one corner might cause another corner to be changed too. So modifying
* multiple corners may result in changing some corners by multiple steps.
* @param tile The tile to raise.
* @param slope Corners to raise (SLOPE_xxx).
@@ -432,7 +432,7 @@ public:
* Lower the given corners of the tile. The corners can be combined,
* for example: SLOPE_N | SLOPE_W (= SLOPE_NW) will lower the west and the north corner.
* @note The corners will be modified in the order west (first), south, east, north (last).
* Changing one corner might cause another corner to be changed too. So modifiing
* Changing one corner might cause another corner to be changed too. So modifying
* multiple corners may result in changing some corners by multiple steps.
* @param tile The tile to lower.
* @param slope Corners to lower (SLOPE_xxx).

View File

@@ -370,7 +370,7 @@ public:
* is owned by you.
* @pre ScriptEngine::IsBuildable(engine_id).
* @pre ScriptCargo::IsValidCargo(cargo).
* @return The capacity the vehicle will have when refited.
* @return The capacity the vehicle will have when refitted.
*/
static SQInteger GetBuildWithRefitCapacity(TileIndex depot, EngineID engine_id, CargoType cargo);
@@ -431,7 +431,7 @@ public:
* @pre ScriptCargo::IsValidCargo(cargo).
* @pre You must own the vehicle.
* @pre The vehicle must be stopped in the depot.
* @return The capacity the vehicle will have when refited.
* @return The capacity the vehicle will have when refitted.
*/
static SQInteger GetRefitCapacity(VehicleID vehicle_id, CargoType cargo);

View File

@@ -167,7 +167,7 @@ std::optional<std::string_view> SoundDriver_XAudio2::Start(const StringList &par
CoUninitialize();
Debug(driver, 0, "xaudio2_s: XAudio2Create failed ({:08x})", (uint)hr);
return "Failed to inititialise the XAudio2 engine";
return "Failed to initialise the XAudio2 engine";
}
/* Create a mastering voice */

View File

@@ -888,7 +888,7 @@ typedef std::set<std::unique_ptr<CargoDataEntry>, CargoSorter> CargoDataSet;
/**
* A cargo data entry representing one possible row in the station view window's
* top part. Cargo data entries form a tree where each entry can have several
* children. Parents keep track of the sums of their childrens' cargo counts.
* children. Parents keep track of the sums of their children's cargo counts.
*/
class CargoDataEntry {
public:

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/>.
*/
/** @file strings_interal.h Types and functions related to the internal workings of formatting OpenTTD's strings. */
/** @file strings_internal.h Types and functions related to the internal workings of formatting OpenTTD's strings. */
#ifndef STRINGS_INTERNAL_H
#define STRINGS_INTERNAL_H

View File

@@ -56,6 +56,6 @@ static const uint SUBSIDY_PAX_MIN_POPULATION = 400; ///< Min. population of to
static const uint SUBSIDY_CARGO_MIN_POPULATION = 900; ///< Min. population of destination town for cargo route
static const uint SUBSIDY_MAX_PCT_TRANSPORTED = 42; ///< Subsidy will be created only for towns/industries with less % transported
static const uint SUBSIDY_MAX_DISTANCE = 70; ///< Max. length of subsidised route (DistanceManhattan)
static const uint SUBSIDY_TOWN_CARGO_RADIUS = 6; ///< Extent of a tile area around town center when scanning for town cargo acceptance and production (6 ~= min catchmement + min station / 2)
static const uint SUBSIDY_TOWN_CARGO_RADIUS = 6; ///< Extent of a tile area around town center when scanning for town cargo acceptance and production (6 ~= min catchment + min station / 2)
#endif /* SUBSIDY_BASE_H */

View File

@@ -114,7 +114,7 @@ static const std::initializer_list<AirportTileLayout> _tile_table_city = {
{ _tile_table_city_0, DIR_N },
};
/** Tiles for Metropolitain Airport (large) - 2 runways */
/** Tiles for Metropolitan Airport (large) - 2 runways */
static const std::initializer_list<AirportTileTable> _tile_table_metropolitan_0 = {
MK(0, 0, APT_BUILDING_1),
MK(1, 0, APT_APRON_FENCE_NW),

View File

@@ -5,7 +5,7 @@
;
; Locale settings as stored in the main configuration file ("openttd.cfg") and
; in the savegame PATS chunk. These settings are not sync'd over the network.
; in the savegame PATS chunk. These settings are not synced over the network.
[pre-amble]
static std::pair<StringParameter, StringParameter> SettingsValueVelocityUnit(const IntSettingDesc &sd, int32_t value);

View File

@@ -153,7 +153,7 @@ static const SpriteID SPR_GROUP_LIVERY_SHIP = SPR_OPENTTD_BASE + 177;
static const SpriteID SPR_GROUP_LIVERY_AIRCRAFT = SPR_OPENTTD_BASE + 178;
static const SpriteID SPR_TOWN_RATING_NA = SPR_OPENTTD_BASE + 162;
static const SpriteID SPR_TOWN_RATING_APALLING = SPR_OPENTTD_BASE + 163;
static const SpriteID SPR_TOWN_RATING_APPALLING = SPR_OPENTTD_BASE + 163;
static const SpriteID SPR_TOWN_RATING_MEDIOCRE = SPR_OPENTTD_BASE + 164;
static const SpriteID SPR_TOWN_RATING_GOOD = SPR_OPENTTD_BASE + 165;

View File

@@ -52,7 +52,7 @@ extern bool ScriptAdminMakeJSON(nlohmann::json &json, HSQUIRRELVM vm, SQInteger
static std::optional<std::string> TestScriptAdminMakeJSON(std::string_view squirrel)
{
auto vm = sq_open(1024);
/* sq_compile creates a closure with our snipper, which is a table.
/* sq_compile creates a closure with our snippet, which is a table.
* Add "return " to get the table on the stack. */
std::string buffer = fmt::format("return {}", squirrel);

View File

@@ -77,7 +77,7 @@ struct DiagonalTileArea {
* Construct this tile area with some set values.
* @param tile The base tile.
* @param a The "x" extent.
* @param b The "y" estent.
* @param b The "y" extent.
*/
DiagonalTileArea(TileIndex tile = INVALID_TILE, int16_t a = 0, int16_t b = 0) : tile(tile), a(a), b(b)
{

View File

@@ -81,7 +81,7 @@ RailType _last_built_railtype;
RoadType _last_built_roadtype;
RoadType _last_built_tramtype;
/** Toobar modes */
/** Toolbar modes */
enum ToolbarMode : uint8_t {
TB_NORMAL,
TB_UPPER,
@@ -1117,7 +1117,7 @@ void ToggleDirtyBlocks()
}
/**
* Toggle drawing of widget outlihes.
* Toggle drawing of widget outlines.
* @note has only an effect when newgrf_developer_tools are active.
*/
void ToggleWidgetOutlines()
@@ -1426,8 +1426,8 @@ public:
this->current_y = given_height;
/* Figure out what are the visible buttons */
uint arrangable_count, button_count, spacer_count;
const WidgetID *arrangement = GetButtonArrangement(given_width, arrangable_count, button_count, spacer_count);
uint arrangeable_count, button_count, spacer_count;
const WidgetID *arrangement = GetButtonArrangement(given_width, arrangeable_count, button_count, spacer_count);
/* Create us ourselves a quick lookup table from WidgetID to slot. */
std::map<WidgetID, uint> lookup;
@@ -1448,8 +1448,8 @@ public:
uint button_i = 0;
/* Index into the arrangement indices. */
const WidgetID *slotp = rtl ? &arrangement[arrangable_count - 1] : arrangement;
for (uint i = 0; i < arrangable_count; i++) {
const WidgetID *slotp = rtl ? &arrangement[arrangeable_count - 1] : arrangement;
for (uint i = 0; i < arrangeable_count; i++) {
uint slot = lookup[*slotp];
auto &child_wid = this->children[slot];
/* If we have space to give to the spacers, do that. */
@@ -1495,24 +1495,24 @@ public:
/**
* Get the arrangement of the buttons for the toolbar.
* @param width the new width of the toolbar.
* @param arrangable_count output of the number of visible items.
* @param arrangeable_count output of the number of visible items.
* @param button_count output of the number of visible buttons.
* @param spacer_count output of the number of spacers.
* @return the button configuration.
*/
virtual const WidgetID *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const = 0;
virtual const WidgetID *GetButtonArrangement(uint &width, uint &arrangeable_count, uint &button_count, uint &spacer_count) const = 0;
};
/** Container for the 'normal' main toolbar */
class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
const WidgetID *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
const WidgetID *GetButtonArrangement(uint &width, uint &arrangeable_count, uint &button_count, uint &spacer_count) const override
{
static const uint SMALLEST_ARRANGEMENT = 14;
static const uint BIGGEST_ARRANGEMENT = 20;
/* The number of buttons of each row of the toolbar should match the number of items which we want to be visible.
* The total number of buttons should be equal to arrangable_count * 2.
* No bad things happen, but we could see strange behaviours if we have buttons < (arrangable_count * 2) like a
* The total number of buttons should be equal to arrangeable_count * 2.
* No bad things happen, but we could see strange behaviours if we have buttons < (arrangeable_count * 2) like a
* pause button appearing on the right of the lower toolbar and weird resizing of the widgets even if there is
* enough space.
*/
@@ -1811,7 +1811,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
/* If at least BIGGEST_ARRANGEMENT fit, just spread all the buttons nicely */
uint full_buttons = std::max(CeilDiv(width, this->smallest_x), SMALLEST_ARRANGEMENT);
if (full_buttons > BIGGEST_ARRANGEMENT) {
button_count = arrangable_count = lengthof(arrange_all);
button_count = arrangeable_count = lengthof(arrange_all);
spacer_count = this->spacers;
return arrange_all;
}
@@ -1819,7 +1819,7 @@ class NWidgetMainToolbarContainer : public NWidgetToolbarContainer {
/* Introduce the split toolbar */
static const WidgetID * const arrangements[] = { arrange14, arrange15, arrange16, arrange17, arrange18, arrange19, arrange20 };
button_count = arrangable_count = full_buttons;
button_count = arrangeable_count = full_buttons;
spacer_count = this->spacers;
return arrangements[full_buttons - SMALLEST_ARRANGEMENT] + ((_toolbar_mode == TB_LOWER) ? full_buttons : 0);
}
@@ -1845,7 +1845,7 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
}
}
const WidgetID *GetButtonArrangement(uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const override
const WidgetID *GetButtonArrangement(uint &width, uint &arrangeable_count, uint &button_count, uint &spacer_count) const override
{
static const WidgetID arrange_all[] = {
WID_TE_PAUSE,
@@ -1918,8 +1918,8 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
size_t min_full_width = (lengthof(arrange_all) - std::size(this->panel_widths)) * this->smallest_x + this->panel_widths[0] + this->panel_widths[1];
if (width >= min_full_width) {
width -= this->panel_widths[0] + this->panel_widths[1];
arrangable_count = lengthof(arrange_all);
button_count = arrangable_count - 2;
arrangeable_count = lengthof(arrange_all);
button_count = arrangeable_count - 2;
spacer_count = this->spacers;
return arrange_all;
}
@@ -1928,18 +1928,18 @@ class NWidgetScenarioToolbarContainer : public NWidgetToolbarContainer {
size_t min_small_width = (lengthof(arrange_switch) - std::size(this->panel_widths)) * this->smallest_x / 2 + this->panel_widths[1];
if (width > min_small_width) {
width -= this->panel_widths[1];
arrangable_count = lengthof(arrange_nopanel);
button_count = arrangable_count - 1;
arrangeable_count = lengthof(arrange_nopanel);
button_count = arrangeable_count - 1;
spacer_count = this->spacers - 1;
return arrange_nopanel;
}
/* Split toolbar */
width -= this->panel_widths[1];
arrangable_count = lengthof(arrange_switch) / 2;
button_count = arrangable_count - 1;
arrangeable_count = lengthof(arrange_switch) / 2;
button_count = arrangeable_count - 1;
spacer_count = 0;
return arrange_switch + ((_toolbar_mode == TB_LOWER) ? arrangable_count : 0);
return arrange_switch + ((_toolbar_mode == TB_LOWER) ? arrangeable_count : 0);
}
};

View File

@@ -213,7 +213,7 @@ enum TownCouncilAttitudes {
*/
enum TownRatingCheckType {
ROAD_REMOVE = 0, ///< Removal of a road owned by the town.
TUNNELBRIDGE_REMOVE = 1, ///< Removal of a tunnel or bridge owned by the towb.
TUNNELBRIDGE_REMOVE = 1, ///< Removal of a tunnel or bridge owned by the town.
TOWN_RATING_CHECK_TYPE_COUNT, ///< Number of town checking action types.
};

View File

@@ -1427,7 +1427,7 @@ static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDi
slope_tile += delta;
}
/* More population means longer tunnels, but make sure we can at least cover the smallest mountain which neccesitates tunneling. */
/* More population means longer tunnels, but make sure we can at least cover the smallest mountain which necessitates tunneling. */
max_tunnel_length = (t->cache.population / 1000) + 7;
} else {
/* When tunneling under an obstruction, the length limit is 5, enough to tunnel under a four-track railway. */
@@ -1435,7 +1435,7 @@ static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDi
}
uint8_t tunnel_length = 0;
TileIndex tunnel_tile = tile; // Iteratator to store the other end tile of the tunnel.
TileIndex tunnel_tile = tile; // Iterator to store the other end tile of the tunnel.
/* Find the end tile of the tunnel for length and continuation checks. */
do {
@@ -1636,7 +1636,7 @@ static TownGrowthResult GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, Dia
if (cur_rb & target_rb) {
/* If it's a road turn possibly build a house in a corner.
* Use intersection with straight road as an indicator
* that we randomed corner house position.
* that we randomised corner house position.
* A turn (and we check for that later) always has only
* one common bit with a straight road so it has the same
* chance to be chosen as the house on the side of a road.

View File

@@ -870,7 +870,7 @@ public:
if (_game_mode == GM_EDITOR || !t->have_ratings.Test(_local_company)) {
DrawSprite(SPR_TOWN_RATING_NA, PAL_NONE, icon_x, tr.top + (this->resize.step_height - icon_size.height) / 2);
} else {
SpriteID icon = SPR_TOWN_RATING_APALLING;
SpriteID icon = SPR_TOWN_RATING_APPALLING;
if (t->ratings[_local_company] > RATING_VERYPOOR) icon = SPR_TOWN_RATING_MEDIOCRE;
if (t->ratings[_local_company] > RATING_GOOD) icon = SPR_TOWN_RATING_GOOD;
DrawSprite(icon, PAL_NONE, icon_x, tr.top + (this->resize.step_height - icon_size.height) / 2);

View File

@@ -267,7 +267,7 @@ static Money TunnelBridgeClearCost(TileIndex tile, Price base_price)
} break;
case TRANSPORT_RAIL: base_cost += RailClearCost(GetRailType(tile)); break;
/* Aquaducts have their own clear price. */
/* Aqueducts have their own clear price. */
case TRANSPORT_WATER: base_cost = _price[PR_CLEAR_AQUEDUCT]; break;
default: break;
}

View File

@@ -746,7 +746,7 @@ public:
/**
* Copy certain configurations and statistics of a vehicle after successful autoreplace/renew
* The function shall copy everything that cannot be copied by a command (like orders / group etc),
* and that shall not be resetted for the new vehicle.
* and that shall not be reset for the new vehicle.
* @param src The old vehicle
*/
inline void CopyVehicleConfigAndStatistics(Vehicle *src)
@@ -1129,7 +1129,7 @@ struct SpecializedVehicle : public Vehicle {
/**
* Gets vehicle with given index
* @return pointer to vehicle with given index casted to T *
* @return pointer to vehicle with given index cast to T *
*/
static inline T *Get(auto index)
{

View File

@@ -357,7 +357,7 @@ struct RefitResult {
* @param new_subtype Cargo subtype to refit to. 0xFF means to try keeping the same subtype according to GetBestFittingSubType().
* @param flags Command flags
* @param auto_refit Refitting is done as automatic refitting outside a depot.
* @return Refit cost + refittet capacity + mail capacity (aircraft).
* @return Refit cost + refitted capacity + mail capacity (aircraft).
*/
static std::tuple<CommandCost, uint, uint16_t, CargoArray> RefitVehicle(Vehicle *v, bool only_this, uint8_t num_vehicles, CargoType new_cargo_type, uint8_t new_subtype, DoCommandFlags flags, bool auto_refit)
{

View File

@@ -141,7 +141,7 @@ std::optional<std::string_view> VideoDriver_Cocoa::Initialize()
/**
* Set dirty a rectangle managed by a cocoa video subdriver.
* @param left Left x cooordinate of the dirty rectangle.
* @param top Uppder y coordinate of the dirty rectangle.
* @param top Upper y coordinate of the dirty rectangle.
* @param width Width of the dirty rectangle.
* @param height Height of the dirty rectangle.
*/

View File

@@ -1065,7 +1065,7 @@ static void DrawTileHighlightType(const TileInfo *ti, TileHighlightType tht)
}
/**
* Highlights tiles insede local authority of selected towns.
* Highlights tiles inside local authority of selected towns.
* @param *ti TileInfo Tile that is being drawn
*/
static void HighlightTownLocalAuthorityTiles(const TileInfo *ti)
@@ -1104,7 +1104,7 @@ static void HighlightTownLocalAuthorityTiles(const TileInfo *ti)
*/
static void DrawTileSelection(const TileInfo *ti)
{
/* Highlight tiles insede local authority of selected towns. */
/* Highlight tiles inside local authority of selected towns. */
HighlightTownLocalAuthorityTiles(ti);
/* Draw a red error square? */
@@ -1590,7 +1590,7 @@ static void ViewportSortParentSprites(ParentSpriteToSortVector *psdv)
* adding extra fields to ParentSpriteToDraw structure.
*/
const uint32_t ORDER_COMPARED = UINT32_MAX; // Sprite was compared but we still need to compare the ones preceding it
const uint32_t ORDER_RETURNED = UINT32_MAX - 1; // Makr sorted sprite in case there are other occurrences of it in the stack
const uint32_t ORDER_RETURNED = UINT32_MAX - 1; // Mark sorted sprite in case there are other occurrences of it in the stack
std::stack<ParentSpriteToDraw *> sprite_order;
uint32_t next_order = 0;

View File

@@ -1169,7 +1169,7 @@ void NWidgetCore::SetString(StringID string)
/**
* Set string and tool tip of the nested widget.
* @param stringThe new string.
* @param string The new string.
* @param tool_tip The new tool_tip.
*/
void NWidgetCore::SetStringTip(StringID string, StringID tool_tip)
@@ -3397,7 +3397,7 @@ std::unique_ptr<NWidgetBase> MakeNWidgets(std::span<const NWidgetPart> nwid_part
* between the title bar and the window body if the first widget in the parts array looks like a title bar (it is a horizontal
* container with a caption widget) and has a shade box widget.
* @param nwid_parts Span of nested widget parts.
* @param[out] shade_select Pointer to the inserted shade selection widget (\c nullptr if not unserted).
* @param[out] shade_select Pointer to the inserted shade selection widget (\c nullptr if not inserted).
* @return Root of the nested widget tree, a vertical container containing the entire GUI.
* @ingroup NestedWidgetParts
*/

View File

@@ -541,7 +541,7 @@ public:
void AdjustPaddingForZoom() override;
void SetPIP(uint8_t pip_pre, uint8_t pip_inter, uint8_t pip_post);
void SetPIPRatio(uint8_t pip_ratio_pre, uint8_t pip_ratio_inter, uint8_t pip_rato_post);
void SetPIPRatio(uint8_t pip_ratio_pre, uint8_t pip_ratio_inter, uint8_t pip_ratio_post);
protected:
NWidContainerFlags flags{}; ///< Flags of the container.

View File

@@ -706,7 +706,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
int dx = (w->resize.step_width == 0) ? 0 : def_width - w->width;
int dy = (w->resize.step_height == 0) ? 0 : def_height - w->height;
/* dx and dy has to go by step.. calculate it.
* The cast to int is necessary else dx/dy are implicitly casted to unsigned int, which won't work. */
* The cast to int is necessary else dx/dy are implicitly cast to unsigned int, which won't work. */
if (w->resize.step_width > 1) dx -= dx % (int)w->resize.step_width;
if (w->resize.step_height > 1) dy -= dy % (int)w->resize.step_height;
ResizeWindow(w, dx, dy, false);
@@ -996,7 +996,7 @@ void Window::ReInit(int rx, int ry, bool reposition)
int dx = (this->resize.step_width == 0) ? 0 : window_width - this->width;
int dy = (this->resize.step_height == 0) ? 0 : window_height - this->height;
/* dx and dy has to go by step.. calculate it.
* The cast to int is necessary else dx/dy are implicitly casted to unsigned int, which won't work. */
* The cast to int is necessary else dx/dy are implicitly cast to unsigned int, which won't work. */
if (this->resize.step_width > 1) dx -= dx % (int)this->resize.step_width;
if (this->resize.step_height > 1) dy -= dy % (int)this->resize.step_height;
@@ -1490,7 +1490,7 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height, bool al
int enlarge_y = std::max(std::min(def_height - this->height, free_height - this->height), 0);
/* X and Y has to go by step.. calculate it.
* The cast to int is necessary else x/y are implicitly casted to
* The cast to int is necessary else x/y are implicitly cast to
* unsigned int, which won't work. */
if (this->resize.step_width > 1) enlarge_x -= enlarge_x % (int)this->resize.step_width;
if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height;
@@ -2066,7 +2066,7 @@ static void EnsureVisibleCaption(Window *w, int nx, int ny)
* Resize the window.
* Update all the widgets of a window based on their resize flags
* Both the areas of the old window and the new sized window are set dirty
* ensuring proper redrawal.
* ensuring proper redrawing.
* @param w Window to resize
* @param delta_x Delta x-size of changed window (positive if larger, etc.)
* @param delta_y Delta y-size of changed window
@@ -2266,7 +2266,7 @@ static EventState HandleWindowDragging()
}
/* X and Y has to go by step.. calculate it.
* The cast to int is necessary else x/y are implicitly casted to
* The cast to int is necessary else x/y are implicitly cast to
* unsigned int, which won't work. */
if (w->resize.step_width > 1) x -= x % (int)w->resize.step_width;
if (w->resize.step_height > 1) y -= y % (int)w->resize.step_height;
@@ -2293,7 +2293,7 @@ static EventState HandleWindowDragging()
_drag_delta.x += x;
}
/* ResizeWindow sets both pre- and after-size to dirty for redrawal */
/* ResizeWindow sets both pre- and after-size to dirty for redrawing */
ResizeWindow(w, x, y);
return ES_HANDLED;
}
@@ -2377,7 +2377,7 @@ static void HandleScrollbarScrolling(Window *w)
}
/**
* Handle active widget (mouse draggin on widget) with the mouse.
* Handle active widget (mouse dragging on widget) with the mouse.
* @return State of handling the event.
*/
static EventState HandleActiveWidget()