mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 12:37:18 -04:00
run d_a_bg::draw on interp frames
to set up lights. this is a somewhat hacky workaround for lighting setup, but it might be good enough?
This commit is contained in:
@@ -46,15 +46,6 @@ void add_interpolation_callback(InterpolationCallBack pCallBack, void* pUserWork
|
||||
void begin_presentation_camera();
|
||||
void end_presentation_camera();
|
||||
|
||||
struct PresentationCameraScope {
|
||||
PresentationCameraScope() { begin_presentation_camera(); }
|
||||
~PresentationCameraScope() { end_presentation_camera(); }
|
||||
PresentationCameraScope(const PresentationCameraScope&) = delete;
|
||||
PresentationCameraScope& operator=(const PresentationCameraScope&) = delete;
|
||||
PresentationCameraScope(PresentationCameraScope&&) = delete;
|
||||
PresentationCameraScope& operator=(PresentationCameraScope&&) = delete;
|
||||
};
|
||||
|
||||
} // namespace frame_interp
|
||||
} // namespace dusk
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct process_node_class {
|
||||
/* 0x0BC */ layer_class layer;
|
||||
/* 0x0E8 */ node_list_class layer_nodelist[16];
|
||||
/* 0x1A8 */ s8 unk_0x1A8;
|
||||
/* 0x1A9 */ s8 draw_interp_frame;
|
||||
} process_node_class;
|
||||
|
||||
typedef struct node_process_profile_definition {
|
||||
|
||||
@@ -623,6 +623,11 @@ int daBg_c::create() {
|
||||
|
||||
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
|
||||
OS_REPORT("<BG> room%d\n", roomNo);
|
||||
|
||||
#if TARGET_PC
|
||||
draw_interp_frame = true;
|
||||
#endif
|
||||
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
|
||||
|
||||
+18
-1
@@ -7,6 +7,13 @@
|
||||
#include "f_pc/f_pc_layer_iter.h"
|
||||
#include "f_pc/f_pc_debug_sv.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "f_op/f_op_draw_iter.h"
|
||||
#include "f_pc/f_pc_manager.h"
|
||||
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
int fpcNd_DrawMethod(nodedraw_method_class* i_method_class, void* i_data) {
|
||||
return fpcMtd_Method(i_method_class->draw_method, i_data);
|
||||
}
|
||||
@@ -18,7 +25,17 @@ int fpcNd_Draw(process_node_class* i_procNode) {
|
||||
if (i_procNode->unk_0x1A8 == 0) {
|
||||
layer_class* save_layer = fpcLy_CurrentLayer();
|
||||
fpcLy_SetCurrentLayer(&var_r28->layer);
|
||||
ret = fpcNd_DrawMethod(i_procNode->nodedraw_method, i_procNode);
|
||||
#if TARGET_PC
|
||||
if (!i_procNode->draw_interp_frame && !dusk::frame_interp::is_sim_frame()) {
|
||||
for (create_tag_class* i = fopDwIt_Begin(); i != NULL; i = fopDwIt_Next(i)) {
|
||||
void* process = i->mpTagData;
|
||||
fpcM_Draw(process);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ret = fpcNd_DrawMethod(i_procNode->nodedraw_method, i_procNode);
|
||||
}
|
||||
fpcLy_SetCurrentLayer(save_layer);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/frame_interpolation.h"
|
||||
|
||||
u8 mDoExt::CurrentHeapAdjustVerbose;
|
||||
u8 mDoExt::HeapAdjustVerbose;
|
||||
@@ -349,6 +350,11 @@ void mDoExt_modelUpdateDL(J3DModel* i_model) {
|
||||
}
|
||||
|
||||
void mDoExt_modelEntryDL(J3DModel* i_model) {
|
||||
#if TARGET_PC
|
||||
if (!dusk::frame_interp::is_sim_frame())
|
||||
return;
|
||||
#endif
|
||||
|
||||
modelMtxErrorCheck(i_model);
|
||||
|
||||
J3DModelData* model_data = i_model->getModelData();
|
||||
|
||||
@@ -243,15 +243,16 @@ void main01(void) {
|
||||
fapGm_Execute();
|
||||
mDoAud_Execute();
|
||||
dusk::game_clock::reset_accumulator();
|
||||
} else {
|
||||
// run draw functions for anything specially marked to handle interp on non-sim ticks
|
||||
fpcM_DrawIterater((fpcM_DrawIteraterFunc)fpcM_Draw);
|
||||
}
|
||||
dusk::frame_interp::interpolate();
|
||||
{
|
||||
dusk::frame_interp::PresentationCameraScope presentation_camera;
|
||||
cAPIGph_Painter();
|
||||
dusk::frame_interp::begin_presentation_camera();
|
||||
if (!pacing.do_sim_tick) {
|
||||
// run draw functions for anything specially marked to handle interp on non-sim
|
||||
// ticks
|
||||
fpcM_DrawIterater((fpcM_DrawIteraterFunc)fpcM_Draw);
|
||||
}
|
||||
cAPIGph_Painter();
|
||||
dusk::frame_interp::end_presentation_camera();
|
||||
dusk::frame_interp::set_ui_tick_pending(false);
|
||||
} else {
|
||||
dusk::frame_interp::set_ui_tick_pending(true);
|
||||
|
||||
Reference in New Issue
Block a user