Commit 09a85588 authored by Sam Lantinga's avatar Sam Lantinga

Making the API simpler, removed support for palettized video modes and textures.

parent b4fff42f
......@@ -219,38 +219,6 @@ extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
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.
*
......
......@@ -355,25 +355,6 @@ extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
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.
......
......@@ -320,27 +320,6 @@ SDL_CompatEventFilter(void *userdata, SDL_Event * event)
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_SetVideoMode(int width, int height, int bpp, Uint32 flags)
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_SetVideoMode(int width, int height, int bpp, Uint32 flags)
}
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 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
/* 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 =
......
......@@ -72,13 +72,6 @@ static int GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
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 @@ SDL_RenderDriver GL_RenderDriver = {
{
"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 @@ typedef struct
#include "SDL_glfuncs.h"
#undef SDL_PROC
PFNGLCOLORTABLEEXTPROC glColorTableEXT;
void (*glTextureRangeAPPLE) (GLenum target, GLsizei length,
const GLvoid * pointer);
......@@ -278,8 +267,6 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
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 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
|| 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 @@ convert_format(GL_RenderData *renderdata, Uint32 pixel_format,
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 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
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 @@ GL_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
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 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
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 @@ GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
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)));
......
......@@ -60,13 +60,6 @@ static int GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
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 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
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 @@ GLES_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
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)
......
......@@ -38,13 +38,6 @@ static int SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
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 @@ SDL_RenderDriver SW_RenderDriver = {
{
"software",
(SDL_RENDERER_PRESENTVSYNC),
14,
13,
{
SDL_PIXELFORMAT_INDEX8,
SDL_PIXELFORMAT_RGB555,
SDL_PIXELFORMAT_RGB565,
SDL_PIXELFORMAT_RGB888,
......@@ -141,26 +133,11 @@ DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
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_CreateRenderer(SDL_Window * window, Uint32 flags)
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;
}
......@@ -365,37 +336,6 @@ SW_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
}
}
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)
{
......@@ -793,13 +733,8 @@ SW_DestroyRenderer(SDL_Renderer * renderer)
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);
}
......
......@@ -67,12 +67,6 @@ struct SDL_Renderer
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 @@ struct SDL_VideoDisplay
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 @@ struct SDL_VideoDevice
*/
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_GetDesktopDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_D
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);
......
......@@ -645,7 +645,6 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode *
{
SDL_DisplayMode display_mode;
SDL_DisplayMode current_mode;
int ncolors;
if (mode) {
display_mode = *mode;
......@@ -689,29 +688,6 @@ SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode *
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 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt)
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_CreateTextureFromSurface(SDL_Renderer * renderer, Uint32 format, SDL_Surface
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 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, Uint32 format, SDL_Surface
/* 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_CreateTextureFromSurface(SDL_Renderer * renderer, Uint32 format, SDL_Surface
SDL_SetTextureBlendMode(texture, blendMode);
}
}
if (SDL_ISPIXELFORMAT_INDEXED(format) && fmt->palette) {
SDL_SetTexturePalette(texture, fmt->palette->colors, 0,
fmt->palette->ncolors);
}
return texture;
}
......@@ -1962,40 +1853,6 @@ SDL_QueryTexturePixels(SDL_Texture * texture, void **pixels, int *pitch)
return renderer->QueryTexturePixels(renderer, texture, pixels, pitch);
}
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)
{
......@@ -2687,10 +2544,6 @@ SDL_VideoQuit(void)
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;
......
......@@ -117,8 +117,8 @@ GetDisplayMode(CFDictionaryRef moderef, SDL_DisplayMode *mode)
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;
......
......@@ -43,14 +43,6 @@ static int DirectFB_CreateTexture(SDL_Renderer * renderer,
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 @@ SDL_RenderDriver DirectFB_RenderDriver = {
{
"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 @@ typedef struct
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 @@ TextureHasAlpha(DirectFB_TextureData * data)
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 @@ DirectFB_AddRenderDriver(_THIS)
}
}
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 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
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 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
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 @@ static DFBSurfacePixelFormat
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 @@ SDLToDFBPixelFormat(Uint32 format)
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 @@ DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
/* 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;
......@@ -545,68 +477,6 @@ DirectFB_QueryTexturePixels(SDL_Renderer * renderer,
return 0;
}
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)
{
......
......@@ -117,7 +117,6 @@ SDL_DUMMY_CreateRenderer(SDL_Window * window, Uint32 flags)
SDL_DUMMY_DestroyRenderer(renderer);
return NULL;
}
SDL_SetSurfacePalette(data->screen, display->palette);
return renderer;
}
......
......@@ -43,13 +43,6 @@ static int NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
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 @@ SDL_RenderDriver NDS_RenderDriver = {
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 @@ NDS_CreateRenderer(SDL_Window * window, Uint32 flags)
return NULL;
}
switch (displayMode->format) {
case SDL_PIXELFORMAT_INDEX8:
case SDL_PIXELFORMAT_ABGR1555:
case SDL_PIXELFORMAT_BGR555:
/* okay */
......@@ -168,8 +159,6 @@ NDS_CreateRenderer(SDL_Window * window, Uint32 flags)
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 @@ NDS_DestroyRenderer(SDL_Renderer * renderer)
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: */
......@@ -70,8 +70,6 @@ int PND_videoinit(_THIS);
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);
......
......@@ -132,8 +132,6 @@ int photon_videoinit(_THIS);
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);
......
......@@ -91,9 +91,8 @@ SDL_RenderDriver photon_renderdriver = {
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 @@ photon_createrenderer(SDL_Window * window, Uint32 flags)
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;
......@@ -811,55 +808,6 @@ photon_querytexturepixels(SDL_Renderer * renderer, SDL_Texture * texture,
return 0;
}
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)
......
......@@ -75,9 +75,8 @@ SDL_RenderDriver gf_renderdriver = {
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 @@ gf_createrenderer(SDL_Window * window, Uint32 flags)
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;
......@@ -305,18 +302,6 @@ gf_querytexturepixels(SDL_Renderer * renderer, SDL_Texture * texture,
{
}
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)
......
......@@ -284,8 +284,6 @@ qnxgf_create(int devindex)
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;
......@@ -921,30 +919,6 @@ qnxgf_setdisplaymode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
return 0;
}
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)
{
......
......@@ -118,8 +118,6 @@ int qnxgf_videoinit(_THIS);
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);
......
......@@ -9,7 +9,6 @@ use strict;
my %file;
# The formats potentially supported by this script:
# SDL_PIXELFORMAT_INDEX8
# SDL_PIXELFORMAT_RGB332
# SDL_PIXELFORMAT_RGB444
# SDL_PIXELFORMAT_RGB555
......
......@@ -94,13 +94,6 @@ static int D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture);
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 @@ D3D_AddRenderDriver(_THIS)
if (data->d3d) {
int i, j;
int formats[] = {
SDL_PIXELFORMAT_INDEX8,
SDL_PIXELFORMAT_RGB332,
SDL_PIXELFORMAT_RGB444,
SDL_PIXELFORMAT_RGB555,
......@@ -436,8 +428,6 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
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;
......@@ -663,25 +653,6 @@ D3D_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture,
}
}
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)
......
......@@ -501,25 +501,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
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:
{
......
......@@ -131,6 +131,10 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
}
}
}
if (SDL_ISPIXELFORMAT_INDEXED(mode->format)) {
/* We don't support palettized modes now */
return SDL_FALSE;
}
return SDL_TRUE;
}
......
......@@ -134,6 +134,10 @@ X11_InitModes(_THIS)
}
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment