1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-20 14:01:15 +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

@ -6,13 +6,13 @@
#define FLAGS ACTOR_FLAG_4
typedef void (*DemoDuActionFunc)(DemoDu*, GlobalContext*);
typedef void (*DemoDuDrawFunc)(Actor*, GlobalContext*);
typedef void (*DemoDuActionFunc)(DemoDu*, PlayState*);
typedef void (*DemoDuDrawFunc)(Actor*, PlayState*);
void DemoDu_Init(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Update(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Draw(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Init(Actor* thisx, PlayState* play);
void DemoDu_Destroy(Actor* thisx, PlayState* play);
void DemoDu_Update(Actor* thisx, PlayState* play);
void DemoDu_Draw(Actor* thisx, PlayState* play);
static s32 sUnused = 0;
@ -38,10 +38,10 @@ static void* sMouthTextures[] = { gDaruniaMouthSeriousTex, gDaruniaMouthGrinning
#define CS_CHAMBERAFTERGANON_SUBSCENE(x) (21 + (x)) // DEMO_DU_CS_CHAMBER_AFTER_GANON
#define CS_CREDITS_SUBSCENE(x) (24 + (x)) // DEMO_DU_CS_CREDITS
void DemoDu_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void DemoDu_Destroy(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
SkelAnime_Free(&this->skelAnime, globalCtx);
SkelAnime_Free(&this->skelAnime, play);
}
void DemoDu_UpdateEyes(DemoDu* this) {
@ -77,10 +77,10 @@ void DemoDu_CsAfterGanon_Reset(DemoDu* this) {
this->unk_1A4 = 0.0f;
}
void DemoDu_CsAfterGanon_CheckIfShouldReset(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsAfterGanon_CheckIfShouldReset(DemoDu* this, PlayState* play) {
static s32 D_8096CE94 = false;
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
if (play->csCtx.state == CS_STATE_IDLE) {
if (D_8096CE94) {
if (this->actor.params == DEMO_DU_CS_CHAMBER_AFTER_GANON) {
DemoDu_CsAfterGanon_Reset(this);
@ -97,20 +97,19 @@ s32 DemoDu_UpdateSkelAnime(DemoDu* this) {
return SkelAnime_Update(&this->skelAnime);
}
void DemoDu_UpdateBgCheckInfo(DemoDu* this, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f,
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
void DemoDu_UpdateBgCheckInfo(DemoDu* this, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 75.0f, 30.0f, 30.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
}
CsCmdActorAction* DemoDu_GetNpcAction(GlobalContext* globalCtx, s32 idx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
return globalCtx->csCtx.npcActions[idx];
CsCmdActorAction* DemoDu_GetNpcAction(PlayState* play, s32 idx) {
if (play->csCtx.state != CS_STATE_IDLE) {
return play->csCtx.npcActions[idx];
}
return NULL;
}
s32 DemoDu_IsNpcDoingThisAction(DemoDu* this, GlobalContext* globalCtx, u16 action, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(globalCtx, idx);
s32 DemoDu_IsNpcDoingThisAction(DemoDu* this, PlayState* play, u16 action, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(play, idx);
if ((npcAction != NULL) && (npcAction->action == action)) {
return true;
@ -118,8 +117,8 @@ s32 DemoDu_IsNpcDoingThisAction(DemoDu* this, GlobalContext* globalCtx, u16 acti
return false;
}
s32 DemoDu_IsNpcNotDoingThisAction(DemoDu* this, GlobalContext* globalCtx, u16 action, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(globalCtx, idx);
s32 DemoDu_IsNpcNotDoingThisAction(DemoDu* this, PlayState* play, u16 action, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(play, idx);
if ((npcAction != NULL) && (npcAction->action != action)) {
return true;
@ -127,8 +126,8 @@ s32 DemoDu_IsNpcNotDoingThisAction(DemoDu* this, GlobalContext* globalCtx, u16 a
return false;
}
void DemoDu_MoveToNpcPos(DemoDu* this, GlobalContext* globalCtx, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(globalCtx, idx);
void DemoDu_MoveToNpcPos(DemoDu* this, PlayState* play, s32 idx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(play, idx);
s32 pad;
if (npcAction != NULL) {
@ -158,63 +157,62 @@ void func_80969DDC(DemoDu* this, AnimationHeader* animation, u8 mode, f32 morphF
Animation_Change(&this->skelAnime, animation, playSpeed, startFrame, endFrame, mode, morphFrames);
}
void DemoDu_InitCs_FireMedallion(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, &gDaruniaIdleAnim, NULL, NULL, 0);
void DemoDu_InitCs_FireMedallion(DemoDu* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, &gDaruniaIdleAnim, NULL, NULL, 0);
this->actor.shape.yOffset = -10000.0f;
DemoDu_SetEyeTexIndex(this, 1);
DemoDu_SetMouthTexIndex(this, 3);
}
// A.k.a Warp portal
void DemoDu_CsFireMedallion_SpawnDoorWarp(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsFireMedallion_SpawnDoorWarp(DemoDu* this, PlayState* play) {
f32 posX = this->actor.world.pos.x;
f32 posY = this->actor.world.pos.y;
f32 posZ = this->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
WARP_SAGES);
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, WARP_SAGES);
}
// Gives the Fire Medallion to Link.
void func_80969F38(DemoDu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
void func_80969F38(DemoDu* this, PlayState* play) {
Player* player = GET_PLAYER(play);
f32 posX = player->actor.world.pos.x;
f32 posY = player->actor.world.pos.y + 80.0f;
f32 posZ = player->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0,
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_EFFECT, posX, posY, posZ, 0, 0, 0,
DEMO_EFFECT_MEDAL_FIRE);
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
Item_Give(play, ITEM_MEDALLION_FIRE);
}
void func_80969FB4(DemoDu* this, GlobalContext* globalCtx) {
void func_80969FB4(DemoDu* this, PlayState* play) {
this->actor.shape.yOffset += 250.0f / 3.0f;
}
// Gives the Fire Medallion to Link too.
void DemoDu_CsFireMedallion_AdvanceTo01(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsFireMedallion_AdvanceTo01(DemoDu* this, PlayState* play) {
s32 pad[2];
if ((gSaveContext.chamberCutsceneNum == 1) && (gSaveContext.sceneSetupIndex < 4)) {
Player* player = GET_PLAYER(globalCtx);
Player* player = GET_PLAYER(play);
this->updateIndex = CS_FIREMEDALLION_SUBSCENE(1);
globalCtx->csCtx.segment = D_8096C1A4;
play->csCtx.segment = D_8096C1A4;
gSaveContext.cutsceneTrigger = 2;
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
Item_Give(play, ITEM_MEDALLION_FIRE);
player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000;
}
}
void DemoDu_CsFireMedallion_AdvanceTo02(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsFireMedallion_AdvanceTo02(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 1)) {
this->updateIndex = CS_FIREMEDALLION_SUBSCENE(2);
this->drawIndex = 1;
DemoDu_CsFireMedallion_SpawnDoorWarp(this, globalCtx);
DemoDu_CsFireMedallion_SpawnDoorWarp(this, play);
}
}
}
@ -226,9 +224,9 @@ void DemoDu_CsFireMedallion_AdvanceTo03(DemoDu* this) {
}
}
void DemoDu_CsFireMedallion_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsFireMedallion_AdvanceTo04(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 2)) {
Animation_Change(&this->skelAnime, &gDaruniaItemGiveAnim, 1.0f, 0.0f,
@ -246,58 +244,58 @@ void DemoDu_CsFireMedallion_AdvanceTo05(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsFireMedallion_AdvanceTo06(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[6];
void DemoDu_CsFireMedallion_AdvanceTo06(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[6];
if ((npcAction != NULL) && (npcAction->action == 2)) {
this->updateIndex = CS_FIREMEDALLION_SUBSCENE(6);
func_80969F38(this, globalCtx);
func_80969F38(this, play);
}
}
}
void DemoDu_UpdateCs_FM_00(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsFireMedallion_AdvanceTo01(this, globalCtx);
void DemoDu_UpdateCs_FM_00(DemoDu* this, PlayState* play) {
DemoDu_CsFireMedallion_AdvanceTo01(this, play);
}
void DemoDu_UpdateCs_FM_01(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsFireMedallion_AdvanceTo02(this, globalCtx);
void DemoDu_UpdateCs_FM_01(DemoDu* this, PlayState* play) {
DemoDu_CsFireMedallion_AdvanceTo02(this, play);
}
void DemoDu_UpdateCs_FM_02(DemoDu* this, GlobalContext* globalCtx) {
func_80969FB4(this, globalCtx);
void DemoDu_UpdateCs_FM_02(DemoDu* this, PlayState* play) {
func_80969FB4(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsFireMedallion_AdvanceTo03(this);
}
void DemoDu_UpdateCs_FM_03(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_FM_03(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsFireMedallion_AdvanceTo04(this, globalCtx);
DemoDu_CsFireMedallion_AdvanceTo04(this, play);
}
void DemoDu_UpdateCs_FM_04(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_FM_04(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsFireMedallion_AdvanceTo05(this, animFinished);
}
void DemoDu_UpdateCs_FM_05(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_FM_05(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsFireMedallion_AdvanceTo06(this, globalCtx);
DemoDu_CsFireMedallion_AdvanceTo06(this, play);
}
void DemoDu_UpdateCs_FM_06(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_FM_06(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
}
void DemoDu_InitCs_GoronsRuby(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
void DemoDu_InitCs_GoronsRuby(DemoDu* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(0);
}
@ -309,15 +307,15 @@ void DemoDu_CsPlaySfx_GoronLanding(DemoDu* this) {
// Cutscene: Darunia gives Link the Goron's Ruby.
// Sfx played when Darunia is falling at the start of the cutscene.
void DemoDu_CsPlaySfx_DaruniaFalling(GlobalContext* globalCtx) {
if (globalCtx->csCtx.frames == 160) {
void DemoDu_CsPlaySfx_DaruniaFalling(PlayState* play) {
if (play->csCtx.frames == 160) {
func_800788CC(NA_SE_EV_OBJECT_FALL);
}
}
// Cutscene: Darunia gives Link the Goron's Ruby.
void DemoDu_CsPlaySfx_DaruniaHitsLink(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
void DemoDu_CsPlaySfx_DaruniaHitsLink(PlayState* play) {
Player* player = GET_PLAYER(play);
s32 pad;
func_80078914(&player->actor.projectedPos, NA_SE_EN_DARUNIA_HIT_LINK);
@ -332,9 +330,9 @@ void DemoDu_CsPlaySfx_HitBreast(DemoDu* this) {
// Cutscene: Darunia gives Link the Goron's Ruby.
// Sfx played when Link is escaping from the gorons at the end of the scene.
void DemoDu_CsPlaySfx_LinkEscapeFromGorons(GlobalContext* globalCtx) {
if (globalCtx->csCtx.frames == 1400) {
Player* player = GET_PLAYER(globalCtx);
void DemoDu_CsPlaySfx_LinkEscapeFromGorons(PlayState* play) {
if (play->csCtx.frames == 1400) {
Player* player = GET_PLAYER(play);
Audio_PlaySoundGeneral(NA_SE_VO_LI_FALL_L_KID, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@ -343,17 +341,17 @@ void DemoDu_CsPlaySfx_LinkEscapeFromGorons(GlobalContext* globalCtx) {
// Cutscene: Darunia gives Link the Goron's Ruby.
// Sfx played when Link is surprised by Darunia falling from the sky.
void DemoDu_CsPlaySfx_LinkSurprised(GlobalContext* globalCtx) {
if (globalCtx->csCtx.frames == 174) {
Player* player = GET_PLAYER(globalCtx);
void DemoDu_CsPlaySfx_LinkSurprised(PlayState* play) {
if (play->csCtx.frames == 174) {
Player* player = GET_PLAYER(play);
Audio_PlaySoundGeneral(NA_SE_VO_LI_SURPRISE_KID, &player->actor.projectedPos, 4U, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
}
void DemoDu_CsGoronsRuby_UpdateFaceTextures(DemoDu* this, GlobalContext* globalCtx) {
u16* frames = &globalCtx->csCtx.frames;
void DemoDu_CsGoronsRuby_UpdateFaceTextures(DemoDu* this, PlayState* play) {
u16* frames = &play->csCtx.frames;
if (*frames < 260) {
DemoDu_UpdateEyes(this);
@ -376,16 +374,16 @@ void DemoDu_CsGoronsRuby_UpdateFaceTextures(DemoDu* this, GlobalContext* globalC
}
}
void func_8096A630(DemoDu* this, GlobalContext* globalCtx) {
void func_8096A630(DemoDu* this, PlayState* play) {
s32 pad;
Vec3f pos = this->actor.world.pos;
pos.y += kREG(5);
func_80033480(globalCtx, &pos, kREG(1) + 100.0f, kREG(2) + 10, kREG(3) + 300, kREG(4), 0);
func_80033480(play, &pos, kREG(1) + 100.0f, kREG(2) + 10, kREG(3) + 300, kREG(4), 0);
DemoDu_CsPlaySfx_GoronLanding(this);
}
void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, PlayState* play) {
static Vec3f dustPosOffsets[] = {
{ 11.0f, -11.0f, -6.0f }, { 0.0f, 14.0f, -13.0f }, { 14.0f, -2.0f, -10.0f }, { 10.0f, -6.0f, -8.0f },
{ 8.0f, 6.0f, 8.0f }, { 13.0f, 8.0f, -10.0f }, { -14.0f, 1.0f, -14.0f }, { 5.0f, 12.0f, -9.0f },
@ -395,7 +393,7 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, GlobalContext* g
if (Animation_OnFrame(&this->skelAnime, 31.0f) || Animation_OnFrame(&this->skelAnime, 41.0f)) {
s32 pad[2];
s32 i;
Player* player = GET_PLAYER(globalCtx);
Player* player = GET_PLAYER(play);
Vec3f* pos = &player->bodyPartsPos[PLAYER_BODYPART_L_FOREARM];
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
Vec3f accel = { 0.0f, 0.3f, 0.0f };
@ -426,17 +424,17 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, GlobalContext* g
envColor.g += colorDelta;
envColor.b += colorDelta;
func_8002829C(globalCtx, &position, &velocity, &accel, &primColor, &envColor,
Rand_ZeroOne() * 40.0f + 200.0f, 0);
func_8002829C(play, &position, &velocity, &accel, &primColor, &envColor, Rand_ZeroOne() * 40.0f + 200.0f,
0);
}
DemoDu_CsPlaySfx_DaruniaHitsLink(globalCtx);
DemoDu_CsPlaySfx_DaruniaHitsLink(play);
}
}
void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, PlayState* play) {
s32 pad;
CutsceneContext* csCtx = &globalCtx->csCtx;
CutsceneContext* csCtx = &play->csCtx;
if (csCtx->state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = csCtx->npcActions[2];
@ -462,40 +460,40 @@ void DemoDu_CsGoronsRuby_DaruniaFalling(DemoDu* this, GlobalContext* globalCtx)
}
}
void DemoDu_CsGoronsRuby_AdvanceTo01(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_AdvanceTo01(DemoDu* this, PlayState* play) {
this->updateIndex = CS_GORONSRUBY_SUBSCENE(1);
}
void DemoDu_CsGoronsRuby_AdvanceTo02(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo02(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 1)) {
Animation_Change(&this->skelAnime, &gDaruniaStandUpAfterFallingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaStandUpAfterFallingAnim), 2, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(2);
this->drawIndex = 1;
DemoDu_CsGoronsRuby_DaruniaFalling(this, globalCtx);
DemoDu_CsGoronsRuby_DaruniaFalling(this, play);
}
}
}
void DemoDu_CsGoronsRuby_AdvanceTo03(DemoDu* this, GlobalContext* globalCtx) {
CutsceneContext* csCtx = &globalCtx->csCtx;
void DemoDu_CsGoronsRuby_AdvanceTo03(DemoDu* this, PlayState* play) {
CutsceneContext* csCtx = &play->csCtx;
if (csCtx->state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = csCtx->npcActions[2];
if ((npcAction != NULL) && (csCtx->frames >= npcAction->endFrame)) {
this->updateIndex = CS_GORONSRUBY_SUBSCENE(3);
func_8096A630(this, globalCtx);
func_8096A630(this, play);
}
}
}
void DemoDu_CsGoronsRuby_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo04(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 2)) {
this->updateIndex = CS_GORONSRUBY_SUBSCENE(4);
@ -511,9 +509,9 @@ void DemoDu_CsGoronsRuby_AdvanceTo05(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsGoronsRuby_AdvanceTo06(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo06(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 3)) {
Animation_Change(&this->skelAnime, &gDaruniaHitBreastAnim, 1.0f, 0.0f,
@ -531,9 +529,9 @@ void DemoDu_CsGoronsRuby_AdvanceTo07(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsGoronsRuby_AdvanceTo08(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo08(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 4)) {
Animation_Change(&this->skelAnime, &gDaruniaHitLinkAnim, 1.0f, 0.0f,
@ -559,9 +557,9 @@ void DemoDu_CsGoronsRuby_AdvanceTo10(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsGoronsRuby_AdvanceTo11(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo11(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 5)) {
Animation_Change(&this->skelAnime, &gDaruniaItemGiveAnim, 1.0f, 0.0f,
@ -579,9 +577,9 @@ void DemoDu_CsGoronsRuby_AdvanceTo12(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsGoronsRuby_AdvanceTo13(DemoDu* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
void DemoDu_CsGoronsRuby_AdvanceTo13(DemoDu* this, PlayState* play) {
if (play->csCtx.state != CS_STATE_IDLE) {
CsCmdActorAction* npcAction = play->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 6)) {
Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim),
@ -591,119 +589,119 @@ void DemoDu_CsGoronsRuby_AdvanceTo13(DemoDu* this, GlobalContext* globalCtx) {
}
}
void DemoDu_UpdateCs_GR_00(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsPlaySfx_DaruniaFalling(globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo01(this, globalCtx);
void DemoDu_UpdateCs_GR_00(DemoDu* this, PlayState* play) {
DemoDu_CsPlaySfx_DaruniaFalling(play);
DemoDu_CsGoronsRuby_AdvanceTo01(this, play);
}
void DemoDu_UpdateCs_GR_01(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsPlaySfx_DaruniaFalling(globalCtx);
DemoDu_CsPlaySfx_LinkSurprised(globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo02(this, globalCtx);
void DemoDu_UpdateCs_GR_01(DemoDu* this, PlayState* play) {
DemoDu_CsPlaySfx_DaruniaFalling(play);
DemoDu_CsPlaySfx_LinkSurprised(play);
DemoDu_CsGoronsRuby_AdvanceTo02(this, play);
}
void DemoDu_UpdateCs_GR_02(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsGoronsRuby_DaruniaFalling(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_CsPlaySfx_DaruniaFalling(globalCtx);
DemoDu_CsPlaySfx_LinkSurprised(globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo03(this, globalCtx);
void DemoDu_UpdateCs_GR_02(DemoDu* this, PlayState* play) {
DemoDu_CsGoronsRuby_DaruniaFalling(this, play);
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_CsPlaySfx_DaruniaFalling(play);
DemoDu_CsPlaySfx_LinkSurprised(play);
DemoDu_CsGoronsRuby_AdvanceTo03(this, play);
}
void DemoDu_UpdateCs_GR_03(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_CsPlaySfx_LinkSurprised(globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo04(this, globalCtx);
void DemoDu_UpdateCs_GR_03(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_CsPlaySfx_LinkSurprised(play);
DemoDu_CsGoronsRuby_AdvanceTo04(this, play);
}
void DemoDu_UpdateCs_GR_04(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_GR_04(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo05(this, animFinished);
}
void DemoDu_UpdateCs_GR_05(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_GR_05(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo06(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo06(this, play);
}
void DemoDu_UpdateCs_GR_06(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_GR_06(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsPlaySfx_HitBreast(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo07(this, animFinished);
}
void DemoDu_UpdateCs_GR_07(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_GR_07(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo08(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo08(this, play);
}
void DemoDu_UpdateCs_GR_08(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_GR_08(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(this, play);
DemoDu_CsGoronsRuby_AdvanceTo09(this, animFinished);
}
void DemoDu_UpdateCs_GR_09(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_GR_09(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsPlaySfx_HitBreast(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo10(this, animFinished);
}
void DemoDu_UpdateCs_GR_10(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_GR_10(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo11(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo11(this, play);
}
void DemoDu_UpdateCs_GR_11(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_GR_11(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo12(this, animFinished);
}
void DemoDu_UpdateCs_GR_12(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_GR_12(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsGoronsRuby_AdvanceTo13(this, globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsGoronsRuby_AdvanceTo13(this, play);
}
void DemoDu_UpdateCs_GR_13(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_GR_13(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, globalCtx);
DemoDu_CsPlaySfx_LinkEscapeFromGorons(globalCtx);
DemoDu_CsGoronsRuby_UpdateFaceTextures(this, play);
DemoDu_CsPlaySfx_LinkEscapeFromGorons(play);
}
void DemoDu_InitCs_AfterGanon(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_InitCs_AfterGanon(DemoDu* this, PlayState* play) {
s32 pad[3];
f32 lastFrame = Animation_GetLastFrame(&gDaruniaSageFormationAnim);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
Animation_Change(&this->skelAnime, &gDaruniaSageFormationAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, 0.0f);
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0);
this->actor.shape.shadowAlpha = 0;
@ -713,13 +711,13 @@ void DemoDu_CsPlaySfx_WhiteOut() {
func_800788CC(NA_SE_SY_WHITE_OUT_T);
}
void DemoDu_CsAfterGanon_SpawnDemo6K(DemoDu* this, GlobalContext* globalCtx) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x,
void DemoDu_CsAfterGanon_SpawnDemo6K(DemoDu* this, PlayState* play) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_6K, this->actor.world.pos.x,
kREG(16) + 22.0f + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 3);
}
void DemoDu_CsAfterGanon_AdvanceTo01(DemoDu* this, GlobalContext* globalCtx) {
if (DemoDu_IsNpcDoingThisAction(this, globalCtx, 4, 2)) {
void DemoDu_CsAfterGanon_AdvanceTo01(DemoDu* this, PlayState* play) {
if (DemoDu_IsNpcDoingThisAction(this, play, 4, 2)) {
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(1);
this->drawIndex = 2;
this->shadowAlpha = 0;
@ -729,11 +727,11 @@ void DemoDu_CsAfterGanon_AdvanceTo01(DemoDu* this, GlobalContext* globalCtx) {
}
}
void DemoDu_CsAfterGanon_AdvanceTo02(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsAfterGanon_AdvanceTo02(DemoDu* this, PlayState* play) {
f32* unk_1A4 = &this->unk_1A4;
s32 shadowAlpha = 255;
if (DemoDu_IsNpcDoingThisAction(this, globalCtx, 4, 2)) {
if (DemoDu_IsNpcDoingThisAction(this, play, 4, 2)) {
*unk_1A4 += 1.0f;
if (*unk_1A4 >= kREG(5) + 10.0f) {
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(2);
@ -759,44 +757,44 @@ void DemoDu_CsAfterGanon_AdvanceTo02(DemoDu* this, GlobalContext* globalCtx) {
this->actor.shape.shadowAlpha = shadowAlpha;
}
void DemoDu_CsAfterGanon_BackTo01(DemoDu* this, GlobalContext* globalCtx) {
if (DemoDu_IsNpcNotDoingThisAction(this, globalCtx, 4, 2)) {
void DemoDu_CsAfterGanon_BackTo01(DemoDu* this, PlayState* play) {
if (DemoDu_IsNpcNotDoingThisAction(this, play, 4, 2)) {
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(1);
this->drawIndex = 2;
this->unk_1A4 = kREG(5) + 10.0f;
this->shadowAlpha = 255;
if (!this->demo6KSpawned) {
DemoDu_CsAfterGanon_SpawnDemo6K(this, globalCtx);
DemoDu_CsAfterGanon_SpawnDemo6K(this, play);
this->demo6KSpawned = 1;
}
this->actor.shape.shadowAlpha = 255;
}
}
void DemoDu_UpdateCs_AG_00(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsAfterGanon_AdvanceTo01(this, globalCtx);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, globalCtx);
void DemoDu_UpdateCs_AG_00(DemoDu* this, PlayState* play) {
DemoDu_CsAfterGanon_AdvanceTo01(this, play);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
}
void DemoDu_UpdateCs_AG_01(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_AG_01(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsAfterGanon_AdvanceTo02(this, globalCtx);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, globalCtx);
DemoDu_CsAfterGanon_AdvanceTo02(this, play);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
}
void DemoDu_UpdateCs_AG_02(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_AG_02(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsAfterGanon_BackTo01(this, globalCtx);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, globalCtx);
DemoDu_CsAfterGanon_BackTo01(this, play);
DemoDu_CsAfterGanon_CheckIfShouldReset(this, play);
}
// Similar to DemoDu_Draw_01, but this uses POLY_XLU_DISP. Also uses this->shadowAlpha for setting the env color.
void DemoDu_Draw_02(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
void DemoDu_Draw_02(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
DemoDu* this = (DemoDu*)thisx;
s16 eyeTexIndex = this->eyeTexIndex;
void* eyeTexture = sEyeTextures[eyeTexIndex];
@ -805,9 +803,9 @@ void DemoDu_Draw_02(Actor* thisx, GlobalContext* globalCtx2) {
void* mouthTexture = sMouthTextures[mouthTexIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_du_inKenjyanomaDemo02.c", 275);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_du_inKenjyanomaDemo02.c", 275);
func_80093D84(globalCtx->state.gfxCtx);
func_80093D84(play->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(mouthTexture));
@ -817,14 +815,14 @@ void DemoDu_Draw_02(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_XLU_DISP++, 0x0C, &D_80116280[0]);
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0,
0, 0, POLY_XLU_DISP);
POLY_XLU_DISP = SkelAnime_DrawFlex(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, 0, 0,
POLY_XLU_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_du_inKenjyanomaDemo02.c", 304);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_du_inKenjyanomaDemo02.c", 304);
}
void DemoDu_InitCs_Credits(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, &gDaruniaCreditsIdleAnim, NULL, NULL, 0);
void DemoDu_InitCs_Credits(DemoDu* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gDaruniaSkel, &gDaruniaCreditsIdleAnim, NULL, NULL, 0);
this->updateIndex = CS_CREDITS_SUBSCENE(0);
this->drawIndex = 0;
this->actor.shape.shadowAlpha = 0;
@ -850,8 +848,8 @@ void DemoDu_CsCredits_UpdateShadowAlpha(DemoDu* this) {
}
}
void DemoDu_CsCredits_AdvanceTo01(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_MoveToNpcPos(this, globalCtx, 2);
void DemoDu_CsCredits_AdvanceTo01(DemoDu* this, PlayState* play) {
DemoDu_MoveToNpcPos(this, play, 2);
this->updateIndex = CS_CREDITS_SUBSCENE(1);
this->drawIndex = 2;
}
@ -880,8 +878,8 @@ void DemoDu_CsCredits_BackTo02(DemoDu* this, s32 animFinished) {
}
}
void DemoDu_CsCredits_HandleSubscenesByNpcAction(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(globalCtx, 2);
void DemoDu_CsCredits_HandleSubscenesByNpcAction(DemoDu* this, PlayState* play) {
CsCmdActorAction* npcAction = DemoDu_GetNpcAction(play, 2);
if (npcAction != NULL) {
s32 action = npcAction->action;
@ -890,7 +888,7 @@ void DemoDu_CsCredits_HandleSubscenesByNpcAction(DemoDu* this, GlobalContext* gl
if (action != lastAction) {
switch (action) {
case 9:
DemoDu_CsCredits_AdvanceTo01(this, globalCtx);
DemoDu_CsCredits_AdvanceTo01(this, play);
break;
case 10:
DemoDu_CsCredits_AdvanceTo03(this);
@ -908,36 +906,36 @@ void DemoDu_CsCredits_HandleSubscenesByNpcAction(DemoDu* this, GlobalContext* gl
}
}
void DemoDu_UpdateCs_CR_00(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, globalCtx);
void DemoDu_UpdateCs_CR_00(DemoDu* this, PlayState* play) {
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, play);
}
void DemoDu_UpdateCs_CR_01(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_CR_01(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsCredits_UpdateShadowAlpha(this);
DemoDu_CsCredits_AdvanceTo02(this);
}
void DemoDu_UpdateCs_CR_02(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_CR_02(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, globalCtx);
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, play);
}
void DemoDu_UpdateCs_CR_03(DemoDu* this, GlobalContext* globalCtx) {
DemoDu_UpdateBgCheckInfo(this, globalCtx);
void DemoDu_UpdateCs_CR_03(DemoDu* this, PlayState* play) {
DemoDu_UpdateBgCheckInfo(this, play);
DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, globalCtx);
DemoDu_CsCredits_HandleSubscenesByNpcAction(this, play);
}
void DemoDu_UpdateCs_CR_04(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_UpdateCs_CR_04(DemoDu* this, PlayState* play) {
s32 animFinished;
DemoDu_UpdateBgCheckInfo(this, globalCtx);
DemoDu_UpdateBgCheckInfo(this, play);
animFinished = DemoDu_UpdateSkelAnime(this);
DemoDu_UpdateEyes(this);
DemoDu_CsCredits_BackTo02(this, animFinished);
@ -952,7 +950,7 @@ static DemoDuActionFunc sUpdateFuncs[] = {
DemoDu_UpdateCs_CR_01, DemoDu_UpdateCs_CR_02, DemoDu_UpdateCs_CR_03, DemoDu_UpdateCs_CR_04,
};
void DemoDu_Update(Actor* thisx, GlobalContext* globalCtx) {
void DemoDu_Update(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
if (this->updateIndex < 0 || this->updateIndex >= 29 || sUpdateFuncs[this->updateIndex] == NULL) {
@ -960,38 +958,38 @@ void DemoDu_Update(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return;
}
sUpdateFuncs[this->updateIndex](this, globalCtx);
sUpdateFuncs[this->updateIndex](this, play);
}
void DemoDu_Init(Actor* thisx, GlobalContext* globalCtx) {
void DemoDu_Init(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
switch (this->actor.params) {
case DEMO_DU_CS_GORONS_RUBY:
DemoDu_InitCs_GoronsRuby(this, globalCtx);
DemoDu_InitCs_GoronsRuby(this, play);
break;
case DEMO_DU_CS_CHAMBER_AFTER_GANON:
DemoDu_InitCs_AfterGanon(this, globalCtx);
DemoDu_InitCs_AfterGanon(this, play);
break;
case DEMO_DU_CS_CREDITS:
DemoDu_InitCs_Credits(this, globalCtx);
DemoDu_InitCs_Credits(this, play);
break;
default:
DemoDu_InitCs_FireMedallion(this, globalCtx);
DemoDu_InitCs_FireMedallion(this, play);
break;
}
}
void DemoDu_Draw_NoDraw(Actor* thisx, GlobalContext* globalCtx2) {
void DemoDu_Draw_NoDraw(Actor* thisx, PlayState* play2) {
}
// Similar to DemoDu_Draw_02, but this uses POLY_OPA_DISP. Sets the env color to 255.
void DemoDu_Draw_01(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
void DemoDu_Draw_01(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
DemoDu* this = (DemoDu*)thisx;
s16 eyeTexIndex = this->eyeTexIndex;
void* eyeTexture = sEyeTextures[eyeTexIndex];
@ -1000,9 +998,9 @@ void DemoDu_Draw_01(Actor* thisx, GlobalContext* globalCtx2) {
void* mouthTexture = sMouthTextures[mouthTexIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_du.c", 615);
OPEN_DISPS(play->state.gfxCtx, "../z_demo_du.c", 615);
func_80093D18(globalCtx->state.gfxCtx);
func_80093D18(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(mouthTexture));
@ -1012,10 +1010,9 @@ void DemoDu_Draw_01(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]);
SkelAnime_DrawFlexOpa(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, NULL, NULL,
this);
SkelAnime_DrawFlexOpa(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, NULL, NULL, this);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_du.c", 638);
CLOSE_DISPS(play->state.gfxCtx, "../z_demo_du.c", 638);
}
static DemoDuDrawFunc sDrawFuncs[] = {
@ -1024,7 +1021,7 @@ static DemoDuDrawFunc sDrawFuncs[] = {
DemoDu_Draw_02,
};
void DemoDu_Draw(Actor* thisx, GlobalContext* globalCtx) {
void DemoDu_Draw(Actor* thisx, PlayState* play) {
DemoDu* this = (DemoDu*)thisx;
if (this->drawIndex < 0 || this->drawIndex >= 3 || sDrawFuncs[this->drawIndex] == NULL) {
@ -1032,7 +1029,7 @@ void DemoDu_Draw(Actor* thisx, GlobalContext* globalCtx) {
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return;
}
sDrawFuncs[this->drawIndex](thisx, globalCtx);
sDrawFuncs[this->drawIndex](thisx, play);
}
const ActorInit Demo_Du_InitVars = {