Decompile and clean up some effect files (#342)

* Decompile various effect files and cleanup z_effect.c

* Decompile z_eff_tire_mark.c and cleanup structs

* Small cleanups

* Apply most review suggestions

* Apply more review suggestions

* Change eff_shield_particle vertices to be extracted as an asset

* Add relevant effect functions to actorfixer.py
This commit is contained in:
Roman971
2021-12-27 02:51:16 +00:00
committed by GitHub
parent 6fba9aa388
commit 6c2f521373
23 changed files with 2198 additions and 446 deletions
+30 -45
View File
@@ -167,7 +167,7 @@ s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status);
// void func_800867B4(void);
// void func_800867D4(void);
// void func_800867F4(void);
// void func_80086814(void);
f32 func_80086814(f32 x);
// void func_80086834(void);
// void func_80086880(void);
// void func_800869A4(void);
@@ -499,52 +499,37 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
s32 func_800A8150(s32 index);
s32 func_800A817C(s32 index);
s32 func_800A81A4(GlobalContext* globalCtx, s32 a1, s32 a2);
void func_800A81F0(EffectBlure* this, Vec3f* p1, Vec3f* p2);
void func_800A8514(void* effectParams);
void EffectBlure_Initcommon(EffectBlure* params);
void EffectBlure_Init1(EffectBlure* params, EffBlureInit1* init);
void EffectBlure_Init2(EffectBlure* params, EffBlureInit2* init);
void EffectBlure_Destroy(EffectBlure* params);
s32 EffectBlure_Update(EffectBlure* params);
// void func_800A8C78(void);
// void func_800A8DE8(void);
// void func_800A92FC(void);
// void func_800A9330(void);
// void func_800A9804(void);
// void func_800AA190(void);
// void func_800AA460(void);
// void func_800AA498(void);
// void func_800AA700(void);
// void func_800AABE0(void);
void EffectBlure_Draw(EffectBlure* params, GraphicsContext* gfxCtx);
void EffectShieldParticle_Init(EffShieldParticleParams* params, EffShieldParticleInit* init);
void EffectShieldParticle_Destroy(EffShieldParticleParams* params);
s32 EffectShieldParticle_Update(EffShieldParticleParams* params);
void EffectShieldParticle_CalculateColors(EffShieldParticleParams* params, Color_RGBA8* primColor, Color_RGBA8* envColor);
void EffectShieldParticle_Draw(EffShieldParticleParams* params, GraphicsContext* gfxCtx);
void EffectSpark_Init(EffSparkParams* params, EffSparkParams* init);
void EffectSpark_Destroy(EffSparkParams* params);
s32 EffectSpark_Update(EffSparkParams* params);
void EffectSpark_Draw(EffSparkParams* params, GraphicsContext* gfxCtx);
void func_800AE2A0(GlobalContext* globalCtx, Color_RGBA8* arg1, s16 arg2, s16 arg3);
void func_800AE434(GlobalContext* globalCtx, Color_RGBA8* color, s16 sParm3, s16 sParm4);
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2);
void EffectBlure_AddSpace(EffectBlure* this);
void EffectBlure_Init1(void* thisx, void* initParamsx);
void EffectBlure_Init2(void* thisx, void* initParamsx);
void EffectBlure_Destroy(void* thisx);
s32 EffectBlure_Update(void* thisx);
void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx);
void EffectShieldParticle_Init(void* thisx, void* initParamsx);
void EffectShieldParticle_Destroy(void* thisx);
s32 EffectShieldParticle_Update(void* thisx);
void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx);
void EffectSpark_Init(void* thisx, void* initParamsx);
void EffectSpark_Destroy(void* thisx);
s32 EffectSpark_Update(void* thisx);
void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx);
void func_800AE2A0(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3);
void func_800AE434(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3);
void func_800AE5A0(GlobalContext* globalCtx);
void func_800AE5E4(GlobalContext* globalCtx, Color_RGBA8* arg1, s16 arg2, s16 arg3);
void func_800AE778(GlobalContext* globalCtx, Color_RGBA8* color, s16 param_3, s16 param_4);
void func_800AE5E4(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3);
void func_800AE778(GlobalContext* globalCtx, Color_RGBA8* color, s16 arg2, s16 arg3);
void func_800AE8EC(GlobalContext* globalCtx);
void func_800AE930(CollisionContext* colCtx, s32 param_2, Vec3f* param_3, f32 param_4, s16 param_5, CollisionPoly* param_6, s32 param_7);
void func_800AEF44(s32 arg0);
void EffectTireMark_InitParticle(EffTireMarkParticle* particle);
void EffectTireMark_Init(EffTireMarkParams* params, EffTireMarkInit* init);
void EffectTireMark_Destroy(EffTireMarkParams* params);
s32 EffectTireMark_Update(EffTireMarkParams* params);
void EffectTireMark_InitVertices(F3DVertexColor* vertices, EffTireMarkParticle* particle, s32 index, s32 alpha);
void EffectTireMark_Draw(EffTireMarkParams* params, GraphicsContext* gfxCtx);
GlobalContext* Effect_GetContext(void);
void* Effect_GetParams(s32 index);
void Effect_InitCommon(EffCommon* common);
void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f32 arg3, s16 angle, CollisionPoly* colPoly, s32 arg6);
void func_800AEF44(EffectTireMark* this);
void EffectTireMark_Init(void* thisx, void* initParamsx);
void EffectTireMark_Destroy(void* thisx);
s32 EffectTireMark_Update(void* thisx);
void EffectTireMark_Draw(void* thisx, GraphicsContext* gfxCtx);
GlobalContext* Effect_GetGlobalCtx(void);
void* Effect_GetByIndex(s32 index);
void Effect_Init(GlobalContext* globalCtx);
void Effect_Add(GlobalContext* globalCtx, s32* index, s32 type, u8 param_4, u8 param_5, void* initParams);
void Effect_Add(GlobalContext* globalCtx, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* initParams);
void Effect_DrawAll(GraphicsContext* gfxCtx);
void Effect_UpdateAll(GlobalContext* globalCtx);
void Effect_Destroy(GlobalContext* globalCtx, s32 index);
@@ -3231,7 +3216,7 @@ f32 Rand_ZeroFloat(f32 scale);
f32 randPlusMinusPoint5Scaled(f32 scale);
f32 Math3D_Normalize(Vec3f* vec);
s32 Math3D_PlaneVsLineSegClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB, f32 planeBC, f32 planeBDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* closestPoint);
// UNK_TYPE4 func_80179798(Vec3f* param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, Vec3f* param_5, Vec3f* param_6);
s32 func_80179798(Vec3f* param_1, Vec3f* param_2, Vec3f* param_3, Vec3f* param_4, Vec3f* param_5, Vec3f* param_6);
// void func_80179A44(void);
void func_80179B34(float fParm1, f32 fParm2, f32 fParm5, f32 fParm6, f32 param_5, f32 param_6, f32 param_7, float* param_8, float* param_9);
// UNK_TYPE4 func_80179B94(f32 fParm1, f32 fParm2, f32 fParm5, f32 param_4, f32 param_5, f32 param_6, f32 param_7, f32 param_8, Vec3f* param_9);
+1
View File
@@ -102,6 +102,7 @@ extern GraphicsContext* __gfxCtx;
s32 __dispPad
#define CLOSE_DISPS(gfxCtx) \
(void)0; \
} \
(void)0
+8 -16
View File
@@ -382,8 +382,6 @@ extern UNK_PTR D_801AE260[3];
// extern UNK_TYPE4 D_801AE2BC;
// extern UNK_TYPE4 D_801AE2CC;
// extern UNK_TYPE4 D_801AE2DC;
extern F3DVertex sEffectShieldParticleVertices[4];
extern EffInfo sEffInfoTable[5];
extern EffectSsInfo EffectSS2Info;
// extern UNK_TYPE1 D_801AE3B0;
// extern UNK_TYPE1 D_801AE3B4;
@@ -870,8 +868,8 @@ extern ColChkVsFunc sOCVsFuncs[COLSHAPE_MAX][COLSHAPE_MAX];
extern CollisionCheckInfo defaultColChkInfo;
extern ColChkApplyFunc sApplyDamageFuncs[COLSHAPE_MAX];
extern ColChkLineFunc sOCLineCheckFuncs[COLSHAPE_MAX];
extern EffShieldParticleInit shieldParticleInitMetal;
extern EffShieldParticleInit shieldParticleInitWood;
extern EffectShieldParticleInit shieldParticleInitMetal;
extern EffectShieldParticleInit shieldParticleInitWood;
// extern UNK_TYPE4 D_801BB090;
// extern UNK_TYPE1 D_801BB094;
// extern UNK_TYPE1 D_801BB0DC;
@@ -3104,15 +3102,7 @@ extern u64 gJpegUCodeData[];
// extern UNK_TYPE1 D_801E3FA0;
// bss
extern EffTables sEffTable;
// extern UNK_TYPE1 D_801E4514;
// extern UNK_TYPE1 D_801E4E08;
// extern UNK_TYPE1 D_801E531C;
// extern UNK_TYPE1 D_801E69E0;
// extern UNK_TYPE1 D_801E9AA0;
// extern UNK_TYPE1 D_801ED4C0;
// extern UNK_TYPE1 D_801ED890;
// extern UNK_TYPE1 D_801ED894;
// extern UNK_TYPE1 D_801ED8A0;
// extern UNK_TYPE1 D_801ED8B0;
// extern UNK_TYPE1 D_801ED8B4;
@@ -3197,12 +3187,12 @@ extern Vec3f D_801EE1E0;
extern Vec3f D_801EE1F0;
// extern UNK_TYPE1 D_801EE1F4;
// extern UNK_TYPE1 D_801EE1F8;
extern EffSparkParams D_801EE200;
extern EffectSparkInit D_801EE200;
extern TriNorm D_801EE6C8;
extern TriNorm D_801EE700;
extern EffSparkParams D_801EE738;
extern EffSparkParams D_801EEC00;
extern EffSparkParams D_801EF0C8;
extern EffectSparkInit D_801EE738;
extern EffectSparkInit D_801EEC00;
extern EffectSparkInit D_801EF0C8;
extern TriNorm D_801EF590;
extern TriNorm D_801EF5C8;
extern TriNorm D_801EF600;
@@ -3887,6 +3877,7 @@ extern Gfx D_04011BD0; // Gold Deku Flower display list
extern SkeletonHeader D_040127E8; // Gold Deku Flower skeleton
extern UNK_TYPE D_04012860;
extern UNK_TYPE D_040128BC;
extern u64 D_04014570[];
extern UNK_TYPE D_04015FA0;
extern UNK_TYPE D_04016360;
extern UNK_TYPE D_0401A4D0;
@@ -3950,6 +3941,7 @@ extern AnimationHeader D_0405140C;
extern UNK_TYPE D_040527F0;
extern UNK_TYPE D_040528B0;
extern Gfx D_04054A90[];
extern u64 D_04054F20[];
extern UNK_TYPE D_04055628;
extern Gfx D_04057B10[];
extern Gfx D_04058BA0[];
+99 -94
View File
@@ -10,14 +10,6 @@
struct GraphicsContext;
struct GlobalContext;
typedef void(*eff_destroy_func)(void* params);
typedef void(*eff_draw_func)(void* params, struct GraphicsContext* gfxCtx);
typedef void(*eff_init_func)(void* params, void* init);
typedef s32(*eff_update_func)(void* params);
#define SPARK_COUNT 3
#define BLURE_COUNT 25
#define SHIELD_PARTICLE_COUNT 3
@@ -41,37 +33,45 @@ typedef s32(*eff_update_func)(void* params);
#define rgObjBankIdx regs[11]
typedef struct {
/* 0x0 */ u8 active;
/* 0x1 */ u8 unk1;
/* 0x2 */ u8 unk2;
/* 0x3 */ UNK_TYPE1 pad3[0x1];
} EffCommon; // size = 0x4
/* 0x00 */ u8 active;
/* 0x01 */ u8 unk1;
/* 0x02 */ u8 unk2;
} EffectStatus; // size = 0x03
typedef struct {
/* 0x00 */ Vec3f velocity;
/* 0x0C */ Vec3f position;
/* 0x18 */ Vec3s unk18;
/* 0x1E */ Vec3s unk1E;
} EffSparkParticle; // size = 0x24
/* 0x18 */ Vec3s unkVelocity;
/* 0x1E */ Vec3s unkPosition;
} EffectSparkElement; // size = 0x24
typedef struct {
/* 0x000 */ Vec3s position;
/* 0x008 */ s32 numParticles; // Will be calculated as particleFactor1 * particleFactor2 + 2
/* 0x00C */ EffSparkParticle particles[32];
/* 0x48C */ f32 velocity;
/* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2
/* 0x00C */ EffectSparkElement elements[32];
/* 0x48C */ f32 speed;
/* 0x490 */ f32 gravity;
/* 0x494 */ u32 particleFactor1;
/* 0x498 */ u32 particleFactor2;
/* 0x494 */ u32 uDiv; // "u_div"
/* 0x498 */ u32 vDiv; // "v_div"
/* 0x49C */ Color_RGBA8 colorStart[4];
/* 0x4AC */ Color_RGBA8 colorEnd[4];
/* 0x4BC */ s32 age;
/* 0x4BC */ s32 timer;
/* 0x4C0 */ s32 duration;
} EffSparkParams; // size = 0x4C4
} EffectSparkInit; // size = 0x4C4
typedef struct {
/* 0x000 */ EffCommon base;
/* 0x004 */ EffSparkParams params;
} EffSpark; // size = 0x4C8
/* 0x000 */ Vec3s position;
/* 0x008 */ s32 numElements; // "table_size"; calculated as uDiv * vDiv + 2
/* 0x00C */ EffectSparkElement elements[32];
/* 0x48C */ f32 speed;
/* 0x490 */ f32 gravity;
/* 0x494 */ u32 uDiv; // "u_div"
/* 0x498 */ u32 vDiv; // "v_div"
/* 0x49C */ Color_RGBA8 colorStart[4];
/* 0x4AC */ Color_RGBA8 colorEnd[4];
/* 0x4BC */ s32 timer;
/* 0x4C0 */ s32 duration;
} EffectSpark; // size = 0x4C4
typedef struct {
/* 0x00 */ s32 state;
@@ -82,13 +82,15 @@ typedef struct {
} EffectBlureElement; // size = 0x18
typedef struct {
/* 0x000 */ UNK_TYPE1 pad0[0x184];
/* 0x184 */ Color_RGBA8 unk184;
/* 0x188 */ Color_RGBA8 unk188;
/* 0x18C */ Color_RGBA8 unk18C;
/* 0x190 */ Color_RGBA8 unk190;
/* 0x194 */ UNK_TYPE1 pad194[0xC];
} EffBlureInit1; // size = 0x1A0
/* 0x000 */ char unk_00[0x184];
/* 0x184 */ u8 p1StartColor[4];
/* 0x188 */ u8 p2StartColor[4];
/* 0x18C */ u8 p1EndColor[4];
/* 0x190 */ u8 p2EndColor[4];
/* 0x194 */ s32 elemDuration;
/* 0x198 */ s32 unkFlag;
/* 0x19C */ s32 calcMode;
} EffectBlureInit1; // size = 0x1A0
typedef struct {
/* 0x00 */ s32 calcMode;
@@ -104,7 +106,7 @@ typedef struct {
/* 0x1B */ u8 mode4Param;
/* 0x1C */ Color_RGBA8 altPrimColor; // used with drawMode 1
/* 0x20 */ Color_RGBA8 altEnvColor; // used with drawMode 1
} EffBlureInit2; // size = 0x24
} EffectBlureInit2; // size = 0x24
typedef struct {
/* 0x000 */ EffectBlureElement elements[16];
@@ -117,31 +119,26 @@ typedef struct {
/* 0x192 */ Color_RGBA8 p2StartColor;
/* 0x196 */ Color_RGBA8 p1EndColor;
/* 0x19A */ Color_RGBA8 p2EndColor;
/* 0x19E */ u8 numElements;
/* 0x19E */ u8 numElements; // "now_edge_num"
/* 0x19F */ u8 elemDuration;
/* 0x1A0 */ u8 unkFlag;
/* 0x1A1 */ u8 drawMode; // 0: simple; 1: simple with alt colors; 2+: smooth
/* 0x1A2 */ Color_RGBA8 altPrimColor;
/* 0x1A6 */ Color_RGBA8 altEnvColor;
/* 0x1A2 */ Color_RGBA8 altPrimColor; // used with drawMode 1
/* 0x1A6 */ Color_RGBA8 altEnvColor; // used with drawMode 1
} EffectBlure; // size = 0x1AC
typedef struct {
/* 0x000 */ EffCommon base;
/* 0x004 */ EffectBlure params;
} EffBlure; // size = 0x1B0
typedef struct {
/* 0x00 */ f32 startSpeed;
/* 0x00 */ f32 initialSpeed;
/* 0x04 */ f32 endXChange;
/* 0x08 */ f32 endX;
/* 0x0C */ f32 startXChange;
/* 0x10 */ f32 startX;
/* 0x14 */ s16 rotationY;
/* 0x16 */ s16 rotationZ;
} EffShieldParticleParticle; // size = 0x18
/* 0x14 */ s16 yaw;
/* 0x16 */ s16 pitch;
} EffectShieldParticleElement; // size = 0x18
typedef struct {
/* 0x00 */ u8 numParticles;
/* 0x00 */ u8 numElements;
/* 0x02 */ Vec3s position;
/* 0x08 */ Color_RGBA8 primColorStart;
/* 0x0C */ Color_RGBA8 envColorStart;
@@ -149,18 +146,17 @@ typedef struct {
/* 0x14 */ Color_RGBA8 envColorMid;
/* 0x18 */ Color_RGBA8 primColorEnd;
/* 0x1C */ Color_RGBA8 envColorEnd;
/* 0x20 */ f32 acceleration;
/* 0x20 */ f32 deceleration;
/* 0x24 */ f32 maxInitialSpeed;
/* 0x28 */ f32 lengthCutoff;
/* 0x2C */ u8 duration;
/* 0x2E */ LightPoint lightPoint;
/* 0x3C */ s32 hasLight;
} EffShieldParticleInit; // size = 0x40
/* 0x3C */ s32 lightDecay; // halves light radius every frame when set to 1
} EffectShieldParticleInit; // size = 0x40
typedef struct {
/* 0x000 */ EffShieldParticleParticle particles[16];
/* 0x180 */ u8 numParticles;
/* 0x181 */ UNK_TYPE1 pad181[0x1];
/* 0x000 */ EffectShieldParticleElement elements[16];
/* 0x180 */ u8 numElements;
/* 0x182 */ Vec3s position;
/* 0x188 */ Color_RGBA8 primColorStart;
/* 0x18C */ Color_RGBA8 envColorStart;
@@ -168,66 +164,75 @@ typedef struct {
/* 0x194 */ Color_RGBA8 envColorMid;
/* 0x198 */ Color_RGBA8 primColorEnd;
/* 0x19C */ Color_RGBA8 envColorEnd;
/* 0x1A0 */ f32 acceleration;
/* 0x1A4 */ UNK_TYPE1 pad1A4[0x4];
/* 0x1A0 */ f32 deceleration;
/* 0x1A4 */ char unk_1A4[0x04];
/* 0x1A8 */ f32 maxInitialSpeed;
/* 0x1AC */ f32 lengthCutoff;
/* 0x1B0 */ u8 duration;
/* 0x1B1 */ u8 age;
/* 0x1B1 */ u8 timer;
/* 0x1B2 */ LightInfo lightInfo;
/* 0x1C0 */ LightNode* light;
/* 0x1C4 */ s32 hasLight;
} EffShieldParticleParams; // size = 0x1C8
/* 0x1C0 */ LightNode* lightNode;
/* 0x1C4 */ s32 lightDecay; // halves light radius every frame when set to 1
} EffectShieldParticle; // size = 0x1C8
typedef struct {
/* 0x000 */ EffCommon base;
/* 0x004 */ EffShieldParticleParams params;
} EffShieldParticle; // size = 0x1CC
typedef struct {
/* 0x00 */ UNK_TYPE2 active;
/* 0x02 */ Vec3s position1;
/* 0x08 */ Vec3s position2;
/* 0x00 */ u16 flags;
/* 0x02 */ Vec3s p1;
/* 0x08 */ Vec3s p2;
/* 0x0E */ s16 life;
/* 0x10 */ UNK_TYPE1 pad10[0x4];
/* 0x14 */ UNK_TYPE4 unk14;
} EffTireMarkParticle; // size = 0x18
/* 0x14 */ CollisionPoly* colPoly;
} EffectTireMarkElement; // size = 0x18
typedef struct {
/* 0x0 */ s16 unk0;
/* 0x2 */ s16 maxLife;
/* 0x2 */ s16 elemDuration;
/* 0x4 */ Color_RGBA8 color;
} EffTireMarkInit; // size = 0x8
} EffectTireMarkInit; // size = 0x8
typedef struct {
/* 0x000 */ EffTireMarkParticle particles[64];
/* 0x000 */ EffectTireMarkElement elements[64];
/* 0x600 */ s16 unk600;
/* 0x602 */ s16 numParticles;
/* 0x604 */ s16 maxLife;
/* 0x602 */ s16 numElements;
/* 0x604 */ s16 elemDuration;
/* 0x606 */ Color_RGBA8 color;
/* 0x60A */ UNK_TYPE1 pad60A[0x2];
} EffTireMarkParams; // size = 0x60C
typedef struct {
/* 0x000 */ EffCommon base;
/* 0x004 */ EffTireMarkParams params;
} EffTireMark; // size = 0x610
typedef struct {
/* 0x00 */ u32 paramsSize;
/* 0x04 */ eff_init_func init;
/* 0x08 */ eff_destroy_func destroy;
/* 0x0C */ eff_update_func update;
/* 0x10 */ eff_draw_func draw;
} EffInfo; // size = 0x14
} EffectTireMark; // size = 0x60C
typedef struct {
/* 0x0000 */ struct GlobalContext* globalCtx;
/* 0x0004 */ EffSpark sparks[SPARK_COUNT];
/* 0x0E5C */ EffBlure blures[BLURE_COUNT];
/* 0x388C */ EffShieldParticle shieldParticles[SHIELD_PARTICLE_COUNT];
/* 0x3DF0 */ EffTireMark tireMarks[TIRE_MARK_COUNT];
} EffTables; // size = 0x98E0
struct {
EffectStatus status;
EffectSpark effect;
} /* 0x0004 */ sparks[SPARK_COUNT];
struct {
EffectStatus status;
EffectBlure effect;
} /* 0x0E5C */ blures[BLURE_COUNT];
struct {
EffectStatus status;
EffectShieldParticle effect;
} /* 0x388C */ shieldParticles[SHIELD_PARTICLE_COUNT];
struct {
EffectStatus status;
EffectTireMark effect;
} /* 0x3DF0 */ tireMarks[TIRE_MARK_COUNT];
} EffectContext; // size = 0x98E0
typedef struct {
/* 0x00 */ u32 size;
/* 0x04 */ void (*init)(void* effect, void* initParams);
/* 0x08 */ void (*destroy)(void* effect);
/* 0x0C */ s32 (*update)(void* effect);
/* 0x10 */ void (*draw)(void* effect, struct GraphicsContext* gfxCtx);
} EffectInfo; // size = 0x14
typedef enum {
/* 0x00 */ EFFECT_SPARK,
/* 0x01 */ EFFECT_BLURE1,
/* 0x02 */ EFFECT_BLURE2,
/* 0x03 */ EFFECT_SHIELD_PARTICLE,
/* 0x04 */ EFFECT_TIRE_MARK
} EffectType;
/* Effect Soft Sprites */
+4 -3
View File
@@ -85,9 +85,10 @@ typedef struct {
/* 0x06 */ s16 yaw; // azimuthal angle
} VecSph; // size = 0x08
#define F32_LERP(v0,v1,t) ((1.0f - (t)) * (v0) + (t) * (v1))
#define F32_LERPIMP(v0, v1, t) (v0 + ((v1 - v0) * t))
#define F32_LERPIMPINV(v0, v1, t) ((v0) + (((v1) - (v0)) / (t)))
#define LERPIMP(v0, v1, t) ((v0) + (((v1) - (v0)) * (t)))
#define F32_LERP(v0, v1, t) ((1.0f - (t)) * (f32)(v0) + (t) * (f32)(v1))
#define F32_LERPIMP(v0, v1, t) ((f32)(v0) + (((f32)(v1) - (f32)(v0)) * (t)))
#define F32_LERPIMPINV(v0, v1, t) ((f32)(v0) + (((f32)(v1) - (f32)(v0)) / (t)))
#define BINANG_LERPIMP(v0, v1, t) ((v0) + (s16)(BINANG_SUB((v1), (v0)) * (t)))
#define BINANG_LERPIMPINV(v0, v1, t) ((v0) + BINANG_SUB((v1), (v0)) / (t))