mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-03 01:58:44 -04:00
Implement unlocked framerates via interpolation (#315)
* Disable waitForTick and waitBlanking * Initial frame interpolation implementation * Initial batch of speed fixes * Fix Iron Boots * Strip dead code once used for debugging * Interpolate shadows * Revert overzealous/redundant lookups * Fix JUTFader * Fix field map cursor * Fix various particle effects * Fix Midna when riding Wolf Link * Fix title logo * Title Logo 2: Electric Boogaloo * Fixed grass and flowers * "Unlock Framerate" config option (WIP) * Wrap more things in TARGET_PC * Finish wrapping things in TARGET_PC * Missed one * Disable dComIfGd_drawXluListInvisible when interpolating --------- Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "JSystem/J2DGraph/J2DScreen.h"
|
||||
#include "d/d_com_inf_game.h"
|
||||
#include "d/d_pane_class.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
class dMsgScrnLight_HIO_c {
|
||||
public:
|
||||
@@ -202,10 +203,17 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
|
||||
}
|
||||
|
||||
if (mPlayAnim) {
|
||||
*i_anmFrame += 1.0f;
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
#endif
|
||||
*i_anmFrame += 1.0f;
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mBckFrame = *i_anmFrame;
|
||||
mBpkFrame = *i_anmFrame;
|
||||
@@ -220,11 +228,18 @@ void dMsgScrnLight_c::draw(f32* i_anmFrame, f32 i_posX, f32 i_posY, f32 i_scaleX
|
||||
mpParent_c->setBlackWhite(i_black, i_white);
|
||||
|
||||
if (mPlayAnim) {
|
||||
*i_anmFrame += i_anmRate;
|
||||
#ifdef TARGET_PC
|
||||
const u32 ui_advance_ticks = dusk::frame_interp::get_presentation_ui_advance_ticks();
|
||||
for (u32 i = 0; i < ui_advance_ticks; ++i) {
|
||||
#endif
|
||||
*i_anmFrame += i_anmRate;
|
||||
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
if (*i_anmFrame >= mpBck->getFrameMax()) {
|
||||
*i_anmFrame = 0.0f;
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
}
|
||||
#endif
|
||||
|
||||
mBckFrame = *i_anmFrame;
|
||||
mBpkFrame = *i_anmFrame;
|
||||
|
||||
Reference in New Issue
Block a user