From ac524cf8bf023c7008f42a13311f99ec4bc07680 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 5 Oct 2002 16:27:56 +0000 Subject: [PATCH] Fixed gamma correction in Atari video drivers (thanks Patrice!) --- src/video/gem/SDL_gemvideo.c | 6 +++++- src/video/xbios/SDL_xbios.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/video/gem/SDL_gemvideo.c b/src/video/gem/SDL_gemvideo.c index b7cbf9b25..3a761a1a1 100644 --- a/src/video/gem/SDL_gemvideo.c +++ b/src/video/gem/SDL_gemvideo.c @@ -600,7 +600,6 @@ SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current, Uint32 modeflags, screensize; SDL_bool use_shadow; - modeflags = SDL_HWPALETTE; GEM_FreeBuffers(this); /*--- Verify if asked mode can be used ---*/ @@ -659,6 +658,11 @@ SDL_Surface *GEM_SetVideoMode(_THIS, SDL_Surface *current, } /*--- Initialize screen ---*/ + modeflags = 0; + if (VDI_bpp == 8) { + modeflags |= SDL_HWPALETTE; + } + if (flags & SDL_FULLSCREEN) { GEM_LockScreen(this); diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index f428b2c24..7f3894a6f 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -454,7 +454,7 @@ static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, return(NULL); } - modeflags = (SDL_FULLSCREEN|SDL_HWPALETTE); + modeflags = SDL_FULLSCREEN; /* Allocate needed buffers: simple/double buffer and shadow surface */ new_video_mode = XBIOS_videomodes[bpp][mode]; @@ -475,7 +475,7 @@ static SDL_Surface *XBIOS_SetVideoMode(_THIS, SDL_Surface *current, } else { Atari_C2pConvert = Atari_C2pConvert8; } - modeflags |= SDL_SWSURFACE; + modeflags |= SDL_SWSURFACE|SDL_HWPALETTE; } else { modeflags |= SDL_HWSURFACE; }