Files
dusklight/src/f_pc/f_pc_draw.cpp
T
Irastris eaec6487a3 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>
2026-04-11 01:06:25 -06:00

56 lines
1.6 KiB
C++

/**
* f_pc_draw.cpp
* Framework - Process Draw
*/
#include "f_pc/f_pc_draw.h"
#include "SSystem/SComponent/c_API_graphic.h"
#include "f_pc/f_pc_leaf.h"
#include "f_pc/f_pc_node.h"
#include "f_pc/f_pc_pause.h"
#include "dusk/frame_interpolation.h"
#include <cstdio>
#include "dusk/logging.h"
int fpcDw_Execute(base_process_class* i_proc) {
if (!fpcPause_IsEnable(i_proc, 2)) {
layer_class* save_layer;
int ret;
process_method_func draw_func;
save_layer = fpcLy_CurrentLayer();
if (fpcBs_Is_JustOfType(g_fpcLf_type, i_proc->subtype)) {
draw_func = ((leafdraw_method_class*)i_proc->methods)->draw_method;
} else {
draw_func = ((nodedraw_method_class*)i_proc->methods)->draw_method;
}
fpcLy_SetCurrentLayer(i_proc->layer_tag.layer);
#ifdef TARGET_PC
dusk::frame_interp::open_child(i_proc, 0);
#endif
ret = draw_func(i_proc);
#ifdef TARGET_PC
dusk::frame_interp::close_child();
#endif
fpcLy_SetCurrentLayer(save_layer);
return ret;
}
return 0;
}
int fpcDw_Handler(fpcDw_HandlerFuncFunc i_iterHandler, fpcDw_HandlerFunc i_func) {
static int sDwLogCount = 0;
int ret;
if (sDwLogCount < 5) { DuskLog.debug("fpcDw_Handler: before BeforeOfDraw"); }
cAPIGph_BeforeOfDraw();
if (sDwLogCount < 5) { DuskLog.debug("fpcDw_Handler: before draw iteration"); }
ret = i_iterHandler(i_func);
if (sDwLogCount < 5) { DuskLog.debug("fpcDw_Handler: before AfterOfDraw"); }
cAPIGph_AfterOfDraw();
if (sDwLogCount < 5) { DuskLog.debug("fpcDw_Handler: done"); }
sDwLogCount++;
return ret;
}