diff --git a/public/blah/app.cpp b/public/blah/app.cpp index 5b99d21..f330308 100644 --- a/public/blah/app.cpp +++ b/public/blah/app.cpp @@ -123,20 +123,26 @@ bool App::run(const Config* c) { time_accumulator -= time_target; + Time::delta = (1.0f / app_config.target_framerate); + + if (Time::pause_timer > 0) + { + Time::pause_timer -= Time::delta; + if (Time::pause_timer <= -0.0001f) + Time::delta = -Time::pause_timer; + else + continue; + } + Time::milliseconds += time_target; - Time::delta = 1.0f / app_config.target_framerate; Time::previous_elapsed = Time::elapsed; Time::elapsed += Time::delta; Internal::Input::frame(); Internal::Graphics::frame(); - Time::pause_timer -= Time::delta; - if (Time::pause_timer <= 0) - { - if (app_config.on_update != nullptr) - app_config.on_update(); - } + if (app_config.on_update != nullptr) + app_config.on_update(); } } diff --git a/public/blah/log.cpp b/public/blah/log.cpp index e31a45f..00c2def 100644 --- a/public/blah/log.cpp +++ b/public/blah/log.cpp @@ -7,10 +7,10 @@ using namespace Blah; void Log::print(const char* format, ...) { - char msg[BLAH_MAX_MESSAGE]; + char msg[BLAH_MESSAGE]; va_list ap; va_start(ap, format); - vsnprintf(msg, sizeof(char) * BLAH_MAX_MESSAGE, format, ap); + vsnprintf(msg, sizeof(char) * BLAH_MESSAGE, format, ap); va_end(ap); if (App::is_running() && App::config()->on_info != nullptr) @@ -25,10 +25,10 @@ void Log::print(const char* format, ...) void Log::warn(const char* format, ...) { - char msg[BLAH_MAX_MESSAGE]; + char msg[BLAH_MESSAGE]; va_list ap; va_start(ap, format); - vsnprintf(msg, sizeof(char) * BLAH_MAX_MESSAGE, format, ap); + vsnprintf(msg, sizeof(char) * BLAH_MESSAGE, format, ap); va_end(ap); if (App::is_running() && App::config()->on_warn != nullptr) @@ -43,10 +43,10 @@ void Log::warn(const char* format, ...) void Log::error(const char* format, ...) { - char msg[BLAH_MAX_MESSAGE]; + char msg[BLAH_MESSAGE]; va_list ap; va_start(ap, format); - vsnprintf(msg, sizeof(char) * BLAH_MAX_MESSAGE, format, ap); + vsnprintf(msg, sizeof(char) * BLAH_MESSAGE, format, ap); va_end(ap); if (App::is_running() && App::config()->on_error != nullptr)