call on_hud_render before rendering the frame

Hud scripts update the first-person hand skeleton, blockwraps and
animations in on_hud_render, which ran after renderFrame, so these
changes were drawn one frame late. With fast camera rotation the hand
visibly lagged and jittered behind the view.
This commit is contained in:
ostermine 2026-10-10 03:49:12 +03:00
parent ca066f46a6
commit 293d68a0fb

View file

@ -271,11 +271,11 @@ void LevelScreen::draw(float delta) {
if (!hud->isPause()) { if (!hud->isPause()) {
scripting::on_entities_render(engine.getTime().getDelta()); scripting::on_entities_render(engine.getTime().getDelta());
} // before the frame: changes made by hud scripts (hand skeleton,
renderer->renderFrame(ctx, camera, hudVisible, *postProcessing); // blockwraps, animations) must be rendered with the current camera
if (!hud->isPause()) {
scripting::on_frontend_render(); scripting::on_frontend_render();
} }
renderer->renderFrame(ctx, camera, hudVisible, *postProcessing);
if (hudVisible) { if (hudVisible) {
hud->draw(ctx); hud->draw(ctx);