those having a palette problem with DX5 in SDL 1.1.5, can you please
try this patch and report if it works?
diff -u -r1.11.2.22 SDL_dx5video.c
— src/video/windx5/SDL_dx5video.c 2000/09/17 23:29:25 1.11.2.22
+++ src/video/windx5/SDL_dx5video.c 2000/10/09 19:58:06
@@ -1934,28 +1934,25 @@
/* Set the system colormap in both fullscreen and windowed modes */
int DX5_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
{
-
SDL_Palette *palette;
int i;
int alloct_all;/* Copy palette colors into display palette */
-
palette = this->screen->format->palette;
if ( SDL_palette != NULL ) {
if ( (this->screen->flags&SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
/* We can set all entries explicitly */
for ( i=0; i< ncolors; ++i ) {
int j = firstcolor + i; -
SDL_colors[j].peRed = palette->colors[i].r;
-
SDL_colors[j].peGreen = palette->colors[i].g;
-
SDL_colors[j].peBlue = palette->colors[i].b;
-
SDL_colors[j].peRed = colors[i].r;
-
SDL_colors[j].peGreen = colors[i].g;
-
SDL_colors[j].peBlue = colors[i].b; } IDirectDrawPalette_SetEntries(SDL_palette, 0, firstcolor, ncolors, &SDL_colors[firstcolor]); alloct_all = 1; } else { /* Grab the 236 most diverse colors in the palette */
-
DX5_CompressPalette(this,
-
palette->colors, palette->ncolors, 236);
-
DX5_CompressPalette(this, colors, ncolors, 236); /* This sends an WM_PALETTECHANGED message to us */ colorchange_expected = 1; IDirectDrawPalette_SetEntries(SDL_palette, 0,
@@ -2127,7 +2124,9 @@
return;
/* We need to get the colors as they were set */
- palette = SDL_VideoSurface->format->palette;
- palette = this->physpal;
- if(!palette)
-
if ( palette == NULL ) { /* Sometimes we don’t have a palette */palette = SDL_VideoSurface->format->palette;
return;
}