mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-15 03:20:35 +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
|
@ -17,23 +17,23 @@ typedef enum {
|
|||
/* 0x02 */ FACE_EYES_OPEN_SMILING
|
||||
} FaceTextureIndex;
|
||||
|
||||
void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Init(Actor* thisx, PlayState* play);
|
||||
void ObjLightswitch_Destroy(Actor* thisx, PlayState* play);
|
||||
void ObjLightswitch_Update(Actor* thisx, PlayState* play);
|
||||
void ObjLightswitch_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void ObjLightswitch_SetupOff(ObjLightswitch* this);
|
||||
void ObjLightswitch_Off(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play);
|
||||
void ObjLightswitch_SetupTurnOn(ObjLightswitch* this);
|
||||
void ObjLightswitch_TurnOn(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_TurnOn(ObjLightswitch* this, PlayState* play);
|
||||
void ObjLightswitch_SetupOn(ObjLightswitch* this);
|
||||
void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_On(ObjLightswitch* this, PlayState* play);
|
||||
void ObjLightswitch_SetupTurnOff(ObjLightswitch* this);
|
||||
void ObjLightswitch_TurnOff(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play);
|
||||
void ObjLightswitch_SetupDisappearDelay(ObjLightswitch* this);
|
||||
void ObjLightswitch_DisappearDelay(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_DisappearDelay(ObjLightswitch* this, PlayState* play);
|
||||
void ObjLightswitch_SetupDisappear(ObjLightswitch* this);
|
||||
void ObjLightswitch_Disappear(ObjLightswitch* this, GlobalContext* globalCtx);
|
||||
void ObjLightswitch_Disappear(ObjLightswitch* this, PlayState* play);
|
||||
|
||||
const ActorInit Obj_Lightswitch_InitVars = {
|
||||
ACTOR_OBJ_LIGHTSWITCH,
|
||||
|
@ -88,11 +88,11 @@ static InitChainEntry sInitChain[] = {
|
|||
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
void ObjLightswitch_InitCollider(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) {
|
||||
s32 pad;
|
||||
|
||||
Collider_InitJntSph(globalCtx, &this->collider);
|
||||
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems);
|
||||
Collider_InitJntSph(play, &this->collider);
|
||||
Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderItems);
|
||||
Matrix_SetTranslateRotateYXZ(this->actor.world.pos.x,
|
||||
this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y),
|
||||
this->actor.world.pos.z, &this->actor.shape.rot);
|
||||
|
@ -100,36 +100,36 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, GlobalContext* globalCtx)
|
|||
Collider_UpdateSpheres(0, &this->collider);
|
||||
}
|
||||
|
||||
void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) {
|
||||
Actor* thisx = &this->actor; // required
|
||||
s32 type;
|
||||
|
||||
if (!Flags_GetSwitch(globalCtx, this->actor.params >> 8 & 0x3F)) {
|
||||
if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) {
|
||||
type = this->actor.params >> 4 & 3;
|
||||
|
||||
Flags_SetSwitch(globalCtx, this->actor.params >> 8 & 0x3F);
|
||||
Flags_SetSwitch(play, this->actor.params >> 8 & 0x3F);
|
||||
|
||||
if (type == OBJLIGHTSWITCH_TYPE_1) {
|
||||
OnePointCutscene_AttentionSetSfx(globalCtx, thisx, NA_SE_SY_TRE_BOX_APPEAR);
|
||||
OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_TRE_BOX_APPEAR);
|
||||
} else if (type == OBJLIGHTSWITCH_TYPE_BURN) {
|
||||
OnePointCutscene_AttentionSetSfx(globalCtx, thisx, NA_SE_SY_ERROR);
|
||||
OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_ERROR);
|
||||
} else {
|
||||
OnePointCutscene_AttentionSetSfx(globalCtx, thisx, NA_SE_SY_CORRECT_CHIME);
|
||||
OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_CORRECT_CHIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
if (Flags_GetSwitch(globalCtx, this->actor.params >> 8 & 0x3F)) {
|
||||
Flags_UnsetSwitch(globalCtx, this->actor.params >> 8 & 0x3F);
|
||||
void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, PlayState* play) {
|
||||
if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) {
|
||||
Flags_UnsetSwitch(play, this->actor.params >> 8 & 0x3F);
|
||||
|
||||
if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_1) {
|
||||
OnePointCutscene_AttentionSetSfx(globalCtx, &this->actor, NA_SE_SY_TRE_BOX_APPEAR);
|
||||
OnePointCutscene_AttentionSetSfx(play, &this->actor, NA_SE_SY_TRE_BOX_APPEAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) {
|
||||
Vec3f pos;
|
||||
f32 s = Math_SinS(this->actor.shape.rot.y);
|
||||
f32 c = Math_CosS(this->actor.shape.rot.y);
|
||||
|
@ -155,14 +155,13 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, GlobalContext* g
|
|||
pos.x = this->actor.world.pos.x + ((z * s) + (x * c));
|
||||
pos.y = this->actor.world.pos.y + y + 10.0f;
|
||||
pos.z = this->actor.world.pos.z + ((z * c) - (x * s));
|
||||
EffectSsDeadDb_Spawn(globalCtx, &pos, &D_80B97F74, &D_80B97F74, 100, 0, 255, 255, 160, 160, 255, 0, 0, 1, 9,
|
||||
true);
|
||||
EffectSsDeadDb_Spawn(play, &pos, &D_80B97F74, &D_80B97F74, 100, 0, 255, 255, 160, 160, 255, 0, 0, 1, 9, true);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_Init(Actor* thisx, PlayState* play) {
|
||||
ObjLightswitch* this = (ObjLightswitch*)thisx;
|
||||
s32 switchFlagSet = Flags_GetSwitch(globalCtx, this->actor.params >> 8 & 0x3F);
|
||||
s32 switchFlagSet = Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F);
|
||||
s32 removeSelf = false;
|
||||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
|
@ -186,9 +185,9 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.world.rot.x = this->actor.home.rot.x = this->actor.shape.rot.x;
|
||||
this->actor.world.rot.z = this->actor.home.rot.z = this->actor.shape.rot.z;
|
||||
this->actor.flags |= ACTOR_FLAG_5;
|
||||
if (Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_OBJ_OSHIHIKI,
|
||||
this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, 0,
|
||||
this->actor.home.rot.y, 0, (0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) {
|
||||
if (Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_OBJ_OSHIHIKI, this->actor.home.pos.x,
|
||||
this->actor.home.pos.y, this->actor.home.pos.z, 0, this->actor.home.rot.y, 0,
|
||||
(0xFF << 8) | PUSHBLOCK_SMALL_START_ON) == NULL) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// "Push-pull block occurrence failure"
|
||||
osSyncPrintf("押引ブロック発生失敗(%s %d)(arg_data 0x%04x)\n", "../z_obj_lightswitch.c", 452,
|
||||
|
@ -197,7 +196,7 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
removeSelf = true;
|
||||
}
|
||||
}
|
||||
ObjLightswitch_InitCollider(this, globalCtx);
|
||||
ObjLightswitch_InitCollider(this, play);
|
||||
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
if (removeSelf) {
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -206,11 +205,11 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
osSyncPrintf("(光スイッチ)(arg_data 0x%04x)\n", this->actor.params);
|
||||
}
|
||||
|
||||
void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
void ObjLightswitch_Destroy(Actor* thisx, PlayState* play2) {
|
||||
PlayState* play = play2;
|
||||
ObjLightswitch* this = (ObjLightswitch*)thisx;
|
||||
|
||||
Collider_DestroyJntSph(globalCtx, &this->collider);
|
||||
Collider_DestroyJntSph(play, &this->collider);
|
||||
}
|
||||
|
||||
void ObjLightswitch_SetupOff(ObjLightswitch* this) {
|
||||
|
@ -222,25 +221,25 @@ void ObjLightswitch_SetupOff(ObjLightswitch* this) {
|
|||
this->alpha = 255 << 6;
|
||||
}
|
||||
|
||||
void ObjLightswitch_Off(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play) {
|
||||
switch (this->actor.params >> 4 & 3) {
|
||||
case OBJLIGHTSWITCH_TYPE_STAY_ON:
|
||||
case OBJLIGHTSWITCH_TYPE_2:
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
ObjLightswitch_SetupTurnOn(this);
|
||||
ObjLightswitch_SetSwitchFlag(this, globalCtx);
|
||||
ObjLightswitch_SetSwitchFlag(this, play);
|
||||
}
|
||||
break;
|
||||
case OBJLIGHTSWITCH_TYPE_1:
|
||||
if ((this->collider.base.acFlags & AC_HIT) && !(this->prevFrameACflags & AC_HIT)) {
|
||||
ObjLightswitch_SetupTurnOn(this);
|
||||
ObjLightswitch_SetSwitchFlag(this, globalCtx);
|
||||
ObjLightswitch_SetSwitchFlag(this, play);
|
||||
}
|
||||
break;
|
||||
case OBJLIGHTSWITCH_TYPE_BURN:
|
||||
if (this->collider.base.acFlags & AC_HIT) {
|
||||
ObjLightswitch_SetupDisappearDelay(this);
|
||||
ObjLightswitch_SetSwitchFlag(this, globalCtx);
|
||||
ObjLightswitch_SetSwitchFlag(this, play);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -253,7 +252,7 @@ void ObjLightswitch_SetupTurnOn(ObjLightswitch* this) {
|
|||
this->faceTextureIndex = FACE_EYES_CLOSED;
|
||||
}
|
||||
|
||||
void ObjLightswitch_TurnOn(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_TurnOn(ObjLightswitch* this, PlayState* play) {
|
||||
if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) {
|
||||
if (this->timer == 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRIFORCE_FLASH);
|
||||
|
@ -289,24 +288,24 @@ void ObjLightswitch_SetupOn(ObjLightswitch* this) {
|
|||
this->timer = 0;
|
||||
}
|
||||
|
||||
void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_On(ObjLightswitch* this, PlayState* play) {
|
||||
switch (this->actor.params >> 4 & 3) {
|
||||
case OBJLIGHTSWITCH_TYPE_STAY_ON:
|
||||
if (!Flags_GetSwitch(globalCtx, this->actor.params >> 8 & 0x3F)) {
|
||||
if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) {
|
||||
ObjLightswitch_SetupTurnOff(this);
|
||||
}
|
||||
break;
|
||||
case OBJLIGHTSWITCH_TYPE_1:
|
||||
if (this->collider.base.acFlags & AC_HIT && !(this->prevFrameACflags & AC_HIT)) {
|
||||
ObjLightswitch_SetupTurnOff(this);
|
||||
ObjLightswitch_ClearSwitchFlag(this, globalCtx);
|
||||
ObjLightswitch_ClearSwitchFlag(this, play);
|
||||
}
|
||||
break;
|
||||
case OBJLIGHTSWITCH_TYPE_2:
|
||||
if (!(this->collider.base.acFlags & AC_HIT)) {
|
||||
if (this->timer >= 7) {
|
||||
ObjLightswitch_SetupTurnOff(this);
|
||||
ObjLightswitch_ClearSwitchFlag(this, globalCtx);
|
||||
ObjLightswitch_ClearSwitchFlag(this, play);
|
||||
} else {
|
||||
this->timer++;
|
||||
}
|
||||
|
@ -325,7 +324,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) {
|
|||
this->faceTextureIndex = FACE_EYES_OPEN;
|
||||
}
|
||||
|
||||
void ObjLightswitch_TurnOff(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play) {
|
||||
if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category ||
|
||||
this->toggleDelay <= 0) {
|
||||
this->timer--;
|
||||
|
@ -350,7 +349,7 @@ void ObjLightswitch_SetupDisappearDelay(ObjLightswitch* this) {
|
|||
this->toggleDelay = 100;
|
||||
}
|
||||
|
||||
void ObjLightswitch_DisappearDelay(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_DisappearDelay(ObjLightswitch* this, PlayState* play) {
|
||||
if (func_8005B198() == this->actor.category || this->toggleDelay <= 0) {
|
||||
ObjLightswitch_SetupDisappear(this);
|
||||
}
|
||||
|
@ -361,23 +360,23 @@ void ObjLightswitch_SetupDisappear(ObjLightswitch* this) {
|
|||
this->alpha = 255 << 6;
|
||||
}
|
||||
|
||||
void ObjLightswitch_Disappear(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_Disappear(ObjLightswitch* this, PlayState* play) {
|
||||
this->alpha -= 200;
|
||||
ObjLightswitch_SpawnDisappearEffects(this, globalCtx);
|
||||
ObjLightswitch_SpawnDisappearEffects(this, play);
|
||||
if (this->alpha < 0) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
||||
void ObjLightswitch_Update(Actor* thisx, PlayState* play2) {
|
||||
ObjLightswitch* this = (ObjLightswitch*)thisx;
|
||||
GlobalContext* globalCtx = globalCtx2;
|
||||
PlayState* play = play2;
|
||||
|
||||
if (this->toggleDelay > 0) {
|
||||
this->toggleDelay--;
|
||||
}
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
this->actionFunc(this, play);
|
||||
|
||||
if (this->actor.update != NULL) {
|
||||
if ((this->actor.params & 1) == 1) {
|
||||
|
@ -389,18 +388,18 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
|
||||
this->prevFrameACflags = this->collider.base.acFlags;
|
||||
this->collider.base.acFlags &= ~AC_HIT;
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjLightswitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) {
|
||||
Actor* child;
|
||||
Vec3f pos;
|
||||
Vec3s rot;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 809);
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 809);
|
||||
func_80093D18(play->state.gfxCtx);
|
||||
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, (u8)(this->color[0] >> 6), (u8)(this->color[1] >> 6), (u8)(this->color[2] >> 6),
|
||||
(u8)(this->alpha >> 6));
|
||||
|
@ -420,7 +419,7 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) {
|
|||
pos.z = this->actor.world.pos.z;
|
||||
}
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 841),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 841),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex]));
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000260);
|
||||
|
@ -430,27 +429,27 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) {
|
|||
rot.z = this->actor.shape.rot.z + this->flameRingRot;
|
||||
Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot);
|
||||
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_lightswitch.c", 859),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 859),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000398);
|
||||
|
||||
rot.z = this->actor.shape.rot.z - this->flameRingRot;
|
||||
Matrix_SetTranslateRotateYXZ(pos.x, pos.y, pos.z, &rot);
|
||||
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_lightswitch.c", 873),
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 873),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000408);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 878);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 878);
|
||||
}
|
||||
|
||||
void ObjLightswitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_DrawXlu(ObjLightswitch* this, PlayState* play) {
|
||||
s32 pad;
|
||||
Vec3f sp68;
|
||||
Vec3s sp60;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 890);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 890);
|
||||
func_80093D84(play->state.gfxCtx);
|
||||
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, (u8)(this->color[0] >> 6), (u8)(this->color[1] >> 6), (u8)(this->color[2] >> 6),
|
||||
(u8)(this->alpha >> 6));
|
||||
|
@ -460,7 +459,7 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) {
|
|||
sp68.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
|
||||
sp68.z = this->actor.world.pos.z;
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 912),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 912),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sFaceTextures[this->faceTextureIndex]));
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000260);
|
||||
|
@ -471,21 +470,21 @@ void ObjLightswitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) {
|
|||
|
||||
Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 930),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 930),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000398);
|
||||
|
||||
sp60.z = this->actor.shape.rot.z - this->flameRingRot;
|
||||
Matrix_SetTranslateRotateYXZ(sp68.x, sp68.y, sp68.z, &sp60);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 944),
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_lightswitch.c", 944),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000408);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_lightswitch.c", 949);
|
||||
CLOSE_DISPS(play->state.gfxCtx, "../z_obj_lightswitch.c", 949);
|
||||
}
|
||||
|
||||
void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
void ObjLightswitch_Draw(Actor* thisx, PlayState* play) {
|
||||
ObjLightswitch* this = (ObjLightswitch*)thisx;
|
||||
s32 alpha = this->alpha >> 6 & 0xFF;
|
||||
|
||||
|
@ -494,8 +493,8 @@ void ObjLightswitch_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) {
|
||||
ObjLightswitch_DrawXlu(this, globalCtx);
|
||||
ObjLightswitch_DrawXlu(this, play);
|
||||
} else {
|
||||
ObjLightswitch_DrawOpa(this, globalCtx);
|
||||
ObjLightswitch_DrawOpa(this, play);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
struct ObjLightswitch;
|
||||
|
||||
typedef void (*ObjLightswitchActionFunc)(struct ObjLightswitch*, GlobalContext*);
|
||||
typedef void (*ObjLightswitchActionFunc)(struct ObjLightswitch*, PlayState*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ OBJLIGHTSWITCH_TYPE_STAY_ON, // doesn't turn off unless the switch flag is cleared some other way
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue