Improve HUD rendering when drawing stretched patches
In HWR_DrawStretchyFixedPatch
, there was a bit of code that did some excessive integer to float conversions by accident. This happened because C compilers don't optimize integers to floats at compile time (funnily enough) and as such, takes two integer values, divides them, converts them to float, divides, then back to integer, add or subtracts and then back to float again. As you can imagine, this is a pretty slow process, and it had a noticeable performance dip on OpenGL when drawing patches.
Also, just for funsies, I made a timelapse of the fix here:
This timelapse is when I got into completely blind, so I did no preparation on this (and I switched terminal to cool-retro-term
just so you folks could look at something nice, something that didn't really work out at the start considering the illegible text near the beginning). It's my normal workflow when dealing with performance issues and the software you saw were kakoune
(text editor) and perf
(profiler). And if anyone asks: the music playing is keisari micro by laamaa.
Fixes #1408 (closed)