Skip to content

Commit d5739e7

Browse files
committed
Fixed some bugs
1 parent 81152cf commit d5739e7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/Settings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "Utilities.h"
55

6-
namespace Settings
6+
struct Settings
77
{
88
inline static const int SHUFFLE_MAX_VALUE = 8192;
99
inline static const int SHUFFLE_MAX_COUNT = 4096;
@@ -35,6 +35,6 @@ namespace Settings
3535

3636
inline static bool PLOT_DO_AFTERCHECK = true;
3737
inline static bool PLOT_SHUFFLE_ON_ALGO_CHANGE = false;
38-
38+
3939
inline static const int PAUSE_SLEEPms = 8;
40-
}
40+
};

src/SortingAlgorithm.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ void SortingAlgorithm::reset() {
6666
SortingAlgorithm::stepState SortingAlgorithm::checkStep() {
6767
if (m_exit)
6868
return stepState::EXITED;
69+
else if (m_doStep)
70+
m_pause = true;
6971
else if (m_pause) {
7072
sf::sleep(sf::milliseconds(Settings::PAUSE_SLEEPms));
7173
theClock.restart();
@@ -78,7 +80,6 @@ SortingAlgorithm::stepState SortingAlgorithm::checkStep() {
7880
theClock.restart();
7981

8082
if (m_doStep) {
81-
m_pause = true;
8283
m_doStep = false;
8384
return stepState::STEP;
8485
}

0 commit comments

Comments
 (0)