mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-20 22:11:16 +00:00
PlayState Rename (#1231)
* global context -> play * fix PlayState* PlayState
This commit is contained in:
parent
154f44b6da
commit
2e6279bc8e
912 changed files with 40489 additions and 41078 deletions
|
@ -14,13 +14,13 @@
|
|||
|
||||
#define FLAGS ACTOR_FLAG_4
|
||||
|
||||
void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNutsball_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnNutsball_Init(Actor* thisx, PlayState* play);
|
||||
void EnNutsball_Destroy(Actor* thisx, PlayState* play);
|
||||
void EnNutsball_Update(Actor* thisx, PlayState* play);
|
||||
void EnNutsball_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx);
|
||||
void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx);
|
||||
void func_80ABBB34(EnNutsball* this, PlayState* play);
|
||||
void func_80ABBBA8(EnNutsball* this, PlayState* play);
|
||||
|
||||
const ActorInit En_Nutsball_InitVars = {
|
||||
ACTOR_EN_NUTSBALL,
|
||||
|
@ -62,14 +62,14 @@ static Gfx* sDLists[] = {
|
|||
gDekuNutsDekuNutDL, gHintNutsNutDL, gBusinessScrubDekuNutDL, gDntJijiNutDL, gDntStageNutDL,
|
||||
};
|
||||
|
||||
void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnNutsball_Init(Actor* thisx, PlayState* play) {
|
||||
EnNutsball* this = (EnNutsball*)thisx;
|
||||
s32 pad;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->objBankIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectIDs[this->actor.params]);
|
||||
Collider_InitCylinder(play, &this->collider);
|
||||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIDs[this->actor.params]);
|
||||
|
||||
if (this->objBankIndex < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -78,14 +78,14 @@ void EnNutsball_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void EnNutsball_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnNutsball_Destroy(Actor* thisx, PlayState* play) {
|
||||
EnNutsball* this = (EnNutsball*)thisx;
|
||||
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
}
|
||||
|
||||
void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) {
|
||||
if (Object_IsLoaded(&globalCtx->objectCtx, this->objBankIndex)) {
|
||||
void func_80ABBB34(EnNutsball* this, PlayState* play) {
|
||||
if (Object_IsLoaded(&play->objectCtx, this->objBankIndex)) {
|
||||
this->actor.objBankIndex = this->objBankIndex;
|
||||
this->actor.draw = EnNutsball_Draw;
|
||||
this->actor.shape.rot.y = 0;
|
||||
|
@ -95,8 +95,8 @@ void func_80ABBB34(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
void func_80ABBBA8(EnNutsball* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
Vec3s sp4C;
|
||||
Vec3f sp40;
|
||||
|
||||
|
@ -132,8 +132,8 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
sp40.y = this->actor.world.pos.y + 4;
|
||||
sp40.z = this->actor.world.pos.z;
|
||||
|
||||
EffectSsHahen_SpawnBurst(globalCtx, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
|
||||
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK);
|
||||
EffectSsHahen_SpawnBurst(play, &sp40, 6.0f, 0, 7, 3, 15, HAHEN_OBJECT_DEFAULT, 10, NULL);
|
||||
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EN_OCTAROCK_ROCK);
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (this->timer == -300) {
|
||||
|
@ -142,39 +142,39 @@ void func_80ABBBA8(EnNutsball* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnNutsball_Update(Actor* thisx, PlayState* play) {
|
||||
EnNutsball* this = (EnNutsball*)thisx;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 pad;
|
||||
|
||||
if (!(player->stateFlags1 & (PLAYER_STATE1_6 | PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) ||
|
||||
(this->actionFunc == func_80ABBB34)) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
|
||||
Actor_MoveForward(&this->actor);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height,
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 10, sCylinderInit.dim.radius, sCylinderInit.dim.height,
|
||||
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
|
||||
this->actor.flags |= ACTOR_FLAG_24;
|
||||
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
|
||||
void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void EnNutsball_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 327);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_en_nutsball.c", 327);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
Matrix_Mult(&globalCtx->billboardMtxF, MTXMODE_APPLY);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(thisx->home.rot.z * 9.58738e-05f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 333),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_nutsball.c", 333),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params]);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_nutsball.c", 337);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_en_nutsball.c", 337);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
struct EnNutsball;
|
||||
|
||||
typedef void (*EnNutsballActionFunc)(struct EnNutsball*, GlobalContext*);
|
||||
typedef void (*EnNutsballActionFunc)(struct EnNutsball*, PlayState*);
|
||||
|
||||
typedef struct EnNutsball {
|
||||
/* 0x0000 */ Actor actor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue