From e826e5f176f21cd18b3bbc22887a266835ada57c Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sun, 29 Jun 2008 12:32:32 +0000 Subject: Added client and server side support for 32-bit solids. New R1Q2 and Q2PRO minor protocol versions, 1905 and 1014. Use environment variables for game and server features negotiation. Relax restrictions on quake paths when searching inside pak files. Made OSS subsystem cvar names consistent with core sound system conventions. Misc latched cvar handling changes. --- source/sys_unix.c | 134 ++---------------------------------------------------- 1 file changed, 4 insertions(+), 130 deletions(-) (limited to 'source/sys_unix.c') diff --git a/source/sys_unix.c b/source/sys_unix.c index 009cd4f..bfcf87b 100644 --- a/source/sys_unix.c +++ b/source/sys_unix.c @@ -49,17 +49,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "q_field.h" #include "prompt.h" -#ifdef DEDICATED_ONLY -#undef USE_SDL -#endif - -#if USE_SDL -#include -#if USE_X11 -#include -#endif -#endif - cvar_t *sys_basedir; cvar_t *sys_libdir; cvar_t *sys_refdir; @@ -495,32 +484,6 @@ unsigned Sys_Milliseconds( void ) { return time; } -/* -================ -Sys_Mkdir -================ -*/ -qboolean Sys_Mkdir( const char *path ) { - if( mkdir( path, 0777 ) == -1 ) { - return qfalse; - } - return qtrue; -} - -qboolean Sys_RemoveFile( const char *path ) { - if( unlink( path ) == -1 ) { - return qfalse; - } - return qtrue; -} - -qboolean Sys_RenameFile( const char *from, const char *to ) { - if( rename( from, to ) == -1 ) { - return qfalse; - } - return qtrue; -} - /* ================ Sys_GetPathInfo @@ -576,79 +539,6 @@ void Sys_Quit( void ) { exit( 0 ); } -/* -================= -Sys_GetClipboardData -================= -*/ -char *Sys_GetClipboardData( void ) { -#if USE_SDL && USE_X11 - SDL_SysWMinfo info; - Display *dpy; - Window sowner, win; - Atom type, property; - unsigned long len, bytes_left; - unsigned char *data; - int format, result; - char *ret; - - if( SDL_WasInit( SDL_INIT_VIDEO ) != SDL_INIT_VIDEO ) { - return NULL; - } - SDL_VERSION( &info.version ); - if( !SDL_GetWMInfo( &info ) ) { - return NULL; - } - if( info.subsystem != SDL_SYSWM_X11 ) { - return NULL; - } - - dpy = info.info.x11.display; - win = info.info.x11.window; - - sowner = XGetSelectionOwner( dpy, XA_PRIMARY ); - if( sowner == None ) { - return NULL; - } - - property = XInternAtom( dpy, "GETCLIPBOARDDATA_PROP", False ); - - XConvertSelection( dpy, XA_PRIMARY, XA_STRING, property, win, CurrentTime ); - - XSync( dpy, False ); - - result = XGetWindowProperty( dpy, win, property, 0, 0, False, - AnyPropertyType, &type, &format, &len, &bytes_left, &data ); - - if( result != Success ) { - return NULL; - } - - ret = NULL; - if( bytes_left ) { - result = XGetWindowProperty( dpy, win, property, 0, bytes_left, True, - AnyPropertyType, &type, &format, &len, &bytes_left, &data ); - if( result == Success ) { - ret = Z_CopyString( ( char * )data ); - } - } - - XFree( data ); - - return ret; -#else - return NULL; -#endif -} - -/* -================= -Sys_SetClipboardData -================= -*/ -void Sys_SetClipboardData( const char *data ) { -} - /* ================= Sys_GetCurrentDirectory @@ -691,10 +581,6 @@ void Sys_Sleep( int msec ) { nanosleep( &req, NULL ); } -void Sys_Setenv( const char *name, const char *value ) { - setenv( name, value, 1 ); -} - #if USE_ANTICHEAT & 1 qboolean Sys_GetAntiCheatAPI( void ) { Sys_Sleep( 1500 ); @@ -709,8 +595,6 @@ Sys_FillAPI */ void Sys_FillAPI( sysAPI_t *api ) { api->Milliseconds = Sys_Milliseconds; - api->GetClipboardData = Sys_GetClipboardData; - api->SetClipboardData = Sys_SetClipboardData; api->HunkBegin = Hunk_Begin; api->HunkAlloc = Hunk_Alloc; api->HunkEnd = Hunk_End; @@ -760,10 +644,8 @@ Sys_Kill static void Sys_Kill( int signum ) { Sys_ShutdownTTY(); -#if USE_SDL - SDL_ShowCursor( SDL_ENABLE ); - SDL_WM_GrabInput( SDL_GRAB_OFF ); - SDL_Quit(); +#ifndef DEDICATED_ONLY + VID_FatalShutdown(); #endif #ifdef _GNU_SOURCE @@ -866,10 +748,8 @@ void Sys_Error( const char *error, ... ) { Sys_ShutdownTTY(); -#if USE_SDL - SDL_WM_GrabInput( SDL_GRAB_OFF ); - SDL_ShowCursor( SDL_ENABLE ); - SDL_Quit(); +#ifndef DEDICATED_ONLY + VID_FatalShutdown(); #endif va_start( argptr, error ); @@ -882,12 +762,6 @@ void Sys_Error( const char *error, ... ) { exit( 1 ); } - -/*void floating_point_exception_handler( int whatever ) { - signal( SIGFPE, floating_point_exception_handler ); -}*/ - - /* ======================================================================== -- cgit v1.2.3