JNechaevsky / international-doom

Small, functional and simple source ports, created with help, efforts and bits of code from people around the world.
https://jnechaevsky.github.io/inter-doom/
GNU General Public License v2.0
25 stars 1 forks source link

Call HSV colors initialization only once #61

Closed JNechaevsky closed 8 months ago

JNechaevsky commented 8 months ago

This is have to be done only once at program startup, as HSV tables are not related to colormaps and gamma correction. Little optimization to save about 5 milliseconds on gamma-correction and few other features toggling.

JNechaevsky commented 8 months ago

@fabiangreffrath, probably worth to add it Crispy for all games? The idea is simple: no need to generate HSV tables over and over again. "Little diff" approach was to use static boolean, but I decided to move it into separated function to prevent extra condition hitting.

fabiangreffrath commented 8 months ago

When is R_InitColormaps() called a second time?

JNechaevsky commented 8 months ago

In Crispy on gamma-correction toggling, and it will be needed for hot-swapping true color render in game, when it's time comes. Apparently, I will need to do extra call for R_InitColormaps() in Hexen's level loading here, but that PR is still WIP and I don't want to bother you with it, at least until I pushed it as far as I can.