Frame interp: Dreamworks' Turbo (2013)

This commit is contained in:
Irastris
2026-04-14 21:58:44 -04:00
parent d876c62822
commit 0508acaa79
4 changed files with 11 additions and 17 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ static void waitPrecise(Limiter& limiter, Uint64 targetNs) {
static void waitForTick(u32 p1, u16 p2) {
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
return;
}
if (dusk::getTransientSettings().skipFrameRateLimit) {
+2 -3
View File
@@ -185,10 +185,9 @@ namespace dusk {
}
if (ImGui::BeginMenu("Tools")) {
config::ImGuiCheckbox("Enable Turbo Key", getSettings().game.enableTurboKeybind);
config::ImGuiCheckbox("Turbo Key", getSettings().game.enableTurboKeybind);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Holding TAB will speed up the game.\n"
"This will not work with the \"Unlock Framerate\" enhancement.");
ImGui::SetTooltip("Hold TAB to increase game speed by up to 4x.");
}
ImGui::EndMenu();
+3 -4
View File
@@ -64,13 +64,12 @@ void fpcM_Management(fpcM_ManagementFunc i_preExecuteFn, fpcM_ManagementFunc i_p
}
#ifdef TARGET_PC
// Frame interpolation: call moved to m_Do_main
if (!dusk::getSettings().game.enableFrameInterpolation) {
// FRAME INTERP NOTE: Called in m_Do_main when interp is enabled
if (!dusk::getSettings().game.enableFrameInterpolation || dusk::getTransientSettings().skipFrameRateLimit)
#endif
{
cAPIGph_Painter();
#ifdef TARGET_PC
}
#endif
if (!dPa_control_c::isStatus(1)) {
fpcDt_Handler();
+5 -9
View File
@@ -202,9 +202,8 @@ void main01(void) {
if (preLaunchUIWindowSize.width != 0)
mDoGph_gInf_c::setWindowSize(preLaunchUIWindowSize);
using clock = std::chrono::steady_clock;
constexpr double kSimStepSeconds = 1.0 / 30.0;
auto previous_time = clock::now();
auto previous_time = std::chrono::steady_clock::now();
double accumulator = kSimStepSeconds;
do {
@@ -229,7 +228,7 @@ void main01(void) {
eventsDone:;
auto current_time = clock::now();
auto current_time = std::chrono::steady_clock::now();
double frame_seconds = std::chrono::duration<double>(current_time - previous_time).count();
previous_time = current_time;
accumulator += frame_seconds;
@@ -242,9 +241,8 @@ void main01(void) {
continue;
}
if (dusk::getSettings().game.enableFrameInterpolation) {
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
dusk::frame_interp::notify_presentation_frame();
while (accumulator >= kSimStepSeconds) {
mDoCPd_c::read();
if (dusk::getSettings().game.enableGyroAim) {
@@ -254,13 +252,11 @@ void main01(void) {
mDoAud_Execute();
accumulator -= kSimStepSeconds;
}
float interp_alpha = static_cast<float>(accumulator / kSimStepSeconds);
dusk::frame_interp::interpolate(interp_alpha);
dusk::frame_interp::interpolate(static_cast<float>(accumulator / kSimStepSeconds));
cAPIGph_Painter();
} else {
accumulator = 0.0;
// Game Inputs
mDoCPd_c::read();
if (dusk::getSettings().game.enableGyroAim) {