Skip to content

Rewrite M_DrawStaticBox

Rewrites M_DrawStaticBox (the TV static effect on new single player saves and locked level select maps) to support sub-1128-pixel-wide "LSSTATIC" graphics (fixes #1014 (closed)), not appear unanimated with certain widths ("alters" #1015), allow vertical randomisation if "LSSTATIC" isn't 100 pixels tall, tile at edges (instead of clamping to avoid seeing the edge in the first place), plus some bonuses.

-

If "LSSTATIC" is 1 pixel wide, it stretches the graphic over the level select box instead of tiling it 160 times. (For comparison, it used to crash, but I mean relative to tiling it.) There's no randomisation here (I expect it to often be 1x1?); make the graphic wider if you want vertical randomisation.

Otherwise, if "LSSTATIC" is 160 pixels wide, it ditches randomisation in favour of controlled animation. Make a graphic that's 160 pixels wide and 100 times the amount of frames that you want tall (e.g. 160x1400 for 14 frames of animation), then fill out 160x100 frames from top to bottom like a vertical sprite-strip. Every frame lasts for 1 tic, and frames are displayed in order. This lets you make a vignette effect, whether animated or not. (For triple-column-wide map icons, the graphic is stretched horizontally to fit; it still uses 160x100 frames either way.)

Otherwise, if "LSSTATIC" is 100 pixels tall (as is the case in vanilla SRB2), it scrolls horizontally through the texture when drawing it, with a slight bit of randomisation (not much, to avoid a static box being drawn with nearly-identical offsets multiple frames in a row). If the end of the texture is on-screen, it gets tiled (as many times as is necessary to fill the static box). (For comparison, it used to clamp the texture to avoid seeing the end of the texture.) Note that it (still) scrolls "per frame", not "per tic".

Otherwise, if "LSSTATIC" is not exactly 1 pixel wide, not exactly 160 pixels wide, nor exactly 100 pixels tall, it scrolls horizontally with a slight bit of randomisation and has full vertical randomisation. Like above, it tiles if necessary, both horizontally and vertically.

This zip contains many add-ons used for testing. "Wide Map.pk3" adds a locked, triple-column-wide "Greenflower Zone act 4" map to the multiplayer map select, and the rest of the PK3s are named based on the width and height of their "LSSTATIC" graphic. Semi epilepsy warning! LSStatic.zip

-

TL;DR: Fixed issues and added new features for the level select's locked-map static effect

Merge request reports