1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Doc misc 1 (#1160)

* Misc documentation 1

* Add parentheses

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>

* Move the parentheses to the right place

* `curByte`(2) -> `curChar`(2)

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

* Revert `isMaterialSet` boolean usage

* Fix misplaced line (how did that happen)

* Fixup

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
Dragorn421 2022-02-27 22:32:05 +01:00 committed by GitHub
parent dfbc356cdf
commit ed6ec5bceb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 265 additions and 262 deletions

View file

@ -146,16 +146,16 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
f32 bodyDistDiff;
f32 phi_f16;
DynaPolyActor* dynaPolyActor;
f32 sp94;
f32 sp90;
f32 curGrabbedDist;
f32 grabbedDist;
s32 pad;
CollisionPoly* poly;
s32 bgId;
Vec3f sp78;
Vec3f intersectPos;
Vec3f prevFrameDiff;
Vec3f sp60;
f32 sp5C;
f32 sp58;
f32 polyNormalX;
f32 polyNormalZ;
f32 velocity;
s32 pad1;
@ -189,10 +189,11 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
grabbed = NULL;
this->grabbed = NULL;
} else if (this->actor.child != NULL) {
sp94 = Actor_WorldDistXYZToActor(&this->actor, grabbed);
sp90 = sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
curGrabbedDist = Actor_WorldDistXYZToActor(&this->actor, grabbed);
grabbedDist =
sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
if (50.0f < (sp94 - sp90)) {
if ((curGrabbedDist - grabbedDist) > 50.0f) {
ArmsHook_DetachHookFromActor(this);
grabbed = NULL;
}
@ -256,14 +257,14 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y);
sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z);
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true,
&bgId) &&
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78)) {
sp5C = COLPOLY_GET_NORMAL(poly->normal.x);
sp58 = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.world.pos, &sp78);
this->actor.world.pos.x += 10.0f * sp5C;
this->actor.world.pos.z += 10.0f * sp58;
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &this->unk_1E8, &intersectPos, &poly, true, true, true,
true, &bgId) &&
!func_8002F9EC(globalCtx, &this->actor, poly, bgId, &intersectPos)) {
polyNormalX = COLPOLY_GET_NORMAL(poly->normal.x);
polyNormalZ = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.world.pos, &intersectPos);
this->actor.world.pos.x += 10.0f * polyNormalX;
this->actor.world.pos.z += 10.0f * polyNormalZ;
this->timer = 0;
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId)) {
if (bgId != BGCHECK_SCENE) {
@ -299,8 +300,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
ArmsHook* this = (ArmsHook*)thisx;
Player* player = GET_PLAYER(globalCtx);
Vec3f sp78;
Vec3f sp6C;
Vec3f sp60;
Vec3f hookNewTip;
Vec3f hookNewBase;
f32 sp5C;
f32 sp58;
@ -309,16 +310,16 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
if ((ArmsHook_Shoot != this->actionFunc) || (this->timer <= 0)) {
Matrix_MultVec3f(&D_80865B70, &this->unk_1E8);
Matrix_MultVec3f(&D_80865B88, &sp6C);
Matrix_MultVec3f(&D_80865B94, &sp60);
Matrix_MultVec3f(&D_80865B88, &hookNewTip);
Matrix_MultVec3f(&D_80865B94, &hookNewBase);
this->hookInfo.active = 0;
} else {
Matrix_MultVec3f(&D_80865B7C, &this->unk_1E8);
Matrix_MultVec3f(&D_80865BA0, &sp6C);
Matrix_MultVec3f(&D_80865BAC, &sp60);
Matrix_MultVec3f(&D_80865BA0, &hookNewTip);
Matrix_MultVec3f(&D_80865BAC, &hookNewBase);
}
func_80090480(globalCtx, &this->collider, &this->hookInfo, &sp6C, &sp60);
func_80090480(globalCtx, &this->collider, &this->hookInfo, &hookNewTip, &hookNewBase);
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View file

@ -803,7 +803,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, GlobalContext* globalCtx) {
void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
BgDyYoseizo* this = (BgDyYoseizo*)thisx;
s32 phi_v1;
s32 sfx;
this->absoluteTimer++;
@ -820,29 +820,29 @@ void BgDyYoseizo_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->actionFunc(this, globalCtx);
if (globalCtx->csCtx.state != CS_STATE_IDLE) {
phi_v1 = 0;
sfx = 0;
if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
if ((globalCtx->csCtx.frames == 32) || (globalCtx->csCtx.frames == 291) ||
(globalCtx->csCtx.frames == 426) || (globalCtx->csCtx.frames == 851)) {
phi_v1 = 1;
sfx = 1;
}
if (globalCtx->csCtx.frames == 101) {
phi_v1 = 2;
sfx = 2;
}
} else {
if ((globalCtx->csCtx.frames == 35) || (globalCtx->csCtx.frames == 181) ||
(globalCtx->csCtx.frames == 462) || (globalCtx->csCtx.frames == 795)) {
phi_v1 = 1;
sfx = 1;
}
if (globalCtx->csCtx.frames == 90) {
phi_v1 = 2;
sfx = 2;
}
}
if (phi_v1 == 1) {
if (sfx == 1) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0);
}
if (phi_v1 == 2) {
if (sfx == 2) {
Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0);
}
}
@ -1015,7 +1015,7 @@ void BgDyYoseizo_ParticleDraw(BgDyYoseizo* this, GlobalContext* globalCtx) {
for (i = 0; i < 200; i++, particle++) {
if (particle->alive == 1) {
if (phi_s3 == 0) {
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleAppearDL));
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleMaterialDL));
gDPPipeSync(POLY_XLU_DISP++);
phi_s3++;
@ -1032,7 +1032,7 @@ void BgDyYoseizo_ParticleDraw(BgDyYoseizo* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_bg_dy_yoseizo.c", 1810),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleAliveDL));
gSPDisplayList(POLY_XLU_DISP++, SEGMENTED_TO_VIRTUAL(gGreatFairyParticleModelDL));
}
}