Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer

This commit is contained in:
gymnast86
2026-04-16 23:45:07 -07:00
26 changed files with 834 additions and 182 deletions
+12 -6
View File
@@ -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();