EnClearTag OK and documented (#214)

* merge main

* Match Init

* Clear_Tag OK

* Full documentation

* More docs

* Fix function

* Fix MakeFile for assets and Fix texture swapped names

* Fix name

* Improve name and remove pad

* Can't stop the minor tweeks

* Adding potential Makefile fixes

* Minor name change

* Another name fix... and format

* PR Suggestion & Add Overlay File Description

* Re-documentation to match OoT WIP (more to come)

* Finish docs from OoT

* Fix merge and format

* Minor touch-ups

* Cleaner conditional
This commit is contained in:
engineer124
2021-07-21 01:07:05 +10:00
committed by GitHub
parent 5fa3049236
commit 9637e19303
21 changed files with 1155 additions and 100 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ extern AnimationHeader D_06000990;
extern FlexSkeletonHeader D_06008C40;
// Probably the same struct as ActorAnimationEntryS, need more info from func_8013BC6C
static ActorAnimationEntryS D_80C1E200[] = { &D_06000990, 1.0f, 0, -1, 0, 0};
static ActorAnimationEntryS D_80C1E200[] = { &D_06000990, 1.0f, 0, -1, 0, 0 };
s32 func_80C1DED0(DmNb* this, s32 arg1) {
s32 ret = 0;
File diff suppressed because it is too large Load Diff
@@ -5,9 +5,50 @@
struct EnClearTag;
typedef enum {
/* 0x00 */ CLEAR_TAG_EFFECT_AVAILABLE,
/* 0x01 */ CLEAR_TAG_EFFECT_DEBRIS,
/* 0x02 */ CLEAR_TAG_EFFECT_FIRE, // never set to, remnant of OoT
/* 0x03 */ CLEAR_TAG_EFFECT_SMOKE,
/* 0x04 */ CLEAR_TAG_EFFECT_FLASH,
/* 0x05 */ CLEAR_TAG_EFFECT_LIGHT_RAYS,
/* 0x06 */ CLEAR_TAG_EFFECT_SHOCKWAVE,
/* 0x07 */ CLEAR_TAG_EFFECT_SPLASH,
/* 0x08 */ CLEAR_TAG_EFFECT_ISOLATED_SMOKE,
} ClearTagEffectType;
typedef struct EnClearTagEffect {
/* 0x00 */ u8 type;
/* 0x01 */ u8 actionTimer;
/* 0x04 */ Vec3f position;
/* 0x10 */ Vec3f velocity;
/* 0x1C */ Vec3f acceleration;
/* 0x28 */ Color_RGBAf primColor;
/* 0x38 */ Color_RGBAf envColor;
/* 0x48 */ s16 bounces;
/* 0x4A */ s16 effectsTimer;
/* 0x4C */ s16 lightRayAlpha;
/* 0x4E */ s16 lightRayAlphaDecrementSpeed;
/* 0x50 */ f32 scale;
/* 0x54 */ f32 maxScale;
/* 0x58 */ f32 rotationY;
/* 0x5C */ f32 rotationX;
/* 0x60 */ f32 rotationZ;
/* 0x64 */ f32 maxScaleTarget;
/* 0x68 */ f32 smokeScaleY;
/* 0x6C */ f32 smokeScaleX;
} EnClearTagEffect; // size = 0x70
typedef struct EnClearTag {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_0144[0x2D40];
/* 0x0144 */ EnClearTagEffect effect[103];
/* 0x2E54 */ u8 cameraState;
/* 0x2E56 */ s16 activeTimer; // Actor Marked for Death when timer runs out
/* 0x2E58 */ UNK_TYPE1 unk2E58[0xC];
/* 0x2E64 */ s16 camId;
/* 0x2E66 */ Color_RGBA8 flashEnvColor;
/* 0x2E6C */ Vec3f eye; // Camera eye
/* 0x2E78 */ Vec3f at; // Camera lookAt
} EnClearTag; // size = 0x2E84
extern const ActorInit En_Clear_Tag_InitVars;
@@ -155,8 +155,8 @@ void EnEncount2_Popped(EnEncount2* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&curPos, &this->dyna.actor.world.pos);
curPos.y += 60.0f;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, curPos.x, curPos.y, curPos.z, 0xFF, 0xFF, 0xC8,
0x0001);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, curPos.x, curPos.y, curPos.z, 255, 255, 200,
CLEAR_TAG_LARGE_EXPLOSION);
for (i = 0; i != 100; ++i) {
EnEncount2_InitParticles(this, &curPos, 10);
@@ -351,7 +351,8 @@ void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) {
this->unk_2E8.x = 4.0f;
this->unk_2E8.y = 0.55f;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->collider.info.bumper.hitPos.x,
this->collider.info.bumper.hitPos.y, this->collider.info.bumper.hitPos.z, 0, 0, 0, 3);
this->collider.info.bumper.hitPos.y, this->collider.info.bumper.hitPos.z, 0, 0, 0,
CLEAR_TAG_SMALL_LIGHT_RAYS);
} else if (this->actor.colChkInfo.damageEffect == 2) {
this->unk_18F = 0;
this->unk_2E8.x = 4.0f;
+2 -1
View File
@@ -557,7 +557,8 @@ void EnFsn_UpdateItemSelectedProperty(EnFsn* this) {
s32 i;
for (items = this->items, i = 0; i < this->totalSellingItems; items++, i++) {
if (this->actionFunc != EnFsn_SelectItem && this->actionFunc != EnFsn_PlayerCannotBuy && this->drawCursor == 0) {
if (this->actionFunc != EnFsn_SelectItem && this->actionFunc != EnFsn_PlayerCannotBuy &&
this->drawCursor == 0) {
(*items)->isSelected = false;
} else {
(*items)->isSelected = (i == this->cursorIdx) ? true : false;
@@ -1347,9 +1347,9 @@ void func_80B452EC(EnInvadepoh* this, GlobalContext* globalCtx) {
s32 i;
for (i = 0; i < this->unk379; i++) {
D_80B50320[i] = (EnInvadepoh*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INVADEPOH, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0,
(i & 7) | ((phi_s2 << 8) & 0x7F00) | 0x10);
D_80B50320[i] = (EnInvadepoh*)Actor_Spawn(
&globalCtx->actorCtx, globalCtx, ACTOR_EN_INVADEPOH, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, (i & 7) | ((phi_s2 << 8) & 0x7F00) | 0x10);
if (phi_s2 != 0xFF) {
Path* path = &globalCtx->setupPathList[phi_s2];
phi_s2 = path->unk1;
@@ -1369,7 +1369,7 @@ void func_80B45460(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B454BC(EnInvadepoh* this, GlobalContext* globalCtx) {
D_80B503F0 = (EnInvadepoh*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_INVADEPOH, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x60);
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0x60);
}
void EnInvadepoh_SetSysMatrix(Vec3f* vec) {
@@ -1436,7 +1436,7 @@ void func_80B457A0(EnInvadepoh* this) {
f32 phi_f20 = FLT_MAX;
s32 i;
s32 phi_s5 = -1;
for (i = 0; i < this->unk379; i++) {
if ((D_80B50320[i] != NULL) && D_80B50320[i]->drawAlien) {
distanceSquared = Math3D_DistanceSquared(&D_80B50320[i]->actor.world.pos, &this->actor.world.pos);
@@ -2307,7 +2307,7 @@ void func_80B479E8(EnInvadepoh* this, GlobalContext* globalCtx) {
this->counter++;
if (this->actionTimer == 8) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
this->actor.world.pos.y - 10.0f, this->actor.world.pos.z, 0, 0, 3, 200);
this->actor.world.pos.y - 10.0f, this->actor.world.pos.z, 0, 0, 3, CLEAR_TAG_SMOKE);
}
if (this->actionTimer == 8) {
@@ -2624,7 +2624,8 @@ void func_80B48848(EnInvadepoh* this, GlobalContext* globalCtx) {
Math_StepToS(&this->behaviorInfo.unk4C, 0x7D0, 0x46);
}
func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x46);
if (((this->actor.flags & 0x40) == 0x40) && (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
if (((this->actor.flags & 0x40) == 0x40) &&
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK);
}
if (this->actionTimer > 0) {
@@ -3077,7 +3078,8 @@ void func_80B49C38(EnInvadepoh* this, GlobalContext* globalCtx) {
this->actor.flags |= (0x8 | 0x1);
}
if (((this->actor.flags & 0x40) == 0x40) && (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
if (((this->actor.flags & 0x40) == 0x40) &&
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK);
}
if (this->clockTime >= 0.9999f) {
@@ -3302,7 +3304,8 @@ void func_80B4A67C(EnInvadepoh* this, GlobalContext* globalCtx) {
this->unk378 = 0;
this->actor.flags |= (0x8 | 0x1);
}
if (((this->actor.flags & 0x40) == 0x40) && (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
if (((this->actor.flags & 0x40) == 0x40) &&
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK);
}
if (this->pathIndex == this->endPoint) {
@@ -3463,8 +3466,7 @@ void func_80B4ADCC(EnInvadepoh* this, GlobalContext* globalCtx) {
}
if (this->textId == 0x3333) {
func_80B4AEC0(this);
}
else if (this->textId == 0x3334) {
} else if (this->textId == 0x3334) {
func_801477B4(globalCtx);
func_80B4B024(this);
}
@@ -3554,7 +3556,6 @@ void func_80B4B218(Actor* thisx, GlobalContext* globalCtx) {
Player* player;
AlienBehaviorInfo* substruct = &this->behaviorInfo;
this->actionFunc(this, globalCtx);
if (sp38 && this->actor.update != NULL) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
@@ -3658,7 +3659,8 @@ void func_80B4B768(EnInvadepoh* this, GlobalContext* globalCtx) {
s32 pad;
Math_StepToF(&this->actor.speedXZ, 0.0f, 1.0f);
Math_SmoothStepToS(&this->actor.world.rot.y, Actor_YawBetweenActors(&this->actor, &D_80B5040C->actor), 5, 0x1388, 0x64);
Math_SmoothStepToS(&this->actor.world.rot.y, Actor_YawBetweenActors(&this->actor, &D_80B5040C->actor), 5, 0x1388,
0x64);
func_80B44E90(this, globalCtx);
if (func_801378B8(&this->skelAnime, 13.0f) || func_801378B8(&this->skelAnime, 19.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_SMALL_DOG_ANG_BARK);
@@ -3836,7 +3838,8 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) {
}
}
if (((this->actor.flags & 0x40) == 0x40) && (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 12.0f))) {
if (((this->actor.flags & 0x40) == 0x40) &&
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 12.0f))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK);
}
if (gSaveContext.time > CLOCK_TIME(20, 15)) {
@@ -3971,14 +3974,14 @@ void func_80B4C5C0(Actor* thisx, GlobalContext* globalCtx) {
}
this->actionFunc(this, globalCtx);
if (sp2C && (this->actor.update != NULL)) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_80B45CE0(&this->behaviorInfo);
if ((this->actionFunc != func_80B4C058) && !isTalking && this->actor.isTargeted) {
func_800B8614(&this->actor, globalCtx, 350.0f);
}
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
func_80B45CE0(&this->behaviorInfo);
if ((this->actionFunc != func_80B4C058) && !isTalking && this->actor.isTargeted) {
func_800B8614(&this->actor, globalCtx, 350.0f);
}
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
void func_80B4C6C8(EnInvadepoh* this) {
@@ -4006,7 +4009,7 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) {
s8 temp_v1;
s16 sp3A;
s8 temp_v0;
func_80B44700(this);
func_80B44EFC(this, globalCtx);
func_80B43E6C(this, 6, 2000, 100);
@@ -4056,7 +4059,8 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) {
substruct->unk26.y = CLAMP(temp_v1_4, -8000, 8000);
}
if (((this->actor.flags & 0x40) == 0x40) && (func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
if (((this->actor.flags & 0x40) == 0x40) &&
(func_801378B8(&this->skelAnime, 0.0f) || func_801378B8(&this->skelAnime, 7.0f))) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -407,7 +407,7 @@ void func_8086A724(EnPametfrog* this, GlobalContext* globalCtx) {
this->unk_2C4 = 3.0f;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG,
this->collider.elements[0].info.bumper.hitPos.x, this->collider.elements[0].info.bumper.hitPos.y,
this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0, 4);
this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS);
} else if (this->actor.colChkInfo.damageEffect == 3) {
func_8086A024(this);
}
@@ -1305,7 +1305,8 @@ void EnPametfrog_ApplyDamage(EnPametfrog* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG,
this->collider.elements[0].info.bumper.hitPos.x,
this->collider.elements[0].info.bumper.hitPos.y,
this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0, 4);
this->collider.elements[0].info.bumper.hitPos.z, 0, 0, 0,
CLEAR_TAG_LARGE_LIGHT_RAYS);
}
func_8086CB4C(this);
}
@@ -242,7 +242,7 @@ void EnPoFusen_IncrementRomaniPop(EnPoFusen* this) {
void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, 2);
this->actor.world.pos.y + 20.0f, this->actor.world.pos.z, 255, 255, 200, CLEAR_TAG_POP);
Audio_PlayActorSound2(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
Actor_MarkForDeath(&this->actor);
}
@@ -53,7 +53,6 @@ static InitChainEntry sInitChain[] = {
static CollisionHeader* sColHeaders[] = { &D_06004FF8, &D_060048D0 };
void ObjRaillift_UpdatePosition(ObjRaillift* this, s32 idx) {
Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, &this->points[idx]);
}
@@ -159,7 +158,8 @@ void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx) {
this->dyna.actor.speedXZ *= 0.4f;
isTeleporting = OBJRAILLIFT_SHOULD_TELEPORT(&this->dyna.actor);
isPosUpdated = true;
if (((this->curPoint >= this->endPoint) && (this->direction > 0)) || ((this->curPoint <= 0) && (this->direction < 0))) {
if (((this->curPoint >= this->endPoint) && (this->direction > 0)) ||
((this->curPoint <= 0) && (this->direction < 0))) {
if (!isTeleporting) {
this->direction = -this->direction;
this->waitTimer = 10;
@@ -168,7 +168,8 @@ void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx) {
endPoint = &this->points[this->endPoint];
this->curPoint = this->direction > 0 ? 0 : this->endPoint;
initialPoint = &this->points[0];
if ((initialPoint->x != endPoint->x) || (initialPoint->y != endPoint->y) || (initialPoint->z != endPoint->z)) {
if ((initialPoint->x != endPoint->x) || (initialPoint->y != endPoint->y) ||
(initialPoint->z != endPoint->z)) {
this->actionFunc = ObjRaillift_Teleport;
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
isPosUpdated = false;
@@ -245,11 +246,12 @@ void ObjRaillift_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->cycle += 0xCE4;
Math_StepToF(&this->maxHeight, 0.0f, 0.12f);
step = this->isWeightOn ? Math_CosS(fabsf(this->cycleSpeed) * 2048.0f) + 0.02f : Math_SinS(fabsf(this->cycleSpeed) * 2048.0f) + 0.02f;
step = this->isWeightOn ? Math_CosS(fabsf(this->cycleSpeed) * 2048.0f) + 0.02f
: Math_SinS(fabsf(this->cycleSpeed) * 2048.0f) + 0.02f;
target = this->isWeightOn ? -8.0f : 0.0f;
Math_StepToF(&this->cycleSpeed, target, step);
this->dyna.actor.shape.yOffset = ((Math_SinS(this->cycle) * this->maxHeight) + this->cycleSpeed) * 10.0f;
dummy:;
dummy:;
}
if (OBJRAILLIFT_GET_TYPE(thisx) == DEKU_FLOWER_PLATFORM && this->dyna.actor.child != NULL) {
if (this->dyna.actor.child->update == NULL) {
@@ -269,8 +271,8 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08,
Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, globalCtx->gameplayFrames, 0, 32, 32, 1, 0, 0,
32, 32, 0, 0, 0, 160));
Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, globalCtx->gameplayFrames, 0, 32, 32, 1, 0, 0, 32,
32, 0, 0, 0, 160));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06004BF0);
CLOSE_DISPS(globalCtx->state.gfxCtx);