summaryrefslogtreecommitdiff
path: root/src/code/PreRender.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2024-03-23 22:04:07 +1100
committerGitHub <noreply@github.com>2024-03-23 08:04:07 -0300
commit5bef89a6ff33c3e84ad58d201bd1996a0d9f7db4 (patch)
tree39cc7a06f0ea32f31ab88096e7da179ceeef7571 /src/code/PreRender.c
parenta7fa8cc241d7f6e08d3744644cf8e93599f190a0 (diff)
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
Diffstat (limited to 'src/code/PreRender.c')
-rw-r--r--src/code/PreRender.c81
1 files changed, 40 insertions, 41 deletions
diff --git a/src/code/PreRender.c b/src/code/PreRender.c
index 011b07f1f..6d4e52cf4 100644
--- a/src/code/PreRender.c
+++ b/src/code/PreRender.c
@@ -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 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 (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 (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];
}
}
}