Minor cleanup (dibwindow) and some cosmetic changes :)

This commit is contained in:
Dabb 2000-12-20 16:42:51 +00:00
parent f4c300676f
commit 4822383a94

View file

@ -112,7 +112,7 @@ int DIBWidth, DIBHeight;
RECT WindowRect; RECT WindowRect;
DWORD WindowStyle, ExWindowStyle; DWORD WindowStyle, ExWindowStyle;
HWND mainwindow, dibwindow; HWND mainwindow;
int vid_modenum = NO_MODE; int vid_modenum = NO_MODE;
int vid_realmode; int vid_realmode;
@ -252,23 +252,23 @@ VID_SetWindowedMode (int modenum)
height = rect.bottom - rect.top; height = rect.bottom - rect.top;
// Create the DIB window // Create the DIB window
dibwindow = CreateWindowEx (ExWindowStyle, mainwindow = CreateWindowEx (ExWindowStyle,
"WinQuake", "QuakeForge",
"GLQuake", "GLQuakeWorld",
WindowStyle, WindowStyle,
rect.left, rect.top, rect.left, rect.top,
width, width,
height, NULL, NULL, global_hInstance, NULL); height, NULL, NULL, global_hInstance, NULL);
if (!dibwindow) if (!mainwindow)
Sys_Error ("Couldn't create DIB window"); Sys_Error ("Couldn't create DIB window");
// Center and show the DIB window // Center and show the DIB window
CenterWindow (dibwindow, WindowRect.right - WindowRect.left, CenterWindow (mainwindow, WindowRect.right - WindowRect.left,
WindowRect.bottom - WindowRect.top, false); WindowRect.bottom - WindowRect.top, false);
ShowWindow (dibwindow, SW_SHOWDEFAULT); ShowWindow (mainwindow, SW_SHOWDEFAULT);
UpdateWindow (dibwindow); UpdateWindow (mainwindow);
modestate = MS_WINDOWED; modestate = MS_WINDOWED;
@ -276,9 +276,9 @@ VID_SetWindowedMode (int modenum)
// (to avoid flickering when re-sizing the window on the desktop), // (to avoid flickering when re-sizing the window on the desktop),
// we clear the window to black when created, otherwise it will be // we clear the window to black when created, otherwise it will be
// empty while Quake starts up. // empty while Quake starts up.
hdc = GetDC (dibwindow); hdc = GetDC (mainwindow);
PatBlt (hdc, 0, 0, WindowRect.right, WindowRect.bottom, BLACKNESS); PatBlt (hdc, 0, 0, WindowRect.right, WindowRect.bottom, BLACKNESS);
ReleaseDC (dibwindow, hdc); ReleaseDC (mainwindow, hdc);
if (vid.conheight > modelist[modenum].height) if (vid.conheight > modelist[modenum].height)
vid.conheight = modelist[modenum].height; vid.conheight = modelist[modenum].height;
@ -289,8 +289,6 @@ VID_SetWindowedMode (int modenum)
vid.numpages = 2; vid.numpages = 2;
mainwindow = dibwindow;
SendMessage (mainwindow, WM_SETICON, (WPARAM) TRUE, (LPARAM) hIcon); SendMessage (mainwindow, WM_SETICON, (WPARAM) TRUE, (LPARAM) hIcon);
SendMessage (mainwindow, WM_SETICON, (WPARAM) FALSE, (LPARAM) hIcon); SendMessage (mainwindow, WM_SETICON, (WPARAM) FALSE, (LPARAM) hIcon);
@ -339,27 +337,27 @@ VID_SetFullDIBMode (int modenum)
height = rect.bottom - rect.top; height = rect.bottom - rect.top;
// Create the DIB window // Create the DIB window
dibwindow = CreateWindowEx (ExWindowStyle, mainwindow = CreateWindowEx (ExWindowStyle,
"WinQuake", "QuakeForge",
"GLQuake", "GLQuakeWorld",
WindowStyle, WindowStyle,
rect.left, rect.top, rect.left, rect.top,
width, width,
height, NULL, NULL, global_hInstance, NULL); height, NULL, NULL, global_hInstance, NULL);
if (!dibwindow) if (!mainwindow)
Sys_Error ("Couldn't create DIB window"); Sys_Error ("Couldn't create DIB window");
ShowWindow (dibwindow, SW_SHOWDEFAULT); ShowWindow (mainwindow, SW_SHOWDEFAULT);
UpdateWindow (dibwindow); UpdateWindow (mainwindow);
// 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 while Quake starts up. // empty while Quake starts up.
hdc = GetDC (dibwindow); hdc = GetDC (mainwindow);
PatBlt (hdc, 0, 0, WindowRect.right, WindowRect.bottom, BLACKNESS); PatBlt (hdc, 0, 0, WindowRect.right, WindowRect.bottom, BLACKNESS);
ReleaseDC (dibwindow, hdc); ReleaseDC (mainwindow, hdc);
if (vid.conheight > modelist[modenum].height) if (vid.conheight > modelist[modenum].height)
vid.conheight = modelist[modenum].height; vid.conheight = modelist[modenum].height;
@ -374,8 +372,6 @@ VID_SetFullDIBMode (int modenum)
window_x = 0; window_x = 0;
window_y = 0; window_y = 0;
mainwindow = dibwindow;
SendMessage (mainwindow, WM_SETICON, (WPARAM) TRUE, (LPARAM) hIcon); SendMessage (mainwindow, WM_SETICON, (WPARAM) TRUE, (LPARAM) hIcon);
SendMessage (mainwindow, WM_SETICON, (WPARAM) FALSE, (LPARAM) hIcon); SendMessage (mainwindow, WM_SETICON, (WPARAM) FALSE, (LPARAM) hIcon);
@ -808,14 +804,14 @@ VID_Shutdown (void)
if (hRC) if (hRC)
wglDeleteContext (hRC); wglDeleteContext (hRC);
if (hDC && dibwindow) if (hDC && mainwindow)
ReleaseDC (dibwindow, hDC); ReleaseDC (mainwindow, hDC);
if (modestate == MS_FULLDIB) if (modestate == MS_FULLDIB)
ChangeDisplaySettings (NULL, 0); ChangeDisplaySettings (NULL, 0);
if (maindc && dibwindow) if (maindc && mainwindow)
ReleaseDC (dibwindow, maindc); ReleaseDC (mainwindow, maindc);
AppActivate (false, false); AppActivate (false, false);
} }
@ -1126,8 +1122,8 @@ MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY: case WM_DESTROY:
{ {
if (dibwindow) if (mainwindow)
DestroyWindow (dibwindow); DestroyWindow (mainwindow);
PostQuitMessage (0); PostQuitMessage (0);
} }
@ -1327,7 +1323,7 @@ VID_InitDIB (HINSTANCE hInstance)
wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hCursor = LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = NULL; wc.hbrBackground = NULL;
wc.lpszMenuName = 0; wc.lpszMenuName = 0;
wc.lpszClassName = "WinQuake"; wc.lpszClassName = "QuakeForge";
if (!RegisterClass (&wc)) if (!RegisterClass (&wc))
Sys_Error ("Couldn't register window class"); Sys_Error ("Couldn't register window class");