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:
parent
154f44b6da
commit
2e6279bc8e
912 changed files with 40489 additions and 41078 deletions
|
@ -10,15 +10,15 @@
|
|||
|
||||
#define FLAGS 0
|
||||
|
||||
void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjComb_Init(Actor* thisx, PlayState* play);
|
||||
void ObjComb_Destroy(Actor* thisx, PlayState* play);
|
||||
void ObjComb_Update(Actor* thisx, PlayState* play);
|
||||
void ObjComb_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx);
|
||||
void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx);
|
||||
void ObjComb_Break(ObjComb* this, PlayState* play);
|
||||
void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play);
|
||||
void ObjComb_SetupWait(ObjComb* this);
|
||||
void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx);
|
||||
void ObjComb_Wait(ObjComb* this, PlayState* play);
|
||||
|
||||
const ActorInit Obj_Comb_InitVars = {
|
||||
ACTOR_OBJ_COMB,
|
||||
|
@ -66,7 +66,7 @@ static InitChainEntry sInitChain[] = {
|
|||
ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
|
||||
void ObjComb_Break(ObjComb* this, PlayState* play) {
|
||||
Vec3f pos1;
|
||||
Vec3f pos;
|
||||
Vec3f velocity;
|
||||
|
@ -117,22 +117,22 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
|
|||
arg5 = 32;
|
||||
}
|
||||
|
||||
EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &pos, gravity, arg5, arg6, 4, 0, scale, 0, 0, 80,
|
||||
KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_FIELD_KEEP, dlist);
|
||||
EffectSsKakera_Spawn(play, &pos, &velocity, &pos, gravity, arg5, arg6, 4, 0, scale, 0, 0, 80, KAKERA_COLOR_NONE,
|
||||
OBJECT_GAMEPLAY_FIELD_KEEP, dlist);
|
||||
}
|
||||
|
||||
pos.x = this->actor.world.pos.x;
|
||||
pos.y = this->actor.world.pos.y - 10.0f;
|
||||
pos.z = this->actor.world.pos.z;
|
||||
func_80033480(globalCtx, &pos, 40.0f, 6, 70, 60, 1);
|
||||
func_80033480(play, &pos, 40.0f, 6, 70, 60, 1);
|
||||
}
|
||||
|
||||
void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) {
|
||||
void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) {
|
||||
s16 params = this->actor.params & 0x1F;
|
||||
|
||||
if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be &&
|
||||
if (params == ITEM00_HEART_PIECE) {
|
||||
if (Flags_GetCollectible(globalCtx, (this->actor.params >> 8) & 0x3F)) {
|
||||
if (Flags_GetCollectible(play, (this->actor.params >> 8) & 0x3F)) {
|
||||
params = -1;
|
||||
} else {
|
||||
params = (params | (((this->actor.params >> 8) & 0x3F) << 8));
|
||||
|
@ -141,32 +141,32 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) {
|
|||
params = -1;
|
||||
}
|
||||
if (params >= 0) {
|
||||
Item_DropCollectible(globalCtx, &this->actor.world.pos, params);
|
||||
Item_DropCollectible(play, &this->actor.world.pos, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjComb_Init(Actor* thisx, PlayState* play) {
|
||||
ObjComb* this = (ObjComb*)thisx;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
|
||||
Collider_InitJntSph(play, &this->collider);
|
||||
Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
|
||||
ObjComb_SetupWait(this);
|
||||
}
|
||||
|
||||
void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
void ObjComb_Destroy(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
ObjComb* this = (ObjComb*)thisx;
|
||||
|
||||
Collider_DestroyJntSph(globalCtx, &this->collider);
|
||||
Collider_DestroyJntSph(play, &this->collider);
|
||||
}
|
||||
|
||||
void ObjComb_SetupWait(ObjComb* this) {
|
||||
this->actionFunc = ObjComb_Wait;
|
||||
}
|
||||
|
||||
void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
|
||||
void ObjComb_Wait(ObjComb* this, PlayState* play) {
|
||||
s32 dmgFlags;
|
||||
|
||||
this->unk_1B0 -= 50;
|
||||
|
@ -180,33 +180,33 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
|
|||
if (dmgFlags & 0x4001F866) {
|
||||
this->unk_1B0 = 1500;
|
||||
} else {
|
||||
ObjComb_Break(this, globalCtx);
|
||||
ObjComb_ChooseItemDrop(this, globalCtx);
|
||||
ObjComb_Break(this, play);
|
||||
ObjComb_ChooseItemDrop(this, play);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
} else {
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
if (this->actor.update != NULL) {
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjComb_Update(Actor* thisx, PlayState* play) {
|
||||
ObjComb* this = (ObjComb*)thisx;
|
||||
|
||||
this->unk_1B2 += 0x2EE0;
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
this->actor.shape.rot.x = Math_SinS(this->unk_1B2) * this->unk_1B0 + this->actor.home.rot.x;
|
||||
}
|
||||
|
||||
void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjComb_Draw(Actor* thisx, PlayState* play) {
|
||||
ObjComb* this = (ObjComb*)thisx;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_comb.c", 369);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_obj_comb.c", 369);
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + (118.0f * this->actor.scale.y),
|
||||
this->actor.world.pos.z, MTXMODE_NEW);
|
||||
|
@ -216,12 +216,12 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Matrix_Translate(0, -(this->actor.scale.y * 118.0f), 0, MTXMODE_APPLY);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_comb.c", 394),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_comb.c", 394),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, gFieldBeehiveDL);
|
||||
|
||||
Collider_UpdateSpheres(0, &this->collider);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_comb.c", 402);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_obj_comb.c", 402);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
struct ObjComb;
|
||||
|
||||
typedef void (*ObjCombActionFunc)(struct ObjComb*, GlobalContext*);
|
||||
typedef void (*ObjCombActionFunc)(struct ObjComb*, PlayState*);
|
||||
|
||||
typedef struct ObjComb {
|
||||
/* 0x0000 */ Actor actor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue