aboutsummaryrefslogtreecommitdiffstats
path: root/games/ezquake/files
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2006-12-21 21:32:40 +0800
committeralepulver <alepulver@FreeBSD.org>2006-12-21 21:32:40 +0800
commit756f51b580e8f385c0afdd2807c694a8e708ee7b (patch)
treee9c89575fa92667a12614fad3bfc699552c7f24d /games/ezquake/files
parentda5699dfdacafc5da373ec3ffb2177f0c0bba667 (diff)
downloadfreebsd-ports-graphics-756f51b580e8f385c0afdd2807c694a8e708ee7b.tar.gz
freebsd-ports-graphics-756f51b580e8f385c0afdd2807c694a8e708ee7b.tar.zst
freebsd-ports-graphics-756f51b580e8f385c0afdd2807c694a8e708ee7b.zip
- Update to version 1754.
Diffstat (limited to 'games/ezquake/files')
-rw-r--r--games/ezquake/files/patch-EX_misc.c11
-rw-r--r--games/ezquake/files/patch-Makefile290
-rw-r--r--games/ezquake/files/patch-Makefile.list10
-rw-r--r--games/ezquake/files/patch-cd_linux.c476
-rw-r--r--games/ezquake/files/patch-cl_tcl.c14
-rw-r--r--games/ezquake/files/patch-common.c106
-rw-r--r--games/ezquake/files/patch-config_manager.c16
-rw-r--r--games/ezquake/files/patch-host.c11
-rw-r--r--games/ezquake/files/patch-image.c27
-rw-r--r--games/ezquake/files/patch-menu.h11
-rw-r--r--games/ezquake/files/patch-modules.c14
-rw-r--r--games/ezquake/files/patch-mp3_player.c52
-rw-r--r--games/ezquake/files/patch-mp3_player.h11
-rw-r--r--games/ezquake/files/patch-q_shared.h35
-rw-r--r--games/ezquake/files/patch-quakeasm.h15
-rw-r--r--games/ezquake/files/patch-snd_dma.c20
-rw-r--r--games/ezquake/files/patch-snd_linux.c167
-rw-r--r--games/ezquake/files/patch-snd_oss.c63
-rw-r--r--games/ezquake/files/patch-sys_linux.c42
-rw-r--r--games/ezquake/files/patch-vid_glx.c12
20 files changed, 633 insertions, 770 deletions
diff --git a/games/ezquake/files/patch-EX_misc.c b/games/ezquake/files/patch-EX_misc.c
deleted file mode 100644
index 533acd880cb..00000000000
--- a/games/ezquake/files/patch-EX_misc.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./EX_misc.c.orig Wed Mar 29 18:54:03 2006
-+++ ./EX_misc.c Tue Aug 29 20:59:12 2006
-@@ -8,7 +8,7 @@
- #include "EX_misc.h"
- #include "EX_FunNames.h"
-
--#if defined __linux || defined(__APPLE__)
-+#if defined __unix__ || defined(__APPLE__)
- #define CLIPBOARDSIZE 1024
- static char clipboard[CLIPBOARDSIZE] = "\0"; // for clipboard implementation
- #endif
diff --git a/games/ezquake/files/patch-Makefile b/games/ezquake/files/patch-Makefile
index b2c5d8be782..268734803cc 100644
--- a/games/ezquake/files/patch-Makefile
+++ b/games/ezquake/files/patch-Makefile
@@ -1,193 +1,97 @@
---- Makefile.orig Fri Apr 7 13:48:24 2006
-+++ Makefile Fri Nov 24 15:51:36 2006
-@@ -5,54 +5,26 @@
-
-
- # compilation tool and detection of targets/achitecture
--CC =gcc
- CC_BASEVERSION =$(shell $(CC) -dumpversion | sed -e 's/\..*//g')
- MACHINE =$(shell $(CC) -dumpmachine)
- ARCH =$(shell echo $(MACHINE) | sed -e 's/.*mingw32.*/mingw32/g' -e 's/\-.*//g' -e 's/i.86/x86/g')
- STRIP =strip --strip-unneeded --remove-section=.comment
-
--# Mac OSX Tiger : powerpc -> ppc
--ifeq ($(MACHINE),powerpc-apple-darwin8) # MacOS-10.4/ppc
-- ARCH = ppc
--endif
--
--# Mac OSX Tiger : i686 -> macx86
--ifeq ($(MACHINE),i686-apple-darwin8) # MacOS-10.4/x86
-- ARCH = macx86
-- STRIP = strip
--endif
--
--# add special architecture based flags
--ifeq ($(ARCH),x86) # Linux/x86
-- DEST_ARCH =x86
-- ARCH_CFLAGS =-march=$(shell echo $(MACHINE) | sed -e 's/\-.*//g')
--endif
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- DEST_ARCH =x86
-- ARCH_CFLAGS =-mwin32 -mno-cygwin
--endif
--ifeq ($(ARCH),ppc) # MacOS-X/ppc
-- DEST_ARCH =ppc
-- ARCH_CFLAGS =-arch ppc -faltivec -maltivec -mcpu=7450 -mtune=7450 -mpowerpc -mpowerpc-gfxopt
-- ifeq ($(CC_BASEVERSION),4) # auto vectorize if we're using gcc4.0+
-- ARCH_CFLAGS += -ftree-vectorize
-- endif
--endif
--
--
- #======================================================================
- # Output Directories
- #======================================================================
- # location of source relative to Makefile
- SOURCE_DIR =.
-
--BUILD_DEBUG_DIR =debug-$(ARCH)
--BUILD_RELEASE_DIR =release-$(ARCH)
-+BUILD_DEBUG_DIR =debug
-+BUILD_RELEASE_DIR =release
-
- # compiler flags
- PRJ_CFLAGS =-DWITH_ZLIB -DWITH_PNG -DEMBED_TCL -DUSE_TCL_STUBS
--XMMS_CFLAGS =-DWITH_XMMS `glib-config --cflags`
--BASE_CFLAGS =-Wall $(PRJ_CFLAGS) $(ARCH_CFLAGS)
-+XMMS_CFLAGS =-DWITH_XMMS `xmms-config --cflags` `glib-config --cflags`
-+BASE_CFLAGS =$(CFLAGS) -I$(LOCALBASE)/include `pcre-config --cflags` -I$(TCL_INCLUDEDIR) -DDATADIR='\"$(Q1DIR)\"' -Wall $(PRJ_CFLAGS) $(XMMS_CFLAGS)
-+
-+ifeq ($(USE_OPTIMIZED_CFLAGS),YES)
- BASE_RELEASE_CFLAGS =-ffast-math -fomit-frame-pointer -fexpensive-optimizations
- ifneq ($(CC_BASEVERSION),4) # if we're not auto-vectorizing then we can unroll the loops (mdfour ahoy)
- BASE_RELEASE_CFLAGS += -funroll-loops
-@@ -69,99 +41,47 @@
- BASE_RELEASE_CFLAGS += -falign-loops=2 -falign-jumps=2 -falign-functions=2
- endif
- endif
-+endif
-+
- BASE_DEBUG_CFLAGS =-g -D_DEBUG
-
--ifeq ($(ARCH),x86) # Linux/x86
-- BASE_CFLAGS += -Did386 $(XMMS_CFLAGS)
-- CL_DLFLAGS += -ldl
--endif
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- # use define for special assembly routines:
-- BASE_CFLAGS += -Did386 -DMINGW32
--endif
--ifeq ($(ARCH),ppc) # MacOS-X/ppc
-- BASE_CFLAGS += -D__BIG_ENDIAN__ -Ddarwin
--endif
--ifeq ($(ARCH),macx86) # MacOS-X/x86
-- BASE_CFLAGS += -Ddarwin
--endif
--ifeq ($(ARCH),powerpc) # Linux/PPC
-- BASE_CFLAGS += -D__BIG_ENDIAN__
-- CL_DLFLAGS += -ldl
-+ifeq ($(ARCH),i386)
-+ ifeq ($(USE_X86_ASM),YES)
-+ BASE_CFLAGS += -Did386
-+ endif
- endif
-
- BASE_CFLAGS += -funsigned-char -pipe -fno-strict-aliasing
- RELEASE_CFLAGS =$(BASE_CFLAGS) $(BASE_RELEASE_CFLAGS) -DNDEBUG
- DEBUG_CFLAGS =$(BASE_CFLAGS) $(BASE_DEBUG_CFLAGS) -Wimplicit
-
--
- # software and console (svga) builds
- DO_CC =$(CC) -DWITH_VMODE $(CFLAGS) -o $@ -c $<
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- DO_CC += -D_WINDOWS -mwindows
--endif
- DO_O_CC =$(CC) -O $(CFLAGS) -o $@ -c $<
- DO_AS =$(CC) $(CFLAGS) -x assembler-with-cpp
--ifeq ($(ARCH),x86) # Linux/x86
-- DO_AS += -DELF
--endif
-+DO_AS += -DELF
- DO_AS += -o $@ -c $<
-
- # opengl builds
--BASE_GLCFLAGS =-DWITH_JPEG -DGLQUAKE
--ifeq ($(ARCH),x86) # Linux/x86
-- ARCH_GLCFLAGS =-I/usr/include -DWITH_VMODE -DWITH_DGA -DWITH_EVDEV
--endif
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- ARCH_GLCFLAGS =-mwindows -I/opt/xmingw/include/ -I./pcre/ -I./libexpat/
--endif
--ifeq ($(ARCH),ppc) # MacOS-X/ppc
-- ARCH_GLCFLAGS = -I/opt/local/include/ -I/Developer/Headers/FlatCarbon -I/sw/include -FOpenGL -FAGL
--endif
--ifeq ($(ARCH),macx86) # MacOS-X/x86
-- ARCH_GLCFLAGS = -I/opt/local/include/ -I/Developer/Headers/FlatCarbon -I/sw/include -FOpenGL -FAGL `pcre-config --cflags` -I./libs
--endif
-+BASE_GLCFLAGS =-DWITH_JPEG -DGLQUAKE -I$(X11BASE)/include
-+ARCH_GLCFLAGS =-DWITH_VMODE -DWITH_DGA
-
- GLCFLAGS =$(ARCH_GLCFLAGS) $(BASE_GLCFLAGS)
-
- DO_GL_CC =$(CC) $(CFLAGS) $(GLCFLAGS) -o $@ -c $<
- DO_GL_AS =$(CC) $(CFLAGS) $(GLCFLAGS) -x assembler-with-cpp
--ifeq ($(ARCH),x86) # Linux/x86
-- DO_GL_AS += -DELF
--endif
-+DO_GL_AS += -DELF
- DO_GL_AS += -o $@ -c $<
-
--
- # linker flags
--LDFLAGS =-lm `glib-config --libs` -lpthread -lexpat `pcre-config --libs` -ltclstub $(CL_DLFLAGS)
-+LDFLAGS =-L$(LOCALBASE)/lib -lm `glib-config --libs` $(PTHREAD_LIBS) -lexpat `pcre-config --libs` -ltclstub$(TCL_SUFX) $(CL_DLFLAGS)
- SVGALDFLAGS =-lvga
--X11_LDFLAGS =-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- LDFLAGS += -lws2_32 -luser32 -lwinmm
--endif
--ifeq ($(ARCH),ppc) # MacOS-X/ppc
-- LDFLAGS =`pcre-config --libs` -lexpat -framework OpenGL -framework AGL -framework DrawSprocket -framework Carbon -framework ApplicationServices -framework IOKit
--endif
--ifeq ($(ARCH),macx86) # MacOS-X/x86
-- LDFLAGS =`pcre-config --libs` -lexpat -framework OpenGL -framework AGL -framework DrawSprocket -framework Carbon -framework ApplicationServices -framework IOKit
--endif
-+X11_LDFLAGS =-L$(X11BASE)/lib -lX11 -lXext -lXxf86dga -lXxf86vm
-
- # opengl build
--BASE_GL_LDFLAGS =-L/usr/X11R6/lib -lGL -lm -lX11 -lXext
-+BASE_GL_LDFLAGS =-L$(X11BASE)/lib -lGL -lm -lX11 -lXext
- ARCH_GL_LDFLAGS =
--ifeq ($(ARCH),x86) # Linux/x86
-- ARCH_GL_LDFLAGS =-lXxf86dga -lXxf86vm
--endif
--ifeq ($(ARCH),mingw32) # Win32/x86 in MingW environment
-- BASE_GL_LDFLAGS =
-- ARCH_GL_LDFLAGS =-mwindows -lopengl32 -ldxguid -lgdi32
--endif
--ifeq ($(ARCH),ppc) # MacOS-X/ppc
-- BASE_GL_LDFLAGS =
--endif
--ifeq ($(ARCH),macx86) # MacOS-X/x86
-- BASE_GL_LDFLAGS =
--endif
-+ARCH_GL_LDFLAGS =-lXxf86dga -lXxf86vm
- GL_LDFLAGS =$(ARCH_GL_LDFLAGS) $(BASE_GL_LDFLAGS)
-
-
-@@ -234,7 +154,6 @@
- $(BUILDDIR)/build/snd_mix.o \
- $(BUILDDIR)/build/snd_linux.o \
- $(BUILDDIR)/build/snd_oss.o \
-- $(BUILDDIR)/build/snd_alsa.o \
- \
- $(BUILDDIR)/build/cl_input.o \
- $(BUILDDIR)/build/keys.o \
-@@ -855,7 +774,6 @@
- $(BUILDDIR)/build-gl/snd_mix.o \
- $(BUILDDIR)/build-gl/snd_linux.o \
- $(BUILDDIR)/build-gl/snd_oss.o \
-- $(BUILDDIR)/build-gl/snd_alsa.o \
- \
- $(BUILDDIR)/build-gl/cl_input.o \
- $(BUILDDIR)/build-gl/keys.o \
+--- Makefile.orig Sat Nov 25 15:28:35 2006
++++ Makefile Tue Dec 19 20:41:59 2006
+@@ -6,7 +6,7 @@
+
+ # compilation tool and detection of targets/achitecture
+ _E = @
+-CC = gcc
++CC ?= gcc
+ CC_BASEVERSION = $(shell $(CC) -dumpversion | sed -e 's/\..*//g')
+
+ # TYPE = release debug
+@@ -16,25 +16,18 @@
+
+ # ARCH = x86 ppc
+ # OS = linux darwin
+-ARCH = $(shell uname -m | sed -e 's/i.86/x86/g' -e 's/Power Macintosh/ppc/g')
++ARCH ?= $(shell uname -m | sed -e 's/i.86/x86/g' -e 's/Power Macintosh/ppc/g')
+ OS = $(shell uname -s | tr A-Z a-z)
+
+-# add special architecture based flags
+-ifeq ($(ARCH),x86_64)
+- ARCH_CFLAGS = -march=k8 -D__LITTLE_ENDIAN__Q__
+-endif
+-ifeq ($(ARCH),x86)
+- ARCH_CFLAGS = -march=i686 -D__LITTLE_ENDIAN__Q__ -Did386
+-endif
+-ifeq ($(ARCH),ppc)
+- ARCH_CFLAGS = -arch ppc -faltivec -maltivec -mcpu=7450 -mtune=7450 -mpowerpc -mpowerpc-gfxopt -D__BIG_ENDIAN__Q__
+-endif
+-
+ # TODO: LIB_PREFIX must be $(OS)-$(ARCH)
+ ifeq ($(OS),linux)
+ DEFAULT_TARGET = glx
+ OS_GL_CFLAGS = -DWITH_DGA -DWITH_EVDEV -DWITH_VMODE
+ endif
++ifeq ($(OS),freebsd)
++ DEFAULT_TARGET = glx
++ OS_GL_CFLAGS = -DWITH_DGA -DWITH_VMODE -I$(X11BASE)/include
++endif
+ ifeq ($(OS),darwin)
+ DEFAULT_TARGET = mac
+ OS_GL_CFLAGS = -I/opt/local/include/ -I/Developer/Headers/FlatCarbon -I/sw/include -FOpenGL -FAGL
+@@ -50,19 +43,19 @@
+ # Directories for object files #
+ ################################
+
+-GLX_DIR = $(TYPE)-$(ARCH)/glx
+-X11_DIR = $(TYPE)-$(ARCH)/x11
+-SVGA_DIR = $(TYPE)-$(ARCH)/svga
+-MAC_DIR = $(TYPE)-$(ARCH)/mac
++GLX_DIR = $(TYPE)/glx
++X11_DIR = $(TYPE)/x11
++SVGA_DIR = $(TYPE)/svga
++MAC_DIR = $(TYPE)/mac
+
+ ################
+ # Binary files #
+ ################
+
+-GLX_TARGET = $(TYPE)-$(ARCH)/ezquake-gl.glx
+-X11_TARGET = $(TYPE)-$(ARCH)/ezquake.x11
+-SVGA_TARGET = $(TYPE)-$(ARCH)/ezquake.svga
+-MAC_TARGET = $(TYPE)-$(ARCH)/ezquake-gl.mac
++GLX_TARGET = $(TYPE)/ezquake-gl.glx
++X11_TARGET = $(TYPE)/ezquake.x11
++SVGA_TARGET = $(TYPE)/ezquake.svga
++MAC_TARGET = $(TYPE)/ezquake-gl.mac
+
+ ################
+
+@@ -78,9 +71,12 @@
+
+ # compiler flags
+ PRJ_CFLAGS = -DWITH_ZLIB -DWITH_PNG -DEMBED_TCL -DJSS_CAM
+-BASE_CFLAGS = -Wall -funsigned-char $(ARCH_CFLAGS) $(PRJ_CFLAGS) -I ./libs
++XMMS_CFLAGS= -DWITH_XMMS `xmms-config --cflags` `glib-config --cflags`
++BASE_CFLAGS := $(CFLAGS) -I$(LOCALBASE)/include `pcre-config --cflags` -I$(TCL_INCLUDEDIR) -DDATADIR='"$(Q1DIR)"' -Wall -funsigned-char $(PRJ_CFLAGS) $(XMMS_CFLAGS)
+
++ifeq ($(USE_OPTIMIZED_CFLAGS),YES)
+ RELEASE_CFLAGS = -pipe -O2 -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fexpensive-optimizations -funroll-loops
++endif
+ DEBUG_CFLAGS = -ggdb
+
+ # opengl builds
+@@ -92,9 +88,9 @@
+ CFLAGS = $(BASE_CFLAGS) $(DEBUG_CFLAGS) -D_DEBUG
+ endif
+
+-LDFLAGS = -lm -lpthread
+-COMMON_LIBS = libs/$(LIB_PREFIX)/libpng.a libs/$(LIB_PREFIX)/libz.a libs/$(LIB_PREFIX)/libpcre.a libs/$(LIB_PREFIX)/libexpat.a libs/$(LIB_PREFIX)/libtcl8.4.a
+-GL_LIBS = libs/$(LIB_PREFIX)/libjpeg.a
++LDFLAGS = -L$(LOCALBASE)/lib -L$(X11BASE)/lib
++COMMON_LIBS = -lm -lpng -lz `pcre-config --libs` `glib-config --libs` -lexpat -ltcl$(TCL_SUFX) $(PTHREAD_LIBS)
++GL_LIBS = -ljpeg
+
+ include Makefile.list
+
diff --git a/games/ezquake/files/patch-Makefile.list b/games/ezquake/files/patch-Makefile.list
new file mode 100644
index 00000000000..a409158362f
--- /dev/null
+++ b/games/ezquake/files/patch-Makefile.list
@@ -0,0 +1,10 @@
+--- Makefile.list.orig Sat Nov 25 15:28:35 2006
++++ Makefile.list Tue Dec 19 20:02:43 2006
+@@ -156,7 +156,6 @@
+ cd_linux \
+ keymap_x11 \
+ localtime_linux \
+- snd_alsa \
+ snd_linux \
+ snd_oss \
+ sys_linux
diff --git a/games/ezquake/files/patch-cd_linux.c b/games/ezquake/files/patch-cd_linux.c
index 8a68b2a7e40..9ee8d0998b2 100644
--- a/games/ezquake/files/patch-cd_linux.c
+++ b/games/ezquake/files/patch-cd_linux.c
@@ -1,253 +1,253 @@
--- ./cd_linux.c.orig Thu Apr 6 20:23:18 2006
+++ ./cd_linux.c Tue Aug 29 20:59:12 2006
@@ -30,7 +30,11 @@
- #include <string.h>
- #include <time.h>
- #include <errno.h>
-+#ifdef __FreeBSD__
-+#include <sys/cdio.h>
-+#else
- #include <linux/cdrom.h>
-+#endif
-
- #include "quakedef.h"
- #include "cdaudio.h"
+ #include <string.h>
+ #include <time.h>
+ #include <errno.h>
++#ifdef __FreeBSD__
++#include <sys/cdio.h>
++#else
+ #include <linux/cdrom.h>
++#endif
+
+ #include "quakedef.h"
+ #include "cdaudio.h"
@@ -54,8 +58,13 @@
- if (cdfile == -1 || !enabled)
- return; // no cd init'd
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCEJECT) == -1)
-+ Com_DPrintf ("ioctl cdioceject failed\n");
-+#else
- if ( ioctl(cdfile, CDROMEJECT) == -1 )
- Com_DPrintf ("ioctl cdromeject failed\n");
-+#endif
- }
-
-
+ if (cdfile == -1 || !enabled)
+ return; // no cd init'd
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCEJECT) == -1)
++ Com_DPrintf ("ioctl cdioceject failed\n");
++#else
+ if ( ioctl(cdfile, CDROMEJECT) == -1 )
+ Com_DPrintf ("ioctl cdromeject failed\n");
++#endif
+ }
+
+
@@ -64,30 +73,53 @@
- if (cdfile == -1 || !enabled)
- return; // no cd init'd
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCCLOSE) == -1)
-+ Com_DPrintf ("ioctl cdiocclose failed\n");
-+#else
- if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
- Com_DPrintf ("ioctl cdromclosetray failed\n");
-+#endif
- }
-
- static int CDAudio_GetAudioDiskInfo(void)
- {
-+#ifdef __FreeBSD__
-+ struct ioc_toc_header tochdr;
-+#else
- struct cdrom_tochdr tochdr;
-+#endif
-
- cdValid = false;
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1)
-+ {
-+ Com_DPrintf ("ioctl cdioreadtocheader failed\n");
-+#else
- if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
- {
- Com_DPrintf ("ioctl cdromreadtochdr failed\n");
-+#endif
- return -1;
- }
-
-+#ifdef __FreeBSD__
-+ if (tochdr.starting_track < 1)
-+#else
- if (tochdr.cdth_trk0 < 1)
-+#endif
- {
- Com_DPrintf ("CDAudio: no music tracks\n");
- return -1;
- }
-
- cdValid = true;
-+#ifdef __FreeBSD__
-+ maxTrack = tochdr.ending_track;
-+#else
- maxTrack = tochdr.cdth_trk1;
-+#endif
-
- return 0;
- }
+ if (cdfile == -1 || !enabled)
+ return; // no cd init'd
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCCLOSE) == -1)
++ Com_DPrintf ("ioctl cdiocclose failed\n");
++#else
+ if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 )
+ Com_DPrintf ("ioctl cdromclosetray failed\n");
++#endif
+ }
+
+ static int CDAudio_GetAudioDiskInfo(void)
+ {
++#ifdef __FreeBSD__
++ struct ioc_toc_header tochdr;
++#else
+ struct cdrom_tochdr tochdr;
++#endif
+
+ cdValid = false;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1)
++ {
++ Com_DPrintf ("ioctl cdioreadtocheader failed\n");
++#else
+ if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 )
+ {
+ Com_DPrintf ("ioctl cdromreadtochdr failed\n");
++#endif
+ return -1;
+ }
+
++#ifdef __FreeBSD__
++ if (tochdr.starting_track < 1)
++#else
+ if (tochdr.cdth_trk0 < 1)
++#endif
+ {
+ Com_DPrintf ("CDAudio: no music tracks\n");
+ return -1;
+ }
+
+ cdValid = true;
++#ifdef __FreeBSD__
++ maxTrack = tochdr.ending_track;
++#else
+ maxTrack = tochdr.cdth_trk1;
++#endif
+
+ return 0;
+ }
@@ -95,8 +127,14 @@
-
- void CDAudio_Play(byte track, qbool looping)
- {
-+#ifdef __FreeBSD__
-+ struct ioc_read_toc_entry entry;
-+ struct cd_toc_entry toc_buffer;
-+ struct ioc_play_track ti;
-+#else
- struct cdrom_tocentry entry;
- struct cdrom_ti ti;
-+#endif
-
- if (cdfile == -1 || !enabled)
- return;
+
+ void CDAudio_Play(byte track, qbool looping)
+ {
++#ifdef __FreeBSD__
++ struct ioc_read_toc_entry entry;
++ struct cd_toc_entry toc_buffer;
++ struct ioc_play_track ti;
++#else
+ struct cdrom_tocentry entry;
+ struct cdrom_ti ti;
++#endif
+
+ if (cdfile == -1 || !enabled)
+ return;
@@ -116,6 +154,21 @@
- return;
- }
-
-+#ifdef __FreeBSD__
-+ #define CDROM_DATA_TRACK 4
-+ bzero((char *)&toc_buffer, sizeof(toc_buffer));
-+ entry.data_len = sizeof(toc_buffer);
-+ entry.data = &toc_buffer;
-+ // don't try to play a non-audio track
-+ entry.starting_track = track;
-+ entry.address_format = CD_MSF_FORMAT;
-+ if ( ioctl(cdfile, CDIOREADTOCENTRYS, &entry) == -1 )
-+ {
-+ Com_DPrintf("ioctl cdromreadtocentry failed\n");
-+ return;
-+ }
-+ if (toc_buffer.control == CDROM_DATA_TRACK)
-+#else
- // don't try to play a non-audio track
- entry.cdte_track = track;
- entry.cdte_format = CDROM_MSF;
+ return;
+ }
+
++#ifdef __FreeBSD__
++ #define CDROM_DATA_TRACK 4
++ bzero((char *)&toc_buffer, sizeof(toc_buffer));
++ entry.data_len = sizeof(toc_buffer);
++ entry.data = &toc_buffer;
++ // don't try to play a non-audio track
++ entry.starting_track = track;
++ entry.address_format = CD_MSF_FORMAT;
++ if ( ioctl(cdfile, CDIOREADTOCENTRYS, &entry) == -1 )
++ {
++ Com_DPrintf("ioctl cdromreadtocentry failed\n");
++ return;
++ }
++ if (toc_buffer.control == CDROM_DATA_TRACK)
++#else
+ // don't try to play a non-audio track
+ entry.cdte_track = track;
+ entry.cdte_format = CDROM_MSF;
@@ -125,6 +178,7 @@
- return;
- }
- if (entry.cdte_ctrl == CDROM_DATA_TRACK)
-+#endif
- {
- Com_Printf ("CDAudio: track %i is not audio\n", track);
- return;
+ return;
+ }
+ if (entry.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ {
+ Com_Printf ("CDAudio: track %i is not audio\n", track);
+ return;
@@ -137,19 +191,37 @@
- CDAudio_Stop();
- }
-
-+#ifdef __FreeBSD__
-+ ti.start_track = track;
-+ ti.end_track = track;
-+ ti.start_index = 1;
-+ ti.end_index = 99;
-+#else
- ti.cdti_trk0 = track;
- ti.cdti_trk1 = track;
- ti.cdti_ind0 = 1;
- ti.cdti_ind1 = 99;
-+#endif
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1)
-+ {
-+ Com_DPrintf ("ioctl cdiocplaytracks failed\n");
-+#else
- if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
- {
- Com_DPrintf ("ioctl cdromplaytrkind failed\n");
-+#endif
- return;
- }
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCRESUME) == -1)
-+ Com_DPrintf ("ioctl cdiocresume failed\n");
-+#else
- if ( ioctl(cdfile, CDROMRESUME) == -1 )
- Com_DPrintf ("ioctl cdromresume failed\n");
-+#endif
-
- playLooping = looping;
- playTrack = track;
+ CDAudio_Stop();
+ }
+
++#ifdef __FreeBSD__
++ ti.start_track = track;
++ ti.end_track = track;
++ ti.start_index = 1;
++ ti.end_index = 99;
++#else
+ ti.cdti_trk0 = track;
+ ti.cdti_trk1 = track;
+ ti.cdti_ind0 = 1;
+ ti.cdti_ind1 = 99;
++#endif
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1)
++ {
++ Com_DPrintf ("ioctl cdiocplaytracks failed\n");
++#else
+ if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 )
+ {
+ Com_DPrintf ("ioctl cdromplaytrkind failed\n");
++#endif
+ return;
+ }
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCRESUME) == -1)
++ Com_DPrintf ("ioctl cdiocresume failed\n");
++#else
+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
+ Com_DPrintf ("ioctl cdromresume failed\n");
++#endif
+
+ playLooping = looping;
+ playTrack = track;
@@ -168,8 +240,13 @@
- if (!playing)
- return;
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCSTOP) == -1)
-+ Com_DPrintf ("ioctl cdiocstop failed (%d)\n", errno);
-+#else
- if ( ioctl(cdfile, CDROMSTOP) == -1 )
- Com_DPrintf ("ioctl cdromstop failed (%d)\n", errno);
-+#endif
-
- wasPlaying = false;
- playing = false;
+ if (!playing)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCSTOP) == -1)
++ Com_DPrintf ("ioctl cdiocstop failed (%d)\n", errno);
++#else
+ if ( ioctl(cdfile, CDROMSTOP) == -1 )
+ Com_DPrintf ("ioctl cdromstop failed (%d)\n", errno);
++#endif
+
+ wasPlaying = false;
+ playing = false;
@@ -183,8 +260,13 @@
- if (!playing)
- return;
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCPAUSE) == -1)
-+ Com_DPrintf ("ioctl cdiocpause failed\n");
-+#else
- if ( ioctl(cdfile, CDROMPAUSE) == -1 )
- Com_DPrintf ("ioctl cdrompause failed\n");
-+#endif
-
- wasPlaying = playing;
- playing = false;
+ if (!playing)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCPAUSE) == -1)
++ Com_DPrintf ("ioctl cdiocpause failed\n");
++#else
+ if ( ioctl(cdfile, CDROMPAUSE) == -1 )
+ Com_DPrintf ("ioctl cdrompause failed\n");
++#endif
+
+ wasPlaying = playing;
+ playing = false;
@@ -202,8 +284,13 @@
- if (!wasPlaying)
- return;
-
-+#ifdef __FreeBSD__
-+ if (ioctl(cdfile, CDIOCRESUME) == -1)
-+ Com_DPrintf ("ioctl cdiocresume failed\n");
-+#else
- if ( ioctl(cdfile, CDROMRESUME) == -1 )
- Com_DPrintf ("ioctl cdromresume failed\n");
-+#endif
- playing = true;
- }
-
+ if (!wasPlaying)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCRESUME) == -1)
++ Com_DPrintf ("ioctl cdiocresume failed\n");
++#else
+ if ( ioctl(cdfile, CDROMRESUME) == -1 )
+ Com_DPrintf ("ioctl cdromresume failed\n");
++#endif
+ playing = true;
+ }
+
@@ -299,7 +386,12 @@
-
- void CDAudio_Update(void)
- {
-+#ifdef __FreeBSD__
-+ struct ioc_read_subchannel subchnl;
-+ struct cd_sub_channel_info data;
-+#else
- struct cdrom_subchnl subchnl;
-+#endif
- static time_t lastchk;
-
- if (!enabled)
+
+ void CDAudio_Update(void)
+ {
++#ifdef __FreeBSD__
++ struct ioc_read_subchannel subchnl;
++ struct cd_sub_channel_info data;
++#else
+ struct cdrom_subchnl subchnl;
++#endif
+ static time_t lastchk;
+
+ if (!enabled)
@@ -323,6 +415,24 @@
-
- if (playing && lastchk < time(NULL)) {
- lastchk = time(NULL) + 2; //two seconds between chks
-+#if defined(__FreeBSD__)
-+ subchnl.address_format = CD_MSF_FORMAT;
-+ subchnl.data_format = CD_CURRENT_POSITION;
-+ subchnl.data_len = sizeof(data);
-+ subchnl.track = playTrack;
-+ subchnl.data = &data;
-+ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) {
-+ Com_DPrintf("ioctl cdiocreadsubchannel failed\n");
-+ playing = false;
-+ return;
-+ }
-+ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS &&
-+ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) {
-+ playing = false;
-+ if (playLooping)
-+ CDAudio_Play(playTrack, true);
-+ }
-+#else
- subchnl.cdsc_format = CDROM_MSF;
- if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
- Com_DPrintf ("ioctl cdromsubchnl failed\n");
+
+ if (playing && lastchk < time(NULL)) {
+ lastchk = time(NULL) + 2; //two seconds between chks
++#if defined(__FreeBSD__)
++ subchnl.address_format = CD_MSF_FORMAT;
++ subchnl.data_format = CD_CURRENT_POSITION;
++ subchnl.data_len = sizeof(data);
++ subchnl.track = playTrack;
++ subchnl.data = &data;
++ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) {
++ Com_DPrintf("ioctl cdiocreadsubchannel failed\n");
++ playing = false;
++ return;
++ }
++ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS &&
++ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) {
++ playing = false;
++ if (playLooping)
++ CDAudio_Play(playTrack, true);
++ }
++#else
+ subchnl.cdsc_format = CDROM_MSF;
+ if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) {
+ Com_DPrintf ("ioctl cdromsubchnl failed\n");
@@ -335,6 +445,7 @@
- if (playLooping)
- CDAudio_Play(playTrack, true);
- }
-+#endif
- }
- }
-
+ if (playLooping)
+ CDAudio_Play(playTrack, true);
+ }
++#endif
+ }
+ }
+
diff --git a/games/ezquake/files/patch-cl_tcl.c b/games/ezquake/files/patch-cl_tcl.c
index 89b0f91d031..9d821fec237 100644
--- a/games/ezquake/files/patch-cl_tcl.c
+++ b/games/ezquake/files/patch-cl_tcl.c
@@ -1,10 +1,10 @@
--- ./cl_tcl.c.orig Tue Apr 18 17:59:55 2006
+++ ./cl_tcl.c Tue Aug 29 20:59:12 2006
@@ -24,6 +24,7 @@
- #define STATIC_BUILD
- #include <tcl.h>
- #include <time.h>
-+#include <dlfcn.h>
- #include "quakedef.h"
-
- extern cmd_function_t *impulse_cmd;
+ #define STATIC_BUILD
+ #include <tcl.h>
+ #include <time.h>
++#include <dlfcn.h>
+ #include "quakedef.h"
+
+ extern cmd_function_t *impulse_cmd;
diff --git a/games/ezquake/files/patch-common.c b/games/ezquake/files/patch-common.c
index a7bc34f4b90..c1c3f52dea9 100644
--- a/games/ezquake/files/patch-common.c
+++ b/games/ezquake/files/patch-common.c
@@ -1,54 +1,52 @@
---- ./common.c.orig Tue Apr 18 17:59:55 2006
-+++ ./common.c Wed Aug 30 18:01:03 2006
-@@ -1387,14 +1387,18 @@
- }
-
- void FS_InitFilesystem (void) {
-+ char *home;
-+ char homepath[MAX_OSPATH];
- int i;
-
-+ home = getenv("HOME");
-+
- // -basedir <path>
- // Overrides the system supplied base directory (under id1)
- if ((i = COM_CheckParm ("-basedir")) && i < com_argc - 1)
- strlcpy (com_basedir, com_argv[i + 1], sizeof(com_basedir));
- else
-- getcwd(com_basedir, sizeof(com_basedir) - 1);
-+ strlcpy(com_basedir, DATADIR, sizeof(com_basedir) - 1);
-
- for (i = 0; i < strlen(com_basedir); i++)
- if (com_basedir[i] == '\\')
-@@ -1406,8 +1410,16 @@
-
- // start up with id1 by default
- FS_AddGameDirectory ( va("%s/id1", com_basedir) );
-- FS_AddGameDirectory ( va("%s/ezquake", com_basedir) );
-+ if (home != NULL)
-+ FS_AddGameDirectory(va("%s/.ezquake/id1", home));
-+
- FS_AddGameDirectory ( va("%s/qw", com_basedir) );
-+ if (home != NULL)
-+ FS_AddGameDirectory(va("%s/.ezquake/qw", home));
-+
-+ FS_AddGameDirectory ( va("%s/ezquake", com_basedir) );
-+ if (home != NULL)
-+ FS_AddGameDirectory(va("%s/.ezquake/ezquake", home));
-
- // any set gamedirs will be freed up to here
- com_base_searchpaths = com_searchpaths;
-@@ -1426,6 +1438,13 @@
- {
- if( UserdirSet )
- FS_SetGamedir("qw");
-+ }
-+
-+ if (home != NULL) {
-+ snprintf(homepath, sizeof(homepath), "%s/.ezquake/%s", home, com_gamedirfile);
-+ COM_CreatePath(homepath);
-+ Sys_mkdir(homepath);
-+ FS_AddGameDirectory(homepath);
- }
- }
-
+--- common.c.orig Tue Oct 24 12:50:11 2006
++++ common.c Tue Dec 19 14:11:31 2006
+@@ -931,14 +931,18 @@
+ }
+
+ void FS_InitFilesystem (void) {
++ char *home;
++ char homepath[MAX_OSPATH];
+ int i;
+
++ home = getenv("HOME");
++
+ // -basedir <path>
+ // Overrides the system supplied base directory (under id1)
+ if ((i = COM_CheckParm ("-basedir")) && i < com_argc - 1)
+ strlcpy (com_basedir, com_argv[i + 1], sizeof(com_basedir));
+ else
+- Sys_getcwd(com_basedir, sizeof(com_basedir) - 1); // FIXME strlcpy (com_basedir, sizeof(com_basedir, "."); ?
++ strlcpy(com_basedir, DATADIR, sizeof(com_basedir) - 1);
+
+ for (i = 0; i < (int) strlen(com_basedir); i++)
+ if (com_basedir[i] == '\\')
+@@ -950,9 +954,14 @@
+
+ // start up with id1 by default
+ FS_AddGameDirectory ( va("%s/id1", com_basedir) );
+- FS_AddGameDirectory ( va("%s/ezquake", com_basedir) );
++ if (home != NULL)
++ FS_AddGameDirectory(va("%s/.ezquake/id1", home));
+ FS_AddGameDirectory ( va("%s/qw", com_basedir) );
+
++ FS_AddGameDirectory ( va("%s/ezquake", com_basedir) );
++ if (home != NULL)
++ FS_AddGameDirectory(va("%s/.ezquake/ezquake", home));
++
+ // any set gamedirs will be freed up to here
+ com_base_searchpaths = com_searchpaths;
+
+@@ -971,6 +980,13 @@
+ if( UserdirSet )
+ #endif
+ FS_SetGamedir("qw");
++ }
++
++ if (home != NULL) {
++ snprintf(homepath, sizeof(homepath), "%s/.ezquake/%s", home, com_gamedirfile);
++ COM_CreatePath(homepath);
++ Sys_mkdir(homepath);
++ FS_AddGameDirectory(homepath);
+ }
+ }
+
diff --git a/games/ezquake/files/patch-config_manager.c b/games/ezquake/files/patch-config_manager.c
index 7b556b2e78f..ac6bff68892 100644
--- a/games/ezquake/files/patch-config_manager.c
+++ b/games/ezquake/files/patch-config_manager.c
@@ -1,11 +1,11 @@
--- config_manager.c.orig Tue Apr 18 17:59:55 2006
+++ config_manager.c Wed Aug 30 19:01:17 2006
@@ -67,7 +67,7 @@
- cvar_t cfg_save_unchanged = {"cfg_save_unchanged", "0"};
- cvar_t cfg_save_userinfo = {"cfg_save_userinfo", "2"};
- cvar_t cfg_legacy_exec = {"cfg_legacy_exec", "1"};
--cvar_t cfg_legacy_write = {"cfg_legacy_write", "0"};
-+cvar_t cfg_legacy_write = {"cfg_legacy_write", "1"};
-
- cvar_t cfg_save_cvars = {"cfg_save_cvars", "1"};
- cvar_t cfg_save_aliases = {"cfg_save_aliases", "1"};
+ cvar_t cfg_save_unchanged = {"cfg_save_unchanged", "0"};
+ cvar_t cfg_save_userinfo = {"cfg_save_userinfo", "2"};
+ cvar_t cfg_legacy_exec = {"cfg_legacy_exec", "1"};
+-cvar_t cfg_legacy_write = {"cfg_legacy_write", "0"};
++cvar_t cfg_legacy_write = {"cfg_legacy_write", "1"};
+
+ cvar_t cfg_save_cvars = {"cfg_save_cvars", "1"};
+ cvar_t cfg_save_aliases = {"cfg_save_aliases", "1"};
diff --git a/games/ezquake/files/patch-host.c b/games/ezquake/files/patch-host.c
new file mode 100644
index 00000000000..7e1378c0eab
--- /dev/null
+++ b/games/ezquake/files/patch-host.c
@@ -0,0 +1,11 @@
+--- host.c.orig Tue Dec 19 19:51:09 2006
++++ host.c Tue Dec 19 19:51:13 2006
+@@ -249,7 +249,7 @@
+
+ #ifdef __i386__
+ unsigned long long old_tsc, tsc_freq;
+- struct timeval tp, tp_old;
++ struct timeval tp, old_tp;
+ #endif
+
+ mib[0] = CTL_HW;
diff --git a/games/ezquake/files/patch-image.c b/games/ezquake/files/patch-image.c
index 6204632f299..4dac1571b6d 100644
--- a/games/ezquake/files/patch-image.c
+++ b/games/ezquake/files/patch-image.c
@@ -1,19 +1,10 @@
---- ./image.c.orig Sat Apr 8 10:15:01 2006
-+++ ./image.c Tue Aug 29 20:59:12 2006
+--- image.c.orig Thu Dec 14 10:04:06 2006
++++ image.c Tue Dec 19 19:00:49 2006
@@ -20,6 +20,7 @@
- $Id: image.c,v 1.20 2006/04/08 13:15:01 disconn3ct Exp $
- */
-
-+#include <dlfcn.h>
- #include "quakedef.h"
-
-
-@@ -1271,7 +1272,7 @@
-
- static QLIB_HANDLETYPE_T jpeg_handle = NULL;
-
--#define qjpeg_create_compress(cinfo) \
-+#define qjpeg_create_compress(cinfo) \
- qjpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, (size_t) sizeof(struct jpeg_compress_struct))
-
- static struct jpeg_error_mgr *(*qjpeg_std_error)(struct jpeg_error_mgr *);
+ $Id: image.c,v 1.33 2006/12/14 13:04:06 disconn3ct Exp $
+ */
+
++#include <dlfcn.h>
+ #include "quakedef.h"
+
+
diff --git a/games/ezquake/files/patch-menu.h b/games/ezquake/files/patch-menu.h
deleted file mode 100644
index 4bb9bbaa298..00000000000
--- a/games/ezquake/files/patch-menu.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./menu.h.orig Thu Apr 6 13:47:34 2006
-+++ ./menu.h Tue Aug 29 21:09:39 2006
-@@ -34,7 +34,7 @@
- m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer,
- m_setup, m_options, m_video, m_keys, m_help, m_quit,
- m_gameoptions, m_slist,/* m_sedit,*/ m_fps, m_demos, m_demos_del
--#if defined(_WIN32) || (defined(__linux__) && defined(WITH_XMMS))
-+#if defined(_WIN32) || (defined(__unix__) && defined(WITH_XMMS))
- , m_mp3_control, m_mp3_playlist
- #endif
- } m_state;
diff --git a/games/ezquake/files/patch-modules.c b/games/ezquake/files/patch-modules.c
index 64904d62fe1..e3b4382a3f2 100644
--- a/games/ezquake/files/patch-modules.c
+++ b/games/ezquake/files/patch-modules.c
@@ -1,10 +1,10 @@
--- ./modules.c.orig Mon Mar 20 10:51:27 2006
+++ ./modules.c Tue Aug 29 20:59:12 2006
@@ -20,6 +20,7 @@
- $Id: modules.c,v 1.8 2006/03/20 13:51:27 vvd0 Exp $
- */
-
-+#include <dlfcn.h>
- #include "quakedef.h"
-
-
+ $Id: modules.c,v 1.8 2006/03/20 13:51:27 vvd0 Exp $
+ */
+
++#include <dlfcn.h>
+ #include "quakedef.h"
+
+
diff --git a/games/ezquake/files/patch-mp3_player.c b/games/ezquake/files/patch-mp3_player.c
index 1f9bb8f2da5..561213a9679 100644
--- a/games/ezquake/files/patch-mp3_player.c
+++ b/games/ezquake/files/patch-mp3_player.c
@@ -1,31 +1,31 @@
--- mp3_player.c.orig Thu Apr 6 20:23:18 2006
+++ mp3_player.c Wed Aug 30 20:11:52 2006
@@ -21,6 +21,7 @@
- */
-
-
-+#include <dlfcn.h>
- #include "quakedef.h"
- #include "mp3_player.h"
-
+ */
+
+
++#include <dlfcn.h>
+ #include "quakedef.h"
+ #include "mp3_player.h"
+
@@ -58,9 +59,10 @@
-
- #include <sys/wait.h>
- #include <sys/types.h> // fork, execv, usleep
-+#include <signal.h>
- #include <unistd.h> // fork, execv, usleep
-
--cvar_t mp3_dir = {"mp3_xmms_dir", "/usr/local/bin"};
-+cvar_t mp3_dir = {"mp3_xmms_dir", "%%X11BASE%%/bin"};
- cvar_t mp3_xmms_session = {"mp3_xmms_session", "0"};
-
- #endif
+
+ #include <sys/wait.h>
+ #include <sys/types.h> // fork, execv, usleep
++#include <signal.h>
+ #include <unistd.h> // fork, execv, usleep
+
+-cvar_t mp3_dir = {"mp3_xmms_dir", "/usr/local/bin"};
++cvar_t mp3_dir = {"mp3_xmms_dir", "%%X11BASE%%/bin"};
+ cvar_t mp3_xmms_session = {"mp3_xmms_session", "0"};
+
+ #endif
@@ -134,7 +136,7 @@
- }
-
- static void XMMS_LoadLibrary(void) {
-- if (!(libxmms_handle = dlopen("libxmms.so.1", RTLD_NOW)) && !(libxmms_handle = dlopen("libxmms.so", RTLD_NOW)))
-+ if (!(libxmms_handle = dlopen("libxmms.so", RTLD_NOW)))
- return;
-
- if (!QLib_ProcessProcdef(libxmms_handle, xmmsProcs, NUM_XMMSPROCS)) {
+ }
+
+ static void XMMS_LoadLibrary(void) {
+- if (!(libxmms_handle = dlopen("libxmms.so.1", RTLD_NOW)) && !(libxmms_handle = dlopen("libxmms.so", RTLD_NOW)))
++ if (!(libxmms_handle = dlopen("libxmms.so", RTLD_NOW)))
+ return;
+
+ if (!QLib_ProcessProcdef(libxmms_handle, xmmsProcs, NUM_XMMSPROCS)) {
diff --git a/games/ezquake/files/patch-mp3_player.h b/games/ezquake/files/patch-mp3_player.h
deleted file mode 100644
index 6d01cb2557d..00000000000
--- a/games/ezquake/files/patch-mp3_player.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./mp3_player.h.orig Fri Sep 9 08:00:27 2005
-+++ ./mp3_player.h Tue Aug 29 21:05:59 2006
-@@ -19,7 +19,7 @@
- */
-
-
--#if defined(__linux__) && defined(WITH_XMMS)
-+#if defined(__unix__) && defined(WITH_XMMS)
- #define __XMMS__
- #endif
-
diff --git a/games/ezquake/files/patch-q_shared.h b/games/ezquake/files/patch-q_shared.h
new file mode 100644
index 00000000000..b6fc12a7a0c
--- /dev/null
+++ b/games/ezquake/files/patch-q_shared.h
@@ -0,0 +1,35 @@
+--- q_shared.h.orig Tue Dec 5 22:01:04 2006
++++ q_shared.h Tue Dec 19 19:45:32 2006
+@@ -31,6 +31,7 @@
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <assert.h>
++#include <machine/endian.h>
+
+ #include "mathlib.h"
+ #include "sys.h"
+@@ -114,21 +115,21 @@
+ float FloatSwapPDP2Big (float f);
+ float FloatSwapPDP2Lit (float f);
+
+-#ifdef __BIG_ENDIAN__Q__
++#if BYTE_ORDER == BIG_ENDIAN
+ #define BigShort(x) (x)
+ #define BigLong(x) (x)
+ #define BigFloat(x) (x)
+ #define LittleShort(x) ShortSwap(x)
+ #define LittleLong(x) LongSwap(x)
+ #define LittleFloat(x) FloatSwap(x)
+-#elif defined(__LITTLE_ENDIAN__Q__)
++#elif BYTE_ORDER == LITTLE_ENDIAN
+ #define BigShort(x) ShortSwap(x)
+ #define BigLong(x) LongSwap(x)
+ #define BigFloat(x) FloatSwap(x)
+ #define LittleShort(x) (x)
+ #define LittleLong(x) (x)
+ #define LittleFloat(x) (x)
+-#elif defined(__PDP_ENDIAN__Q__)
++#elif BYTE_ORDER == PDP_ENDIAN
+ #define BigShort(x) ShortSwap(x)
+ #define BigLong(x) LongSwapPDP2Big(x)
+ #define BigFloat(x) FloatSwapPDP2Big(x)
diff --git a/games/ezquake/files/patch-quakeasm.h b/games/ezquake/files/patch-quakeasm.h
deleted file mode 100644
index 51396555c03..00000000000
--- a/games/ezquake/files/patch-quakeasm.h
+++ /dev/null
@@ -1,15 +0,0 @@
---- quakeasm.h.orig Tue Jul 5 17:01:34 2005
-+++ quakeasm.h Thu Aug 31 17:29:32 2006
-@@ -25,12 +25,6 @@
- #define __i386__ 1
- #endif
-
--#ifdef __i386__
--#define id386 1
--#else
--#define id386 0
--#endif
--
- #ifndef SERVERONLY
-
- // !!! must be kept the same as in d_iface.h !!!
diff --git a/games/ezquake/files/patch-snd_dma.c b/games/ezquake/files/patch-snd_dma.c
new file mode 100644
index 00000000000..d746ea7aff5
--- /dev/null
+++ b/games/ezquake/files/patch-snd_dma.c
@@ -0,0 +1,20 @@
+--- snd_dma.c.orig Thu Oct 19 16:52:41 2006
++++ snd_dma.c Tue Dec 19 20:53:19 2006
+@@ -90,7 +90,7 @@
+ cvar_t s_swapstereo = {"s_swapstereo", "0", CVAR_ARCHIVE};
+
+ cvar_t s_khz = {"s_khz", "11", CVAR_ARCHIVE};
+-#ifdef __linux__
++#ifdef __unix__
+ cvar_t s_noalsa = {"s_noalsa", "0"};
+ // ALSA only -->
+ cvar_t s_stereo = {"s_stereo", "1"};
+@@ -185,7 +185,7 @@
+ Cvar_Register(&s_show);
+ Cvar_Register(&s_mixahead);
+ Cvar_Register(&s_swapstereo);
+-#ifdef __linux__
++#ifdef __unix__
+ Cvar_Register(&s_noalsa);
+ Cvar_Register(&s_stereo);
+ Cvar_Register(&s_device);
diff --git a/games/ezquake/files/patch-snd_linux.c b/games/ezquake/files/patch-snd_linux.c
index 25773fb9449..d0540851a46 100644
--- a/games/ezquake/files/patch-snd_linux.c
+++ b/games/ezquake/files/patch-snd_linux.c
@@ -1,90 +1,77 @@
---- ./snd_linux.c.orig Fri Sep 9 08:00:27 2005
-+++ ./snd_linux.c Tue Aug 29 20:59:12 2006
-@@ -6,7 +6,6 @@
-
- #include "quakedef.h"
-
--qbool SNDDMA_ALSA;
- int snd_inited;
- // Note: The functions here keep track of if the sound system is inited.
- // They perform checks so that the real functions are only called if
-@@ -15,13 +14,9 @@
-
- // Prototypes
-
--qbool SNDDMA_Init_ALSA(void);
- qbool SNDDMA_Init_OSS(void);
--int SNDDMA_GetDMAPos_ALSA(void);
- int SNDDMA_GetDMAPos_OSS(void);
--void SNDDMA_Shutdown_ALSA(void);
- void SNDDMA_Shutdown_OSS(void);
--void SNDDMA_Submit_ALSA(void);
- void SNDDMA_Submit_OSS(void);
-
-
-@@ -31,30 +26,8 @@
- {
- int retval;
-
-- // Give user the option to force OSS...
-- if(COM_CheckParm("-noalsa")) // || Cvar_VariableValue("s_noalsa") )
-- {
-- // User wants us to use OSS...
-- Com_Printf("sound: Using OSS at user's request...\n");
-- retval = SNDDMA_Init_OSS();
-- }
-- else
-- {
-- // Try ALSA first...
-- Com_Printf("sound: Attempting to initialise ALSA...\n");
-- retval = SNDDMA_Init_ALSA();
-- if( retval )
-- {
-- SNDDMA_ALSA = true;
-- }
-- else
-- {
-- // Fall back to OSS...
-- SNDDMA_ALSA = false;
-- Com_Printf("sound: Falling back to OSS...\n");
-- retval = SNDDMA_Init_OSS();
-- }
-- }
-+ Com_Printf("sound: Initializing OSS...\n");
-+ retval = SNDDMA_Init_OSS();
-
- snd_inited = retval;
- return retval;
-@@ -64,10 +37,7 @@
- {
- if( snd_inited )
- {
-- if( SNDDMA_ALSA )
-- return SNDDMA_GetDMAPos_ALSA();
-- else
-- return SNDDMA_GetDMAPos_OSS();
-+ return SNDDMA_GetDMAPos_OSS();
- }
- else
- return 0;
-@@ -77,10 +47,7 @@
- {
- if (snd_inited)
- {
-- if( SNDDMA_ALSA )
-- SNDDMA_Shutdown_ALSA();
-- else
-- SNDDMA_Shutdown_OSS();
-+ SNDDMA_Shutdown_OSS();
-
- snd_inited = 0;
- }
-@@ -97,8 +64,6 @@
- {
- if( snd_inited )
- {
-- if( SNDDMA_ALSA )
-- SNDDMA_Submit_ALSA();
- // OSS doesn't use this so no need to call it.
- }
- }
+--- snd_linux.c.orig Tue May 16 06:40:16 2006
++++ snd_linux.c Tue Dec 19 19:22:24 2006
+@@ -21,19 +21,14 @@
+
+ #include "quakedef.h"
+
+-static qbool SNDDMA_ALSA = true;
+ // Note: The functions here keep track of if the sound system is inited.
+ // They perform checks so that the real functions are only called if appropriate.
+
+
+ // Prototypes
+-qbool SNDDMA_Init_ALSA(void);
+ qbool SNDDMA_Init_OSS(void);
+-int SNDDMA_GetDMAPos_ALSA(void);
+ int SNDDMA_GetDMAPos_OSS(void);
+-void SNDDMA_Shutdown_ALSA(void);
+ void SNDDMA_Shutdown_OSS(void);
+-void SNDDMA_Submit_ALSA(void);
+
+
+ // Main functions
+@@ -41,49 +36,24 @@
+ {
+ int retval;
+
+- // Give user the option to force OSS...
+- if (Cvar_VariableValue("s_noalsa")) {
+- // User wants us to use OSS...
+- SNDDMA_ALSA = false;
+- Com_Printf("sound: Using OSS at user's request...\n");
+- retval = SNDDMA_Init_OSS();
+- } else {
+- // Try ALSA first...
+- Com_Printf("sound: Attempting to initialise ALSA...\n");
+- retval = SNDDMA_Init_ALSA();
+- if (retval) {
+- SNDDMA_ALSA = true;
+- } else {
+- // Fall back to OSS...
+- SNDDMA_ALSA = false;
+- Com_Printf("sound: Falling back to OSS...\n");
+- retval = SNDDMA_Init_OSS();
+- }
+- }
++ Com_Printf("sound: Initializing OSS...\n");
++ retval = SNDDMA_Init_OSS();
+
+ return retval;
+ }
+
+ int SNDDMA_GetDMAPos(void)
+ {
+- if (SNDDMA_ALSA)
+- return SNDDMA_GetDMAPos_ALSA();
+- else
+- return SNDDMA_GetDMAPos_OSS();
++ return SNDDMA_GetDMAPos_OSS();
+ }
+
+ void SNDDMA_Shutdown(void)
+ {
+- if (SNDDMA_ALSA)
+- SNDDMA_Shutdown_ALSA();
+- else
+- SNDDMA_Shutdown_OSS();
++ SNDDMA_Shutdown_OSS();
+ }
+
+ //Send sound to device if buffer isn't really the dma buffer
+ void SNDDMA_Submit(void)
+ {
+- if (SNDDMA_ALSA)
+- SNDDMA_Submit_ALSA();
+- // OSS doesn't use this so no need to call it.
++ // OSS doesn't use this so no need to call it.
+ }
diff --git a/games/ezquake/files/patch-snd_oss.c b/games/ezquake/files/patch-snd_oss.c
index cdcf188f7db..c3c468b6ef3 100644
--- a/games/ezquake/files/patch-snd_oss.c
+++ b/games/ezquake/files/patch-snd_oss.c
@@ -1,5 +1,5 @@
---- snd_oss.c.orig Mon Mar 20 10:51:28 2006
-+++ snd_oss.c Wed Aug 30 20:09:50 2006
+--- snd_oss.c.orig Wed Nov 15 16:21:49 2006
++++ snd_oss.c Tue Dec 19 19:26:57 2006
@@ -27,7 +27,11 @@
#include <sys/mman.h>
#include <sys/shm.h>
@@ -12,64 +12,31 @@
#include <stdio.h>
#include "quakedef.h"
-@@ -78,13 +82,6 @@
+@@ -70,13 +74,6 @@
return 0;
}
-- if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1) {
-- perror("GETOSPACE");
-- Com_Printf ("Um, can't do GETOSPACE?\n");
-- close(audio_fd);
-- return 0;
-- }
--
- shm = &sn;
- shm->splitbuffer = 0;
-
-@@ -125,19 +122,6 @@
- else
- shm->channels = 2;
-
-- shm->samples = info.fragstotal * info.fragsize / (shm->samplebits/8);
-- shm->submission_chunk = 1;
--
-- // memory map the dma buffer
--
-- shm->buffer = (byte *) mmap(NULL, info.fragstotal * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
-- if (!shm->buffer) {
-- perror(snd_dev);
-- Com_Printf ("Could not mmap %s\n", snd_dev);
+- if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1) {
+- perror("GETOSPACE");
+- Com_Printf("Um, can't do GETOSPACE?\n");
- close(audio_fd);
- return 0;
- }
-
- tmp = 0;
- if (shm->channels == 2)
- tmp = 1;
-@@ -182,6 +166,26 @@
- } else {
+ // set sample bits & speed
+ shm->format.width = (int) (s_bits.value / 8);
+ shm->format.speed = SND_Rate((int)s_khz.value);
+@@ -127,6 +124,13 @@
+ } else {
perror(snd_dev);
- Com_Printf ("%d-bit sound not supported.", shm->samplebits);
+ Com_Printf("%d-bit sound not supported.", shm->format.width * 8);
+ close(audio_fd);
+ return 0;
+ }
+
-+ if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1) {
-+ perror("GETOSPACE");
-+ Com_Printf ("Um, can't do GETOSPACE?\n");
-+ close(audio_fd);
-+ return 0;
-+ }
-+
-+ shm->samples = info.fragstotal * info.fragsize / (shm->samplebits/8);
-+ shm->submission_chunk = 1;
-+
-+ // memory map the dma buffer
-+
-+ shm->buffer = (byte *) mmap(NULL, info.fragstotal * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
-+ if (!shm->buffer) {
-+ perror(snd_dev);
-+ Com_Printf ("Could not mmap %s\n", snd_dev);
++ if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1) {
++ perror("GETOSPACE");
++ Com_Printf("Um, can't do GETOSPACE?\n");
close(audio_fd);
return 0;
}
diff --git a/games/ezquake/files/patch-sys_linux.c b/games/ezquake/files/patch-sys_linux.c
index 46d2cdb2692..abe36a55b88 100644
--- a/games/ezquake/files/patch-sys_linux.c
+++ b/games/ezquake/files/patch-sys_linux.c
@@ -1,26 +1,26 @@
--- ./sys_linux.c.orig Mon Mar 20 10:51:28 2006
+++ ./sys_linux.c Tue Aug 29 20:59:12 2006
@@ -35,7 +35,6 @@
- #include <ctype.h>
- #include <sys/wait.h>
- #include <sys/mman.h>
--#include <linux/rtc.h>
- #include <sys/ioctl.h>
- #include <sys/poll.h>
- #include <sched.h>
+ #include <ctype.h>
+ #include <sys/wait.h>
+ #include <sys/mman.h>
+-#include <linux/rtc.h>
+ #include <sys/ioctl.h>
+ #include <sys/poll.h>
+ #include <sched.h>
@@ -256,6 +255,7 @@
- if (COM_CheckParm("-nostdout"))
- sys_nostdout.value = 1;
-
-+#if 0
- /* also check for -rtctimer before Host_Init is called */
- if (COM_CheckParm("-rtctimer")) {
- int retval;
+ if (COM_CheckParm("-nostdout"))
+ sys_nostdout.value = 1;
+
++#if 0
+ /* also check for -rtctimer before Host_Init is called */
+ if (COM_CheckParm("-rtctimer")) {
+ int retval;
@@ -292,6 +292,7 @@
-
- Com_Printf("RTC Timer Enabled.\n");
- }
-+#endif
-
- #if id386
- Sys_SetFPCW();
+
+ Com_Printf("RTC Timer Enabled.\n");
+ }
++#endif
+
+ #if id386
+ Sys_SetFPCW();
diff --git a/games/ezquake/files/patch-vid_glx.c b/games/ezquake/files/patch-vid_glx.c
deleted file mode 100644
index bd5ad2a39c5..00000000000
--- a/games/ezquake/files/patch-vid_glx.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- ./vid_glx.c.orig Thu Apr 6 20:23:19 2006
-+++ ./vid_glx.c Tue Aug 29 20:59:12 2006
-@@ -20,7 +20,9 @@
- #include <termios.h>
- #include <sys/ioctl.h>
- #include <sys/stat.h>
-+#ifdef __linux__
- #include <sys/vt.h>
-+#endif
- #include <stdarg.h>
- #include <stdio.h>
- #include <signal.h>