summaryrefslogtreecommitdiff
path: root/source/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-05-05 21:18:52 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-05-05 21:18:52 +0000
commit0bd55fbf794d11385bcc64b01b81e8e478295bad (patch)
treeab548c3ad37fc13c555a5cca9da4348f3e35d84c /source/sys_unix.c
parent49e6170b49fbb933eddec6d0e3f946320c68832f (diff)
Brought SDL window resizing policy in compliance to ICCCM.
Renamed `vid_placement' cvar to `vid_geometry'. Load *.pkz files by default. Do not allow backed-up quake paths at all. Apply `--enable-dsound' and `--enable-dinput' options to Unix too. Replaced `s_driver' and `in_driver' cvars with `s_direct' and `in_direct'. Renamed `s_initsound' cva to `s_enable'. Improved SDL input grabs handling in windowed mode. Allow `cl_noskins' to be dynamically changed. Run client at 10 fps if minimuzed, at 60 fps if not active (client is disconnected or in background). Fixed Sys_ExecDefault. Use absolute mouse positioning for UI. Hide custom UI cursor in windowed mode.
Diffstat (limited to 'source/sys_unix.c')
-rw-r--r--source/sys_unix.c72
1 files changed, 3 insertions, 69 deletions
diff --git a/source/sys_unix.c b/source/sys_unix.c
index 293f2ca..bb9bbf7 100644
--- a/source/sys_unix.c
+++ b/source/sys_unix.c
@@ -414,7 +414,7 @@ void Hunk_Begin( mempool_t *pool, size_t maxsize ) {
buf = mmap( NULL, pool->maxsize, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON, -1, 0 );
if( buf == NULL || buf == ( void * )-1 ) {
- Com_Error( ERR_FATAL, "%s: unable to virtual allocate %d bytes",
+ Com_Error( ERR_FATAL, "%s: unable to virtual allocate %"PRIz" bytes",
__func__, pool->maxsize );
}
pool->base = buf;
@@ -471,72 +471,6 @@ void Hunk_Free( mempool_t *pool ) {
/*
===============================================================================
-FIFO
-
-===============================================================================
-*/
-
-#if 0
-qboolean FIFO_Alloc( fifo_t *fifo, int size ) {
- byte *mem, *ret;
- char temp[32];
- int fd;
-
- strcpy( temp, "/dev/shm/" APPLICATION "-XXXXXX" );
- fd = mkstemp( temp );
- if( fd < 0 ) {
- return qfalse;
- }
-
- unlink( temp );
-
- size = ( size + 4095 ) & ~4095;
-
- if( ftruncate( fd, size << 1 ) == -1 ) {
- goto fail2;
- }
-
- mem = mmap( NULL, size << 1, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0 );
- if( mem == MAP_FAILED ) {
- goto fail2;
- }
-
- ret = mmap( mem, size, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, fd, 0 );
- if( ret != mem ) {
- goto fail1;
- }
-
- ret = mmap( mem + size, size, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_SHARED, fd, 0 );
- if( ret != mem + size ) {
- goto fail1;
- }
-
- fifo->data = mem;
- fifo->size = size;
- fifo->tail = fifo->head = 0;
- return qtrue;
-
-fail1:
- munmap( mem, size << 1 );
-fail2:
- close( fd );
- return qfalse;
-}
-
-void FIFO_Free( fifo_t *fifo ) {
- if( fifo->data ) {
- if( munmap( fifo->data, fifo->size << 1 ) ) {
- Com_Error( ERR_FATAL, "%s: munmap failed: %s",
- __func__, strerror( errno ) );
- }
- }
- memset( fifo, 0, sizeof( *fifo ) );
-}
-#endif
-
-/*
-===============================================================================
-
GENERAL ROUTINES
===============================================================================
@@ -727,7 +661,7 @@ void Sys_AddDefaultConfig( void ) {
struct stat st;
char *text;
- fp = fopen( DEFCFG, "r" );
+ fp = fopen( SYS_SITECFG_NAME, "r" );
if( !fp ) {
return;
}
@@ -735,7 +669,7 @@ void Sys_AddDefaultConfig( void ) {
if( fstat( fileno( fp ), &st ) == 0 ) {
text = Cbuf_Alloc( &cmd_buffer, st.st_size );
if( text ) {
- Com_Printf( "Execing " DEFCFG "\n" );
+ Com_Printf( "Execing " SYS_SITECFG_NAME "\n" );
fread( text, st.st_size, 1, fp );
}
}