Drive animation clocks from real frame time

Water, network-actor, flying-effect and weapon-trace clocks used
frames*0.033 or frames/60, and the sky box, effect.Update, fly.Update and
render-target previews advanced a fixed 1/30 or 1/60 s per call, so their
speed followed the frame rate. They now use the measured frame delta
(game_clock = sum of dt in main; GetGameFrameDelta for the Python-driven
paths; elapsed SDL ticks for render targets). --frames runs keep their
fixed 0.033 s step. The SpeedTree wind update is left unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-12 17:44:04 +09:00
co-authored by Claude Opus 5.5
parent 71f393bbd1
commit 6282199179
7 changed files with 23 additions and 12 deletions
+4 -2
View File
@@ -750,7 +750,7 @@ static PyObject* effect_RegisterIndexedFlyData(PyObject*, PyObject* args) {
}
static PyObject* effect_Update(PyObject*, PyObject*) {
ava2::EffectManager::Instance().Update(1.0f / 60.0f);
ava2::EffectManager::Instance().Update(ava2::GetGameFrameDelta());
Py_RETURN_NONE;
}
@@ -795,7 +795,9 @@ void initeffect() {
}
static PyObject* fly_Update(PyObject*, PyObject*) {
ava2::FlyingManager::Instance().Update(1.0f / 60.0f, 0.0f);
static float flyingTime = 0.0f;
flyingTime += ava2::GetGameFrameDelta();
ava2::FlyingManager::Instance().Update(ava2::GetGameFrameDelta(), flyingTime);
Py_RETURN_NONE;
}