Skip to content

Commit e79f35c

Browse files
committed
use SDL_SetPixelFormatPalette
1 parent 74fc87a commit e79f35c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src_c/surface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,15 +1561,15 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
15611561
format.BitsPerPixel, format.Rmask, format.Gmask,
15621562
format.Bmask, format.Amask))) {
15631563
if (SDL_ISPIXELFORMAT_INDEXED(surf->format->format)) {
1564-
format.palette = surf->format->palette;
1564+
SDL_SetPixelFormatPalette(&format, surf->format->palette);
15651565
}
15661566
else {
15671567
/* Give the surface something other than an all white
15681568
* palette.
15691569
*/
15701570
SDL_SetPaletteColors(palette, default_palette_colors, 0,
15711571
default_palette_size);
1572-
format.palette = palette;
1572+
SDL_SetPixelFormatPalette(&format, palette);
15731573
}
15741574
}
15751575
newsurf = SDL_ConvertSurface(surf, &format, 0);

0 commit comments

Comments
 (0)