diff src/video/SDL_pixels.c @ 1682:7ae8018b2e5d SDL-1.3

Default palette entries to white, instead of black. More palettized video mode support...
author Sam Lantinga <slouken@libsdl.org>
date Fri, 16 Jun 2006 06:00:31 +0000
parents eef792d31de8
children 396a35389351
line wrap: on
line diff
--- a/src/video/SDL_pixels.c	Thu Jun 15 07:07:07 2006 +0000
+++ b/src/video/SDL_pixels.c	Fri Jun 16 06:00:31 2006 +0000
@@ -386,7 +386,7 @@
                 a = (a << format->Aloss) | ((a * Am) >> Aw);
                 format->palette->colors[i].unused = a;
 #else
-                format->palette->colors[i].unused = 0;
+                format->palette->colors[i].unused = SDL_ALPHA_OPAQUE;
 #endif
             }
         } else if (ncolors == 2) {
@@ -399,7 +399,7 @@
             format->palette->colors[1].b = 0x00;
         } else {
             /* Create an empty palette */
-            SDL_memset((format->palette)->colors, 0,
+            SDL_memset((format->palette)->colors, 0xFF,
                        (format->palette)->ncolors * sizeof(SDL_Color));
         }
     }
@@ -474,6 +474,7 @@
         b |= b << 2;
         b |= b << 4;
         colors[i].b = b;
+        colors[i].unused = SDL_ALPHA_OPAQUE;
     }
 }
 
@@ -696,7 +697,7 @@
 
     /* SDL_DitherColors does not initialize the 'unused' component of colors,
        but Map1to1 compares it against pal, so we should initialize it. */
-    SDL_memset(colors, 0, sizeof(colors));
+    SDL_memset(colors, 0xFF, sizeof(colors));
 
     dithered.ncolors = 256;
     SDL_DitherColors(colors, 8);