From 4918a3224f34c8b37fa648827a29e8e3d33f53d5 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 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) { +#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) + HDC hdc, mdc; RGBQUAD *pal; - int i; -#if (_WIN32_WCE < 400 ) - HDC hdc; #else - HDC hdc, mdc; + 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);