diff --git a/CMakeLists.txt b/CMakeLists.txt index 202501be..3c82312a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,13 +184,10 @@ set(Backends-Unix-Source ${BACKENDS_SRC_DIR}/unix/shared/hunk.c ) -set(Backends-Unix-Header - ${BACKENDS_SRC_DIR}/unix/header/unix.h - ) - set(Backends-Windows-Source ${BACKENDS_SRC_DIR}/generic/frame.c ${BACKENDS_SRC_DIR}/windows/icon.rc + ${BACKENDS_SRC_DIR}/windows/main.c ${BACKENDS_SRC_DIR}/windows/network.c ${BACKENDS_SRC_DIR}/windows/system.c ${BACKENDS_SRC_DIR}/windows/shared/mem.c @@ -213,7 +210,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(Platform-Specific-Source ${Backends-Windows-Source} ${Backends-Windows-Header}) set(REF-Platform-Specific-Source ${REF-Windows-Source}) else() - set(Platform-Specific-Source ${Backends-Unix-Source} ${Backends-Unix-Header}) + set(Platform-Specific-Source ${Backends-Unix-Source}) set(REF-Platform-Specific-Source ${REF-Unix-Source}) endif() diff --git a/Makefile b/Makefile index be0f4873..234a0fcb 100755 --- a/Makefile +++ b/Makefile @@ -863,6 +863,7 @@ CLIENT_OBJS_ := \ ifeq ($(YQ2_OSTYPE), Windows) CLIENT_OBJS_ += \ + src/backends/windows/main.o \ src/backends/windows/network.o \ src/backends/windows/system.o \ src/backends/windows/shared/mem.o @@ -1010,6 +1011,7 @@ SERVER_OBJS_ := \ ifeq ($(YQ2_OSTYPE), Windows) SERVER_OBJS_ += \ + src/backends/windows/main.o \ src/backends/windows/network.o \ src/backends/windows/system.o \ src/backends/windows/shared/mem.o diff --git a/src/backends/unix/main.c b/src/backends/unix/main.c index ca5e1455..9a294bdd 100644 --- a/src/backends/unix/main.c +++ b/src/backends/unix/main.c @@ -19,44 +19,32 @@ * * ======================================================================= * - * This file is the starting point of the program and implements - * the main loop + * This file is the starting point of the program. It does some platform + * specific initialization stuff and calls the common initialization code. * * ======================================================================= */ #include -#include -#include #include #include "../../common/header/common.h" -#include "header/unix.h" + +void registerHandler(void); qboolean is_portable; int main(int argc, char **argv) { - int verLen, i; - long long oldtime, newtime; - const char* versionString; - - // Time slept each frame. -#ifndef DEDICATED_ONLY - struct timespec t = {0, 5000}; -#else - struct timespec t = {0, 850000}; -#endif - - /* register signal handler */ + // register signal handler registerHandler(); - /* Setup FPU if necessary */ + // Setup FPU if necessary Sys_SetupFPU(); - /* Are we portable? */ - for (i = 0; i < argc; i++) { + // Are we portable? + for (int i = 0; i < argc; i++) { if (strcmp(argv[i], "-portable") == 0) { is_portable = true; } @@ -73,8 +61,7 @@ main(int argc, char **argv) return 1; } - /* Enforce the real UID to - prevent setuid crap */ + // Enforce the real UID to prevent setuid crap if (getuid() != geteuid()) { printf("The effective UID is not the real UID! Your binary is probably marked\n"); @@ -85,73 +72,15 @@ main(int argc, char **argv) return 1; } - /* enforce C locale */ + // enforce C locale setenv("LC_ALL", "C", 1); - versionString = va("Yamagi Quake II v%s", YQ2VERSION); - verLen = strlen(versionString); - - printf("\n%s\n", versionString); - for(i=0; i