1
0
Fork 0
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:
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

@ -9,13 +9,13 @@
#define FLAGS 0
void BgInGate_Init(Actor* thisx, GlobalContext* globalCtx);
void BgInGate_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgInGate_Update(Actor* thisx, GlobalContext* globalCtx);
void BgInGate_Draw(Actor* thisx, GlobalContext* globalCtx);
void BgInGate_Init(Actor* thisx, PlayState* play);
void BgInGate_Destroy(Actor* thisx, PlayState* play);
void BgInGate_Update(Actor* thisx, PlayState* play);
void BgInGate_Draw(Actor* thisx, PlayState* play);
void func_80892890(BgInGate* this, GlobalContext* globalCtx);
void BgInGate_DoNothing(BgInGate* this, GlobalContext* globalCtx);
void func_80892890(BgInGate* this, PlayState* play);
void BgInGate_DoNothing(BgInGate* this, PlayState* play);
const ActorInit Bg_Ingate_InitVars = {
ACTOR_BG_INGATE,
@ -33,7 +33,7 @@ void BgInGate_SetupAction(BgInGate* this, BgInGateActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
void BgInGate_Init(Actor* thisx, GlobalContext* globalCtx) {
void BgInGate_Init(Actor* thisx, PlayState* play) {
BgInGate* this = (BgInGate*)thisx;
s32 pad;
@ -42,9 +42,9 @@ void BgInGate_Init(Actor* thisx, GlobalContext* globalCtx) {
DynaPolyActor_Init(&this->dyna, DPM_UNK);
CollisionHeader_GetVirtual(&gIngoGateCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if ((globalCtx->sceneNum != SCENE_SPOT20 || !LINK_IS_ADULT) ||
if ((play->sceneNum != SCENE_SPOT20 || !LINK_IS_ADULT) ||
(GET_EVENTCHKINF(EVENTCHKINF_18) && (gSaveContext.cutsceneIndex != 0xFFF0))) {
Actor_Kill(&this->dyna.actor);
return;
@ -52,33 +52,33 @@ void BgInGate_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->dyna.actor, 0.1f);
if (((this->dyna.actor.params & 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) {
globalCtx->csCtx.frames = 0;
play->csCtx.frames = 0;
BgInGate_SetupAction(this, func_80892890);
} else {
BgInGate_SetupAction(this, BgInGate_DoNothing);
}
}
void BgInGate_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgInGate_Destroy(Actor* thisx, PlayState* play) {
BgInGate* this = (BgInGate*)thisx;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80892890(BgInGate* this, GlobalContext* globalCtx) {
void func_80892890(BgInGate* this, PlayState* play) {
s32 phi0;
s16 phi1;
s16 csFrames;
if (globalCtx->csCtx.frames >= 50) {
if (play->csCtx.frames >= 50) {
phi0 = 0x4000;
if ((this->dyna.actor.params & 2) == 0) {
phi0 = -0x4000;
}
this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0;
BgInGate_SetupAction(this, BgInGate_DoNothing);
} else if (globalCtx->csCtx.frames >= 10) {
csFrames = globalCtx->csCtx.frames - 10;
} else if (play->csCtx.frames >= 10) {
csFrames = play->csCtx.frames - 10;
csFrames *= 400;
phi1 = csFrames;
if (csFrames > 0x4000) {
@ -93,24 +93,24 @@ void func_80892890(BgInGate* this, GlobalContext* globalCtx) {
}
}
void BgInGate_DoNothing(BgInGate* this, GlobalContext* globalCtx) {
void BgInGate_DoNothing(BgInGate* this, PlayState* play) {
}
void BgInGate_Update(Actor* thisx, GlobalContext* globalCtx) {
void BgInGate_Update(Actor* thisx, PlayState* play) {
BgInGate* this = (BgInGate*)thisx;
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
}
void BgInGate_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_ingate.c", 240);
void BgInGate_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_bg_ingate.c", 240);
func_80093D18(globalCtx->state.gfxCtx);
func_80093D18(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ingate.c", 245),
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_ingate.c", 245),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gIngoGateDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_ingate.c", 250);
CLOSE_DISPS(play->state.gfxCtx, "../z_bg_ingate.c", 250);
}

View file

@ -6,7 +6,7 @@
struct BgInGate;
typedef void (*BgInGateActionFunc)(struct BgInGate*, GlobalContext*);
typedef void (*BgInGateActionFunc)(struct BgInGate*, PlayState*);
typedef struct BgInGate {
/* 0x0000 */ DynaPolyActor dyna;