]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_win.c
build number 101
[xonotic/darkplaces.git] / sys_win.c
index 574926260bc87247ccbab7611e68f4cd52376590..a7f21401318f46288313024988d98f267096b0b6 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -26,11 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "conproc.h"
 #include "direct.h"
 
-// LordHavoc: raised min to 64mb (was 8.5mb)
-#define MINIMUM_WIN_MEMORY             0x04000000
-// LordHavoc: raised max to 64mb (was 16mb)
-#define MAXIMUM_WIN_MEMORY             0x04000000
-
 #define CONSOLE_ERROR_TIMEOUT  60.0    // # of seconds to wait on Sys_Error running
                                                                                //  dedicated before exiting
 #define PAUSE_SLEEP            50                              // sleep time on pause or minimization
@@ -192,21 +187,15 @@ int Sys_FileWrite (int handle, void *data, int count)
 int    Sys_FileTime (char *path)
 {
        FILE    *f;
-       int             retval;
-
+       
        f = fopen(path, "rb");
-
        if (f)
        {
                fclose(f);
-               retval = 1;
-       }
-       else
-       {
-               retval = -1;
+               return 1;
        }
        
-       return retval;
+       return -1;
 }
 
 void Sys_mkdir (char *path)
@@ -223,6 +212,7 @@ SYSTEM IO
 ===============================================================================
 */
 
+#if NOTUSED
 /*
 ================
 Sys_MakeCodeWriteable
@@ -235,6 +225,7 @@ void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length)
        if (!VirtualProtect((LPVOID)startaddr, length, PAGE_READWRITE, &flOldProtect))
                Sys_Error("Protection change failed\n");
 }
+#endif
 
 
 /*
@@ -617,7 +608,7 @@ WinMain
 void SleepUntilInput (int time)
 {
 
-       MsgWaitForMultipleObjects(1, &tevent, FALSE, time, QS_ALLINPUT);
+       MsgWaitForMultipleObjects(1, &tevent, false, time, QS_ALLINPUT);
 }
 
 
@@ -654,8 +645,9 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
        if (cwd[strlen(cwd)-1] == '/')
                cwd[strlen(cwd)-1] = 0;
 
+       memset(&host_parms, 0, sizeof(host_parms));
+
        host_parms.basedir = cwd;
-       host_parms.cachedir = NULL;
 
        host_parms.argc = 1;
        argv[0] = empty_string;
@@ -694,6 +686,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
 // take the greater of all the available memory or half the total memory,
 // but at least 8 Mb and no more than 16 Mb, unless they explicitly
 // request otherwise
+       /*
        host_parms.memsize = lpBuffer.dwAvailPhys;
 
        if (host_parms.memsize < MINIMUM_WIN_MEMORY)
@@ -704,28 +697,11 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
 
        if (host_parms.memsize > MAXIMUM_WIN_MEMORY)
                host_parms.memsize = MAXIMUM_WIN_MEMORY;
-
-       if ((t = COM_CheckParm("-heapsize")))
-       {
-               t++;
-               if (t < com_argc)
-                       host_parms.memsize = atoi (com_argv[t]) * 1024;
-       }
-       else if ((t = COM_CheckParm("-mem")) || (t = COM_CheckParm("-winmem")))
-       {
-               t++;
-               if (t < com_argc)
-                       host_parms.memsize = atoi (com_argv[t]) * 1048576;
-       }
-
-       host_parms.membase = qmalloc(host_parms.memsize);
-
-       if (!host_parms.membase)
-               Sys_Error ("Not enough memory free; check disk space\n");
+       */
 
 //     Sys_PageIn (parms.membase, parms.memsize);
 
-       tevent = CreateEvent(NULL, FALSE, FALSE, NULL);
+       tevent = CreateEvent(NULL, false, false, NULL);
 
        if (!tevent)
                Sys_Error ("Couldn't create event");
@@ -823,6 +799,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
        }
 
     /* return success of application */
-    return TRUE;
+    return true;
 }