mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-31 08:51:29 -04:00
Register interp callback for d_a_obj_lv8Lift
This commit is contained in:
@@ -58,6 +58,9 @@ public:
|
||||
void setNextPoint();
|
||||
int Draw();
|
||||
int Delete();
|
||||
#if TARGET_PC
|
||||
friend void daL8Lift_interp_callback(bool isSimFrame, void* pUserWork);
|
||||
#endif
|
||||
|
||||
u8 getPthID() { return fopAcM_GetParamBit(this, 0, 8); }
|
||||
u8 getMoveSpeed() { return fopAcM_GetParamBit(this, 8, 4); }
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
#include "d/d_path.h"
|
||||
#include "d/d_bg_w.h"
|
||||
|
||||
#if TARGET_PC
|
||||
#include "dusk/frame_interpolation.h"
|
||||
#endif
|
||||
|
||||
daL8Lift_HIO_c::daL8Lift_HIO_c() {
|
||||
mStopDisappearTime = 30;
|
||||
mStartMoveTime = 60;
|
||||
@@ -380,7 +384,44 @@ void daL8Lift_c::setNextPoint() {
|
||||
mCurrentPoint = next_point;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void daL8Lift_interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
daL8Lift_c* lift = static_cast<daL8Lift_c*>(pUserWork);
|
||||
if (lift == NULL || lift->mpModel == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_env_light.settingTevStruct(0x10, &lift->current.pos, &lift->tevStr);
|
||||
g_env_light.setLightTevColorType_MAJI(lift->mpModel, &lift->tevStr);
|
||||
|
||||
J3DModelData* modelData = lift->mpModel->getModelData();
|
||||
J3DMaterial* materialp = modelData->getMaterialNodePointer(0);
|
||||
|
||||
if (materialp->getTexGenBlock()->getTexMtx(1) != NULL) {
|
||||
J3DTexMtxInfo* mtx_info = &materialp->getTexGenBlock()->getTexMtx(1)->getTexMtxInfo();
|
||||
if (mtx_info != NULL) {
|
||||
Mtx m;
|
||||
C_MTXLightOrtho(m, 100.0f, -100.0f, -100.0f, 100.0f, 1.0f, 1.0f, 0.0f, 0.0f);
|
||||
mDoMtx_stack_c::XrotS(0x4000);
|
||||
mDoMtx_stack_c::transM(-lift->current.pos.x, -lift->current.pos.y, -lift->current.pos.z);
|
||||
cMtx_concat(m, mDoMtx_stack_c::get(), mtx_info->mEffectMtx);
|
||||
}
|
||||
}
|
||||
|
||||
lift->mBtk.entry(modelData);
|
||||
|
||||
J3DGXColor* color = materialp->getTevKColor(1);
|
||||
color->r = l_HIO.mColorR;
|
||||
color->g = l_HIO.mColorG;
|
||||
color->b = l_HIO.mColorB;
|
||||
}
|
||||
#endif
|
||||
|
||||
int daL8Lift_c::Draw() {
|
||||
#if TARGET_PC
|
||||
dusk::frame_interp::add_interpolation_callback(&daL8Lift_interp_callback, this);
|
||||
#endif
|
||||
|
||||
g_env_light.settingTevStruct(16, ¤t.pos, &tevStr);
|
||||
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
|
||||
J3DModelData* modelData = mpModel->getModelData();
|
||||
|
||||
Reference in New Issue
Block a user