Spread the 6 scanlines evenly across the full height
Skipping the last two of the 8 candidate positions (at y=24, 28) left an 8px gap with nothing in it at the bottom of every 32-row cycle. Skipping two interspersed positions instead (y=12, 28) spreads the resulting slightly-larger gaps across the full height instead of clustering them in one spot.
This commit is contained in:
1 parent
ef38fabebb
commit
1b2c96a42e
1 file changed
+9
-5
@@ -551,14 +551,18 @@ def _glitch_scanlines():
|
||||
# the starting position, so the snap is invisible -- a standard
|
||||
# infinite-scrolling-texture trick -- while the translate distance
|
||||
# never has to leave the small range already confirmed safe.
|
||||
# SCANLINE_PERIOD=4 over ART_SLOT=32 gives 8 evenly-spaced candidate
|
||||
# positions (0, 4, 8, ..., 28); skipping 2 of those 8 (rather than
|
||||
# changing the period itself, which the sweep's periodicity depends
|
||||
# on) to land on 6 visible lines. Skipping two *interspersed*
|
||||
# positions instead of the last two in the run -- which left an 8px
|
||||
# gap with nothing in it at the bottom of every cycle -- spreads the
|
||||
# resulting two, slightly-larger gaps across the full height instead.
|
||||
SCANLINE_SKIP = (12, 28)
|
||||
tall = ART_SLOT + SCANLINE_PERIOD
|
||||
lines = []
|
||||
for y in range(tall):
|
||||
# SCANLINE_PERIOD=4 over ART_SLOT=32 gives 8 evenly-spaced lines
|
||||
# per window; skipping 2 of those 8 positions (dropping the last
|
||||
# two in each 32-row repeat, rather than changing the period
|
||||
# itself) keeps the period dividing evenly into things cleanly.
|
||||
if y % SCANLINE_PERIOD == 0 and (y % ART_SLOT) < ART_SLOT - 2 * SCANLINE_PERIOD:
|
||||
if y % SCANLINE_PERIOD == 0 and (y % ART_SLOT) not in SCANLINE_SKIP:
|
||||
lines.append(render.Box(width = ART_SLOT, height = 1, color = "#00000080"))
|
||||
else:
|
||||
lines.append(render.Box(width = ART_SLOT, height = 1, color = "#00000000"))
|
||||
|
||||