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