fix Electric Arc interpolation

This commit is contained in:
Sonic Dreamcaster
2025-04-11 05:34:26 -03:00
parent daa711f290
commit af686894f2
3 changed files with 40 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef SF64_TAGGING
#define SF64_TAGGING
/* For dynamic actors */
#define TAG_ADDRESS(ptr) ((u32) (ptr) & 0x0FFFFFFF)
/*
X XXX XX XX
TYPE ID INDEX CUSTOM
*/
#define TAG_OBJ(ptr) (((((ptr)->obj.id) << 16) & 0x0FFF0000) | ((((ptr)->index) << 8) & 0x0000FF00))
/* Actor Types */
#define TAG_ACTOR(actor) ((u32) (0x10000000 | (TAG_OBJ(actor))))
#define TAG_ACTOR_EVENT(actor) ((u32) (0x20000000 | (TAG_OBJ(actor))))
#define TAG_ACTOR_EVENT_COMMON(actor) ((u32) (0x90000000 | (TAG_OBJ(actor))))
#define TAG_BOSS(boss) ((u32) (0x30000000 | (TAG_OBJ(boss))))
#define TAG_SCENERY(scenery) ((u32) (0x40000000 | (TAG_OBJ(scenery))))
#define TAG_SCENERY_360(scenery360) ((u32) (0x50000000 | (TAG_ADDRESS(scenery360))))
#define TAG_EFFECT(effect) ((u32) (0x60000000 | (TAG_OBJ(effect))))
#define TAG_ITEM(item) ((u32) (0x70000000 | (TAG_OBJ(item))))
#define TAG_PLAYER_SHOT(shot) ((u32) (0xC0000000 | (TAG_OBJ(shot))))
/* Skeletons */
#define TAG_LIMB_ADDRESS(ptr, data) ((((u32) (ptr) << 16) & 0xFFFF0000) | ((u32) (data) & 0x0000FFFF))
#define TAG_LIMB(limb, data) ((u32) (0x80000000 | (TAG_LIMB_ADDRESS(limb, data))))
/* Others */
#define TAG_ARWING_SKEL(arwing) (0xB0000000 | (((u32) (arwing) << 16) & 0x0FFF0000))
#endif
+8
View File
@@ -24,6 +24,7 @@
#include "assets/ast_zoness.h"
#include "port/interpolation/FrameInterpolation.h"
#include "port/mods/PortEnhancements.h"
#include "sf64_tagging.h"
// rodata
const char D_800D7230[] = "Enm->wrk3=<%d>\n";
@@ -363,11 +364,18 @@ void Effect_Effect389_Draw(Effect389* this) {
for (i = 0; i < 10; i++) {
if ((i >= this->unk_48) && (i < this->unk_46)) {
Matrix_Push(&gGfxMatrix);
// @port: Tag the transform.
FrameInterpolation_RecordOpenChild("ElectricArc1", TAG_EFFECT(this) + i);
Matrix_Translate(gGfxMatrix, 0.0f, -60.0f, 0.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.8f, 3.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, D_102F5E0);
Matrix_Pop(&gGfxMatrix);
// @port: Pop the transform.
FrameInterpolation_RecordCloseChild();
}
Matrix_Translate(gGfxMatrix, 0.0f, -120.0f, 0.0f, MTXF_APPLY);
Matrix_RotateZ(gGfxMatrix, D_800D1534[this->unk_4C][i] * M_DTOR, MTXF_APPLY);
+1 -3
View File
@@ -1,5 +1,6 @@
#include "global.h"
#include "assets/ast_text.h"
#include "sf64_tagging.h"
char D_801619A0[100];
@@ -206,9 +207,6 @@ s32 Animation_GetLimbIndex(Limb* limb, Limb** skeleton) {
return 0;
}
#define TAG_LIMB_ADDRESS(ptr, data) ((((u32) (ptr) << 16) & 0xFFFF0000) | ((u32) (data) & 0x0000FFFF))
#define TAG_LIMB(limb, data) ((u32) (0x80000000 | (TAG_LIMB_ADDRESS(limb, data))))
void Animation_DrawLimb(s32 mode, Limb* limb, Limb** skeleton, Vec3f* jointTable, OverrideLimbDraw overrideLimbDraw,
PostLimbDraw postLimbDraw, void* data) {
bool override;