diff --git a/code/win32/glw_win.h b/code/win32/glw_win.h
deleted file mode 100644
index e58c1c0..0000000
--- a/code/win32/glw_win.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-===========================================================================
-Copyright (C) 1999-2005 Id Software, Inc.
-
-This file is part of Quake III Arena source code.
-
-Quake III Arena source code is free software; you can redistribute it
-and/or modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the License,
-or (at your option) any later version.
-
-Quake III Arena source code is distributed in the hope that it will be
-useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Quake III Arena source code; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-===========================================================================
-*/
-#ifndef _WIN32
-# error You should not be including this file on this platform
-#endif
-
-#ifndef __GLW_WIN_H__
-#define __GLW_WIN_H__
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-typedef struct {
- // @TODO: move this crap out of this file and nuke the file
- qbool cdsDevModeValid;
- DEVMODE cdsDevMode; // Custom device mode for full-screen with r_mode 1.
-} glwstate_t;
-
-extern glwstate_t glw_state;
-
-#if defined(__cplusplus)
-};
-#endif
-
-#endif
diff --git a/code/win32/win_exception.cpp b/code/win32/win_exception.cpp
index 8ea4feb..31ad88a 100644
--- a/code/win32/win_exception.cpp
+++ b/code/win32/win_exception.cpp
@@ -27,7 +27,6 @@ along with Challenge Quake 3. If not, see .
#include "../client/client.h"
#endif
#include "win_local.h"
-#include "glw_win.h"
#include
#include
@@ -543,8 +542,8 @@ static LONG WIN_HandleCrash( EXCEPTION_POINTERS* ep )
#ifndef DEDICATED
__try {
- wasDevModeValid = glw_state.cdsDevModeValid;
- if (glw_state.cdsDevModeValid)
+ wasDevModeValid = g_wv.cdsDevModeValid;
+ if (g_wv.cdsDevModeValid)
WIN_SetDesktopDisplaySettings();
} __except (EXCEPTION_EXECUTE_HANDLER) {}
diff --git a/code/win32/win_glimp.cpp b/code/win32/win_glimp.cpp
index c8ebb5f..c7dbf27 100644
--- a/code/win32/win_glimp.cpp
+++ b/code/win32/win_glimp.cpp
@@ -43,10 +43,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../client/client.h"
#include "resource.h"
#include "win_local.h"
-#include "glw_win.h"
-
-
-glwstate_t glw_state;
// responsible for creating the Win32 window and initializing the OpenGL driver.
@@ -218,13 +214,13 @@ static qbool GLW_SetDisplaySettings( DEVMODE& dm )
const int ec = ChangeDisplaySettingsExA( deviceName, &dm, NULL, CDS_FULLSCREEN, NULL );
if ( ec == DISP_CHANGE_SUCCESSFUL )
{
- glw_state.cdsDevMode = dm;
- glw_state.cdsDevModeValid = qtrue;
+ g_wv.cdsDevMode = dm;
+ g_wv.cdsDevModeValid = qtrue;
GLW_UpdateMonitorRect( deviceName );
return qtrue;
}
- glw_state.cdsDevModeValid = qfalse;
+ g_wv.cdsDevModeValid = qfalse;
ri.Printf( PRINT_ALL, "...CDS: %ix%i (C%i) failed: ", (int)dm.dmPelsWidth, (int)dm.dmPelsHeight, (int)dm.dmBitsPerPel );
@@ -252,20 +248,20 @@ static void GLW_ResetDisplaySettings( qbool invalidate )
ChangeDisplaySettingsEx( deviceName, NULL, NULL, 0, NULL );
GLW_UpdateMonitorRect( deviceName );
if ( invalidate )
- glw_state.cdsDevModeValid = qfalse;
+ g_wv.cdsDevModeValid = qfalse;
}
void WIN_SetGameDisplaySettings()
{
- if ( glw_state.cdsDevModeValid )
- GLW_SetDisplaySettings( glw_state.cdsDevMode );
+ if ( g_wv.cdsDevModeValid )
+ GLW_SetDisplaySettings( g_wv.cdsDevMode );
}
void WIN_SetDesktopDisplaySettings()
{
- // We don't invalidate glw_state.cdsDevModeValid so we can
+ // We don't invalidate g_wv.cdsDevModeValid so we can
// return to the previous mode later.
GLW_ResetDisplaySettings( qfalse );
}
@@ -285,7 +281,7 @@ static qbool GLW_SetMode()
ZeroMemory( &dm, sizeof( dm ) );
dm.dmSize = sizeof( dm );
- if (glInfo.vidFullscreen != glw_state.cdsDevModeValid) {
+ if (glInfo.vidFullscreen != g_wv.cdsDevModeValid) {
if (glInfo.vidFullscreen) {
dm.dmPelsWidth = glConfig.vidWidth;
dm.dmPelsHeight = glConfig.vidHeight;
@@ -347,7 +343,7 @@ void Sys_V_Shutdown()
}
// reset display settings
- if ( glw_state.cdsDevModeValid )
+ if ( g_wv.cdsDevModeValid )
{
ri.Printf( PRINT_DEVELOPER, "...resetting display\n" );
GLW_ResetDisplaySettings( qtrue );
diff --git a/code/win32/win_local.h b/code/win32/win_local.h
index c8c3888..006a386 100644
--- a/code/win32/win_local.h
+++ b/code/win32/win_local.h
@@ -84,6 +84,9 @@ typedef struct {
qbool inputInitialized;
qbool forceUnmute; // overrides s_autoMute
+
+ DEVMODE cdsDevMode; // custom device mode for full-screen with r_mode 1
+ qbool cdsDevModeValid;
} WinVars_t;
extern WinVars_t g_wv;
diff --git a/code/win32/win_wndproc.cpp b/code/win32/win_wndproc.cpp
index 93e3992..531d619 100644
--- a/code/win32/win_wndproc.cpp
+++ b/code/win32/win_wndproc.cpp
@@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../client/client.h"
#include "win_local.h"
-#include "glw_win.h"
// Console variables that we need to access from this module
@@ -303,13 +302,13 @@ LRESULT CALLBACK MainWndProc (
break;
case WM_SETFOCUS:
- if ( glw_state.cdsDevModeValid ) // is there a valid mode to restore?
+ if ( g_wv.cdsDevModeValid ) // is there a valid mode to restore?
{
WIN_SetGameDisplaySettings();
- if ( glw_state.cdsDevModeValid ) // was the mode successfully restored?
+ if ( g_wv.cdsDevModeValid ) // was the mode successfully restored?
{
const RECT& rect = g_wv.monitorRects[g_wv.monitor];
- const DEVMODE& dm = glw_state.cdsDevMode;
+ const DEVMODE& dm = g_wv.cdsDevMode;
SetWindowPos( hWnd, NULL, (int)rect.left, (int)rect.top, (int)dm.dmPelsWidth, (int)dm.dmPelsHeight, SWP_NOZORDER );
}
}
@@ -319,7 +318,7 @@ LRESULT CALLBACK MainWndProc (
case WM_KILLFOCUS:
g_wv.activeApp = qfalse;
- if ( glw_state.cdsDevModeValid )
+ if ( g_wv.cdsDevModeValid )
WIN_SetDesktopDisplaySettings();
break;
diff --git a/makefiles/windows_vs2019/cnq3-server.vcxproj b/makefiles/windows_vs2019/cnq3-server.vcxproj
index 7588d01..4410e5d 100644
--- a/makefiles/windows_vs2019/cnq3-server.vcxproj
+++ b/makefiles/windows_vs2019/cnq3-server.vcxproj
@@ -187,7 +187,6 @@ copy "..\..\.bin\release\cnq3-server.pdb" "$(QUAKE3DIR)"
-
diff --git a/makefiles/windows_vs2019/cnq3-server.vcxproj.filters b/makefiles/windows_vs2019/cnq3-server.vcxproj.filters
index 0b2e311..76d086e 100644
--- a/makefiles/windows_vs2019/cnq3-server.vcxproj.filters
+++ b/makefiles/windows_vs2019/cnq3-server.vcxproj.filters
@@ -204,9 +204,6 @@
server
-
- win32
-
win32
diff --git a/makefiles/windows_vs2019/cnq3.vcxproj b/makefiles/windows_vs2019/cnq3.vcxproj
index 6da7952..4200258 100644
--- a/makefiles/windows_vs2019/cnq3.vcxproj
+++ b/makefiles/windows_vs2019/cnq3.vcxproj
@@ -210,7 +210,6 @@ copy "..\..\.bin\release\cnq3.pdb" "$(QUAKE3DIR)"
-
diff --git a/makefiles/windows_vs2019/cnq3.vcxproj.filters b/makefiles/windows_vs2019/cnq3.vcxproj.filters
index b032d43..77648ff 100644
--- a/makefiles/windows_vs2019/cnq3.vcxproj.filters
+++ b/makefiles/windows_vs2019/cnq3.vcxproj.filters
@@ -276,9 +276,6 @@
server
-
- win32
-
win32
diff --git a/makefiles/windows_vs2022/cnq3-server.vcxproj b/makefiles/windows_vs2022/cnq3-server.vcxproj
index 2c1bf2d..4fcd659 100644
--- a/makefiles/windows_vs2022/cnq3-server.vcxproj
+++ b/makefiles/windows_vs2022/cnq3-server.vcxproj
@@ -189,7 +189,6 @@ copy "..\..\.bin\release\cnq3-server.pdb" "$(QUAKE3DIR)"
-
diff --git a/makefiles/windows_vs2022/cnq3-server.vcxproj.filters b/makefiles/windows_vs2022/cnq3-server.vcxproj.filters
index 0b2e311..76d086e 100644
--- a/makefiles/windows_vs2022/cnq3-server.vcxproj.filters
+++ b/makefiles/windows_vs2022/cnq3-server.vcxproj.filters
@@ -204,9 +204,6 @@
server
-
- win32
-
win32
diff --git a/makefiles/windows_vs2022/cnq3.vcxproj b/makefiles/windows_vs2022/cnq3.vcxproj
index 564cd50..b601734 100644
--- a/makefiles/windows_vs2022/cnq3.vcxproj
+++ b/makefiles/windows_vs2022/cnq3.vcxproj
@@ -212,7 +212,6 @@ copy "..\..\.bin\release\cnq3.pdb" "$(QUAKE3DIR)"
-
diff --git a/makefiles/windows_vs2022/cnq3.vcxproj.filters b/makefiles/windows_vs2022/cnq3.vcxproj.filters
index b032d43..77648ff 100644
--- a/makefiles/windows_vs2022/cnq3.vcxproj.filters
+++ b/makefiles/windows_vs2022/cnq3.vcxproj.filters
@@ -276,9 +276,6 @@
server
-
- win32
-
win32