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

@ -34,17 +34,17 @@ s32 DemoIk_UpdateSkelAnime(DemoIk* this) {
return SkelAnime_Update(&this->skelAnime);
}
CsCmdActorAction* DemoIk_GetCue(PlayState* play, s32 index) {
CsCmdActorCue* DemoIk_GetCue(PlayState* play, s32 cueChannel) {
if (play->csCtx.state != CS_STATE_IDLE) {
return play->csCtx.npcActions[index];
return play->csCtx.actorCues[cueChannel];
}
return NULL;
}
s32 DemoIk_CheckCue(PlayState* play, u16 action, s32 index) {
CsCmdActorAction* cue = DemoIk_GetCue(play, index);
s32 DemoIk_CheckForCue(PlayState* play, u16 cueId, s32 cueChannel) {
CsCmdActorCue* cue = DemoIk_GetCue(play, cueChannel);
if ((cue != NULL) && (cue->action == action)) {
if ((cue != NULL) && (cue->id == cueId)) {
return 1;
}
return 0;
@ -73,7 +73,7 @@ Gfx* DemoIk_SetColors(GraphicsContext* gfxCtx, u8 primR, u8 primG, u8 primB, u8
return head;
}
s32 DemoIk_GetIndexFromParams(s32 params) {
s32 DemoIk_GetCueChannel(s32 params) {
s32 ret;
if (params == 0) {
@ -116,18 +116,18 @@ void DemoIk_SpawnDeadDb(DemoIk* this, PlayState* play) {
{ -6.0f, 13.0f, -5.0f }, { 1.0f, 9.0f, 3.0f }, { -10.0f, 9.0f, 1.0f },
};
s32 i;
s32 index = DemoIk_GetIndexFromParams(this->actor.params);
s32 cueChannel = DemoIk_GetCueChannel(this->actor.params);
if (DemoIk_CheckCue(play, 5, index)) {
if (DemoIk_CheckForCue(play, 5, cueChannel)) {
Vec3f pos;
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
s32 startIndex;
s32 endIndex;
if (index == 5) {
if (cueChannel == 5) {
startIndex = 0;
endIndex = 4;
} else if (index == 7) {
} else if (cueChannel == 7) {
startIndex = 4;
endIndex = 8;
} else {
@ -143,8 +143,8 @@ void DemoIk_SpawnDeadDb(DemoIk* this, PlayState* play) {
}
}
void DemoIk_MoveToStartPos(DemoIk* this, PlayState* play, s32 index) {
CsCmdActorAction* cue = DemoIk_GetCue(play, index);
void DemoIk_MoveToStartPos(DemoIk* this, PlayState* play, s32 cueChannel) {
CsCmdActorCue* cue = DemoIk_GetCue(play, cueChannel);
if (cue != NULL) {
this->actor.world.pos.x = cue->startPos.x;
@ -190,7 +190,7 @@ void func_8098393C(DemoIk* this) {
void func_8098394C(DemoIk* this, PlayState* play) {
DemoIk_EndMove(this);
DemoIk_MoveToStartPos(this, play, DemoIk_GetIndexFromParams(this->actor.params));
DemoIk_MoveToStartPos(this, play, DemoIk_GetCueChannel(this->actor.params));
this->actionMode = 1;
this->drawMode = 1;
this->actor.shape.shadowAlpha = 255;
@ -205,14 +205,14 @@ void func_809839AC(DemoIk* this) {
}
void func_809839D0(DemoIk* this, PlayState* play) {
CsCmdActorAction* cue = DemoIk_GetCue(play, DemoIk_GetIndexFromParams(this->actor.params));
CsCmdActorCue* cue = DemoIk_GetCue(play, DemoIk_GetCueChannel(this->actor.params));
if (cue != NULL) {
s32 nextCsAction = cue->action;
s32 csAction = this->csAction;
s32 nextCueId = cue->id;
s32 currentCueId = this->cueId;
if (nextCsAction != csAction) {
switch (nextCsAction) {
if (nextCueId != currentCueId) {
switch (nextCueId) {
case 1:
func_8098393C(this);
break;
@ -232,7 +232,7 @@ void func_809839D0(DemoIk* this, PlayState* play) {
// "there is no such action"
osSyncPrintf("Demo_Ik_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->csAction = nextCsAction;
this->cueId = nextCueId;
}
}
}
@ -359,14 +359,14 @@ void func_8098402C(DemoIk* this) {
}
void func_80984048(DemoIk* this, PlayState* play) {
CsCmdActorAction* cue = DemoIk_GetCue(play, 4);
CsCmdActorCue* cue = DemoIk_GetCue(play, 4);
if (cue != NULL) {
s32 nextCsAction = cue->action;
s32 csAction = this->csAction;
s32 nextCueId = cue->id;
s32 currentCueId = this->cueId;
if (nextCsAction != csAction) {
switch (nextCsAction) {
if (nextCueId != currentCueId) {
switch (nextCueId) {
case 1:
func_80983FDC(this);
break;
@ -383,7 +383,7 @@ void func_80984048(DemoIk* this, PlayState* play) {
// "there is no such action"
osSyncPrintf("Demo_Ik_inFace_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->csAction = nextCsAction;
this->cueId = nextCueId;
}
}
}

View file

@ -16,7 +16,7 @@ typedef struct DemoIk {
/* 0x019C */ Vec3s morphTable[2];
/* 0x01A8 */ s32 actionMode;
/* 0x01AC */ s32 drawMode;
/* 0x01B0 */ s32 csAction;
/* 0x01B0 */ s32 cueId;
} DemoIk; // size = 0x01B4
#endif