Commit 838b8023 authored by Sam Lantinga's avatar Sam Lantinga

Fixed palette bug on non-WinCE

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401295
parent e051a43d
...@@ -773,13 +773,13 @@ static void DIB_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) ...@@ -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) int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
{ {
#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
HDC hdc, mdc;
RGBQUAD *pal; RGBQUAD *pal;
int i;
#if (_WIN32_WCE < 400 )
HDC hdc;
#else #else
HDC hdc, mdc; HDC hdc;
#endif #endif
int i;
/* Update the display palette */ /* Update the display palette */
hdc = GetDC(SDL_Window); hdc = GetDC(SDL_Window);
...@@ -798,6 +798,7 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) ...@@ -798,6 +798,7 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
RealizePalette(hdc); RealizePalette(hdc);
} }
#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400)
/* Copy palette colors into DIB palette */ /* Copy palette colors into DIB palette */
pal = (RGBQUAD *)alloca(ncolors*sizeof(RGBQUAD)); pal = (RGBQUAD *)alloca(ncolors*sizeof(RGBQUAD));
for ( i=0; i<ncolors; ++i ) { for ( i=0; i<ncolors; ++i ) {
...@@ -808,7 +809,6 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) ...@@ -808,7 +809,6 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
} }
/* Set the DIB palette and update the display */ /* Set the DIB palette and update the display */
#if ( _WIN32_WCE >= 400 )
mdc = CreateCompatibleDC(hdc); mdc = CreateCompatibleDC(hdc);
SelectObject(mdc, screen_bmp); SelectObject(mdc, screen_bmp);
SetDIBColorTable(mdc, firstcolor, ncolors, pal); SetDIBColorTable(mdc, firstcolor, ncolors, pal);
......
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