changeset 4075:0207ca19fd8f SDL-1.2

Fixed building on Windows CE
author Sam Lantinga <slouken@libsdl.org>
date Sun, 15 Jul 2007 19:43:54 +0000
parents fd1cbe7a706c
children 9a7c62bbc8b3
files src/video/windib/SDL_dibvideo.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/windib/SDL_dibvideo.c	Sun Jul 15 19:00:22 2007 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Sun Jul 15 19:43:54 2007 +0000
@@ -939,6 +939,7 @@
 			entry->peBlue  = colors[i].b;
 			entry->peFlags = PC_NOCOLLAPSE;
 		}
+#ifdef SYSPAL_NOSTATIC
 		/* Check to make sure black and white are in position */
 		if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
 			moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00);
@@ -950,9 +951,12 @@
 		   in the desired palette, set those entries (10-245) and
 		   then map everything into the new system palette.
 		 */
+#endif
 
+#ifndef _WIN32_WCE
 		/* Copy the entries into the system palette */
 		UnrealizeObject(screen_pal);
+#endif
 		SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry);
 		SelectPalette(hdc, screen_pal, FALSE);
 		RealizePalette(hdc);
@@ -1156,6 +1160,7 @@
 /* Exported for the windows message loop only */
 static void DIB_GrabStaticColors(HWND window)
 {
+#ifdef SYSPAL_NOSTATIC
 	HDC hdc;
 
 	hdc = GetDC(window);
@@ -1164,14 +1169,17 @@
 		SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
 	}
 	ReleaseDC(window, hdc);
+#endif
 }
 static void DIB_ReleaseStaticColors(HWND window)
 {
+#ifdef SYSPAL_NOSTATIC
 	HDC hdc;
 
 	hdc = GetDC(window);
 	SetSystemPaletteUse(hdc, SYSPAL_STATIC);
 	ReleaseDC(window, hdc);
+#endif
 }
 static void DIB_Activate(_THIS, BOOL active, BOOL minimized)
 {
@@ -1191,7 +1199,9 @@
 		HDC hdc;
 
 		hdc = GetDC(SDL_Window);
+#ifndef _WIN32_WCE
 		UnrealizeObject(screen_pal);
+#endif
 		SelectPalette(hdc, screen_pal, FALSE);
 		if ( RealizePalette(hdc) ) {
 			InvalidateRect(SDL_Window, NULL, FALSE);