Skip to content

Commit

Permalink
fix many typos (diasurgical#7322)
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel authored Aug 9, 2024
1 parent 75f42cc commit 24f108f
Show file tree
Hide file tree
Showing 61 changed files with 140 additions and 140 deletions.
2 changes: 1 addition & 1 deletion Source/DiabloUI/diabloui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ void DrawSelector(const SDL_Rect &rect)
const ClxSpriteList sprites = *ArtFocus[size];
const ClxSprite sprite = sprites[GetAnimationFrame(sprites.numSprites())];

// TODO FOCUS_MED appares higher than the box
// TODO FOCUS_MED appears higher than the box
const int y = rect.y + (rect.h - static_cast<int>(sprite.height())) / 2;

const Surface &out = Surface(DiabloUiSurface());
Expand Down
2 changes: 1 addition & 1 deletion Source/DiabloUI/multi/selgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void selgame_GameSelection_Focus(size_t value)
infoString.append(_("Speed: Fastest"));
break;
default:
// This should not occure, so no translations is needed
// This should not occur, so no translation is needed
infoString.append(StrCat("Speed: ", gameInfo.gameData.nTickRate));
break;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CloseCharPanel();
void ToggleCharPanel();

/**
* @brief Check if the UI can cover the game area entierly
* @brief Check if the UI can cover the game area entirely
*/
inline bool CanPanelsCoverView()
{
Expand Down Expand Up @@ -160,7 +160,7 @@ void CheckPanelInfo();

/**
* Check if the mouse is within a control panel button that's flagged.
* Takes apropiate action if so.
* Takes appropriate action if so.
*/
void CheckBtnUp();
void FreeControlPan();
Expand Down
4 changes: 2 additions & 2 deletions Source/controls/plrctrls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ void SpellBookMove(AxisDirection dir)
/**
* @brief check if stepping in direction (dir) from position is blocked.
*
* If you step from A to B, at leat one of the Xs need to be clear:
* If you step from A to B, at least one of the Xs need to be clear:
*
* AX
* XB
Expand Down Expand Up @@ -1747,7 +1747,7 @@ void plrctrls_after_check_curs_move()
return;
}

// Clear focuse set by cursor
// Clear focus set by cursor
PlayerUnderCursor = nullptr;
pcursmonst = -1;
pcursitem = -1;
Expand Down
4 changes: 2 additions & 2 deletions Source/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,11 @@ void CheckCursMove()
int ty = sy / TILE_HEIGHT;
ShiftGrid(&mx, &my, tx, ty);

// Shift position to match diamond grid aligment
// Shift position to match diamond grid alignment
int px = sx % TILE_WIDTH;
int py = sy % TILE_HEIGHT;

// Shift position to match diamond grid aligment
// Shift position to match diamond grid alignment
bool flipy = py < (px / 2);
if (flipy) {
my--;
Expand Down
12 changes: 6 additions & 6 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ void DiabloInit()
if (gbIsHellfire && !forceHellfire && *sgOptions.StartUp.gameMode == StartUpGameMode::Ask) {
UiSelStartUpGameOption();
if (!gbIsHellfire) {
// Reinitialize the UI Elements cause we changed the game
// Reinitialize the UI Elements because we changed the game
UnloadUiGFX();
UiInitialize();
if (IsHardwareCursor())
Expand Down Expand Up @@ -1483,7 +1483,7 @@ void TimeoutCursor(bool bTimeout)
} else if (sgnTimeoutCurs != CURSOR_NONE) {
// Timeout is gone, we should restore the previous cursor.
// But the timeout cursor could already be changed by the now processed messages (for example item cursor from CMD_GETITEM).
// Changing the item cursor back to the previous (hand) cursor could result in deleted items, cause this resets Player.HoldItem (see NewCursor).
// Changing the item cursor back to the previous (hand) cursor could result in deleted items, because this resets Player.HoldItem (see NewCursor).
if (pcurs == CURSOR_HOURGLASS)
NewCursor(sgnTimeoutCurs);
sgnTimeoutCurs = CURSOR_NONE;
Expand Down Expand Up @@ -1524,11 +1524,11 @@ void InventoryKeyPressed()
return;
invflag = !invflag;
if (!IsLeftPanelOpen() && CanPanelsCoverView()) {
if (!invflag) { // We closed the invetory
if (!invflag) { // We closed the inventory
if (MousePosition.x < 480 && MousePosition.y < GetMainPanel().position.y) {
SetCursorPos(MousePosition + Displacement { 160, 0 });
}
} else if (!sbookflag) { // We opened the invetory
} else if (!sbookflag) { // We opened the inventory
if (MousePosition.x > 160 && MousePosition.y < GetMainPanel().position.y) {
SetCursorPos(MousePosition - Displacement { 160, 0 });
}
Expand Down Expand Up @@ -1604,11 +1604,11 @@ void SpellBookKeyPressed()
return;
sbookflag = !sbookflag;
if (!IsLeftPanelOpen() && CanPanelsCoverView()) {
if (!sbookflag) { // We closed the invetory
if (!sbookflag) { // We closed the inventory
if (MousePosition.x < 480 && MousePosition.y < GetMainPanel().position.y) {
SetCursorPos(MousePosition + Displacement { 160, 0 });
}
} else if (!invflag) { // We opened the invetory
} else if (!invflag) { // We opened the inventory
if (MousePosition.x > 160 && MousePosition.y < GetMainPanel().position.y) {
SetCursorPos(MousePosition - Displacement { 160, 0 });
}
Expand Down
4 changes: 2 additions & 2 deletions Source/diablo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum clicktype : int8_t {
};

/**
* @brief Specifices what game logic step is currently executed
* @brief Specifies what game logic step is currently executed
*/
enum class GameLogicStep : uint8_t {
None,
Expand Down Expand Up @@ -121,7 +121,7 @@ struct QuickMessage {
constexpr size_t QUICK_MESSAGE_OPTIONS = 10;
extern QuickMessage QuickMessages[QUICK_MESSAGE_OPTIONS];
/**
* @brief Specifices what game logic step is currently executed
* @brief Specifies what game logic step is currently executed
*/
extern GameLogicStep gGameLogicStep;

Expand Down
2 changes: 1 addition & 1 deletion Source/dvlnet/packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef int leaveinfo_t; // also change later
#ifdef PACKET_ENCRYPTION
typedef std::array<unsigned char, crypto_secretbox_KEYBYTES> key_t;
#else
// Stub out the key_t defintion as we're not doing any encryption.
// Stub out the key_t definition as we're not doing any encryption.
using key_t = uint8_t;
#endif

Expand Down
4 changes: 2 additions & 2 deletions Source/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ void UnsafeDrawBorder2px(const Surface &out, Rectangle rect, uint8_t color);
Direction GetDirection(Point start, Point destination);

/**
* @brief Calculate Width2 from the orginal Width
* Width2 is needed for savegame compatiblity and to render animations centered
* @brief Calculate Width2 from the original Width
* Width2 is needed for savegame compatibility and to render animations centered
* @return Returns Width2
*/
int CalculateWidth2(int width);
Expand Down
8 changes: 4 additions & 4 deletions Source/engine/animationinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int8_t AnimationInfo::getFrameToUseForRendering() const
// Normal logic is used,
// - if no frame-skipping is required and so we have exactly one Animationframe per game tick
// or
// - if we load from a savegame where the new variables are not stored (we don't want to break savegame compatiblity because of smoother rendering of one animation)
// - if we load from a savegame where the new variables are not stored (we don't want to break savegame compatibility because of smoother rendering of one animation)
if (relevantFramesForDistributing_ <= 0)
return std::max<int8_t>(0, currentFrame);

Expand Down Expand Up @@ -128,7 +128,7 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
relevantAnimationTicksWithSkipping -= 1;
// The Animation Distribution Logic needs to account how many game ticks passed since the Animation started.
// Because processAnimation will increase this later (in same game tick as setNewAnimation), we correct this upfront.
// This also means Rendering should never hapen with ticksSinceSequenceStarted_ < 0.
// This also means Rendering should never happen with ticksSinceSequenceStarted_ < 0.
ticksSinceSequenceStarted_ = -baseValueFraction;
}

Expand All @@ -148,7 +148,7 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
// 5 - -
// in game tick 5 ProcessPlayer sees Frame = 3 and stops the animation.
// But Frame 3 is only shown 1 game tick and all other Frames are shown 2 game ticks.
// Thats why we need to remove the Delay of the last Frame from the time (game ticks) the Animation is shown
// That's why we need to remove the Delay of the last Frame from the time (game ticks) the Animation is shown
relevantAnimationTicksWithSkipping -= (ticksPerFrame - 1);
}

Expand Down Expand Up @@ -180,7 +180,7 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
void AnimationInfo::changeAnimationData(OptionalClxSpriteList celSprite, int8_t numberOfFrames, int8_t ticksPerFrame)
{
if (numberOfFrames != this->numberOfFrames || ticksPerFrame != this->ticksPerFrame) {
// Ensure that the currentFrame is still valid and that we disable ADL cause the calculcated values (for example tickModifier_) could be wrong
// Ensure that the currentFrame is still valid and that we disable ADL because the calculated values (for example tickModifier_) could be wrong
if (numberOfFrames >= 1)
currentFrame = std::clamp<int8_t>(currentFrame, 0, numberOfFrames - 1);
else
Expand Down
4 changes: 2 additions & 2 deletions Source/engine/demomode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ bool GetRunGameLoop(bool &drawGame, bool &processInput)
app_fatal("Unexpected event demo message in GetRunGameLoop");
LogDemoMessage(dmsg);
if (Timedemo) {
// disable additonal rendering to speedup replay
// disable additional rendering to speedup replay
drawGame = dmsg.type == DemoMsg::GameTick && !HeadlessMode;
} else {
int currentTickCount = SDL_GetTicks();
Expand Down Expand Up @@ -849,7 +849,7 @@ void NotifyGameLoopEnd()
HeroCompareResult compareResult = pfile_compare_hero_demo(DemoNumber, false);
switch (compareResult.status) {
case HeroCompareResult::ReferenceNotFound:
SDL_Log("Timedemo: No final comparison cause reference is not present.");
SDL_Log("Timedemo: No final comparison because reference is not present.");
break;
case HeroCompareResult::Same:
SDL_Log("Timedemo: Same outcome as initial run. :)");
Expand Down
8 changes: 4 additions & 4 deletions Source/engine/random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DiabloGenerator {
/**
* @brief Advance the global RandomNumberEngine state by the specified number of rounds
*
* Only used to maintain vanilla compatibility until logic requiring reproducable random number generation is isolated.
* Only used to maintain vanilla compatibility until logic requiring reproducible random number generation is isolated.
* @param count How many values to discard
*/
void discardRandomValues(unsigned count)
Expand Down Expand Up @@ -125,7 +125,7 @@ class DiabloGenerator {

/**
* @brief Randomly chooses a value somewhere within the given range
* @param min lower limit, minumum possible value
* @param min lower limit, minimum possible value
* @param max upper limit, either the maximum possible value for a closed range (the default behaviour) or one greater than the maximum value for a half-open range
* @param halfOpen whether to use the limits as a half-open range or not
* @return a randomly selected integer
Expand Down Expand Up @@ -155,7 +155,7 @@ uint32_t GetLCGEngineState();
/**
* @brief Advance the global RandomNumberEngine state by the specified number of rounds
*
* Only used to maintain vanilla compatibility until logic requiring reproducable random number generation is isolated.
* Only used to maintain vanilla compatibility until logic requiring reproducible random number generation is isolated.
* @param count How many values to discard
*/
void DiscardRandomValues(unsigned count);
Expand Down Expand Up @@ -234,7 +234,7 @@ inline int32_t RandomIntLessThan(int32_t v)

/**
* @brief Randomly chooses a value somewhere within the given range
* @param min lower limit, minumum possible value
* @param min lower limit, minimum possible value
* @param max upper limit, either the maximum possible value for a closed range (the default behaviour) or one greater than the maximum value for a half-open range
* @param halfOpen whether to use the limits as a half-open range or not
* @return a randomly selected integer
Expand Down
8 changes: 4 additions & 4 deletions Source/engine/render/scrollrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void UpdateMissilePositionForRendering(Missile &m, int progress)
Displacement pixelsTravelled = (m.position.traveled + Displacement { static_cast<int>(velocity.deltaX), static_cast<int>(velocity.deltaY) }) >> 16;
Displacement tileOffset = pixelsTravelled.screenToMissile();

// calculcate the future missile position
// calculate the future missile position
m.position.tileForRendering = m.position.start + tileOffset;
m.position.offsetForRendering = pixelsTravelled + tileOffset.worldToScreen();
}
Expand All @@ -130,10 +130,10 @@ void UpdateMissileRendererData(Missile &m)
int progress = ProgressToNextGameTick;
UpdateMissilePositionForRendering(m, progress);

// In some cases this calculcated position is invalid.
// In some cases this calculated position is invalid.
// For example a missile shouldn't move inside a wall.
// In this case the game logic don't advance the missile position and removes the missile or shows an explosion animation at the old position.
// For the animation distribution logic this means we are not allowed to move to a tile where the missile could collide, cause this could be a invalid position.
// For the animation distribution logic this means we are not allowed to move to a tile where the missile could collide, because this could be a invalid position.

// If we are still at the current tile, this tile was already checked and is a valid tile
if (m.position.tileForRendering == m.position.tile)
Expand Down Expand Up @@ -918,7 +918,7 @@ void DrawTileContent(const Surface &out, Point tilePosition, Point targetBufferP
if (tilePosition.x + 1 < MAXDUNX && tilePosition.y - 1 >= 0 && targetBufferPosition.x + TILE_WIDTH <= gnScreenWidth) {
// Render objects behind walls first to prevent sprites, that are moving
// between tiles, from poking through the walls as they exceed the tile bounds.
// A proper fix for this would probably be to layout the sceen and render by
// A proper fix for this would probably be to layout the scene and render by
// sprite screen position rather than tile position.
if (IsWall(tilePosition) && (IsWall(tilePosition + Displacement { 1, 0 }) || (tilePosition.x > 0 && IsWall(tilePosition + Displacement { -1, 0 })))) { // Part of a wall aligned on the x-axis
if (IsTileNotSolid(tilePosition + Displacement { 1, -1 }) && IsTileNotSolid(tilePosition + Displacement { 0, -1 })) { // Has walkable area behind it
Expand Down
2 changes: 1 addition & 1 deletion Source/inv.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool AutoPlaceItemInBelt(Player &player, const Item &item, bool persistItem = fa
void ReorganizeInventory(Player &player);

/**
* @brief Calculate the maximum aditional gold that may fit in the user's inventory
* @brief Calculate the maximum additional gold that may fit in the user's inventory
*/
int RoomForGold();

Expand Down
8 changes: 4 additions & 4 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ StringOrView GetTranslatedItemName(const Item &item)
continue;
return _(OilNames[i]);
}
app_fatal("unkown oil");
app_fatal("unknown oil");
} else if (item._itype == ItemType::Staff && item._iSpell != SpellID::Null && item._iMagical != ITEM_QUALITY_UNIQUE) {
return GenerateStaffName(baseItemData, item._iSpell, true);
} else {
Expand Down Expand Up @@ -3379,7 +3379,7 @@ void SpawnItem(Monster &monster, Point position, bool sendmsg, bool spawn /*= fa
NetSendCmdPItem(false, CMD_DROPITEM, uniqueItem->position, *uniqueItem);
return;
} else if (monster.isUnique() || dropsSpecialTreasure) {
// Unqiue monster is killed => use better item base (for example no gold)
// Unique monster is killed => use better item base (for example no gold)
idx = RndUItem(&monster);
} else if (dropBrain && !gbIsMultiplayer) {
// Normal monster is killed => need to drop brain to progress the quest
Expand All @@ -3392,7 +3392,7 @@ void SpawnItem(Monster &monster, Point position, bool sendmsg, bool spawn /*= fa
Quests[Q_MUSHROOM]._qvar1 = QS_BRAINSPAWNED;
NetSendCmdQuest(true, Quests[Q_MUSHROOM]);
// Drop the brain as extra item to ensure that all clients see the brain drop
// When executing SpawnItem is not reliable, cause another client can already have the quest state updated before SpawnItem is executed
// When executing SpawnItem is not reliable, because another client can already have the quest state updated before SpawnItem is executed
Point posBrain = GetSuperItemLoc(position);
SpawnQuestItem(IDI_BRAIN, posBrain, 0, 0, true);
}
Expand Down Expand Up @@ -5105,7 +5105,7 @@ void UpdateHellfireFlag(Item &item, const char *identifiedItemName)
return; // Only magic item's name can differ between diablo and hellfire
if (gbIsMultiplayer)
return; // Vanilla hellfire multiplayer is not supported in devilutionX, so there can't be items with missing dwBuff from there
// We need to test both short and long name, cause StringInPanel can return a different result (other font and some bugfixes)
// We need to test both short and long name, because StringInPanel can return a different result (other font and some bugfixes)
std::string diabloItemNameShort = GetTranslatedItemNameMagical(item, false, false, false);
if (diabloItemNameShort == identifiedItemName)
return; // Diablo item name is identical => not a hellfire specific item
Expand Down
2 changes: 1 addition & 1 deletion Source/levels/drlg_l1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ bool CanReplaceTile(uint8_t replace, Point tile)
return true;
}

// BUGFIX: p2 is a workaround for a bug, only p1 should have been used (fixing this breaks compatability)
// BUGFIX: p2 is a workaround for a bug, only p1 should have been used (fixing this breaks compatibility)
constexpr auto ComparisonWithBoundsCheck = [](Point p1, Point p2) {
return (p1.x >= 0 && p1.x < DMAXX && p1.y >= 0 && p1.y < DMAXY)
&& (p2.x >= 0 && p2.x < DMAXX && p2.y >= 0 && p2.y < DMAXY)
Expand Down
14 changes: 7 additions & 7 deletions Source/levels/drlg_l3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,14 +1017,14 @@ void River()
int riveramt;

int rivercnt = 0;
int trys = 0;
int tries = 0;
/// BUGFIX: pdir is uninitialized, add code `pdir = -1;`(fixed)
int pdir = -1;

while (trys < 200 && rivercnt < 4) {
while (tries < 200 && rivercnt < 4) {
bool bail = false;
while (!bail && trys < 200) {
trys++;
while (!bail && tries < 200) {
tries++;
int rx = 0;
int ry = 0;
int i = 0;
Expand Down Expand Up @@ -1369,7 +1369,7 @@ bool CanReplaceTile(uint8_t replace, Point tile)
return true;
}

// BUGFIX: p2 is a workaround for a bug, only p1 should have been used (fixing this breaks compatability)
// BUGFIX: p2 is a workaround for a bug, only p1 should have been used (fixing this breaks compatibility)
constexpr auto ComparisonWithBoundsCheck = [](Point p1, Point p2) {
return (p1.x >= 0 && p1.x < DMAXX && p1.y >= 0 && p1.y < DMAXY)
&& (p2.x >= 0 && p2.x < DMAXX && p2.y >= 0 && p2.y < DMAXY)
Expand Down Expand Up @@ -1805,8 +1805,8 @@ bool PlaceAnvil()
WorldTileCoord sx = GenerateRnd(DMAXX - areaSize.width);
WorldTileCoord sy = GenerateRnd(DMAXY - areaSize.height);

for (int trys = 0;; trys++, sx++) {
if (trys > 198)
for (int tries = 0;; tries++, sx++) {
if (tries > 198)
return false;

if (sx == DMAXX - areaSize.width) {
Expand Down
2 changes: 1 addition & 1 deletion Source/levels/gendung.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void PlaceDunTiles(const uint16_t *dunData, Point position, int floorId = 0);
void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, bool rndSize);
void DRLG_HoldThemeRooms();
/**
* @brief Returns ths size in tiles of the specified ".dun" Data
* @brief Returns the size in tiles of the specified ".dun" Data
*/
WorldTileSize GetDunSize(const uint16_t *dunData);
void DRLG_LPass3(int lv);
Expand Down
Loading

0 comments on commit 24f108f

Please sign in to comment.