1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 22:41:14 +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,18 +10,18 @@
#define FLAGS ACTOR_FLAG_4
void ObjLift_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjLift_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjLift_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjLift_Draw(Actor* thisx, GlobalContext* globalCtx);
void ObjLift_Init(Actor* thisx, PlayState* play);
void ObjLift_Destroy(Actor* thisx, PlayState* play);
void ObjLift_Update(Actor* thisx, PlayState* play);
void ObjLift_Draw(Actor* thisx, PlayState* play);
void func_80B9651C(ObjLift* this);
void func_80B9664C(ObjLift* this);
void func_80B967C0(ObjLift* this);
void func_80B96560(ObjLift* this, GlobalContext* globalCtx);
void func_80B96678(ObjLift* this, GlobalContext* globalCtx);
void func_80B96840(ObjLift* this, GlobalContext* globalCtx);
void func_80B96560(ObjLift* this, PlayState* play);
void func_80B96678(ObjLift* this, PlayState* play);
void func_80B96840(ObjLift* this, PlayState* play);
const ActorInit Obj_Lift_InitVars = {
ACTOR_OBJ_LIFT,
@ -60,14 +60,14 @@ void ObjLift_SetupAction(ObjLift* this, ObjLiftActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
void ObjLift_InitDynaPoly(ObjLift* this, GlobalContext* globalCtx, CollisionHeader* collision, s32 flags) {
void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* collision, s32 flags) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2;
DynaPolyActor_Init(&this->dyna, flags);
CollisionHeader_GetVirtual(collision, &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 (this->dyna.bgId == BG_ACTOR_MAX) {
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_lift.c", 188,
@ -75,7 +75,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, GlobalContext* globalCtx, CollisionHead
}
}
void func_80B96160(ObjLift* this, GlobalContext* globalCtx) {
void func_80B96160(ObjLift* this, PlayState* play) {
Vec3f pos;
Vec3f velocity;
Vec3f* temp_s3;
@ -91,24 +91,24 @@ void func_80B96160(ObjLift* this, GlobalContext* globalCtx) {
velocity.x = sFragmentScales[i].x * this->dyna.actor.scale.x * 0.8f;
velocity.y = Rand_ZeroOne() * 10.0f + 6.0f;
velocity.z = sFragmentScales[i].z * this->dyna.actor.scale.z * 0.8f;
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, temp_s3, -256, (Rand_ZeroOne() < 0.5f) ? 64 : 32, 15, 15, 0,
EffectSsKakera_Spawn(play, &pos, &velocity, temp_s3, -256, (Rand_ZeroOne() < 0.5f) ? 64 : 32, 15, 15, 0,
(Rand_ZeroOne() * 50.0f + 50.0f) * this->dyna.actor.scale.x, 0, 32, 50, KAKERA_COLOR_NONE,
OBJECT_D_LIFT, gCollapsingPlatformDL);
}
if (((this->dyna.actor.params >> 1) & 1) == 0) {
func_80033480(globalCtx, &this->dyna.actor.world.pos, 120.0f, 12, 120, 100, 1);
func_80033480(play, &this->dyna.actor.world.pos, 120.0f, 12, 120, 100, 1);
} else if (((this->dyna.actor.params >> 1) & 1) == 1) {
func_80033480(globalCtx, &this->dyna.actor.world.pos, 60.0f, 8, 60, 100, 1);
func_80033480(play, &this->dyna.actor.world.pos, 60.0f, 8, 60, 100, 1);
}
}
void ObjLift_Init(Actor* thisx, GlobalContext* globalCtx) {
void ObjLift_Init(Actor* thisx, PlayState* play) {
ObjLift* this = (ObjLift*)thisx;
ObjLift_InitDynaPoly(this, globalCtx, &gCollapsingPlatformCol, DPM_PLAYER);
ObjLift_InitDynaPoly(this, play, &gCollapsingPlatformCol, DPM_PLAYER);
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 2) & 0x3F)) {
if (Flags_GetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F)) {
Actor_Kill(&this->dyna.actor);
return;
}
@ -122,10 +122,10 @@ void ObjLift_Init(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf("(Dungeon Lift)(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void ObjLift_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ObjLift_Destroy(Actor* thisx, PlayState* play) {
ObjLift* this = (ObjLift*)thisx;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80B9651C(ObjLift* this) {
@ -133,7 +133,7 @@ void func_80B9651C(ObjLift* this) {
ObjLift_SetupAction(this, func_80B96560);
}
void func_80B96560(ObjLift* this, GlobalContext* globalCtx) {
void func_80B96560(ObjLift* this, PlayState* play) {
s32 pad;
s32 quakeIndex;
@ -142,7 +142,7 @@ void func_80B96560(ObjLift* this, GlobalContext* globalCtx) {
if (((this->dyna.actor.params >> 8) & 7) == 7) {
func_80B967C0(this);
} else {
quakeIndex = Quake_Add(GET_ACTIVE_CAM(globalCtx), 1);
quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1);
Quake_SetSpeed(quakeIndex, 10000);
Quake_SetQuakeValues(quakeIndex, 2, 0, 0, 0);
Quake_SetCountdown(quakeIndex, 20);
@ -159,7 +159,7 @@ void func_80B9664C(ObjLift* this) {
ObjLift_SetupAction(this, func_80B96678);
}
void func_80B96678(ObjLift* this, GlobalContext* globalCtx) {
void func_80B96678(ObjLift* this, PlayState* play) {
if (this->timer <= 0) {
func_80B967C0(this);
} else {
@ -176,7 +176,7 @@ void func_80B96678(ObjLift* this, GlobalContext* globalCtx) {
}
if ((this->timer & 3) == 3) {
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 16, NA_SE_EV_BLOCK_SHAKE);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 16, NA_SE_EV_BLOCK_SHAKE);
}
}
@ -186,7 +186,7 @@ void func_80B967C0(ObjLift* this) {
this->dyna.actor.shape.rot = this->dyna.actor.world.rot = this->dyna.actor.home.rot;
}
void func_80B96840(ObjLift* this, GlobalContext* globalCtx) {
void func_80B96840(ObjLift* this, PlayState* play) {
s32 pad;
s32 bgId;
Vec3f sp2C;
@ -195,27 +195,27 @@ void func_80B96840(ObjLift* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&sp2C, &this->dyna.actor.prevPos);
sp2C.y += sMaxFallDistances[(this->dyna.actor.params >> 1) & 1];
this->dyna.actor.floorHeight =
BgCheck_EntityRaycastFloor4(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &sp2C);
BgCheck_EntityRaycastFloor4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &sp2C);
if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >=
(sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) {
func_80B96160(this, globalCtx);
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK);
Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 2) & 0x3F);
func_80B96160(this, play);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK);
Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F);
Actor_Kill(&this->dyna.actor);
}
}
void ObjLift_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjLift_Update(Actor* thisx, PlayState* play) {
ObjLift* this = (ObjLift*)thisx;
if (this->timer > 0) {
this->timer--;
}
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
}
void ObjLift_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_DrawDListOpa(globalCtx, gCollapsingPlatformDL);
void ObjLift_Draw(Actor* thisx, PlayState* play) {
Gfx_DrawDListOpa(play, gCollapsingPlatformDL);
}

View file

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