| Summary: | please allow for paletted surfaces with 32 bit depth | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Fabian Greffrath <fabian+debian> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
|
Description
Fabian Greffrath
2017-10-16 11:09:56 UTC
I'm fine with that, but it would be a feature of SDL_Surface, not the rendering system. Would you like to attach a tested patch? (In reply to Sam Lantinga from comment #1) > Would you like to attach a tested patch? I am not yet that far, just sharing the idea. Okay, that would be fine with me. :) Once you implement a patch you might want to check the performance. Shuffling around 32-bit data might be more expensive than working with 8-bit data and doing a final 32-bit expansion right before rendering. This seems to be a lot more involved than I initially expected/hoped. There are assumptions about palette values being Uint8 all over the code. However, I was pleasantly surprised that simply changing code from this screenbuffer = SDL_CreateRGBSurface(0, SCREENWIDTH, SCREENHEIGHT, 8, 0, 0, 0, 0); to this screenbuffer = SDL_CreateRGBSurface(0, SCREENWIDTH, SCREENHEIGHT, 32, 0, 0, 0, 0); SDL_Palette *palette = SDL_AllocPalette(256); SDL_SetSurfacePalette(screenbuffer, palette); SDL_FreePalette(palette); does at least not crash, but then each paletted image will be displayed as shades of blue. |