Commit 5adb9f2f authored by Sam Lantinga's avatar Sam Lantinga

Fixed building on Windows CE

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402542
parent adddf96a
...@@ -939,6 +939,7 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) ...@@ -939,6 +939,7 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
entry->peBlue = colors[i].b; entry->peBlue = colors[i].b;
entry->peFlags = PC_NOCOLLAPSE; entry->peFlags = PC_NOCOLLAPSE;
} }
#ifdef SYSPAL_NOSTATIC
/* Check to make sure black and white are in position */ /* Check to make sure black and white are in position */
if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) { if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00); moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00);
...@@ -950,9 +951,12 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) ...@@ -950,9 +951,12 @@ int DIB_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
in the desired palette, set those entries (10-245) and in the desired palette, set those entries (10-245) and
then map everything into the new system palette. then map everything into the new system palette.
*/ */
#endif
#ifndef _WIN32_WCE
/* Copy the entries into the system palette */ /* Copy the entries into the system palette */
UnrealizeObject(screen_pal); UnrealizeObject(screen_pal);
#endif
SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry); SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry);
SelectPalette(hdc, screen_pal, FALSE); SelectPalette(hdc, screen_pal, FALSE);
RealizePalette(hdc); RealizePalette(hdc);
...@@ -1156,6 +1160,7 @@ void DIB_VideoQuit(_THIS) ...@@ -1156,6 +1160,7 @@ void DIB_VideoQuit(_THIS)
/* Exported for the windows message loop only */ /* Exported for the windows message loop only */
static void DIB_GrabStaticColors(HWND window) static void DIB_GrabStaticColors(HWND window)
{ {
#ifdef SYSPAL_NOSTATIC
HDC hdc; HDC hdc;
hdc = GetDC(window); hdc = GetDC(window);
...@@ -1164,14 +1169,17 @@ static void DIB_GrabStaticColors(HWND window) ...@@ -1164,14 +1169,17 @@ static void DIB_GrabStaticColors(HWND window)
SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC); SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
} }
ReleaseDC(window, hdc); ReleaseDC(window, hdc);
#endif
} }
static void DIB_ReleaseStaticColors(HWND window) static void DIB_ReleaseStaticColors(HWND window)
{ {
#ifdef SYSPAL_NOSTATIC
HDC hdc; HDC hdc;
hdc = GetDC(window); hdc = GetDC(window);
SetSystemPaletteUse(hdc, SYSPAL_STATIC); SetSystemPaletteUse(hdc, SYSPAL_STATIC);
ReleaseDC(window, hdc); ReleaseDC(window, hdc);
#endif
} }
static void DIB_Activate(_THIS, BOOL active, BOOL minimized) static void DIB_Activate(_THIS, BOOL active, BOOL minimized)
{ {
...@@ -1191,7 +1199,9 @@ static void DIB_RealizePalette(_THIS) ...@@ -1191,7 +1199,9 @@ static void DIB_RealizePalette(_THIS)
HDC hdc; HDC hdc;
hdc = GetDC(SDL_Window); hdc = GetDC(SDL_Window);
#ifndef _WIN32_WCE
UnrealizeObject(screen_pal); UnrealizeObject(screen_pal);
#endif
SelectPalette(hdc, screen_pal, FALSE); SelectPalette(hdc, screen_pal, FALSE);
if ( RealizePalette(hdc) ) { if ( RealizePalette(hdc) ) {
InvalidateRect(SDL_Window, NULL, FALSE); InvalidateRect(SDL_Window, NULL, FALSE);
......
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