aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2006-05-22 05:28:29 +0800
committeralepulver <alepulver@FreeBSD.org>2006-05-22 05:28:29 +0800
commitacb2fc4a9c95e7c0990f37ec6ecffd92b167e552 (patch)
tree55f2af368cc1d0e8f4acea33a4266f0968ef3ebc /games
parent4a9e5d22e05058c5bc4a4fe88afc56522bc0d729 (diff)
downloadfreebsd-ports-gnome-acb2fc4a9c95e7c0990f37ec6ecffd92b167e552.tar.gz
freebsd-ports-gnome-acb2fc4a9c95e7c0990f37ec6ecffd92b167e552.tar.zst
freebsd-ports-gnome-acb2fc4a9c95e7c0990f37ec6ecffd92b167e552.zip
Enhaced Quake engine based on JoeQuake.
WWW: http://tremor.quakedev.com/tremor.html Approved by: garga (mentor)
Diffstat (limited to 'games')
-rw-r--r--games/Makefile1
-rw-r--r--games/tremor/Makefile99
-rw-r--r--games/tremor/distinfo12
-rw-r--r--games/tremor/files/patch-Makefile116
-rw-r--r--games/tremor/files/patch-src__cd_linux.c252
-rw-r--r--games/tremor/files/patch-src__common.c48
-rw-r--r--games/tremor/files/patch-src__host.c11
-rw-r--r--games/tremor/files/patch-src__keys.c11
-rw-r--r--games/tremor/files/patch-src__net.h11
-rw-r--r--games/tremor/files/patch-src__snd_linux.c14
-rw-r--r--games/tremor/files/patch-src__sys.h11
-rw-r--r--games/tremor/files/patch-src__vid_glx.c12
-rw-r--r--games/tremor/pkg-descr3
-rw-r--r--games/tremor/pkg-message15
-rw-r--r--games/tremor/pkg-plist16
15 files changed, 632 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index ae192a89b4a9..b3a701e208a0 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -639,6 +639,7 @@
SUBDIR += trackballs
SUBDIR += tractorgen
SUBDIR += traindirector
+ SUBDIR += tremor
SUBDIR += trigger
SUBDIR += trimines
SUBDIR += trojka
diff --git a/games/tremor/Makefile b/games/tremor/Makefile
new file mode 100644
index 000000000000..3d4585edea59
--- /dev/null
+++ b/games/tremor/Makefile
@@ -0,0 +1,99 @@
+# New ports collection makefile for: tremor
+# Date created: 15 May 2006
+# Whom: alepulver
+#
+# $FreeBSD$
+#
+
+PORTNAME= tremor
+PORTVERSION= 3.2.4
+CATEGORIES= games
+MASTER_SITES= http://qudos.quakedev.com/linux/quake1/:src \
+ http://tremor.quakedev.com/:data
+DISTFILES= Tremor-v${PORTVERSION}-bin-src.linux.tar.bz2:src \
+ tremor_3.2.4-bin.zip:data
+DIST_SUBDIR= ${PORTNAME}
+EXTRACT_ONLY= Tremor-v${PORTVERSION}-bin-src.linux.tar.bz2
+
+MAINTAINER= alepulver@FreeBSD.org
+COMMENT= Enhaced Quake engine based on JoeQuake
+
+LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
+ png.5:${PORTSDIR}/graphics/png
+EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip
+
+USE_BZIP2= yes
+USE_GCC= 3.2+
+USE_GL= yes
+USE_GMAKE= yes
+
+OPTIONS= GOODIES "Extra graphics, DM maps and models" off \
+ OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
+ SDL "Build SDL client" on \
+ TEXTURES "Collection of extra textures" off \
+ X86_ASM "Enable x86 assembly code when possible" on
+
+WRKSRC= ${WRKDIR}/Tremor_${PORTVERSION}-bin-src.linux
+ALL_TARGET= release
+
+.include "${.CURDIR}/../quake-data/Makefile.include"
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_GOODIES)
+DISTFILES+= tremor_goodies.zip:data
+PLIST_SUB+= GOODIES=""
+.else
+PLIST_SUB+= GOODIES="@comment "
+.endif
+
+.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
+MAKE_ENV+= OPTIMIZED_CFLAGS=YES
+.endif
+
+.if !defined(WITHOUT_SDL)
+USE_SDL= sdl
+MAKE_ENV+= BUILD_SDL=YES
+PLIST_SUB+= SDL=""
+.else
+PLIST_SUB+= SDL="@comment "
+.endif
+
+.if defined(WITH_TEXTURES)
+DISTFILES+= tremor_texture_packX.zip:data
+PLIST_SUB+= TEXTURES=""
+.else
+PLIST_SUB+= TEXTURES="@comment "
+.endif
+
+.if !defined(WITHOUT_X86_ASM)
+MAKE_ENV+= X86_ASM=YES
+.endif
+
+post-extract:
+ @${UNZIP_CMD} -q ${DISTDIR}/${DIST_SUBDIR}/tremor_3.2.4-bin.zip \
+ base/*.cfg.bak base/tremor0.pak "base/textures/*" -d ${WRKDIR}
+ @cd ${WRKDIR}/base && ${MV} config.cfg.bak config.cfg && \
+ ${MV} autoexec.cfg.bak autoexec.cfg
+.if defined(WITH_GOODIES)
+ @${UNZIP_CMD} -qL ${DISTDIR}/${DIST_SUBDIR}/tremor_goodies.zip \
+ -d ${WRKDIR}
+.endif
+.if defined(WITH_TEXTURES)
+ @${UNZIP_CMD} -q ${DISTDIR}/${DIST_SUBDIR}/tremor_texture_packX.zip \
+ -d ${WRKDIR}
+.endif
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/release/${PORTNAME} ${PREFIX}/bin
+.if !defined(WITHOUT_SDL)
+ ${INSTALL_PROGRAM} ${WRKSRC}/release/${PORTNAME}-sdl ${PREFIX}/bin
+.endif
+ ${MKDIR} ${Q1DIR}/${PORTNAME}
+ ${CP} -R ${WRKDIR}/base/* ${Q1DIR}/${PORTNAME}
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/tremor.txt ${DOCSDIR}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/games/tremor/distinfo b/games/tremor/distinfo
new file mode 100644
index 000000000000..7b6a79da788a
--- /dev/null
+++ b/games/tremor/distinfo
@@ -0,0 +1,12 @@
+MD5 (tremor/Tremor-v3.2.4-bin-src.linux.tar.bz2) = 303912bdee7f7a525c9859a33d01d36f
+SHA256 (tremor/Tremor-v3.2.4-bin-src.linux.tar.bz2) = c31d6ac7b37971315b1ee7677ca04594e3aaa564209a63413697761c39e2dff6
+SIZE (tremor/Tremor-v3.2.4-bin-src.linux.tar.bz2) = 1186180
+MD5 (tremor/tremor_3.2.4-bin.zip) = b478c32cbe75f3b3f91285f00f1a4ae1
+SHA256 (tremor/tremor_3.2.4-bin.zip) = 3b1fe258c8b9850ddce9640ec462a5348be6604ab359b21031e908e53834551e
+SIZE (tremor/tremor_3.2.4-bin.zip) = 5432207
+MD5 (tremor/tremor_goodies.zip) = cad43eedc8c336ca185112ad4c3335ef
+SHA256 (tremor/tremor_goodies.zip) = 6afd3fa05041fdc63f18d66307e4efeb4ef9fa15d741935b638a74533db29588
+SIZE (tremor/tremor_goodies.zip) = 32417292
+MD5 (tremor/tremor_texture_packX.zip) = a20d1aa14165ac1f2898833be79f43ad
+SHA256 (tremor/tremor_texture_packX.zip) = c38b1c4b10ce478573ef3140f78e08f85ff2a958d7a34ee38a1f32fe5b356db6
+SIZE (tremor/tremor_texture_packX.zip) = 120875810
diff --git a/games/tremor/files/patch-Makefile b/games/tremor/files/patch-Makefile
new file mode 100644
index 000000000000..2bb7f2ec8dac
--- /dev/null
+++ b/games/tremor/files/patch-Makefile
@@ -0,0 +1,116 @@
+--- ./Makefile.orig Thu Nov 10 09:57:12 2005
++++ ./Makefile Tue May 16 14:59:52 2006
+@@ -9,9 +9,9 @@
+ #
+
+ BASEVERSION=1.09
+-VERSION=$(BASEVERSION)$(GLIBC)
++VERSION=$(BASEVERSION)
+
+-BUILD_SDL=YES # Tremor sdl glx executable (uses SDL for cdrom and sound)
++#BUILD_SDL=YES # Tremor sdl glx executable (uses SDL for cdrom and sound)
+
+ ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6 ];then echo libc6;fi)))
+ GLIBC=-glibc
+@@ -19,45 +19,49 @@
+ GLIBC=
+ endif
+
+-ifneq (,$(findstring alpha,$(shell uname -m)))
+-ARCH=axp
+-else
+-ARCH=i386
+-endif
++ARCH=$(shell uname -m)
+ NOARCH=noarch
+
+ MOUNT_DIR=./src
+
+-BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC)
+-BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC)
++BUILD_DEBUG_DIR=debug
++BUILD_RELEASE_DIR=release
+
+-CC=gcc
++CC?=gcc
+
+-BASE_CFLAGS=-Dstricmp=strcasecmp -Did386 -funsigned-char #-Wall
++BASE_CFLAGS=$(CFLAGS) -I$(LOCALBASE)/include -DDATADIR='"$(Q1DIR)"' -Dstricmp=strcasecmp -funsigned-char #-Wall
++
++ifeq ($(ARCH),i386)
++ ifdef X86_ASM
++BASE_CFLAGS+=-Did386
++ endif
++endif
++
++RELEASE_CFLAGS=$(BASE_CFLAGS)
++
++ifdef OPTIMIZED_CFLAGS
++RELEASE_CFLAGS+=-O2 -ffast-math -funroll-loops \
++ -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
++endif
+
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -march=i686 -O2 -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing -pipe
+-
+ DEBUG_CFLAGS=$(BASE_CFLAGS) -g
+
+
+-LDFLAGS=-lm -ldl
++LDFLAGS+=-L$(LOCALBASE)/lib -lm
+
+ ifeq ($(strip $(BUILD_SDL)),YES)
+- LDFLAGS += \
+- -lSDL
+ BASE_CFLAGS += \
+ -D_SDL_FIX -D_SDL_BIN
+ endif
+
+
+ ifeq ($(strip $(BUILD_SDL)),YES)
+-SDLCFLAGS=$(shell sdl-config --cflags)
+-SDLLDFLAGS=$(shell sdl-config --libs)
++SDLCFLAGS=$(shell $(SDL_CONFIG) --cflags)
++SDLLDFLAGS=$(shell $(SDL_CONFIG) --libs)
+ endif
+
+-GLLDFLAGS=-L/usr/X11R6/lib -L/usr/lib -L/usr/local/lib -lGL -lGLU -lX11 -lXext -ldl -lXxf86dga -lXxf86vm -lm -lpng -lz -ljpeg
+-GLCFLAGS= -I/usr/include -I/usr/X11R6/include
++GLLDFLAGS=-L$(X11BASE)/lib -lGL -lGLU -lX11 -lXext -lXxf86dga -lXxf86vm -lpng -lz -ljpeg
++GLCFLAGS=-I$(X11BASE)/include
+
+ DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
+ DO_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -o $@ -c $<
+@@ -73,10 +77,10 @@
+ # SETUP AND BUILD
+ #############################################################################
+
+-TARGETS=$(BUILDDIR)/tremor.glx
++TARGETS=$(BUILDDIR)/tremor
+
+ ifeq ($(strip $(BUILD_SDL)),YES)
+- TARGETS +=$(BUILDDIR)/tremor-sdl.glx
++ TARGETS +=$(BUILDDIR)/tremor-sdl
+ endif
+
+ all:
+@@ -183,10 +187,10 @@
+ GLX_OBJS=$(BUILDDIR)/glquake/vid_glx.o \
+ $(BUILDDIR)/glquake/vid_common_gl.o
+
+-$(BUILDDIR)/tremor.glx : $(GLQUAKE_OBJS) $(GLQUAKE_LNX_OBJS) $(GLX_OBJS)
++$(BUILDDIR)/tremor : $(GLQUAKE_OBJS) $(GLQUAKE_LNX_OBJS) $(GLX_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(GLQUAKE_OBJS) $(GLQUAKE_LNX_OBJS) $(GLX_OBJS) $(GLLDFLAGS) $(LDFLAGS)
+
+-$(BUILDDIR)/tremor-sdl.glx : $(GLQUAKE_OBJS) $(GLQUAKE_SDL_OBJS) $(GLX_OBJS)
++$(BUILDDIR)/tremor-sdl : $(GLQUAKE_OBJS) $(GLQUAKE_SDL_OBJS) $(GLX_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(GLQUAKE_OBJS) $(GLQUAKE_SDL_OBJS) $(GLX_OBJS) $(GLLDFLAGS) $(LDFLAGS) $(SDLLDFLAGS)
+
+ $(BUILDDIR)/glquake/cl_demo.o : $(MOUNT_DIR)/cl_demo.c
+@@ -395,4 +399,4 @@
+ $(GLX_OBJS) \
+ $(GLQUAKE_LNX_OBJS) \
+ $(GLQUAKE_SDL_OBJS)
+-
+\ No newline at end of file
++
diff --git a/games/tremor/files/patch-src__cd_linux.c b/games/tremor/files/patch-src__cd_linux.c
new file mode 100644
index 000000000000..78e5d12e4eca
--- /dev/null
+++ b/games/tremor/files/patch-src__cd_linux.c
@@ -0,0 +1,252 @@
+--- ./src/cd_linux.c.orig Sun Sep 12 09:41:28 2004
++++ ./src/cd_linux.c Tue May 16 14:59:52 2006
+@@ -31,7 +31,11 @@
+ #include <time.h>
+ #include <errno.h>
+
++#ifdef __FreeBSD__
++#include <sys/cdio.h>
++#else
+ #include <linux/cdrom.h>
++#endif
+
+ #include "quakedef.h"
+
+@@ -54,8 +58,13 @@
+ if (cdfile == -1 || !enabled)
+ return; // no cd init'd
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCEJECT) == -1)
++ Con_DPrintf ("ioctl cdioceject failed\n");
++#else
+ if (ioctl(cdfile, CDROMEJECT) == -1)
+ Con_DPrintf ("ioctl cdromeject failed\n");
++#endif
+ }
+
+ static void CDAudio_CloseDoor (void)
+@@ -63,38 +72,67 @@
+ if (cdfile == -1 || !enabled)
+ return; // no cd init'd
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCCLOSE) == -1)
++ Con_DPrintf ("ioctl cdiocclose failed\n");
++#else
+ if (ioctl(cdfile, CDROMCLOSETRAY) == -1)
+ Con_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)
++ {
++ Con_DPrintf ("ioctl cdioreadtocheader failed\n");
++#else
+ if (ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1)
+ {
+ Con_DPrintf ("ioctl cdromreadtochdr failed\n");
++#endif
+ return -1;
+ }
+
++#ifdef __FreeBSD__
++ if (tochdr.starting_track < 1)
++#else
+ if (tochdr.cdth_trk0 < 1)
++#endif
+ {
+ Con_DPrintf ("CDAudio: no music tracks\n");
+ return -1;
+ }
+
+ cdValid = true;
++#ifdef __FreeBSD__
++ maxTrack = tochdr.ending_track;
++#else
+ maxTrack = tochdr.cdth_trk1;
++#endif
+
+ return 0;
+ }
+
+ void CDAudio_Play (byte track, qboolean 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;
+@@ -114,6 +152,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 )
++ {
++ Con_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;
+@@ -123,6 +176,7 @@
+ return;
+ }
+ if (entry.cdte_ctrl == CDROM_DATA_TRACK)
++#endif
+ {
+ Con_Printf ("CDAudio: track %i is not audio\n", track);
+ return;
+@@ -135,19 +189,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)
++ {
++ Con_DPrintf ("ioctl cdiocplaytracks failed\n");
++#else
+ if (ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1)
+ {
+ Con_DPrintf ("ioctl cdromplaytrkind failed\n");
++#endif
+ return;
+ }
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCRESUME) == -1)
++ Con_DPrintf ("ioctl cdiocresume failed\n");
++#else
+ if (ioctl(cdfile, CDROMRESUME) == -1)
+ Con_DPrintf ("ioctl cdromresume failed\n");
++#endif
+
+ playLooping = looping;
+ playTrack = track;
+@@ -165,8 +237,13 @@
+ if (!playing)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCSTOP) == -1)
++ Con_DPrintf ("ioctl cdiocstop failed (%d)\n", errno);
++#else
+ if (ioctl(cdfile, CDROMSTOP) == -1)
+ Con_DPrintf ("ioctl cdromstop failed (%d)\n", errno);
++#endif
+
+ wasPlaying = false;
+ playing = false;
+@@ -180,8 +257,13 @@
+ if (!playing)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCPAUSE) == -1)
++ Con_DPrintf ("ioctl cdiocpause failed\n");
++#else
+ if (ioctl(cdfile, CDROMPAUSE) == -1)
+ Con_DPrintf ("ioctl cdrompause failed\n");
++#endif
+
+ wasPlaying = playing;
+ playing = false;
+@@ -198,8 +280,13 @@
+ if (!wasPlaying)
+ return;
+
++#ifdef __FreeBSD__
++ if (ioctl(cdfile, CDIOCRESUME) == -1)
++ Con_DPrintf ("ioctl cdiocresume failed\n");
++#else
+ if (ioctl(cdfile, CDROMRESUME) == -1)
+ Con_DPrintf ("ioctl cdromresume failed\n");
++#endif
+ playing = true;
+ }
+
+@@ -322,7 +409,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)
+@@ -347,6 +439,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 ) {
++ Con_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)
+ {
+@@ -360,6 +470,7 @@
+ if (playLooping)
+ CDAudio_Play (playTrack, true);
+ }
++#endif
+ }
+ }
+
diff --git a/games/tremor/files/patch-src__common.c b/games/tremor/files/patch-src__common.c
new file mode 100644
index 000000000000..f74338828d0a
--- /dev/null
+++ b/games/tremor/files/patch-src__common.c
@@ -0,0 +1,48 @@
+--- ./src/common.c.orig Thu Nov 10 09:56:53 2005
++++ ./src/common.c Tue May 16 15:00:44 2006
+@@ -1769,14 +1769,18 @@
+ */
+ void COM_InitFilesystem (void)
+ {
++ char *home;
++ char homepath[MAX_OSPATH];
+ int i;
+
++ home = getenv("HOME");
++
+ // -basedir <path>
+ // Overrides the system supplied base directory (under GAMENAME)
+ if ((i = COM_CheckParm ("-basedir")) && i < com_argc-1)
+ Q_strncpyz (com_basedir, com_argv[i+1], sizeof(com_basedir));
+ else
+- Q_strncpyz (com_basedir, host_parms.basedir, sizeof(com_basedir));
++ Q_strncpyz (com_basedir, DATADIR, sizeof(com_basedir));
+
+ for (i=0 ; i < strlen(com_basedir) ; i++)
+ if (com_basedir[i] == '\\')
+@@ -1788,7 +1792,11 @@
+
+ // start up with GAMENAME by default (id1)
+ COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
+- COM_AddGameDirectory (va("%s/base", com_basedir)); // JT021305 - use base as default GAMENAME
++ if (home != NULL)
++ COM_AddGameDirectory(va("%s/.tremor/"GAMENAME, home));
++ COM_AddGameDirectory (va("%s/tremor", com_basedir)); // JT021305 - use base as default GAMENAME
++ if (home != NULL)
++ COM_AddGameDirectory(va("%s/.tremor/tremor", home));
+
+ if (COM_CheckParm("-rogue"))
+ COM_AddGameDirectory (va("%s/rogue", com_basedir));
+@@ -1807,4 +1815,12 @@
+ // Adds basedir/gamedir as an override game
+ if ((i = COM_CheckParm("-game")) && i < com_argc-1)
+ COM_AddGameDirectory (va("%s/%s", com_basedir, com_argv[i+1]));
++
++ if (home != NULL) {
++ Q_snprintfz(homepath, sizeof(homepath), "%s/.tremor/%s",
++ home, com_gamedirname);
++ COM_CreatePath(homepath);
++ Sys_mkdir(homepath);
++ COM_AddGameDirectory(homepath);
++ }
+ }
diff --git a/games/tremor/files/patch-src__host.c b/games/tremor/files/patch-src__host.c
new file mode 100644
index 000000000000..3105f6d8bebd
--- /dev/null
+++ b/games/tremor/files/patch-src__host.c
@@ -0,0 +1,11 @@
+--- ./src/host.c.orig Sat Mar 26 21:14:38 2005
++++ ./src/host.c Tue May 16 14:59:52 2006
+@@ -987,7 +987,7 @@
+ Host_WriteConfiguration ();
+
+ // joe: same here
+- if (con_initialized && (cmdhist = fopen("cmdhist.dat", "wb")))
++ if (con_initialized && (cmdhist = fopen(va("%s/cmdhist.dat", com_gamedir), "wb")))
+ {
+ for (i=0 ; i<64 ; i++)
+ for (j=0 ; j<MAXCMDLINE ; j++)
diff --git a/games/tremor/files/patch-src__keys.c b/games/tremor/files/patch-src__keys.c
new file mode 100644
index 000000000000..4172cd47e242
--- /dev/null
+++ b/games/tremor/files/patch-src__keys.c
@@ -0,0 +1,11 @@
+--- ./src/keys.c.orig Fri Oct 29 19:15:24 2004
++++ ./src/keys.c Tue May 16 14:59:52 2006
+@@ -674,7 +674,7 @@
+ FILE *cmdhist;
+ cmdhistory_t cmdhistory;
+
+- if ((cmdhist = fopen("cmdhist.dat", "rb")))
++ if ((cmdhist = fopen(va("%s/cmdhist.dat", com_gamedir), "rb")))
+ {
+ fread (&cmdhistory, sizeof(cmdhistory_t), 1, cmdhist);
+ fclose (cmdhist);
diff --git a/games/tremor/files/patch-src__net.h b/games/tremor/files/patch-src__net.h
new file mode 100644
index 000000000000..d8a6a23a933e
--- /dev/null
+++ b/games/tremor/files/patch-src__net.h
@@ -0,0 +1,11 @@
+--- ./src/net.h.orig Sun Nov 14 08:19:46 2004
++++ ./src/net.h Tue May 16 14:59:52 2006
+@@ -253,7 +253,7 @@
+ extern int hostCacheCount;
+ extern hostcache_t hostcache[HOSTCACHESIZE];
+
+-#if !defined(_WIN32 ) && !defined (__linux__)
++#if !defined(_WIN32 ) && !defined (__unix__)
+ #ifndef htonl
+ extern unsigned long htonl (unsigned long hostlong);
+ #endif
diff --git a/games/tremor/files/patch-src__snd_linux.c b/games/tremor/files/patch-src__snd_linux.c
new file mode 100644
index 000000000000..1443917ae971
--- /dev/null
+++ b/games/tremor/files/patch-src__snd_linux.c
@@ -0,0 +1,14 @@
+--- ./src/snd_linux.c.orig Mon Oct 31 20:29:19 2005
++++ ./src/snd_linux.c Tue May 16 14:59:52 2006
+@@ -25,7 +25,11 @@
+ #include <sys/mman.h>
+ #include <sys/shm.h>
+ #include <sys/wait.h>
++#ifdef __linux__
+ #include <linux/soundcard.h>
++#else
++#include <sys/soundcard.h>
++#endif
+ #include <stdio.h>
+ #include "quakedef.h"
+
diff --git a/games/tremor/files/patch-src__sys.h b/games/tremor/files/patch-src__sys.h
new file mode 100644
index 000000000000..5fb6bae13433
--- /dev/null
+++ b/games/tremor/files/patch-src__sys.h
@@ -0,0 +1,11 @@
+--- ./src/sys.h.orig Mon Oct 31 20:47:55 2005
++++ ./src/sys.h Tue May 16 14:59:52 2006
+@@ -65,7 +65,7 @@
+
+ char *Sys_GetClipboardData (void);
+
+-#ifdef __linux__ //QuDos *.pak linux loading from tenebrae
++#ifdef __unix__ //QuDos *.pak linux loading from tenebrae
+ typedef struct
+ {
+ char entry[MAX_OSPATH]; // current entry in the list
diff --git a/games/tremor/files/patch-src__vid_glx.c b/games/tremor/files/patch-src__vid_glx.c
new file mode 100644
index 000000000000..53d4e358b7bd
--- /dev/null
+++ b/games/tremor/files/patch-src__vid_glx.c
@@ -0,0 +1,12 @@
+--- ./src/vid_glx.c.orig Thu Nov 10 07:03:04 2005
++++ ./src/vid_glx.c Tue May 16 14:59:52 2006
+@@ -22,7 +22,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>
diff --git a/games/tremor/pkg-descr b/games/tremor/pkg-descr
new file mode 100644
index 000000000000..11a16df70d05
--- /dev/null
+++ b/games/tremor/pkg-descr
@@ -0,0 +1,3 @@
+Enhaced Quake engine based on JoeQuake.
+
+WWW: http://tremor.quakedev.com/tremor.html
diff --git a/games/tremor/pkg-message b/games/tremor/pkg-message
new file mode 100644
index 000000000000..450f8e4c430b
--- /dev/null
+++ b/games/tremor/pkg-message
@@ -0,0 +1,15 @@
+==============================================================================
+
+Tremor has been installed.
+
+To start it in full-screen mode you can run it with the "-fullscreen"
+parameter.
+
+If you have mouse problems you can try running it with the "-nomdga"
+parameter (this will make the mouse work fine when the DGA X11 extension is
+disabled).
+
+If you hace sound problems try running it with the parameter
+"-sndspeed <speed>", where "<speed>" could be 22050 or 44100 for example.
+
+==============================================================================
diff --git a/games/tremor/pkg-plist b/games/tremor/pkg-plist
new file mode 100644
index 000000000000..9a3c141ebdee
--- /dev/null
+++ b/games/tremor/pkg-plist
@@ -0,0 +1,16 @@
+bin/tremor
+%%SDL%%bin/tremor-sdl
+%%PORTDOCS%%%%DOCSDIR%%/tremor.txt
+%%GOODIES%%%%Q1DIR%%/tremor/md3ammo.pak
+%%Q1DIR%%/tremor/autoexec.cfg
+%%Q1DIR%%/tremor/config.cfg
+%%GOODIES%%%%Q1DIR%%/tremor/lgmdl.pak
+%%Q1DIR%%/tremor/textures/charsets/charset_babylon5.png
+%%Q1DIR%%/tremor/tremor0.pak
+%%GOODIES%%%%Q1DIR%%/tremor/tremor1.pak
+%%TEXTURES%%%%Q1DIR%%/tremor/tremor_textures.pak
+%%GOODIES%%%%Q1DIR%%/tremor/wpnmdls.pak
+@dirrm %%Q1DIR%%/tremor/textures/charsets
+@dirrm %%Q1DIR%%/tremor/textures
+@dirrm %%Q1DIR%%/tremor
+%%PORTDOCS%%@dirrm %%DOCSDIR%%