SubS Skelanime functions (#572)

* Bring code over

* Change ActorDraw typedefs from actor to thisx

* Rename functions

* Format

* Rename and clean up limb draws

* Some more limb draw cleanup

* Some more cleanup

* Function comments

* Last bit of cleanup

* update tutorial

* More tutorial and format

* Remove extra newlines form actorfixer

* Missed one

* Remove some unnecessary casts

* Fix SkelAnime transform functions in functions.h

* Remove bug comments, and add note

* Remove some more unneeded casts and rename one variable

* format

* Fix merge

* Format
This commit is contained in:
Derek Hensley
2022-01-16 20:14:34 +00:00
committed by GitHub
parent a9c2449c11
commit aa90d1ee2b
53 changed files with 411 additions and 271 deletions
+2 -2
View File
@@ -262,7 +262,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -273,7 +273,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
(We can delete the `GLOBAL_ASM` lines now.)
The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_UnkLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_TransformLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
```
$ ./tools/rename_global_asm.py
asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C10558.s --> asm/non_matchings/overlays/ovl_En_Recepgirl/EnRecepgirl_OverrideLimbDraw.s
+12 -12
View File
@@ -34,7 +34,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
sp30->polyOpa.p = temp_v1 + 8;
temp_v1->words.w0 = 0xDB060020;
temp_v1->words.w1 = (u32) D_80C106B0[this->unk_2AC];
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
}
```
@@ -107,7 +107,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -115,28 +115,28 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
And this matches.
The last two functions in the actor are used as arguments in `func_801343C0`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
The last two functions in the actor are used as arguments in `SkelAnime_DrawTransformFlexOpa`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
```C
void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkDraw, Actor* actor)
void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor)
```
The typedefs of the callbacks it uses are in `z64animation.h`:
```C
typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* thisx);
typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor);
typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* thisx);
[...]
typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
```
which is where mips2c got them from.
In this case, only two of them are used, and it is these that are the last functions standing between us and a decompiled actor.
## OverrideLimbDraw, PostLimbDraw, UnkActorDraw
## OverrideLimbDraw, PostLimbDraw, TransformLimbDraw
Well, we don't have a PostLimbDraw here, but as we see from the prototype, it's much the same as the OverrideLimbDraw but without the `pos` argument and no return value.
```C
@@ -159,7 +159,7 @@ s32 func_80C10558(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *p
}
```
As for the UnkActorDraw, it has a much simpler prototype. mips2c gives
As for the TransformLimbDraw, it has a much simpler prototype. mips2c gives
```C
void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *actor) {
if (limbIndex == 5) {
+4 -4
View File
@@ -2375,8 +2375,8 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, Mtx** limbMatricies);
void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor, Mtx** mtx);
void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor);
void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx);
void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor);
void SkelAnime_GetFrameData(AnimationHeader* animationSeg, s32 currentFrame, s32 limbCount, Vec3s* dst);
s16 Animation_GetLength(void* animation);
s16 Animation_GetLastFrame(void* animation);
@@ -2504,8 +2504,8 @@ u32 func_8013A4C4(s32 flag);
s16 func_8013A504(s16 val);
s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, Vec3s* rot, f32 distanceMin, f32 distanceMax, s16 angleError);
struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5);
Gfx* func_8013A860(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* func_8013AB00(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Gfx* gfx);
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx);
s32 func_8013AD6C(GlobalContext* globalCtx);
s32 func_8013AD9C(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5);
void func_8013AED4(u16* arg0, u16 arg1, u16 arg2);
-1
View File
@@ -18,7 +18,6 @@ struct Lights;
struct CollisionPoly;
struct EnBox;
struct EnDoor;
typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* globalCtx);
+8 -8
View File
@@ -204,26 +204,26 @@ typedef struct SkelAnime {
} SkelAnime; // size = 0x44
typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor, Gfx** gfx);
struct Actor* thisx, Gfx** gfx);
typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
struct Actor* actor, Gfx** gfx);
struct Actor* thisx, Gfx** gfx);
typedef s32 (*OverrideLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*PostLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList1, Gfx** dList2, Vec3s* rot,
struct Actor* actor);
struct Actor* thisx);
typedef void (*UnkActorDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor, Gfx** gfx);
typedef void (*TransformLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx, Gfx** gfx);
typedef void (*AnimationEntryCallback)(struct GlobalContext*, AnimationEntryData*);
+39 -31
View File
@@ -35,7 +35,7 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
OPEN_DISPS(globalCtx->state.gfxCtx);
Matrix_StatePush();
limb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -94,7 +94,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
Matrix_StatePush();
rootLimb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[0]);
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
pos.z = jointTable[0].z;
@@ -146,7 +146,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
Matrix_StatePush();
limb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -203,7 +203,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
Mtx* mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
if (skeleton == NULL) {
return;
@@ -214,7 +214,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
Matrix_StatePush();
rootLimb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[0]);
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
pos.z = jointTable[0].z;
@@ -266,7 +266,7 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
Matrix_StatePush();
limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
pos.x = limb->jointPos.x;
@@ -421,7 +421,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
Mtx* mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
if (skeleton == NULL) {
return;
@@ -473,9 +473,9 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw,
Actor* actor, Mtx** mtx) {
void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx) {
StandardLimb* limb;
Gfx* newDList;
Gfx* limbDList;
@@ -486,7 +486,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
Matrix_StatePush();
limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -500,8 +500,8 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
//! @bug Does not check unkDraw is not NULL before calling it.
unkDraw(globalCtx, limbIndex, actor);
transformLimbDraw(globalCtx, limbIndex, actor);
if (newDList != NULL) {
Gfx* polyTemp = POLY_OPA_DISP;
@@ -523,23 +523,32 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
}
if (limb->child != LIMB_DONE) {
func_80134148(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
mtx);
SkelAnime_DrawTransformFlexLimbOpa(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, mtx);
}
Matrix_StatePop();
if (limb->sibling != LIMB_DONE) {
func_80134148(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
mtx);
SkelAnime_DrawTransformFlexLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw,
postLimbDraw, transformLimbDraw, actor, mtx);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw,
Actor* actor) {
/**
* Draw all limbs of type `StandardLimb` in a given flexible skeleton to the polyOpa buffer
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
*
* Also makes use of a `TransformLimbDraw`, which transforms limbs based on world coordinates, as opposed to local limb
* coordinates.
* Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
*/
void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
TransformLimbDrawOpa transformLimbDraw, Actor* actor) {
StandardLimb* rootLimb;
s32 pad;
Gfx* newDList;
@@ -554,13 +563,13 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
OPEN_DISPS(globalCtx->state.gfxCtx);
mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
Matrix_StatePush();
rootLimb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
@@ -573,8 +582,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
//! @bug Does not check unkDraw is not NULL before calling it.
unkDraw(globalCtx, 1, actor);
transformLimbDraw(globalCtx, 1, actor);
if (newDList != NULL) {
Gfx* polyTemp = POLY_OPA_DISP;
@@ -596,8 +604,8 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
}
if (rootLimb->child != LIMB_DONE) {
func_80134148(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
&mtx);
SkelAnime_DrawTransformFlexLimbOpa(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw,
postLimbDraw, transformLimbDraw, actor, &mtx);
}
Matrix_StatePop();
@@ -655,7 +663,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
Matrix_StatePush();
limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -711,7 +719,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
Matrix_StatePush();
rootLimb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
@@ -758,7 +766,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
Matrix_StatePush();
limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -821,7 +829,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
return NULL;
}
mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
gSPSegment(gfx++, 0x0D, mtx);
@@ -994,7 +1002,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMATION_LINKANIMETION);
if (entry != NULL) {
LinkAnimationHeader* linkAnimHeader = (LinkAnimationHeader*)Lib_SegmentedToVirtual(animation);
LinkAnimationHeader* linkAnimHeader = Lib_SegmentedToVirtual(animation);
u32 ram = frameTable;
osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);
+112 -2
View File
@@ -36,9 +36,119 @@ EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
return door;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013A860.s")
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx) {
StandardLimb* limb;
Gfx* newDList;
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AB00.s")
Matrix_StatePush();
limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
pos.x = limb->jointPos.x;
pos.y = limb->jointPos.y;
pos.z = limb->jointPos.z;
newDList = limbDList = limb->dList;
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor, &gfx)) {
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
transformLimbDraw(globalCtx, limbIndex, actor, &gfx);
if (newDList != NULL) {
Matrix_ToMtx(*mtx);
gSPMatrix(gfx++, *mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, newDList);
(*mtx)++;
} else if (limbDList != NULL) {
Matrix_ToMtx(*mtx);
(*mtx)++;
}
Matrix_StatePop();
}
if (postLimbDraw != NULL) {
postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, actor, &gfx);
}
if (limb->child != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, mtx, gfx);
}
Matrix_StatePop();
if (limb->sibling != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
transformLimbDraw, actor, mtx, gfx);
}
return gfx;
}
/**
* Draw all limbs of type `StandardLimb` in a given flexible skeleton
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
*
* Also makes use of a `TransformLimbDraw`, which transforms limbs based on world coordinates, as opposed to local limb
* coordinates.
* Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
*/
Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx) {
StandardLimb* rootLimb;
s32 pad;
Gfx* newDlist;
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(dListCount * sizeof(Mtx)));
if (skeleton == NULL) {
return NULL;
}
gSPSegment(gfx++, 0x0D, mtx);
Matrix_StatePush();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable->x;
pos.y = jointTable->y;
pos.z = jointTable->z;
rot = jointTable[1];
newDlist = rootLimb->dList;
limbDList = rootLimb->dList;
if (overrideLimbDraw == NULL || !overrideLimbDraw(globalCtx, 1, &newDlist, &pos, &rot, actor, &gfx)) {
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
transformLimbDraw(globalCtx, 1, actor, &gfx);
if (newDlist != NULL) {
Matrix_ToMtx(mtx);
gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfx++, newDlist);
mtx++;
} else if (limbDList != NULL) {
Matrix_ToMtx(mtx);
mtx++;
}
Matrix_StatePop();
}
if (postLimbDraw != NULL) {
postLimbDraw(globalCtx, 1, &limbDList, &rot, actor, &gfx);
}
if (rootLimb->child != LIMB_DONE) {
gfx = SubS_DrawTransformFlexLimb(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw,
postLimbDraw, transformLimbDraw, actor, &mtx, gfx);
}
Matrix_StatePop();
return gfx;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AD6C.s")
+3 -3
View File
@@ -91,13 +91,13 @@ void DmNb_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
}
void DmNb_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void DmNb_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void DmNb_Draw(Actor* thisx, GlobalContext* globalCtx) {
DmNb* this = THIS;
func_8012C5B0(globalCtx->state.gfxCtx);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
NULL, DmNb_UnkActorDraw, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, NULL, DmNb_TransformLimbDraw, &this->actor);
}
+7 -6
View File
@@ -74,14 +74,14 @@ void DmSa_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
s32 func_80A2EB10(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
return 0;
s32 DmSa_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
return false;
}
void func_80A2EB2C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
void DmSa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
void func_80A2EB44(GlobalContext* globalCtx, s32 limbIndex, Actor* actor) {
void DmSa_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
Gfx* func_80A2EB58(GraphicsContext* gfxCtx, u32 alpha) {
@@ -120,8 +120,9 @@ void DmSa_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x0C, func_80A2EBB0(globalCtx->state.gfxCtx, this->alpha));
}
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80A2EB10, func_80A2EB2C, func_80A2EB44, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, DmSa_OverrideLimbDraw, DmSa_PostLimbDraw,
DmSa_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1670,13 +1670,13 @@ s32 EnAkindonuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
*dList = object_dnt_DL_008290;
}
}
return 0;
return false;
}
void EnAkindonuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
void EnAkindonuts_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnAkindonuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnAkindonuts* this = THIS;
if (((this->unk_33E == 1) || (this->unk_33E == 2)) && ((limbIndex == 23) || (limbIndex == 24))) {
@@ -1696,6 +1696,7 @@ void EnAkindonuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnAkindonuts* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnAkindonuts_OverrideLimbDraw, EnAkindonuts_PostLimbDraw, EnAkindonuts_UnkActorDraw, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnAkindonuts_OverrideLimbDraw, EnAkindonuts_PostLimbDraw,
EnAkindonuts_TransformLimbDraw, &this->actor);
}
@@ -979,7 +979,7 @@ void EnAob01_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 EnAob01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) {
EnAob01* this = THIS;
UNK_TYPE sp38[] = {
TexturePtr sp38[] = {
&object_aob_Tex_000658,
&object_aob_Tex_000E58,
&object_aob_Tex_001658,
@@ -1023,7 +1023,7 @@ void EnAob01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
}
void EnAob01_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnAob01_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnAob01_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -1040,8 +1040,9 @@ void EnAob01_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 50, 80, 0, 0));
gDPPipeSync(POLY_OPA_DISP++);
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnAob01_OverrideLimbDraw, EnAob01_PostLimbDraw, EnAob01_UnkDraw, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnAob01_OverrideLimbDraw, EnAob01_PostLimbDraw,
EnAob01_TransformLimbDraw, &this->actor);
if (this->actor.draw != NULL) {
func_8012C2DC(globalCtx->state.gfxCtx);
@@ -1223,19 +1223,19 @@ void EnBigpo_UpdateFire(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
s32 EnBigpo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor,
s32 EnBigpo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
Gfx** gfx) {
EnBigpo* this = (EnBigpo*)actor;
EnBigpo* this = THIS;
// not fully invisible
if (!(this->mainColor.a != 0 && limbIndex != 7) ||
(this->actionFunc == EnBigpo_BurnAwayDeath && this->idleTimer >= 2)) {
*dList = NULL;
}
return 0;
return false;
}
void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor, Gfx** gfx) {
EnBigpo* this = (EnBigpo*)actor;
void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
EnBigpo* this = THIS;
s8 limbByte;
Vec3f* v1ptr; // todo: figure out better names
Vec3f* v2ptr;
@@ -26,8 +26,9 @@ void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx);
void func_809CD70C(EnBji01* this, GlobalContext* globalCtx);
void func_809CD77C(EnBji01* this, GlobalContext* globalCtx);
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg);
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg);
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx);
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
extern AnimationHeader D_06000FDC;
extern AnimationHeader D_06005B58;
@@ -441,7 +442,7 @@ void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx) {
static void* sEyeTextures[] = { D_060049F0, D_06004E70, D_06005270 };
static TexturePtr sEyeTextures[] = { D_060049F0, D_06004E70, D_06005270 };
EnBji01* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
+15 -15
View File
@@ -582,8 +582,8 @@ void EnDai_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
s32 func_80B3F598(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
Gfx** gfx) {
s32 EnDai_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
Gfx** gfx) {
EnDai* this = THIS;
if (!(this->unk_1CE & 0x40)) {
@@ -598,10 +598,10 @@ s32 func_80B3F598(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
*dList = NULL;
}
return 0;
return false;
}
void func_80B3F614(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
void EnDai_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static Vec3f D_80B3FE4C = { 0.0f, 0.0f, 0.0f };
EnDai* this = THIS;
@@ -626,10 +626,10 @@ void func_80B3F614(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
}
void func_80B3F6EC(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx) {
void EnDai_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx, Gfx** gfx) {
EnDai* this = THIS;
switch (arg1) {
switch (limbIndex) {
case 9:
if (this->unk_1CE & 0x100) {
func_80B3EC84(this);
@@ -669,9 +669,9 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE58[this->unk_1D6]));
POLY_XLU_DISP =
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
POLY_XLU_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
if (this->unk_1CE & 0x40) {
Matrix_SetCurrentState(&this->unk_18C);
@@ -701,9 +701,9 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
POLY_OPA_DISP =
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_OPA_DISP);
POLY_OPA_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
EnDai_TransformLimbDraw, &this->actor, POLY_OPA_DISP);
Matrix_SetCurrentState(&this->unk_18C);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -720,9 +720,9 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1CD);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
POLY_XLU_DISP =
func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
POLY_XLU_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
Matrix_SetCurrentState(&this->unk_18C);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -296,7 +296,8 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
s32 func_80943E18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
s32 EnDaiku_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) {
EnDaiku* this = THIS;
if (limbIndex == 15) {
@@ -304,10 +305,10 @@ s32 func_80943E18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
rot->z += this->unk_25E;
}
return 0;
return false;
}
void func_80943E60(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Gfx* D_809440D4[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70 };
EnDaiku* this = THIS;
@@ -354,7 +355,7 @@ void EnDaiku_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_80943E18, func_80943E60, &this->actor);
EnDaiku_OverrideLimbDraw, EnDaiku_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -671,7 +671,8 @@ void EnDekunuts_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
s32 func_808BEBD0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
s32 EnDekunuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) {
EnDekunuts* this = THIS;
f32 arg1, arg2, arg3;
f32 currentFrame;
@@ -700,10 +701,10 @@ s32 func_808BEBD0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
rot->z = this->actor.world.rot.x;
}
}
return 0;
return false;
}
void func_808BED30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
void EnDekunuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static s8 D_808BEF98[] = {
-1, -1, -1, 3, -1, 0, -1, 1, -1, 2, 0, 0,
};
@@ -739,8 +740,8 @@ void func_808BED30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnDekunuts* this = THIS;
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, func_808BEBD0, func_808BED30,
&this->actor);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDekunuts_OverrideLimbDraw,
EnDekunuts_PostLimbDraw, &this->actor);
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
&this->actor.home.rot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+4 -4
View File
@@ -1174,11 +1174,11 @@ void EnDg_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
s32 func_8098BFB8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
return 0;
s32 EnDg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
return false;
}
void func_8098BFD4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
void EnDg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnDg* this = THIS;
Vec3f sp20 = { 0.0f, 20.0f, 0.0f };
@@ -1231,7 +1231,7 @@ void EnDg_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_8098BFB8, func_8098BFD4, &this->actor);
EnDg_OverrideLimbDraw, EnDg_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
+5 -4
View File
@@ -456,10 +456,10 @@ s32 func_80B3D974(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
return 1;
}
void func_80B3DA88(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
void EnDnp_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
void func_80B3DAA0(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnDnp_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnDnp* this = THIS;
s32 phi_v1 = 1;
s32 phi_v0;
@@ -504,8 +504,9 @@ void EnDnp_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3DEAC[this->unk_336]));
func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
func_80B3DA88, func_80B3DAA0, &this->actor);
SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, NULL, EnDnp_PostLimbDraw, EnDnp_TransformLimbDraw,
&this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -99,7 +99,7 @@ void EnEndingHero_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C1E984[index]));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
0, 0, &this->actor);
NULL, NULL, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -71,5 +71,5 @@ void EnEndingHero2_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
0, 0, &this->actor);
NULL, NULL, &this->actor);
}

Some files were not shown because too many files have changed in this diff Show More