added windows version detection back from original sources

with extra bits from uhexen2. we may use the information some
day.. (or not..)


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@354 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-12-30 17:00:19 +00:00
parent 165598051c
commit 94767a4e6d
2 changed files with 33 additions and 1 deletions

View File

@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
qboolean isDedicated;
qboolean Win95, Win95old, WinNT, WinVista;
static HANDLE hinput, houtput;
@ -145,6 +146,37 @@ int Sys_FileTime (const char *path)
void Sys_Init (void)
{
OSVERSIONINFO vinfo;
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
if (!GetVersionEx (&vinfo))
Sys_Error ("Couldn't get OS info");
if ((vinfo.dwMajorVersion < 4) ||
(vinfo.dwPlatformId == VER_PLATFORM_WIN32s))
{
Sys_Error ("QuakeSpasm requires at least Win95 or NT 4.0");
}
if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
{
WinNT = true;
if (vinfo.dwMajorVersion >= 6)
WinVista = true;
}
else
{
WinNT = false; /* Win9x or WinME */
if ((vinfo.dwMajorVersion == 4) && (vinfo.dwMinorVersion == 0))
{
Win95 = true;
/* Win95-gold or Win95A can't switch bpp automatically */
if (vinfo.szCSDVersion[1] != 'C' && vinfo.szCSDVersion[1] != 'B')
Win95old = true;
}
}
if (isDedicated)
{
if (!AllocConsole ())

View File

@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WM_MOUSEWHEEL 0x020A
#endif
extern qboolean WinNT;
extern qboolean Win95, Win95old, WinNT, WinVista;
extern HINSTANCE global_hInstance;
extern int global_nCmdShow;