stislav73 / quadra

Automatically exported from code.google.com/p/quadra
0 stars 0 forks source link

fades should be done with the physical palette only #75

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
SDL_Surface, compared to Bitmap, has the slight difference that it keeps
one logical palette per instance (instead of just always interpreting the
pixel values in terms of the physical palette).

The thing is, when blitting from one surface to another, the pixel values
are mapped from one palette to the other. So we need to keep adjusting the
source surface's palette when blitting during a fade, otherwise all the
pixels get mapped to dark color entries, and it doesn't "fix itself" when
the fade is over.

If we would keep the logical palette of the display surface stable and
played only with the physical palette for the fading effect, this would be
much simpler, where source surfaces (of which there seems to be only one at
a time in most screens? yet to be verified) would need to be adjusted only
when we changed the logical palette. In fact, it seems like we usually do
it the other way around (set the display palette from the background image,
for example) in the first place.

Palettes in general are really starting to annoy me, though. :-)

Original issue reported on code.google.com by pphaneuf on 20 Jun 2008 at 6:00