1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 00:40:16 +00:00

Create Macros for Cutscene Data (#63)

* Added additional (potentially unused) fields to macros, now builds OK

* Ran formatter, attempted better macro formatting

* Formatted unknown fields as hex, further cleanups

* Rename and prefix macros, use command base macros, format cutscenes with indents

* Move command macros into a new file and include it globally

* Generate cutscene command macros for Bg_Toki_Swd, Cleanups

* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h

* Introduce CS_CMD_CONTINUE and CS_CMD_STOP

* Remove apparently redundant arguments in certain commands, include the values in the macros directly

* Re-add cutscene terminator destination enum values to example cutscene data

* Format what should be floats as hex, Change actorAnim to actorAction

* Allow floating-point representation of values in cutscene data (asm-processor hack)

* Include cutscene commands only where necessary, documentation fixes

* Rename actor actions to npc actions, separate player action from npc actions

* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled

* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
This commit is contained in:
Tharo 2020-05-20 12:37:28 +01:00 committed by GitHub
parent 2bccbe7679
commit 43dfaa7518
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1538 additions and 506 deletions

View file

@ -133,26 +133,26 @@ void func_8097CB0C(DemoGo* this, GlobalContext* globalCtx) {
Actor* thisx = &this->actor;
PosRot* posRot = &thisx->posRot;
CutsceneContext* csCtx = &globalCtx->csCtx;
CsCmdActorAction* actorAction;
CsCmdActorAction* npcAction;
f32 temp_ret;
s32 pad;
Vec3f startPos;
Vec3f endPos;
if (globalCtx->csCtx.state != 0) {
actorAction = csCtx->actorActions[func_8097C870(this)];
if (actorAction != NULL) {
temp_ret = func_8006F93C(actorAction->endFrame, actorAction->startFrame, csCtx->frames);
startPos.x = actorAction->startPos.x;
startPos.y = actorAction->startPos.y;
startPos.z = actorAction->startPos.z;
endPos.x = actorAction->endPos.x;
endPos.y = actorAction->endPos.y;
endPos.z = actorAction->endPos.z;
npcAction = csCtx->npcActions[func_8097C870(this)];
if (npcAction != NULL) {
temp_ret = func_8006F93C(npcAction->endFrame, npcAction->startFrame, csCtx->frames);
startPos.x = npcAction->startPos.x;
startPos.y = npcAction->startPos.y;
startPos.z = npcAction->startPos.z;
endPos.x = npcAction->endPos.x;
endPos.y = npcAction->endPos.y;
endPos.z = npcAction->endPos.z;
posRot->pos.x = (((endPos.x - startPos.x) * temp_ret) + startPos.x);
posRot->pos.y = (((endPos.y - startPos.y) * temp_ret) + startPos.y);
posRot->pos.z = (((endPos.z - startPos.z) * temp_ret) + startPos.z);
posRot->rot.y = thisx->shape.rot.y = actorAction->rot.y;
posRot->rot.y = thisx->shape.rot.y = npcAction->rot.y;
}
}
}
@ -172,19 +172,19 @@ void func_8097CCC0(DemoGo* this) {
}
void func_8097CCE0(DemoGo* this, GlobalContext* globalCtx) {
CsCmdActorAction* actorAction;
CsCmdActorAction* npcAction;
Actor* thisx = &this->actor;
s32 rotYDelta;
s32 newRotY;
s32 thisRotY;
if (globalCtx->csCtx.state != 0) {
actorAction = globalCtx->csCtx.actorActions[func_8097C870(this)];
if (actorAction != NULL) {
npcAction = globalCtx->csCtx.npcActions[func_8097C870(this)];
if (npcAction != NULL) {
thisRotY = thisx->posRot.rot.y;
rotYDelta = actorAction->rot.y - thisRotY;
rotYDelta = npcAction->rot.y - thisRotY;
if ((rotYDelta > -(kREG(16) + 0x96)) && (rotYDelta < kREG(16) + 0x96)) {
newRotY = actorAction->rot.y;
newRotY = npcAction->rot.y;
} else if (rotYDelta > 0) {
newRotY = (thisRotY + kREG(16)) + 0x96;
} else {
@ -202,11 +202,11 @@ UNK_TYPE DemoGo_FrameUpdateMatrix(DemoGo* this) {
#ifdef NON_MATCHING
// return value isn't produced in the same way
s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 csCmdActorAction) {
s32 func_8097CDB0(DemoGo* this, GlobalContext* globalCtx, u16 csCmdNPCAction) {
CutsceneContext* csCtx = &globalCtx->csCtx;
CsCmdActorAction* actorAction = csCtx->actorActions[func_8097C870(this)];
CsCmdActorAction* npcAction = csCtx->npcActions[func_8097C870(this)];
if (csCtx->state != 0) {
if (actorAction != NULL && actorAction->action == csCmdActorAction) {
if (npcAction != NULL && npcAction->action == csCmdNPCAction) {
return 1;
}
}
@ -231,11 +231,11 @@ void func_8097CE20(DemoGo* this, GlobalContext* globalCtx) {
void func_8097CE78(DemoGo* this, GlobalContext* globalCtx) {
CutsceneContext* csCtx = &globalCtx->csCtx;
CsCmdActorAction* actorAction;
CsCmdActorAction* npcAction;
if (globalCtx->csCtx.state != 0) {
actorAction = csCtx->actorActions[func_8097C870(this)];
if (actorAction != NULL && csCtx->frames >= actorAction->endFrame) {
npcAction = csCtx->npcActions[func_8097C870(this)];
if (npcAction != NULL && csCtx->frames >= npcAction->endFrame) {
func_8097CA78(this, globalCtx);
this->action = 3;
}