1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-22 06:52:03 +00:00

PlayState Rename (#1231)

* global context -> play

* fix PlayState* PlayState
This commit is contained in:
fig02 2022-05-21 14:23:43 -04:00 committed by GitHub
parent 154f44b6da
commit 2e6279bc8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
912 changed files with 40489 additions and 41078 deletions

View file

@ -10,11 +10,11 @@
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3)
void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx);
void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx);
void EnHs2_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80A6F1A4(EnHs2* this, GlobalContext* globalCtx);
void EnHs2_Init(Actor* thisx, PlayState* play);
void EnHs2_Destroy(Actor* thisx, PlayState* play);
void EnHs2_Update(Actor* thisx, PlayState* play);
void EnHs2_Draw(Actor* thisx, PlayState* play);
void func_80A6F1A4(EnHs2* this, PlayState* play);
const ActorInit En_Hs2_InitVars = {
ACTOR_EN_HS2,
@ -48,16 +48,16 @@ static ColliderCylinderInit sCylinderInit = {
{ 40, 40, 0, { 0, 0, 0 } },
};
void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnHs2_Init(Actor* thisx, PlayState* play) {
EnHs2* this = (EnHs2*)thisx;
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable,
SkelAnime_InitFlex(play, &this->skelAnime, &object_hs_Skel_006260, &object_hs_Anim_0005C0, this->jointTable,
this->morphTable, 16);
Animation_PlayLoop(&this->skelAnime, &object_hs_Anim_0005C0);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(子人の時) \n" VT_RST);
@ -66,14 +66,14 @@ void EnHs2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 6;
}
void EnHs2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnHs2_Destroy(Actor* thisx, PlayState* play) {
EnHs2* this = (EnHs2*)thisx;
Collider_DestroyCylinder(globalCtx, &this->collider);
Collider_DestroyCylinder(play, &this->collider);
}
s32 func_80A6F0B4(EnHs2* this, GlobalContext* globalCtx, u16 textId, EnHs2ActionFunc actionFunc) {
if (Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
s32 func_80A6F0B4(EnHs2* this, PlayState* play, u16 textId, EnHs2ActionFunc actionFunc) {
if (Actor_ProcessTalkRequest(&this->actor, play)) {
this->actionFunc = actionFunc;
return 1;
}
@ -82,43 +82,43 @@ s32 func_80A6F0B4(EnHs2* this, GlobalContext* globalCtx, u16 textId, EnHs2Action
if (ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x2151 &&
this->actor.xzDistToPlayer < 100.0f) {
this->unk_2A8 |= 0x1;
func_8002F2CC(&this->actor, globalCtx, 100.0f);
func_8002F2CC(&this->actor, play, 100.0f);
}
return 0;
}
void func_80A6F164(EnHs2* this, GlobalContext* globalCtx) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
void func_80A6F164(EnHs2* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actionFunc = func_80A6F1A4;
}
this->unk_2A8 |= 0x1;
}
void func_80A6F1A4(EnHs2* this, GlobalContext* globalCtx) {
void func_80A6F1A4(EnHs2* this, PlayState* play) {
u16 textId;
textId = Text_GetFaceReaction(globalCtx, 9);
textId = Text_GetFaceReaction(play, 9);
if (textId == 0) {
textId = 0x5069;
}
func_80A6F0B4(this, globalCtx, textId, func_80A6F164);
func_80A6F0B4(this, play, textId, func_80A6F164);
}
void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnHs2_Update(Actor* thisx, PlayState* play) {
EnHs2* this = (EnHs2*)thisx;
s32 pad;
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
Actor_MoveForward(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
if (SkelAnime_Update(&this->skelAnime) != 0) {
this->skelAnime.curFrame = 0.0f;
}
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
if (this->unk_2A8 & 0x1) {
func_80038290(globalCtx, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos);
func_80038290(play, &this->actor, &this->unk_29C, &this->unk_2A2, this->actor.focus.pos);
this->unk_2A8 &= ~1;
} else {
Math_SmoothStepToS(&this->unk_29C.x, 12800, 6, 6200, 100);
@ -128,7 +128,7 @@ void EnHs2_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
s32 EnHs2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
s32 EnHs2_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
EnHs2* this = (EnHs2*)thisx;
switch (limbIndex) {
@ -150,7 +150,7 @@ s32 EnHs2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
return false;
}
void EnHs2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
void EnHs2_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
static Vec3f D_80A6F4CC = { 300.0f, 1000.0f, 0.0f };
EnHs2* this = (EnHs2*)thisx;
@ -159,10 +159,10 @@ void EnHs2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
}
void EnHs2_Draw(Actor* thisx, GlobalContext* globalCtx) {
void EnHs2_Draw(Actor* thisx, PlayState* play) {
EnHs2* this = (EnHs2*)thisx;
func_800943C8(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
func_800943C8(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnHs2_OverrideLimbDraw, EnHs2_PostLimbDraw, this);
}

View file

@ -6,7 +6,7 @@
struct EnHs2;
typedef void (*EnHs2ActionFunc)(struct EnHs2*, GlobalContext*);
typedef void (*EnHs2ActionFunc)(struct EnHs2*, PlayState*);
typedef struct EnHs2 {
/* 0x0000 */ Actor actor;