Making the API simpler, removed support for palettized video modes and textures.
authorSam Lantinga <slouken@libsdl.org>
Tue, 01 Feb 2011 21:23:43 -0800
changeset 5149be02be2ea897
parent 5148 5429daf5e3f9
child 5150 1435f8a6425c
Making the API simpler, removed support for palettized video modes and textures.
include/SDL_render.h
include/SDL_video.h
src/SDL_compat.c
src/video/SDL_renderer_gl.c
src/video/SDL_renderer_gles.c
src/video/SDL_renderer_sw.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/cocoa/SDL_cocoamodes.m
src/video/directfb/SDL_DirectFB_render.c
src/video/dummy/SDL_nullrender.c
src/video/nds/SDL_ndsrender.c
src/video/pandora/SDL_pandora.h
src/video/photon/SDL_photon.h
src/video/photon/SDL_photon_render.c
src/video/qnxgf/SDL_gf_render.c
src/video/qnxgf/SDL_qnxgf.c
src/video/qnxgf/SDL_qnxgf.h
src/video/sdlgenblit.pl
src/video/windows/SDL_d3drender.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsmodes.c
src/video/x11/SDL_x11modes.c
     1.1 --- a/include/SDL_render.h	Tue Feb 01 20:50:04 2011 -0800
     1.2 +++ b/include/SDL_render.h	Tue Feb 01 21:23:43 2011 -0800
     1.3 @@ -220,38 +220,6 @@
     1.4                                                     void **pixels, int *pitch);
     1.5  
     1.6  /**
     1.7 - *  \brief Set the color palette of an indexed texture.
     1.8 - *  
     1.9 - *  \param texture  The texture to update.
    1.10 - *  \param colors     The array of RGB color data.
    1.11 - *  \param firstcolor The first index to update.
    1.12 - *  \param ncolors    The number of palette entries to fill with the color data.
    1.13 - *  
    1.14 - *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
    1.15 - *          texture.
    1.16 - */
    1.17 -extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture,
    1.18 -                                                  const SDL_Color * colors,
    1.19 -                                                  int firstcolor,
    1.20 -                                                  int ncolors);
    1.21 -
    1.22 -/**
    1.23 - *  \brief Get the color palette from an indexed texture if it has one.
    1.24 - *  
    1.25 - *  \param texture  The texture to update.
    1.26 - *  \param colors     The array to fill with RGB color data.
    1.27 - *  \param firstcolor The first index to retrieve.
    1.28 - *  \param ncolors    The number of palette entries to retrieve.
    1.29 - *  
    1.30 - *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
    1.31 - *          texture.
    1.32 - */
    1.33 -extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture,
    1.34 -                                                  SDL_Color * colors,
    1.35 -                                                  int firstcolor,
    1.36 -                                                  int ncolors);
    1.37 -
    1.38 -/**
    1.39   *  \brief Set an additional color value used in render copy operations.
    1.40   *  
    1.41   *  \param texture The texture to update.
     2.1 --- a/include/SDL_video.h	Tue Feb 01 20:50:04 2011 -0800
     2.2 +++ b/include/SDL_video.h	Tue Feb 01 21:23:43 2011 -0800
     2.3 @@ -356,25 +356,6 @@
     2.4                                                       SDL_DisplayMode * mode);
     2.5  
     2.6  /**
     2.7 - *  \brief Set the palette entries for indexed display modes.
     2.8 - *  
     2.9 - *  \return 0 on success, or -1 if the display mode isn't palettized or the 
    2.10 - *          colors couldn't be set.
    2.11 - */
    2.12 -extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
    2.13 -                                                  int firstcolor,
    2.14 -                                                  int ncolors);
    2.15 -
    2.16 -/**
    2.17 - *  \brief Gets the palette entries for indexed display modes.
    2.18 - *  
    2.19 - *  \return 0 on success, or -1 if the display mode isn't palettized
    2.20 - */
    2.21 -extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
    2.22 -                                                  int firstcolor,
    2.23 -                                                  int ncolors);
    2.24 -
    2.25 -/**
    2.26   *  \brief Set the gamma correction for each of the color channels on the 
    2.27   *         currently selected display.
    2.28   *  
     3.1 --- a/src/SDL_compat.c	Tue Feb 01 20:50:04 2011 -0800
     3.2 +++ b/src/SDL_compat.c	Tue Feb 01 21:23:43 2011 -0800
     3.3 @@ -320,27 +320,6 @@
     3.4      return 1;
     3.5  }
     3.6  
     3.7 -static int
     3.8 -SDL_VideoPaletteChanged(void *userdata, SDL_Palette * palette)
     3.9 -{
    3.10 -    if (userdata == SDL_ShadowSurface) {
    3.11 -        /* If the shadow palette changed, make the changes visible */
    3.12 -        if (!SDL_VideoSurface->format->palette) {
    3.13 -            SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0);
    3.14 -        }
    3.15 -    }
    3.16 -    if (userdata == SDL_VideoSurface) {
    3.17 -        /* The display may not have a palette, but always set texture palette */
    3.18 -        SDL_SetDisplayPalette(palette->colors, 0, palette->ncolors);
    3.19 -
    3.20 -        if (SDL_SetTexturePalette
    3.21 -            (SDL_VideoTexture, palette->colors, 0, palette->ncolors) < 0) {
    3.22 -            return -1;
    3.23 -        }
    3.24 -    }
    3.25 -    return 0;
    3.26 -}
    3.27 -
    3.28  static void
    3.29  GetEnvironmentWindowPosition(int w, int h, int *x, int *y)
    3.30  {
    3.31 @@ -543,8 +522,6 @@
    3.32          SDL_ShadowSurface = NULL;
    3.33      }
    3.34      if (SDL_VideoSurface) {
    3.35 -        SDL_DelPaletteWatch(SDL_VideoSurface->format->palette,
    3.36 -                            SDL_VideoPaletteChanged, NULL);
    3.37          SDL_FreeSurface(SDL_VideoSurface);
    3.38          SDL_VideoSurface = NULL;
    3.39      }
    3.40 @@ -694,18 +671,6 @@
    3.41      }
    3.42      SDL_VideoSurface->flags |= surface_flags;
    3.43  
    3.44 -    /* Set a default screen palette */
    3.45 -    if (SDL_VideoSurface->format->palette) {
    3.46 -        SDL_VideoSurface->flags |= SDL_HWPALETTE;
    3.47 -        SDL_DitherColors(SDL_VideoSurface->format->palette->colors,
    3.48 -                         SDL_VideoSurface->format->BitsPerPixel);
    3.49 -        SDL_AddPaletteWatch(SDL_VideoSurface->format->palette,
    3.50 -                            SDL_VideoPaletteChanged, SDL_VideoSurface);
    3.51 -        SDL_SetPaletteColors(SDL_VideoSurface->format->palette,
    3.52 -                             SDL_VideoSurface->format->palette->colors, 0,
    3.53 -                             SDL_VideoSurface->format->palette->ncolors);
    3.54 -    }
    3.55 -
    3.56      /* Create a shadow surface if necessary */
    3.57      if ((bpp != SDL_VideoSurface->format->BitsPerPixel)
    3.58          && !(flags & SDL_ANYFORMAT)) {
    3.59 @@ -719,15 +684,8 @@
    3.60          /* 8-bit SDL_ShadowSurface surfaces report that they have exclusive palette */
    3.61          if (SDL_ShadowSurface->format->palette) {
    3.62              SDL_ShadowSurface->flags |= SDL_HWPALETTE;
    3.63 -            if (SDL_VideoSurface->format->palette) {
    3.64 -                SDL_SetSurfacePalette(SDL_ShadowSurface,
    3.65 -                                      SDL_VideoSurface->format->palette);
    3.66 -            } else {
    3.67 -                SDL_DitherColors(SDL_ShadowSurface->format->palette->colors,
    3.68 -                                 SDL_ShadowSurface->format->BitsPerPixel);
    3.69 -            }
    3.70 -            SDL_AddPaletteWatch(SDL_ShadowSurface->format->palette,
    3.71 -                                SDL_VideoPaletteChanged, SDL_ShadowSurface);
    3.72 +            SDL_DitherColors(SDL_ShadowSurface->format->palette->colors,
    3.73 +                             SDL_ShadowSurface->format->BitsPerPixel);
    3.74          }
    3.75      }
    3.76      SDL_PublicSurface =
     4.1 --- a/src/video/SDL_renderer_gl.c	Tue Feb 01 20:50:04 2011 -0800
     4.2 +++ b/src/video/SDL_renderer_gl.c	Tue Feb 01 21:23:43 2011 -0800
     4.3 @@ -72,13 +72,6 @@
     4.4  static int GL_QueryTexturePixels(SDL_Renderer * renderer,
     4.5                                   SDL_Texture * texture, void **pixels,
     4.6                                   int *pitch);
     4.7 -static int GL_SetTexturePalette(SDL_Renderer * renderer,
     4.8 -                                SDL_Texture * texture,
     4.9 -                                const SDL_Color * colors, int firstcolor,
    4.10 -                                int ncolors);
    4.11 -static int GL_GetTexturePalette(SDL_Renderer * renderer,
    4.12 -                                SDL_Texture * texture, SDL_Color * colors,
    4.13 -                                int firstcolor, int ncolors);
    4.14  static int GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    4.15                              const SDL_Rect * rect, const void *pixels,
    4.16                              int pitch);
    4.17 @@ -111,11 +104,8 @@
    4.18      {
    4.19       "opengl",
    4.20       (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
    4.21 -     15,
    4.22 +     13,
    4.23       {
    4.24 -      SDL_PIXELFORMAT_INDEX1LSB,
    4.25 -      SDL_PIXELFORMAT_INDEX1MSB,
    4.26 -      SDL_PIXELFORMAT_INDEX8,
    4.27        SDL_PIXELFORMAT_RGB332,
    4.28        SDL_PIXELFORMAT_RGB444,
    4.29        SDL_PIXELFORMAT_RGB555,
    4.30 @@ -149,7 +139,6 @@
    4.31  #include "SDL_glfuncs.h"
    4.32  #undef SDL_PROC
    4.33  
    4.34 -    PFNGLCOLORTABLEEXTPROC glColorTableEXT;
    4.35      void (*glTextureRangeAPPLE) (GLenum target, GLsizei length,
    4.36                                   const GLvoid * pointer);
    4.37  
    4.38 @@ -278,8 +267,6 @@
    4.39      renderer->WindowEvent = GL_WindowEvent;
    4.40      renderer->CreateTexture = GL_CreateTexture;
    4.41      renderer->QueryTexturePixels = GL_QueryTexturePixels;
    4.42 -    renderer->SetTexturePalette = GL_SetTexturePalette;
    4.43 -    renderer->GetTexturePalette = GL_GetTexturePalette;
    4.44      renderer->UpdateTexture = GL_UpdateTexture;
    4.45      renderer->LockTexture = GL_LockTexture;
    4.46      renderer->UnlockTexture = GL_UnlockTexture;
    4.47 @@ -339,21 +326,6 @@
    4.48          || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) {
    4.49          data->GL_ARB_texture_rectangle_supported = SDL_TRUE;
    4.50      }
    4.51 -    if (SDL_GL_ExtensionSupported("GL_EXT_paletted_texture")) {
    4.52 -        data->GL_EXT_paletted_texture_supported = SDL_TRUE;
    4.53 -        data->glColorTableEXT =
    4.54 -            (PFNGLCOLORTABLEEXTPROC) SDL_GL_GetProcAddress("glColorTableEXT");
    4.55 -    } else {
    4.56 -        /* Don't advertise support for 8-bit indexed texture format */
    4.57 -        Uint32 i, j;
    4.58 -        SDL_RendererInfo *info = &renderer->info;
    4.59 -        for (i = 0, j = 0; i < info->num_texture_formats; ++i) {
    4.60 -            if (info->texture_formats[i] != SDL_PIXELFORMAT_INDEX8) {
    4.61 -                info->texture_formats[j++] = info->texture_formats[i];
    4.62 -            }
    4.63 -        }
    4.64 -        --info->num_texture_formats;
    4.65 -    }
    4.66      if (SDL_GL_ExtensionSupported("GL_APPLE_ycbcr_422")) {
    4.67          data->GL_APPLE_ycbcr_422_supported = SDL_TRUE;
    4.68      }
    4.69 @@ -572,20 +544,6 @@
    4.70                 GLint* internalFormat, GLenum* format, GLenum* type)
    4.71  {
    4.72      switch (pixel_format) {
    4.73 -    case SDL_PIXELFORMAT_INDEX1LSB:
    4.74 -    case SDL_PIXELFORMAT_INDEX1MSB:
    4.75 -        *internalFormat = GL_RGB;
    4.76 -        *format = GL_COLOR_INDEX;
    4.77 -        *type = GL_BITMAP;
    4.78 -        break;
    4.79 -    case SDL_PIXELFORMAT_INDEX8:
    4.80 -        if (!renderdata->GL_EXT_paletted_texture_supported) {
    4.81 -            return SDL_FALSE;
    4.82 -        }
    4.83 -        *internalFormat = GL_COLOR_INDEX8_EXT;
    4.84 -        *format = GL_COLOR_INDEX;
    4.85 -        *type = GL_UNSIGNED_BYTE;
    4.86 -        break;
    4.87      case SDL_PIXELFORMAT_RGB332:
    4.88          *internalFormat = GL_R3_G3_B2;
    4.89          *format = GL_RGB;
    4.90 @@ -752,16 +710,6 @@
    4.91  
    4.92      data->shader = shader;
    4.93  
    4.94 -    if (texture->format == SDL_PIXELFORMAT_INDEX8) {
    4.95 -        data->palette = (Uint8 *) SDL_malloc(3 * 256 * sizeof(Uint8));
    4.96 -        if (!data->palette) {
    4.97 -            SDL_OutOfMemory();
    4.98 -            SDL_free(data);
    4.99 -            return -1;
   4.100 -        }
   4.101 -        SDL_memset(data->palette, 0xFF, 3 * 256 * sizeof(Uint8));
   4.102 -    }
   4.103 -
   4.104      if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
   4.105          data->pitch = texture->w * bytes_per_pixel(texture->format);
   4.106          data->pixels = SDL_malloc(texture->h * data->pitch);
   4.107 @@ -871,65 +819,10 @@
   4.108      return 0;
   4.109  }
   4.110  
   4.111 -static int
   4.112 -GL_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   4.113 -                     const SDL_Color * colors, int firstcolor, int ncolors)
   4.114 -{
   4.115 -    GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata;
   4.116 -    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
   4.117 -    Uint8 *palette;
   4.118 -
   4.119 -    GL_ActivateRenderer(renderer);
   4.120 -
   4.121 -    if (!data->palette) {
   4.122 -        SDL_SetError("Texture doesn't have a palette");
   4.123 -        return -1;
   4.124 -    }
   4.125 -    palette = data->palette + firstcolor * 3;
   4.126 -    while (ncolors--) {
   4.127 -        *palette++ = colors->r;
   4.128 -        *palette++ = colors->g;
   4.129 -        *palette++ = colors->b;
   4.130 -        ++colors;
   4.131 -    }
   4.132 -    renderdata->glEnable(data->type);
   4.133 -    renderdata->glBindTexture(data->type, data->texture);
   4.134 -    renderdata->glColorTableEXT(data->type, GL_RGB8, 256, GL_RGB,
   4.135 -                                GL_UNSIGNED_BYTE, data->palette);
   4.136 -    return 0;
   4.137 -}
   4.138 -
   4.139 -static int
   4.140 -GL_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   4.141 -                     SDL_Color * colors, int firstcolor, int ncolors)
   4.142 -{
   4.143 -    GL_TextureData *data = (GL_TextureData *) texture->driverdata;
   4.144 -    Uint8 *palette;
   4.145 -
   4.146 -    if (!data->palette) {
   4.147 -        SDL_SetError("Texture doesn't have a palette");
   4.148 -        return -1;
   4.149 -    }
   4.150 -    palette = data->palette + firstcolor * 3;
   4.151 -    while (ncolors--) {
   4.152 -        colors->r = *palette++;
   4.153 -        colors->g = *palette++;
   4.154 -        colors->b = *palette++;
   4.155 -        colors->unused = SDL_ALPHA_OPAQUE;
   4.156 -        ++colors;
   4.157 -    }
   4.158 -    return 0;
   4.159 -}
   4.160 -
   4.161  static void
   4.162  SetupTextureUpdate(GL_RenderData * renderdata, SDL_Texture * texture,
   4.163                     int pitch)
   4.164  {
   4.165 -    if (texture->format == SDL_PIXELFORMAT_INDEX1LSB) {
   4.166 -        renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 1);
   4.167 -    } else if (texture->format == SDL_PIXELFORMAT_INDEX1MSB) {
   4.168 -        renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 0);
   4.169 -    }
   4.170      renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   4.171      renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH,
   4.172                                (pitch / bytes_per_pixel(texture->format)) /
   4.173 @@ -1265,11 +1158,6 @@
   4.174          return -1;
   4.175      }
   4.176  
   4.177 -    if (pixel_format == SDL_PIXELFORMAT_INDEX1LSB) {
   4.178 -        data->glPixelStorei(GL_PACK_LSB_FIRST, 1);
   4.179 -    } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
   4.180 -        data->glPixelStorei(GL_PACK_LSB_FIRST, 0);
   4.181 -    }
   4.182      data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
   4.183      data->glPixelStorei(GL_PACK_ROW_LENGTH,
   4.184                          (pitch / bytes_per_pixel(pixel_format)));
   4.185 @@ -1314,11 +1202,6 @@
   4.186          return -1;
   4.187      }
   4.188  
   4.189 -    if (pixel_format == SDL_PIXELFORMAT_INDEX1LSB) {
   4.190 -        data->glPixelStorei(GL_UNPACK_LSB_FIRST, 1);
   4.191 -    } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
   4.192 -        data->glPixelStorei(GL_UNPACK_LSB_FIRST, 0);
   4.193 -    }
   4.194      data->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   4.195      data->glPixelStorei(GL_UNPACK_ROW_LENGTH,
   4.196                          (pitch / bytes_per_pixel(pixel_format)));
     5.1 --- a/src/video/SDL_renderer_gles.c	Tue Feb 01 20:50:04 2011 -0800
     5.2 +++ b/src/video/SDL_renderer_gles.c	Tue Feb 01 21:23:43 2011 -0800
     5.3 @@ -60,13 +60,6 @@
     5.4  static int GLES_QueryTexturePixels(SDL_Renderer * renderer,
     5.5                                     SDL_Texture * texture, void **pixels,
     5.6                                     int *pitch);
     5.7 -static int GLES_SetTexturePalette(SDL_Renderer * renderer,
     5.8 -                                  SDL_Texture * texture,
     5.9 -                                  const SDL_Color * colors, int firstcolor,
    5.10 -                                  int ncolors);
    5.11 -static int GLES_GetTexturePalette(SDL_Renderer * renderer,
    5.12 -                                  SDL_Texture * texture, SDL_Color * colors,
    5.13 -                                  int firstcolor, int ncolors);
    5.14  static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    5.15                                const SDL_Rect * rect, const void *pixels,
    5.16                                int pitch);
    5.17 @@ -219,8 +212,6 @@
    5.18      renderer->WindowEvent = GLES_WindowEvent;
    5.19      renderer->CreateTexture = GLES_CreateTexture;
    5.20      renderer->QueryTexturePixels = GLES_QueryTexturePixels;
    5.21 -    renderer->SetTexturePalette = GLES_SetTexturePalette;
    5.22 -    renderer->GetTexturePalette = GLES_GetTexturePalette;
    5.23      renderer->UpdateTexture = GLES_UpdateTexture;
    5.24      renderer->LockTexture = GLES_LockTexture;
    5.25      renderer->UnlockTexture = GLES_UnlockTexture;
    5.26 @@ -467,22 +458,6 @@
    5.27      return 0;
    5.28  }
    5.29  
    5.30 -static int
    5.31 -GLES_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    5.32 -                       const SDL_Color * colors, int firstcolor, int ncolors)
    5.33 -{
    5.34 -    SDL_SetError("OpenGL ES does not support paletted textures");
    5.35 -    return -1;
    5.36 -}
    5.37 -
    5.38 -static int
    5.39 -GLES_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    5.40 -                       SDL_Color * colors, int firstcolor, int ncolors)
    5.41 -{
    5.42 -    SDL_SetError("OpenGL ES does not support paletted textures");
    5.43 -    return -1;
    5.44 -}
    5.45 -
    5.46  static void
    5.47  SetupTextureUpdate(GLES_RenderData * renderdata, SDL_Texture * texture,
    5.48                     int pitch)
     6.1 --- a/src/video/SDL_renderer_sw.c	Tue Feb 01 20:50:04 2011 -0800
     6.2 +++ b/src/video/SDL_renderer_sw.c	Tue Feb 01 21:23:43 2011 -0800
     6.3 @@ -38,13 +38,6 @@
     6.4  static int SW_QueryTexturePixels(SDL_Renderer * renderer,
     6.5                                   SDL_Texture * texture, void **pixels,
     6.6                                   int *pitch);
     6.7 -static int SW_SetTexturePalette(SDL_Renderer * renderer,
     6.8 -                                SDL_Texture * texture,
     6.9 -                                const SDL_Color * colors, int firstcolor,
    6.10 -                                int ncolors);
    6.11 -static int SW_GetTexturePalette(SDL_Renderer * renderer,
    6.12 -                                SDL_Texture * texture, SDL_Color * colors,
    6.13 -                                int firstcolor, int ncolors);
    6.14  static int SW_SetTextureColorMod(SDL_Renderer * renderer,
    6.15                                   SDL_Texture * texture);
    6.16  static int SW_SetTextureAlphaMod(SDL_Renderer * renderer,
    6.17 @@ -80,9 +73,8 @@
    6.18      {
    6.19       "software",
    6.20       (SDL_RENDERER_PRESENTVSYNC),
    6.21 -     14,
    6.22 +     13,
    6.23       {
    6.24 -      SDL_PIXELFORMAT_INDEX8,
    6.25        SDL_PIXELFORMAT_RGB555,
    6.26        SDL_PIXELFORMAT_RGB565,
    6.27        SDL_PIXELFORMAT_RGB888,
    6.28 @@ -141,26 +133,11 @@
    6.29      SDL_free(texture);
    6.30  }
    6.31  
    6.32 -static int
    6.33 -DisplayPaletteChanged(void *userdata, SDL_Palette * palette)
    6.34 -{
    6.35 -    SW_RenderData *data = (SW_RenderData *) userdata;
    6.36 -
    6.37 -    if (data->renderer->SetTexturePalette) {
    6.38 -        data->renderer->SetTexturePalette(data->renderer, data->texture,
    6.39 -                                          palette->colors, 0,
    6.40 -                                          palette->ncolors);
    6.41 -    }
    6.42 -    return 0;
    6.43 -}
    6.44 -
    6.45  void
    6.46  Setup_SoftwareRenderer(SDL_Renderer * renderer)
    6.47  {
    6.48      renderer->CreateTexture = SW_CreateTexture;
    6.49      renderer->QueryTexturePixels = SW_QueryTexturePixels;
    6.50 -    renderer->SetTexturePalette = SW_SetTexturePalette;
    6.51 -    renderer->GetTexturePalette = SW_GetTexturePalette;
    6.52      renderer->SetTextureColorMod = SW_SetTextureColorMod;
    6.53      renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod;
    6.54      renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
    6.55 @@ -273,12 +250,6 @@
    6.56          SW_DestroyRenderer(renderer);
    6.57          return NULL;
    6.58      }
    6.59 -    SDL_SetSurfacePalette(&data->surface, display->palette);
    6.60 -
    6.61 -    /* Set up a palette watch on the display palette */
    6.62 -    if (display->palette) {
    6.63 -        SDL_AddPaletteWatch(display->palette, DisplayPaletteChanged, data);
    6.64 -    }
    6.65  
    6.66      return renderer;
    6.67  }
    6.68 @@ -366,37 +337,6 @@
    6.69  }
    6.70  
    6.71  static int
    6.72 -SW_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    6.73 -                     const SDL_Color * colors, int firstcolor, int ncolors)
    6.74 -{
    6.75 -    if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    6.76 -        SDL_SetError("YUV textures don't have a palette");
    6.77 -        return -1;
    6.78 -    } else {
    6.79 -        SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
    6.80 -
    6.81 -        return SDL_SetPaletteColors(surface->format->palette, colors,
    6.82 -                                    firstcolor, ncolors);
    6.83 -    }
    6.84 -}
    6.85 -
    6.86 -static int
    6.87 -SW_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
    6.88 -                     SDL_Color * colors, int firstcolor, int ncolors)
    6.89 -{
    6.90 -    if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
    6.91 -        SDL_SetError("YUV textures don't have a palette");
    6.92 -        return -1;
    6.93 -    } else {
    6.94 -        SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
    6.95 -
    6.96 -        SDL_memcpy(colors, &surface->format->palette->colors[firstcolor],
    6.97 -                   ncolors * sizeof(*colors));
    6.98 -        return 0;
    6.99 -    }
   6.100 -}
   6.101 -
   6.102 -static int
   6.103  SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture)
   6.104  {
   6.105      SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
   6.106 @@ -793,13 +733,8 @@
   6.107              DestroyTexture(data->renderer, data->texture);
   6.108          }
   6.109          if (data->surface.format) {
   6.110 -            SDL_SetSurfacePalette(&data->surface, NULL);
   6.111              SDL_FreeFormat(data->surface.format);
   6.112          }
   6.113 -        if (display->palette) {
   6.114 -            SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged,
   6.115 -                                data);
   6.116 -        }
   6.117          if (data->renderer) {
   6.118              data->renderer->DestroyRenderer(data->renderer);
   6.119          }
     7.1 --- a/src/video/SDL_sysvideo.h	Tue Feb 01 20:50:04 2011 -0800
     7.2 +++ b/src/video/SDL_sysvideo.h	Tue Feb 01 21:23:43 2011 -0800
     7.3 @@ -67,12 +67,6 @@
     7.4      int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
     7.5      int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
     7.6                                 void **pixels, int *pitch);
     7.7 -    int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
     7.8 -                              const SDL_Color * colors, int firstcolor,
     7.9 -                              int ncolors);
    7.10 -    int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
    7.11 -                              SDL_Color * colors, int firstcolor,
    7.12 -                              int ncolors);
    7.13      int (*SetTextureColorMod) (SDL_Renderer * renderer,
    7.14                                 SDL_Texture * texture);
    7.15      int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
    7.16 @@ -195,7 +189,6 @@
    7.17      SDL_DisplayMode desktop_mode;
    7.18      SDL_DisplayMode current_mode;
    7.19      SDL_bool updating_fullscreen;
    7.20 -    SDL_Palette *palette;
    7.21  
    7.22      Uint16 *gamma;
    7.23      Uint16 *saved_gamma;        /* (just offset into gamma) */
    7.24 @@ -259,12 +252,6 @@
    7.25       */
    7.26      int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
    7.27  
    7.28 -    /* Set the color entries of the display palette */
    7.29 -    int (*SetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
    7.30 -
    7.31 -    /* Get the color entries of the display palette */
    7.32 -    int (*GetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
    7.33 -
    7.34      /* Set the gamma ramp */
    7.35      int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
    7.36  
    7.37 @@ -447,8 +434,6 @@
    7.38  extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
    7.39  extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
    7.40  extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode);
    7.41 -extern int SDL_SetPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors);
    7.42 -extern int SDL_GetPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors);
    7.43  extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue);
    7.44  extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue);
    7.45  extern void SDL_AddRenderDriver(SDL_VideoDisplay *display, const SDL_RenderDriver * driver);
     8.1 --- a/src/video/SDL_video.c	Tue Feb 01 20:50:04 2011 -0800
     8.2 +++ b/src/video/SDL_video.c	Tue Feb 01 21:23:43 2011 -0800
     8.3 @@ -645,7 +645,6 @@
     8.4  {
     8.5      SDL_DisplayMode display_mode;
     8.6      SDL_DisplayMode current_mode;
     8.7 -    int ncolors;
     8.8  
     8.9      if (mode) {
    8.10          display_mode = *mode;
    8.11 @@ -689,29 +688,6 @@
    8.12          return -1;
    8.13      }
    8.14      display->current_mode = display_mode;
    8.15 -
    8.16 -    /* Set up a palette, if necessary */
    8.17 -    if (SDL_ISPIXELFORMAT_INDEXED(display_mode.format)) {
    8.18 -        ncolors = (1 << SDL_BITSPERPIXEL(display_mode.format));
    8.19 -    } else {
    8.20 -        ncolors = 0;
    8.21 -    }
    8.22 -    if ((!ncolors && display->palette) || (ncolors && !display->palette)
    8.23 -        || (ncolors && ncolors != display->palette->ncolors)) {
    8.24 -        if (display->palette) {
    8.25 -            SDL_FreePalette(display->palette);
    8.26 -            display->palette = NULL;
    8.27 -        }
    8.28 -        if (ncolors) {
    8.29 -            display->palette = SDL_AllocPalette(ncolors);
    8.30 -            if (!display->palette) {
    8.31 -                return -1;
    8.32 -            }
    8.33 -            SDL_DitherColors(display->palette->colors,
    8.34 -                             SDL_BITSPERPIXEL(display_mode.format));
    8.35 -        }
    8.36 -    }
    8.37 -
    8.38      return 0;
    8.39  }
    8.40  
    8.41 @@ -813,66 +789,6 @@
    8.42      display->fullscreen_window = NULL;
    8.43  }
    8.44  
    8.45 -int
    8.46 -SDL_SetPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors)
    8.47 -{
    8.48 -    SDL_Palette *palette;
    8.49 -    int status = 0;
    8.50 -
    8.51 -    palette = display->palette;
    8.52 -    if (!palette) {
    8.53 -        SDL_SetError("Display mode does not have a palette");
    8.54 -        return -1;
    8.55 -    }
    8.56 -    status = SDL_SetPaletteColors(palette, colors, firstcolor, ncolors);
    8.57 -
    8.58 -    if (_this->SetDisplayPalette) {
    8.59 -        if (_this->SetDisplayPalette(_this, display, palette) < 0) {
    8.60 -            status = -1;
    8.61 -        }
    8.62 -    }
    8.63 -    return status;
    8.64 -}
    8.65 -
    8.66 -int
    8.67 -SDL_SetDisplayPalette(const SDL_Color * colors, int firstcolor, int ncolors)
    8.68 -{
    8.69 -    if (!_this) {
    8.70 -        SDL_UninitializedVideo();
    8.71 -        return -1;
    8.72 -    }
    8.73 -    return SDL_SetPaletteForDisplay(SDL_CurrentDisplay, colors, firstcolor, ncolors);
    8.74 -}
    8.75 -
    8.76 -int
    8.77 -SDL_GetPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors)
    8.78 -{
    8.79 -    SDL_Palette *palette;
    8.80 -
    8.81 -    palette = display->palette;
    8.82 -    if (!palette || !palette->ncolors) {
    8.83 -        SDL_SetError("Display mode does not have a palette");
    8.84 -        return -1;
    8.85 -    }
    8.86 -    if (firstcolor < 0 || (firstcolor + ncolors) > palette->ncolors) {
    8.87 -        SDL_SetError("Palette indices are out of range");
    8.88 -        return -1;
    8.89 -    }
    8.90 -    SDL_memcpy(colors, &palette->colors[firstcolor],
    8.91 -               ncolors * sizeof(*colors));
    8.92 -    return 0;
    8.93 -}
    8.94 -
    8.95 -int
    8.96 -SDL_GetDisplayPalette(SDL_Color * colors, int firstcolor, int ncolors)
    8.97 -{
    8.98 -    if (!_this) {
    8.99 -        SDL_UninitializedVideo();
   8.100 -        return -1;
   8.101 -    }
   8.102 -    return SDL_GetPaletteForDisplay(SDL_CurrentDisplay, colors, firstcolor, ncolors);
   8.103 -}
   8.104 -
   8.105  SDL_Window *
   8.106  SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
   8.107  {
   8.108 @@ -1674,12 +1590,7 @@
   8.109                  SDL_PIXELFORMAT_BGRA4444,
   8.110                  SDL_PIXELFORMAT_RGB444,
   8.111                  SDL_PIXELFORMAT_ARGB2101010,
   8.112 -                SDL_PIXELFORMAT_INDEX8,
   8.113 -                SDL_PIXELFORMAT_INDEX4LSB,
   8.114 -                SDL_PIXELFORMAT_INDEX4MSB,
   8.115                  SDL_PIXELFORMAT_RGB332,
   8.116 -                SDL_PIXELFORMAT_INDEX1LSB,
   8.117 -                SDL_PIXELFORMAT_INDEX1MSB,
   8.118                  SDL_PIXELFORMAT_UNKNOWN
   8.119              };
   8.120  
   8.121 @@ -1874,26 +1785,11 @@
   8.122  
   8.123          /* Set up a destination surface for the texture update */
   8.124          SDL_InitFormat(&dst_fmt, bpp, Rmask, Gmask, Bmask, Amask);
   8.125 -        if (SDL_ISPIXELFORMAT_INDEXED(format)) {
   8.126 -            dst_fmt.palette =
   8.127 -                SDL_AllocPalette((1 << SDL_BITSPERPIXEL(format)));
   8.128 -            if (dst_fmt.palette) {
   8.129 -                /*
   8.130 -                 * FIXME: Should we try to copy
   8.131 -                 * fmt->palette?
   8.132 -                 */
   8.133 -                SDL_DitherColors(dst_fmt.palette->colors,
   8.134 -                                 SDL_BITSPERPIXEL(format));
   8.135 -            }
   8.136 -        }
   8.137          dst = SDL_ConvertSurface(surface, &dst_fmt, 0);
   8.138          if (dst) {
   8.139              SDL_UpdateTexture(texture, NULL, dst->pixels, dst->pitch);
   8.140              SDL_FreeSurface(dst);
   8.141          }
   8.142 -        if (dst_fmt.palette) {
   8.143 -            SDL_FreePalette(dst_fmt.palette);
   8.144 -        }
   8.145          if (!dst) {
   8.146              SDL_DestroyTexture(texture);
   8.147              return 0;
   8.148 @@ -1918,11 +1814,6 @@
   8.149              SDL_SetTextureBlendMode(texture, blendMode);
   8.150          }
   8.151      }
   8.152 -
   8.153 -    if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) {
   8.154 -        SDL_SetTexturePalette(texture, fmt->palette->colors, 0,
   8.155 -                              fmt->palette->ncolors);
   8.156 -    }
   8.157      return texture;
   8.158  }
   8.159  
   8.160 @@ -1963,40 +1854,6 @@
   8.161  }
   8.162  
   8.163  int
   8.164 -SDL_SetTexturePalette(SDL_Texture * texture, const SDL_Color * colors,
   8.165 -                      int firstcolor, int ncolors)
   8.166 -{
   8.167 -    SDL_Renderer *renderer;
   8.168 -
   8.169 -    CHECK_TEXTURE_MAGIC(texture, -1);
   8.170 -
   8.171 -    renderer = texture->renderer;
   8.172 -    if (!renderer->SetTexturePalette) {
   8.173 -        SDL_Unsupported();
   8.174 -        return -1;
   8.175 -    }
   8.176 -    return renderer->SetTexturePalette(renderer, texture, colors, firstcolor,
   8.177 -                                       ncolors);
   8.178 -}
   8.179 -
   8.180 -int
   8.181 -SDL_GetTexturePalette(SDL_Texture * texture, SDL_Color * colors,
   8.182 -                      int firstcolor, int ncolors)
   8.183 -{
   8.184 -    SDL_Renderer *renderer;
   8.185 -
   8.186 -    CHECK_TEXTURE_MAGIC(texture, -1);
   8.187 -
   8.188 -    renderer = texture->renderer;
   8.189 -    if (!renderer->GetTexturePalette) {
   8.190 -        SDL_Unsupported();
   8.191 -        return -1;
   8.192 -    }
   8.193 -    return renderer->GetTexturePalette(renderer, texture, colors, firstcolor,
   8.194 -                                       ncolors);
   8.195 -}
   8.196 -
   8.197 -int
   8.198  SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b)
   8.199  {
   8.200      SDL_Renderer *renderer;
   8.201 @@ -2687,10 +2544,6 @@
   8.202              SDL_free(display->desktop_mode.driverdata);
   8.203              display->desktop_mode.driverdata = NULL;
   8.204          }
   8.205 -        if (display->palette) {
   8.206 -            SDL_FreePalette(display->palette);
   8.207 -            display->palette = NULL;
   8.208 -        }
   8.209          if (display->gamma) {
   8.210              SDL_free(display->gamma);
   8.211              display->gamma = NULL;
     9.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Tue Feb 01 20:50:04 2011 -0800
     9.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Tue Feb 01 21:23:43 2011 -0800
     9.3 @@ -117,8 +117,8 @@
     9.4      mode->format = SDL_PIXELFORMAT_UNKNOWN;
     9.5      switch (bpp) {
     9.6      case 8:
     9.7 -        mode->format = SDL_PIXELFORMAT_INDEX8;
     9.8 -        break;
     9.9 +        /* We don't support palettized modes now */
    9.10 +        return SDL_FALSE;
    9.11      case 16:
    9.12          mode->format = SDL_PIXELFORMAT_ARGB1555;
    9.13          break;
    10.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Tue Feb 01 20:50:04 2011 -0800
    10.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Tue Feb 01 21:23:43 2011 -0800
    10.3 @@ -43,14 +43,6 @@
    10.4  static int DirectFB_QueryTexturePixels(SDL_Renderer * renderer,
    10.5                                         SDL_Texture * texture,
    10.6                                         void **pixels, int *pitch);
    10.7 -static int DirectFB_SetTexturePalette(SDL_Renderer * renderer,
    10.8 -                                      SDL_Texture * texture,
    10.9 -                                      const SDL_Color * colors,
   10.10 -                                      int firstcolor, int ncolors);
   10.11 -static int DirectFB_GetTexturePalette(SDL_Renderer * renderer,
   10.12 -                                      SDL_Texture * texture,
   10.13 -                                      SDL_Color * colors,
   10.14 -                                      int firstcolor, int ncolors);
   10.15  static int DirectFB_UpdateTexture(SDL_Renderer * renderer,
   10.16                                    SDL_Texture * texture,
   10.17                                    const SDL_Rect * rect,
   10.18 @@ -86,10 +78,8 @@
   10.19      {
   10.20       "directfb",
   10.21       (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
   10.22 -     14,
   10.23 +     12,
   10.24       {
   10.25 -      SDL_PIXELFORMAT_INDEX4LSB,
   10.26 -      SDL_PIXELFORMAT_INDEX8,
   10.27        SDL_PIXELFORMAT_RGB332,
   10.28        SDL_PIXELFORMAT_RGB555,
   10.29        SDL_PIXELFORMAT_RGB565,
   10.30 @@ -123,7 +113,6 @@
   10.31      Uint32 format;
   10.32      void *pixels;
   10.33      int pitch;
   10.34 -    IDirectFBPalette *palette;
   10.35      SDL_VideoDisplay *display;
   10.36      SDL_DirtyRectList dirty;
   10.37  #if (DFB_VERSION_ATLEAST(1,2,0))
   10.38 @@ -148,7 +137,6 @@
   10.39      if (!data)
   10.40          return 0;
   10.41      switch (data->format) {
   10.42 -    case SDL_PIXELFORMAT_INDEX4LSB:
   10.43      case SDL_PIXELFORMAT_ARGB4444:
   10.44      case SDL_PIXELFORMAT_ARGB1555:
   10.45      case SDL_PIXELFORMAT_ARGB8888:
   10.46 @@ -211,39 +199,6 @@
   10.47      }
   10.48  }
   10.49  
   10.50 -static int
   10.51 -DisplayPaletteChanged(void *userdata, SDL_Palette * palette)
   10.52 -{
   10.53 -#if USE_DISPLAY_PALETTE
   10.54 -    DirectFB_RenderData *data = (DirectFB_RenderData *) userdata;
   10.55 -    SDL_DFB_WINDOWSURFACE(data->window);
   10.56 -    IDirectFBPalette *surfpal;
   10.57 -
   10.58 -    int i;
   10.59 -    int ncolors;
   10.60 -    DFBColor entries[256];
   10.61 -
   10.62 -    SDL_DFB_CHECKERR(destsurf->GetPalette(destsurf, &surfpal));
   10.63 -
   10.64 -    /* FIXME: number of colors */
   10.65 -    ncolors = (palette->ncolors < 256 ? palette->ncolors : 256);
   10.66 -
   10.67 -    for (i = 0; i < ncolors; ++i) {
   10.68 -        entries[i].r = palette->colors[i].r;
   10.69 -        entries[i].g = palette->colors[i].g;
   10.70 -        entries[i].b = palette->colors[i].b;
   10.71 -        entries[i].a = palette->colors[i].unused;
   10.72 -    }
   10.73 -    SDL_DFB_CHECKERR(surfpal->SetEntries(surfpal, entries, ncolors, 0));
   10.74 -    return 0;
   10.75 -  error:
   10.76 -#else
   10.77 -    SDL_Unsupported();
   10.78 -#endif
   10.79 -    return -1;
   10.80 -}
   10.81 -
   10.82 -
   10.83  SDL_Renderer *
   10.84  DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
   10.85  {
   10.86 @@ -260,8 +215,6 @@
   10.87      renderer->ActivateRenderer = DirectFB_ActivateRenderer;
   10.88      renderer->CreateTexture = DirectFB_CreateTexture;
   10.89      renderer->QueryTexturePixels = DirectFB_QueryTexturePixels;
   10.90 -    renderer->SetTexturePalette = DirectFB_SetTexturePalette;
   10.91 -    renderer->GetTexturePalette = DirectFB_GetTexturePalette;
   10.92      renderer->UpdateTexture = DirectFB_UpdateTexture;
   10.93      renderer->LockTexture = DirectFB_LockTexture;
   10.94      renderer->UnlockTexture = DirectFB_UnlockTexture;
   10.95 @@ -298,11 +251,6 @@
   10.96      if (p)
   10.97          data->isyuvdirect = atoi(p);
   10.98  
   10.99 -    /* Set up a palette watch on the display palette */
  10.100 -    if (display->palette) {
  10.101 -        SDL_AddPaletteWatch(display->palette, DisplayPaletteChanged, data);
  10.102 -    }
  10.103 -
  10.104      return renderer;
  10.105  
  10.106    error:
  10.107 @@ -315,10 +263,6 @@
  10.108  SDLToDFBPixelFormat(Uint32 format)
  10.109  {
  10.110      switch (format) {
  10.111 -    case SDL_PIXELFORMAT_INDEX4LSB:
  10.112 -        return DSPF_ALUT44;
  10.113 -    case SDL_PIXELFORMAT_INDEX8:
  10.114 -        return DSPF_LUT8;
  10.115      case SDL_PIXELFORMAT_RGB332:
  10.116          return DSPF_RGB332;
  10.117      case SDL_PIXELFORMAT_RGB555:
  10.118 @@ -345,12 +289,6 @@
  10.119          return DSPF_UYVY;       /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
  10.120      case SDL_PIXELFORMAT_YVYU:
  10.121          return DSPF_UNKNOWN;    /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
  10.122 -    case SDL_PIXELFORMAT_INDEX1LSB:
  10.123 -        return DSPF_UNKNOWN;
  10.124 -    case SDL_PIXELFORMAT_INDEX1MSB:
  10.125 -        return DSPF_UNKNOWN;
  10.126 -    case SDL_PIXELFORMAT_INDEX4MSB:
  10.127 -        return DSPF_UNKNOWN;
  10.128  #if (DFB_VERSION_ATLEAST(1,2,0))
  10.129      case SDL_PIXELFORMAT_RGB444:
  10.130          return DSPF_RGB444;
  10.131 @@ -499,12 +437,6 @@
  10.132          /* Create the surface */
  10.133          SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc,
  10.134                                                       &data->surface));
  10.135 -        if (SDL_ISPIXELFORMAT_INDEXED(data->format)
  10.136 -            && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
  10.137 -            SDL_DFB_CHECKERR(data->surface->GetPalette(data->surface,
  10.138 -                                                       &data->palette));
  10.139 -        }
  10.140 -
  10.141      }
  10.142  #if (DFB_VERSION_ATLEAST(1,2,0))
  10.143      data->render_options = DSRO_NONE;
  10.144 @@ -546,68 +478,6 @@
  10.145  }
  10.146  
  10.147  static int
  10.148 -DirectFB_SetTexturePalette(SDL_Renderer * renderer,
  10.149 -                           SDL_Texture * texture,
  10.150 -                           const SDL_Color * colors, int firstcolor,
  10.151 -                           int ncolors)
  10.152 -{
  10.153 -    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
  10.154 - 
  10.155 -    if (SDL_ISPIXELFORMAT_INDEXED(data->format)
  10.156 -        && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
  10.157 -        DFBColor entries[256];
  10.158 -        int i;
  10.159 -
  10.160 -        for (i = 0; i < ncolors; ++i) {
  10.161 -            entries[i].r = colors[i].r;
  10.162 -            entries[i].g = colors[i].g;
  10.163 -            entries[i].b = colors[i].b;
  10.164 -            entries[i].a = 0xFF;
  10.165 -        }
  10.166 -        SDL_DFB_CHECKERR(data->
  10.167 -                         palette->SetEntries(data->palette, entries, ncolors,
  10.168 -                                             firstcolor));
  10.169 -        return 0;
  10.170 -    } else {
  10.171 -        SDL_SetError("YUV textures don't have a palette");
  10.172 -        return -1;
  10.173 -    }
  10.174 -  error:
  10.175 -    return -1;
  10.176 -}
  10.177 -
  10.178 -static int
  10.179 -DirectFB_GetTexturePalette(SDL_Renderer * renderer,
  10.180 -                           SDL_Texture * texture, SDL_Color * colors,
  10.181 -                           int firstcolor, int ncolors)
  10.182 -{
  10.183 -    DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
  10.184 -
  10.185 -    if (SDL_ISPIXELFORMAT_INDEXED(data->format)
  10.186 -        && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
  10.187 -        DFBColor entries[256];
  10.188 -        int i;
  10.189 -
  10.190 -        SDL_DFB_CHECKERR(data->
  10.191 -                         palette->GetEntries(data->palette, entries, ncolors,
  10.192 -                                             firstcolor));
  10.193 -
  10.194 -        for (i = 0; i < ncolors; ++i) {
  10.195 -            colors[i].r = entries[i].r;
  10.196 -            colors[i].g = entries[i].g;
  10.197 -            colors[i].b = entries[i].b;
  10.198 -            colors->unused = SDL_ALPHA_OPAQUE;
  10.199 -        }
  10.200 -        return 0;
  10.201 -    } else {
  10.202 -        SDL_SetError("YUV textures don't have a palette");
  10.203 -        return -1;
  10.204 -    }
  10.205 -  error:
  10.206 -    return -1;
  10.207 -}
  10.208 -
  10.209 -static int
  10.210  DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
  10.211  {
  10.212  #if (DFB_VERSION_ATLEAST(1,2,0))
    11.1 --- a/src/video/dummy/SDL_nullrender.c	Tue Feb 01 20:50:04 2011 -0800
    11.2 +++ b/src/video/dummy/SDL_nullrender.c	Tue Feb 01 21:23:43 2011 -0800
    11.3 @@ -117,7 +117,6 @@
    11.4          SDL_DUMMY_DestroyRenderer(renderer);
    11.5          return NULL;
    11.6      }
    11.7 -    SDL_SetSurfacePalette(data->screen, display->palette);
    11.8  
    11.9      return renderer;
   11.10  }
    12.1 --- a/src/video/nds/SDL_ndsrender.c	Tue Feb 01 20:50:04 2011 -0800
    12.2 +++ b/src/video/nds/SDL_ndsrender.c	Tue Feb 01 21:23:43 2011 -0800
    12.3 @@ -43,13 +43,6 @@
    12.4  static int NDS_QueryTexturePixels(SDL_Renderer * renderer,
    12.5                                    SDL_Texture * texture, void **pixels,
    12.6                                    int *pitch);
    12.7 -static int NDS_SetTexturePalette(SDL_Renderer * renderer,
    12.8 -                                 SDL_Texture * texture,
    12.9 -                                 const SDL_Color * colors, int firstcolor,
   12.10 -                                 int ncolors);
   12.11 -static int NDS_GetTexturePalette(SDL_Renderer * renderer,
   12.12 -                                 SDL_Texture * texture, SDL_Color * colors,
   12.13 -                                 int firstcolor, int ncolors);
   12.14  static int NDS_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   12.15                               const SDL_Rect * rect, const void *pixels,
   12.16                               int pitch);
   12.17 @@ -72,9 +65,8 @@
   12.18      NDS_CreateRenderer,
   12.19      {"nds",                     /* char* name */
   12.20       (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC),  /* u32 flags */
   12.21 -     3,                         /* u32 num_texture_formats */
   12.22 +     2,                         /* u32 num_texture_formats */
   12.23       {
   12.24 -      SDL_PIXELFORMAT_INDEX8,
   12.25        SDL_PIXELFORMAT_ABGR1555,
   12.26        SDL_PIXELFORMAT_BGR555,
   12.27        },                        /* u32 texture_formats[20] */
   12.28 @@ -129,7 +121,6 @@
   12.29          return NULL;
   12.30      }
   12.31      switch (displayMode->format) {
   12.32 -    case SDL_PIXELFORMAT_INDEX8:
   12.33      case SDL_PIXELFORMAT_ABGR1555:
   12.34      case SDL_PIXELFORMAT_BGR555:
   12.35          /* okay */
   12.36 @@ -168,8 +159,6 @@
   12.37      renderer->driverdata = data;
   12.38      renderer->CreateTexture = NDS_CreateTexture;
   12.39      renderer->QueryTexturePixels = NDS_QueryTexturePixels;
   12.40 -    renderer->SetTexturePalette = NDS_SetTexturePalette;
   12.41 -    renderer->GetTexturePalette = NDS_GetTexturePalette;
   12.42      renderer->UpdateTexture = NDS_UpdateTexture;
   12.43      renderer->LockTexture = NDS_LockTexture;
   12.44      renderer->UnlockTexture = NDS_UnlockTexture;
   12.45 @@ -529,24 +518,4 @@
   12.46      SDL_free(renderer);
   12.47  }
   12.48  
   12.49 -static int
   12.50 -NDS_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   12.51 -                      const SDL_Color * colors, int firstcolor, int ncolors)
   12.52 -{
   12.53 -    NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
   12.54 -    /* set 8-bit modes in the background control registers
   12.55 -       for backgrounds, BGn_CR |= BG_256_COLOR */
   12.56 -
   12.57 -    return 0;
   12.58 -}
   12.59 -
   12.60 -static int
   12.61 -NDS_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   12.62 -                      SDL_Color * colors, int firstcolor, int ncolors)
   12.63 -{
   12.64 -    NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata;
   12.65 -    /* stub! */
   12.66 -    return 0;
   12.67 -}
   12.68 -
   12.69  /* vi: set ts=4 sw=4 expandtab: */
    13.1 --- a/src/video/pandora/SDL_pandora.h	Tue Feb 01 20:50:04 2011 -0800
    13.2 +++ b/src/video/pandora/SDL_pandora.h	Tue Feb 01 21:23:43 2011 -0800
    13.3 @@ -70,8 +70,6 @@
    13.4  void PND_videoquit(_THIS);
    13.5  void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display);
    13.6  int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
    13.7 -int PND_setdisplaypalette(_THIS, SDL_Palette * palette);
    13.8 -int PND_getdisplaypalette(_THIS, SDL_Palette * palette);
    13.9  int PND_setdisplaygammaramp(_THIS, Uint16 * ramp);
   13.10  int PND_getdisplaygammaramp(_THIS, Uint16 * ramp);
   13.11  int PND_createwindow(_THIS, SDL_Window * window);
    14.1 --- a/src/video/photon/SDL_photon.h	Tue Feb 01 20:50:04 2011 -0800
    14.2 +++ b/src/video/photon/SDL_photon.h	Tue Feb 01 21:23:43 2011 -0800
    14.3 @@ -132,8 +132,6 @@
    14.4  void photon_videoquit(_THIS);
    14.5  void photon_getdisplaymodes(_THIS);
    14.6  int photon_setdisplaymode(_THIS, SDL_DisplayMode * mode);
    14.7 -int photon_setdisplaypalette(_THIS, SDL_Palette * palette);
    14.8 -int photon_getdisplaypalette(_THIS, SDL_Palette * palette);
    14.9  int photon_setdisplaygammaramp(_THIS, Uint16 * ramp);
   14.10  int photon_getdisplaygammaramp(_THIS, Uint16 * ramp);
   14.11  int photon_createwindow(_THIS, SDL_Window * window);
    15.1 --- a/src/video/photon/SDL_photon_render.c	Tue Feb 01 20:50:04 2011 -0800
    15.2 +++ b/src/video/photon/SDL_photon_render.c	Tue Feb 01 21:23:43 2011 -0800
    15.3 @@ -91,9 +91,8 @@
    15.4        SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
    15.5        SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD |
    15.6        SDL_RENDERER_ACCELERATED),
    15.7 -     10,
    15.8 -     {SDL_PIXELFORMAT_INDEX8,
    15.9 -      SDL_PIXELFORMAT_RGB555,
   15.10 +     9,
   15.11 +     {SDL_PIXELFORMAT_RGB555,
   15.12        SDL_PIXELFORMAT_RGB565,
   15.13        SDL_PIXELFORMAT_RGB24,
   15.14        SDL_PIXELFORMAT_RGB888,
   15.15 @@ -134,8 +133,6 @@
   15.16      renderer->ActivateRenderer = photon_activaterenderer;
   15.17      renderer->CreateTexture = photon_createtexture;
   15.18      renderer->QueryTexturePixels = photon_querytexturepixels;
   15.19 -    renderer->SetTexturePalette = photon_settexturepalette;
   15.20 -    renderer->GetTexturePalette = photon_gettexturepalette;
   15.21      renderer->UpdateTexture = photon_updatetexture;
   15.22      renderer->LockTexture = photon_locktexture;
   15.23      renderer->UnlockTexture = photon_unlocktexture;
   15.24 @@ -812,55 +809,6 @@
   15.25  }
   15.26  
   15.27  static int
   15.28 -photon_settexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
   15.29 -                         const SDL_Color * colors, int firstcolor,
   15.30 -                         int ncolors)
   15.31 -{
   15.32 -   SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
   15.33 -   SDL_TextureData* tdata=(SDL_TextureData*)texture->driverdata;
   15.34 -
   15.35 -   /* Check, if it is not initialized */
   15.36 -   if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_UNKNOWN)
   15.37 -   {
   15.38 -      SDL_SetError("Photon: can't set texture palette for OpenGL ES window");
   15.39 -      return -1;
   15.40 -   }
   15.41 -
   15.42 -   if (texture->format!=SDL_PIXELFORMAT_INDEX8)
   15.43 -   {
   15.44 -      SDL_SetError("Photon: can't set palette for non-paletted texture");
   15.45 -      return -1;
   15.46 -   }
   15.47 -
   15.48 -   SDL_Unsupported();
   15.49 -   return -1;
   15.50 -}
   15.51 -
   15.52 -static int
   15.53 -photon_gettexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
   15.54 -                         SDL_Color * colors, int firstcolor, int ncolors)
   15.55 -{
   15.56 -   SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
   15.57 -   SDL_TextureData* tdata=(SDL_TextureData*)texture->driverdata;
   15.58 -
   15.59 -   /* Check, if it is not initialized */
   15.60 -   if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_UNKNOWN)
   15.61 -   {
   15.62 -      SDL_SetError("Photon: can't return texture palette for OpenGL ES window");
   15.63 -      return -1;
   15.64 -   }
   15.65 -
   15.66 -   if (texture->format!=SDL_PIXELFORMAT_INDEX8)
   15.67 -   {
   15.68 -      SDL_SetError("Photon: can't return palette for non-paletted texture");
   15.69 -      return -1;
   15.70 -   }
   15.71 -
   15.72 -   SDL_Unsupported();
   15.73 -   return -1;
   15.74 -}
   15.75 -
   15.76 -static int
   15.77  photon_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture,
   15.78                       const SDL_Rect * rect, const void *pixels, int pitch)
   15.79  {
    16.1 --- a/src/video/qnxgf/SDL_gf_render.c	Tue Feb 01 20:50:04 2011 -0800
    16.2 +++ b/src/video/qnxgf/SDL_gf_render.c	Tue Feb 01 21:23:43 2011 -0800
    16.3 @@ -75,9 +75,8 @@
    16.4        SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
    16.5        SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD |
    16.6        SDL_RENDERER_ACCELERATED),
    16.7 -     13,
    16.8 +     12,
    16.9       {
   16.10 -      SDL_PIXELFORMAT_INDEX8,
   16.11        SDL_PIXELFORMAT_RGB555,
   16.12        SDL_PIXELFORMAT_RGB565,
   16.13        SDL_PIXELFORMAT_RGB888,
   16.14 @@ -131,8 +130,6 @@
   16.15      renderer->ActivateRenderer = gf_activaterenderer;
   16.16      renderer->CreateTexture = gf_createtexture;
   16.17      renderer->QueryTexturePixels = gf_querytexturepixels;
   16.18 -    renderer->SetTexturePalette = gf_settexturepalette;
   16.19 -    renderer->GetTexturePalette = gf_gettexturepalette;
   16.20      renderer->UpdateTexture = gf_updatetexture;
   16.21      renderer->LockTexture = gf_locktexture;
   16.22      renderer->UnlockTexture = gf_unlocktexture;
   16.23 @@ -306,18 +303,6 @@
   16.24  }
   16.25  
   16.26  static int
   16.27 -gf_settexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
   16.28 -                     const SDL_Color * colors, int firstcolor, int ncolors)
   16.29 -{
   16.30 -}
   16.31 -
   16.32 -static int
   16.33 -gf_gettexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
   16.34 -                     SDL_Color * colors, int firstcolor, int ncolors)
   16.35 -{
   16.36 -}
   16.37 -
   16.38 -static int
   16.39  gf_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture,
   16.40                   const SDL_Rect * rect, const void *pixels, int pitch)
   16.41  {
    17.1 --- a/src/video/qnxgf/SDL_qnxgf.c	Tue Feb 01 20:50:04 2011 -0800
    17.2 +++ b/src/video/qnxgf/SDL_qnxgf.c	Tue Feb 01 21:23:43 2011 -0800
    17.3 @@ -284,8 +284,6 @@
    17.4      device->VideoQuit = qnxgf_videoquit;
    17.5      device->GetDisplayModes = qnxgf_getdisplaymodes;
    17.6      device->SetDisplayMode = qnxgf_setdisplaymode;
    17.7 -    device->SetDisplayPalette = qnxgf_setdisplaypalette;
    17.8 -    device->GetDisplayPalette = qnxgf_getdisplaypalette;
    17.9      device->SetDisplayGammaRamp = qnxgf_setdisplaygammaramp;
   17.10      device->GetDisplayGammaRamp = qnxgf_getdisplaygammaramp;
   17.11      device->CreateWindow = qnxgf_createwindow;
   17.12 @@ -922,30 +920,6 @@
   17.13  }
   17.14  
   17.15  int
   17.16 -qnxgf_setdisplaypalette(_THIS, SDL_VideoDisplay * display, SDL_Palette * palette)
   17.17 -{
   17.18 -    SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
   17.19 -
   17.20 -    /* QNX GF doesn't have support for global palette changing, but we */
   17.21 -    /* could store it for usage in future */
   17.22 -
   17.23 -    SDL_Unsupported();
   17.24 -    return -1;
   17.25 -}
   17.26 -
   17.27 -int
   17.28 -qnxgf_getdisplaypalette(_THIS, SDL_VideoDisplay * display, SDL_Palette * palette)
   17.29 -{
   17.30 -    SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
   17.31 -
   17.32 -    /* We can't provide current palette settings and looks like SDL          */
   17.33 -    /* do not call this function also, in such case this function returns -1 */
   17.34 -
   17.35 -    SDL_Unsupported();
   17.36 -    return -1;
   17.37 -}
   17.38 -
   17.39 -int
   17.40  qnxgf_setdisplaygammaramp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp)
   17.41  {
   17.42      SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
    18.1 --- a/src/video/qnxgf/SDL_qnxgf.h	Tue Feb 01 20:50:04 2011 -0800
    18.2 +++ b/src/video/qnxgf/SDL_qnxgf.h	Tue Feb 01 21:23:43 2011 -0800
    18.3 @@ -118,8 +118,6 @@
    18.4  void qnxgf_videoquit(_THIS);
    18.5  void qnxgf_getdisplaymodes(_THIS);
    18.6  int qnxgf_setdisplaymode(_THIS, SDL_DisplayMode * mode);
    18.7 -int qnxgf_setdisplaypalette(_THIS, SDL_Palette * palette);
    18.8 -int qnxgf_getdisplaypalette(_THIS, SDL_Palette * palette);
    18.9  int qnxgf_setdisplaygammaramp(_THIS, Uint16 * ramp);
   18.10  int qnxgf_getdisplaygammaramp(_THIS, Uint16 * ramp);
   18.11  int qnxgf_createwindow(_THIS, SDL_Window * window);
    19.1 --- a/src/video/sdlgenblit.pl	Tue Feb 01 20:50:04 2011 -0800
    19.2 +++ b/src/video/sdlgenblit.pl	Tue Feb 01 21:23:43 2011 -0800
    19.3 @@ -9,7 +9,6 @@
    19.4  my %file;
    19.5  
    19.6  # The formats potentially supported by this script:
    19.7 -# SDL_PIXELFORMAT_INDEX8
    19.8  # SDL_PIXELFORMAT_RGB332
    19.9  # SDL_PIXELFORMAT_RGB444
   19.10  # SDL_PIXELFORMAT_RGB555
    20.1 --- a/src/video/windows/SDL_d3drender.c	Tue Feb 01 20:50:04 2011 -0800
    20.2 +++ b/src/video/windows/SDL_d3drender.c	Tue Feb 01 21:23:43 2011 -0800
    20.3 @@ -94,13 +94,6 @@
    20.4  static int D3D_QueryTexturePixels(SDL_Renderer * renderer,
    20.5                                    SDL_Texture * texture, void **pixels,
    20.6                                    int *pitch);
    20.7 -static int D3D_SetTexturePalette(SDL_Renderer * renderer,
    20.8 -                                 SDL_Texture * texture,
    20.9 -                                 const SDL_Color * colors, int firstcolor,
   20.10 -                                 int ncolors);
   20.11 -static int D3D_GetTexturePalette(SDL_Renderer * renderer,
   20.12 -                                 SDL_Texture * texture, SDL_Color * colors,
   20.13 -                                 int firstcolor, int ncolors);
   20.14  static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   20.15                               const SDL_Rect * rect, const void *pixels,
   20.16                               int pitch);
   20.17 @@ -362,7 +355,6 @@
   20.18      if (data->d3d) {
   20.19          int i, j;
   20.20          int formats[] = {
   20.21 -            SDL_PIXELFORMAT_INDEX8,
   20.22              SDL_PIXELFORMAT_RGB332,
   20.23              SDL_PIXELFORMAT_RGB444,
   20.24              SDL_PIXELFORMAT_RGB555,
   20.25 @@ -436,8 +428,6 @@
   20.26      renderer->DisplayModeChanged = D3D_DisplayModeChanged;
   20.27      renderer->CreateTexture = D3D_CreateTexture;
   20.28      renderer->QueryTexturePixels = D3D_QueryTexturePixels;
   20.29 -    renderer->SetTexturePalette = D3D_SetTexturePalette;
   20.30 -    renderer->GetTexturePalette = D3D_GetTexturePalette;
   20.31      renderer->UpdateTexture = D3D_UpdateTexture;
   20.32      renderer->LockTexture = D3D_LockTexture;
   20.33      renderer->UnlockTexture = D3D_UnlockTexture;
   20.34 @@ -664,25 +654,6 @@
   20.35  }
   20.36  
   20.37  static int
   20.38 -D3D_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   20.39 -                      const SDL_Color * colors, int firstcolor, int ncolors)
   20.40 -{
   20.41 -    D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
   20.42 -    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
   20.43 -
   20.44 -    return 0;
   20.45 -}
   20.46 -
   20.47 -static int
   20.48 -D3D_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture,
   20.49 -                      SDL_Color * colors, int firstcolor, int ncolors)
   20.50 -{
   20.51 -    D3D_TextureData *data = (D3D_TextureData *) texture->driverdata;
   20.52 -
   20.53 -    return 0;
   20.54 -}
   20.55 -
   20.56 -static int
   20.57  D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   20.58                    const SDL_Rect * rect, const void *pixels, int pitch)
   20.59  {
    21.1 --- a/src/video/windows/SDL_windowsevents.c	Tue Feb 01 20:50:04 2011 -0800
    21.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Feb 01 21:23:43 2011 -0800
    21.3 @@ -501,25 +501,6 @@
    21.4          }
    21.5          break;
    21.6  
    21.7 -        /* We are about to get palette focus! */
    21.8 -    case WM_QUERYNEWPALETTE:
    21.9 -        {
   21.10 -            /*
   21.11 -                WIN_RealizePalette(current_video);
   21.12 -                returnCode = TRUE;
   21.13 -             */
   21.14 -        }
   21.15 -        break;
   21.16 -
   21.17 -        /* Another application changed the palette */
   21.18 -    case WM_PALETTECHANGED:
   21.19 -        {
   21.20 -            /*
   21.21 -               WIN_PaletteChanged(current_video, (HWND) wParam);
   21.22 -             */
   21.23 -        }
   21.24 -        break;
   21.25 -
   21.26          /* We were occluded, refresh our display */
   21.27      case WM_PAINT:
   21.28          {
    22.1 --- a/src/video/windows/SDL_windowsmodes.c	Tue Feb 01 20:50:04 2011 -0800
    22.2 +++ b/src/video/windows/SDL_windowsmodes.c	Tue Feb 01 21:23:43 2011 -0800
    22.3 @@ -131,6 +131,10 @@
    22.4              }
    22.5          }
    22.6      }
    22.7 +    if (SDL_ISPIXELFORMAT_INDEXED(mode->format)) {
    22.8 +        /* We don't support palettized modes now */
    22.9 +        return SDL_FALSE;
   22.10 +    }
   22.11      return SDL_TRUE;
   22.12  }
   22.13  
    23.1 --- a/src/video/x11/SDL_x11modes.c	Tue Feb 01 20:50:04 2011 -0800
    23.2 +++ b/src/video/x11/SDL_x11modes.c	Tue Feb 01 21:23:43 2011 -0800
    23.3 @@ -134,6 +134,10 @@
    23.4          }
    23.5  
    23.6          mode.format = X11_GetPixelFormatFromVisualInfo(data->display, &vinfo);
    23.7 +        if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) {
    23.8 +            /* We don't support palettized modes now */
    23.9 +            continue;
   23.10 +        }
   23.11          mode.w = DisplayWidth(data->display, screen);
   23.12          mode.h = DisplayHeight(data->display, screen);
   23.13          mode.refresh_rate = 0;