diff --git a/libopenage/event/demo/gui.cpp b/libopenage/event/demo/gui.cpp index ff61a50cbb..aebb8c8145 100644 --- a/libopenage/event/demo/gui.cpp +++ b/libopenage/event/demo/gui.cpp @@ -10,8 +10,6 @@ #include #include -#include - namespace openage::event::demo { diff --git a/libopenage/event/demo/main.cpp b/libopenage/event/demo/main.cpp index 779985525b..91d0190bd1 100644 --- a/libopenage/event/demo/main.cpp +++ b/libopenage/event/demo/main.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "../../config.h" #include "../event.h" @@ -153,7 +153,7 @@ void curvepong(bool disable_gui, bool no_human) { // handle timing for screen refresh and simulation advancement using dt_s_t = std::chrono::duration>; - using dt_us_t = std::chrono::duration; + using dt_ms_t = std::chrono::duration; // microseconds per frame // 30fps = 1s/30 = 1000000us/30 per frame @@ -162,16 +162,16 @@ void curvepong(bool disable_gui, bool no_human) { if (speed == timescale::NOSLEEP) { // increase the simulation loop time a bit - usleep(5000); + SDL_Delay(5); } - dt_us_t dt_us = Clock::now() - loop_start; + dt_ms_t dt_us = Clock::now() - loop_start; if (speed != timescale::NOSLEEP) { - dt_us_t wait_time = per_frame - dt_us; + dt_ms_t wait_time = per_frame - dt_us; - if (wait_time > dt_us_t::zero()) { - usleep(wait_time.count()); + if (wait_time > dt_ms_t::zero()) { + SDL_Delay(wait_time.count()); } }