Date: Sat, 14 Jan 2006 20:44:44 -0300 From: "Alejandro Pulver" <alejandro@varnet.biz> To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org> Subject: ports/91803: [NEW PORT] games/alienarena: Alien Arena 2006 (native version) Message-ID: <1137282284.0@phobos.mars.bsd> Resent-Message-ID: <200601142350.k0ENo3mL045516@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 91803 >Category: ports >Synopsis: [NEW PORT] games/alienarena: Alien Arena 2006 (native version) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jan 14 23:50:03 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alejandro Pulver >Release: FreeBSD 5.4-RELEASE i386 >Organization: >Environment: System: FreeBSD 5.4-RELEASE #0: Sat May 21 12:14:47 ART 2005 root@ale.varnet.bsd:/usr/src/sys/i386/compile/ATHLON-ALE >Description: Note: this port needs games/alienarena-data to be committed first. >How-To-Repeat: >Fix: --- alienarena.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # alienarena # alienarena/Makefile # alienarena/files # alienarena/files/patch-client_menu.c # alienarena/files/patch-client_qmenu.c # alienarena/files/patch-game_acesrc_acebot__ai.c # alienarena/files/patch-game_acesrc_acebot__cmds.c # alienarena/files/patch-game_acesrc_acebot__movement.c # alienarena/files/patch-game_acesrc_acebot__nodes.c # alienarena/files/patch-game_acesrc_acebot__spawn.c # alienarena/files/patch-game_acesrc_g__fakeclient.c # alienarena/files/patch-game_g__local.h # alienarena/files/patch-game_g__main.c # alienarena/files/patch-game_p__client.c # alienarena/files/patch-game_q__shared.c # alienarena/files/patch-game_q__shared.h # alienarena/files/patch-linux_Makefile # alienarena/files/patch-linux_q__shlinux.c # alienarena/files/patch-qcommon_files.c # alienarena/files/patch-ref__gl_qgl.h # alienarena/files/patch-ref__gl_r__bloom.c # alienarena/files/patch-ref__gl_r__draw.c # alienarena/files/patch-client_cl__parse.c # alienarena/files/patch-ref__gl_r__main.c # alienarena/files/patch-ref__gl_r__script.c # alienarena/files/patch-server_sv__main.c # alienarena/files/patch-linux_gl__glx.c # alienarena/files/patch-linux_glw__linux.h # alienarena/files/patch-linux_snd__linux.c # alienarena/files/patch-qcommon_cmd.c # alienarena/files/patch-linux_sys__linux.c # alienarena/files/patch-client_cl__ents.c # alienarena/files/patch-client_cl__main.c # alienarena/files/patch-client_snd__mix.c # alienarena/files/patch-game_acesrc_acebot__items.c # alienarena/files/patch-game_m__leader.c # alienarena/files/patch-qcommon_common.c # alienarena/files/patch-qcommon_qcommon.h # alienarena/files/patch-ref__gl_r__local.h # alienarena/files/patch-client_snd__dma.c # alienarena/files/patch-server_sv__user.c # alienarena/files/patch-game_g__phys.c # alienarena/files/patch-game_acesrc_acebot__compress.c # alienarena/files/patch-linux_cd__linux.c # alienarena/files/alienarena.in # alienarena/files/alienarena-ded.in # alienarena/files/alienarena-sdl.in # alienarena/distinfo # alienarena/pkg-descr # alienarena/pkg-message # alienarena/pkg-plist # echo c - alienarena mkdir -p alienarena > /dev/null 2>&1 echo x - alienarena/Makefile sed 's/^X//' >alienarena/Makefile << 'END-of-alienarena/Makefile' X# New ports collection makefile for: alienarena X# Date created: 13 Jan 2005 X# Whom: Alejandro Pulver <alejandro@varnet.biz> X# X# $FreeBSD$ X# X XPORTNAME= alienarena XPORTVERSION= 2006.0.30 XCATEGORIES= games XMASTER_SITES= http://offload1.icculus.org/~ravage/alienarena2006/:full \ X http://cor.planetquake.gamespy.com/codered/files/:patch XDISTFILES= ${PORTNAME}-2006-x86.run:full \ X aa2k6-update-12-30.tar.gz:patch X XMAINTAINER= alejandro@varnet.biz XCOMMENT= Alien Arena 2006 (native version) X XLIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg XRUN_DEPENDS= ${DATADIR}/arena/default.cfg:${PORTSDIR}/games/alienarena-data X XUSE_X_PREFIX= yes XUSE_GMAKE= yes XUSE_REINPLACE= yes XUSE_GL= yes XWANT_SDL= yes X XBUILD_WRKSRC= ${WRKDIR}/source/linux XWRKSRC= ${WRKDIR}/source XALL_TARGET= build_release X XOPTIONS= SDLSOUND "Build client that uses SDL for sound" off X XSUB_FILES= alienarena alienarena-ded XSUB_LIST= LIBDIR=${LIBDIR} XPLIST_SUB= LIBDIR=${LIBDIR:S/${PREFIX}\///} XLIBDIR= ${PREFIX}/lib/${PORTNAME} X X.include <bsd.port.pre.mk> X XEXE_TARGETS= crx crded XSCRIPTS= alienarena alienarena-ded X X.if defined(WITH_SDLSOUND) || ${HAVE_SDL:Msdl} != "" XUSE_SDL+= sdl XMAKE_ENV+= SDLSOUND=1 XEXE_TARGETS+= crx.sdl XSCRIPTS+= alienarena-sdl XSUB_FILES+= alienarena-sdl XPLIST_SUB+= SDLSOUND="" X.else XPLIST_SUB+= SDLSOUND="@comment " X.endif X Xdo-extract: X @${MKDIR} ${WRKDIR} X @cd ${WRKDIR} && \ X ${TAIL} -c +8778 ${DISTDIR}/${PORTNAME}-2006-x86.run | ${TAR} xfz - X @${TAR} xfz ${WRKDIR}/alienarena-2006-src.tar.gz -C ${WRKDIR} X @${TAR} xfz ${DISTDIR}/aa2k6-update-12-30.tar.gz -C ${WRKDIR} X X# Convert source files from DOS to Unix. Xpost-extract: X @${FIND} ${WRKSRC} -type f | ${XARGS} ${FILE} | ${GREP} "CRLF" | \ X ${SED} -e 's/:.*//' | \ X ${XARGS} ${REINPLACE_CMD} -e "s/`${PRINTF} '\r'`$$//" X Xdo-install: X ${MKDIR} ${LIBDIR}/arena ${LIBDIR}/data1 X cd ${WRKSRC}/linux/release && \ X ${INSTALL_PROGRAM} arena/game.so ${LIBDIR}/arena && \ X ${INSTALL_PROGRAM} game.so ${LIBDIR}/data1 X ${LN} -s ${DATADIR}/arena/* ${LIBDIR}/arena X ${LN} -s ${DATADIR}/botinfo ${LIBDIR} X ${LN} -s ${DATADIR}/data1/* ${LIBDIR}/data1 X.for f in ${EXE_TARGETS} X ${INSTALL_PROGRAM} ${WRKSRC}/linux/release/${f} ${LIBDIR} X.endfor X.for f in ${SCRIPTS} X ${INSTALL_SCRIPT} ${WRKDIR}/${f} ${PREFIX}/bin X.endfor X X.include <bsd.port.post.mk> END-of-alienarena/Makefile echo c - alienarena/files mkdir -p alienarena/files > /dev/null 2>&1 echo x - alienarena/files/patch-client_menu.c sed 's/^X//' >alienarena/files/patch-client_menu.c << 'END-of-alienarena/files/patch-client_menu.c' X--- client/menu.c.orig Wed Oct 5 18:36:09 2005 X+++ client/menu.c Fri Dec 2 12:04:43 2005 X@@ -2759,14 +2759,14 @@ X X strcpy( shortname, COM_Parse( &s ) ); X l = strlen(shortname); X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X for (j=0 ; j<l ; j++) X shortname[j] = toupper(shortname[j]); X #endif X strcpy( longname, COM_Parse( &s ) ); X Com_sprintf( scratch, sizeof( scratch ), "%s\n%s", longname, shortname ); X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X X if (s_rules_box.curvalue == 0 || s_rules_box.curvalue == 1) { X if((shortname[0] == 'd' && shortname[1] == 'm') || (shortname[0] == 't' && shortname[1] == 'o')) { END-of-alienarena/files/patch-client_menu.c echo x - alienarena/files/patch-client_qmenu.c sed 's/^X//' >alienarena/files/patch-client_qmenu.c << 'END-of-alienarena/files/patch-client_qmenu.c' X--- client/qmenu.c.orig Tue Oct 4 21:25:54 2005 X+++ client/qmenu.c Fri Dec 2 12:59:58 2005 X@@ -25,7 +25,8 @@ X X static void Action_DoEnter( menuaction_s *a ); X static void Action_Draw( menuaction_s *a ); X-static void Menu_DrawStatusBar( const char *string ); X+static void Menu_DrawStatusBar( const char *string ); X+void Menu_DrawString( int x, int y, const char *string ); X static void Menulist_DoEnter( menulist_s *l ); X static void MenuList_Draw( menulist_s *l ); X static void Separator_Draw( menuseparator_s *s ); END-of-alienarena/files/patch-client_qmenu.c echo x - alienarena/files/patch-game_acesrc_acebot__ai.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__ai.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__ai.c' X--- game/acesrc/acebot_ai.c.orig Wed Sep 21 14:11:19 2005 X+++ game/acesrc/acebot_ai.c Fri Dec 2 12:05:40 2005 X@@ -61,7 +61,7 @@ X // to provide a "higher" level of AI. X //////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #include "../m_player.h" X #else END-of-alienarena/files/patch-game_acesrc_acebot__ai.c echo x - alienarena/files/patch-game_acesrc_acebot__cmds.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__cmds.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__cmds.c' X--- game/acesrc/acebot_cmds.c.orig Sat Jul 23 10:31:47 2005 X+++ game/acesrc/acebot_cmds.c Fri Dec 2 12:05:52 2005 X@@ -56,7 +56,7 @@ X // X /////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #else X #include "..\g_local.h" END-of-alienarena/files/patch-game_acesrc_acebot__cmds.c echo x - alienarena/files/patch-game_acesrc_acebot__movement.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__movement.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__movement.c' X--- game/acesrc/acebot_movement.c.orig Wed Sep 7 10:01:24 2005 X+++ game/acesrc/acebot_movement.c Fri Dec 2 12:06:18 2005 X@@ -56,7 +56,7 @@ X // X /////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #else X #include "..\g_local.h" END-of-alienarena/files/patch-game_acesrc_acebot__movement.c echo x - alienarena/files/patch-game_acesrc_acebot__nodes.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__nodes.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__nodes.c' X--- game/acesrc/acebot_nodes.c.orig Thu Dec 29 20:23:22 2005 X+++ game/acesrc/acebot_nodes.c Sat Jan 14 19:44:53 2006 X@@ -57,7 +57,7 @@ X // X /////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #else X #include "..\g_local.h" X@@ -725,7 +725,7 @@ X X safe_bprintf(PRINT_MEDIUM,"Saving node table..."); X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X strcpy(filename,"botinfo/nav/"); X #else X strcpy(filename,"botinfo\\nav\\"); X@@ -763,7 +763,7 @@ X char filename[60]; X int version; X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X strcpy(filename,"botinfo/nav/"); X #else X strcpy(filename,"botinfo\\nav\\"); END-of-alienarena/files/patch-game_acesrc_acebot__nodes.c echo x - alienarena/files/patch-game_acesrc_acebot__spawn.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__spawn.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__spawn.c' X--- game/acesrc/acebot_spawn.c.orig Sat Jan 14 19:40:29 2006 X+++ game/acesrc/acebot_spawn.c Sat Jan 14 19:46:15 2006 X@@ -57,7 +57,7 @@ X // X /////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #include "../m_player.h" X #else X@@ -84,7 +84,7 @@ X FILE *pOut; X int i,count = 0; X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if((pOut = fopen("botinfo/bots.tmp", "wb" )) == NULL) X #else X if((pOut = fopen("botinfo\\bots.tmp", "wb" )) == NULL) X@@ -134,7 +134,7 @@ X X #ifdef ARENA //certain bots and configurations will be loaded level specific X if (((int)(dmflags->value) & DF_SKINTEAMS) || ctf->value) X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X strcpy(bot_filename, "botinfo/team.tmp"); X else X sprintf(bot_filename, "botinfo/%s.tmp", level.mapname); X@@ -147,7 +147,7 @@ X return; // bail X X #else X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if((pIn = fopen("botinfo/bots.tmp", "rb" )) == NULL) X #else X if((pIn = fopen("botinfo\\bots.tmp", "rb" )) == NULL) X@@ -255,7 +255,7 @@ X X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void ACECO_ReadConfig(char config_file[128]) //use standard c routines for linux X { X FILE *fp; X@@ -514,7 +514,7 @@ X //load bot configuration file(specific to each bot) X info = Info_ValueForKey (bot->client->pers.userinfo, "name"); X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X sprintf(bot_configfilename, "botinfo/%s.cfg", info); X //write something else for linux only X #else END-of-alienarena/files/patch-game_acesrc_acebot__spawn.c echo x - alienarena/files/patch-game_acesrc_g__fakeclient.c sed 's/^X//' >alienarena/files/patch-game_acesrc_g__fakeclient.c << 'END-of-alienarena/files/patch-game_acesrc_g__fakeclient.c' X--- game/acesrc/g_fakeclient.c.orig Sat Jul 23 10:31:47 2005 X+++ game/acesrc/g_fakeclient.c Fri Dec 2 12:11:21 2005 X@@ -18,7 +18,7 @@ X X */ X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #else X #include "..\g_local.h" END-of-alienarena/files/patch-game_acesrc_g__fakeclient.c echo x - alienarena/files/patch-game_g__local.h sed 's/^X//' >alienarena/files/patch-game_g__local.h << 'END-of-alienarena/files/patch-game_g__local.h' X--- game/g_local.h.orig Wed Sep 21 14:12:36 2005 X+++ game/g_local.h Fri Dec 2 12:12:24 2005 X@@ -1273,14 +1273,14 @@ X extern void DeathcamStart (edict_t *ent); X X // ACEBOT_ADD X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "acesrc/acebot.h" X #else X #include "acesrc\acebot.h" X #endif X // ACEBOT_END X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void FS_FreeFile (void *buffer); X void Z_Free (void *ptr); X void Com_Error (int code, char *fmt, ...); END-of-alienarena/files/patch-game_g__local.h echo x - alienarena/files/patch-game_g__main.c sed 's/^X//' >alienarena/files/patch-game_g__main.c << 'END-of-alienarena/files/patch-game_g__main.c' X--- game/g_main.c.orig Tue Sep 27 11:38:16 2005 X+++ game/g_main.c Fri Dec 2 12:12:51 2005 X@@ -389,7 +389,7 @@ X X strcpy( shortname, COM_Parse( &s ) ); X l = strlen(shortname); X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X for (j=0 ; j<l ; j++) X shortname[j] = toupper(shortname[j]); X #endif END-of-alienarena/files/patch-game_g__main.c echo x - alienarena/files/patch-game_p__client.c sed 's/^X//' >alienarena/files/patch-game_p__client.c << 'END-of-alienarena/files/patch-game_p__client.c' X--- game/p_client.c.orig Fri Jan 13 16:44:31 2006 X+++ game/p_client.c Fri Jan 13 16:49:02 2006 X@@ -321,7 +321,7 @@ X //here is where the bot chat features will be added. X //default is on. Setting to 1 turns it off. X X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X if ((!((int)(dmflags->value) & DF_BOTCHAT)) && self->is_bot) X { X msg = random() * 12; END-of-alienarena/files/patch-game_p__client.c echo x - alienarena/files/patch-game_q__shared.c sed 's/^X//' >alienarena/files/patch-game_q__shared.c << 'END-of-alienarena/files/patch-game_q__shared.c' X--- game/q_shared.c.orig Fri Aug 5 07:13:03 2005 X+++ game/q_shared.c Fri Dec 2 12:34:32 2005 X@@ -345,7 +345,7 @@ X Returns 1, 2, or 1 + 2 X ================== X */ X-#if !id386 || defined __linux__ X+#if !id386 || defined __linux__ || defined __FreeBSD__ X int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p) X { X float dist1, dist2; END-of-alienarena/files/patch-game_q__shared.c echo x - alienarena/files/patch-game_q__shared.h sed 's/^X//' >alienarena/files/patch-game_q__shared.h << 'END-of-alienarena/files/patch-game_q__shared.h' X--- game/q_shared.h.orig Thu Aug 25 09:42:14 2005 X+++ game/q_shared.h Fri Dec 2 12:34:52 2005 X@@ -146,7 +146,7 @@ X // microsoft's fabs seems to be ungodly slow... X //float Q_fabs (float f); X //#define fabs(f) Q_fabs(f) X-#if !defined C_ONLY && !defined __linux__ && !defined __sgi X+#if !defined C_ONLY && !defined __linux__ && !defined __sgi && !defined __FreeBSD__ X extern long Q_ftol( float f ); X #else X #define Q_ftol( f ) ( long ) (f) END-of-alienarena/files/patch-game_q__shared.h echo x - alienarena/files/patch-linux_Makefile sed 's/^X//' >alienarena/files/patch-linux_Makefile << 'END-of-alienarena/files/patch-linux_Makefile' X--- linux/Makefile.orig Thu Dec 29 20:23:22 2005 X+++ linux/Makefile Sat Jan 14 19:51:24 2006 X@@ -11,25 +11,12 @@ X GLIBC= X endif X X-ifneq (,$(findstring alpha,$(shell uname -m))) X-ARCH=axp X-else X-ifneq (,$(findstring ppc,$(shell uname -m))) X-ARCH=ppc X-else X-ifneq (,$(findstring x86_64,$(shell uname -m))) X-ARCH=x86_64 X-else X-ARCH=i386 X-endif X-endif X-endif X NOARCH=noarch X X MOUNT_DIR=.. X X-BUILD_DEBUG_DIR=debug$(ARCH) X-BUILD_RELEASE_DIR=release$(ARCH) X+BUILD_DEBUG_DIR=debug X+BUILD_RELEASE_DIR=release X CLIENT_DIR=$(MOUNT_DIR)/client X SERVER_DIR=$(MOUNT_DIR)/server X REF_GL_DIR=$(MOUNT_DIR)/ref_gl X@@ -42,7 +29,7 @@ X X EGCS=/usr/local/egcs-1.1.2/bin/gcc X X-CC=gcc X+CC?=gcc X X ifeq ($(ARCH),x86_64) X _LIB := lib64 X@@ -50,46 +37,50 @@ X _LIB := lib X endif X X-BASE_CFLAGS=-Dstricmp=strcasecmp -D_stricmp=strcasecmp -D__linux__ X+BASE_CFLAGS=-Dstricmp=strcasecmp -D_stricmp=strcasecmp X X ifeq ($(ARCH),axp) X RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \ X -fomit-frame-pointer -fexpensive-optimizations X endif X X-ifeq ($(ARCH),ppc) X RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \ X -fomit-frame-pointer -fexpensive-optimizations X-endif X- X-ifeq ($(ARCH),sparc) X-RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \ X- -fomit-frame-pointer -fexpensive-optimizations X-endif X X ifeq ($(ARCH),i386) X-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -falign-loops=2 \ X- -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing X-endif X- X-ifeq ($(ARCH),x86_64) X-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \ X- -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing X+RELEASE_CFLAGS+=-falign-loops=2 -falign-jumps=2 -falign-functions=2 \ X+ -fno-strict-aliasing X endif X X ARENA_CFLAGS=-DARENA X X DEBUG_CFLAGS=$(BASE_CFLAGS) -g X-LDFLAGS=-ldl -lm X+ X+OSTYPE := $(shell uname -s) X+ X+ifeq ($(OSTYPE),FreeBSD) X+LDFLAGS=-lm X+endif X+ifeq ($(OSTYPE),Linux) X+LDFLAGS=-lm -ldl X+endif X+ X SVGALDFLAGS=-lvga -lm X-XLDFLAGS=-L/usr/X11R6/$(_LIB) -lX11 -lXext -lXxf86dga X-XCFLAGS= X X-GLLDFLAGS=-L/usr/X11R6/$(_LIB) -L/usr/local/$(_LIB) -lX11 -lXext -lvga -lm X-GLXLDFLAGS=-L/usr/X11R6/$(_LIB) -L/usr/local/$(_LIB) -lX11 -lXext -lXxf86dga -lXxf86vm -lm -ljpeg -lGL -lGLU X+LOCALBASE?=/usr/local X+X11BASE?=/usr/X11R6 X+ X+GLCFLAGS=-I$(X11BASE)/include X+ X+XLDFLAGS=-L$(X11BASE)/$(_LIB) -lX11 -lXext -lXxf86dga X+ X+GLLDFLAGS=-L$(X11BASE)/$(_LIB) -L$(LOCALBASE)/$(_LIB) -lX11 -lXext -lvga -lm X+GLXLDFLAGS=-L$(X11BASE)/$(_LIB) -L$(LOCALBASE)/$(_LIB) -lX11 -lXext -lXxf86dga -lXxf86vm -lm -ljpeg -lGL -lGLU X+ X+SDL_CONFIG?=sdl-config X X-SDLCFLAGS=$(shell sdl-config --cflags) X-SDLLDFLAGS=$(shell sdl-config --libs) X+SDLCFLAGS=$(shell $(SDL_CONFIG) --cflags) X+SDLLDFLAGS=$(shell $(SDL_CONFIG) --libs) X X SHLIBEXT=so X X@@ -117,13 +108,13 @@ X X ifeq ($(ARCH),axp) X TARGETS=$(BUILDDIR)/crded \ X- $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ X- $(BUILDDIR)/arena/game$(ARCH).$(SHLIBEXT) X+ $(BUILDDIR)/game.$(SHLIBEXT) \ X+ $(BUILDDIR)/arena/game.$(SHLIBEXT) X else X TARGETS=$(BUILDDIR)/crded \ X $(BUILDDIR)/crx \ X- $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ X- $(BUILDDIR)/arena/game$(ARCH).$(SHLIBEXT) X+ $(BUILDDIR)/game.$(SHLIBEXT) \ X+ $(BUILDDIR)/arena/game.$(SHLIBEXT) X endif X X ifeq ($(strip $(SDLSOUND)),1) X@@ -146,7 +137,7 @@ X $(BUILD_RELEASE_DIR)/ref_gl \ X $(BUILD_RELEASE_DIR)/game \ X $(BUILD_RELEASE_DIR)/arena X- $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" X+ $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(RELEASE_CFLAGS)" X X all: build_debug build_release X X@@ -616,7 +607,7 @@ X X X X-$(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) X+$(BUILDDIR)/game.$(SHLIBEXT) : $(GAME_OBJS) X $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) X X X@@ -848,7 +839,7 @@ X $(BUILDDIR)/arena/p_weapon.o \ X $(BUILDDIR)/arena/vehicles.o X X-$(BUILDDIR)/arena/game$(ARCH).$(SHLIBEXT) : $(ARENA_OBJS) X+$(BUILDDIR)/arena/game.$(SHLIBEXT) : $(ARENA_OBJS) X $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(ARENA_OBJS) X X X@@ -1025,10 +1016,10 @@ X clean: clean-debug clean-release X X clean-debug: X- $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" X+ $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS+="$(DEBUG_CFLAGS)" X X clean-release: X- $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)" X+ $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(DEBUG_CFLAGS)" X X clean2: X -rm -f \ END-of-alienarena/files/patch-linux_Makefile echo x - alienarena/files/patch-linux_q__shlinux.c sed 's/^X//' >alienarena/files/patch-linux_q__shlinux.c << 'END-of-alienarena/files/patch-linux_q__shlinux.c' X--- linux/q_shlinux.c.orig Sat Jul 23 10:31:48 2005 X+++ linux/q_shlinux.c Sat Dec 3 13:47:56 2005 X@@ -30,6 +30,11 @@ X X #include "../qcommon/qcommon.h" X X+#if defined(__FreeBSD__) X+ /* For round_page macro. */ X+#include <machine/param.h> X+#endif X+ X //=============================================================================== X X byte *membase; X@@ -41,8 +46,14 @@ X // reserve a huge chunk of memory, but don't commit any yet X maxhunksize = maxsize + sizeof(int); X curhunksize = 0; X+#if defined(__FreeBSD__) X+ /* MAP_ANONYMOUS -> MAP_ANON */ X+ membase = mmap(0, maxhunksize, PROT_READ|PROT_WRITE, X+ MAP_PRIVATE|MAP_ANON, -1, 0); X+#else X membase = mmap(0, maxhunksize, PROT_READ|PROT_WRITE, X MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); X+#endif X if (membase == NULL || membase == (byte *)-1) X Sys_Error("unable to virtual allocate %d bytes", maxsize); X X@@ -68,7 +79,33 @@ X { X byte *n; X X+#if defined(__FreeBSD__) X+ /* X+ * The Linux system call mremap() is not present, so a wrapper is X+ * needed. This code frees the unused part of the allocated memory X+ * (equivalent to mremap() when shrinking a block of memory). X+ */ X+ X+ size_t old_size = maxhunksize; X+ size_t new_size = curhunksize + sizeof(int); X+ void * unmap_base; X+ size_t unmap_len; X+ X+ new_size = round_page(new_size); X+ old_size = round_page(old_size); X+ X+ if (new_size > old_size) X+ n = 0; /* error */ X+ else if (new_size < old_size) X+ { X+ unmap_base = (caddr_t)(membase + new_size); X+ unmap_len = old_size - new_size; X+ n = munmap(unmap_base, unmap_len) + membase; X+ } X+#endif X+#if defined(__linux__) X n = mremap(membase, maxhunksize, curhunksize + sizeof(int), 0); X+#endif X if (n != membase) X Sys_Error("Hunk_End: Could not remap virtual block (%d)", errno); X *((int *)membase) = curhunksize + sizeof(int); END-of-alienarena/files/patch-linux_q__shlinux.c echo x - alienarena/files/patch-qcommon_files.c sed 's/^X//' >alienarena/files/patch-qcommon_files.c << 'END-of-alienarena/files/patch-qcommon_files.c' X--- qcommon/files.c.orig Sat Jan 14 19:40:29 2006 X+++ qcommon/files.c Sat Jan 14 19:43:20 2006 X@@ -569,7 +569,7 @@ X // add the directory to the search path X // X search = Z_Malloc (sizeof(searchpath_t)); X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X strncpy (search->filename, dir, sizeof(search->filename)-1); X search->filename[sizeof(search->filename)-1] = 0; X #else X@@ -596,7 +596,7 @@ X X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X /* X ================ X FS_AddHomeAsGameDirectory X@@ -634,7 +634,7 @@ X */ X char *FS_Gamedir (void) X { X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X return fs_gamedir; X #else X if (*fs_gamedir) X@@ -651,13 +651,13 @@ X */ X void FS_ExecAutoexec (void) X { X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X searchpath_t *s, *end; X #else X char *dir; X #endif X char name [MAX_QPATH]; X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if (fs_searchpaths == fs_base_searchpaths) X end = NULL; X #else X@@ -666,7 +666,7 @@ X Com_sprintf(name, sizeof(name), "%s/%s/autoexec.cfg", fs_basedir->string, dir); X #endif X else X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X end = fs_base_searchpaths; X X // search through all the paths for an autoexec.cfg file X@@ -747,7 +747,7 @@ X if (fs_cddir->string[0]) X FS_AddGameDirectory (va("%s/%s", fs_cddir->string, dir) ); X FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) ); X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X FS_AddHomeAsGameDirectory(dir); X #endif X } X@@ -846,7 +846,7 @@ X return list; X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void FS_FreeFileList (char **list, int n) // jit X { X int i; X@@ -953,7 +953,7 @@ X searchpath_t *s; X char *prev; X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X prev = NULL; /* fs_gamedir is the first directory in the searchpath */ X #else X if (!prevpath) X@@ -965,7 +965,7 @@ X { X if (s->pack) X continue; X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if (prevpath == NULL) X return s->filename; X #endif X@@ -1009,7 +1009,7 @@ X // X FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) ); X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X FS_AddHomeAsGameDirectory(BASEDIRNAME); X #endif X // any set gamedirs will be freed up to here END-of-alienarena/files/patch-qcommon_files.c echo x - alienarena/files/patch-ref__gl_qgl.h sed 's/^X//' >alienarena/files/patch-ref__gl_qgl.h << 'END-of-alienarena/files/patch-ref__gl_qgl.h' X--- ref_gl/qgl.h.orig Sat Jul 23 10:31:48 2005 X+++ ref_gl/qgl.h Fri Dec 2 12:39:59 2005 X@@ -30,7 +30,7 @@ X X #include <GL/gl.h> X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X //#include <GL/fxmesa.h> X #include <GL/glx.h> X #endif X@@ -430,7 +430,7 @@ X X #endif X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X X // local function in dll X extern void *qwglGetProcAddress(char *symbol); X@@ -481,7 +481,7 @@ X #define GL_TEXTURE0_ARB 0x84C0 X #define GL_TEXTURE1_ARB 0x84C1 X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #ifdef GL_TEXTURE0 X #undef GL_TEXTURE0 X #endif END-of-alienarena/files/patch-ref__gl_qgl.h echo x - alienarena/files/patch-ref__gl_r__bloom.c sed 's/^X//' >alienarena/files/patch-ref__gl_r__bloom.c << 'END-of-alienarena/files/patch-ref__gl_r__bloom.c' X--- ref_gl/r_bloom.c.orig Sat Jul 23 10:31:48 2005 X+++ ref_gl/r_bloom.c Fri Dec 2 12:40:41 2005 X@@ -29,7 +29,7 @@ X ============================================================================== X */ X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #define min(a,b) ((a) < (b) ? (a) : (b)) X #endif X END-of-alienarena/files/patch-ref__gl_r__bloom.c echo x - alienarena/files/patch-ref__gl_r__draw.c sed 's/^X//' >alienarena/files/patch-ref__gl_r__draw.c << 'END-of-alienarena/files/patch-ref__gl_r__draw.c' X--- ref_gl/r_draw.c.orig Fri Sep 23 09:25:58 2005 X+++ ref_gl/r_draw.c Fri Dec 2 12:40:55 2005 X@@ -22,7 +22,7 @@ X X #include "r_local.h" X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #define min(a,b) ((a) < (b) ? (a) : (b)) X #endif X END-of-alienarena/files/patch-ref__gl_r__draw.c echo x - alienarena/files/patch-client_cl__parse.c sed 's/^X//' >alienarena/files/patch-client_cl__parse.c << 'END-of-alienarena/files/patch-client_cl__parse.c' X--- client/cl_parse.c.orig Fri Jan 13 16:54:49 2006 X+++ client/cl_parse.c Fri Jan 13 17:00:51 2006 X@@ -48,7 +48,7 @@ X "svc_frame" X }; X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X /* X ============== X Q_strncpyz END-of-alienarena/files/patch-client_cl__parse.c echo x - alienarena/files/patch-ref__gl_r__main.c sed 's/^X//' >alienarena/files/patch-ref__gl_r__main.c << 'END-of-alienarena/files/patch-ref__gl_r__main.c' X--- ref_gl/r_main.c.orig Fri Jan 13 17:01:44 2006 X+++ ref_gl/r_main.c Fri Jan 13 17:04:49 2006 X@@ -269,7 +269,7 @@ X The linux "c" version of this function X ================= X */ X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void R_ReadFogScript(char config_file[128]) X { X FILE *fp; X@@ -1647,7 +1647,7 @@ X gl_flashblend = Cvar_Get ("gl_flashblend", "0", 0); X gl_playermip = Cvar_Get ("gl_playermip", "0", 0); X gl_monolightmap = Cvar_Get( "gl_monolightmap", "0", 0 ); X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X gl_driver = Cvar_Get( "gl_driver", "libGL.so.1", CVAR_ARCHIVE ); X #else X gl_driver = Cvar_Get( "gl_driver", "opengl32", CVAR_ARCHIVE ); X@@ -1880,7 +1880,7 @@ X Cvar_Set( "scr_drawall", "0" ); X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X Cvar_SetValue( "gl_finish", 1 ); X #endif X X@@ -1952,7 +1952,7 @@ X Com_Printf ("...GL_EXT_point_parameters not found\n" ); X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if ( strstr( gl_config.extensions_string, "3DFX_set_global_palette" )) X { X if ( gl_ext_palettedtexture->value ) X@@ -2496,7 +2496,7 @@ X X farclip_dist = DotProduct( r_origin, vpn ); X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if(r_farclip_min > 256.0f) X farclip = farclip_dist + r_farclip_min; X else X@@ -2518,7 +2518,7 @@ X if( dist > farclip ) X farclip = dist; X } X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X if((farclip - farclip_dist + r_farclip_bias) > r_farclip) X return ( farclip - farclip_dist + r_farclip_bias); X else END-of-alienarena/files/patch-ref__gl_r__main.c echo x - alienarena/files/patch-ref__gl_r__script.c sed 's/^X//' >alienarena/files/patch-ref__gl_r__script.c << 'END-of-alienarena/files/patch-ref__gl_r__script.c' X--- ref_gl/r_script.c.orig Fri Jan 13 16:52:55 2006 X+++ ref_gl/r_script.c Fri Jan 13 16:53:59 2006 X@@ -1014,7 +1014,7 @@ X free(buf); X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void RS_ScanPathForScripts (void) X { X char script[MAX_OSPATH]; X@@ -1095,7 +1095,7 @@ X } X #endif X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X __inline void RS_RotateST (float *os, float *ot, float degrees, msurface_t *fa) X #else X _inline void RS_RotateST (float *os, float *ot, float degrees, msurface_t *fa) X@@ -1169,7 +1169,7 @@ X RS_RotateST (os, ot, -stage->rot_speed * rs_realtime * 0.0087266388888888888888888888888889, fa); X } X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X __inline void RS_RotateST2 (float *os, float *ot, float degrees) X #else X _inline void RS_RotateST2 (float *os, float *ot, float degrees) X@@ -1722,7 +1722,7 @@ X float *v; X int i, nv; X vec3_t wv, vectors[3]; X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X rs_stage_t *stage; X #else X rs_stage_t *stage = rs->stage; X@@ -1736,7 +1736,7 @@ X // rs_realtime+=.0001; X // if(rs_realtime > 10000) X // rs_realtime = 0; X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X stage = rs->stage; X #endif X nv = surf->polys->numverts; END-of-alienarena/files/patch-ref__gl_r__script.c echo x - alienarena/files/patch-server_sv__main.c sed 's/^X//' >alienarena/files/patch-server_sv__main.c << 'END-of-alienarena/files/patch-server_sv__main.c' X--- server/sv_main.c.orig Fri Sep 23 09:25:45 2005 X+++ server/sv_main.c Fri Dec 2 14:45:50 2005 X@@ -343,8 +343,9 @@ X X challenge = atoi(Cmd_Argv(3)); X X- strncpy (userinfo, Cmd_Argv(4), sizeof(userinfo)-1); X- userinfo[sizeof(userinfo) - 1] = 0; X+ // sku - reserve 32 bytes for the IP address X+ strncpy (userinfo, Cmd_Argv(4), sizeof(userinfo)-32); X+ userinfo[sizeof(userinfo) - 32] = 0; X X // force the IP key/value pair so the game can filter based on ip X Info_SetValueForKey (userinfo, "ip", NET_AdrToString(net_from)); X@@ -367,8 +368,11 @@ X { X if (NET_CompareBaseAdr (net_from, svs.challenges[i].adr)) X { X- if (challenge == svs.challenges[i].challenge) X+ // sku - ignore zero challenges X+ if( svs.challenges[i].challenge && challenge == svs.challenges[i].challenge ) { X+ svs.challenges[i].challenge = 0; X break; // good X+ } X Netchan_OutOfBandPrint (NS_SERVER, adr, "print\nBad challenge.\n"); X return; X } X@@ -392,6 +396,11 @@ X && ( cl->netchan.qport == qport X || adr.port == cl->netchan.remote_address.port ) ) X { X+ // sku - avoid reusing slot of the client already connected X+ if( cl->state != cs_zombie ) { X+ Netchan_OutOfBandPrint( NS_SERVER, adr, "print\nConnected client from this IP is already present.\n" ); X+ return; X+ } X if (!NET_IsLocalAddress (adr) && (svs.realtime - cl->lastconnect) < ((int)sv_reconnect_limit->value * 1000)) X { X Com_DPrintf ("%s:reconnect rejected : too soon\n", NET_AdrToString (adr)); END-of-alienarena/files/patch-server_sv__main.c echo x - alienarena/files/patch-linux_gl__glx.c sed 's/^X//' >alienarena/files/patch-linux_gl__glx.c << 'END-of-alienarena/files/patch-linux_gl__glx.c' X--- linux/gl_glx.c.orig Sun Sep 25 19:45:59 2005 X+++ linux/gl_glx.c Fri Dec 2 15:08:56 2005 X@@ -34,7 +34,9 @@ X #include <termios.h> X #include <sys/ioctl.h> X #include <sys/stat.h> X+#ifdef __linux__ X #include <sys/vt.h> X+#endif X #include <stdarg.h> X #include <stdio.h> X #include <unistd.h> END-of-alienarena/files/patch-linux_gl__glx.c echo x - alienarena/files/patch-linux_glw__linux.h sed 's/^X//' >alienarena/files/patch-linux_glw__linux.h << 'END-of-alienarena/files/patch-linux_glw__linux.h' X--- linux/glw_linux.h.orig Sat Jul 23 10:31:48 2005 X+++ linux/glw_linux.h Fri Dec 2 12:35:23 2005 X@@ -17,7 +17,7 @@ X Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X X */ X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X #error You shouldnt be including this file on non-Linux platforms X #endif X END-of-alienarena/files/patch-linux_glw__linux.h echo x - alienarena/files/patch-linux_snd__linux.c sed 's/^X//' >alienarena/files/patch-linux_snd__linux.c << 'END-of-alienarena/files/patch-linux_snd__linux.c' X--- linux/snd_linux.c Sat Jul 23 10:31:48 2005 X+++ ../../../quake2lnx/work/quake2-r0.16.2/src/linux/snd_linux.c Sat Feb 9 19:09:23 2002 X@@ -1,285 +1,308 @@ X-/* X-Copyright (C) 1997-2001 Id Software, Inc. X- X-This program is free software; you can redistribute it and/or X-modify it under the terms of the GNU General Public License X-as published by the Free Software Foundation; either version 2 X-of the License, or (at your option) any later version. X- X-This program is distributed in the hope that it will be useful, X-but WITHOUT ANY WARRANTY; without even the implied warranty of X-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. X- X-See the GNU General Public License for more details. X- X-You should have received a copy of the GNU General Public License X-along with this program; if not, write to the Free Software X-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X- X-*/ X-#include <unistd.h> X-#include <fcntl.h> X-#include <stdlib.h> X-#include <sys/types.h> X-#include <sys/ioctl.h> X-#include <sys/mman.h> X-#include <sys/shm.h> X-#include <sys/wait.h> X-#include <linux/soundcard.h> X-#include <stdio.h> X- X-#include "../client/client.h" X-#include "../client/snd_loc.h" X- X-int audio_fd; X-int snd_inited; X- X-cvar_t *sndbits; X-cvar_t *sndspeed; X-cvar_t *sndchannels; X-cvar_t *snddevice; X- X-static int tryrates[] = { 11025, 22051, 44100, 8000 }; X- X-qboolean SNDDMA_Init(void) X-{ X- X- int rc; X- int fmt; X- int tmp; X- int i; X- char *s; X- struct audio_buf_info info; X- int caps; X- extern uid_t saved_euid; X- X- if (snd_inited) X- return; X- X- if (!snddevice) { X- sndbits = Cvar_Get("sndbits", "16", CVAR_ARCHIVE); X- sndspeed = Cvar_Get("sndspeed", "0", CVAR_ARCHIVE); X- sndchannels = Cvar_Get("sndchannels", "2", CVAR_ARCHIVE); X- snddevice = Cvar_Get("snddevice", "/dev/dsp", CVAR_ARCHIVE); X- } X- X-// open /dev/dsp, confirm capability to mmap, and get size of dma buffer X- X- if (!audio_fd) { X- seteuid(saved_euid); X- X- audio_fd = open(snddevice->string, O_RDWR); X- X- seteuid(getuid()); X- X- if (audio_fd < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not open %s\n", snddevice->string); X- return 0; X- } X- } X- X- rc = ioctl(audio_fd, SNDCTL_DSP_RESET, 0); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not reset %s\n", snddevice->string); X- close(audio_fd); X- return 0; X- } X- X- if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps)==-1) X- { X- perror(snddevice->string); X- Com_Printf("Sound driver too old\n"); X- close(audio_fd); X- return 0; X- } X- X- if (!(caps & DSP_CAP_TRIGGER) || !(caps & DSP_CAP_MMAP)) X- { X- Com_Printf("Sorry but your soundcard can't do this\n"); X- close(audio_fd); X- return 0; X- } X- X- if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) X- { X- perror("GETOSPACE"); X- Com_Printf("Um, can't do GETOSPACE?\n"); X- close(audio_fd); X- return 0; X- } X- X-// set sample bits & speed X- X- dma.samplebits = (int)sndbits->value; X- if (dma.samplebits != 16 && dma.samplebits != 8) X- { X- ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &fmt); X- if (fmt & AFMT_S16_LE) dma.samplebits = 16; X- else if (fmt & AFMT_U8) dma.samplebits = 8; X- } X- X- dma.speed = (int)sndspeed->value; X- if (!dma.speed) { X- for (i=0 ; i<sizeof(tryrates)/4 ; i++) X- if (!ioctl(audio_fd, SNDCTL_DSP_SPEED, &tryrates[i])) break; X- dma.speed = tryrates[i]; X- } X- X- dma.channels = (int)sndchannels->value; X- if (dma.channels < 1 || dma.channels > 2) X- dma.channels = 2; X- X- dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8); X- dma.submission_chunk = 1; X- X-// memory map the dma buffer X- X- if (!dma.buffer) X- dma.buffer = (unsigned char *) mmap(NULL, info.fragstotal X- * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0); X- if (!dma.buffer) X- { X- perror(snddevice->string); X- Com_Printf("Could not mmap %s\n", snddevice->string); X- close(audio_fd); X- return 0; X- } X- X- tmp = 0; X- if (dma.channels == 2) X- tmp = 1; X- rc = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not set %s to stereo=%d", snddevice->string, dma.channels); X- close(audio_fd); X- return 0; X- } X- if (tmp) X- dma.channels = 2; X- else X- dma.channels = 1; X- X- rc = ioctl(audio_fd, SNDCTL_DSP_SPEED, &dma.speed); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not set %s speed to %d", snddevice->string, dma.speed); X- close(audio_fd); X- return 0; X- } X- X- if (dma.samplebits == 16) X- { X- rc = AFMT_S16_LE; X- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not support 16-bit data. Try 8-bit.\n"); X- close(audio_fd); X- return 0; X- } X- } X- else if (dma.samplebits == 8) X- { X- rc = AFMT_U8; X- rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not support 8-bit data.\n"); X- close(audio_fd); X- return 0; X- } X- } X- else X- { X- perror(snddevice->string); X- Com_Printf("%d-bit sound not supported.", dma.samplebits); X- close(audio_fd); X- return 0; X- } X- X-// toggle the trigger & start her up X- X- tmp = 0; X- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not toggle.\n"); X- close(audio_fd); X- return 0; X- } X- tmp = PCM_ENABLE_OUTPUT; X- rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp); X- if (rc < 0) X- { X- perror(snddevice->string); X- Com_Printf("Could not toggle.\n"); X- close(audio_fd); X- return 0; X- } X- X- dma.samplepos = 0; X- X- snd_inited = 1; X- return 1; X- X-} X- X-int SNDDMA_GetDMAPos(void) X-{ X- X- struct count_info count; X- X- if (!snd_inited) return 0; X- X- if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1) X- { X- perror(snddevice->string); X- Com_Printf("Uh, sound dead.\n"); X- close(audio_fd); X- snd_inited = 0; X- return 0; X- } X-// dma.samplepos = (count.bytes / (dma.samplebits / 8)) & (dma.samples-1); X-// fprintf(stderr, "%d \r", count.ptr); X- dma.samplepos = count.ptr / (dma.samplebits / 8); X- X- return dma.samplepos; X- X-} X- X-void SNDDMA_Shutdown(void) X-{ X-#if 0 X- if (snd_inited) X- { X- close(audio_fd); X- snd_inited = 0; X- } X-#endif X-} X- X-/* X-============== X-SNDDMA_Submit X- X-Send sound to device if buffer isn't really the dma buffer X-=============== X-*/ X-void SNDDMA_Submit(void) X-{ X-} X- X-void SNDDMA_BeginPainting (void) X-{ X-} X- X+/* X+Copyright (C) 1997-2001 Id Software, Inc. X+ X+This program is free software; you can redistribute it and/or X+modify it under the terms of the GNU General Public License X+as published by the Free Software Foundation; either version 2 X+of the License, or (at your option) any later version. X+ X+This program is distributed in the hope that it will be useful, X+but WITHOUT ANY WARRANTY; without even the implied warranty of X+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. X+ X+See the GNU General Public License for more details. X+ X+You should have received a copy of the GNU General Public License X+along with this program; if not, write to the Free Software X+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X+ X+*/ X+#include <unistd.h> X+#include <fcntl.h> X+#include <stdlib.h> X+#include <sys/types.h> X+#include <sys/ioctl.h> X+#include <sys/mman.h> X+#include <sys/shm.h> X+#include <sys/wait.h> X+#if defined(__FreeBSD__) X+#include <sys/soundcard.h> X+#endif X+#if defined(__linux__) X+#include <linux/soundcard.h> X+#endif X+#include <stdio.h> X+ X+#include "../client/client.h" X+#include "../client/snd_loc.h" X+ X+int audio_fd = -1; X+int snd_inited; X+ X+cvar_t *sndbits; X+cvar_t *sndspeed; X+cvar_t *sndchannels; X+cvar_t *snddevice; X+ X+static int tryrates[] = { 11025, 22051, 44100, 48000, 8000 }; X+ X+qboolean SNDDMA_Init(void) X+{ X+ X+ int rc; X+ int fmt; X+ int tmp; X+ int i; X+ struct audio_buf_info info; X+ int caps; X+ extern uid_t saved_euid; X+ X+ if (snd_inited) X+ return 1; X+ X+ snd_inited = 0; X+ X+ if (!snddevice) X+ { X+ sndbits = Cvar_Get("sndbits", "16", CVAR_ARCHIVE); X+ sndspeed = Cvar_Get("sndspeed", "0", CVAR_ARCHIVE); X+ sndchannels = Cvar_Get("sndchannels", "2", CVAR_ARCHIVE); X+ snddevice = Cvar_Get("snddevice", "/dev/dsp", CVAR_ARCHIVE); X+ } X+ X+// open /dev/dsp, confirm capability to mmap, and get size of dma buffer X+ X+ if (audio_fd == -1) X+ { X+ seteuid(saved_euid); X+ X+ audio_fd = open(snddevice->string, O_RDWR); X+ X+ if (audio_fd == -1) X+ { X+ perror(snddevice->string); X+ seteuid(getuid()); X+ Com_Printf("SNDDMA_Init: Could not open %s.\n", snddevice->string); X+ return 0; X+ } X+ seteuid(getuid()); X+ } X+ X+ rc = ioctl(audio_fd, SNDCTL_DSP_RESET, 0); X+ if (rc == -1) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not reset %s.\n", snddevice->string); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps)==-1) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Sound driver too old.\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ if (!(caps & DSP_CAP_TRIGGER) || !(caps & DSP_CAP_MMAP)) X+ { X+ Com_Printf("SNDDMA_Init: Sorry, but your soundcard doesn't support trigger or mmap. (%08x)\n", caps); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1) X+ { X+ perror("GETOSPACE"); X+ Com_Printf("SNDDMA_Init: GETOSPACE ioctl failed.\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+// set sample bits & speed X+ X+ dma.samplebits = (int)sndbits->value; X+ if (dma.samplebits != 16 && dma.samplebits != 8) X+ { X+ ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &fmt); X+ if (fmt & AFMT_S16_LE) dma.samplebits = 16; X+ else if (fmt & AFMT_U8) dma.samplebits = 8; X+ } X+ X+ if (dma.samplebits == 16) X+ { X+ rc = AFMT_S16_LE; X+ rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc); X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not support 16-bit data. Try 8-bit.\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ } X+ else if (dma.samplebits == 8) X+ { X+ rc = AFMT_U8; X+ rc = ioctl(audio_fd, SNDCTL_DSP_SETFMT, &rc); X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not support 8-bit data.\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ } X+ else X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: %d-bit sound not supported.", dma.samplebits); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ dma.speed = (int)sndspeed->value; X+ if (!dma.speed) X+ { X+ for (i=0 ; i<sizeof(tryrates)/4 ; i++) X+ if (!ioctl(audio_fd, SNDCTL_DSP_SPEED, &tryrates[i])) X+ break; X+ dma.speed = tryrates[i]; X+ } X+ X+ dma.channels = (int)sndchannels->value; X+ if (dma.channels < 1 || dma.channels > 2) X+ dma.channels = 2; X+ X+ tmp = 0; X+ if (dma.channels == 2) X+ tmp = 1; X+ rc = ioctl(audio_fd, SNDCTL_DSP_STEREO, &tmp); //FP: bugs here. X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not set %s to stereo=%d.", snddevice->string, dma.channels); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ if (tmp) X+ dma.channels = 2; X+ else X+ dma.channels = 1; X+ X+ X+ rc = ioctl(audio_fd, SNDCTL_DSP_SPEED, &dma.speed); X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not set %s speed to %d.", snddevice->string, dma.speed); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ dma.samples = info.fragstotal * info.fragsize / (dma.samplebits/8); X+ dma.submission_chunk = 1; X+ X+// memory map the dma buffer X+ X+ if (!dma.buffer) X+ dma.buffer = (unsigned char *) mmap(NULL, info.fragstotal X+ * info.fragsize, PROT_WRITE|PROT_READ, MAP_FILE|MAP_SHARED, audio_fd, 0); X+ if (!dma.buffer || dma.buffer == MAP_FAILED) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not mmap %s.\n", snddevice->string); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+// toggle the trigger & start her up X+ X+ tmp = 0; X+ rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp); X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not toggle. (1)\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ tmp = PCM_ENABLE_OUTPUT; X+ rc = ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp); X+ if (rc < 0) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_Init: Could not toggle. (2)\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ return 0; X+ } X+ X+ dma.samplepos = 0; X+ X+ snd_inited = 1; X+ return 1; X+} X+ X+int SNDDMA_GetDMAPos(void) X+{ X+ struct count_info count; X+ X+ if (!snd_inited) return 0; X+ X+ if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1) X+ { X+ perror(snddevice->string); X+ Com_Printf("SNDDMA_GetDMAPos: GETOPTR failed.\n"); X+ close(audio_fd); X+ audio_fd = -1; X+ snd_inited = 0; X+ return 0; X+ } X+// dma.samplepos = (count.bytes / (dma.samplebits / 8)) & (dma.samples-1); X+// fprintf(stderr, "%d \r", count.ptr); X+ dma.samplepos = count.ptr / (dma.samplebits / 8); X+ X+ return dma.samplepos; X+} X+ X+void SNDDMA_Shutdown(void) X+{ X+#if 0 X+ if (snd_inited) X+ { X+ close(audio_fd); X+ audio_fd = -1; X+ snd_inited = 0; X+ } X+#endif X+} X+ X+/* X+============== X+SNDDMA_Submit X+ X+Send sound to device if buffer isn't really the dma buffer X+=============== X+*/ X+void SNDDMA_Submit(void) X+{ X+} X+ X+void SNDDMA_BeginPainting (void) X+{ X+} X+ END-of-alienarena/files/patch-linux_snd__linux.c echo x - alienarena/files/patch-qcommon_cmd.c sed 's/^X//' >alienarena/files/patch-qcommon_cmd.c << 'END-of-alienarena/files/patch-qcommon_cmd.c' X--- qcommon/cmd.c.orig Sat Jul 23 10:31:48 2005 X+++ qcommon/cmd.c Fri Dec 2 14:38:52 2005 X@@ -215,8 +215,10 @@ X if (text[i] == '\n') X break; X } X- X- X+ // sku - removed potentional buffer overflow vulnerability X+ if( i > sizeof( line ) - 1 ) { X+ i = sizeof( line ) - 1; X+ } X memcpy (line, text, i); X line[i] = 0; X X@@ -657,7 +659,8 @@ X { X int l; X X- strcpy (cmd_args, text); X+ // sku - removed potentional buffer overflow vulnerability X+ strncpy( cmd_args, text, sizeof( cmd_args ) ); X X // strip off any trailing whitespace X l = strlen(cmd_args) - 1; END-of-alienarena/files/patch-qcommon_cmd.c echo x - alienarena/files/patch-linux_sys__linux.c sed 's/^X//' >alienarena/files/patch-linux_sys__linux.c << 'END-of-alienarena/files/patch-linux_sys__linux.c' X--- linux/sys_linux.c.orig Thu Dec 29 20:23:22 2005 X+++ linux/sys_linux.c Fri Jan 13 17:15:40 2006 X@@ -217,19 +217,7 @@ X char name[MAX_OSPATH]; X char *path; X char *str_p; X-#if defined __i386__ X- const char *gamename = "gamei386.so"; X-#elif defined __x86_64__ X- const char *gamename = "gamex86_64.so"; X-#elif defined __alpha__ X- const char *gamename = "gameaxp.so"; X-#elif defined __powerpc__ X- const char *gamename = "gameppc.so"; X-#elif defined __sparc__ X- const char *gamename = "gamesparc.so"; X-#else X-#error Unknown arch X-#endif X+ const char *gamename = "game.so"; X X setreuid(getuid(), getuid()); X setegid(getgid()); END-of-alienarena/files/patch-linux_sys__linux.c echo x - alienarena/files/patch-client_cl__ents.c sed 's/^X//' >alienarena/files/patch-client_cl__ents.c << 'END-of-alienarena/files/patch-client_cl__ents.c' X--- client/cl_ents.c.orig Wed Sep 7 10:08:59 2005 X+++ client/cl_ents.c Fri Dec 2 12:02:13 2005 X@@ -1079,7 +1079,7 @@ X X done = false; X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X X while(!done) { X if(modelpath[len] == 'h') END-of-alienarena/files/patch-client_cl__ents.c echo x - alienarena/files/patch-client_cl__main.c sed 's/^X//' >alienarena/files/patch-client_cl__main.c << 'END-of-alienarena/files/patch-client_cl__main.c' X--- client/cl_main.c.orig Tue Oct 4 21:26:13 2005 X+++ client/cl_main.c Fri Dec 2 12:03:47 2005 X@@ -24,7 +24,7 @@ X #include <winsock.h> X #endif X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include <unistd.h> X #include <sys/socket.h> X #include <sys/time.h> X@@ -932,7 +932,7 @@ X } X } X #endif X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void GetServerList (void) { X X netadr_t master; X@@ -1130,7 +1130,7 @@ X //send a packet to each server we got from the COR master X for (i = 0; i < numServers; i++) X { X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X Com_Printf ("pinging %s...\n", inet_ntoa(servers[i].ip)); X //need something different here X if (!NET_StringToAdr (inet_ntoa(servers[i].ip), &adr)) X@@ -1142,7 +1142,7 @@ X if (!NET_StringToAdr (inet_ntoa(tmp), &adr)) X #endif X { X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X Com_Printf ("Bad address: %s\n", inet_ntoa(servers[i].ip)); X #else X Com_Printf ("Bad address: %s\n", inet_ntoa(tmp)); X@@ -2008,7 +2008,7 @@ X // all archived variables will now be loaded X X Con_Init (); X-#if defined __linux__ || defined __sgi X+#if defined __linux__ || defined __sgi || defined __FreeBSD__ X S_Init (); X VID_Init (); X #else END-of-alienarena/files/patch-client_cl__main.c echo x - alienarena/files/patch-client_snd__mix.c sed 's/^X//' >alienarena/files/patch-client_snd__mix.c << 'END-of-alienarena/files/patch-client_snd__mix.c' X--- client/snd_mix.c.orig Sat Jul 23 10:31:47 2005 X+++ client/snd_mix.c Fri Dec 2 12:05:23 2005 X@@ -30,7 +30,7 @@ X X void S_WriteLinearBlastStereo16 (void); X X-#if !(defined __linux__ && defined __i386__) X+#if !((defined __linux__ || defined __FreeBSD__) && defined __i386__) X #if !id386 X X void S_WriteLinearBlastStereo16 (void) X@@ -362,7 +362,7 @@ X } X X X-#if !(defined __linux__ && defined __i386__) X+#if !((defined __linux__ || defined __FreeBSD__) && defined __i386__) X #if !id386 X X void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset) END-of-alienarena/files/patch-client_snd__mix.c echo x - alienarena/files/patch-game_acesrc_acebot__items.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__items.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__items.c' X--- game/acesrc/acebot_items.c.orig Wed Sep 7 10:01:05 2005 X+++ game/acesrc/acebot_items.c Fri Dec 2 12:06:05 2005 X@@ -58,7 +58,7 @@ X // X /////////////////////////////////////////////////////////////////////// X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X #include "../g_local.h" X #else X #include "..\g_local.h" END-of-alienarena/files/patch-game_acesrc_acebot__items.c echo x - alienarena/files/patch-game_m__leader.c sed 's/^X//' >alienarena/files/patch-game_m__leader.c << 'END-of-alienarena/files/patch-game_m__leader.c' X--- game/m_leader.c.orig Sat Jul 23 10:31:47 2005 X+++ game/m_leader.c Fri Dec 2 12:13:16 2005 X@@ -409,7 +409,7 @@ X { X gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0); X for (n= 0; n < 1 /*4*/; n++) X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC, 0); X for (n= 0; n < 4; n++) X ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC, 0); END-of-alienarena/files/patch-game_m__leader.c echo x - alienarena/files/patch-qcommon_common.c sed 's/^X//' >alienarena/files/patch-qcommon_common.c << 'END-of-alienarena/files/patch-qcommon_common.c' X--- qcommon/common.c.orig Mon Aug 22 19:16:46 2005 X+++ qcommon/common.c Fri Dec 2 14:41:07 2005 X@@ -127,7 +127,7 @@ X // also echo to debugging console X Sys_ConsoleOutput (msg); X X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X // Also echo to dedicated console X Sys_Print(msg); X #endif X@@ -781,7 +781,9 @@ X l = 0; X do X { X- c = MSG_ReadChar (msg_read); X+ // sku - replaced MSG_ReadChar with MSG_ReadByte to avoid X+ // potentional vulnerability X+ c = MSG_ReadByte (msg_read); X if (c == -1 || c == 0) X break; X string[l] = c; X@@ -801,7 +803,9 @@ X l = 0; X do X { X- c = MSG_ReadChar (msg_read); X+ // sku - replaced MSG_ReadChar with MSG_ReadByte to avoid X+ // potentional vulnerability X+ c = MSG_ReadByte (msg_read); X if (c == -1 || c == 0 || c == '\n') X break; X string[l] = c; X@@ -1559,7 +1563,7 @@ X c_brush_traces = 0; X c_pointcontents = 0; X } X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X do X { X s = Sys_ConsoleInput (); END-of-alienarena/files/patch-qcommon_common.c echo x - alienarena/files/patch-qcommon_qcommon.h sed 's/^X//' >alienarena/files/patch-qcommon_qcommon.h << 'END-of-alienarena/files/patch-qcommon_qcommon.h' X--- qcommon/qcommon.h.orig Tue Sep 27 14:40:50 2005 X+++ qcommon/qcommon.h Fri Dec 2 12:39:14 2005 X@@ -47,7 +47,7 @@ X #define CPUSTRING "AXP" X #endif X X-#elif defined __linux__ X+#elif defined __linux__ || defined __FreeBSD__ X X #define BUILDSTRING "Linux" X X@@ -715,7 +715,7 @@ X void FS_Read (void *buffer, int len, FILE *f); X // properly handles partial reads X X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void FS_FreeFileList (char **list, int n); X #endif X void FS_FreeFile (void *buffer); END-of-alienarena/files/patch-qcommon_qcommon.h echo x - alienarena/files/patch-ref__gl_r__local.h sed 's/^X//' >alienarena/files/patch-ref__gl_r__local.h << 'END-of-alienarena/files/patch-ref__gl_r__local.h' X--- ref_gl/r_local.h.orig Fri Jan 13 16:51:14 2006 X+++ ref_gl/r_local.h Fri Jan 13 16:51:15 2006 X@@ -28,7 +28,7 @@ X #include <math.h> X #include "glext.h" X X-#ifndef __linux__ X+#if !defined(__linux__) && !defined(__FreeBSD__) X #ifndef GL_COLOR_INDEX8_EXT X #define GL_COLOR_INDEX8_EXT GL_COLOR_INDEX X #endif X@@ -340,7 +340,7 @@ X void R_DrawSkyBox (void); X void R_DrawSkyBoxVooDoo (void); X void R_MarkLights (dlight_t *light, int bit, mnode_t *node); X-#ifdef __linux__ X+#if defined(__linux__) || defined(__FreeBSD__) X void R_ReadFogScript(char config_file[128]); X #endif X END-of-alienarena/files/patch-ref__gl_r__local.h echo x - alienarena/files/patch-client_snd__dma.c sed 's/^X//' >alienarena/files/patch-client_snd__dma.c << 'END-of-alienarena/files/patch-client_snd__dma.c' X--- client/snd_dma.c.orig Sat Jul 23 10:31:47 2005 X+++ client/snd_dma.c Thu Dec 1 21:20:45 2005 X@@ -771,8 +771,17 @@ X clear = 0; X X SNDDMA_BeginPainting (); X- if (dma.buffer) X- memset(dma.buffer, clear, dma.samples * dma.samplebits/8); X+ if (dma.buffer) { X+ int i; X+ unsigned char *ptr = (unsigned char *)dma.buffer; X+ X+ /* clear it manually because the buffer might be writeonly (mmap) */ X+ i = dma.samples * dma.samplebits/8; X+ while (i--) { X+ *ptr = clear; X+ ptr++; X+ } X+ } X SNDDMA_Submit (); X } X X@@ -892,8 +901,23 @@ X ch->rightvol = right_total; X ch->autosound = true; // remove next frame X ch->sfx = sfx; X- ch->pos = paintedtime % sc->length; X- ch->end = paintedtime + sc->length - ch->pos; X+ /* X+ * PATCH: eliasm X+ * X+ * Sometimes, the sc->length argument can become 0, X+ * and in that case we get a SIGFPE in the next X+ * modulo operation. The workaround checks for this X+ * situation and in that case, sets the pos and end X+ * parameters to 0. X+ */ X+ if( sc->length == 0 ) { X+ ch->pos = 0; X+ ch->end = 0; X+ } X+ else { X+ ch->pos = paintedtime % sc->length; X+ ch->end = paintedtime + sc->length - ch->pos; X+ } X } X } X END-of-alienarena/files/patch-client_snd__dma.c echo x - alienarena/files/patch-server_sv__user.c sed 's/^X//' >alienarena/files/patch-server_sv__user.c << 'END-of-alienarena/files/patch-server_sv__user.c' X--- server/sv_user.c.orig Sun Aug 7 15:06:22 2005 X+++ server/sv_user.c Fri Dec 2 14:48:41 2005 X@@ -142,6 +142,9 @@ X } X X start = atoi(Cmd_Argv(2)); X+ if( start < 0 ) { X+ start = 0; // sku - catch negative offsets X+ } X X // write a packet full of data X X@@ -150,9 +153,18 @@ X { X if (sv.configstrings[start][0]) X { X+ int length; X+ X+ // sku - write configstrings that exceed MAX_QPATH in proper-sized chunks X+ length = strlen( sv.configstrings[start] ); X+ if( length > MAX_QPATH ) { X+ length = MAX_QPATH; X+ } X+ X MSG_WriteByte (&sv_client->netchan.message, svc_configstring); X MSG_WriteShort (&sv_client->netchan.message, start); X- MSG_WriteString (&sv_client->netchan.message, sv.configstrings[start]); X+ SZ_Write (&sv_client->netchan.message, sv.configstrings[start], length); X+ MSG_WriteByte (&sv_client->netchan.message, 0); X } X start++; X } X@@ -199,6 +211,9 @@ X } X X start = atoi(Cmd_Argv(2)); X+ if( start < 0 ) { X+ start = 0; X+ } X X memset (&nullstate, 0, sizeof(nullstate)); X X@@ -398,7 +413,7 @@ X */ X void SV_ShowServerinfo_f (void) X { X- Info_Print (Cvar_Serverinfo()); X+// Info_Print (Cvar_Serverinfo()); X } X X END-of-alienarena/files/patch-server_sv__user.c echo x - alienarena/files/patch-game_g__phys.c sed 's/^X//' >alienarena/files/patch-game_g__phys.c << 'END-of-alienarena/files/patch-game_g__phys.c' X--- game/g_phys.c.orig Sat Jul 23 10:31:47 2005 X+++ game/g_phys.c Fri Dec 2 14:50:18 2005 X@@ -356,7 +356,13 @@ X mask = MASK_SOLID; X X trace = gi.trace (start, ent->mins, ent->maxs, end, ent, mask); X- X+ X+ if (trace.startsolid || trace.allsolid) X+ { X+ mask ^= CONTENTS_DEADMONSTER; X+ trace = gi.trace (start, ent->mins, ent->maxs, end, ent, mask); X+ } X+ X VectorCopy (trace.endpos, ent->s.origin); X gi.linkentity (ent); X END-of-alienarena/files/patch-game_g__phys.c echo x - alienarena/files/patch-game_acesrc_acebot__compress.c sed 's/^X//' >alienarena/files/patch-game_acesrc_acebot__compress.c << 'END-of-alienarena/files/patch-game_acesrc_acebot__compress.c' X--- game/acesrc/acebot_compress.c.orig Sat Jul 23 10:31:47 2005 X+++ game/acesrc/acebot_compress.c Wed Nov 30 19:44:53 2005 X@@ -17,7 +17,6 @@ X #include <stdlib.h> X #include <string.h> X #include <ctype.h> X-#include <malloc.h> X X #define N 4096 /* size of ring buffer */ X #define F 18 /* upper limit for match_length */ X@@ -286,4 +285,4 @@ X X return EXIT_SUCCESS; X } X-*/ X\ No newline at end of file X+*/ END-of-alienarena/files/patch-game_acesrc_acebot__compress.c echo x - alienarena/files/patch-linux_cd__linux.c sed 's/^X//' >alienarena/files/patch-linux_cd__linux.c << 'END-of-alienarena/files/patch-linux_cd__linux.c' X--- linux/cd_linux.c.orig Sat Jul 23 10:31:48 2005 X+++ linux/cd_linux.c Wed Nov 30 19:36:19 2005 X@@ -31,7 +31,11 @@ X #include <time.h> X #include <errno.h> X X-#include <linux/cdrom.h> X+#if defined(__FreeBSD__) X+ #include <sys/cdio.h> X+#else X+ #include <linux/cdrom.h> X+#endif X X #include "../client/client.h" X X@@ -61,8 +65,13 @@ X if (cdfile == -1 || !enabled) X return; // no cd init'd X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCEJECT) == -1 ) X+ Com_DPrintf("ioctl cdioeject failed\n"); X+#else X if ( ioctl(cdfile, CDROMEJECT) == -1 ) X Com_DPrintf("ioctl cdromeject failed\n"); X+#endif X } X X X@@ -71,30 +80,53 @@ X if (cdfile == -1 || !enabled) X return; // no cd init'd X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCCLOSE) == -1 ) X+ Com_DPrintf("ioctl cdiocclose failed\n"); X+#else X if ( ioctl(cdfile, CDROMCLOSETRAY) == -1 ) X Com_DPrintf("ioctl cdromclosetray failed\n"); X+#endif X } X X static int CDAudio_GetAudioDiskInfo(void) X { X+#if defined(__FreeBSD__) X+ struct ioc_toc_header tochdr; X+#else X struct cdrom_tochdr tochdr; X+#endif X X cdValid = false; X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1 ) X+ { X+ Com_DPrintf("ioctl cdioreadtocheader failed\n"); X+#else X if ( ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1 ) X { X Com_DPrintf("ioctl cdromreadtochdr failed\n"); X+#endif X return -1; X } X X+#if defined(__FreeBSD__) X+ if (tochdr.starting_track < 1) X+#else X if (tochdr.cdth_trk0 < 1) X+#endif X { X Com_DPrintf("CDAudio: no music tracks\n"); X return -1; X } X X cdValid = true; X+#if defined(__FreeBSD__) X+ maxTrack = tochdr.ending_track; X+#else X maxTrack = tochdr.cdth_trk1; X+#endif X X return 0; X } X@@ -102,8 +134,14 @@ X X void CDAudio_Play(int track, qboolean looping) X { X+#if defined(__FreeBSD__) X+ struct ioc_read_toc_entry entry; X+ struct cd_toc_entry toc_buffer; X+ struct ioc_play_track ti; X+#else X struct cdrom_tocentry entry; X struct cdrom_ti ti; X+#endif X X if (cdfile == -1 || !enabled) X return; X@@ -123,6 +161,21 @@ X return; X } X X+#if defined(__FreeBSD__) X+ #define CDROM_DATA_TRACK 4 X+ bzero((char *)&toc_buffer, sizeof(toc_buffer)); X+ entry.data_len = sizeof(toc_buffer); X+ entry.data = &toc_buffer; X+ // don't try to play a non-audio track X+ entry.starting_track = track; X+ entry.address_format = CD_MSF_FORMAT; X+ if ( ioctl(cdfile, CDIOREADTOCENTRYS, &entry) == -1 ) X+ { X+ Com_DPrintf("ioctl cdromreadtocentry failed\n"); X+ return; X+ } X+ if (toc_buffer.control == CDROM_DATA_TRACK) X+#else X // don't try to play a non-audio track X entry.cdte_track = track; X entry.cdte_format = CDROM_MSF; X@@ -132,6 +185,7 @@ X return; X } X if (entry.cdte_ctrl == CDROM_DATA_TRACK) X+#endif X { X Com_Printf("CDAudio: track %i is not audio\n", track); X return; X@@ -144,18 +198,33 @@ X CDAudio_Stop(); X } X X+#if defined(__FreeBSD__) X+ ti.start_track = track; X+ ti.end_track = track; X+ ti.start_index = 1; X+ ti.end_index = 99; X+#else X ti.cdti_trk0 = track; X ti.cdti_trk1 = track; X- ti.cdti_ind0 = 1; X- ti.cdti_ind1 = 99; X- X- if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 ) X- { X+ ti.cdti_ind0 = 0; X+ ti.cdti_ind1 = 0; X+#endif X+ X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1 ) X+#else X+ if ( ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1 ) X+#endif X+ { X Com_DPrintf("ioctl cdromplaytrkind failed\n"); X return; X } X X- if ( ioctl(cdfile, CDROMRESUME) == -1 ) X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCRESUME) == -1 ) X+#else X+ if ( ioctl(cdfile, CDROMRESUME) == -1 ) X+#endif X Com_DPrintf("ioctl cdromresume failed\n"); X X playLooping = looping; X@@ -175,8 +244,13 @@ X if (!playing) X return; X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCSTOP) == -1 ) X+ Com_DPrintf("ioctl cdiocstop failed (%d)\n", errno); X+#else X if ( ioctl(cdfile, CDROMSTOP) == -1 ) X Com_DPrintf("ioctl cdromstop failed (%d)\n", errno); X+#endif X X wasPlaying = false; X playing = false; X@@ -190,8 +264,13 @@ X if (!playing) X return; X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCPAUSE) == -1 ) X+ Com_DPrintf("ioctl cdiocpause failed\n"); X+#else X if ( ioctl(cdfile, CDROMPAUSE) == -1 ) X Com_DPrintf("ioctl cdrompause failed\n"); X+#endif X X wasPlaying = playing; X playing = false; X@@ -209,8 +288,13 @@ X if (!wasPlaying) X return; X X+#if defined(__FreeBSD__) X+ if ( ioctl(cdfile, CDIOCRESUME) == -1 ) X+ Com_DPrintf("ioctl cdiocresume failed\n"); X+#else X if ( ioctl(cdfile, CDROMRESUME) == -1 ) X Com_DPrintf("ioctl cdromresume failed\n"); X+#endif X playing = true; X } X X@@ -334,7 +418,12 @@ X X void CDAudio_Update(void) X { X+#if defined(__FreeBSD__) X+ struct ioc_read_subchannel subchnl; X+ struct cd_sub_channel_info data; X+#else X struct cdrom_subchnl subchnl; X+#endif X static time_t lastchk; X X if (cdfile == -1 || !enabled) X@@ -358,6 +447,24 @@ X X if (playing && lastchk < time(NULL)) { X lastchk = time(NULL) + 2; //two seconds between chks X+#if defined(__FreeBSD__) X+ subchnl.address_format = CD_MSF_FORMAT; X+ subchnl.data_format = CD_CURRENT_POSITION; X+ subchnl.data_len = sizeof(data); X+ subchnl.track = playTrack; X+ subchnl.data = &data; X+ if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1 ) { X+ Com_DPrintf("ioctl cdiocreadsubchannel failed\n"); X+ playing = false; X+ return; X+ } X+ if (subchnl.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS && X+ subchnl.data->header.audio_status != CD_AS_PLAY_PAUSED) { X+ playing = false; X+ if (playLooping) X+ CDAudio_Play(playTrack, true); X+ } X+#else X subchnl.cdsc_format = CDROM_MSF; X if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1 ) { X Com_DPrintf("ioctl cdromsubchnl failed\n"); X@@ -370,6 +477,7 @@ X if (playLooping) X CDAudio_Play(playTrack, true); X } X+#endif X } X } X END-of-alienarena/files/patch-linux_cd__linux.c echo x - alienarena/files/alienarena.in sed 's/^X//' >alienarena/files/alienarena.in << 'END-of-alienarena/files/alienarena.in' X#!/bin/sh X Xcd %%LIBDIR%% || exit 1 X Xexec ./crx +set game arena "$@" END-of-alienarena/files/alienarena.in echo x - alienarena/files/alienarena-ded.in sed 's/^X//' >alienarena/files/alienarena-ded.in << 'END-of-alienarena/files/alienarena-ded.in' X#!/bin/sh X Xcd %%LIBDIR%% || exit 1 X Xexec ./crded +set game arena "$@" END-of-alienarena/files/alienarena-ded.in echo x - alienarena/files/alienarena-sdl.in sed 's/^X//' >alienarena/files/alienarena-sdl.in << 'END-of-alienarena/files/alienarena-sdl.in' X#!/bin/sh X Xcd %%LIBDIR%% || exit 1 X Xexec ./crx.sdl +set game arena "$@" END-of-alienarena/files/alienarena-sdl.in echo x - alienarena/distinfo sed 's/^X//' >alienarena/distinfo << 'END-of-alienarena/distinfo' XMD5 (alienarena-2006-x86.run) = 00cd1868251cb05685e4a886ef14fdc8 XSHA256 (alienarena-2006-x86.run) = aca46849e24ccd50d89a88617625476f814080e99fbc00cc082524b2645b9f81 XSIZE (alienarena-2006-x86.run) = 151751128 XMD5 (aa2k6-update-12-30.tar.gz) = 73d800a2ab17000e77a64f56f421c8db XSHA256 (aa2k6-update-12-30.tar.gz) = 6fdf1014adcf2b674e2273038b09d10f710e6a654d4aefdf875d08df258a2922 XSIZE (aa2k6-update-12-30.tar.gz) = 9469494 END-of-alienarena/distinfo echo x - alienarena/pkg-descr sed 's/^X//' >alienarena/pkg-descr << 'END-of-alienarena/pkg-descr' XAA2K6 is the latest in a series of standalone games based on a classic Sci-Fi Xtheme with a modern, updated visual experience. With 25 levels, five modes of Xplay, mutators, built-in bots, 9 characters, 8 weapons (3 with alt-fire Xmodes), the game has an endless supply of replayability. Billed as the sequel Xto 2004's CodeRED: Alien Arena, AA2K6 is much more than that. With the trials Xand tribulations of software development, endless hours of playing, gathering Xfeedback, COR Entertainment has been able to not only fine tune and perfect Xit's flagship game, but add completely new dimensions to it. X XWWW: http://red.planetarena.org/ END-of-alienarena/pkg-descr echo x - alienarena/pkg-message sed 's/^X//' >alienarena/pkg-message << 'END-of-alienarena/pkg-message' X============================================================================== X XAlien Arena 2006 (native version) has been installed. X XThe OSS (native FreeBSD sound) version of Alien Arena 2006 (named X"alienarena") uses by default a slow sound speed, which causes a notable Xdelay. To solve this you have to run it once like this: X Xalienarena +set sndspeed <speed> X XWhere <speed> could be 22050 and 44100 for example (the default that has the Xdelay is 11025, and the SDL version uses 22050). The value of "sndspeed" will Xbe saved in the configuration file for future runs. X X============================================================================== END-of-alienarena/pkg-message echo x - alienarena/pkg-plist sed 's/^X//' >alienarena/pkg-plist << 'END-of-alienarena/pkg-plist' Xbin/alienarena Xbin/alienarena-ded X%%SDLSOUND%%bin/alienarena-sdl X%%LIBDIR%%/arena/ctf.cfg X%%LIBDIR%%/arena/default.cfg X%%LIBDIR%%/arena/game.so X%%LIBDIR%%/arena/maps.lst X%%LIBDIR%%/arena/motd.txt X%%LIBDIR%%/arena/pics X%%LIBDIR%%/arena/server.cfg X%%LIBDIR%%/arena/video X%%LIBDIR%%/botinfo X%%LIBDIR%%/crded X%%LIBDIR%%/crx X%%SDLSOUND%%%%LIBDIR%%/crx.sdl X%%LIBDIR%%/data1/default.cfg X%%LIBDIR%%/data1/env X%%LIBDIR%%/data1/game.so X%%LIBDIR%%/data1/gfx X%%LIBDIR%%/data1/levelshots X%%LIBDIR%%/data1/maps X%%LIBDIR%%/data1/models X%%LIBDIR%%/data1/particles X%%LIBDIR%%/data1/pics X%%LIBDIR%%/data1/players X%%LIBDIR%%/data1/scripts X%%LIBDIR%%/data1/sound X%%LIBDIR%%/data1/sprites X%%LIBDIR%%/data1/textures X%%LIBDIR%%/data1/vehicles X@dirrm %%LIBDIR%%/data1 X@dirrm %%LIBDIR%%/arena X@dirrm %%DATADIR%% END-of-alienarena/pkg-plist exit --- alienarena.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1137282284.0>