Fixed building on Windows CE SDL-1.2
authorSam Lantinga
Sun, 15 Jul 2007 19:43:54 +0000
branchSDL-1.2
changeset 40750207ca19fd8f
parent 4074 fd1cbe7a706c
child 4076 9a7c62bbc8b3
Fixed building on Windows CE
src/video/windib/SDL_dibvideo.c
     1.1 --- a/src/video/windib/SDL_dibvideo.c	Sun Jul 15 19:00:22 2007 +0000
     1.2 +++ b/src/video/windib/SDL_dibvideo.c	Sun Jul 15 19:43:54 2007 +0000
     1.3 @@ -939,6 +939,7 @@
     1.4  			entry->peBlue  = colors[i].b;
     1.5  			entry->peFlags = PC_NOCOLLAPSE;
     1.6  		}
     1.7 +#ifdef SYSPAL_NOSTATIC
     1.8  		/* Check to make sure black and white are in position */
     1.9  		if ( GetSystemPaletteUse(hdc) != SYSPAL_NOSTATIC256 ) {
    1.10  			moved_entries += CheckPaletteEntry(screen_logpal, 0, 0x00, 0x00, 0x00);
    1.11 @@ -950,9 +951,12 @@
    1.12  		   in the desired palette, set those entries (10-245) and
    1.13  		   then map everything into the new system palette.
    1.14  		 */
    1.15 +#endif
    1.16  
    1.17 +#ifndef _WIN32_WCE
    1.18  		/* Copy the entries into the system palette */
    1.19  		UnrealizeObject(screen_pal);
    1.20 +#endif
    1.21  		SetPaletteEntries(screen_pal, 0, screen_logpal->palNumEntries, screen_logpal->palPalEntry);
    1.22  		SelectPalette(hdc, screen_pal, FALSE);
    1.23  		RealizePalette(hdc);
    1.24 @@ -1156,6 +1160,7 @@
    1.25  /* Exported for the windows message loop only */
    1.26  static void DIB_GrabStaticColors(HWND window)
    1.27  {
    1.28 +#ifdef SYSPAL_NOSTATIC
    1.29  	HDC hdc;
    1.30  
    1.31  	hdc = GetDC(window);
    1.32 @@ -1164,14 +1169,17 @@
    1.33  		SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
    1.34  	}
    1.35  	ReleaseDC(window, hdc);
    1.36 +#endif
    1.37  }
    1.38  static void DIB_ReleaseStaticColors(HWND window)
    1.39  {
    1.40 +#ifdef SYSPAL_NOSTATIC
    1.41  	HDC hdc;
    1.42  
    1.43  	hdc = GetDC(window);
    1.44  	SetSystemPaletteUse(hdc, SYSPAL_STATIC);
    1.45  	ReleaseDC(window, hdc);
    1.46 +#endif
    1.47  }
    1.48  static void DIB_Activate(_THIS, BOOL active, BOOL minimized)
    1.49  {
    1.50 @@ -1191,7 +1199,9 @@
    1.51  		HDC hdc;
    1.52  
    1.53  		hdc = GetDC(SDL_Window);
    1.54 +#ifndef _WIN32_WCE
    1.55  		UnrealizeObject(screen_pal);
    1.56 +#endif
    1.57  		SelectPalette(hdc, screen_pal, FALSE);
    1.58  		if ( RealizePalette(hdc) ) {
    1.59  			InvalidateRect(SDL_Window, NULL, FALSE);