src/SDL12_compat.c
changeset 72 d20d9d70694b
parent 71 7a5593f0cd40
child 73 040f36454e95
equal deleted inserted replaced
71:7a5593f0cd40 72:d20d9d70694b
  1933         /* fill in the same default palette that SDL 1.2 does... */
  1933         /* fill in the same default palette that SDL 1.2 does... */
  1934         if (VideoSurface12->format->BitsPerPixel == 8) {
  1934         if (VideoSurface12->format->BitsPerPixel == 8) {
  1935             int i;
  1935             int i;
  1936             SDL_Color *color = VideoSurface12->format->palette->colors;
  1936             SDL_Color *color = VideoSurface12->format->palette->colors;
  1937             for (i = 0; i < 256; i++, color++) {
  1937             for (i = 0; i < 256; i++, color++) {
  1938                 { const int x = i & 0xe0; color->r = x >> 3 | x >> 6; }
  1938                 { const int x = i & 0xe0; color->r = x | x >> 3 | x >> 6; }
  1939                 { const int x = (i << 3) & 0xe0; color->g = x >> 3 | x >> 6; }
  1939                 { const int x = (i << 3) & 0xe0; color->g = x | x >> 3 | x >> 6; }
  1940                 { const int x = (i & 0x3) | (i & 0x3 << 2); color->b = x | x << 4; }
  1940                 { const int x = (i & 0x3) | ((i & 0x3) << 2); color->b = x | x << 4; }
  1941                 color->a = 255;
  1941                 color->a = 255;
  1942             }
  1942             }
  1943         }
  1943         }
  1944     }
  1944     }
  1945 
  1945