Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dosbox-staging/dosbox-staging.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/PDCurses/sdl2_queue/pdcutil.cpp')
-rw-r--r--src/libs/PDCurses/sdl2_queue/pdcutil.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libs/PDCurses/sdl2_queue/pdcutil.cpp b/src/libs/PDCurses/sdl2_queue/pdcutil.cpp
index ffa2eacd9..d06c1ec86 100644
--- a/src/libs/PDCurses/sdl2_queue/pdcutil.cpp
+++ b/src/libs/PDCurses/sdl2_queue/pdcutil.cpp
@@ -1,4 +1,6 @@
/* PDCurses */
+#include <chrono>
+#include <thread>
#include "pdcsdl.h"
@@ -9,16 +11,18 @@ void PDC_beep(void)
void PDC_napms(int ms)
{
+ constexpr int nap_interval = 50;
+
PDC_LOG(("PDC_napms() - called: ms=%d\n", ms));
- while (ms > 50)
+ while (ms > nap_interval)
{
PDC_pump_and_peep();
- SDL_Delay(50);
- ms -= 50;
+ std::this_thread::sleep_for(std::chrono::milliseconds(nap_interval));
+ ms -= nap_interval;
}
PDC_pump_and_peep();
- SDL_Delay(ms);
+ std::this_thread::sleep_for(std::chrono::milliseconds(ms));
}
const char *PDC_sysname(void)