26 #include "../../common/common.h"
45 vinfo.dwOSVersionInfoSize =
sizeof(vinfo);
47 if (!GetVersionEx(&vinfo))
50 char const* detected =
"win";
51 if (vinfo.dwMajorVersion < 4)
52 Sys_Error(
"UFO: AI requires windows version 4 or greater");
53 if (vinfo.dwPlatformId == VER_PLATFORM_WIN32s)
54 Sys_Error(
"UFO: AI doesn't run on Win32s");
55 else if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
57 else if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) {
58 if (vinfo.dwMajorVersion == 5 && vinfo.dwMinorVersion == 0)
60 else if (vinfo.dwMajorVersion == 5)
62 else if (vinfo.dwMajorVersion == 6)
63 detected =
"winVista";
69 GlobalMemoryStatus(&mem);
70 Com_Printf(
"Memory: %u MB\n", mem.dwTotalPhys >> 20);
76 char curDir[MAX_PATH];
78 GetModuleFileName(
nullptr, curDir,
sizeof(curDir)-1);
80 char* p = strrchr(curDir,
'\\');
84 Sys_Error(
"Current path is too long. Please move your installation to a shorter path.");
86 SetCurrentDirectory(curDir);
90 int main(
int argc,
char *argv[])
92 int WINAPI
WinMain (HINSTANCE hInstance, HINSTANCE, LPSTR,
int)
void Qcommon_Frame(void)
This is the function that is called directly from main()
void Qcommon_Init(int argc, char **argv)
Init function.
void Sys_Error(const char *error,...)
void Sys_ConsoleInit(void)
Initialize the console input (tty mode if possible)
int main(int argc, char **argv)
The entry point for linux server and client. Initializes the program and calls Qcommon_Frame in an in...
void Com_Printf(const char *const fmt,...)
static void FixWorkingDirectory(void)
HINSTANCE global_hInstance
Win32-specific UFO header file.
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags, const char *desc)
Init or return a cvar.
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)