mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-29 08:42:51 -04:00
Misc Cleanup 2 (#1521)
* begin cleanup * more cleanup * more cleanup * more cleanup * more cleanup * more cleanup * fake matches * more cleanup * more cleanup * small thing * PR Review * PR Review
This commit is contained in:
+39
-40
@@ -449,59 +449,58 @@ void PreRender_AntiAliasFilterPixel(PreRender* this, s32 x, s32 y) {
|
||||
// For each neighbor
|
||||
for (i = 1; i < 5 * 3; i += 2) {
|
||||
// Only sample fully covered pixels
|
||||
if (buffCvg[i] == 7) {
|
||||
// Determine "Penultimate Maximum" Value
|
||||
if (buffCvg[i] != 7) {
|
||||
continue;
|
||||
}
|
||||
// Determine "Penultimate Maximum" Value
|
||||
|
||||
// If current maximum is less than this neighbor
|
||||
if (pmaxR < buffR[i]) {
|
||||
// For each neighbor (again)
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
// If not the neighbor we were at before, and this neighbor has a larger value and this pixel is
|
||||
// fully covered, that means the neighbor at `i` is the "penultimate maximum"
|
||||
if ((i != j) && (buffR[j] >= buffR[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxR = buffR[i];
|
||||
}
|
||||
// If current maximum is less than this neighbor
|
||||
if (pmaxR < buffR[i]) {
|
||||
// For each neighbor (again)
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
// If not the neighbor we were at before, and this neighbor has a larger value and this pixel is
|
||||
// fully covered, that means the neighbor at `i` is the "penultimate maximum"
|
||||
if ((i != j) && (buffR[j] >= buffR[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxR = buffR[i];
|
||||
}
|
||||
}
|
||||
if (pmaxG < buffG[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffG[j] >= buffG[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxG = buffG[i];
|
||||
}
|
||||
}
|
||||
if (pmaxG < buffG[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffG[j] >= buffG[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxG = buffG[i];
|
||||
}
|
||||
}
|
||||
if (pmaxB < buffB[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffB[j] >= buffB[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxB = buffB[i];
|
||||
}
|
||||
}
|
||||
if (pmaxB < buffB[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffB[j] >= buffB[i]) && (buffCvg[j] == 7)) {
|
||||
pmaxB = buffB[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (1) {}
|
||||
// Determine "Penultimate Minimum" Value
|
||||
|
||||
// Determine "Penultimate Minimum" Value
|
||||
|
||||
// Same as above with inverted conditions
|
||||
if (pminR > buffR[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffR[j] <= buffR[i]) && (buffCvg[j] == 7)) {
|
||||
pminR = buffR[i];
|
||||
}
|
||||
// Same as above with inverted conditions
|
||||
if (pminR > buffR[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffR[j] <= buffR[i]) && (buffCvg[j] == 7)) {
|
||||
pminR = buffR[i];
|
||||
}
|
||||
}
|
||||
if (pminG > buffG[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffG[j] <= buffG[i]) && (buffCvg[j] == 7)) {
|
||||
pminG = buffG[i];
|
||||
}
|
||||
}
|
||||
if (pminG > buffG[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffG[j] <= buffG[i]) && (buffCvg[j] == 7)) {
|
||||
pminG = buffG[i];
|
||||
}
|
||||
}
|
||||
if (pminB > buffB[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffB[j] <= buffB[i]) && (buffCvg[j] == 7)) {
|
||||
pminB = buffB[i];
|
||||
}
|
||||
}
|
||||
if (pminB > buffB[i]) {
|
||||
for (j = 1; j < 5 * 3; j += 2) {
|
||||
if ((i != j) && (buffB[j] <= buffB[i]) && (buffCvg[j] == 7)) {
|
||||
pminB = buffB[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-6
@@ -1075,7 +1075,7 @@ Vec3f Camera_CalcUpVec(s16 pitch, s16 yaw, s16 roll) {
|
||||
Vec3f rollMtxRow1;
|
||||
Vec3f rollMtxRow2;
|
||||
Vec3f rollMtxRow3;
|
||||
f32 pad;
|
||||
s32 pad;
|
||||
|
||||
// Axis to roll around
|
||||
u.x = cosP * sinY;
|
||||
@@ -1391,7 +1391,7 @@ s32 Camera_CalcAtForNormal1(Camera* camera, VecGeo* arg1, f32 yOffset, f32 forwa
|
||||
*/
|
||||
s32 Camera_CalcAtForParallel(Camera* camera, VecGeo* arg1, f32 yOffset, f32 xzOffsetMax, f32* focalActorPosY,
|
||||
s16 flags) {
|
||||
f32 pad;
|
||||
s32 pad;
|
||||
Vec3f focalActorAtOffsetTarget;
|
||||
Vec3f atTarget;
|
||||
f32 fovHeight;
|
||||
@@ -2477,9 +2477,7 @@ s32 Camera_Normal3(Camera* camera) {
|
||||
sp62 = BINANG_SUB(focalActorPosRot->rot.y, BINANG_ROT180(sp68.yaw));
|
||||
sp78 = OLib_Vec3fToVecGeo(&camera->unk_0F0);
|
||||
phi_v1_2 = focalActorPosRot->rot.y - sp78.yaw;
|
||||
if (phi_v1_2 < 0) {
|
||||
phi_v1_2 *= -1;
|
||||
}
|
||||
phi_v1_2 = ABS_ALT(phi_v1_2);
|
||||
|
||||
if (phi_v1_2 < 0x555A) {
|
||||
temp_f2 = 1.0f;
|
||||
@@ -3299,7 +3297,7 @@ s32 Camera_Jump3(Camera* camera) {
|
||||
f32 phi_f2_2;
|
||||
f32 temp_f0;
|
||||
f32 temp1;
|
||||
f32 pad;
|
||||
s32 pad;
|
||||
Jump3ReadOnlyData* roData = &camera->paramData.jump3.roData;
|
||||
Jump3ReadWriteData* rwData = &camera->paramData.jump3.rwData;
|
||||
f32 focalActorHeight = Camera_GetFocalActorHeight(camera);
|
||||
|
||||
@@ -2941,7 +2941,7 @@ s32 CollisionCheck_GetMassType(u8 mass) {
|
||||
*/
|
||||
void CollisionCheck_SetOCvsOC(PlayState* play, Collider* left, ColliderInfo* leftInfo, Vec3f* leftPos, Collider* right,
|
||||
ColliderInfo* rightInfo, Vec3f* rightPos, f32 overlap) {
|
||||
f32 pad;
|
||||
s32 pad;
|
||||
f32 leftDispRatio;
|
||||
f32 rightDispRatio;
|
||||
f32 xzDist;
|
||||
|
||||
@@ -116,8 +116,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
|
||||
f32 minDist = 0.0f;
|
||||
|
||||
do {
|
||||
doorIter = SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door = (EnDoor*)doorIter;
|
||||
door = (EnDoor*)SubS_FindActor(play, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
dist = Actor_WorldDistXYZToActor(actor, &door->knobDoor.dyna.actor);
|
||||
if (!isSetup || (dist < minDist)) {
|
||||
nearestDoor = door;
|
||||
@@ -127,6 +126,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) {
|
||||
doorIter = door->knobDoor.dyna.actor.next;
|
||||
} while (doorIter != NULL);
|
||||
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
return nearestDoor;
|
||||
|
||||
+2
-1
@@ -1302,7 +1302,8 @@ void Play_DrawMain(PlayState* this) {
|
||||
Lights_Draw(lights, gfxCtx);
|
||||
|
||||
if (1) {
|
||||
u32 roomDrawFlags = ((1) ? 1 : 0) | (((void)0, 1) ? 2 : 0); // FAKE:
|
||||
//! FAKE:
|
||||
u32 roomDrawFlags = ((1) ? 1 : 0) | (((void)0, 1) ? 2 : 0);
|
||||
|
||||
Scene_Draw(this);
|
||||
if (this->roomCtx.unk78) {
|
||||
|
||||
@@ -2262,7 +2262,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx**
|
||||
if (sPlayerRightHandType == PLAYER_MODELTYPE_RH_SHIELD) {
|
||||
if (player->transformation == PLAYER_FORM_HUMAN) {
|
||||
if (player->currentShield != PLAYER_SHIELD_NONE) {
|
||||
//! FAKE
|
||||
//! FAKE:
|
||||
rightHandDLists = &gPlayerHandHoldingShields[2 * ((player->currentShield - 1) ^ 0)];
|
||||
}
|
||||
}
|
||||
@@ -2870,7 +2870,7 @@ void Player_DrawCircusLeadersMask(PlayState* play, Player* player) {
|
||||
|
||||
Matrix_MultVec3f(&D_801C0B90[i], &D_801F59B0[i]);
|
||||
|
||||
//! FAKE
|
||||
//! FAKE:
|
||||
if (1) {}
|
||||
|
||||
D_801F59B0[i].y += -10.0f * scaleY;
|
||||
@@ -3607,7 +3607,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
}
|
||||
}
|
||||
} else if (limbIndex == PLAYER_LIMB_HEAD) {
|
||||
//! FAKE
|
||||
//! FAKE:
|
||||
if (((*dList1 != NULL) && ((((void)0, player->currentMask)) != (((void)0, PLAYER_MASK_NONE)))) &&
|
||||
(((player->transformation == PLAYER_FORM_HUMAN) &&
|
||||
((player->skelAnime.animation != &gPlayerAnim_cl_setmask) || (player->skelAnime.curFrame >= 12.0f))) ||
|
||||
@@ -3702,17 +3702,15 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
}
|
||||
|
||||
temp = &player->arr_AF0[1];
|
||||
for (i = 0; i < ARRAY_COUNT(spF0); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(spF0); i++, temp++) {
|
||||
*temp = spF0[0].x;
|
||||
temp++;
|
||||
}
|
||||
} else {
|
||||
temp = &player->arr_AF0[1];
|
||||
for (i = 0; i < ARRAY_COUNT(spF0); i++) {
|
||||
for (i = 0; i < ARRAY_COUNT(spF0); i++, temp++) {
|
||||
spF0[i].x = *temp;
|
||||
spF0[i].y = *temp;
|
||||
spF0[i].z = *temp;
|
||||
temp++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3731,7 +3729,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G
|
||||
Matrix_Scale(spF0[i].x, spF0[i].y, spF0[i].z, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
//! FAKE (yes, all of them are required)
|
||||
//! FAKE: (yes, all of them are required)
|
||||
// https://decomp.me/scratch/AdU3G
|
||||
if (1) {}
|
||||
if (1) {}
|
||||
|
||||
@@ -602,7 +602,7 @@ void SkinMatrix_SetRotateAroundVec(MtxF* mf, s16 a, f32 x, f32 y, f32 z) {
|
||||
f32 xy;
|
||||
f32 yz;
|
||||
f32 xz;
|
||||
f32 pad;
|
||||
s32 pad;
|
||||
|
||||
sinA = Math_SinS(a);
|
||||
cosA = Math_CosS(a);
|
||||
|
||||
@@ -1581,7 +1581,7 @@ void func_801457CC(GameState* gameState, SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
gSaveContext.save.saveInfo.checksum = 0;
|
||||
// FAKE: [sp64 + 0]?
|
||||
//! FAKE: [sp64 + 0]?
|
||||
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, gFlashSaveSizes[sp64 + 0]);
|
||||
|
||||
for (sp7A = 0; sp7A < ARRAY_COUNT(gSaveContext.save.saveInfo.playerData.newf); sp7A++) {
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
|
||||
actor = SubS_FindActor(play, actor, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door = (EnDoor*)actor;
|
||||
|
||||
if (actor == NULL) {
|
||||
if (door == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animationI
|
||||
endFrame = Animation_GetLastFrame(&animationInfo->animation->common);
|
||||
}
|
||||
startFrame = animationInfo->startFrame;
|
||||
if (startFrame >= endFrame || startFrame < 0) {
|
||||
if ((startFrame >= endFrame) || (startFrame < 0)) {
|
||||
return false;
|
||||
}
|
||||
if (animationInfo->playSpeed < 0.0f) {
|
||||
|
||||
Reference in New Issue
Block a user