mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Document the lens system (#1079)
* merge master * A little bit * start docs on lens * Delete Jenkinsfile * Make sense of the numbers in `Actor_DrawLensOfTruthMask` f3dzex commands * More comments on `Actor_DrawLens` f3dzex usage * remove padding * renames * Simplify gfx comments * Add some line breaks * Remove undef Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Louis <louist103@pop-os.localdomain>
This commit is contained in:
parent
1f300f4a79
commit
d1ac7eb80d
15 changed files with 68 additions and 42 deletions
|
@ -39,7 +39,7 @@ void BgGndNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void BgGndNisekabe_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgGndNisekabe* this = (BgGndNisekabe*)thisx;
|
||||
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
this->actor.flags |= ACTOR_FLAG_7;
|
||||
} else {
|
||||
this->actor.flags &= ~ACTOR_FLAG_7;
|
||||
|
|
|
@ -291,7 +291,7 @@ void BgHakaGate_FalseSkull(BgHakaGate* this, GlobalContext* globalCtx) {
|
|||
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
|
||||
Math_StepToS(&this->vFlameScale, 350, 20);
|
||||
}
|
||||
if (globalCtx->actorCtx.unk_03) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
this->dyna.actor.flags |= ACTOR_FLAG_7;
|
||||
} else {
|
||||
this->dyna.actor.flags &= ~ACTOR_FLAG_7;
|
||||
|
|
|
@ -108,7 +108,7 @@ void func_8087DB24(BgHakaMegane* this, GlobalContext* globalCtx) {
|
|||
void func_8087DBF0(BgHakaMegane* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx = &this->dyna.actor;
|
||||
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
thisx->flags |= ACTOR_FLAG_7;
|
||||
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
|
||||
} else {
|
||||
|
|
|
@ -259,7 +259,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, GlobalContext* globalCtx) {
|
|||
&scytheVertices[2]);
|
||||
}
|
||||
|
||||
if ((this->unk_151 == 0) || (globalCtx->actorCtx.unk_03 != 0)) {
|
||||
if ((this->unk_151 == 0) || globalCtx->actorCtx.lensActive) {
|
||||
scytheVertices[0].x = this->actor.world.pos.x + blureEffectVertices1[this->actor.params].z * actorRotYSin +
|
||||
blureEffectVertices1[this->actor.params].x * actorRotYCos;
|
||||
scytheVertices[0].y = this->actor.world.pos.y + blureEffectVertices1[this->actor.params].y;
|
||||
|
|
|
@ -40,7 +40,7 @@ void BgMenkuriNisekabe_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void BgMenkuriNisekabe_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx;
|
||||
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
this->actor.flags |= ACTOR_FLAG_7;
|
||||
} else {
|
||||
this->actor.flags &= ~ACTOR_FLAG_7;
|
||||
|
|
|
@ -2636,7 +2636,7 @@ void BossSst_UpdateHead(Actor* thisx, GlobalContext* globalCtx) {
|
|||
BossSst_HeadCollisionCheck(this, globalCtx);
|
||||
this->actionFunc(this, globalCtx);
|
||||
if (this->vVanish) {
|
||||
if ((globalCtx->actorCtx.unk_03 == 0) || (thisx->colorFilterTimer != 0)) {
|
||||
if (!globalCtx->actorCtx.lensActive || (thisx->colorFilterTimer != 0)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_7;
|
||||
} else {
|
||||
this->actor.flags |= ACTOR_FLAG_7;
|
||||
|
|
|
@ -722,7 +722,7 @@ s32 EnFirefly_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
|
|||
void* thisx, Gfx** gfx) {
|
||||
EnFirefly* this = (EnFirefly*)thisx;
|
||||
|
||||
if ((this->actor.draw == EnFirefly_DrawInvisible) && (globalCtx->actorCtx.unk_03 == 0)) {
|
||||
if ((this->actor.draw == EnFirefly_DrawInvisible) && !globalCtx->actorCtx.lensActive) {
|
||||
*dList = NULL;
|
||||
} else if (limbIndex == 1) {
|
||||
pos->y += 2300.0f;
|
||||
|
|
|
@ -132,7 +132,7 @@ void EnPoDesert_UpdateSpeedModifier(EnPoDesert* this) {
|
|||
|
||||
void EnPoDesert_WaitForPlayer(EnPoDesert* this, GlobalContext* globalCtx) {
|
||||
func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG);
|
||||
if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.unk_03)) {
|
||||
if (this->actor.xzDistToPlayer < 200.0f && (this->currentPathPoint != 2 || globalCtx->actorCtx.lensActive)) {
|
||||
if (this->currentPathPoint == 2) {
|
||||
if (Gameplay_InCsMode(globalCtx)) {
|
||||
this->actor.shape.rot.y += 0x800;
|
||||
|
@ -197,7 +197,7 @@ void EnPoDesert_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_SetFocus(&this->actor, 42.0f);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
if (globalCtx->actorCtx.unk_03) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_7;
|
||||
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
|
||||
} else {
|
||||
|
|
|
@ -1803,7 +1803,7 @@ void EnTest_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->actor.params == STALFOS_TYPE_INVISIBLE) {
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_7;
|
||||
this->actor.shape.shadowDraw = ActorShadow_DrawFeet;
|
||||
} else {
|
||||
|
@ -1876,7 +1876,7 @@ void EnTest_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
|
|||
Matrix_MultVec3f(&D_80864670, &sp64);
|
||||
|
||||
if ((this->swordState >= 1) &&
|
||||
((this->actor.params != STALFOS_TYPE_INVISIBLE) || (globalCtx->actorCtx.unk_03 != 0))) {
|
||||
((this->actor.params != STALFOS_TYPE_INVISIBLE) || globalCtx->actorCtx.lensActive)) {
|
||||
EffectBlure_AddVertex(Effect_GetByIndex(this->effectIndex), &sp70, &sp64);
|
||||
} else if (this->swordState >= 0) {
|
||||
EffectBlure_AddSpace(Effect_GetByIndex(this->effectIndex));
|
||||
|
|
|
@ -201,7 +201,7 @@ void ItemEtcetera_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ItemEtcetera* this = (ItemEtcetera*)thisx;
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
func_8002EBCC(&this->actor, globalCtx, 0);
|
||||
func_8002ED80(&this->actor, globalCtx, 0);
|
||||
GetItem_Draw(globalCtx, this->giDrawId);
|
||||
|
|
|
@ -2722,12 +2722,12 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) {
|
|||
|
||||
if (actionParam == PLAYER_AP_LENS) {
|
||||
if (func_80087708(globalCtx, 0, 3)) {
|
||||
if (globalCtx->actorCtx.unk_03 != 0) {
|
||||
func_800304B0(globalCtx);
|
||||
if (globalCtx->actorCtx.lensActive) {
|
||||
Actor_DisableLens(globalCtx);
|
||||
} else {
|
||||
globalCtx->actorCtx.unk_03 = 1;
|
||||
globalCtx->actorCtx.lensActive = true;
|
||||
}
|
||||
func_80078884((globalCtx->actorCtx.unk_03 != 0) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF);
|
||||
func_80078884((globalCtx->actorCtx.lensActive) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF);
|
||||
} else {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
}
|
||||
|
@ -4175,7 +4175,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) {
|
|||
.sides[(doorDirection > 0) ? 0 : 1]
|
||||
.effects;
|
||||
|
||||
func_800304B0(globalCtx);
|
||||
Actor_DisableLens(globalCtx);
|
||||
}
|
||||
} else {
|
||||
// This actor can be either EnDoor or DoorKiller.
|
||||
|
@ -4228,7 +4228,7 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->doorType != PLAYER_DOORTYPE_FAKE) {
|
||||
this->stateFlags1 |= PLAYER_STATE1_29;
|
||||
func_800304B0(globalCtx);
|
||||
Actor_DisableLens(globalCtx);
|
||||
|
||||
if (((doorActor->params >> 7) & 7) == 3) {
|
||||
sp4C.x = doorActor->world.pos.x - (sp6C * sp74);
|
||||
|
@ -5806,7 +5806,7 @@ s32 func_8083E0FC(Player* this, GlobalContext* globalCtx) {
|
|||
func_80832F54(globalCtx, this, 0x9B);
|
||||
this->actor.parent = this->rideActor;
|
||||
func_80832224(this);
|
||||
func_800304B0(globalCtx);
|
||||
Actor_DisableLens(globalCtx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue