mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-20 07:31:39 -04:00
c_keyframe.c decompiled and documented (#1630)
* 2 non-matching * 1 function left Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Fully matching Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Documented, has bss reordering issues * Fixes * Apply suggestions * Format * Re-add cast oops * Remove != 0 for override and transform limb draws, format --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
+1287
-42
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z64collision_check.h"
|
||||
|
||||
#include "z64actor.h"
|
||||
|
||||
@@ -14,6 +14,28 @@ static s16 sBssPad;
|
||||
u8 gDisablePlayerCsActionStartPos;
|
||||
s16 gDungeonBossWarpSceneId;
|
||||
|
||||
// clang-format off
|
||||
// Partial structs taken from "prevent_bss_reordering.h"
|
||||
struct Dummy200 { int x; };
|
||||
struct Dummy201 { int x; };
|
||||
struct Dummy202 { int x; };
|
||||
struct Dummy203 { int x; };
|
||||
struct Dummy204 { int x; };
|
||||
struct Dummy205 { int x; };
|
||||
struct Dummy206 { int x; };
|
||||
struct Dummy207 { int x; };
|
||||
struct Dummy208 { int x; };
|
||||
struct Dummy209 { int x; };
|
||||
struct Dummy210 { int x; };
|
||||
struct Dummy211 { int x; };
|
||||
struct Dummy212 { int x; };
|
||||
struct Dummy213 { int x; };
|
||||
struct Dummy214 { int x; };
|
||||
struct Dummy215 { int x; };
|
||||
struct Dummy216 { int x; };
|
||||
struct Dummy217 { int x; };
|
||||
// clang-format on
|
||||
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
* - Seaweed
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_boss_03.h"
|
||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
|
||||
|
||||
@@ -46,14 +46,14 @@ void DemoMoonend_Init(Actor* thisx, PlayState* play) {
|
||||
this->actionFunc = func_80C17B60;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, 0.095f);
|
||||
func_80183430(&this->skeletonInfo, &object_moonend_Blob_00B5A0, &object_moonend_Blob_001214, this->jointTable,
|
||||
this->morphTable, NULL);
|
||||
func_801834A8(&this->skeletonInfo, &object_moonend_Blob_001214);
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&object_moonend_Blob_00B5A0,
|
||||
(KeyFrameAnimation*)&object_moonend_Blob_001214, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&object_moonend_Blob_001214);
|
||||
this->cueType = CS_CMD_ACTOR_CUE_560;
|
||||
this->actionFunc = func_80C17C48;
|
||||
this->actor.home.rot.z = 0;
|
||||
this->actor.draw = NULL;
|
||||
this->skeletonInfo.frameCtrl.unk_C = 2.0f / 3.0f;
|
||||
this->kfSkelAnime.frameCtrl.speed = 2.0f / 3.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ void DemoMoonend_Destroy(Actor* thisx, PlayState* play) {
|
||||
DemoMoonend* this = THIS;
|
||||
|
||||
if (DEMOMOONEND_GET_PARAM_F(thisx) != 1) {
|
||||
func_8018349C(&this->skeletonInfo);
|
||||
Keyframe_DestroyFlex(&this->kfSkelAnime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void func_80C17B60(DemoMoonend* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80C17C48(DemoMoonend* this, PlayState* play) {
|
||||
if (func_80183DE0(&this->skeletonInfo)) {
|
||||
if (Keyframe_UpdateFlex(&this->kfSkelAnime)) {
|
||||
this->actor.home.rot.z = 0;
|
||||
}
|
||||
if (Cutscene_IsCueInChannel(play, this->cueType)) {
|
||||
@@ -110,14 +110,14 @@ void func_80C17C48(DemoMoonend* this, PlayState* play) {
|
||||
switch (this->cueId) {
|
||||
case 1:
|
||||
this->actor.draw = DemoMoonend_Draw;
|
||||
func_801834A8(&this->skeletonInfo, &object_moonend_Blob_001214);
|
||||
this->skeletonInfo.frameCtrl.unk_C = 0.0f;
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&object_moonend_Blob_001214);
|
||||
this->kfSkelAnime.frameCtrl.speed = 0.0f;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this->actor.draw = DemoMoonend_Draw;
|
||||
func_801834A8(&this->skeletonInfo, &object_moonend_Blob_001214);
|
||||
this->skeletonInfo.frameCtrl.unk_C = 2.0f / 3.0f;
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&object_moonend_Blob_001214);
|
||||
this->kfSkelAnime.frameCtrl.speed = 2.0f / 3.0f;
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_EXPLOSION);
|
||||
this->actor.home.rot.z = 1;
|
||||
break;
|
||||
@@ -166,8 +166,8 @@ void DemoMoonend_Update(Actor* thisx, PlayState* play) {
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
s32 func_80C17E70(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
|
||||
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
s32 DemoMoonend_OverrideLimbDraw(PlayState* play, KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
DemoMoonend* this = THIS;
|
||||
|
||||
if (limbIndex == 2) {
|
||||
@@ -178,8 +178,8 @@ s32 func_80C17E70(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gf
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 func_80C17EE0(PlayState* play, SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
|
||||
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
s32 DemoMoonend_PostLimbDraw(PlayState* play, KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
DemoMoonend* this = THIS;
|
||||
|
||||
if (limbIndex == 8) {
|
||||
@@ -191,16 +191,17 @@ s32 func_80C17EE0(PlayState* play, SkeletonInfo* skeleton, s32 limbIndex, Gfx**
|
||||
|
||||
void DemoMoonend_Draw(Actor* thisx, PlayState* play) {
|
||||
DemoMoonend* this = THIS;
|
||||
Mtx* mtx;
|
||||
Mtx* mtxStack;
|
||||
|
||||
AnimatedMat_Draw(play, (AnimatedMaterial*)Lib_SegmentedToVirtual(object_moonend_Matanimheader_00B540));
|
||||
|
||||
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
|
||||
mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (mtxStack != NULL) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
Gfx_SetupDL25_Opa(play->state.gfxCtx);
|
||||
func_8018450C(play, &this->skeletonInfo, mtx, func_80C17E70, func_80C17EE0, &this->actor);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, DemoMoonend_OverrideLimbDraw, DemoMoonend_PostLimbDraw,
|
||||
&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef void (*DemoMoonendActionFunc)(struct DemoMoonend*, PlayState*);
|
||||
|
||||
typedef struct DemoMoonend {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkeletonInfo skeletonInfo;
|
||||
/* 0x144 */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x174 */ Vec3s jointTable[30];
|
||||
/* 0x228 */ Vec3s morphTable[30];
|
||||
/* 0x2DC */ u16 cueType;
|
||||
|
||||
@@ -73,9 +73,9 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
switch (DEMOSYOTEN_GET_F(&this->actor)) {
|
||||
case DEMOSYOTEN_F_0:
|
||||
func_80183430(&this->unk_144, &object_syoten_Blob_001328, &object_syoten_Blob_00023C, this->unk_174,
|
||||
this->unk_2A6, NULL);
|
||||
func_801835EC(&this->unk_144, &object_syoten_Blob_00023C);
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&object_syoten_Blob_001328,
|
||||
(KeyFrameAnimation*)&object_syoten_Blob_00023C, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayLoop(&this->kfSkelAnime, (KeyFrameAnimation*)&object_syoten_Blob_00023C);
|
||||
this->actor.draw = NULL;
|
||||
this->actionFunc = func_80C16A74;
|
||||
this->actor.child =
|
||||
@@ -131,7 +131,7 @@ void DemoSyoten_Destroy(Actor* thisx, PlayState* play) {
|
||||
DemoSyoten* this = THIS;
|
||||
|
||||
if (DEMOSYOTEN_GET_F(&this->actor) == DEMOSYOTEN_F_0) {
|
||||
func_8018349C(&this->unk_144);
|
||||
Keyframe_DestroyFlex(&this->kfSkelAnime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ void func_80C16A64(DemoSyoten* this, PlayState* play) {
|
||||
void func_80C16A74(DemoSyoten* this, PlayState* play) {
|
||||
u16 cueId;
|
||||
|
||||
func_80183DE0(&this->unk_144);
|
||||
Keyframe_UpdateFlex(&this->kfSkelAnime);
|
||||
if (Cutscene_IsCueInChannel(play, this->cueType)) {
|
||||
if ((play->csCtx.curFrame >= 160) && (play->csCtx.curFrame < 322)) {
|
||||
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_IKANA_SOUL_LV - SFX_FLAG);
|
||||
@@ -436,13 +436,14 @@ void DemoSyoten_Update(Actor* thisx, PlayState* play) {
|
||||
this->actionFunc(this, play);
|
||||
}
|
||||
|
||||
s32 func_80C170F8(PlayState* play, UNK_TYPE arg1, s32 arg2, UNK_TYPE arg3, UNK_TYPE arg4, Actor* thisx) {
|
||||
s32 DemoSyoten_OverrideLimbDraw(PlayState* play, KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
GraphicsContext* gfxCtx = play->state.gfxCtx;
|
||||
DemoSyoten* this = THIS;
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
switch (arg2) {
|
||||
switch (limbIndex) {
|
||||
case 2:
|
||||
gDPPipeSync(POLY_XLU_DISP++);
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 240, 140, (s32)(this->unk_3D8 * 150.0f));
|
||||
@@ -483,16 +484,16 @@ s32 func_80C170F8(PlayState* play, UNK_TYPE arg1, s32 arg2, UNK_TYPE arg3, UNK_T
|
||||
void func_80C173B4(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
DemoSyoten* this = THIS;
|
||||
Mtx* mtx;
|
||||
Mtx* mtxStack;
|
||||
|
||||
AnimatedMat_DrawXlu(play, Lib_SegmentedToVirtual(&object_syoten_Matanimheader_001298));
|
||||
|
||||
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_144.unk_18->unk_1 * sizeof(Mtx));
|
||||
mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (mtxStack != NULL) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
||||
func_8018450C(play, &this->unk_144, mtx, (void*)func_80C170F8, 0, &this->actor);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, DemoSyoten_OverrideLimbDraw, NULL, &this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ typedef enum {
|
||||
|
||||
typedef struct DemoSyoten {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkeletonInfo unk_144;
|
||||
/* 0x174 */ Vec3s unk_174[51];
|
||||
/* 0x2A6 */ Vec3s unk_2A6[51];
|
||||
/* 0x144 */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x174 */ Vec3s jointTable[51];
|
||||
/* 0x2A6 */ Vec3s morphTable[51];
|
||||
/* 0x3D8 */ f32 unk_3D8;
|
||||
/* 0x3DC */ Gfx* unk_3DC;
|
||||
/* 0x3E0 */ AnimatedMaterial* unk_3E0;
|
||||
|
||||
@@ -50,19 +50,19 @@ void EffChange_Init(Actor* thisx, PlayState* play) {
|
||||
EffChange_SetColors(this, EFFCHANGE_GET_COLORS(thisx));
|
||||
Actor_SetScale(&this->actor, 0.075f);
|
||||
this->primColors[3] = 0;
|
||||
func_80183430(&this->skeletonInfo, gameplay_keep_Blob_02900C, gameplay_keep_Blob_0281DC, this->jointTable,
|
||||
this->morphTable, NULL);
|
||||
func_801834A8(&this->skeletonInfo, gameplay_keep_Blob_0281DC);
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&gameplay_keep_Blob_02900C,
|
||||
(KeyFrameAnimation*)&gameplay_keep_Blob_0281DC, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&gameplay_keep_Blob_0281DC);
|
||||
this->step = 0;
|
||||
this->actor.shape.rot.y = 0;
|
||||
this->skeletonInfo.frameCtrl.unk_C = (2.0f / 3.0f);
|
||||
this->kfSkelAnime.frameCtrl.speed = 2.0f / 3.0f;
|
||||
CutsceneManager_Queue(CS_ID_GLOBAL_ELEGY);
|
||||
}
|
||||
|
||||
void EffChange_Destroy(Actor* thisx, PlayState* play) {
|
||||
EffChange* this = THIS;
|
||||
|
||||
func_8018349C(&this->skeletonInfo);
|
||||
Keyframe_DestroyFlex(&this->kfSkelAnime);
|
||||
}
|
||||
|
||||
void EffChange_SetColors(EffChange* this, s32 arg1) {
|
||||
@@ -78,7 +78,7 @@ void EffChange_SetColors(EffChange* this, s32 arg1) {
|
||||
void func_80A4C5CC(EffChange* this, PlayState* play) {
|
||||
f32 phi_fv0;
|
||||
|
||||
if (func_80183DE0(&this->skeletonInfo)) {
|
||||
if (Keyframe_UpdateFlex(&this->kfSkelAnime)) {
|
||||
Actor_Kill(&this->actor);
|
||||
CutsceneManager_Stop(CS_ID_GLOBAL_ELEGY);
|
||||
Environment_AdjustLights(play, 0.0f, 850.0f, 0.2f, 0.0f);
|
||||
@@ -86,13 +86,13 @@ void func_80A4C5CC(EffChange* this, PlayState* play) {
|
||||
}
|
||||
|
||||
this->step++;
|
||||
if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) {
|
||||
if (this->kfSkelAnime.frameCtrl.curTime < 20.0f) {
|
||||
if ((this->primColors[3]) < 242) {
|
||||
this->primColors[3] += 13;
|
||||
} else {
|
||||
this->primColors[3] = 255;
|
||||
}
|
||||
} else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) {
|
||||
} else if (this->kfSkelAnime.frameCtrl.curTime > 70.0f) {
|
||||
if ((this->primColors[3]) >= 14) {
|
||||
this->primColors[3] -= 13;
|
||||
} else {
|
||||
@@ -126,13 +126,13 @@ void EffChange_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
void EffChange_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
Mtx* mtx;
|
||||
Mtx* mtxStack;
|
||||
EffChange* this = THIS;
|
||||
|
||||
AnimatedMat_DrawStepXlu(play, Lib_SegmentedToVirtual(&gameplay_keep_Matanimheader_028FEC), this->step);
|
||||
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
|
||||
mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (mtxStack != NULL) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
Matrix_RotateYS((Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000), MTXMODE_APPLY);
|
||||
|
||||
@@ -141,7 +141,7 @@ void EffChange_Draw(Actor* thisx, PlayState* play) {
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->primColors[0], this->primColors[1], this->primColors[2],
|
||||
this->primColors[3]);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, this->envColors[0], this->envColors[1], this->envColors[2], 255);
|
||||
func_8018450C(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, NULL, NULL, &this->actor);
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ typedef void (*EffChangeActionFunc)(struct EffChange*, PlayState*);
|
||||
|
||||
typedef struct EffChange {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkeletonInfo skeletonInfo;
|
||||
/* 0x174 */ Vec3s jointTable[PINK_DEKU_FLOWER_LIMB_BACK_RIGHT_PETAL];
|
||||
/* 0x198 */ Vec3s morphTable[PINK_DEKU_FLOWER_LIMB_BACK_RIGHT_PETAL];
|
||||
/* 0x144 */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x174 */ Vec3s jointTable[6];
|
||||
/* 0x198 */ Vec3s morphTable[6];
|
||||
/* 0x1BC */ s16 step;
|
||||
/* 0x1BE */ u8 primColors[4];
|
||||
/* 0x1C2 */ u8 envColors[4];
|
||||
|
||||
@@ -35,9 +35,9 @@ void EnFall2_Init(Actor* thisx, PlayState* play) {
|
||||
|
||||
Actor_SetScale(&this->actor, 1.0f);
|
||||
this->actionFunc = EnFall2_DoNothing;
|
||||
func_80183430(&this->skeletonInfo, object_fall2_Blob_008898, object_fall2_Blob_005EF4, this->unk174, this->unk228,
|
||||
NULL);
|
||||
func_801835EC(&this->skeletonInfo, object_fall2_Blob_005EF4);
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&object_fall2_Blob_008898,
|
||||
(KeyFrameAnimation*)&object_fall2_Blob_005EF4, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayLoop(&this->kfSkelAnime, (KeyFrameAnimation*)&object_fall2_Blob_005EF4);
|
||||
this->unk2DC = Lib_SegmentedToVirtual(object_fall2_Matanimheader_008840);
|
||||
Actor_SetScale(&this->actor, 0.02f);
|
||||
this->actionFunc = EnFall2_HandleCutscene;
|
||||
@@ -48,7 +48,7 @@ void EnFall2_Init(Actor* thisx, PlayState* play) {
|
||||
void EnFall2_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnFall2* this = THIS;
|
||||
|
||||
func_8018349C(&this->skeletonInfo);
|
||||
Keyframe_DestroyFlex(&this->kfSkelAnime);
|
||||
}
|
||||
|
||||
static u8 sAlphaTableIndices[] = {
|
||||
@@ -125,7 +125,7 @@ void func_80C1B8F0(EnFall2* this) {
|
||||
}
|
||||
|
||||
void EnFall2_HandleCutscene(EnFall2* this, PlayState* play) {
|
||||
func_80183DE0(&this->skeletonInfo);
|
||||
Keyframe_UpdateFlex(&this->kfSkelAnime);
|
||||
if (Cutscene_IsCueInChannel(play, this->cueType)) {
|
||||
Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType));
|
||||
if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) {
|
||||
@@ -151,18 +151,18 @@ void EnFall2_Update(Actor* thisx, PlayState* play) {
|
||||
void EnFall2_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
EnFall2* this = THIS;
|
||||
Mtx* mtx;
|
||||
Mtx* mtxStack;
|
||||
|
||||
if (!(this->alphaLevel <= 0.0f)) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
AnimatedMat_DrawXlu(play, Lib_SegmentedToVirtual(object_fall2_Matanimheader_008840));
|
||||
|
||||
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
|
||||
mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (mtxStack != NULL) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
Matrix_RotateYS((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000), MTXMODE_APPLY);
|
||||
func_8018450C(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, NULL, NULL, &this->actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ typedef void (*EnFall2ActionFunc)(struct EnFall2*, PlayState*);
|
||||
|
||||
typedef struct EnFall2 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkeletonInfo skeletonInfo;
|
||||
/* 0x174 */ Vec3s unk174[30];
|
||||
/* 0x228 */ Vec3s unk228[30];
|
||||
/* 0x144 */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x174 */ Vec3s jointTable[30];
|
||||
/* 0x228 */ Vec3s morphTable[30];
|
||||
/* 0x2DC */ AnimatedMaterial* unk2DC;
|
||||
/* 0x2E0 */ f32 alphaLevel;
|
||||
/* 0x2E4 */ s16 cueId;
|
||||
|
||||
@@ -186,26 +186,26 @@ void EnTest_Init(Actor* thisx, PlayState* play2) {
|
||||
this->surfaceMaterial = SurfaceType_GetMaterial(&play->colCtx, thisx->floorPoly, bgId);
|
||||
}
|
||||
|
||||
func_80183430(&this->skeletonInfo, &gameplay_keep_Blob_06EB70, &gameplay_keep_Blob_06BB0C, this->unk_178,
|
||||
this->unk_1C0, NULL);
|
||||
func_801834A8(&this->skeletonInfo, &gameplay_keep_Blob_06BB0C);
|
||||
this->skeletonInfo.frameCtrl.unk_10 = 9.0f;
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&gameplay_keep_Blob_06EB70,
|
||||
(KeyFrameAnimation*)&gameplay_keep_Blob_06BB0C, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&gameplay_keep_Blob_06BB0C);
|
||||
this->kfSkelAnime.frameCtrl.curTime = 9.0f;
|
||||
func_80862B70(this->unk_20C);
|
||||
}
|
||||
|
||||
void EnTest_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnTest* this = THIS;
|
||||
|
||||
func_8018349C(&this->skeletonInfo);
|
||||
Keyframe_DestroyFlex(&this->kfSkelAnime);
|
||||
}
|
||||
|
||||
void EnTest_Update(Actor* thisx, PlayState* play) {
|
||||
EnTest* this = THIS;
|
||||
s32 i;
|
||||
|
||||
this->unk_208 = this->skeletonInfo.frameCtrl.unk_10;
|
||||
this->unk_208 = this->kfSkelAnime.frameCtrl.curTime;
|
||||
|
||||
if (func_80183DE0(&this->skeletonInfo) && (this->actor.parent == NULL) && (this->actor.params != -1)) {
|
||||
if (Keyframe_UpdateFlex(&this->kfSkelAnime) && (this->actor.parent == NULL) && (this->actor.params != -1)) {
|
||||
this->unk_209++;
|
||||
if (this->unk_209 > 20) {
|
||||
Actor_Kill(&this->actor);
|
||||
@@ -224,8 +224,8 @@ void EnTest_Update(Actor* thisx, PlayState* play) {
|
||||
func_80862EDC(this->unk_20C);
|
||||
}
|
||||
|
||||
s32 EnTest_OverrideKeyframeDraw(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
Actor* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
s32 EnTest_OverrideLimbDraw(PlayState* play, KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
EnTest* this = THIS;
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
@@ -250,7 +250,7 @@ s32 EnTest_OverrideKeyframeDraw(PlayState* play, SkeletonInfo* skeletonInfo, s32
|
||||
|
||||
void EnTest_Draw(Actor* thisx, PlayState* play) {
|
||||
EnTest* this = THIS;
|
||||
Mtx* mtx;
|
||||
Mtx* mtxStack;
|
||||
s32 sp2C = this->unk_208 - 1;
|
||||
|
||||
if (sp2C >= 29) {
|
||||
@@ -264,11 +264,11 @@ void EnTest_Draw(Actor* thisx, PlayState* play) {
|
||||
AnimatedMat_DrawStep(play, Lib_SegmentedToVirtual(gameplay_keep_Matanimheader_06B6A0), sp2C);
|
||||
}
|
||||
|
||||
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
|
||||
mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx != NULL) {
|
||||
if (mtxStack != NULL) {
|
||||
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
|
||||
func_8018450C(play, &this->skeletonInfo, mtx, EnTest_OverrideKeyframeDraw, NULL, thisx);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, EnTest_OverrideLimbDraw, NULL, thisx);
|
||||
func_80863048(play, this->unk_20C);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ typedef struct {
|
||||
|
||||
typedef struct EnTest {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkeletonInfo skeletonInfo;
|
||||
/* 0x144 */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x174 */ s32 unk_174;
|
||||
/* 0x178 */ Vec3s unk_178[12];
|
||||
/* 0x1C0 */ Vec3s unk_1C0[12];
|
||||
/* 0x178 */ Vec3s jointTable[12];
|
||||
/* 0x1C0 */ Vec3s morphTable[12];
|
||||
/* 0x208 */ u8 unk_208;
|
||||
/* 0x209 */ u8 unk_209;
|
||||
/* 0x20A */ u8 surfaceMaterial;
|
||||
|
||||
@@ -383,9 +383,9 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
|
||||
this->playerScaleZ = player->actor.scale.z;
|
||||
|
||||
// Keyframe animations
|
||||
func_80183430(&this->skeletonInfo, &gameplay_keep_Blob_085640, &gameplay_keep_Blob_083534, this->unk_18FC,
|
||||
this->unk_1BA8, NULL);
|
||||
func_801834A8(&this->skeletonInfo, &gameplay_keep_Blob_083534);
|
||||
Keyframe_InitFlex(&this->kfSkelAnime, (KeyFrameFlexSkeleton*)&gameplay_keep_Blob_085640,
|
||||
(KeyFrameAnimation*)&gameplay_keep_Blob_083534, this->jointTable, this->morphTable, NULL);
|
||||
Keyframe_FlexPlayOnce(&this->kfSkelAnime, (KeyFrameAnimation*)&gameplay_keep_Blob_083534);
|
||||
|
||||
EnTest7_InitFeathers(this->feathers);
|
||||
EnTest7_InitWindCapsule(&this->windCapsule);
|
||||
@@ -482,20 +482,20 @@ void EnTest7_UpdateGrowingWindCapsule(EnTest7* this, PlayState* play) {
|
||||
void EnTest7_WarpCsPart2(EnTest7* this, PlayState* play) {
|
||||
Vec3f featherPos;
|
||||
|
||||
if (func_80183DE0(&this->skeletonInfo)) {
|
||||
if (Keyframe_UpdateFlex(&this->kfSkelAnime)) {
|
||||
EnTest7_SetupAction(this, EnTest7_WarpCsPart3);
|
||||
}
|
||||
|
||||
if (this->skeletonInfo.frameCtrl.unk_10 > 60.0f) {
|
||||
if (this->kfSkelAnime.frameCtrl.curTime > 60.0f) {
|
||||
EnTest7_UpdateGrowingWindCapsule(this, play);
|
||||
}
|
||||
|
||||
if ((this->skeletonInfo.frameCtrl.unk_10 > 20.0f) && !(this->flags & OWL_WARP_FLAGS_40)) {
|
||||
if ((this->kfSkelAnime.frameCtrl.curTime > 20.0f) && !(this->flags & OWL_WARP_FLAGS_40)) {
|
||||
this->flags |= OWL_WARP_FLAGS_40;
|
||||
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_CLOSE);
|
||||
}
|
||||
|
||||
if (this->skeletonInfo.frameCtrl.unk_10 > 42.0f) {
|
||||
if (this->kfSkelAnime.frameCtrl.curTime > 42.0f) {
|
||||
if (!(this->flags & OWL_WARP_FLAGS_80)) {
|
||||
this->flags |= OWL_WARP_FLAGS_80;
|
||||
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_ROLL);
|
||||
@@ -538,7 +538,7 @@ void EnTest7_WarpCsPart3(EnTest7* this, PlayState* play) {
|
||||
|
||||
Math_Vec3f_Copy(&featherPos, &this->actor.world.pos);
|
||||
EnTest7_AddAndChooseFeather(this->feathers, &featherPos, true);
|
||||
this->unk_18FC[1].y += 0x2EE0;
|
||||
this->jointTable[1].y += 0x2EE0;
|
||||
}
|
||||
|
||||
void EnTest7_WarpCsPart4(EnTest7* this, PlayState* play) {
|
||||
@@ -953,8 +953,8 @@ void EnTest7_Update(Actor* thisx, PlayState* play) {
|
||||
(this->flags & OWL_WARP_FLAGS_10) != 0);
|
||||
}
|
||||
|
||||
s32 func_80AF31D0(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
|
||||
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
s32 EnTest7_OverrideLimbDraw(PlayState* play, KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex, Gfx** dList, u8* flags,
|
||||
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
|
||||
EnTest7* this = THIS;
|
||||
Vec3f featherPos;
|
||||
|
||||
@@ -972,12 +972,12 @@ void EnTest7_Draw(Actor* thisx, PlayState* play) {
|
||||
|
||||
// Draw wings
|
||||
if (this->flags & OWL_WARP_FLAGS_DRAW_WINGS) {
|
||||
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
|
||||
Mtx* mtxStack = GRAPH_ALLOC(play->state.gfxCtx, this->kfSkelAnime.skeleton->dListCount * sizeof(Mtx));
|
||||
|
||||
if (mtx == NULL) {
|
||||
if (mtxStack == NULL) {
|
||||
return;
|
||||
}
|
||||
func_8018450C(play, &this->skeletonInfo, mtx, func_80AF31D0, NULL, &this->actor);
|
||||
Keyframe_DrawFlex(play, &this->kfSkelAnime, mtxStack, EnTest7_OverrideLimbDraw, NULL, &this->actor);
|
||||
}
|
||||
|
||||
// Draw windCapsule encasing that surrounds player after wings
|
||||
|
||||
@@ -53,9 +53,9 @@ typedef struct EnTest7 {
|
||||
/* 0x0144 */ s32 flags;
|
||||
/* 0x0148 */ OwlWarpWindCapsule windCapsule;
|
||||
/* 0x015C */ OwlWarpFeather feathers[OWL_WARP_NUM_FEATHERS];
|
||||
/* 0x18CC */ SkeletonInfo skeletonInfo; // wingsSkeletonInfo
|
||||
/* 0x18FC */ Vec3s unk_18FC[114]; // wingsFrameData
|
||||
/* 0x1BA8 */ Vec3s unk_1BA8[114];
|
||||
/* 0x18CC */ KFSkelAnimeFlex kfSkelAnime;
|
||||
/* 0x18FC */ Vec3s jointTable[114];
|
||||
/* 0x1BA8 */ Vec3s morphTable[114];
|
||||
/* 0x1E54 */ s32 timer;
|
||||
/* 0x1E58 */ EnTest7ActionFunc actionFunc;
|
||||
/* 0x1E5C */ EnTest7PlayerCamFunc playerCamFunc;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* Front
|
||||
*
|
||||
*/
|
||||
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "z_obj_takaraya_wall.h"
|
||||
#include "objects/object_takaraya_objects/object_takaraya_objects.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user