From 630212af0d2a883f131e3268430aec810f5da557 Mon Sep 17 00:00:00 2001
From: Thar0 <17233964+Thar0@users.noreply.github.com>
Date: Wed, 4 Oct 2023 00:30:10 +0100
Subject: [PATCH] Further review changes
---
assets/xml/objects/object_po_composer.xml | 2 +-
.../ovl_En_Po_Composer/z_en_po_composer.c | 50 +++++++++----------
.../ovl_En_Po_Composer/z_en_po_composer.h | 13 ++---
3 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/assets/xml/objects/object_po_composer.xml b/assets/xml/objects/object_po_composer.xml
index 67036066f..4b5ca10b8 100644
--- a/assets/xml/objects/object_po_composer.xml
+++ b/assets/xml/objects/object_po_composer.xml
@@ -58,6 +58,6 @@
-
+
diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
index daa4f6338..e223c4504 100644
--- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
+++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
@@ -197,7 +197,7 @@ void EnPoComposer_Init(Actor* thisx, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->lightColor = sLightColorInit;
this->envColor = sEnvColorInit;
- this->lastCsAction = COMPOSER_CUEID_NONE;
+ this->cueId = COMPOSER_CUEID_NONE;
if (PO_COMPOSER_IS_FLAT(&this->actor)) {
this->sharpCsNum = 0;
@@ -365,65 +365,65 @@ void EnPoComposer_Idle(EnPoComposer* this, PlayState* play) {
}
void EnPoComposer_SetupRaiseArms(EnPoComposer* this) {
- this->csActionTimer = 0;
+ this->csCueTimer = 0;
Actor_PlaySfx(&this->actor, NA_SE_EN_SHARP_REACTION);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_RAISE_ARMS);
this->actionFunc = EnPoComposer_RaiseArms;
}
void EnPoComposer_RaiseArms(EnPoComposer* this, PlayState* play) {
- if ((this->csActionTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->csActionTimer++;
+ if ((this->csCueTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->csCueTimer++;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_ARMS_RAISED);
}
}
void EnPoComposer_SetupLowerArms(EnPoComposer* this) {
- this->csActionTimer = 0;
+ this->csCueTimer = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_LOWER_ARMS);
this->actionFunc = EnPoComposer_LowerArms;
}
void EnPoComposer_LowerArms(EnPoComposer* this, PlayState* play) {
- if ((this->csActionTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->csActionTimer++;
+ if ((this->csCueTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->csCueTimer++;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_IDLE_FACING_DOWN);
}
}
void EnPoComposer_SetupCutscenePlayCurse(EnPoComposer* this) {
- this->csActionTimer = 0;
+ this->csCueTimer = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_BEGIN_PLAYING_CURSE);
this->actionFunc = EnPoComposer_CutscenePlayCurse;
}
void EnPoComposer_CutscenePlayCurse(EnPoComposer* this, PlayState* play) {
- if ((this->csActionTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->csActionTimer++;
+ if ((this->csCueTimer == 0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->csCueTimer++;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_PLAYING_CURSE);
}
}
void EnPoComposer_SetupRoll(EnPoComposer* this) {
- this->csActionTimer = 0;
+ this->csCueTimer = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_BEGIN_ROLLING);
this->actionFunc = EnPoComposer_Roll;
}
void EnPoComposer_Roll(EnPoComposer* this, PlayState* play) {
- if (this->csActionTimer == 0) {
+ if (this->csCueTimer == 0) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->csActionTimer++;
+ this->csCueTimer++;
Actor_PlaySfx(&this->actor, NA_SE_EN_SHARP_REACTION);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, PO_COMPOSER_ANIM_ROLLING);
}
- } else if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->lightColor.a >= 33)) {
- if (this->csActionTimer == 1) {
+ } else if (Animation_OnFrame(&this->skelAnime, 1.0f) && (this->lightColor.a > 32)) {
+ if (this->csCueTimer == 1) {
Actor_PlaySfx(&this->actor, NA_SE_EN_LAST3_DEAD_WIND2_OLD);
- this->csActionTimer = 2;
+ this->csCueTimer = 2;
} else {
Actor_PlaySfx(&this->actor, NA_SE_EN_LAST3_DEAD_WIND3_OLD);
- this->csActionTimer = 1;
+ this->csCueTimer = 1;
}
}
}
@@ -444,8 +444,8 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
if (Cutscene_IsCueInChannel(play, cueType)) {
cueChannel = Cutscene_GetCueChannel(play, cueType);
- if (this->lastCsAction != play->csCtx.actorCues[cueChannel]->id) {
- this->lastCsAction = play->csCtx.actorCues[cueChannel]->id;
+ if (this->cueId != play->csCtx.actorCues[cueChannel]->id) {
+ this->cueId = play->csCtx.actorCues[cueChannel]->id;
switch (play->csCtx.actorCues[cueChannel]->id) {
case COMPOSER_CUEID_IDLE: // loop idle
@@ -516,8 +516,8 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
return true;
}
- if (this->actionFunc != EnPoComposer_StartedCutscene && this->actionFunc != EnPoComposer_StartCutscene &&
- this->actionFunc != EnPoComposer_PlayCurse && play->csCtx.state == CS_STATE_IDLE) {
+ if ((this->actionFunc != EnPoComposer_StartedCutscene) && (this->actionFunc != EnPoComposer_StartCutscene) &&
+ (this->actionFunc != EnPoComposer_PlayCurse) && (play->csCtx.state == CS_STATE_IDLE)) {
if (PO_COMPOSER_IS_FLAT(&this->actor)) {
EnPoComposer_SetupStartedCutscene(this);
@@ -527,7 +527,7 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
this->inCutscene = false;
if (this->sharpCsNum < SHARP_CS_SONG_STORMS) {
- if (!(CHECK_WEEKEVENTREG(WEEKEVENTREG_14_02))) {
+ if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_14_02)) {
SET_WEEKEVENTREG(WEEKEVENTREG_14_02);
}
EnPoComposer_SetupPlayCurse(this);
@@ -537,7 +537,7 @@ s32 EnPoComposer_UpdateAction(EnPoComposer* this, PlayState* play) {
}
}
- this->lastCsAction = COMPOSER_CUEID_NONE;
+ this->cueId = COMPOSER_CUEID_NONE;
return false;
}
@@ -628,7 +628,7 @@ s32 EnPoComposer_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V
gDPSetEnvColor((*gfx)++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
}
- return 0;
+ return false;
}
void EnPoComposer_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
@@ -739,7 +739,7 @@ void EnPoComposer_Draw(Actor* thisx, PlayState* play) {
lightPos.z += (s16)lightOffset.z;
Lights_PointGlowSetInfo(&this->lightInfo, lightPos.x, lightPos.y, lightPos.z, this->envColor.r, this->envColor.g,
- this->envColor.b, this->envColor.a * 0.78431374f);
+ this->envColor.b, this->envColor.a * (200.0f / 255.0f));
CLOSE_DISPS(play->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
index c067b8d5e..535a63b3b 100644
--- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
+++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.h
@@ -19,14 +19,15 @@ typedef enum {
/* 9 */ COMPOSER_CUEID_DISAPPEAR,
/* 10 */ COMPOSER_CUEID_DONE,
/* 99 */ COMPOSER_CUEID_NONE = 99
-} EnPoComposerCutsceneAction;
+} EnPoComposerCueId;
typedef enum {
/* 0 */ SHARP_CS_ENCOUNTER_FIRST,
/* 1 */ SHARP_CS_ENCOUNTER_OTHER,
/* 2 */ SHARP_CS_SONG_HEALING,
- /* 3 */ SHARP_CS_SONG_STORMS
-} SharpCsId;
+ /* 3 */ SHARP_CS_SONG_STORMS,
+ /* 4 */ SHARP_CS_MAX
+} SharpCsIdIndex;
struct EnPoComposer;
@@ -46,12 +47,12 @@ typedef struct EnPoComposer {
/* 0x290 */ s32 sharpCsNum;
/* 0x294 */ Vec3s jointTable[PO_COMPOSER_LIMB_MAX];
/* 0x2DC */ Vec3s morphTable[PO_COMPOSER_LIMB_MAX];
- /* 0x324 */ s16 csIds[4];
+ /* 0x324 */ s16 csIds[SHARP_CS_MAX];
/* 0x32C */ s16 actionTimer;
- /* 0x32E */ s16 csActionTimer;
+ /* 0x32E */ s16 csCueTimer;
/* 0x330 */ s16 inCutscene;
/* 0x332 */ s16 visible;
- /* 0x334 */ u16 lastCsAction;
+ /* 0x334 */ u16 cueId;
/* 0x336 */ Color_RGBA8 lightColor;
/* 0x33A */ Color_RGBA8 envColor;
} EnPoComposer; // size = 0x340