mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-19 14:30:29 -04:00
Frame interp: Refactor JUTFader
Now works regardless of interpolation being on/off
This commit is contained in:
@@ -16,6 +16,7 @@ public:
|
||||
};
|
||||
|
||||
JUTFader(int, int, int, int, JUtility::TColor);
|
||||
void advance();
|
||||
void control();
|
||||
void setStatus(JUTFader::EStatus, int);
|
||||
|
||||
|
||||
@@ -224,20 +224,17 @@ void JFWDisplay::endGX() {
|
||||
if (mFader != NULL) {
|
||||
ortho.setPort();
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
u32 advance_count = 1;
|
||||
if (s_faderSimSteps >= 0) {
|
||||
advance_count = static_cast<u32>(s_faderSimSteps);
|
||||
s_faderSimSteps = -1;
|
||||
}
|
||||
for (u32 i = 0; i < advance_count; i++) {
|
||||
mFader->control();
|
||||
}
|
||||
if (mFader->getStatus() != 1) {
|
||||
mFader->draw();
|
||||
}
|
||||
u32 advance_count = 1;
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && s_faderSimSteps >= 0) {
|
||||
advance_count = static_cast<u32>(s_faderSimSteps);
|
||||
s_faderSimSteps = -1;
|
||||
} else {
|
||||
mFader->control();
|
||||
s_faderSimSteps = -1;
|
||||
}
|
||||
for (u32 i = 0; i < advance_count; i++) {
|
||||
mFader->advance();
|
||||
}
|
||||
if (mFader->getStatus() != 1) {
|
||||
mFader->draw();
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -17,7 +17,7 @@ JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor)
|
||||
mEStatus = UNKSTATUS_M1;
|
||||
}
|
||||
|
||||
void JUTFader::control() {
|
||||
void JUTFader::advance() {
|
||||
if (0 <= mEStatus && mEStatus-- == 0) {
|
||||
mStatus = field_0x24;
|
||||
}
|
||||
@@ -59,9 +59,12 @@ void JUTFader::control() {
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JUTFader::control() {
|
||||
advance();
|
||||
#ifndef TARGET_PC
|
||||
// Frame interpolation: draw call moved to JFWDisplay
|
||||
// FRAME INTERP NOTE: Draw is called by JFWDisplay when interpolation is active
|
||||
draw();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2419,7 +2419,9 @@ int mDoGph_Painter() {
|
||||
#if TARGET_PC
|
||||
dusk::g_imguiConsole.PostDraw();
|
||||
|
||||
JFWDisplay::getManager()->setFaderSimSteps(pending_ui_ticks);
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
JFWDisplay::getManager()->setFaderSimSteps(pending_ui_ticks);
|
||||
}
|
||||
#endif
|
||||
|
||||
mDoGph_gInf_c::endRender();
|
||||
|
||||
Reference in New Issue
Block a user