fix: 更新引擎核心时间模块的计算逻辑。

This commit is contained in:
Ziyu
2026-01-04 09:20:05 +08:00
parent ace4885c84
commit a549918af2
+2
View File
@@ -31,6 +31,8 @@ void Time::limitFrameRate(float current_delta_time) {
Uint64 ns_to_wait = static_cast<Uint64>(time_to_wait * 1000000000.0);
SDL_DelayNS(ns_to_wait);
delta_time_ = static_cast<double>(SDL_GetTicksNS() - last_time_) / 1000000000.0;
} else { // 否则,直接使用当前帧耗费的时间
delta_time_ = static_cast<double>(current_delta_time);
}
}