1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 22:41:14 +00:00

z_demo documentation (#1327)

* commit old stuff

* progress

* progress

* progress

* progress

* more progress, renaming cues next

* small changes

* enum values added for all actions

* hardcoded values removed when possible

* commands renamed

* first pass of action -> cue

* fix some matches

* some more cleanup

* scriptPtr

* forgot one

* remove cue rot union

* more changes

* some more stuff

* more stuff

* fix matching issues

* some more things

* progress, starting to rename destinations

* small changes

* name some destinations

* more names

* need to switch branch

* progress

* first pass of destination names

* usages fixed

* use destination enum

* fix csdis

* format

* command descriptions

* revert accidental zap changes

* forgot some things

* use a single macro for CutsceneCameraPoint (idk why i didnt think of this sooner)

* typo

* review1

* clarify ruby/sapphire comment

* remove endframe for commands that dont use it

* some more review

* most review, but not all

* scriptPtr -> script, and another small change

* ocarina action

* remove +1 from light settings command, change comment

* actionIndex -> cueIdTemp (i guess)

* _SetCueX -> _SetXFromCue

* format

* tweak fade out seq arg names

* use spline terminology

* more dragorn and engineer review

* misc start/end frame note

* cleanup StartPosRotFromCue vs PosRotFromCue

* cleanup spline terminology

* sPrevCamId -> sReturnToCamId

* comment on debug cs data address

* Cutscene_Init -> Cutscene_InitContext

* single point types are not a list

* remove todo comment

* some more review

* rumble struct names

* some review

* more review

* missed one

* reword pointer comment

* even more review

* match transition terminology with z_play

* change condition and format

* frame count

* command specific structs with alignment

* anon review

* remove unneeded arg from time macro

* yeet `CsCmdGeneric`

* remove unused from single point types

* typo

* compromise attempt -- name endFrame everywhere

* fixes

* fix again

* copied the wrong note

* cutscene data note

* review, format

* compat defines

* idk whats going on man

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
fig02 2022-12-24 13:55:17 -05:00 committed by GitHub
parent 92e03cf747
commit 7927e7b330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 6392 additions and 5954 deletions

View file

@ -195,15 +195,15 @@ static s16 sTimer = 0;
void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
u8 type = this->actor.params >> 8;
u16 csFrames;
u16 csCurFrame;
s32 animationEnded;
if (type == ENVIEWER_TYPE_2_ZELDA) {
if (gSaveContext.sceneLayer == 5) {
csFrames = play->csCtx.frames;
if (csFrames == 792) {
csCurFrame = play->csCtx.curFrame;
if (csCurFrame == 792) {
Actor_PlaySfx(&this->actor, NA_SE_VO_Z0_SURPRISE);
} else if (csFrames == 845) {
} else if (csCurFrame == 845) {
Actor_PlaySfx(&this->actor, NA_SE_VO_Z0_THROW);
}
}
@ -214,7 +214,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
this->actor.uncullZoneDownward = 10000.0f;
} else if (type == ENVIEWER_TYPE_3_GANONDORF) {
if (gSaveContext.sceneLayer == 4) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 20:
case 59:
case 71:
@ -232,18 +232,18 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
}
}
if (gSaveContext.sceneLayer == 5) {
if (play->csCtx.frames == 1508) {
if (play->csCtx.curFrame == 1508) {
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_ST_LAUGH);
}
if (play->csCtx.frames == 1545) {
if (play->csCtx.curFrame == 1545) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DEMO_6K, 32.0f, 101.0f, 1226.0f, 0, 0, 0,
0xC);
}
}
if (play->csCtx.frames == 1020) {
if (play->csCtx.curFrame == 1020) {
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_FANFARE, 0, 0, NA_BGM_OPENING_GANON);
}
if (play->csCtx.frames == 960) {
if (play->csCtx.curFrame == 960) {
Audio_PlaySfxGeneral(NA_SE_EV_HORSE_GROAN, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
@ -279,8 +279,8 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
animationEnded = SkelAnime_Update(&this->skin.skelAnime);
if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_4_HORSE_GANONDORF) {
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[1] != NULL) {
if (play->csCtx.npcActions[1]->action == 2 && sTimer == 0) {
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[1] != NULL) {
if (play->csCtx.actorCues[1]->id == 2 && sTimer == 0) {
if (type == ENVIEWER_TYPE_3_GANONDORF) {
if (this->skin.skelAnime.animation != &gYoungGanondorfHorsebackIdleAnim) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gYoungGanondorfHorsebackIdleAnim, 1.0f);
@ -288,7 +288,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
} else if (this->skin.skelAnime.animation != &gHorseGanonIdleAnim) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gHorseGanonIdleAnim, 1.0f);
}
} else if (play->csCtx.npcActions[1]->action == 1) {
} else if (play->csCtx.actorCues[1]->id == 1) {
sTimer = 100;
if (type == ENVIEWER_TYPE_3_GANONDORF) {
if (this->skin.skelAnime.animation != &gYoungGanondorfHorsebackRearAnim) {
@ -300,7 +300,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
} else if (type == ENVIEWER_TYPE_3_GANONDORF) {
switch (this->state) {
case 0:
if (play->csCtx.npcActions[1]->action == 4) {
if (play->csCtx.actorCues[1]->id == 4) {
Animation_MorphToPlayOnce(&this->skin.skelAnime,
&gYoungGanondorfHorsebackLookSidewaysStartAnim, -5.0f);
this->state++;
@ -314,7 +314,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
}
break;
case 2:
if (play->csCtx.npcActions[1]->action == 5) {
if (play->csCtx.actorCues[1]->id == 5) {
Animation_MorphToPlayOnce(&this->skin.skelAnime,
&gYoungGanondorfHorsebackMagicChargeUpStartAnim, -5.0f);
this->state++;
@ -328,20 +328,20 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
}
break;
case 4:
if (play->csCtx.npcActions[1]->action == 11) {
if (play->csCtx.actorCues[1]->id == 11) {
Animation_MorphToLoop(&this->skin.skelAnime, &gYoungGanondorfHorsebackLookSidewaysLoopAnim,
-20.0f);
this->state++;
}
break;
case 5:
if (play->csCtx.npcActions[1]->action == 8) {
if (play->csCtx.actorCues[1]->id == 8) {
Animation_MorphToLoop(&this->skin.skelAnime, &gYoungGanondorfHorsebackIdleAnim, -15.0f);
this->state++;
}
break;
case 6:
if (play->csCtx.npcActions[1]->action == 12) {
if (play->csCtx.actorCues[1]->id == 12) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GANON_VOICE_DEMO);
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gYoungGanondorfHorsebackRideAnim, 3.0f);
this->state++;
@ -352,34 +352,34 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
break;
}
} else if (this->skin.skelAnime.animation != &gHorseGanonGallopingAnim &&
play->csCtx.npcActions[1]->action == 12) {
play->csCtx.actorCues[1]->id == 12) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gHorseGanonGallopingAnim, 3.0f);
}
}
} else if (type == ENVIEWER_TYPE_1_IMPA) {
if (gSaveContext.sceneLayer == 5) {
if (play->csCtx.frames == 845) {
if (play->csCtx.curFrame == 845) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_ITEM_OCARINA, 4.0f, 81.0f, 2600.0f, 0, 0,
0, 0);
}
} else {
if (play->csCtx.frames == 195) {
if (play->csCtx.curFrame == 195) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_ITEM_OCARINA, 4.0f, 81.0f, 2035.0f, 0, 0,
0, 1);
}
}
switch (this->state) {
case 0:
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL &&
play->csCtx.npcActions[0]->action == 6 &&
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL &&
play->csCtx.actorCues[0]->id == 6 &&
this->skin.skelAnime.animation != &object_opening_demo1_Anim_002574) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &object_opening_demo1_Anim_002574, 1.5f);
this->state++;
}
break;
case 1:
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL &&
play->csCtx.npcActions[0]->action == 2 &&
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL &&
play->csCtx.actorCues[0]->id == 2 &&
this->skin.skelAnime.animation != &object_opening_demo1_Anim_0029CC) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &object_opening_demo1_Anim_0029CC, 3.0f);
this->state++;
@ -391,7 +391,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
switch (this->state) {
case 0:
if (play->csCtx.state != CS_STATE_IDLE) {
if (play->csCtx.npcActions[0] != NULL && play->csCtx.npcActions[0]->action == 6 &&
if (play->csCtx.actorCues[0] != NULL && play->csCtx.actorCues[0]->id == 6 &&
this->skin.skelAnime.animation != &object_opening_demo1_Anim_001410) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &object_opening_demo1_Anim_001410, 1.5f);
this->state++;
@ -400,7 +400,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
break;
case 1:
if (play->csCtx.state != CS_STATE_IDLE) {
if (play->csCtx.npcActions[0] != NULL && play->csCtx.npcActions[0]->action == 2 &&
if (play->csCtx.actorCues[0] != NULL && play->csCtx.actorCues[0]->id == 2 &&
this->skin.skelAnime.animation != &object_opening_demo1_Anim_000450) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &object_opening_demo1_Anim_000450, 3.0f);
this->state++;
@ -416,7 +416,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
this->state++;
break;
case 1:
if (play->csCtx.npcActions[0]->action == 11) {
if (play->csCtx.actorCues[0]->id == 11) {
Animation_MorphToPlayOnce(&this->skin.skelAnime, &object_opening_demo1_Anim_00420C, -5.0f);
this->state++;
}
@ -434,8 +434,8 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
} else if (type == ENVIEWER_TYPE_7_GANONDORF) {
switch (this->state) {
case 0:
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[1] != NULL &&
play->csCtx.npcActions[1]->action == 7) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[1] != NULL) &&
(play->csCtx.actorCues[1]->id == 7)) {
Audio_PlaySfxGeneral(NA_SE_EN_GANON_LAUGH, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
Animation_MorphToPlayOnce(&this->skin.skelAnime, &gYoungGanondorfLaughStartAnim, -5.0f);
@ -453,14 +453,14 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
switch (this->state) {
case 0:
if (play->csCtx.state != CS_STATE_IDLE) {
if (play->csCtx.npcActions[1] != NULL && play->csCtx.npcActions[1]->action == 9) {
if ((play->csCtx.actorCues[1] != NULL) && (play->csCtx.actorCues[1]->id == 9)) {
Animation_PlayLoopSetSpeed(&this->skin.skelAnime, &gYoungGanondorfWalkAnim, 1.0f);
this->state++;
}
}
break;
case 1:
if (play->csCtx.npcActions[1]->action == 10) {
if (play->csCtx.actorCues[1]->id == 10) {
Animation_MorphToPlayOnce(&this->skin.skelAnime, &gYoungGanondorfKneelStartAnim, -10.0f);
this->state++;
}
@ -472,7 +472,7 @@ void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) {
}
break;
case 3:
if (play->csCtx.npcActions[1]->action == 4) {
if (play->csCtx.actorCues[1]->id == 4) {
Animation_MorphToPlayOnce(&this->skin.skelAnime, &gYoungGanondorfKneelLookSidewaysAnim, -5.0f);
this->state++;
}
@ -494,13 +494,13 @@ void EnViewer_Update(Actor* thisx, PlayState* play) {
s32 EnViewer_Ganondorf3OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
void* thisx) {
if (gSaveContext.sceneLayer == 4) {
if (play->csCtx.frames >= 400) {
if (play->csCtx.curFrame >= 400) {
if (limbIndex == YOUNG_GANONDORF_LIMB_LEFT_HAND) {
*dList = gYoungGanondorfOpenLeftHandDL;
}
}
} else {
if (play->csCtx.frames >= 1510 && play->csCtx.frames <= 1650) {
if ((play->csCtx.curFrame >= 1510) && (play->csCtx.curFrame <= 1650)) {
if (limbIndex == YOUNG_GANONDORF_LIMB_LEFT_HAND) {
*dList = gYoungGanondorfOpenLeftHandDL;
}
@ -533,22 +533,24 @@ void EnViewer_DrawGanondorf(EnViewer* this, PlayState* play) {
s16 type;
OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1405);
type = this->actor.params >> 8;
if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF ||
type == ENVIEWER_TYPE_8_GANONDORF) {
if (gSaveContext.sceneLayer != 4) {
frames = 149;
}
if (frames + 1127 >= play->csCtx.frames) {
if (frames + 1127 >= play->csCtx.curFrame) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeOpenTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeOpenTex));
} else if (frames + 1128 >= play->csCtx.frames) {
} else if (frames + 1128 >= play->csCtx.curFrame) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeHalfTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeHalfTex));
} else if (frames + 1129 >= play->csCtx.frames) {
} else if (frames + 1129 >= play->csCtx.curFrame) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeClosedTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gYoungGanondorfEyeClosedTex));
@ -570,7 +572,7 @@ void EnViewer_DrawGanondorf(EnViewer* this, PlayState* play) {
EnViewer_UpdateGanondorfCape(play, this);
} else if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF ||
type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[1] != NULL)) {
if ((play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.actorCues[1] != NULL)) {
SkelAnime_DrawFlexOpa(play, this->skin.skelAnime.skeleton, this->skin.skelAnime.jointTable,
this->skin.skelAnime.dListCount, NULL, EnViewer_GanondorfPostLimbDrawUpdateCapeVec,
this);
@ -625,22 +627,22 @@ void EnViewer_ZeldaPostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
void EnViewer_DrawZelda(EnViewer* this, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1583);
if (play->sceneId == SCENE_HYRULE_FIELD) {
if (play->csCtx.frames < 771) {
if (play->csCtx.curFrame < 771) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeInTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeOutTex));
} else if (play->csCtx.frames < 772) {
} else if (play->csCtx.curFrame < 772) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeBlinkTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeBlinkTex));
} else if (play->csCtx.frames < 773) {
} else if (play->csCtx.curFrame < 773) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeShutTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeShutTex));
} else if (play->csCtx.frames < 791) {
} else if (play->csCtx.curFrame < 791) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeWideTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeWideTex));
} else if (play->csCtx.frames < 792) {
} else if (play->csCtx.curFrame < 792) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeBlinkTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeBlinkTex));
} else if (play->csCtx.frames < 793) {
} else if (play->csCtx.curFrame < 793) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeShutTex));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(gChildZeldaEyeShutTex));
} else {
@ -651,9 +653,9 @@ void EnViewer_DrawZelda(EnViewer* this, PlayState* play) {
if (gSaveContext.sceneLayer == 6) {
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(gChildZeldaMouthSurprisedTex));
} else {
if (play->csCtx.frames < 758) {
if (play->csCtx.curFrame < 758) {
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(gChildZeldaMouthWorriedTex));
} else if (play->csCtx.frames < 848) {
} else if (play->csCtx.curFrame < 848) {
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(gChildZeldaMouthSurprisedTex));
} else {
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(gChildZeldaMouthWorriedTex));
@ -704,11 +706,11 @@ void EnViewer_Draw(Actor* thisx, PlayState* play) {
if (this->isVisible) {
type = this->actor.params >> 8;
if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL) {
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
sDrawFuncs[this->drawFuncIndex](this, play);
}
} else if ((play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[1] != NULL) ||
} else if ((play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[1] != NULL) ||
type == ENVIEWER_TYPE_9_GANONDORF) {
Gfx_SetupDL_25Opa(play->state.gfxCtx);
sDrawFuncs[this->drawFuncIndex](this, play);
@ -724,8 +726,8 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) {
s16 type = this->actor.params >> 8;
if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL &&
play->csCtx.frames < play->csCtx.npcActions[0]->endFrame) {
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL &&
play->csCtx.curFrame < play->csCtx.actorCues[0]->endFrame) {
if (type == ENVIEWER_TYPE_0_HORSE_ZELDA) {
if (!sHorseSfxPlayed) {
sHorseSfxPlayed = true;
@ -735,34 +737,34 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_HORSE_RUN_LEVEL - SFX_FLAG);
}
startPos.x = play->csCtx.npcActions[0]->startPos.x;
startPos.y = play->csCtx.npcActions[0]->startPos.y;
startPos.z = play->csCtx.npcActions[0]->startPos.z;
endPos.x = play->csCtx.npcActions[0]->endPos.x;
endPos.y = play->csCtx.npcActions[0]->endPos.y;
endPos.z = play->csCtx.npcActions[0]->endPos.z;
lerpFactor = Environment_LerpWeight(play->csCtx.npcActions[0]->endFrame,
play->csCtx.npcActions[0]->startFrame, play->csCtx.frames);
startPos.x = play->csCtx.actorCues[0]->startPos.x;
startPos.y = play->csCtx.actorCues[0]->startPos.y;
startPos.z = play->csCtx.actorCues[0]->startPos.z;
endPos.x = play->csCtx.actorCues[0]->endPos.x;
endPos.y = play->csCtx.actorCues[0]->endPos.y;
endPos.z = play->csCtx.actorCues[0]->endPos.z;
lerpFactor = Environment_LerpWeight(play->csCtx.actorCues[0]->endFrame,
play->csCtx.actorCues[0]->startFrame, play->csCtx.curFrame);
this->actor.world.pos.x = (endPos.x - startPos.x) * lerpFactor + startPos.x;
this->actor.world.pos.y = (endPos.y - startPos.y) * lerpFactor + startPos.y;
this->actor.world.pos.z = (endPos.z - startPos.z) * lerpFactor + startPos.z;
}
} else { // ganondorf and ganondorf's horse
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[1] != NULL &&
play->csCtx.frames < play->csCtx.npcActions[1]->endFrame) {
startPos.x = play->csCtx.npcActions[1]->startPos.x;
startPos.y = play->csCtx.npcActions[1]->startPos.y;
startPos.z = play->csCtx.npcActions[1]->startPos.z;
endPos.x = play->csCtx.npcActions[1]->endPos.x;
endPos.y = play->csCtx.npcActions[1]->endPos.y;
endPos.z = play->csCtx.npcActions[1]->endPos.z;
lerpFactor = Environment_LerpWeight(play->csCtx.npcActions[1]->endFrame,
play->csCtx.npcActions[1]->startFrame, play->csCtx.frames);
if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[1] != NULL &&
play->csCtx.curFrame < play->csCtx.actorCues[1]->endFrame) {
startPos.x = play->csCtx.actorCues[1]->startPos.x;
startPos.y = play->csCtx.actorCues[1]->startPos.y;
startPos.z = play->csCtx.actorCues[1]->startPos.z;
endPos.x = play->csCtx.actorCues[1]->endPos.x;
endPos.y = play->csCtx.actorCues[1]->endPos.y;
endPos.z = play->csCtx.actorCues[1]->endPos.z;
lerpFactor = Environment_LerpWeight(play->csCtx.actorCues[1]->endFrame,
play->csCtx.actorCues[1]->startFrame, play->csCtx.curFrame);
this->actor.world.pos.x = (endPos.x - startPos.x) * lerpFactor + startPos.x;
this->actor.world.pos.y = (endPos.y - startPos.y) * lerpFactor + startPos.y;
this->actor.world.pos.z = (endPos.z - startPos.z) * lerpFactor + startPos.z;
if (play->csCtx.npcActions[1]->action == 12) {
if (play->csCtx.actorCues[1]->id == 12) {
s16 yaw = Math_Vec3f_Yaw(&startPos, &endPos);
Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 0xA, 0x3E8, 1);
@ -770,12 +772,12 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) {
}
if (type == ENVIEWER_TYPE_9_GANONDORF) {
this->actor.world.rot.x = play->csCtx.npcActions[1]->urot.x;
this->actor.world.rot.y = play->csCtx.npcActions[1]->urot.y;
this->actor.world.rot.z = play->csCtx.npcActions[1]->urot.z;
this->actor.shape.rot.x = play->csCtx.npcActions[1]->urot.x;
this->actor.shape.rot.y = play->csCtx.npcActions[1]->urot.y;
this->actor.shape.rot.z = play->csCtx.npcActions[1]->urot.z;
this->actor.world.rot.x = play->csCtx.actorCues[1]->rot.x;
this->actor.world.rot.y = play->csCtx.actorCues[1]->rot.y;
this->actor.world.rot.z = play->csCtx.actorCues[1]->rot.z;
this->actor.shape.rot.x = play->csCtx.actorCues[1]->rot.x;
this->actor.shape.rot.y = play->csCtx.actorCues[1]->rot.y;
this->actor.shape.rot.z = play->csCtx.actorCues[1]->rot.z;
}
}
if (type == ENVIEWER_TYPE_5_GANONDORF) {