mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-03 18:06:02 -04:00
Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer
This commit is contained in:
+12
-6
@@ -138,6 +138,9 @@ bool launchUILoop() {
|
||||
const AuroraEvent* event = aurora_update();
|
||||
while (event != nullptr && event->type != AURORA_NONE) {
|
||||
switch (event->type) {
|
||||
case AURORA_SDL_EVENT:
|
||||
dusk::g_imguiConsole.HandleSDLEvent(event->sdl);
|
||||
break;
|
||||
case AURORA_WINDOW_RESIZED:
|
||||
preLaunchUIWindowSize = event->windowSize;
|
||||
break;
|
||||
@@ -207,9 +210,9 @@ void main01(void) {
|
||||
if (preLaunchUIWindowSize.width != 0)
|
||||
mDoGph_gInf_c::setWindowSize(preLaunchUIWindowSize);
|
||||
|
||||
constexpr double kSimStepSeconds = 1.0 / 30.0;
|
||||
constexpr float kSimStepSeconds = 1.0 / 30.0;
|
||||
auto previous_time = std::chrono::steady_clock::now();
|
||||
double accumulator = kSimStepSeconds;
|
||||
float accumulator = kSimStepSeconds;
|
||||
|
||||
do {
|
||||
// 1. Update Window Events
|
||||
@@ -218,6 +221,9 @@ void main01(void) {
|
||||
switch (event->type) {
|
||||
case AURORA_NONE:
|
||||
goto eventsDone;
|
||||
case AURORA_SDL_EVENT:
|
||||
dusk::g_imguiConsole.HandleSDLEvent(event->sdl);
|
||||
break;
|
||||
case AURORA_WINDOW_RESIZED:
|
||||
mDoGph_gInf_c::setWindowSize(event->windowSize);
|
||||
break;
|
||||
@@ -234,7 +240,7 @@ void main01(void) {
|
||||
eventsDone:;
|
||||
|
||||
auto current_time = std::chrono::steady_clock::now();
|
||||
double frame_seconds = std::chrono::duration<double>(current_time - previous_time).count();
|
||||
float frame_seconds = std::chrono::duration<float>(current_time - previous_time).count();
|
||||
previous_time = current_time;
|
||||
accumulator += frame_seconds;
|
||||
|
||||
@@ -248,12 +254,12 @@ void main01(void) {
|
||||
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
||||
dusk::frame_interp::notify_presentation_frame();
|
||||
while (accumulator >= kSimStepSeconds) {
|
||||
if (accumulator >= kSimStepSeconds) {
|
||||
mDoCPd_c::read();
|
||||
dusk::gyro::read(kSimStepSeconds);
|
||||
fapGm_Execute();
|
||||
mDoAud_Execute();
|
||||
accumulator -= kSimStepSeconds;
|
||||
accumulator = 0.0f;
|
||||
}
|
||||
dusk::frame_interp::interpolate(static_cast<float>(accumulator / kSimStepSeconds));
|
||||
{
|
||||
@@ -261,7 +267,7 @@ void main01(void) {
|
||||
cAPIGph_Painter();
|
||||
}
|
||||
} else {
|
||||
accumulator = 0.0;
|
||||
accumulator = 0.0f;
|
||||
|
||||
// Game Inputs
|
||||
mDoCPd_c::read();
|
||||
|
||||
Reference in New Issue
Block a user