From d21e8338077cb8f3055656782dd2f5be6e343b10 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 29 Jan 2006 22:23:54 +0000 Subject: [PATCH] Fixed palette bug on non-WinCE --- src/video/windib/SDL_dibvideo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index 9beb1f657..09bbdf2e0 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -773,13 +773,13 @@ static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) { - RGBQUAD *pal; - int i; -#if (_WIN32_WCE < 400 ) - HDC hdc; -#else +#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) HDC hdc, mdc; + RGBQUAD *pal; +#else + HDC hdc; #endif + int i; /* Update the display palette */ hdc = GetDC(SDL_Window); @@ -798,6 +798,7 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) RealizePalette(hdc); } +#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) /* Copy palette colors into DIB palette */ pal = (RGBQUAD *)alloca(ncolors*sizeof(RGBQUAD)); for ( i=0; i= 400 ) mdc = CreateCompatibleDC(hdc); SelectObject(mdc, screen_bmp); SetDIBColorTable(mdc, firstcolor, ncolors, pal);