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

@ -9,13 +9,13 @@
#define FLAGS 0
void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjHsblock_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx);
void ObjHsblock_Init(Actor* thisx, PlayState* play);
void ObjHsblock_Destroy(Actor* thisx, PlayState* play);
void ObjHsblock_Update(Actor* thisx, PlayState* play);
void ObjHsblock_Draw(Actor* thisx, PlayState* play);
void func_80B93DF4(ObjHsblock* this, GlobalContext* globalCtx);
void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx);
void func_80B93DF4(ObjHsblock* this, PlayState* play);
void func_80B93E5C(ObjHsblock* this, PlayState* play);
void func_80B93D90(ObjHsblock* this);
void func_80B93DB0(ObjHsblock* this);
@ -52,34 +52,34 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, CollisionHeader* collision, s32 moveFlags) {
void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 moveFlags) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2[2];
DynaPolyActor_Init(&this->dyna, moveFlags);
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_hsblock.c", 163,
this->dyna.actor.id, this->dyna.actor.params);
}
}
void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) {
void func_80B93BF0(ObjHsblock* this, PlayState* play) {
if ((this->dyna.actor.params >> 5) & 1) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_OBJ_ICE_POLY,
this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1);
Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x,
this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1);
}
}
void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx) {
void ObjHsblock_Init(Actor* thisx, PlayState* play) {
ObjHsblock* this = (ObjHsblock*)thisx;
func_80B93B68(this, globalCtx, sCollisionHeaders[thisx->params & 3], DPM_UNK);
func_80B93B68(this, play, sCollisionHeaders[thisx->params & 3], DPM_UNK);
Actor_ProcessInitChain(thisx, sInitChain);
func_80B93BF0(this, globalCtx);
func_80B93BF0(this, play);
switch (thisx->params & 3) {
case 0:
@ -87,7 +87,7 @@ void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80B93D90(this);
break;
case 1:
if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0x3F)) {
if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) {
func_80B93D90(this);
} else {
func_80B93DB0(this);
@ -99,10 +99,10 @@ void ObjHsblock_Init(Actor* thisx, GlobalContext* globalCtx) {
mREG(15) = 255;
}
void ObjHsblock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void ObjHsblock_Destroy(Actor* thisx, PlayState* play) {
ObjHsblock* this = (ObjHsblock*)thisx;
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
void func_80B93D90(ObjHsblock* this) {
@ -115,8 +115,8 @@ void func_80B93DB0(ObjHsblock* this) {
ObjHsblock_SetupAction(this, func_80B93DF4);
}
void func_80B93DF4(ObjHsblock* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
void func_80B93DF4(ObjHsblock* this, PlayState* play) {
if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) {
func_80B93E38(this);
}
}
@ -125,7 +125,7 @@ void func_80B93E38(ObjHsblock* this) {
ObjHsblock_SetupAction(this, func_80B93E5C);
}
void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx) {
void func_80B93E5C(ObjHsblock* this, PlayState* play) {
Math_SmoothStepToF(&this->dyna.actor.velocity.y, 16.0f, 0.1f, 0.8f, 0.0f);
if (fabsf(Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.3f,
this->dyna.actor.velocity.y, 0.3f)) < 0.001f) {
@ -135,27 +135,27 @@ void func_80B93E5C(ObjHsblock* this, GlobalContext* globalCtx) {
}
}
void ObjHsblock_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjHsblock_Update(Actor* thisx, PlayState* play) {
ObjHsblock* this = (ObjHsblock*)thisx;
if (this->actionFunc != NULL) {
this->actionFunc(this, globalCtx);
this->actionFunc(this, play);
}
Actor_SetFocus(thisx, D_80B940C0[thisx->params & 3]);
}
void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
void ObjHsblock_Draw(Actor* thisx, PlayState* play) {
Color_RGB8* color;
Color_RGB8 defaultColor;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 365);
OPEN_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 365);
func_80093D18(globalCtx->state.gfxCtx);
func_80093D18(play->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 369),
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_hsblock.c", 369),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (globalCtx->sceneNum == SCENE_HIDAN) {
if (play->sceneNum == SCENE_HIDAN) {
color = &sFireTempleColor;
} else {
defaultColor.r = mREG(13);
@ -167,5 +167,5 @@ void ObjHsblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 255);
gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params & 3]);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_hsblock.c", 399);
CLOSE_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 399);
}

View file

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