Skip to content

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CosminPerRam committed Jun 17, 2022
1 parent 81152cf commit d5739e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "Utilities.h"

namespace Settings
struct Settings
{
inline static const int SHUFFLE_MAX_VALUE = 8192;
inline static const int SHUFFLE_MAX_COUNT = 4096;
Expand Down Expand Up @@ -35,6 +35,6 @@ namespace Settings

inline static bool PLOT_DO_AFTERCHECK = true;
inline static bool PLOT_SHUFFLE_ON_ALGO_CHANGE = false;

inline static const int PAUSE_SLEEPms = 8;
}
};
3 changes: 2 additions & 1 deletion src/SortingAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void SortingAlgorithm::reset() {
SortingAlgorithm::stepState SortingAlgorithm::checkStep() {
if (m_exit)
return stepState::EXITED;
else if (m_doStep)
m_pause = true;
else if (m_pause) {
sf::sleep(sf::milliseconds(Settings::PAUSE_SLEEPms));
theClock.restart();
Expand All @@ -78,7 +80,6 @@ SortingAlgorithm::stepState SortingAlgorithm::checkStep() {
theClock.restart();

if (m_doStep) {
m_pause = true;
m_doStep = false;
return stepState::STEP;
}
Expand Down

0 comments on commit d5739e7

Please sign in to comment.