Whitespace.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2004-01-06 03:38:48 +00:00
parent 067080296c
commit a87fc16d12

View file

@ -86,8 +86,8 @@ static BOOL (GLAPIENTRY *qf_wglMakeCurrent) (HDC, HGLRC);
#define MODE_FULLSCREEN_DEFAULT (MODE_WINDOWED + 1)
static int windowed_mouse;
static HICON hIcon;
static HICON hIcon;
static RECT WindowRect;
static DWORD WindowStyle;
@ -95,10 +95,11 @@ static qboolean fullsbardraw = true;
static HDC maindc;
static void GL_Init (void);
static void GL_Init (void);
static void * (WINAPI *glGetProcAddress) (const char *symbol) = NULL;
void *
QFGL_GetProcAddress (void *handle, const char *name)
{
@ -122,11 +123,8 @@ QFGL_LoadLibrary (void)
return handle;
}
//====================================
static void
CenterWindow (HWND hWndCenter, int width, int height, BOOL lefttopjustify)
{
@ -159,7 +157,7 @@ VID_SetWindowedMode ( void )
height = rect.bottom - rect.top;
// Create the window
mainwindow = CreateWindow ("QuakeForge", "GLQuakeWorld",
mainwindow = CreateWindow ("QuakeForge", PROGRAM,
WindowStyle, rect.left, rect.top, width, height,
NULL, NULL, global_hInstance, NULL);
@ -200,15 +198,16 @@ VID_SetFullDIBMode ( void )
int width, height;
RECT rect;
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
if (ChangeDisplaySettings (&win_gdevmode, CDS_FULLSCREEN)
!= DISP_CHANGE_SUCCESSFUL)
Sys_Error ("Couldn't set fullscreen DIB mode (%lx)", GetLastError());
// FIXME: some drivers have broken FS popup window handling
// until I find way around it, or find some other cause for it
// this is way to avoid it
if (COM_CheckParm ("-brokenpopup")) WindowStyle = 0;
else WindowStyle = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
// FIXME: some drivers have broken FS popup window handling until I find a
// way around it, or find some other cause for it this is a way to avoid it
if (COM_CheckParm ("-brokenpopup"))
WindowStyle = 0;
else
WindowStyle = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
rect = WindowRect;
AdjustWindowRect (&rect, WindowStyle, FALSE);
@ -217,8 +216,8 @@ VID_SetFullDIBMode ( void )
height = rect.bottom - rect.top;
// Create the DIB window
mainwindow = CreateWindow ("QuakeForge", "GLQuakeWorld",
WindowStyle, rect.left, rect.top, width, height, NULL, NULL,
mainwindow = CreateWindow ("QuakeForge", "GLQuakeWorld", WindowStyle,
rect.left, rect.top, width, height, NULL, NULL,
global_hInstance, NULL);
if (!mainwindow)
@ -229,8 +228,8 @@ VID_SetFullDIBMode ( void )
// Because we have set the background brush for the window to NULL
// (to avoid flickering when re-sizing the window on the desktop), we
// clear the window to black when created, otherwise it will be
// empty while Quake starts up.
// clear the window to black when created, otherwise it will be empty
// while Quake starts up.
hdc = GetDC (mainwindow);
PatBlt (hdc, 0, 0, WindowRect.right, WindowRect.bottom, BLACKNESS);
ReleaseDC (mainwindow, hdc);
@ -256,7 +255,6 @@ VID_SetMode (unsigned char *palette)
MSG msg;
// so Con_Printfs don't mess us up by forcing vid and snd updates
CDAudio_Pause ();
WindowRect.top = WindowRect.left = 0;
@ -317,7 +315,8 @@ VID_SetMode (unsigned char *palette)
// fix the leftover Alt from any Alt-Tab or the like that switched us away
IN_ClearStates ();
Con_Printf ("Video mode %ix%i initialized.\n",vid_width->int_val, vid_height->int_val);
Con_Printf ("Video mode %ix%i initialized.\n", vid_width->int_val,
vid_height->int_val);
VID_SetPalette (palette);
@ -460,8 +459,7 @@ VID_Init (unsigned char *palette)
WNDCLASS wc;
vid_fullscreen = Cvar_Get ("vid_fullscreen", "0", CVAR_ROM | CVAR_ARCHIVE,
NULL,
"Run WGL client at fullscreen");
NULL, "Run WGL client at fullscreen");
GL_Pre_Init ();
qf_wglCreateContext = QFGL_ProcAddress (libgl_handle, "wglCreateContext",
@ -480,7 +478,6 @@ VID_Init (unsigned char *palette)
hIcon = LoadIcon (global_hInstance, MAKEINTRESOURCE (IDI_ICON1));
// Register the frame class
wc.style = 0;
wc.lpfnWndProc = (WNDPROC) MainWndProc;
@ -506,7 +503,6 @@ VID_Init (unsigned char *palette)
}
ReleaseDC (NULL, hdc);
} else {
if (COM_CheckParm ("-bpp")) {
bpp = atoi (com_argv[COM_CheckParm ("-bpp") + 1]);
@ -517,12 +513,15 @@ VID_Init (unsigned char *palette)
do {
stat = EnumDisplaySettings (NULL, vid_mode, &win_gdevmode);
if ((win_gdevmode.dmBitsPerPel == bpp) && (win_gdevmode.dmPelsWidth == vid.width) &&
(win_gdevmode.dmPelsHeight == vid.height)) {
win_gdevmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
if ((win_gdevmode.dmBitsPerPel == bpp)
&& (win_gdevmode.dmPelsWidth == vid.width)
&& (win_gdevmode.dmPelsHeight == vid.height)) {
win_gdevmode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH
| DM_PELSHEIGHT);
if (ChangeDisplaySettings (&win_gdevmode, CDS_TEST | CDS_FULLSCREEN) ==
DISP_CHANGE_SUCCESSFUL) {
if (ChangeDisplaySettings (&win_gdevmode,
CDS_TEST | CDS_FULLSCREEN)
== DISP_CHANGE_SUCCESSFUL) {
break;
}
}
@ -530,7 +529,8 @@ VID_Init (unsigned char *palette)
vid_mode++;
} while (stat);
if (!stat)
Sys_Error("Couldn't get requested resolution (%i, %i, %i)",vid_width->int_val, vid_height->int_val, bpp);
Sys_Error ("Couldn't get requested resolution (%i, %i, %i)",
vid_width->int_val, vid_height->int_val, bpp);
}
vid.maxwarpwidth = WARP_WIDTH;
@ -555,9 +555,10 @@ VID_Init (unsigned char *palette)
lasterror=GetLastError();
if (maindc && mainwindow)
ReleaseDC (mainwindow, maindc);
Sys_Error("Could not initialize GL (wglCreateContext failed).\n\nMake "
"sure you in are 65535 color mode, and try running -window. "
"\nError code: (%lx)", lasterror);
Sys_Error ("Could not initialize GL (wglCreateContext failed).\n\n"
"Make sure you are in 65535 color mode, and try running "
"with -window.\n"
"Error code: (%lx)", lasterror);
}
if (!qf_wglMakeCurrent (maindc, baseRC)) {
@ -620,6 +621,7 @@ VID_SetGamma (double gamma)
ReleaseDC (NULL, hdc);
return i;
}
#if 0
static void
VID_SaveGamma (void)