26 #include "..\ref_soft\r_local.h"
30 # error You should not be trying to compile this file on this platform
52 COLOR_INACTIVECAPTION,
61 #define NUM_SYS_COLORS ( sizeof( s_syspalindices ) / sizeof( int ) )
75 PALETTEENTRY palEntries[256];
91 BITMAPINFO *pbmiDIB = ( BITMAPINFO * ) &dibheader;
95 memset( &dibheader, 0,
sizeof( dibheader ) );
109 if ( GetDeviceCaps(
sww_state.
hDC, RASTERCAPS ) & RC_PALETTE )
130 pbmiDIB->bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
131 pbmiDIB->bmiHeader.biWidth =
vid.
width;
132 pbmiDIB->bmiHeader.biHeight =
vid.
height;
133 pbmiDIB->bmiHeader.biPlanes = 1;
134 pbmiDIB->bmiHeader.biBitCount = 8;
135 pbmiDIB->bmiHeader.biCompression = BI_RGB;
136 pbmiDIB->bmiHeader.biSizeImage = 0;
137 pbmiDIB->bmiHeader.biXPelsPerMeter = 0;
138 pbmiDIB->bmiHeader.biYPelsPerMeter = 0;
139 pbmiDIB->bmiHeader.biClrUsed = 256;
140 pbmiDIB->bmiHeader.biClrImportant = 256;
145 for (
i = 0;
i < 256;
i++ )
168 if ( pbmiDIB->bmiHeader.biHeight > 0 )
181 MONITORINFOEX monInfo;
182 memset(&monInfo, 0,
sizeof(MONITORINFOEX));
183 monInfo.cbSize =
sizeof(MONITORINFOEX);
184 GetMonitorInfo( MonitorFromWindow(
sww_state.
hWnd, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&monInfo );
186 ChangeDisplaySettingsEx(monInfo.szDevice,
NULL,
NULL, 0,
NULL);
192 DWORD WindowStyle, ExWindowStyle;
194 WindowRect.top = monInfo.rcMonitor.top;
195 WindowRect.left = monInfo.rcMonitor.left;
199 memset(&gdevmode, 0,
sizeof(gdevmode));
200 gdevmode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;
203 gdevmode.dmSize =
sizeof (gdevmode);
205 if ( ChangeDisplaySettingsEx( monInfo.szDevice, &gdevmode,
NULL, CDS_FULLSCREEN,
NULL ) != DISP_CHANGE_SUCCESSFUL )
211 GetMonitorInfo( MonitorFromWindow(
sww_state.
hWnd, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&monInfo );
214 monInfo.rcMonitor.left, monInfo.rcMonitor.top,
217 SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREPOSITION | SWP_NOZORDER))
223 WindowStyle = WS_POPUP | WS_SYSMENU | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
226 AdjustWindowRectEx(&WindowRect, WindowStyle,
FALSE, 0);
228 SetWindowLong(
sww_state.
hWnd, GWL_STYLE, WindowStyle | WS_VISIBLE);
271 const unsigned char *pal = _pal;
272 LOGPALETTE *pLogPal = ( LOGPALETTE * ) &
s_ipal;
283 for (
i = 0;
i < 256;
i++, pal += 4 )
285 colors[
i].rgbRed = pal[0];
286 colors[
i].rgbGreen = pal[1];
287 colors[
i].rgbBlue = pal[2];
288 colors[
i].rgbReserved = 0;
291 colors[0].rgbRed = 0;
292 colors[0].rgbGreen = 0;
293 colors[0].rgbBlue = 0;
295 colors[255].rgbRed = 0xff;
296 colors[255].rgbGreen = 0xff;
297 colors[255].rgbBlue = 0xff;
314 if ( SetSystemPaletteUse( hDC, SYSPAL_NOSTATIC ) == SYSPAL_ERROR )
332 pLogPal->palVersion = 0x300;
333 pLogPal->palNumEntries = 256;
335 for (
i = 0, pal = _pal;
i < 256;
i++, pal += 4 )
337 pLogPal->palPalEntry[
i].peRed = pal[0];
338 pLogPal->palPalEntry[
i].peGreen = pal[1];
339 pLogPal->palPalEntry[
i].peBlue = pal[2];
340 pLogPal->palPalEntry[
i].peFlags = PC_RESERVED | PC_NOCOLLAPSE;
342 pLogPal->palPalEntry[0].peRed = 0;
343 pLogPal->palPalEntry[0].peGreen = 0;
344 pLogPal->palPalEntry[0].peBlue = 0;
345 pLogPal->palPalEntry[0].peFlags = 0;
346 pLogPal->palPalEntry[255].peRed = 0xff;
347 pLogPal->palPalEntry[255].peGreen = 0xff;
348 pLogPal->palPalEntry[255].peBlue = 0xff;
349 pLogPal->palPalEntry[255].peFlags = 0;
364 if ( ( ret = RealizePalette( hDC ) ) != pLogPal->palNumEntries )