1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Misc Cleanup (#1585)

* misc cleanup

* more fake matches

* revert for sym
This commit is contained in:
engineer124 2023-11-22 20:19:31 +11:00 committed by GitHub
parent 2aaa286cf8
commit f2c06ce441
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 134 additions and 161 deletions

View file

@ -50,8 +50,8 @@ f32 Math_FAtanTaylorQF(f32 x) {
if (poly + term == poly) {
break;
}
poly = poly + term;
exp = exp * sq;
poly += term;
exp *= sq;
}
return poly;

View file

@ -181,7 +181,6 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
R_HREG_MODE = HREG_MODE_UCODE_DISAS;
R_UCODE_DISAS_TOGGLE = 1;
R_UCODE_DISAS_LOG_LEVEL = 2;
sPrevTaskWorkBuffer = sPrevTaskWorkBuffer;
Graph_DisassembleUCode(sPrevTaskWorkBuffer);
}

View file

@ -1120,7 +1120,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targetPos, f
playerToTargetDir.r = (playerToTargetDir.r * CAM_DATA_SCALED(OREG(39))) -
(((CAM_DATA_SCALED(OREG(39)) - CAM_DATA_SCALED(OREG(38))) * playerToTargetDir.r) *
(playerToTargetDir.r / distance));
playerToTargetDir.r = playerToTargetDir.r - (playerToTargetDir.r * temp_f0_2) * temp_f0_2;
playerToTargetDir.r -= (playerToTargetDir.r * temp_f0_2) * temp_f0_2;
}
if (flags & CAM_LOCKON_AT_FLAG_OFF_GROUND) {
@ -1160,7 +1160,7 @@ s32 Camera_CalcAtForLockOn(Camera* camera, VecGeo* eyeAtDir, Vec3f* targetPos, f
*yPosOffset = *yPosOffset + (yPosDelta + temp_f0_2);
yPosDelta = -temp_f0_2;
}
playerToAtOffsetTarget.y = playerToAtOffsetTarget.y - yPosDelta;
playerToAtOffsetTarget.y -= yPosDelta;
} else {
yPosDelta = playerPosRot->pos.y - *yPosOffset;
temp_f0_2 = Math_FAtan2F(yPosDelta, OLib_Vec3fDistXZ(at, &camera->eye));
@ -4318,10 +4318,9 @@ s32 Camera_Subj3(Camera* camera) {
tGeo.pitch = rwData->pitch;
if (rwData->animTimer != 0) {
temp_f0_3 = (1.0f / rwData->animTimer);
pad2 = at;
at->x = at->x + (sp98.x - pad2->x) * temp_f0_3;
at->y = at->y + (sp98.y - pad2->y) * temp_f0_3;
at->z = at->z + (sp98.z - pad2->z) * temp_f0_3;
at->x = F32_LERPIMP(at->x, sp98.x, temp_f0_3);
at->y = F32_LERPIMP(at->y, sp98.y, temp_f0_3);
at->z = F32_LERPIMP(at->z, sp98.z, temp_f0_3);
temp_f0_3 = (1.0f / R_CAM_DEFAULT_ANIM_TIME);
sp58 = (tGeo.r - sp84.r) * temp_f0_3;
@ -6964,7 +6963,7 @@ s32 Camera_Special9(Camera* camera) {
doorParams->timer2--;
if (doorParams->timer2 <= 0) {
camera->animState++;
rwData->targetYaw = rwData->targetYaw - 0x7FFF;
rwData->targetYaw -= 0x7FFF;
} else {
break;
}

View file

@ -973,14 +973,14 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) {
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
break;
case 3:
ratio = ratio * 0.5f;
ratio *= 0.5f;
vtx[j].v.ob[0] = EffectSs_LerpS16(elem->p1.x, elem->p2.x, ratio);
vtx[j].v.ob[1] = EffectSs_LerpS16(elem->p1.y, elem->p2.y, ratio);
vtx[j].v.ob[2] = EffectSs_LerpS16(elem->p1.z, elem->p2.z, ratio);
vtx[j + 1].v.ob[0] = EffectSs_LerpS16(elem->p2.x, elem->p1.x, ratio);
vtx[j + 1].v.ob[1] = EffectSs_LerpS16(elem->p2.y, elem->p1.y, ratio);
vtx[j + 1].v.ob[2] = EffectSs_LerpS16(elem->p2.z, elem->p1.z, ratio);
ratio = ratio + ratio;
ratio *= 2.0f;
break;
case 0:
default:

View file

@ -160,24 +160,24 @@ void Effect_DrawAll(GraphicsContext* gfxCtx) {
s32 i;
for (i = 0; i < SPARK_COUNT; i++) {
if (sEffectContext.sparks[i].status.active) {
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
if (!sEffectContext.sparks[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SPARK].draw(&sEffectContext.sparks[i].effect, gfxCtx);
}
for (i = 0; i < BLURE_COUNT; i++) {
if (sEffectContext.blures[i].status.active) {
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
if (!sEffectContext.blures[i].status.active) {
continue;
}
if (1) {} // Necessary to match
if (1) {}
sEffectInfoTable[EFFECT_BLURE1].draw(&sEffectContext.blures[i].effect, gfxCtx);
}
for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) {
if (sEffectContext.shieldParticles[i].status.active) {
if (gfxCtx) {} // Necessary to match
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
if (!sEffectContext.shieldParticles[i].status.active) {
continue;
}
sEffectInfoTable[EFFECT_SHIELD_PARTICLE].draw(&sEffectContext.shieldParticles[i].effect, gfxCtx);
}
}

View file

@ -2419,17 +2419,17 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
if (ABS(primA - primA1) < 9) {
primA = primA1;
} else if (primA1 < primA) {
primA = primA - 9;
primA -= 9;
} else {
primA = primA + 9;
primA += 9;
}
if (ABS(envA - envA1) < 9) {
envA = envA1;
} else if (envA1 < envA) {
envA = envA - 9;
envA -= 9;
} else {
envA = envA + 9;
envA += 9;
}
play->envCtx.sandstormPrimA = primA;

View file

@ -108,7 +108,7 @@ void Lights_BindPoint(Lights* lights, LightParams* params, Vec3f* vec) {
if (light != NULL) {
posDiff = sqrtf(posDiff);
if (1) {}
scale = posDiff / scale;
scale = 1 - SQ(scale);

View file

@ -848,7 +848,7 @@ void Message_HandleOcarina(PlayState* play) {
*/
void Message_DrawText(PlayState* play, Gfx** gfxP) {
MessageContext* msgCtx = &play->msgCtx;
u16 lookAheadCharacter;
s16 pad;
u8 character;
u16 j;
u16 i;
@ -928,15 +928,13 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
j = i;
while (true) {
lookAheadCharacter = msgCtx->msgBufDecoded[j];
if (lookAheadCharacter == MESSAGE_SHIFT) {
character = msgCtx->msgBufDecoded[j];
if (character == MESSAGE_SHIFT) {
j += 2;
} else if ((lookAheadCharacter != MESSAGE_QUICKTEXT_DISABLE) &&
(lookAheadCharacter != MESSAGE_PERSISTENT) &&
(lookAheadCharacter != MESSAGE_EVENT) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK_DELAYED) &&
(lookAheadCharacter != MESSAGE_AWAIT_BUTTON_PRESS) &&
(lookAheadCharacter != MESSAGE_BOX_BREAK) && (lookAheadCharacter != MESSAGE_END)) {
} else if ((character != MESSAGE_QUICKTEXT_DISABLE) && (character != MESSAGE_PERSISTENT) &&
(character != MESSAGE_EVENT) && (character != MESSAGE_BOX_BREAK_DELAYED) &&
(character != MESSAGE_AWAIT_BUTTON_PRESS) && (character != MESSAGE_BOX_BREAK) &&
(character != MESSAGE_END)) {
j++;
} else {
break;
@ -944,8 +942,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
}
i = j - 1;
msgCtx->textDrawPos = i + 1;
if (character) {}
}
FALLTHROUGH;
case MESSAGE_QUICKTEXT_DISABLE:
@ -1435,7 +1431,6 @@ void Message_Decode(PlayState* play) {
digits[2]++;
digits[3] -= 10;
}
if (curChar) {}
loadChar = false;
for (i = 0; i < 4; i++) {

View file

@ -1025,7 +1025,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
sp50 = Math_FAtan2F(sp58, sp60);
temp1 = RAD_TO_BINANG(M_PI - (Math_FAtan2F(sp5C, sp58) + ((M_PI / 2) - sp50)));
temp1 = temp1 - skelAnime->jointTable[shinLimbIndex].z;
temp1 -= skelAnime->jointTable[shinLimbIndex].z;
if ((s16)(ABS(skelAnime->jointTable[shinLimbIndex].x) + ABS(skelAnime->jointTable[shinLimbIndex].y)) < 0) {
temp1 += 0x8000;