1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-22 06:52:03 +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,10 +9,10 @@
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_25)
void OceffWipe_Init(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx);
void OceffWipe_Init(Actor* thisx, PlayState* play);
void OceffWipe_Destroy(Actor* thisx, PlayState* play);
void OceffWipe_Update(Actor* thisx, PlayState* play);
void OceffWipe_Draw(Actor* thisx, PlayState* play);
const ActorInit Oceff_Wipe_InitVars = {
ACTOR_OCEFF_WIPE,
@ -26,29 +26,29 @@ const ActorInit Oceff_Wipe_InitVars = {
(ActorFunc)OceffWipe_Draw,
};
void OceffWipe_Init(Actor* thisx, GlobalContext* globalCtx) {
void OceffWipe_Init(Actor* thisx, PlayState* play) {
OceffWipe* this = (OceffWipe*)thisx;
Actor_SetScale(&this->actor, 0.1f);
this->timer = 0;
this->actor.world.pos = GET_ACTIVE_CAM(globalCtx)->eye;
this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
osSyncPrintf(VT_FGCOL(CYAN) " WIPE arg_data = %d\n" VT_RST, this->actor.params);
}
void OceffWipe_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void OceffWipe_Destroy(Actor* thisx, PlayState* play) {
OceffWipe* this = (OceffWipe*)thisx;
Player* player = GET_PLAYER(globalCtx);
Player* player = GET_PLAYER(play);
func_800876C8(globalCtx);
func_800876C8(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= PLAYER_STATE3_6;
}
}
void OceffWipe_Update(Actor* thisx, GlobalContext* globalCtx) {
void OceffWipe_Update(Actor* thisx, PlayState* play) {
OceffWipe* this = (OceffWipe*)thisx;
this->actor.world.pos = GET_ACTIVE_CAM(globalCtx)->eye;
this->actor.world.pos = GET_ACTIVE_CAM(play)->eye;
if (this->timer < 100) {
this->timer++;
} else {
@ -63,8 +63,8 @@ static u8 sAlphaIndices[] = {
0x10, 0x22, 0x01, 0x20, 0x12, 0x01, 0x12, 0x21, 0x01, 0x02,
};
void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) {
u32 scroll = globalCtx->state.frames & 0xFF;
void OceffWipe_Draw(Actor* thisx, PlayState* play) {
u32 scroll = play->state.frames & 0xFF;
OceffWipe* this = (OceffWipe*)thisx;
f32 z;
s32 pad;
@ -74,10 +74,10 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) {
Vtx* vtxPtr;
Vec3f vec;
eye = GET_ACTIVE_CAM(globalCtx)->eye;
Camera_GetSkyboxOffset(&vec, GET_ACTIVE_CAM(globalCtx));
eye = GET_ACTIVE_CAM(play)->eye;
Camera_GetSkyboxOffset(&vec, GET_ACTIVE_CAM(play));
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 346);
OPEN_DISPS(play->state.gfxCtx, "../z_oceff_wipe.c", 346);
if (this->timer < 32) {
z = Math_SinS(this->timer << 9) * 1400;
@ -101,14 +101,14 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) {
vtxPtr[i * 2 + 1].v.cn[3] = alphaTable[sAlphaIndices[i] & 0xF];
}
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
Matrix_Translate(eye.x + vec.x, eye.y + vec.y, eye.z + vec.z, MTXMODE_NEW);
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Translate(0.0f, 0.0f, -z, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 375),
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_oceff_wipe.c", 375),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->actor.params != OCEFF_WIPE_ZL) {
@ -120,9 +120,9 @@ void OceffWipe_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
gSPDisplayList(POLY_XLU_DISP++, sMaterialDL);
gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 - scroll, scroll * (-2), 32, 32, 1,
gSPDisplayList(POLY_XLU_DISP++, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0 - scroll, scroll * (-2), 32, 32, 1,
0 - scroll, scroll * (-2), 32, 32));
gSPDisplayList(POLY_XLU_DISP++, sFrustumDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_oceff_wipe.c", 398);
CLOSE_DISPS(play->state.gfxCtx, "../z_oceff_wipe.c", 398);
}