]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sys_win.c
Linux GLX, a lot of code shrinkage/cleanup, assembly support.
[xonotic/darkplaces.git] / sys_win.c
index d87240bd83ce164b61fbcbbabebff84b92bac968..ead6e3434df998c6916b1443ac27ea89b7131c8d 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -121,17 +121,12 @@ int filelength (FILE *f)
 {
        int             pos;
        int             end;
-       int             t;
-
-       t = VID_ForceUnlockedAndReturnState ();
 
        pos = ftell (f);
        fseek (f, 0, SEEK_END);
        end = ftell (f);
        fseek (f, pos, SEEK_SET);
 
-       VID_ForceLockState (t);
-
        return end;
 }
 
@@ -139,9 +134,6 @@ int Sys_FileOpenRead (char *path, int *hndl)
 {
        FILE    *f;
        int             i, retval;
-       int             t;
-
-       t = VID_ForceUnlockedAndReturnState ();
 
        i = findhandle ();
 
@@ -159,8 +151,6 @@ int Sys_FileOpenRead (char *path, int *hndl)
                retval = filelength(f);
        }
 
-       VID_ForceLockState (t);
-
        return retval;
 }
 
@@ -168,10 +158,7 @@ int Sys_FileOpenWrite (char *path)
 {
        FILE    *f;
        int             i;
-       int             t;
 
-       t = VID_ForceUnlockedAndReturnState ();
-       
        i = findhandle ();
 
        f = fopen(path, "wb");
@@ -179,57 +166,35 @@ int Sys_FileOpenWrite (char *path)
                Host_Error ("Error opening %s: %s", path,strerror(errno));
        sys_handles[i] = f;
        
-       VID_ForceLockState (t);
-
        return i;
 }
 
 void Sys_FileClose (int handle)
 {
-       int             t;
-
-       t = VID_ForceUnlockedAndReturnState ();
        fclose (sys_handles[handle]);
        sys_handles[handle] = NULL;
-       VID_ForceLockState (t);
 }
 
 void Sys_FileSeek (int handle, int position)
 {
-       int             t;
-
-       t = VID_ForceUnlockedAndReturnState ();
        fseek (sys_handles[handle], position, SEEK_SET);
-       VID_ForceLockState (t);
 }
 
 int Sys_FileRead (int handle, void *dest, int count)
 {
-       int             t, x;
-
-       t = VID_ForceUnlockedAndReturnState ();
-       x = fread (dest, 1, count, sys_handles[handle]);
-       VID_ForceLockState (t);
-       return x;
+       return fread (dest, 1, count, sys_handles[handle]);
 }
 
 int Sys_FileWrite (int handle, void *data, int count)
 {
-       int             t, x;
-
-       t = VID_ForceUnlockedAndReturnState ();
-       x = fwrite (data, 1, count, sys_handles[handle]);
-       VID_ForceLockState (t);
-       return x;
+       return fwrite (data, 1, count, sys_handles[handle]);
 }
 
 int    Sys_FileTime (char *path)
 {
        FILE    *f;
-       int             t, retval;
+       int             retval;
 
-       t = VID_ForceUnlockedAndReturnState ();
-       
        f = fopen(path, "rb");
 
        if (f)
@@ -242,7 +207,6 @@ int Sys_FileTime (char *path)
                retval = -1;
        }
        
-       VID_ForceLockState (t);
        return retval;
 }
 
@@ -362,10 +326,7 @@ void Sys_Error (char *error, ...)
        static int      in_sys_error3 = 0;
 
        if (!in_sys_error3)
-       {
                in_sys_error3 = 1;
-               VID_ForceUnlockedAndReturnState ();
-       }
 
        va_start (argptr, error);
        vsprintf (text, error, argptr);
@@ -446,8 +407,6 @@ void Sys_Printf (char *fmt, ...)
 void Sys_Quit (void)
 {
 
-       VID_ForceUnlockedAndReturnState ();
-
        Host_Shutdown();
 
        if (tevent)