mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2025-04-07 05:56:53 +02:00
Clamp delta time to fix UI disappearing on OS with timestamps that don't always increase.
This commit is contained in:
parent
26a030e059
commit
e33441b6db
@ -98,7 +98,7 @@ namespace recompui {
|
||||
}
|
||||
case EventType::Update: {
|
||||
std::chrono::high_resolution_clock::duration now = ultramodern::time_since_start();
|
||||
float delta_time = std::chrono::duration<float>(now - last_time).count();
|
||||
float delta_time = std::max(std::chrono::duration<float>(now - last_time).count(), 0.0f);
|
||||
last_time = now;
|
||||
|
||||
constexpr float dp_speed = 740.0f;
|
||||
|
@ -166,7 +166,7 @@ void ModEntrySpacer::process_event(const Event &e) {
|
||||
switch (e.type) {
|
||||
case EventType::Update: {
|
||||
std::chrono::high_resolution_clock::duration now = ultramodern::time_since_start();
|
||||
float delta_time = std::chrono::duration<float>(now - last_time).count();
|
||||
float delta_time = std::max(std::chrono::duration<float>(now - last_time).count(), 0.0f);
|
||||
constexpr float dp_speed = 1000.0f;
|
||||
last_time = now;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user