Mercurial > sdl-ios-xcode
changeset 5152:be02be2ea897
Making the API simpler, removed support for palettized video modes and textures.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 01 Feb 2011 21:23:43 -0800 |
parents | 5429daf5e3f9 |
children | 1435f8a6425c |
files | 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 |
diffstat | 23 files changed, 19 insertions(+), 783 deletions(-) [+] |
line wrap: on
line diff
--- a/include/SDL_render.h Tue Feb 01 20:50:04 2011 -0800 +++ b/include/SDL_render.h Tue Feb 01 21:23:43 2011 -0800 @@ -220,38 +220,6 @@ void **pixels, int *pitch); /** - * \brief Set the color palette of an indexed texture. - * - * \param texture The texture to update. - * \param colors The array of RGB color data. - * \param firstcolor The first index to update. - * \param ncolors The number of palette entries to fill with the color data. - * - * \return 0 on success, or -1 if the texture is not valid or not an indexed - * texture. - */ -extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture, - const SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \brief Get the color palette from an indexed texture if it has one. - * - * \param texture The texture to update. - * \param colors The array to fill with RGB color data. - * \param firstcolor The first index to retrieve. - * \param ncolors The number of palette entries to retrieve. - * - * \return 0 on success, or -1 if the texture is not valid or not an indexed - * texture. - */ -extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture, - SDL_Color * colors, - int firstcolor, - int ncolors); - -/** * \brief Set an additional color value used in render copy operations. * * \param texture The texture to update.
--- a/include/SDL_video.h Tue Feb 01 20:50:04 2011 -0800 +++ b/include/SDL_video.h Tue Feb 01 21:23:43 2011 -0800 @@ -356,25 +356,6 @@ SDL_DisplayMode * mode); /** - * \brief Set the palette entries for indexed display modes. - * - * \return 0 on success, or -1 if the display mode isn't palettized or the - * colors couldn't be set. - */ -extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors, - int firstcolor, - int ncolors); - -/** - * \brief Gets the palette entries for indexed display modes. - * - * \return 0 on success, or -1 if the display mode isn't palettized - */ -extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors, - int firstcolor, - int ncolors); - -/** * \brief Set the gamma correction for each of the color channels on the * currently selected display. *
--- a/src/SDL_compat.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/SDL_compat.c Tue Feb 01 21:23:43 2011 -0800 @@ -320,27 +320,6 @@ return 1; } -static int -SDL_VideoPaletteChanged(void *userdata, SDL_Palette * palette) -{ - if (userdata == SDL_ShadowSurface) { - /* If the shadow palette changed, make the changes visible */ - if (!SDL_VideoSurface->format->palette) { - SDL_UpdateRect(SDL_ShadowSurface, 0, 0, 0, 0); - } - } - if (userdata == SDL_VideoSurface) { - /* The display may not have a palette, but always set texture palette */ - SDL_SetDisplayPalette(palette->colors, 0, palette->ncolors); - - if (SDL_SetTexturePalette - (SDL_VideoTexture, palette->colors, 0, palette->ncolors) < 0) { - return -1; - } - } - return 0; -} - static void GetEnvironmentWindowPosition(int w, int h, int *x, int *y) { @@ -543,8 +522,6 @@ SDL_ShadowSurface = NULL; } if (SDL_VideoSurface) { - SDL_DelPaletteWatch(SDL_VideoSurface->format->palette, - SDL_VideoPaletteChanged, NULL); SDL_FreeSurface(SDL_VideoSurface); SDL_VideoSurface = NULL; } @@ -694,18 +671,6 @@ } SDL_VideoSurface->flags |= surface_flags; - /* Set a default screen palette */ - if (SDL_VideoSurface->format->palette) { - SDL_VideoSurface->flags |= SDL_HWPALETTE; - SDL_DitherColors(SDL_VideoSurface->format->palette->colors, - SDL_VideoSurface->format->BitsPerPixel); - SDL_AddPaletteWatch(SDL_VideoSurface->format->palette, - SDL_VideoPaletteChanged, SDL_VideoSurface); - SDL_SetPaletteColors(SDL_VideoSurface->format->palette, - SDL_VideoSurface->format->palette->colors, 0, - SDL_VideoSurface->format->palette->ncolors); - } - /* Create a shadow surface if necessary */ if ((bpp != SDL_VideoSurface->format->BitsPerPixel) && !(flags & SDL_ANYFORMAT)) { @@ -719,15 +684,8 @@ /* 8-bit SDL_ShadowSurface surfaces report that they have exclusive palette */ if (SDL_ShadowSurface->format->palette) { SDL_ShadowSurface->flags |= SDL_HWPALETTE; - if (SDL_VideoSurface->format->palette) { - SDL_SetSurfacePalette(SDL_ShadowSurface, - SDL_VideoSurface->format->palette); - } else { - SDL_DitherColors(SDL_ShadowSurface->format->palette->colors, - SDL_ShadowSurface->format->BitsPerPixel); - } - SDL_AddPaletteWatch(SDL_ShadowSurface->format->palette, - SDL_VideoPaletteChanged, SDL_ShadowSurface); + SDL_DitherColors(SDL_ShadowSurface->format->palette->colors, + SDL_ShadowSurface->format->BitsPerPixel); } } SDL_PublicSurface =
--- a/src/video/SDL_renderer_gl.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/SDL_renderer_gl.c Tue Feb 01 21:23:43 2011 -0800 @@ -72,13 +72,6 @@ static int GL_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int GL_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); -static int GL_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors); static int GL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); @@ -111,11 +104,8 @@ { "opengl", (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), - 15, + 13, { - SDL_PIXELFORMAT_INDEX1LSB, - SDL_PIXELFORMAT_INDEX1MSB, - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB444, SDL_PIXELFORMAT_RGB555, @@ -149,7 +139,6 @@ #include "SDL_glfuncs.h" #undef SDL_PROC - PFNGLCOLORTABLEEXTPROC glColorTableEXT; void (*glTextureRangeAPPLE) (GLenum target, GLsizei length, const GLvoid * pointer); @@ -278,8 +267,6 @@ renderer->WindowEvent = GL_WindowEvent; renderer->CreateTexture = GL_CreateTexture; renderer->QueryTexturePixels = GL_QueryTexturePixels; - renderer->SetTexturePalette = GL_SetTexturePalette; - renderer->GetTexturePalette = GL_GetTexturePalette; renderer->UpdateTexture = GL_UpdateTexture; renderer->LockTexture = GL_LockTexture; renderer->UnlockTexture = GL_UnlockTexture; @@ -339,21 +326,6 @@ || SDL_GL_ExtensionSupported("GL_EXT_texture_rectangle")) { data->GL_ARB_texture_rectangle_supported = SDL_TRUE; } - if (SDL_GL_ExtensionSupported("GL_EXT_paletted_texture")) { - data->GL_EXT_paletted_texture_supported = SDL_TRUE; - data->glColorTableEXT = - (PFNGLCOLORTABLEEXTPROC) SDL_GL_GetProcAddress("glColorTableEXT"); - } else { - /* Don't advertise support for 8-bit indexed texture format */ - Uint32 i, j; - SDL_RendererInfo *info = &renderer->info; - for (i = 0, j = 0; i < info->num_texture_formats; ++i) { - if (info->texture_formats[i] != SDL_PIXELFORMAT_INDEX8) { - info->texture_formats[j++] = info->texture_formats[i]; - } - } - --info->num_texture_formats; - } if (SDL_GL_ExtensionSupported("GL_APPLE_ycbcr_422")) { data->GL_APPLE_ycbcr_422_supported = SDL_TRUE; } @@ -572,20 +544,6 @@ GLint* internalFormat, GLenum* format, GLenum* type) { switch (pixel_format) { - case SDL_PIXELFORMAT_INDEX1LSB: - case SDL_PIXELFORMAT_INDEX1MSB: - *internalFormat = GL_RGB; - *format = GL_COLOR_INDEX; - *type = GL_BITMAP; - break; - case SDL_PIXELFORMAT_INDEX8: - if (!renderdata->GL_EXT_paletted_texture_supported) { - return SDL_FALSE; - } - *internalFormat = GL_COLOR_INDEX8_EXT; - *format = GL_COLOR_INDEX; - *type = GL_UNSIGNED_BYTE; - break; case SDL_PIXELFORMAT_RGB332: *internalFormat = GL_R3_G3_B2; *format = GL_RGB; @@ -752,16 +710,6 @@ data->shader = shader; - if (texture->format == SDL_PIXELFORMAT_INDEX8) { - data->palette = (Uint8 *) SDL_malloc(3 * 256 * sizeof(Uint8)); - if (!data->palette) { - SDL_OutOfMemory(); - SDL_free(data); - return -1; - } - SDL_memset(data->palette, 0xFF, 3 * 256 * sizeof(Uint8)); - } - if (texture->access == SDL_TEXTUREACCESS_STREAMING) { data->pitch = texture->w * bytes_per_pixel(texture->format); data->pixels = SDL_malloc(texture->h * data->pitch); @@ -871,65 +819,10 @@ return 0; } -static int -GL_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ - GL_RenderData *renderdata = (GL_RenderData *) renderer->driverdata; - GL_TextureData *data = (GL_TextureData *) texture->driverdata; - Uint8 *palette; - - GL_ActivateRenderer(renderer); - - if (!data->palette) { - SDL_SetError("Texture doesn't have a palette"); - return -1; - } - palette = data->palette + firstcolor * 3; - while (ncolors--) { - *palette++ = colors->r; - *palette++ = colors->g; - *palette++ = colors->b; - ++colors; - } - renderdata->glEnable(data->type); - renderdata->glBindTexture(data->type, data->texture); - renderdata->glColorTableEXT(data->type, GL_RGB8, 256, GL_RGB, - GL_UNSIGNED_BYTE, data->palette); - return 0; -} - -static int -GL_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - GL_TextureData *data = (GL_TextureData *) texture->driverdata; - Uint8 *palette; - - if (!data->palette) { - SDL_SetError("Texture doesn't have a palette"); - return -1; - } - palette = data->palette + firstcolor * 3; - while (ncolors--) { - colors->r = *palette++; - colors->g = *palette++; - colors->b = *palette++; - colors->unused = SDL_ALPHA_OPAQUE; - ++colors; - } - return 0; -} - static void SetupTextureUpdate(GL_RenderData * renderdata, SDL_Texture * texture, int pitch) { - if (texture->format == SDL_PIXELFORMAT_INDEX1LSB) { - renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 1); - } else if (texture->format == SDL_PIXELFORMAT_INDEX1MSB) { - renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 0); - } renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); renderdata->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / bytes_per_pixel(texture->format)) / @@ -1265,11 +1158,6 @@ return -1; } - if (pixel_format == SDL_PIXELFORMAT_INDEX1LSB) { - data->glPixelStorei(GL_PACK_LSB_FIRST, 1); - } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) { - data->glPixelStorei(GL_PACK_LSB_FIRST, 0); - } data->glPixelStorei(GL_PACK_ALIGNMENT, 1); data->glPixelStorei(GL_PACK_ROW_LENGTH, (pitch / bytes_per_pixel(pixel_format))); @@ -1314,11 +1202,6 @@ return -1; } - if (pixel_format == SDL_PIXELFORMAT_INDEX1LSB) { - data->glPixelStorei(GL_UNPACK_LSB_FIRST, 1); - } else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) { - data->glPixelStorei(GL_UNPACK_LSB_FIRST, 0); - } data->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); data->glPixelStorei(GL_UNPACK_ROW_LENGTH, (pitch / bytes_per_pixel(pixel_format)));
--- a/src/video/SDL_renderer_gles.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/SDL_renderer_gles.c Tue Feb 01 21:23:43 2011 -0800 @@ -60,13 +60,6 @@ static int GLES_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int GLES_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); -static int GLES_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors); static int GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); @@ -219,8 +212,6 @@ renderer->WindowEvent = GLES_WindowEvent; renderer->CreateTexture = GLES_CreateTexture; renderer->QueryTexturePixels = GLES_QueryTexturePixels; - renderer->SetTexturePalette = GLES_SetTexturePalette; - renderer->GetTexturePalette = GLES_GetTexturePalette; renderer->UpdateTexture = GLES_UpdateTexture; renderer->LockTexture = GLES_LockTexture; renderer->UnlockTexture = GLES_UnlockTexture; @@ -467,22 +458,6 @@ return 0; } -static int -GLES_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ - SDL_SetError("OpenGL ES does not support paletted textures"); - return -1; -} - -static int -GLES_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - SDL_SetError("OpenGL ES does not support paletted textures"); - return -1; -} - static void SetupTextureUpdate(GLES_RenderData * renderdata, SDL_Texture * texture, int pitch)
--- a/src/video/SDL_renderer_sw.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/SDL_renderer_sw.c Tue Feb 01 21:23:43 2011 -0800 @@ -38,13 +38,6 @@ static int SW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int SW_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); -static int SW_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors); static int SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture); static int SW_SetTextureAlphaMod(SDL_Renderer * renderer, @@ -80,9 +73,8 @@ { "software", (SDL_RENDERER_PRESENTVSYNC), - 14, + 13, { - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB888, @@ -141,26 +133,11 @@ SDL_free(texture); } -static int -DisplayPaletteChanged(void *userdata, SDL_Palette * palette) -{ - SW_RenderData *data = (SW_RenderData *) userdata; - - if (data->renderer->SetTexturePalette) { - data->renderer->SetTexturePalette(data->renderer, data->texture, - palette->colors, 0, - palette->ncolors); - } - return 0; -} - void Setup_SoftwareRenderer(SDL_Renderer * renderer) { renderer->CreateTexture = SW_CreateTexture; renderer->QueryTexturePixels = SW_QueryTexturePixels; - renderer->SetTexturePalette = SW_SetTexturePalette; - renderer->GetTexturePalette = SW_GetTexturePalette; renderer->SetTextureColorMod = SW_SetTextureColorMod; renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; renderer->SetTextureBlendMode = SW_SetTextureBlendMode; @@ -273,12 +250,6 @@ SW_DestroyRenderer(renderer); return NULL; } - SDL_SetSurfacePalette(&data->surface, display->palette); - - /* Set up a palette watch on the display palette */ - if (display->palette) { - SDL_AddPaletteWatch(display->palette, DisplayPaletteChanged, data); - } return renderer; } @@ -366,37 +337,6 @@ } static int -SW_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ - if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { - SDL_SetError("YUV textures don't have a palette"); - return -1; - } else { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; - - return SDL_SetPaletteColors(surface->format->palette, colors, - firstcolor, ncolors); - } -} - -static int -SW_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { - SDL_SetError("YUV textures don't have a palette"); - return -1; - } else { - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; - - SDL_memcpy(colors, &surface->format->palette->colors[firstcolor], - ncolors * sizeof(*colors)); - return 0; - } -} - -static int SW_SetTextureColorMod(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_Surface *surface = (SDL_Surface *) texture->driverdata; @@ -793,13 +733,8 @@ DestroyTexture(data->renderer, data->texture); } if (data->surface.format) { - SDL_SetSurfacePalette(&data->surface, NULL); SDL_FreeFormat(data->surface.format); } - if (display->palette) { - SDL_DelPaletteWatch(display->palette, DisplayPaletteChanged, - data); - } if (data->renderer) { data->renderer->DestroyRenderer(data->renderer); }
--- a/src/video/SDL_sysvideo.h Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/SDL_sysvideo.h Tue Feb 01 21:23:43 2011 -0800 @@ -67,12 +67,6 @@ int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); - int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); - int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, - int ncolors); int (*SetTextureColorMod) (SDL_Renderer * renderer, SDL_Texture * texture); int (*SetTextureAlphaMod) (SDL_Renderer * renderer, @@ -195,7 +189,6 @@ SDL_DisplayMode desktop_mode; SDL_DisplayMode current_mode; SDL_bool updating_fullscreen; - SDL_Palette *palette; Uint16 *gamma; Uint16 *saved_gamma; /* (just offset into gamma) */ @@ -259,12 +252,6 @@ */ int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); - /* Set the color entries of the display palette */ - int (*SetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette); - - /* Get the color entries of the display palette */ - int (*GetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette); - /* Set the gamma ramp */ int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp); @@ -447,8 +434,6 @@ extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode); extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode); -extern int SDL_SetPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors); -extern int SDL_GetPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors); extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue); extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue); extern void SDL_AddRenderDriver(SDL_VideoDisplay *display, const SDL_RenderDriver * driver);
--- a/src/video/SDL_video.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/SDL_video.c Tue Feb 01 21:23:43 2011 -0800 @@ -645,7 +645,6 @@ { SDL_DisplayMode display_mode; SDL_DisplayMode current_mode; - int ncolors; if (mode) { display_mode = *mode; @@ -689,29 +688,6 @@ return -1; } display->current_mode = display_mode; - - /* Set up a palette, if necessary */ - if (SDL_ISPIXELFORMAT_INDEXED(display_mode.format)) { - ncolors = (1 << SDL_BITSPERPIXEL(display_mode.format)); - } else { - ncolors = 0; - } - if ((!ncolors && display->palette) || (ncolors && !display->palette) - || (ncolors && ncolors != display->palette->ncolors)) { - if (display->palette) { - SDL_FreePalette(display->palette); - display->palette = NULL; - } - if (ncolors) { - display->palette = SDL_AllocPalette(ncolors); - if (!display->palette) { - return -1; - } - SDL_DitherColors(display->palette->colors, - SDL_BITSPERPIXEL(display_mode.format)); - } - } - return 0; } @@ -813,66 +789,6 @@ display->fullscreen_window = NULL; } -int -SDL_SetPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors) -{ - SDL_Palette *palette; - int status = 0; - - palette = display->palette; - if (!palette) { - SDL_SetError("Display mode does not have a palette"); - return -1; - } - status = SDL_SetPaletteColors(palette, colors, firstcolor, ncolors); - - if (_this->SetDisplayPalette) { - if (_this->SetDisplayPalette(_this, display, palette) < 0) { - status = -1; - } - } - return status; -} - -int -SDL_SetDisplayPalette(const SDL_Color * colors, int firstcolor, int ncolors) -{ - if (!_this) { - SDL_UninitializedVideo(); - return -1; - } - return SDL_SetPaletteForDisplay(SDL_CurrentDisplay, colors, firstcolor, ncolors); -} - -int -SDL_GetPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors) -{ - SDL_Palette *palette; - - palette = display->palette; - if (!palette || !palette->ncolors) { - SDL_SetError("Display mode does not have a palette"); - return -1; - } - if (firstcolor < 0 || (firstcolor + ncolors) > palette->ncolors) { - SDL_SetError("Palette indices are out of range"); - return -1; - } - SDL_memcpy(colors, &palette->colors[firstcolor], - ncolors * sizeof(*colors)); - return 0; -} - -int -SDL_GetDisplayPalette(SDL_Color * colors, int firstcolor, int ncolors) -{ - if (!_this) { - SDL_UninitializedVideo(); - return -1; - } - return SDL_GetPaletteForDisplay(SDL_CurrentDisplay, colors, firstcolor, ncolors); -} - SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) { @@ -1674,12 +1590,7 @@ SDL_PIXELFORMAT_BGRA4444, SDL_PIXELFORMAT_RGB444, SDL_PIXELFORMAT_ARGB2101010, - SDL_PIXELFORMAT_INDEX8, - SDL_PIXELFORMAT_INDEX4LSB, - SDL_PIXELFORMAT_INDEX4MSB, SDL_PIXELFORMAT_RGB332, - SDL_PIXELFORMAT_INDEX1LSB, - SDL_PIXELFORMAT_INDEX1MSB, SDL_PIXELFORMAT_UNKNOWN }; @@ -1874,26 +1785,11 @@ /* Set up a destination surface for the texture update */ SDL_InitFormat(&dst_fmt, bpp, Rmask, Gmask, Bmask, Amask); - if (SDL_ISPIXELFORMAT_INDEXED(format)) { - dst_fmt.palette = - SDL_AllocPalette((1 << SDL_BITSPERPIXEL(format))); - if (dst_fmt.palette) { - /* - * FIXME: Should we try to copy - * fmt->palette? - */ - SDL_DitherColors(dst_fmt.palette->colors, - SDL_BITSPERPIXEL(format)); - } - } dst = SDL_ConvertSurface(surface, &dst_fmt, 0); if (dst) { SDL_UpdateTexture(texture, NULL, dst->pixels, dst->pitch); SDL_FreeSurface(dst); } - if (dst_fmt.palette) { - SDL_FreePalette(dst_fmt.palette); - } if (!dst) { SDL_DestroyTexture(texture); return 0; @@ -1918,11 +1814,6 @@ SDL_SetTextureBlendMode(texture, blendMode); } } - - if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) { - SDL_SetTexturePalette(texture, fmt->palette->colors, 0, - fmt->palette->ncolors); - } return texture; } @@ -1963,40 +1854,6 @@ } int -SDL_SetTexturePalette(SDL_Texture * texture, const SDL_Color * colors, - int firstcolor, int ncolors) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (!renderer->SetTexturePalette) { - SDL_Unsupported(); - return -1; - } - return renderer->SetTexturePalette(renderer, texture, colors, firstcolor, - ncolors); -} - -int -SDL_GetTexturePalette(SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors) -{ - SDL_Renderer *renderer; - - CHECK_TEXTURE_MAGIC(texture, -1); - - renderer = texture->renderer; - if (!renderer->GetTexturePalette) { - SDL_Unsupported(); - return -1; - } - return renderer->GetTexturePalette(renderer, texture, colors, firstcolor, - ncolors); -} - -int SDL_SetTextureColorMod(SDL_Texture * texture, Uint8 r, Uint8 g, Uint8 b) { SDL_Renderer *renderer; @@ -2687,10 +2544,6 @@ SDL_free(display->desktop_mode.driverdata); display->desktop_mode.driverdata = NULL; } - if (display->palette) { - SDL_FreePalette(display->palette); - display->palette = NULL; - } if (display->gamma) { SDL_free(display->gamma); display->gamma = NULL;
--- a/src/video/cocoa/SDL_cocoamodes.m Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/cocoa/SDL_cocoamodes.m Tue Feb 01 21:23:43 2011 -0800 @@ -117,8 +117,8 @@ mode->format = SDL_PIXELFORMAT_UNKNOWN; switch (bpp) { case 8: - mode->format = SDL_PIXELFORMAT_INDEX8; - break; + /* We don't support palettized modes now */ + return SDL_FALSE; case 16: mode->format = SDL_PIXELFORMAT_ARGB1555; break;
--- a/src/video/directfb/SDL_DirectFB_render.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/directfb/SDL_DirectFB_render.c Tue Feb 01 21:23:43 2011 -0800 @@ -43,14 +43,6 @@ static int DirectFB_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int DirectFB_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, - int firstcolor, int ncolors); -static int DirectFB_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - SDL_Color * colors, - int firstcolor, int ncolors); static int DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, @@ -86,10 +78,8 @@ { "directfb", (SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), - 14, + 12, { - SDL_PIXELFORMAT_INDEX4LSB, - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, @@ -123,7 +113,6 @@ Uint32 format; void *pixels; int pitch; - IDirectFBPalette *palette; SDL_VideoDisplay *display; SDL_DirtyRectList dirty; #if (DFB_VERSION_ATLEAST(1,2,0)) @@ -148,7 +137,6 @@ if (!data) return 0; switch (data->format) { - case SDL_PIXELFORMAT_INDEX4LSB: case SDL_PIXELFORMAT_ARGB4444: case SDL_PIXELFORMAT_ARGB1555: case SDL_PIXELFORMAT_ARGB8888: @@ -211,39 +199,6 @@ } } -static int -DisplayPaletteChanged(void *userdata, SDL_Palette * palette) -{ -#if USE_DISPLAY_PALETTE - DirectFB_RenderData *data = (DirectFB_RenderData *) userdata; - SDL_DFB_WINDOWSURFACE(data->window); - IDirectFBPalette *surfpal; - - int i; - int ncolors; - DFBColor entries[256]; - - SDL_DFB_CHECKERR(destsurf->GetPalette(destsurf, &surfpal)); - - /* FIXME: number of colors */ - ncolors = (palette->ncolors < 256 ? palette->ncolors : 256); - - for (i = 0; i < ncolors; ++i) { - entries[i].r = palette->colors[i].r; - entries[i].g = palette->colors[i].g; - entries[i].b = palette->colors[i].b; - entries[i].a = palette->colors[i].unused; - } - SDL_DFB_CHECKERR(surfpal->SetEntries(surfpal, entries, ncolors, 0)); - return 0; - error: -#else - SDL_Unsupported(); -#endif - return -1; -} - - SDL_Renderer * DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) { @@ -260,8 +215,6 @@ renderer->ActivateRenderer = DirectFB_ActivateRenderer; renderer->CreateTexture = DirectFB_CreateTexture; renderer->QueryTexturePixels = DirectFB_QueryTexturePixels; - renderer->SetTexturePalette = DirectFB_SetTexturePalette; - renderer->GetTexturePalette = DirectFB_GetTexturePalette; renderer->UpdateTexture = DirectFB_UpdateTexture; renderer->LockTexture = DirectFB_LockTexture; renderer->UnlockTexture = DirectFB_UnlockTexture; @@ -298,11 +251,6 @@ if (p) data->isyuvdirect = atoi(p); - /* Set up a palette watch on the display palette */ - if (display->palette) { - SDL_AddPaletteWatch(display->palette, DisplayPaletteChanged, data); - } - return renderer; error: @@ -315,10 +263,6 @@ SDLToDFBPixelFormat(Uint32 format) { switch (format) { - case SDL_PIXELFORMAT_INDEX4LSB: - return DSPF_ALUT44; - case SDL_PIXELFORMAT_INDEX8: - return DSPF_LUT8; case SDL_PIXELFORMAT_RGB332: return DSPF_RGB332; case SDL_PIXELFORMAT_RGB555: @@ -345,12 +289,6 @@ return DSPF_UYVY; /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ case SDL_PIXELFORMAT_YVYU: return DSPF_UNKNOWN; /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ - case SDL_PIXELFORMAT_INDEX1LSB: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_INDEX1MSB: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_INDEX4MSB: - return DSPF_UNKNOWN; #if (DFB_VERSION_ATLEAST(1,2,0)) case SDL_PIXELFORMAT_RGB444: return DSPF_RGB444; @@ -499,12 +437,6 @@ /* Create the surface */ SDL_DFB_CHECKERR(devdata->dfb->CreateSurface(devdata->dfb, &dsc, &data->surface)); - if (SDL_ISPIXELFORMAT_INDEXED(data->format) - && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { - SDL_DFB_CHECKERR(data->surface->GetPalette(data->surface, - &data->palette)); - } - } #if (DFB_VERSION_ATLEAST(1,2,0)) data->render_options = DSRO_NONE; @@ -546,68 +478,6 @@ } static int -DirectFB_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors) -{ - DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; - - if (SDL_ISPIXELFORMAT_INDEXED(data->format) - && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { - DFBColor entries[256]; - int i; - - for (i = 0; i < ncolors; ++i) { - entries[i].r = colors[i].r; - entries[i].g = colors[i].g; - entries[i].b = colors[i].b; - entries[i].a = 0xFF; - } - SDL_DFB_CHECKERR(data-> - palette->SetEntries(data->palette, entries, ncolors, - firstcolor)); - return 0; - } else { - SDL_SetError("YUV textures don't have a palette"); - return -1; - } - error: - return -1; -} - -static int -DirectFB_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors) -{ - DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; - - if (SDL_ISPIXELFORMAT_INDEXED(data->format) - && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { - DFBColor entries[256]; - int i; - - SDL_DFB_CHECKERR(data-> - palette->GetEntries(data->palette, entries, ncolors, - firstcolor)); - - for (i = 0; i < ncolors; ++i) { - colors[i].r = entries[i].r; - colors[i].g = entries[i].g; - colors[i].b = entries[i].b; - colors->unused = SDL_ALPHA_OPAQUE; - } - return 0; - } else { - SDL_SetError("YUV textures don't have a palette"); - return -1; - } - error: - return -1; -} - -static int DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { #if (DFB_VERSION_ATLEAST(1,2,0))
--- a/src/video/dummy/SDL_nullrender.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/dummy/SDL_nullrender.c Tue Feb 01 21:23:43 2011 -0800 @@ -117,7 +117,6 @@ SDL_DUMMY_DestroyRenderer(renderer); return NULL; } - SDL_SetSurfacePalette(data->screen, display->palette); return renderer; }
--- a/src/video/nds/SDL_ndsrender.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/nds/SDL_ndsrender.c Tue Feb 01 21:23:43 2011 -0800 @@ -43,13 +43,6 @@ static int NDS_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int NDS_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); -static int NDS_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors); static int NDS_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); @@ -72,9 +65,8 @@ NDS_CreateRenderer, {"nds", /* char* name */ (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC), /* u32 flags */ - 3, /* u32 num_texture_formats */ + 2, /* u32 num_texture_formats */ { - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_BGR555, }, /* u32 texture_formats[20] */ @@ -129,7 +121,6 @@ return NULL; } switch (displayMode->format) { - case SDL_PIXELFORMAT_INDEX8: case SDL_PIXELFORMAT_ABGR1555: case SDL_PIXELFORMAT_BGR555: /* okay */ @@ -168,8 +159,6 @@ renderer->driverdata = data; renderer->CreateTexture = NDS_CreateTexture; renderer->QueryTexturePixels = NDS_QueryTexturePixels; - renderer->SetTexturePalette = NDS_SetTexturePalette; - renderer->GetTexturePalette = NDS_GetTexturePalette; renderer->UpdateTexture = NDS_UpdateTexture; renderer->LockTexture = NDS_LockTexture; renderer->UnlockTexture = NDS_UnlockTexture; @@ -529,24 +518,4 @@ SDL_free(renderer); } -static int -NDS_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ - NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata; - /* set 8-bit modes in the background control registers - for backgrounds, BGn_CR |= BG_256_COLOR */ - - return 0; -} - -static int -NDS_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - NDS_TextureData *txdat = (NDS_TextureData *) texture->driverdata; - /* stub! */ - return 0; -} - /* vi: set ts=4 sw=4 expandtab: */
--- a/src/video/pandora/SDL_pandora.h Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/pandora/SDL_pandora.h Tue Feb 01 21:23:43 2011 -0800 @@ -70,8 +70,6 @@ void PND_videoquit(_THIS); void PND_getdisplaymodes(_THIS, SDL_VideoDisplay * display); int PND_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); -int PND_setdisplaypalette(_THIS, SDL_Palette * palette); -int PND_getdisplaypalette(_THIS, SDL_Palette * palette); int PND_setdisplaygammaramp(_THIS, Uint16 * ramp); int PND_getdisplaygammaramp(_THIS, Uint16 * ramp); int PND_createwindow(_THIS, SDL_Window * window);
--- a/src/video/photon/SDL_photon.h Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/photon/SDL_photon.h Tue Feb 01 21:23:43 2011 -0800 @@ -132,8 +132,6 @@ void photon_videoquit(_THIS); void photon_getdisplaymodes(_THIS); int photon_setdisplaymode(_THIS, SDL_DisplayMode * mode); -int photon_setdisplaypalette(_THIS, SDL_Palette * palette); -int photon_getdisplaypalette(_THIS, SDL_Palette * palette); int photon_setdisplaygammaramp(_THIS, Uint16 * ramp); int photon_getdisplaygammaramp(_THIS, Uint16 * ramp); int photon_createwindow(_THIS, SDL_Window * window);
--- a/src/video/photon/SDL_photon_render.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/photon/SDL_photon_render.c Tue Feb 01 21:23:43 2011 -0800 @@ -91,9 +91,8 @@ SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), - 10, - {SDL_PIXELFORMAT_INDEX8, - SDL_PIXELFORMAT_RGB555, + 9, + {SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB24, SDL_PIXELFORMAT_RGB888, @@ -134,8 +133,6 @@ renderer->ActivateRenderer = photon_activaterenderer; renderer->CreateTexture = photon_createtexture; renderer->QueryTexturePixels = photon_querytexturepixels; - renderer->SetTexturePalette = photon_settexturepalette; - renderer->GetTexturePalette = photon_gettexturepalette; renderer->UpdateTexture = photon_updatetexture; renderer->LockTexture = photon_locktexture; renderer->UnlockTexture = photon_unlocktexture; @@ -812,55 +809,6 @@ } static int -photon_settexturepalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors) -{ - SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata; - SDL_TextureData* tdata=(SDL_TextureData*)texture->driverdata; - - /* Check, if it is not initialized */ - if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_UNKNOWN) - { - SDL_SetError("Photon: can't set texture palette for OpenGL ES window"); - return -1; - } - - if (texture->format!=SDL_PIXELFORMAT_INDEX8) - { - SDL_SetError("Photon: can't set palette for non-paletted texture"); - return -1; - } - - SDL_Unsupported(); - return -1; -} - -static int -photon_gettexturepalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata; - SDL_TextureData* tdata=(SDL_TextureData*)texture->driverdata; - - /* Check, if it is not initialized */ - if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_UNKNOWN) - { - SDL_SetError("Photon: can't return texture palette for OpenGL ES window"); - return -1; - } - - if (texture->format!=SDL_PIXELFORMAT_INDEX8) - { - SDL_SetError("Photon: can't return palette for non-paletted texture"); - return -1; - } - - SDL_Unsupported(); - return -1; -} - -static int photon_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) {
--- a/src/video/qnxgf/SDL_gf_render.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/qnxgf/SDL_gf_render.c Tue Feb 01 21:23:43 2011 -0800 @@ -75,9 +75,8 @@ SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), - 13, + 12, { - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB555, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB888, @@ -131,8 +130,6 @@ renderer->ActivateRenderer = gf_activaterenderer; renderer->CreateTexture = gf_createtexture; renderer->QueryTexturePixels = gf_querytexturepixels; - renderer->SetTexturePalette = gf_settexturepalette; - renderer->GetTexturePalette = gf_gettexturepalette; renderer->UpdateTexture = gf_updatetexture; renderer->LockTexture = gf_locktexture; renderer->UnlockTexture = gf_unlocktexture; @@ -306,18 +303,6 @@ } static int -gf_settexturepalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ -} - -static int -gf_gettexturepalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ -} - -static int gf_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) {
--- a/src/video/qnxgf/SDL_qnxgf.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/qnxgf/SDL_qnxgf.c Tue Feb 01 21:23:43 2011 -0800 @@ -284,8 +284,6 @@ device->VideoQuit = qnxgf_videoquit; device->GetDisplayModes = qnxgf_getdisplaymodes; device->SetDisplayMode = qnxgf_setdisplaymode; - device->SetDisplayPalette = qnxgf_setdisplaypalette; - device->GetDisplayPalette = qnxgf_getdisplaypalette; device->SetDisplayGammaRamp = qnxgf_setdisplaygammaramp; device->GetDisplayGammaRamp = qnxgf_getdisplaygammaramp; device->CreateWindow = qnxgf_createwindow; @@ -922,30 +920,6 @@ } int -qnxgf_setdisplaypalette(_THIS, SDL_VideoDisplay * display, SDL_Palette * palette) -{ - SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata; - - /* QNX GF doesn't have support for global palette changing, but we */ - /* could store it for usage in future */ - - SDL_Unsupported(); - return -1; -} - -int -qnxgf_getdisplaypalette(_THIS, SDL_VideoDisplay * display, SDL_Palette * palette) -{ - SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata; - - /* We can't provide current palette settings and looks like SDL */ - /* do not call this function also, in such case this function returns -1 */ - - SDL_Unsupported(); - return -1; -} - -int qnxgf_setdisplaygammaramp(_THIS, SDL_VideoDisplay * display, Uint16 * ramp) { SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
--- a/src/video/qnxgf/SDL_qnxgf.h Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/qnxgf/SDL_qnxgf.h Tue Feb 01 21:23:43 2011 -0800 @@ -118,8 +118,6 @@ void qnxgf_videoquit(_THIS); void qnxgf_getdisplaymodes(_THIS); int qnxgf_setdisplaymode(_THIS, SDL_DisplayMode * mode); -int qnxgf_setdisplaypalette(_THIS, SDL_Palette * palette); -int qnxgf_getdisplaypalette(_THIS, SDL_Palette * palette); int qnxgf_setdisplaygammaramp(_THIS, Uint16 * ramp); int qnxgf_getdisplaygammaramp(_THIS, Uint16 * ramp); int qnxgf_createwindow(_THIS, SDL_Window * window);
--- a/src/video/sdlgenblit.pl Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/sdlgenblit.pl Tue Feb 01 21:23:43 2011 -0800 @@ -9,7 +9,6 @@ my %file; # The formats potentially supported by this script: -# SDL_PIXELFORMAT_INDEX8 # SDL_PIXELFORMAT_RGB332 # SDL_PIXELFORMAT_RGB444 # SDL_PIXELFORMAT_RGB555
--- a/src/video/windows/SDL_d3drender.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/windows/SDL_d3drender.c Tue Feb 01 21:23:43 2011 -0800 @@ -94,13 +94,6 @@ static int D3D_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); -static int D3D_SetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, - int ncolors); -static int D3D_GetTexturePalette(SDL_Renderer * renderer, - SDL_Texture * texture, SDL_Color * colors, - int firstcolor, int ncolors); static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); @@ -362,7 +355,6 @@ if (data->d3d) { int i, j; int formats[] = { - SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB332, SDL_PIXELFORMAT_RGB444, SDL_PIXELFORMAT_RGB555, @@ -436,8 +428,6 @@ renderer->DisplayModeChanged = D3D_DisplayModeChanged; renderer->CreateTexture = D3D_CreateTexture; renderer->QueryTexturePixels = D3D_QueryTexturePixels; - renderer->SetTexturePalette = D3D_SetTexturePalette; - renderer->GetTexturePalette = D3D_GetTexturePalette; renderer->UpdateTexture = D3D_UpdateTexture; renderer->LockTexture = D3D_LockTexture; renderer->UnlockTexture = D3D_UnlockTexture; @@ -664,25 +654,6 @@ } static int -D3D_SetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Color * colors, int firstcolor, int ncolors) -{ - D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata; - D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; - - return 0; -} - -static int -D3D_GetTexturePalette(SDL_Renderer * renderer, SDL_Texture * texture, - SDL_Color * colors, int firstcolor, int ncolors) -{ - D3D_TextureData *data = (D3D_TextureData *) texture->driverdata; - - return 0; -} - -static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) {
--- a/src/video/windows/SDL_windowsevents.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/windows/SDL_windowsevents.c Tue Feb 01 21:23:43 2011 -0800 @@ -501,25 +501,6 @@ } break; - /* We are about to get palette focus! */ - case WM_QUERYNEWPALETTE: - { - /* - WIN_RealizePalette(current_video); - returnCode = TRUE; - */ - } - break; - - /* Another application changed the palette */ - case WM_PALETTECHANGED: - { - /* - WIN_PaletteChanged(current_video, (HWND) wParam); - */ - } - break; - /* We were occluded, refresh our display */ case WM_PAINT: {
--- a/src/video/windows/SDL_windowsmodes.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/windows/SDL_windowsmodes.c Tue Feb 01 21:23:43 2011 -0800 @@ -131,6 +131,10 @@ } } } + if (SDL_ISPIXELFORMAT_INDEXED(mode->format)) { + /* We don't support palettized modes now */ + return SDL_FALSE; + } return SDL_TRUE; }
--- a/src/video/x11/SDL_x11modes.c Tue Feb 01 20:50:04 2011 -0800 +++ b/src/video/x11/SDL_x11modes.c Tue Feb 01 21:23:43 2011 -0800 @@ -134,6 +134,10 @@ } mode.format = X11_GetPixelFormatFromVisualInfo(data->display, &vinfo); + if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) { + /* We don't support palettized modes now */ + continue; + } mode.w = DisplayWidth(data->display, screen); mode.h = DisplayHeight(data->display, screen); mode.refresh_rate = 0;