1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +00:00

More actor cleanup Part 2 (#116)

* Change all main actor functions to take a 'Actor* thisx' argument

* Change all actor callbacks to also take a 'Actor* thisx' argument
This commit is contained in:
Roman971 2020-05-04 21:02:51 +02:00 committed by GitHub
parent 8efddb0fe0
commit f114df8929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
429 changed files with 3689 additions and 2523 deletions

View file

@ -8,10 +8,12 @@
#define FLAGS 0x00000009
void EnDs_Init(EnDs* this, GlobalContext* globalCtx);
void EnDs_Destroy(EnDs* this, GlobalContext* globalCtx);
void EnDs_Update(EnDs* this, GlobalContext* globalCtx);
void EnDs_Draw(EnDs* this, GlobalContext* globalCtx);
#define THIS ((EnDs*)thisx)
void EnDs_Init(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Update(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnDs_Talk(EnDs* this, GlobalContext* globalCtx);
void EnDs_TalkNoEmptyBottle(EnDs* this, GlobalContext* globalCtx);
@ -28,9 +30,6 @@ void EnDs_GiveBluePotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_OfferBluePotion(EnDs* this, GlobalContext* globalCtx);
void EnDs_Wait(EnDs* this, GlobalContext* globalCtx);
UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnDs* this);
void func_809FDA7C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* this);
const ActorInit En_Ds_InitVars = {
ACTOR_EN_DS,
ACTORTYPE_NPC,
@ -48,11 +47,11 @@ extern AnimationHeader D_0600039C;
Vec3f mtxSrc = { 1100.0f, 500.0f, 0.0f };
void EnDs_Init(EnDs* this, GlobalContext* globalCtx) {
SkelAnime* skelAnime = &this->skelAnime;
void EnDs_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDs* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 36.0f);
SkelAnime_InitSV(globalCtx, skelAnime, &D_06004768, &D_0600039C, &this->limbDrawTable, &this->unk_1B4, 6);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06004768, &D_0600039C, &this->limbDrawTable, &this->unk_1B4, 6);
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600039C);
this->actor.colChkInfo.mass = 0xFF;
@ -66,7 +65,7 @@ void EnDs_Init(EnDs* this, GlobalContext* globalCtx) {
this->unk_1E4 = 0.0f;
}
void EnDs_Destroy(EnDs* this, GlobalContext* globalCtx) {
void EnDs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnDs_Talk(EnDs* this, GlobalContext* globalCtx) {
@ -251,7 +250,9 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
}
}
void EnDs_Update(EnDs* this, GlobalContext* globalCtx) {
void EnDs_Update(Actor* thisx, GlobalContext* globalCtx) {
EnDs* this = THIS;
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
this->skelAnime.animCurrentFrame = 0.0f;
}
@ -268,8 +269,8 @@ void EnDs_Update(EnDs* this, GlobalContext* globalCtx) {
}
}
UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnDs* this) {
EnDs* enDs = this;
s32 EnDs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnDs* this = THIS;
if (limbIndex == 5) {
rot->x += this->unk_1D8.y;
@ -278,14 +279,16 @@ UNK_TYPE func_809FDA38(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
return 0;
}
void func_809FDA7C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
void EnDs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
if (limbIndex == 5) {
Matrix_MultVec3f(&mtxSrc, &actor->posRot2.pos);
Matrix_MultVec3f(&mtxSrc, &thisx->posRot2.pos);
}
}
void EnDs_Draw(EnDs* this, GlobalContext* globalCtx) {
void EnDs_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnDs* this = THIS;
func_800943C8(globalCtx->state.gfxCtx);
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
&func_809FDA38, &func_809FDA7C, this);
EnDs_OverrideLimbDraw, EnDs_PostLimbDraw, this);
}