Differences From Artifact [38a360a277]:
- File
src/worldlight.m
— part of check-in
[75e920ae30]
at
2025-03-29 14:25:43
on branch trunk
— Switch from clang-format to manual formatting
clang-format does too many weird things. (user: js, size: 6260) [annotate] [blame] [check-ins using]
To Artifact [05ada5ded7]:
- File src/worldlight.m — part of check-in [c634a689e7] at 2025-03-29 17:13:40 on branch trunk — More style fixes (user: js, size: 6088) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
38 39 40 41 42 43 44 | if (hasoverbright) { l /= lightscale; stepl /= lightscale; // coloured light version, special case because most lights are // white if (light.attr3 || light.attr4) { | | < | < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | if (hasoverbright) { l /= lightscale; stepl /= lightscale; // coloured light version, special case because most lights are // white if (light.attr3 || light.attr4) { int dimness = rnd((255 - (light.attr2 + light.attr3 + light.attr4) / 3) / 16 + 1); x += stepx * dimness; y += stepy * dimness; if (OUTBORD(x >> PRECBITS, y >> PRECBITS)) return; int g = light.attr3 << PRECBITS; |
︙ | ︙ | |||
144 145 146 147 148 149 150 | } // median filter, smooths out random noise in light and makes it more mipable void postlightarea(const struct block *a) { // assumes area not on edge of world | | > > | < | | | < > | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | } // median filter, smooths out random noise in light and makes it more mipable void postlightarea(const struct block *a) { // assumes area not on edge of world for (int x = 0; x < a->xs; x++) { for (int y = 0; y < a->ys; y++) { struct sqr *s = S(x + a->x, y + a->y); // median is 4/2/1 instead #define median(m) \ s->m = (s->m * 2 + SW(s, 1, 0)->m * 2 + SW(s, 0, 1)->m * 2 + \ SW(s, -1, 0)->m * 2 + SW(s, 0, -1)->m * 2 + SW(s, 1, 1)->m + \ SW(s, 1, -1)->m + SW(s, -1, 1)->m + SW(s, -1, -1)->m) / 14; median(r); median(g); median(b); } } remip(a, 0); } void calclight() { |
︙ | ︙ |