Browse Source

typos and code cleanup

pull/5629/head
qndel 3 years ago committed by Anders Jenbo
parent
commit
efaf334965
  1. 2
      Source/DiabloUI/settingsmenu.cpp
  2. 2
      Source/diablo.cpp
  3. 6
      Source/engine/animationinfo.cpp
  4. 2
      Source/engine/animationinfo.h
  5. 6
      Source/engine/demomode.cpp
  6. 2
      Source/items.cpp
  7. 2
      Source/nthread.cpp

2
Source/DiabloUI/settingsmenu.cpp

@ -181,7 +181,7 @@ bool ChangeOptionValue(OptionEntryBase *pOption, size_t listIndex)
}
if (HasAnyOf(pOption->GetFlags(), OptionEntryFlags::RecreateUI)) {
// Reinitalize UI with changed settings (for example game mode, language or resolution)
// Reinitialize UI with changed settings (for example game mode, language or resolution)
UiInitialize();
InitItemGFX();
SetHardwareCursor(CursorInfo::UnknownCursor());

2
Source/diablo.cpp

@ -1139,7 +1139,7 @@ void DiabloInit()
if (gbIsHellfire && !forceHellfire && *sgOptions.StartUp.gameMode == StartUpGameMode::Ask) {
UiSelStartUpGameOption();
if (!gbIsHellfire) {
// Reinitalize the UI Elements cause we changed the game
// Reinitialize the UI Elements cause we changed the game
UnloadUiGFX();
UiInitialize();
if (IsHardwareCursor())

6
Source/engine/animationinfo.cpp

@ -156,17 +156,15 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
relevantAnimationTicksForDistribution *= baseValueFraction;
relevantAnimationTicksWithSkipping *= baseValueFraction;
// The preview animation was shown some times (less then one game tick)
// The preview animation was shown some times (less than one game tick)
// So we overall have a longer time the animation is shown
ticksSinceSequenceStarted_ += previewShownGameTickFragments;
relevantAnimationTicksWithSkipping += previewShownGameTickFragments;
// if we skipped Frames we need to expand the game ticks to make one game tick for this Animation "faster"
int32_t tickModifier;
int32_t tickModifier = 0;
if (relevantAnimationTicksWithSkipping != 0)
tickModifier = baseValueFraction * relevantAnimationTicksForDistribution / relevantAnimationTicksWithSkipping;
else
tickModifier = 0;
// tickModifier specifies the Animation fraction per game tick, so we have to remove the delay from the variable
tickModifier /= ticksPerFrame;

2
Source/engine/animationinfo.h

@ -128,7 +128,7 @@ private:
*/
int8_t skippedFramesFromPreviousAnimation_;
/**
* @brief Specifies how many animations-fractions (see baseValueFraction) are displayed between two game ticks. this can be more then one frame, if animations are skipped or less then one frame if the same animation is shown in multiple times (delay specified).
* @brief Specifies how many animations-fractions (see baseValueFraction) are displayed between two game ticks. this can be more than one frame, if animations are skipped or less than one frame if the same animation is shown in multiple times (delay specified).
*/
uint16_t tickModifier_;
/**

6
Source/engine/demomode.cpp

@ -585,13 +585,13 @@ void NotifyGameLoopEnd()
HeroCompareResult compareResult = pfile_compare_hero_demo(DemoNumber, false);
switch (compareResult.status) {
case HeroCompareResult::ReferenceNotFound:
SDL_Log("Timedemo: No final comparision cause reference is not present.");
SDL_Log("Timedemo: No final comparison cause reference is not present.");
break;
case HeroCompareResult::Same:
SDL_Log("Timedemo: Same outcome as inital run. :)");
SDL_Log("Timedemo: Same outcome as initial run. :)");
break;
case HeroCompareResult::Difference:
Log("Timedemo: Different outcome then inital run. ;(\n{}", compareResult.message);
Log("Timedemo: Different outcome than initial run. ;(\n{}", compareResult.message);
break;
}
}

2
Source/items.cpp

@ -4292,7 +4292,7 @@ bool GetItemRecord(int nSeed, uint16_t wCI, int nIndex)
for (int i = 0; i < gnNumGetRecords; i++) {
if (ticks - itemrecord[i].dwTimestamp > 6000) {
// BUGFIX: loot actions for multiple quest items with same seed (e.g. blood stone) performed within less then 6 seconds will be ignored.
// BUGFIX: loot actions for multiple quest items with same seed (e.g. blood stone) performed within less than 6 seconds will be ignored.
NextItemRecord(i);
i--;
} else if (nSeed == itemrecord[i].nSeed && wCI == itemrecord[i].wCI && nIndex == itemrecord[i].nIndex) {

2
Source/nthread.cpp

@ -229,7 +229,7 @@ bool nthread_has_500ms_passed()
}
}
if (resetLastTick) {
// Reset last tick to avoid caught up of all missed game ticks (game speed is dramatically increased for a short time)
// Reset last tick to avoid catching up with all missed game ticks (game speed is dramatically increased for a short time)
last_tick = currentTickCount;
ticksElapsed = 0;
}

Loading…
Cancel
Save