This commit is contained in:
2026-10-18 12:11:17 -04:00
parent 36f6aa24f0
commit 02ecb175e8
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -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);
}