frametime fix
This commit is contained in:
parent
d26d71ec91
commit
a220e40d13
2 changed files with 15 additions and 0 deletions
|
|
@ -378,6 +378,7 @@ void WindowWayland::QueueRender() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowWayland::StartUpdate() {
|
void WindowWayland::StartUpdate() {
|
||||||
|
lastFrameBegin = std::chrono::high_resolution_clock::now();
|
||||||
cb = wl_surface_frame(surface);
|
cb = wl_surface_frame(surface);
|
||||||
wl_callback_add_listener(cb, &wl_callback_listener, this);
|
wl_callback_add_listener(cb, &wl_callback_listener, this);
|
||||||
updating = true;
|
updating = true;
|
||||||
|
|
|
||||||
|
|
@ -150,14 +150,28 @@ namespace Crafter {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export constexpr std::int_fast32_t AbsoluteToRelative(std::int_fast32_t absolute, std::int_fast32_t relative) {
|
||||||
|
return static_cast<std::int_fast32_t>(
|
||||||
|
(static_cast<__int128>(absolute) * SCALE) / relative
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export constexpr std::int_fast32_t BoundToBoundless(std::int_fast32_t bound) {
|
export constexpr std::int_fast32_t BoundToBoundless(std::int_fast32_t bound) {
|
||||||
return bound * BOUND;
|
return bound * BOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export constexpr std::int_fast32_t BoundToBoundlessU(std::int_fast32_t bound) {
|
||||||
|
return static_cast<std::uint_fast32_t>((bound*2)) * BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
export constexpr std::int_fast32_t BoundlessToBound(std::int_fast32_t bound) {
|
export constexpr std::int_fast32_t BoundlessToBound(std::int_fast32_t bound) {
|
||||||
return bound / BOUND;
|
return bound / BOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export constexpr std::int_fast32_t BoundlessUToBound(std::uint_fast32_t bound) {
|
||||||
|
return static_cast<std::int_fast32_t>(bound / 2) / BOUND;
|
||||||
|
}
|
||||||
|
|
||||||
export constexpr std::int_fast32_t FractionalToMappedBoundless(double f) {
|
export constexpr std::int_fast32_t FractionalToMappedBoundless(double f) {
|
||||||
return std::int_fast32_t(f * SCALEDOUBLEBOUNDLESS);
|
return std::int_fast32_t(f * SCALEDOUBLEBOUNDLESS);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue