renpy / pygame_sdl2

Reimplementation of portions of the pygame API using SDL2.
GNU Lesser General Public License v2.1
325 stars 63 forks source link

Document a means of efficient color swapping in 32-bit surfaces #118

Closed pinobatch closed 1 month ago

pinobatch commented 5 years ago

The file README.rst states:

Our thinking is that 8, 16, and (to some extent) 24-bit surfaces are legacy formats, and not worth duplicating code four or more times to support.

I agree with respect to 16- and 24-bit surfaces. But in my Pygame code, it has been an idiom to draw a single image several times with different colors by changing the palette between draw calls. For example, if three of 16 colors represent skin, and three other colors represent a character's uniform, I can draw two teams of light- and dark-skinned characters with one 8-bit sprite sheet and a variable palette. I'd appreciate it if the documentation mentioned a replacement technique suitable for use with the 32-bit surfaces of Pygame_SDL2.