From 02ecb175e8c89e8282ccdbb56c0a390074221176 Mon Sep 17 00:00:00 2001 From: john Date: Sun, 18 Oct 2026 12:11:17 -0400 Subject: [PATCH] fiserfd --- Engine.cpp | 10 ++++++++-- main.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Engine.cpp b/Engine.cpp index 3331f7c..1b3bc19 100644 --- a/Engine.cpp +++ b/Engine.cpp @@ -962,7 +962,13 @@ void Engine::Initiate() testcharacter->Step(deltatime); npc->Step(deltatime); soundsystem->Update(); - physicsengine->Step(deltatime); + // Split into equal substeps of at most 1/120 s so jump arcs, falling and collisions + // come out the same whatever the frame rate + { + const int substeps = std::max(1, (int)std::ceil(deltatime * 120.0f)); + const float subDt = deltatime / float(substeps); + for (int i = 0; i < substeps; i++) physicsengine->Step(subDt); + } // -------------------------------------------------------------------- // LAN: send our transform, apply the other player's @@ -1055,7 +1061,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod { // F11: toggle fullscreen on the primary monitor, restoring the old window rect on exit if (key == GLFW_KEY_F11 && action == GLFW_PRESS) { - static int wx = 100, wy = 100, ww = 1280, wh = 720; + static int wx = 100, wy = 100, ww = 1920, wh = 1080; if (glfwGetWindowMonitor(window)) { glfwSetWindowMonitor(window, nullptr, wx, wy, ww, wh, 0); } diff --git a/main.cpp b/main.cpp index 3380c5b..0d3ec24 100644 --- a/main.cpp +++ b/main.cpp @@ -128,7 +128,7 @@ int main() { mouse = new Mouse(); keyboard = new Keyboard(); - window = new Window(1280,720,"EIIFWHRN"); + window = new Window(1920,1080,"EIIFWHRN"); soundsystem = new SoundSystem(); resourcemanager = new ResourceManager();