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

@ -618,13 +618,13 @@ void EnFish_Cutscene_WiggleFlyingThroughAir(EnFish* this, PlayState* play) {
void EnFish_UpdateCutscene(EnFish* this, PlayState* play) {
s32 pad;
s32 pad2;
CsCmdActorAction* csAction = play->csCtx.npcActions[1];
CsCmdActorCue* cue = play->csCtx.actorCues[1];
Vec3f startPos;
Vec3f endPos;
f32 progress;
f32 lerp;
s32 bgId;
if (csAction == NULL) {
if (cue == NULL) {
// "Warning : DEMO ended without dousa (action) 3 termination being called"
osSyncPrintf("Warning : dousa 3 消滅 が呼ばれずにデモが終了した(%s %d)(arg_data 0x%04x)\n", "../z_en_sakana.c",
1169, this->actor.params);
@ -636,7 +636,7 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) {
this->slowPhase += 0x111;
this->fastPhase += 0x500;
switch (csAction->action) {
switch (cue->id) {
case 1:
EnFish_Cutscene_FlopOnGround(this, play);
break;
@ -655,18 +655,19 @@ void EnFish_UpdateCutscene(EnFish* this, PlayState* play) {
break;
}
startPos.x = csAction->startPos.x;
startPos.y = csAction->startPos.y;
startPos.z = csAction->startPos.z;
endPos.x = csAction->endPos.x;
endPos.y = csAction->endPos.y;
endPos.z = csAction->endPos.z;
startPos.x = cue->startPos.x;
startPos.y = cue->startPos.y;
startPos.z = cue->startPos.z;
progress = Environment_LerpWeight(csAction->endFrame, csAction->startFrame, play->csCtx.frames);
endPos.x = cue->endPos.x;
endPos.y = cue->endPos.y;
endPos.z = cue->endPos.z;
this->actor.world.pos.x = (endPos.x - startPos.x) * progress + startPos.x;
this->actor.world.pos.y = (endPos.y - startPos.y) * progress + startPos.y + D_80A17014;
this->actor.world.pos.z = (endPos.z - startPos.z) * progress + startPos.z;
lerp = Environment_LerpWeight(cue->endFrame, cue->startFrame, play->csCtx.curFrame);
this->actor.world.pos.x = (endPos.x - startPos.x) * lerp + startPos.x;
this->actor.world.pos.y = (endPos.y - startPos.y) * lerp + startPos.y + D_80A17014;
this->actor.world.pos.z = (endPos.z - startPos.z) * lerp + startPos.z;
this->actor.floorHeight =
BgCheck_EntityRaycastDown4(&play->colCtx, &this->actor.floorPoly, &bgId, &this->actor, &this->actor.world.pos);
@ -742,7 +743,7 @@ void EnFish_Update(Actor* thisx, PlayState* play) {
EnFish* this = (EnFish*)thisx;
if ((D_80A17010 == NULL) && (this->actor.params == FISH_DROPPED) && (play->csCtx.state != 0) &&
(play->csCtx.npcActions[1] != NULL)) {
(play->csCtx.actorCues[1] != NULL)) {
EnFish_SetCutsceneData(this);
}