mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-29 23:27:25 -04:00
Frame interp: Fix Epona's reins
This commit is contained in:
+74
-5
@@ -2398,7 +2398,12 @@ void mDoExt_3DlineMat0_c::draw() {
|
||||
var_r28++;
|
||||
}
|
||||
|
||||
field_0x16 ^= (u8)1;
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableFrameInterpolation)
|
||||
#endif
|
||||
{
|
||||
field_0x16 ^= (u8)1;
|
||||
}
|
||||
}
|
||||
|
||||
void mDoExt_3DlineMat0_c::update(int param_0, f32 param_1, GXColor& param_2, u16 param_3,
|
||||
@@ -2648,6 +2653,9 @@ int mDoExt_3DlineMat1_c::init(u16 param_0, u16 param_1, ResTIMG* param_2, int pa
|
||||
|
||||
field_0x4 = 0;
|
||||
mIsDrawn = 0;
|
||||
#if TARGET_PC
|
||||
mInterpLineKind = 0;
|
||||
#endif
|
||||
|
||||
GXInitTexObj(&mTextureObject, (void*)((intptr_t)param_2 + param_2->imageOffset), param_2->width,
|
||||
param_2->height, (GXTexFmt)param_2->format, (GXTexWrapMode)param_2->wrapS,
|
||||
@@ -2720,11 +2728,19 @@ void mDoExt_3DlineMat1_c::draw() {
|
||||
lines++;
|
||||
}
|
||||
GXSetTexCoordScaleManually(GX_TEXCOORD0, 0, 0, 0);
|
||||
mIsDrawn ^= (u8)1;
|
||||
#if TARGET_PC
|
||||
if (!dusk::getSettings().game.enableFrameInterpolation)
|
||||
#endif
|
||||
{
|
||||
mIsDrawn ^= (u8)1;
|
||||
}
|
||||
}
|
||||
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16 param_3,
|
||||
dKy_tevstr_c* param_4) {
|
||||
#if TARGET_PC
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16 param_3, dKy_tevstr_c* param_4, const cXyz* presentationEye) {
|
||||
#else
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16 param_3, dKy_tevstr_c* param_4) {
|
||||
#endif
|
||||
mColor = param_2;
|
||||
this->mpTevStr = param_4;
|
||||
if (param_0 < 0) {
|
||||
@@ -2734,6 +2750,13 @@ void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16
|
||||
} else {
|
||||
field_0x34 = param_0;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mInterpLineKind = 1;
|
||||
mInterpLineF = param_1;
|
||||
mInterpLineU16 = param_3;
|
||||
#endif
|
||||
|
||||
view_class* sp_3c = dComIfGd_getView();
|
||||
mDoExt_3Dline_c* sp_38 = mpLines;
|
||||
f32 local_f27 = param_3 != 0 ? param_1 / param_3 : 0.0f;
|
||||
@@ -2787,7 +2810,12 @@ void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16
|
||||
local_f31 += local_f30 * 0.02f * (8.0f / param_1);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
const cXyz& lineEye = (presentationEye != nullptr && dusk::getSettings().game.enableFrameInterpolation) ? *presentationEye : sp_3c->lookat.eye;
|
||||
sp_13c = *local_r27 - lineEye;
|
||||
#else
|
||||
sp_13c = *local_r27 - sp_3c->lookat.eye;
|
||||
#endif
|
||||
sp_130 = sp_130.outprod(sp_13c);
|
||||
sp_130.normalizeZP();
|
||||
|
||||
@@ -2822,7 +2850,11 @@ void mDoExt_3DlineMat1_c::update(int param_0, f32 param_1, GXColor& param_2, u16
|
||||
local_f31 += local_f30 * 0.02f * (8.0f / param_1);
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
sp_13c = local_r27[0] - lineEye;
|
||||
#else
|
||||
sp_13c = local_r27[0] - sp_3c->lookat.eye;
|
||||
#endif
|
||||
sp_130 = sp_130.outprod(sp_13c);
|
||||
sp_130.normalizeZP();
|
||||
|
||||
@@ -2894,7 +2926,11 @@ void mDoExt_3DlineMat2_c::setMaterial() {
|
||||
GXLoadNrmMtxImm(cMtx_getIdentity(), 0);
|
||||
}
|
||||
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* param_4) {
|
||||
#if TARGET_PC
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* param_4, const cXyz* presentationEye) {
|
||||
#else
|
||||
void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* param_4
|
||||
#endif
|
||||
mColor = param_2;
|
||||
this->mpTevStr = param_4;
|
||||
if (param_0 < 0) {
|
||||
@@ -2904,6 +2940,11 @@ void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
} else {
|
||||
field_0x34 = param_0;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
mInterpLineKind = 2;
|
||||
#endif
|
||||
|
||||
view_class* stack_3c = dComIfGd_getView();
|
||||
mDoExt_3Dline_c* sp_38 = mpLines;
|
||||
f32 local_f30;
|
||||
@@ -2929,6 +2970,12 @@ void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
for (s32 sp_14 = 0; sp_14 < mNumLines; sp_14++) {
|
||||
local_r27 = sp_38[0].field_0x0;
|
||||
size_p = sp_38->field_0x4;
|
||||
#if TARGET_PC
|
||||
if (presentationEye != nullptr && dusk::getSettings().game.enableFrameInterpolation && size_p == NULL) {
|
||||
sp_38 += 1;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
JUT_ASSERT(5875, size_p != NULL);
|
||||
sp_24 = sp_38->field_0x8[mIsDrawn];
|
||||
sp_28 = sp_24;
|
||||
@@ -2942,7 +2989,12 @@ void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
sp_130 = local_r27[1] - local_r27[0];
|
||||
local_f30 = sp_130.abs();
|
||||
local_f31 += local_f30 * 0.1f;
|
||||
#if TARGET_PC
|
||||
const cXyz& lineEye = (presentationEye != nullptr && dusk::getSettings().game.enableFrameInterpolation) ? *presentationEye : stack_3c->lookat.eye;
|
||||
sp_13c = local_r27[0] - lineEye;
|
||||
#else
|
||||
sp_13c = local_r27[0] - stack_3c->lookat.eye;
|
||||
#endif
|
||||
sp_130 = sp_130.outprod(sp_13c);
|
||||
sp_130.normalizeZP();
|
||||
local_r30->x = sp_130.x * 64.0f;
|
||||
@@ -2964,7 +3016,11 @@ void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
sp_130 = local_r27[1] - local_r27[0];
|
||||
local_f30 = sp_130.abs();
|
||||
local_f31 += local_f30 * 0.1f;
|
||||
#if TARGET_PC
|
||||
sp_13c = local_r27[0] - lineEye;
|
||||
#else
|
||||
sp_13c = local_r27[0] - stack_3c->lookat.eye;
|
||||
#endif
|
||||
sp_130 = sp_130.outprod(sp_13c);
|
||||
sp_130.normalizeZP();
|
||||
local_r30 += 2;
|
||||
@@ -3008,6 +3064,19 @@ void mDoExt_3DlineMat1_c::update(int param_0, GXColor& param_2, dKy_tevstr_c* pa
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void mDoExt_3DlineMat1_c::refreshGeometryForPresentationEye(const cXyz& eye) {
|
||||
if (!dusk::getSettings().game.enableFrameInterpolation) {
|
||||
return;
|
||||
}
|
||||
if (mInterpLineKind == 1) {
|
||||
update(field_0x34, mInterpLineF, mColor, mInterpLineU16, mpTevStr, &eye);
|
||||
} else if (mInterpLineKind == 2) {
|
||||
update(field_0x34, mColor, mpTevStr, &eye);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void mDoExt_3DlineMatSortPacket::setMat(mDoExt_3DlineMat_c* i_3DlineMat) {
|
||||
if (mp3DlineMat == NULL) {
|
||||
dComIfGd_getListPacket()->entryImm(this, 0);
|
||||
|
||||
Reference in New Issue
Block a user