1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +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

@ -8,12 +8,12 @@
#define FLAGS ACTOR_FLAG_4
void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjRoomtimer_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjRoomtimer_Init(Actor* thisx, PlayState* play);
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play);
void ObjRoomtimer_Update(Actor* thisx, PlayState* play);
void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx);
void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx);
void func_80B9D054(ObjRoomtimer* this, PlayState* play);
void func_80B9D0B0(ObjRoomtimer* this, PlayState* play);
const ActorInit Obj_Roomtimer_InitVars = {
ACTOR_OBJ_ROOMTIMER,
@ -27,7 +27,7 @@ const ActorInit Obj_Roomtimer_InitVars = {
(ActorFunc)NULL,
};
void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx) {
void ObjRoomtimer_Init(Actor* thisx, PlayState* play) {
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
s16 params = this->actor.params;
@ -46,7 +46,7 @@ void ObjRoomtimer_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_80B9D054;
}
void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ObjRoomtimer_Destroy(Actor* thisx, PlayState* play) {
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value > 0)) {
@ -54,36 +54,36 @@ void ObjRoomtimer_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
}
void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx) {
void func_80B9D054(ObjRoomtimer* this, PlayState* play) {
if (this->actor.params != 0x3FF) {
func_80088B34(this->actor.params);
}
Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
this->actionFunc = func_80B9D0B0;
}
void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) {
if (Flags_GetTempClear(globalCtx, this->actor.room)) {
void func_80B9D0B0(ObjRoomtimer* this, PlayState* play) {
if (Flags_GetTempClear(play, this->actor.room)) {
if (this->actor.params != 0x3FF) {
gSaveContext.timer1State = 10;
}
Flags_SetClear(globalCtx, this->actor.room);
Flags_SetSwitch(globalCtx, this->switchFlag);
Flags_SetClear(play, this->actor.room);
Flags_SetSwitch(play, this->switchFlag);
func_80078884(NA_SE_SY_CORRECT_CHIME);
Actor_Kill(&this->actor);
} else {
if ((this->actor.params != 0x3FF) && (gSaveContext.timer1Value == 0)) {
Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Play_TriggerVoidOut(globalCtx);
Play_TriggerVoidOut(play);
Actor_Kill(&this->actor);
}
}
}
void ObjRoomtimer_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjRoomtimer_Update(Actor* thisx, PlayState* play) {
ObjRoomtimer* this = (ObjRoomtimer*)thisx;
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
}

View file

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