pierce-smith1 / yok.scr

the doughbyte-themed windows screensaver
https://doughbyte.com/aut/yokscr
11 stars 1 forks source link

Make palette customizer dialog not slow as shit #59

Closed pierce-smith1 closed 7 months ago

pierce-smith1 commented 7 months ago

58

It turns out the (primary) cause of this was converting color data from the registry from a wide string to a short string every time the dialog refreshed - the function Windows uses to do this (WideCharToMultiByte) is insultingly slow. I just made the palette data deserializer work on wide strings directly, which involved some other code changes, but not too bad.

I also tried to solve the palette dialog flickering wildly when you scroll through the palettes, which is due to invalidating the entire dialog window when the only thing that needs to be repainted is the color buttons. I didn't really like what I had to do to get that to work... but it seems alright?