summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2003-12-13 10:32:53 +0000
committerxtraeme <xtraeme@pkgsrc.org>2003-12-13 10:32:53 +0000
commit0f3d636f68bde03e73f5caf618c16f4c42c2cc0b (patch)
tree2f24b3fafae0cf3032a739d785547e7889691911 /games
parentfa2622d05e4448507a6174f21906a07c1cb1c160 (diff)
downloadpkgsrc-0f3d636f68bde03e73f5caf618c16f4c42c2cc0b.tar.gz
Updated to 1.10.0.
The ChangeLog is huge. Selected new features include: * vote based kicking * tunable game parameters like gravity and world size * smarter bots * world weapons * bzadmin text client * autopilot * rabbit game style * single port networking And more... please review Changelog for a detailed list of changes. pkgsrc changes: o USE_X11BASE not needed anymore. I'm sorry, only tested on NetBSD/FreeBSD x86, I need more hardware...
Diffstat (limited to 'games')
-rw-r--r--games/bzflag/Makefile50
-rw-r--r--games/bzflag/PLIST96
-rw-r--r--games/bzflag/distinfo24
-rw-r--r--games/bzflag/patches/patch-aa29
-rw-r--r--games/bzflag/patches/patch-ab143
-rw-r--r--games/bzflag/patches/patch-ac230
-rw-r--r--games/bzflag/patches/patch-ad77
-rw-r--r--games/bzflag/patches/patch-ae510
-rw-r--r--games/bzflag/patches/patch-af84
-rw-r--r--games/bzflag/patches/patch-ag67
-rw-r--r--games/bzflag/patches/patch-ah44
-rw-r--r--games/bzflag/patches/patch-ai45
-rw-r--r--games/bzflag/patches/patch-aj30
-rw-r--r--games/bzflag/patches/patch-ak17
-rw-r--r--games/bzflag/patches/patch-al21
-rw-r--r--games/bzflag/patches/patch-am25
16 files changed, 189 insertions, 1303 deletions
diff --git a/games/bzflag/Makefile b/games/bzflag/Makefile
index c53f73bfe2e..56f081b0ca3 100644
--- a/games/bzflag/Makefile
+++ b/games/bzflag/Makefile
@@ -1,35 +1,37 @@
-# $NetBSD: Makefile,v 1.5 2003/11/30 22:58:41 jschauma Exp $
+# $NetBSD: Makefile,v 1.6 2003/12/13 10:32:53 xtraeme Exp $
-DISTNAME= bzflag-1.7e6
-PKGNAME= ${DISTNAME:S/e/.5./}
-PKGREVISION= 3
+DISTNAME= bzflag-1.10.20031209
+WRKSRC= ${WRKDIR}/bzflag-1.9.10.20031209
CATEGORIES= games x11
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=bzflag/}
-EXTRACT_SUFX= .tgz
MAINTAINER= blymn@baea.com.au
HOMEPAGE= http://www.bzflag.org/
COMMENT= OpenGL tank game
-USE_X11BASE= yes
+GNU_CONFIGURE= yes
+USE_NCURSES= # resize_term()
+USE_X11= yes
USE_BUILDLINK2= yes
USE_GMAKE= yes
-MAKE_ENV+= X11BASE=${X11BASE} INSTALL_PREFIX=${X11PREFIX}
-
-ALL_TARGET= netbsd default
-
-do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/bin/bzflag ${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/bin/bzfls ${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/bin/bzfrelay ${PREFIX}/bin
- ${INSTALL_PROGRAM} ${WRKSRC}/bin/bzfs ${PREFIX}/bin
- ${INSTALL_MAN} ${WRKSRC}/man/bzflag.6s ${PREFIX}/man/man6/bzflag.6
- ${INSTALL_MAN} ${WRKSRC}/man/bzfls.6s ${PREFIX}/man/man6/bzfls.6
- ${INSTALL_MAN} ${WRKSRC}/man/bzfrelay.6s ${PREFIX}/man/man6/bzfrelay.6
- ${INSTALL_MAN} ${WRKSRC}/man/bzfs.6s ${PREFIX}/man/man6/bzfs.6
- ${INSTALL_DATA_DIR} ${PREFIX}/share/bzflag
- ${CP} ${WRKSRC}/data/* ${PREFIX}/share/bzflag
-
-.include "../../graphics/MesaLib/buildlink2.mk"
-.include "../../graphics/glu/buildlink2.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} != "Linux"
+post-extract:
+ ${SED} -e 's|@LINUX_TRUE@||g ; s|@LINUX_FALSE@|#|g' \
+ ${WRKSRC}/src/platform/Makefile.in > \
+ ${WRKSRC}/src/platform/Makefile.sed
+ ${MV} ${WRKSRC}/src/platform/Makefile.sed \
+ ${WRKSRC}/src/platform/Makefile.in
+.endif
+
+CONFIGURE_ARGS+= --with-ncurses
+
+.include "../../devel/ncurses/buildlink2.mk"
+.include "../../devel/zlib/buildlink2.mk"
+.include "../../graphics/Mesa/buildlink2.mk"
+
+.include "../../mk/ossaudio.buildlink2.mk"
+.include "../../mk/pthread.buildlink2.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/games/bzflag/PLIST b/games/bzflag/PLIST
index 670d12483c4..71e7f399721 100644
--- a/games/bzflag/PLIST
+++ b/games/bzflag/PLIST
@@ -1,62 +1,88 @@
-@comment $NetBSD: PLIST,v 1.2 2002/11/08 11:24:25 mrg Exp $
+@comment $NetBSD: PLIST,v 1.3 2003/12/13 10:32:53 xtraeme Exp $
+bin/bzadmin
bin/bzflag
-bin/bzfls
bin/bzfrelay
bin/bzfs
+man/man6/bzadmin.6
man/man6/bzflag.6
man/man6/bzfls.6
+man/man6/bzfquery.6
man/man6/bzfrelay.6
man/man6/bzfs.6
-share/bzflag/Bzflag.fti
-share/bzflag/Bzflag.ftr
-share/bzflag/Bzfs.fti
-share/bzflag/bbolt.rgb
-share/bzflag/blaser.rgb
+share/bzflag/bbolt.png
+share/bzflag/blaser.png
share/bzflag/boom.wav
-share/bzflag/boxwall.rgb
-share/bzflag/caution.rgb
-share/bzflag/clouds.rgb
-share/bzflag/explode1.rgb
+share/bzflag/boxwall.png
+share/bzflag/btbolt.png
+share/bzflag/caution.png
+share/bzflag/clouds.png
+share/bzflag/explode1.png
share/bzflag/explosion.wav
share/bzflag/fire.wav
-share/bzflag/fixedbr.rgb
-share/bzflag/fixedmr.rgb
-share/bzflag/flag.rgb
+share/bzflag/fixedbr.png
+share/bzflag/fixedmr.png
+share/bzflag/flag.png
share/bzflag/flag_alert.wav
share/bzflag/flag_drop.wav
share/bzflag/flag_grab.wav
share/bzflag/flag_lost.wav
share/bzflag/flag_won.wav
-share/bzflag/flage.rgb
-share/bzflag/gbolt.rgb
-share/bzflag/glaser.rgb
-share/bzflag/ground.rgb
-share/bzflag/helvbi.rgb
-share/bzflag/helvbr.rgb
+share/bzflag/flage.png
+share/bzflag/gbolt.png
+share/bzflag/glaser.png
+share/bzflag/ground.png
+share/bzflag/gtbolt.png
+share/bzflag/helvbi.png
+share/bzflag/helvbr.png
+share/bzflag/hunt.wav
+share/bzflag/hunt_select.wav
share/bzflag/jump.wav
share/bzflag/killteam.wav
+share/bzflag/l10n/bzflag_cs_CZ.po
+share/bzflag/l10n/bzflag_da.po
+share/bzflag/l10n/bzflag_de.po
+share/bzflag/l10n/bzflag_en_US_l33t.po
+share/bzflag/l10n/bzflag_en_US_redneck.po
+share/bzflag/l10n/bzflag_es.po
+share/bzflag/l10n/bzflag_fr.po
+share/bzflag/l10n/bzflag_it.po
+share/bzflag/l10n/bzflag_kg.po
+share/bzflag/l10n/bzflag_nl.po
+share/bzflag/l10n/bzflag_pt.po
+share/bzflag/l10n/bzflag_sv.po
+share/bzflag/l10n/bzflag_xx.po
share/bzflag/land.wav
share/bzflag/laser.wav
share/bzflag/lock.wav
-share/bzflag/missile.rgb
+share/bzflag/missile.png
share/bzflag/missile.wav
-share/bzflag/mountain.rgb
-share/bzflag/panel.rgb
-share/bzflag/pbolt.rgb
+share/bzflag/mountain.png
+share/bzflag/panel.png
+share/bzflag/pbolt.png
share/bzflag/phantom.wav
-share/bzflag/plaser.rgb
+share/bzflag/plaser.png
share/bzflag/pop.wav
-share/bzflag/pyrwall.rgb
-share/bzflag/rbolt.rgb
+share/bzflag/ptbolt.png
+share/bzflag/pyrwall.png
+share/bzflag/rbolt.png
share/bzflag/ricochet.wav
-share/bzflag/rlaser.rgb
-share/bzflag/roof.rgb
+share/bzflag/rlaser.png
+share/bzflag/roof.png
+share/bzflag/rtbolt.png
share/bzflag/shock.wav
+share/bzflag/steamroller.wav
+share/bzflag/teamgrab.wav
share/bzflag/teleport.wav
-share/bzflag/timesbi.rgb
-share/bzflag/timesbr.rgb
-share/bzflag/title.rgb
-share/bzflag/wall.rgb
-share/bzflag/ybolt.rgb
-share/bzflag/ylaser.rgb
+share/bzflag/thief.png
+share/bzflag/timesbi.png
+share/bzflag/timesbr.png
+share/bzflag/title.png
+share/bzflag/wall.png
+share/bzflag/wbolt.png
+share/bzflag/wlaser.png
+share/bzflag/wtbolt.png
+share/bzflag/ybolt.png
+share/bzflag/ylaser.png
+share/bzflag/ytbolt.png
+@dirrm share/bzflag/l10n
@dirrm share/bzflag
diff --git a/games/bzflag/distinfo b/games/bzflag/distinfo
index 5c1fbaf339f..b95e760dad0 100644
--- a/games/bzflag/distinfo
+++ b/games/bzflag/distinfo
@@ -1,17 +1,9 @@
-$NetBSD: distinfo,v 1.2 2003/09/25 02:38:12 jschauma Exp $
+$NetBSD: distinfo,v 1.3 2003/12/13 10:32:53 xtraeme Exp $
-SHA1 (bzflag-1.7e6.tgz) = 283a5f4eae87c43a1a7772e9ca40048df0e84bda
-Size (bzflag-1.7e6.tgz) = 2428811 bytes
-SHA1 (patch-aa) = b96af1e1a6a5ecbf1cde1007fc4fd06f7d005c42
-SHA1 (patch-ab) = 54414bd84630f3af19a4401d0342495553275cde
-SHA1 (patch-ac) = 81d06903bd4e7cf433b070562647069247c04b8a
-SHA1 (patch-ad) = 1393333c31a1be69a8a24f7d18e01539651356f8
-SHA1 (patch-ae) = 9c6f5df5f85c5aa8dcd12506bd7129dfbac38acf
-SHA1 (patch-af) = e604489f687ba6858ed7916eed9f63e2d068929b
-SHA1 (patch-ag) = e5f539e70cfb527d0faa05bfe2afb777242df6bb
-SHA1 (patch-ah) = c997a123696e7a26ef8f39950f8bea4a7eaf6ebc
-SHA1 (patch-ai) = 50bfe81735a71abb69b203272d28312a93c0eaaf
-SHA1 (patch-aj) = 2c88ce8add674a9a28d686bd5f7b1d2958f3084f
-SHA1 (patch-ak) = abdef8fe4c4efe622540b3f2da0b6153dbf5cdab
-SHA1 (patch-al) = 586abdf3c690162adb861a00147038bdce4b5543
-SHA1 (patch-am) = f82c2fa9ad22beec209e789ecb463caf58272004
+SHA1 (bzflag-1.10.20031209.tar.gz) = 3bf7fb071707075f9a7a681fe5ae9e03c17a08ec
+Size (bzflag-1.10.20031209.tar.gz) = 3352632 bytes
+SHA1 (patch-aa) = 05df40eb0fbb7dbab583434f25709cb815469393
+SHA1 (patch-ab) = 4c5cf621c5f66768b61669087373e74233d179ab
+SHA1 (patch-ac) = 808f1065b64478248337e84785518d03d230c96b
+SHA1 (patch-ad) = 896097e7cc29c8d186751c299857730be196b228
+SHA1 (patch-ae) = 2b20b1f46510e66c5ac33415af15e25e9acffc8d
diff --git a/games/bzflag/patches/patch-aa b/games/bzflag/patches/patch-aa
index 53d50162146..ea1798715a1 100644
--- a/games/bzflag/patches/patch-aa
+++ b/games/bzflag/patches/patch-aa
@@ -1,20 +1,13 @@
-$NetBSD: patch-aa,v 1.1.1.1 2002/09/24 12:49:10 blymn Exp $
+$NetBSD: patch-aa,v 1.2 2003/12/13 10:32:53 xtraeme Exp $
---- Makefile.orig Sun Sep 22 22:24:02 2002
-+++ Makefile
-@@ -33,6 +33,7 @@ AVAILTARGETS = \
- linux-ppc \
- solaris-cc \
- solaris-gcc \
-+ netbsd \
- $(NULL)
+--- include/common.h.orig 2003-12-13 10:38:57.000000000 +0100
++++ include/common.h 2003-12-13 10:41:43.000000000 +0100
+@@ -45,7 +45,7 @@
+ #endif
+
+ // Might we be BSDish? sys/param.h has BSD defined if so
+-#if (defined(__unix__) || defined(unix) || defined(__APPLE__)) && !defined(USG)
++#if defined(__APPLE__) || !defined(USG)
+ #include <sys/param.h>
+ #endif
- config-sys:
-@@ -42,6 +43,7 @@ config-sys:
- @echo " make linux"
- @echo " make linux-i386"
- @echo " make linux-ppc"
-+ @echo " make netbsd"
- @echo " make solaris-cc"
- @echo " make solaris-gcc"
- @echo " make win32"
diff --git a/games/bzflag/patches/patch-ab b/games/bzflag/patches/patch-ab
index b5425d9af17..9c1b39d9772 100644
--- a/games/bzflag/patches/patch-ab
+++ b/games/bzflag/patches/patch-ab
@@ -1,123 +1,22 @@
-$NetBSD: patch-ab,v 1.2 2003/09/25 02:38:13 jschauma Exp $
+$NetBSD: patch-ab,v 1.3 2003/12/13 10:32:53 xtraeme Exp $
---- configs/config-netbsd.orig Mon Sep 23 15:26:33 2002
-+++ configs/config-netbsd
-@@ -0,0 +1,118 @@
-+# bzflag
-+# Copyright (c) 1993 - 2002 Tim Riker
-+#
-+# This package is free software; you can redistribute it and/or
-+# modify it under the terms of the license found in the file
-+# named LICENSE that should have accompanied this file.
-+#
-+# THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+
-+#
-+# configuration for generic netbsd
-+#
-+CONFIG = netbsd
-+
-+#
-+# use XF86 vidmode extension (comment out to disable)
-+#
-+XF86VIDMODE_DEF = -DXF86VIDMODE_EXT
-+XF86VIDMODE_LIB = -lXxf86vm
-+
-+#
-+# use XInput extension for joystick support (comment out to disable)
-+#
-+JOYSTICK_DEF = -DXIJOYSTICK
-+JOYSTICK_LIB = -lXi
-+
-+#
-+# accumulate extension definitions and libs
-+#
-+XEXT_DEF = $(XF86VIDMODE_DEF) $(JOYSTICK_DEF)
-+XEXT_LIB = $(XF86VIDMODE_LIB) $(JOYSTICK_LIB)
-+
-+#
-+# install locations
-+#
-+INSTALL_DATA_DIR = $(X11PREFIX)/share/bzflag
-+
-+#
-+# tools
-+#
-+AR = /usr/bin/ar cru
-+CC = /usr/bin/gcc
-+CXX = /usr/bin/g++
-+CD = cd
-+CP = /bin/cp
-+LD = /usr/bin/ld
-+MKDIR = /bin/mkdir
-+NROFF = /usr/bin/nroff
-+RM = /bin/rm -f
-+RMR = $(RM) -r
-+SHELL = /bin/sh
-+ECHO = echo
-+
-+#
-+# compiler definitions
-+#
-+PCDEFS = -D_BSD_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -DHALF_RATE_AUDIO $(XEXT_DEF)
-+PCXXDEFS = -D_BSD_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -DHALF_RATE_AUDIO $(XEXT_DEF)
-+
-+#
-+# compiler options
-+#
-+PCOPTS = -Wall -W -ansi $(ACOPTS)
-+PCXXOPTS = -Wall -W -fno-exceptions -fno-rtti $(ACXXOPTS)
-+COPT = -DNDEBUG -O2
-+CXXOPT = -DNDEBUG -O2 -ffast-math -fomit-frame-pointer -fnonnull-objects \
-+ -fexpensive-optimizations
-+CDEBUG = -DDEBUG -g
-+CXXDEBUG = -DDEBUG -g
-+CWOFF =
-+CXXWOFF =
-+
-+#
-+# search paths
-+#
-+PCINCS = -I/usr/include -I$(X11BASE)/include
-+PCXXINCS = -I/usr/include -I$(X11BASE)/include
-+
-+#
-+# linker options
-+#
-+PLDOPTS = -L$(X11BASE)/lib -Wl,-R$(X11BASE)/lib -L$(PREFIX)/lib -Wl,-R$(PREFIX)/lib
-+
-+#
-+# dirt
-+#
-+PDIRT = *.[eou] a.out core ar.tmp.*
-+
-+#
-+# libraries
-+#
-+AUDIO_LIBS = \
-+ $(NULL)
-+
-+DISPLAY_LIBS = \
-+ $(NULL)
-+
-+GL_LIBS = \
-+ -lGLU \
-+ -lGL \
-+ $(NULL)
-+
-+IMAGE_LIBS = \
-+ $(NULL)
-+
-+NETWORK_LIBS = \
-+ $(NULL)
-+
-+WINDOW_LIBS = \
-+ $(XEXT_LIB) \
-+ -lXext \
-+ -lX11 \
-+ -lossaudio \
-+ -lm \
-+ $(NULL)
-+
+--- include/network.h.orig 2003-12-13 10:57:47.000000000 +0100
++++ include/network.h 2003-12-13 10:58:05.000000000 +0100
+@@ -46,7 +46,7 @@
+ #include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
+-#if defined(_old_linux_) || (!defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(macintosh) && !defined(__BEOS__))
++#if defined(_old_linux_) || (!defined(__linux__) && !defined(sun) && !defined(BSD) && !defined(__APPLE__) && !defined(macintosh) && !defined(__BEOS__))
+ #include <bstring.h>
+ #endif
+
+@@ -72,7 +72,7 @@
+ #define SSOType void*
+ #endif
+
+-#if defined(__FreeBSD__) || defined(sun)
++#if defined(BSD) || defined(sun)
+ #define AddrLen socklen_t
+ #endif
+
diff --git a/games/bzflag/patches/patch-ac b/games/bzflag/patches/patch-ac
index a444080ffcd..1226e86572f 100644
--- a/games/bzflag/patches/patch-ac
+++ b/games/bzflag/patches/patch-ac
@@ -1,219 +1,13 @@
-$NetBSD: patch-ac,v 1.1.1.1 2002/09/24 12:49:12 blymn Exp $
+$NetBSD: patch-ac,v 1.2 2003/12/13 10:32:53 xtraeme Exp $
---- src/platform/NetBSDDisplay.cxx.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDDisplay.cxx
-@@ -0,0 +1,214 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#include "NetBSDDisplay.h"
-+#include "XWindow.h"
-+
-+#if defined(USE_XF86VIDMODE_EXT)
-+#include <stdio.h>
-+
-+// evaluates to the (approximate) vertical retrace speed of modeinfo _r
-+#define getRetrace(_r) ((int)(0.5f + (1000.0f * (_r)->dotclock) / \
-+ ((_r)->htotal * (_r)->vtotal)))
-+
-+static int resolutionCompare(const void* _a, const void* _b)
-+{
-+ const XF86VidModeModeInfo* a = *((const XF86VidModeModeInfo**)_a);
-+ const XF86VidModeModeInfo* b = *((const XF86VidModeModeInfo**)_b);
-+
-+ // test the stuff we actually care about
-+ if (a->hdisplay < b->hdisplay) return -1;
-+ if (a->hdisplay > b->hdisplay) return 1;
-+ if (a->vdisplay < b->vdisplay) return -1;
-+ if (a->vdisplay > b->vdisplay) return 1;
-+ if (getRetrace(a) < getRetrace(b)) return -1;
-+ if (getRetrace(a) > getRetrace(b)) return 1;
-+
-+ // other info can be ordered arbitrarily
-+ return 0;
-+}
-+
-+//
-+// NetBSDDisplayMode
-+//
-+
-+NetBSDDisplayMode::NetBSDDisplayMode() : display(NULL),
-+ numResolutions(0),
-+ lastResolution(-1),
-+ resolutions(NULL),
-+ origNumResolutions(0),
-+ origResolutions(NULL)
-+{
-+ // do nothing
-+}
-+
-+NetBSDDisplayMode::~NetBSDDisplayMode()
-+{
-+ delete[] resolutions;
-+ if (origResolutions)
-+ XFree(origResolutions);
-+}
-+
-+XDisplayMode::ResInfo** NetBSDDisplayMode::init(XDisplay* _display,
-+ int& numModes, int& currentMode)
-+{
-+ int i, eventbase, errorbase;
-+
-+ // save display for later
-+ display = _display;
-+
-+ // Check if we have the XF86 vidmode extension
-+ if (!XF86VidModeQueryExtension(display->getRep()->getDisplay(),
-+ &eventbase, &errorbase))
-+ return NULL;
-+
-+ // get available resolutions
-+ if (!XF86VidModeGetAllModeLines(display->getRep()->getDisplay(),
-+ display->getRep()->getScreen(),
-+ &numResolutions, &origResolutions))
-+ return NULL;
-+
-+ // get current resolution
-+ int dotclock;
-+ XF86VidModeModeLine mode;
-+ XF86VidModeGetModeLine(display->getRep()->getDisplay(),
-+ display->getRep()->getScreen(),
-+ &dotclock, &mode);
-+
-+ // make a copy of the original data
-+ origNumResolutions = numResolutions;
-+ resolutions = new XF86VidModeModeInfo*[numResolutions];
-+ for (i = 0; i < numResolutions; i++)
-+ resolutions[i] = origResolutions[i];
-+
-+ // sort resolutions
-+ qsort(resolutions, numResolutions, sizeof(resolutions[0]), resolutionCompare);
-+
-+ // find current resolution in the available resolution list
-+ int current;
-+ for (current = 0; current < numResolutions; current++) {
-+ const XF86VidModeModeInfo* r = resolutions[current];
-+ if (dotclock == (int)r->dotclock &&
-+ mode.hdisplay == r->hdisplay &&
-+ mode.hsyncstart == r->hsyncstart &&
-+ mode.hsyncend == r->hsyncend &&
-+ mode.htotal == r->htotal &&
-+ mode.vdisplay == r->vdisplay &&
-+ mode.vsyncstart == r->vsyncstart &&
-+ mode.vsyncend == r->vsyncend &&
-+ mode.vtotal == r->vtotal &&
-+ mode.flags == r->flags)
-+ break;
-+ }
-+
-+ // no switching if current mode not found
-+ if (current == numResolutions)
-+ return NULL;
-+
-+ // compress out modes that are (effectively) duplicates. never
-+ // remove the current mode.
-+ for (i = 0; i < numResolutions - 1; ) {
-+ if (resolutionCompare(resolutions + i, resolutions + i + 1) == 0) {
-+ // is next resolution the current mode? if so then move it down
-+ // so we don't blow it away.
-+ if (current == i + 1)
-+ resolutions[i] = resolutions[i + 1];
-+
-+ // move remaining resolutions down (overwriting the one after i)
-+ for (int j = i + 2; j < numResolutions; j++)
-+ resolutions[j - 1] = resolutions[j];
-+
-+ // do we move the current resolution down too?
-+ if (current > i)
-+ current--;
-+
-+ // now one less resolution
-+ numResolutions--;
-+ }
-+ else {
-+ i++;
-+ }
-+ }
-+
-+ // make ResInfo list
-+ char name[80];
-+ ResInfo** resInfo = new ResInfo*[numResolutions];
-+ for (i = 0; i < numResolutions; i++) {
-+ const XF86VidModeModeInfo* r = resolutions[i];
-+ sprintf(name, "%dx%d @%d", r->hdisplay, r->vdisplay, getRetrace(r));
-+ resInfo[i] = new ResInfo(name, r->hdisplay, r->vdisplay, getRetrace(r));
-+ }
-+
-+ // return modes
-+ numModes = numResolutions;
-+ currentMode = current;
-+ lastResolution = current;
-+ return resInfo;
-+}
-+
-+boolean NetBSDDisplayMode::set(int index)
-+{
-+ return doSet(index, True);
-+}
-+
-+boolean NetBSDDisplayMode::setDefault(int index)
-+{
-+ return doSet(index, False);
-+}
-+
-+boolean NetBSDDisplayMode::doSet(int index, boolean position)
-+{
-+ // ignore attempts to set video format to current format.
-+ // normally this only happens when restoring the default
-+ // format, when BzfDisplay deliberately forces the change.
-+ // that's useful for win32 where the OS knows the right
-+ // format and will ignore calls to switch the current
-+ // format. however, irix isn't so clever and may cause
-+ // the display to flicker even when the format isn't
-+ // really changing.
-+ if (index == lastResolution || numResolutions <= 1)
-+ return True;
-+
-+ // deactivate windows before resolution change. if we don't do this
-+ // then the app will almost certainly crash in the OpenGL driver.
-+ XWindow::deactivateAll();
-+
-+ // change resolution
-+ if (XF86VidModeSwitchToMode(display->getRep()->getDisplay(),
-+ display->getRep()->getScreen(),
-+ resolutions[index])) {
-+ if (position) {
-+ // kludge for accelerated GLX. when we set the view port after
-+ // changing the resolution just before quiting, GLX does not
-+ // release the display to X server control. or something like
-+ // that. the effect is that you see the game window still on
-+ // the screen but maybe shifted around and you can't see any of
-+ // the other windows. without this code, a workaround for the
-+ // problem is ctrl_alt_+ or ctrl_alt_- to force a resize.
-+ XF86VidModeSetViewPort(display->getRep()->getDisplay(),
-+ display->getRep()->getScreen(), 0, 0);
-+ }
-+ XSync(display->getRep()->getDisplay(), False);
-+ lastResolution = index;
-+
-+ // reactivate previously deactivated window after change
-+ XWindow::reactivateAll();
-+ return True;
-+ }
-+
-+ // reactivate previously deactivated window after change
-+ XWindow::reactivateAll();
-+ return False;
-+}
-+
-+#endif
-+// ex: shiftwidth=2 tabstop=8
+--- src/bzadmin/Makefile.in.orig 2003-12-13 11:01:09.000000000 +0100
++++ src/bzadmin/Makefile.in 2003-12-13 11:01:28.000000000 +0100
+@@ -128,7 +128,7 @@
+ PROGRAMS = $(bin_PROGRAMS)
+
+
+-DEFS = @DEFS@ -I. -I$(srcdir) -I../../include
++DEFS = @DEFS@ -I. -I$(srcdir) -I../../include -I${BUILDLINK_DIR}/include
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
diff --git a/games/bzflag/patches/patch-ad b/games/bzflag/patches/patch-ad
index 401c58a4300..9855c3782f6 100644
--- a/games/bzflag/patches/patch-ad
+++ b/games/bzflag/patches/patch-ad
@@ -1,57 +1,22 @@
-$NetBSD: patch-ad,v 1.1.1.1 2002/09/24 12:49:12 blymn Exp $
+$NetBSD: patch-ad,v 1.2 2003/12/13 10:32:53 xtraeme Exp $
---- src/platform/NetBSDDisplay.h.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDDisplay.h
-@@ -0,0 +1,52 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+/* NetBSDDisplay:
-+ * An X display with XFree86 vidmode extension
-+ */
-+
-+#ifndef BZF_NETBSDDISPLAY_H
-+#define BZF_NETBSDDISPLAY_H
-+
-+#include "XDisplay.h"
-+#if defined(XF86VIDMODE_EXT)
-+#define USE_XF86VIDMODE_EXT
-+#define private c_private
-+#include <X11/extensions/xf86vmode.h>
-+#undef private
-+#endif
-+
-+class NetBSDDisplayMode : public XDisplayMode {
-+ public:
-+#if defined(USE_XF86VIDMODE_EXT)
-+ NetBSDDisplayMode();
-+ ~NetBSDDisplayMode();
-+
-+ ResInfo** init(XDisplay* owner, int& num, int& current);
-+ boolean set(int);
-+ boolean setDefault(int);
-+
-+ private:
-+ boolean doSet(int, boolean position);
-+
-+ private:
-+ XDisplay* display;
-+ int numResolutions;
-+ int lastResolution;
-+ XF86VidModeModeInfo** resolutions;
-+ int origNumResolutions;
-+ XF86VidModeModeInfo** origResolutions;
-+#endif
-+};
-+
-+#endif // BZF_NETBSDDISPLAY_H
-+// ex: shiftwidth=2 tabstop=8
+--- configure.orig Tue Dec 9 17:08:21 2003
++++ configure Thu Dec 11 00:55:53 2003
+@@ -2515,7 +2515,7 @@
+ fi
+
+
+-LDFLAGS=$X_LIBS
++LDFLAGS="$X_LIBS $LDFLAGS"
+ case $host_os in
+ solaris*)
+ GLIBS="-lresolv -laudio $GLIBS";
+@@ -2724,7 +2724,7 @@
+
+ # avoid using X11 in BeOS
+ if test $host_os != beos; then
+- CPPFLAGS=
++ CPPFLAGS="$X_CFLAGS $CPPFLAGS"
+ if test x$no_x = x; then
+ GLIBS="$X_PRE_LIBS -lX11 $EXTRA_LIBS $GLIBS"
+ fi
diff --git a/games/bzflag/patches/patch-ae b/games/bzflag/patches/patch-ae
index 7683bae27b5..96d7643d0fa 100644
--- a/games/bzflag/patches/patch-ae
+++ b/games/bzflag/patches/patch-ae
@@ -1,482 +1,30 @@
-$NetBSD: patch-ae,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
+$NetBSD: patch-ae,v 1.2 2003/12/13 10:32:53 xtraeme Exp $
---- src/platform/NetBSDMedia.cxx.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDMedia.cxx
-@@ -0,0 +1,477 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#include "NetBSDMedia.h"
-+#include <math.h>
-+#include <fcntl.h>
-+#ifdef BSD
-+#include <machine/endian.h>
-+#else
-+#ifdef __NetBSD__
-+#include <sys/endian.h>
-+#else
-+#include <endian.h>
-+#endif
-+#endif
-+#include <sys/time.h>
-+#include <sys/types.h>
-+#include <unistd.h>
-+#include <sys/wait.h>
-+#include "bzsignal.h"
-+#ifdef __NetBSD__
-+#include <soundcard.h>
-+#else
-+#include <sys/soundcard.h>
-+#endif
-+#include <sys/ioctl.h>
-+#include <TimeKeeper.h>
-+#include <errno.h>
-+#include <string.h>
-+
-+#ifdef HALF_RATE_AUDIO
-+static const int defaultAudioRate=11025;
-+#else
-+static const int defaultAudioRate=22050;
-+#endif
-+
-+//
-+// NetBSDMedia
-+//
-+
-+NetBSDMedia::NetBSDMedia() : BzfMedia(), audioReady(False),
-+ audioPortFd(-1),
-+ queueIn(-1), queueOut(-1),
-+ outputBuffer(NULL),
-+ childProcID(0),
-+ audio8Bit(False),
-+ getospaceBroken(False)
-+{
-+ // do nothing
-+}
-+
-+NetBSDMedia::~NetBSDMedia()
-+{
-+ // do nothing
-+}
-+
-+double NetBSDMedia::getTime()
-+{
-+ struct timeval tv;
-+ gettimeofday(&tv, 0);
-+ return (double)tv.tv_sec + 1.0e-6 * (double)tv.tv_usec;
-+}
-+
-+double NetBSDMedia::stopwatch(boolean start)
-+{
-+ if (start) {
-+ stopwatchTime = getTime();
-+ return 0.0;
-+ }
-+ return getTime() - stopwatchTime;
-+}
-+
-+void NetBSDMedia::sleep(float timeInSeconds)
-+{
-+ struct timeval tv;
-+ tv.tv_sec = (long)timeInSeconds;
-+ tv.tv_usec = (long)(1.0e6 * (timeInSeconds - tv.tv_sec));
-+ select(0, NULL, NULL, NULL, &tv);
-+}
-+
-+boolean NetBSDMedia::openAudio()
-+{
-+ // don't re-initialize
-+ if (audioReady) return False;
-+
-+ // check for and open audio hardware
-+ if (!checkForAudioHardware() || !openAudioHardware()) return False;
-+
-+ // open communication channel (FIFO pipe). close on exec.
-+ int fd[2];
-+ if (pipe(fd)<0) {
-+ closeAudio();
-+ return False;
-+ }
-+ queueIn = fd[1];
-+ queueOut = fd[0];
-+ fcntl(queueIn, F_SETFL, fcntl(queueIn, F_GETFL, 0) | O_NDELAY);
-+ fcntl(queueOut, F_SETFL, fcntl(queueOut, F_GETFL, 0) | O_NDELAY);
-+ fcntl(queueIn, F_SETFD, fcntl(queueIn, F_GETFD, 0) | FD_CLOEXEC);
-+ fcntl(queueOut, F_SETFD, fcntl(queueOut, F_GETFD, 0) | FD_CLOEXEC);
-+
-+ // compute maxFd for use in select() call
-+ maxFd = queueOut;
-+ if (maxFd<audioPortFd) maxFd = audioPortFd;
-+ maxFd++;
-+
-+ // make an output buffer
-+ outputBuffer = new short[audioBufferSize];
-+
-+ // Set default no thread
-+ childProcID=0;
-+
-+ // ready to go
-+ audioReady = True;
-+ return True;
-+}
-+
-+boolean NetBSDMedia::checkForAudioHardware()
-+{
-+ boolean flag=False;
-+ if (!access("/dev/audio", W_OK)) flag=True;
-+ if (!access("/dev/sound", W_OK)) flag=True;
-+ return flag;
-+}
-+
-+boolean NetBSDMedia::openIoctl(
-+ int cmd, void* value, boolean req)
-+{
-+ if (audioPortFd == -1)
-+ return False;
-+
-+ if (ioctl(audioPortFd, cmd, value) < 0) {
-+ fprintf(stderr, "audio ioctl failed (cmd %x, err %d)... ", cmd, errno);
-+ if (req) {
-+ close(audioPortFd);
-+ audioPortFd = -1;
-+ fprintf(stderr, "giving up on audio\n");
-+ }
-+ else {
-+ fprintf(stderr, "ignored\n");
-+ }
-+ return False;
-+ }
-+ return True;
-+}
-+
-+static const int NumChunks = 4;
-+
-+boolean NetBSDMedia::openAudioHardware()
-+{
-+ int format, n;
-+
-+ // what's the audio format?
-+#if BYTE_ORDER == BIG_ENDIAN
-+ format = AFMT_S16_BE;
-+#else
-+ format = AFMT_S16_LE;
-+#endif
-+
-+ // what the frequency?
-+ audioOutputRate = defaultAudioRate;
-+
-+ // how big a fragment to use? we want to hold at around 1/10th of
-+ // a second.
-+ int fragmentSize = (int)(0.08f * (float)audioOutputRate);
-+ n = 0;
-+ while ((1 << n) < fragmentSize)
-+ ++n;
-+
-+ // samples are two bytes each and we're in stereo so quadruple the size
-+ fragmentSize = n + 2;
-+
-+ // now how many fragments and what's the low water mark (in fragments)?
-+ int fragmentInfo = (NumChunks << 16) | fragmentSize;
-+ audioLowWaterMark = 2;
-+
-+ // open device (but don't wait for it)
-+ audioPortFd = open("/dev/audio", O_WRONLY | O_NDELAY, 0);
-+ if (audioPortFd == -1) {
-+ audioPortFd = open("/dev/sound", O_WRONLY | O_NDELAY, 0);
-+ if (audioPortFd == -1) {
-+ fprintf(stderr, "Failed to open audio device /dev/audio or /dev/sound (%d)\n", errno);
-+ return False;
-+ }
-+ }
-+
-+ // back to blocking I/O
-+ fcntl(audioPortFd, F_SETFL, fcntl(audioPortFd, F_GETFL, 0) & ~O_NDELAY);
-+
-+ /* close audio on exec so launched server doesn't hold sound device */
-+ fcntl(audioPortFd, F_SETFD, fcntl(audioPortFd, F_GETFD) | FD_CLOEXEC);
-+
-+ // initialize device
-+ openIoctl(SNDCTL_DSP_RESET, 0);
-+ n = fragmentInfo;
-+ noSetFragment = false;
-+ if (!openIoctl(SNDCTL_DSP_SETFRAGMENT, &n, False)) {
-+ // this is not good. we can't set the size of the fragment
-+ // buffers. we'd like something short to minimize latencies
-+ // and the default is probably too long. we've got two
-+ // options here: accept the latency or try to force the
-+ // driver to play partial fragments. we'll try the later
-+ // unless BZF_AUDIO_NOPOST is in the environment
-+ if (!getenv("BZF_AUDIO_NOPOST"))
-+ noSetFragment = true;
-+ }
-+ n = format;
-+ openIoctl(SNDCTL_DSP_SETFMT, &n, False);
-+ if (n != format) {
-+ audio8Bit = True;
-+ n = AFMT_U8;
-+ openIoctl(SNDCTL_DSP_SETFMT, &n);
-+ }
-+ n = 1;
-+ openIoctl(SNDCTL_DSP_STEREO, &n);
-+ n = defaultAudioRate;
-+ openIoctl(SNDCTL_DSP_SPEED, &n);
-+
-+ // set audioBufferSize, which is the number of samples (not bytes)
-+ // in each fragment. there are two bytes per sample so divide the
-+ // fragment size by two unless we're in audio8Bit mode. also, if
-+ // we couldn't set the fragment size then force the buffer size to
-+ // the size we would've asked for. we'll force the buffer to be
-+ // flushed after we write that much data to keep latency low.
-+ if (noSetFragment ||
-+ !openIoctl(SNDCTL_DSP_GETBLKSIZE, &audioBufferSize, False) ||
-+ audioBufferSize > (1 << fragmentSize)) {
-+ audioBufferSize = 1 << fragmentSize;
-+ noSetFragment = true;
-+ }
-+ if (!audio8Bit)
-+ audioBufferSize >>= 1;
-+
-+ // SNDCTL_DSP_GETOSPACE not supported on all platforms. check if
-+ // it fails here and, if so, do a workaround by using the wall
-+ // clock. *shudder*
-+ if (audioPortFd != -1) {
-+ audio_buf_info info;
-+ if (!openIoctl(SNDCTL_DSP_GETOSPACE, &info, False)) {
-+ getospaceBroken = True;
-+ chunksPending = 0;
-+ chunksPerSecond = (double)getAudioOutputRate() /
-+ (double)getAudioBufferChunkSize();
-+ }
-+ }
-+
-+ return (audioPortFd != -1);
-+}
-+
-+void NetBSDMedia::closeAudio()
-+{
-+ delete [] outputBuffer;
-+ if (audioPortFd>=0) close(audioPortFd);
-+ if (queueIn!=-1) close(queueIn);
-+ if (queueOut!=-1) close(queueOut);
-+ audioReady=False;
-+ audioPortFd=-1;
-+ queueIn=-1;
-+ queueOut=-1;
-+ outputBuffer=0;
-+}
-+
-+boolean NetBSDMedia::startAudioThread(
-+ void (*proc)(void*), void* data)
-+{
-+ // if no audio thread then just call proc and return
-+ if (!hasAudioThread()) {
-+ proc(data);
-+ return True;
-+ }
-+
-+ // has an audio thread so fork and call proc
-+ if (childProcID) return True;
-+ if ((childProcID=fork()) > 0) {
-+ close(queueOut);
-+ close(audioPortFd);
-+ return True;
-+ }
-+ else if (childProcID < 0) {
-+ return False;
-+ }
-+ close(queueIn);
-+ proc(data);
-+ exit(0);
-+}
-+
-+void NetBSDMedia::stopAudioThread()
-+{
-+ if (childProcID != 0) kill(childProcID, SIGTERM);
-+ childProcID=0;
-+}
-+
-+boolean NetBSDMedia::hasAudioThread() const
-+{
-+#if defined(NO_AUDIO_THREAD)
-+ return False;
-+#else
-+ return True;
-+#endif
-+}
-+
-+void NetBSDMedia::audioThreadInit(void*)
-+{
-+}
-+
-+void NetBSDMedia::writeSoundCommand(const void* cmd, int len)
-+{
-+ if (!audioReady) return;
-+ write(queueIn, cmd, len);
-+}
-+
-+boolean NetBSDMedia::readSoundCommand(void* cmd, int len)
-+{
-+ return (read(queueOut, cmd, len)==len);
-+}
-+
-+int NetBSDMedia::getAudioOutputRate() const
-+{
-+ return audioOutputRate;
-+}
-+
-+int NetBSDMedia::getAudioBufferSize() const
-+{
-+ return NumChunks*(audioBufferSize>>1);
-+}
-+
-+int NetBSDMedia::getAudioBufferChunkSize() const
-+{
-+ return audioBufferSize>>1;
-+}
-+
-+boolean NetBSDMedia::isAudioTooEmpty() const
-+{
-+ if (getospaceBroken) {
-+ if (chunksPending > 0) {
-+ // get time elapsed since chunkTime
-+ const double dt = getTime() - chunkTime;
-+
-+ // how many chunks could've played in the elapsed time?
-+ const int numChunks = (int)(dt * chunksPerSecond);
-+
-+ // remove pending chunks
-+ NetBSDMedia* self = (NetBSDMedia*)this;
-+ self->chunksPending -= numChunks;
-+ if (chunksPending < 0)
-+ self->chunksPending = 0;
-+ else
-+ self->chunkTime += (double)numChunks / chunksPerSecond;
-+ }
-+ return chunksPending < audioLowWaterMark;
-+ }
-+ else {
-+ audio_buf_info info;
-+ if (ioctl(audioPortFd, SNDCTL_DSP_GETOSPACE, &info) < 0)
-+ return False;
-+ return info.fragments > info.fragstotal - audioLowWaterMark;
-+ }
-+}
-+
-+void NetBSDMedia::writeAudioFrames8Bit(
-+ const float* samples, int numFrames)
-+{
-+ int numSamples = 2 * numFrames;
-+ int limit;
-+ char *smOutputBuffer;
-+
-+ smOutputBuffer=(char*)outputBuffer;
-+ while (numSamples > 0) {
-+ if (numSamples>audioBufferSize) limit=audioBufferSize;
-+ else limit=numSamples;
-+ for (int j = 0; j < limit; j++) {
-+ if (samples[j] <= -32767.0) smOutputBuffer[j] = 0;
-+ else if (samples[j] >= 32767.0) smOutputBuffer[j] = 255;
-+ else smOutputBuffer[j] = char((samples[j]+32767)/257);
-+ }
-+
-+ // fill out the chunk (we never write a partial chunk)
-+ if (limit < audioBufferSize) {
-+ for (int j = limit; j < audioBufferSize; ++j)
-+ smOutputBuffer[j] = 127;
-+ limit = audioBufferSize;
-+ }
-+
-+ write(audioPortFd, smOutputBuffer, limit);
-+ samples += limit;
-+ numSamples -= limit;
-+ }
-+}
-+
-+void NetBSDMedia::writeAudioFrames16Bit(
-+ const float* samples, int numFrames)
-+{
-+ int numSamples = 2 * numFrames;
-+ int limit;
-+
-+ while (numSamples > 0) {
-+ if (numSamples>audioBufferSize) limit=audioBufferSize;
-+ else limit=numSamples;
-+ for (int j = 0; j < limit; j++) {
-+ if (samples[j] < -32767.0) outputBuffer[j] = -32767;
-+ else if (samples[j] > 32767.0) outputBuffer[j] = 32767;
-+ else outputBuffer[j] = short(samples[j]);
-+ }
-+
-+ // fill out the chunk (we never write a partial chunk)
-+ if (limit < audioBufferSize) {
-+ for (int j = limit; j < audioBufferSize; ++j)
-+ outputBuffer[j] = 0;
-+ limit = audioBufferSize;
-+ }
-+
-+ write(audioPortFd, outputBuffer, 2*limit);
-+ samples += limit;
-+ numSamples -= limit;
-+ }
-+}
-+
-+void NetBSDMedia::writeAudioFrames(
-+ const float* samples, int numFrames)
-+{
-+ if (audio8Bit) writeAudioFrames8Bit(samples, numFrames);
-+ else writeAudioFrames16Bit(samples, numFrames);
-+
-+ // if we couldn't set the fragment size then force the driver
-+ // to play the short buffer.
-+ if (noSetFragment) {
-+ int dummy = 0;
-+ ioctl(audioPortFd, SNDCTL_DSP_POST, &dummy);
-+ }
-+
-+ if (getospaceBroken) {
-+ if (chunksPending == 0)
-+ chunkTime = getTime();
-+ chunksPending += (numFrames + getAudioBufferChunkSize() - 1) /
-+ getAudioBufferChunkSize();
-+ }
-+}
-+
-+void NetBSDMedia::audioSleep(
-+ boolean checkLowWater, double endTime)
-+{
-+ fd_set commandSelectSet;
-+ struct timeval tv;
-+
-+ // To do both these operations at once, we need to poll.
-+ if (checkLowWater) {
-+ // start looping
-+ TimeKeeper start = TimeKeeper::getCurrent();
-+ do {
-+ // break if buffer has drained enough
-+ if (isAudioTooEmpty()) break;
-+ FD_ZERO(&commandSelectSet);
-+ FD_SET(queueOut, &commandSelectSet);
-+ tv.tv_sec=0;
-+ tv.tv_usec=50000;
-+ if (select(maxFd, &commandSelectSet, 0, 0, &tv)) break;
-+
-+ } while (endTime<0.0 || (TimeKeeper::getCurrent()-start)<endTime);
-+ } else {
-+ FD_ZERO(&commandSelectSet);
-+ FD_SET(queueOut, &commandSelectSet);
-+ tv.tv_sec=int(endTime);
-+ tv.tv_usec=int(1.0e6*(endTime-floor(endTime)));
-+
-+ select(maxFd, &commandSelectSet, 0, 0, (endTime>=0.0)?&tv : 0);
-+ }
-+}
-+// ex: shiftwidth=2 tabstop=8
+--- src/bzflag/Makefile.in.orig Wed Dec 10 09:09:45 2003
++++ src/bzflag/Makefile.in Thu Dec 11 02:09:15 2003
+@@ -168,7 +168,6 @@
+ @MACOS_FALSE@ ../scene/libSceneDB.a \
+ @MACOS_FALSE@ ../geometry/libGeometry.a \
+ @MACOS_FALSE@ ../mediafile/libMediaFile.a \
+-@MACOS_FALSE@ ../zlib/libz.a \
+ @MACOS_FALSE@ $(RESOURCE) \
+ @MACOS_FALSE@ $(GLIBS)
+ # This is required to hook in ogg/vorbis libraries
+@@ -176,7 +175,7 @@
+
+ AM_CPPFLAGS = $(X_CFLAGS)
+
+-bzflag_LDFLAGS = ../date/buildDate.o
++bzflag_LDFLAGS = ../date/buildDate.o -lz ${LIBOSSAUDIO}
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../include/config.h
+ CONFIG_CLEAN_FILES =
+@@ -207,7 +206,7 @@
+ @MACOS_FALSE@../common/libCommon.a ../obstacle/libObstacle.a \
+ @MACOS_FALSE@../platform/libPlatform.a ../ogl/libGLKit.a \
+ @MACOS_FALSE@../scene/libSceneDB.a ../geometry/libGeometry.a \
+-@MACOS_FALSE@../mediafile/libMediaFile.a ../zlib/libz.a
++@MACOS_FALSE@../mediafile/libMediaFile.a
+ CXXFLAGS = @CXXFLAGS@
+ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+ CXXLD = $(CXX)
diff --git a/games/bzflag/patches/patch-af b/games/bzflag/patches/patch-af
deleted file mode 100644
index 026b85ea883..00000000000
--- a/games/bzflag/patches/patch-af
+++ /dev/null
@@ -1,84 +0,0 @@
-$NetBSD: patch-af,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/platform/NetBSDMedia.h.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDMedia.h
-@@ -0,0 +1,79 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+/* NetBSDMedia:
-+ * Media I/O on NetBSD
-+ */
-+
-+#ifndef BZF_NETBSDMEDIA_H
-+#define BZF_NETBSDMEDIA_H
-+
-+#include "BzfMedia.h"
-+#include <stdio.h>
-+#include <unistd.h>
-+
-+class NetBSDMedia : public BzfMedia {
-+ public:
-+ NetBSDMedia();
-+ ~NetBSDMedia();
-+
-+ double stopwatch(boolean);
-+ void sleep(float);
-+ boolean openAudio();
-+ void closeAudio();
-+ boolean startAudioThread(void (*)(void*), void*);
-+ void stopAudioThread();
-+ boolean hasAudioThread() const;
-+ void writeSoundCommand(const void*, int);
-+ boolean readSoundCommand(void*, int);
-+ int getAudioOutputRate() const;
-+ int getAudioBufferSize() const;
-+ int getAudioBufferChunkSize() const;
-+ boolean isAudioTooEmpty() const;
-+ void writeAudioFrames(const float* samples, int numFrames);
-+ void audioSleep(boolean checkLowWater, double maxTime);
-+
-+ private:
-+ boolean checkForAudioHardware();
-+ boolean openAudioHardware();
-+ boolean openIoctl(int cmd, void* value, boolean req = True);
-+ static void audioThreadInit(void*);
-+
-+ void writeAudioFrames8Bit(
-+ const float* samples, int numFrames);
-+ void writeAudioFrames16Bit(
-+ const float* samples, int numFrames);
-+
-+ static double getTime();
-+
-+ private:
-+ boolean audioReady;
-+ int audioOutputRate;
-+ int audioBufferSize;
-+ int audioLowWaterMark;
-+ int maxFd;
-+ int audioPortFd;
-+ int queueIn, queueOut;
-+ short* outputBuffer;
-+ pid_t childProcID;
-+ double stopwatchTime;
-+ boolean audio8Bit;
-+
-+ boolean noSetFragment;
-+ boolean getospaceBroken;
-+ int chunksPending;
-+ double chunkTime;
-+ double chunksPerSecond;
-+};
-+
-+#endif // BZF_NETBSDMEDIA_H
-+// ex: shiftwidth=2 tabstop=8
diff --git a/games/bzflag/patches/patch-ag b/games/bzflag/patches/patch-ag
deleted file mode 100644
index f552031bfb1..00000000000
--- a/games/bzflag/patches/patch-ag
+++ /dev/null
@@ -1,67 +0,0 @@
-$NetBSD: patch-ag,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/platform/NetBSDPlatformFactory.cxx.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDPlatformFactory.cxx
-@@ -0,0 +1,62 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+#include "NetBSDPlatformFactory.h"
-+#include "NetBSDDisplay.h"
-+#include "XVisual.h"
-+#include "XWindow.h"
-+#include "NetBSDMedia.h"
-+
-+PlatformFactory* PlatformFactory::getInstance()
-+{
-+ if (!instance) instance = new NetBSDPlatformFactory;
-+ return instance;
-+}
-+
-+NetBSDPlatformFactory::NetBSDPlatformFactory()
-+{
-+ // do nothing
-+}
-+
-+NetBSDPlatformFactory::~NetBSDPlatformFactory()
-+{
-+ // do nothing
-+}
-+
-+BzfDisplay* NetBSDPlatformFactory::createDisplay(
-+ const char* name, const char*)
-+{
-+ XDisplay* display = new XDisplay(name, new NetBSDDisplayMode);
-+ if (!display || !display->isValid()) {
-+ delete display;
-+ return NULL;
-+ }
-+ return display;
-+}
-+
-+BzfVisual* NetBSDPlatformFactory::createVisual(
-+ const BzfDisplay* display)
-+{
-+ return new XVisual((const XDisplay*)display);
-+}
-+
-+BzfWindow* NetBSDPlatformFactory::createWindow(
-+ const BzfDisplay* display, BzfVisual* visual)
-+{
-+ return new XWindow((const XDisplay*)display, (XVisual*)visual);
-+}
-+
-+BzfMedia* NetBSDPlatformFactory::createMedia()
-+{
-+ return new NetBSDMedia;
-+}
-+// ex: shiftwidth=2 tabstop=8
diff --git a/games/bzflag/patches/patch-ah b/games/bzflag/patches/patch-ah
deleted file mode 100644
index 0b82193ada1..00000000000
--- a/games/bzflag/patches/patch-ah
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-ah,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/platform/NetBSDPlatformFactory.h.orig Sun Sep 22 22:29:02 2002
-+++ src/platform/NetBSDPlatformFactory.h
-@@ -0,0 +1,39 @@
-+/* bzflag
-+ * Copyright (c) 1993 - 2002 Tim Riker
-+ *
-+ * This package is free software; you can redistribute it and/or
-+ * modify it under the terms of the license found in the file
-+ * named LICENSE that should have accompanied this file.
-+ *
-+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+ */
-+
-+/* NetBSDPlatformFactory:
-+ * Factory for NetBSD platform stuff.
-+ */
-+
-+#ifndef BZF_NETBSD_PLATFORM_FACTORY_H
-+#define BZF_NETBSD_PLATFORM_FACTORY_H
-+
-+#include "PlatformFactory.h"
-+
-+class NetBSDPlatformFactory : public PlatformFactory {
-+ public:
-+ NetBSDPlatformFactory();
-+ ~NetBSDPlatformFactory();
-+
-+ BzfDisplay* createDisplay(const char* name, const char*);
-+ BzfVisual* createVisual(const BzfDisplay*);
-+ BzfWindow* createWindow(const BzfDisplay*, BzfVisual*);
-+
-+ private:
-+ NetBSDPlatformFactory(const NetBSDPlatformFactory&);
-+ NetBSDPlatformFactory& operator=(const NetBSDPlatformFactory&);
-+
-+ BzfMedia* createMedia();
-+};
-+
-+#endif // BZF_NETBSD_PLATFORM_FACTORY_H
-+// ex: shiftwidth=2 tabstop=8
diff --git a/games/bzflag/patches/patch-ai b/games/bzflag/patches/patch-ai
deleted file mode 100644
index 745ab48345a..00000000000
--- a/games/bzflag/patches/patch-ai
+++ /dev/null
@@ -1,45 +0,0 @@
-$NetBSD: patch-ai,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- include/common.h.orig Sun Sep 22 22:36:51 2002
-+++ include/common.h
-@@ -22,6 +22,22 @@
- #include <sys/param.h>
- #endif
-
-+#ifdef __NetBSD__
-+typedef unsigned long u_long;
-+typedef unsigned short u_short;
-+#include <sys/endian.h>
-+#include <sys/types.h>
-+#include <strings.h>
-+#define O_NDELAY O_NONBLOCK /* compat */
-+
-+__BEGIN_DECLS
-+int inet_aton(const char *, struct in_addr *);
-+const char *hstrerror(int);
-+int setenv(const char *, const char *, int);
-+void unsetenv(const char *);
-+__END_DECLS
-+#endif
-+
- #if defined(_WIN32)
- // turn off bogus `this used in base member initialization list'
- #pragma warning(disable: 4355)
-@@ -57,7 +73,7 @@ const boolean False = 0;
- const boolean True = !False;
-
- // some platforms don't have float versions of the math library
--#if defined(_old_linux_) || defined(_MACOSX_) || defined(sun)
-+#if defined(_old_linux_) || defined(_MACOSX_) || defined(sun) || defined(__NetBSD__)
- #define asinf (float)asin
- #define atanf (float)atan
- #define atan2f (float)atan2
-@@ -82,7 +98,7 @@ const boolean True = !False;
-
- #if !defined(_WIN32) & !defined(macintosh)
-
--#ifndef BSD
-+#if !defined(BSD) && !defined(__NetBSD__)
- #include <values.h>
- #endif
- #include <sys/types.h>
diff --git a/games/bzflag/patches/patch-aj b/games/bzflag/patches/patch-aj
deleted file mode 100644
index 9b3507e772e..00000000000
--- a/games/bzflag/patches/patch-aj
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD: patch-aj,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- include/network.h.orig Sun Sep 22 22:37:32 2002
-+++ include/network.h
-@@ -38,10 +38,13 @@
- #undef TCP_NODELAY
- #undef TCP_MAXSEG
- #endif
-+#ifdef __NetBSD__
-+#include <sys/endian.h>
-+#endif
- #include <netinet/tcp.h>
- #include <arpa/inet.h>
- #include <netdb.h>
--#if defined(_old_linux_) || (!defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(macintosh))
-+#if defined(_old_linux_) || (!defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(macintosh) && !defined(__NetBSD__))
- #include <bstring.h>
- #endif
-
-@@ -69,6 +72,10 @@
-
- #if defined(__FreeBSD__) && !defined(_MACOSX_)
- #define AddrLen socklen_t
-+#endif
-+
-+#if defined(__NetBSD__)
-+#define AddrLen socklen_t
- #endif
-
- #if defined(sun)
diff --git a/games/bzflag/patches/patch-ak b/games/bzflag/patches/patch-ak
deleted file mode 100644
index 5c10b06e919..00000000000
--- a/games/bzflag/patches/patch-ak
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-ak,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/bzfrelay/bzfrelay.c.orig Sun Sep 22 22:41:45 2002
-+++ src/bzfrelay/bzfrelay.c
-@@ -16,6 +16,12 @@
- * note that this program does not depend on any other bzflag files.
- */
-
-+#ifdef __NetBSD__
-+typedef unsigned long u_long;
-+typedef unsigned short u_short;
-+#define O_NDELAY O_NONBLOCK /* compat */
-+#endif
-+
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdarg.h>
diff --git a/games/bzflag/patches/patch-al b/games/bzflag/patches/patch-al
deleted file mode 100644
index b9a58b7ebe4..00000000000
--- a/games/bzflag/patches/patch-al
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-al,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/bzflag/bzflag.cxx.orig Sun Sep 22 22:45:49 2002
-+++ src/bzflag/bzflag.cxx
-@@ -473,14 +473,14 @@ static void parse(int argc, char** argv
- resources.addValue("window", "");
- }
- else if (strcmp(argv[i], "-3dfx") == 0 || strcmp(argv[i], "-3Dfx") == 0) {
--#if !defined(__linux__)
-+#if !defined(__linux__) && !defined(__NetBSD__)
- putenv("MESA_GLX_FX=fullscreen");
- #else
- setenv("MESA_GLX_FX", "fullscreen", 1);
- #endif
- }
- else if (strcmp(argv[i], "-no3dfx") == 0 || strcmp(argv[i], "-no3Dfx") == 0) {
--#if !defined(__linux__)
-+#if !defined(__linux__) && !defined(__NetBSD__)
- putenv("MESA_GLX_FX=");
- #else
- unsetenv("MESA_GLX_FX");
diff --git a/games/bzflag/patches/patch-am b/games/bzflag/patches/patch-am
deleted file mode 100644
index d1269803a41..00000000000
--- a/games/bzflag/patches/patch-am
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-am,v 1.1.1.1 2002/09/24 12:49:13 blymn Exp $
-
---- src/platform/Make-netbsd.orig Sun Sep 22 22:29:15 2002
-+++ src/platform/Make-netbsd
-@@ -0,0 +1,20 @@
-+# bzflag
-+# Copyright (c) 1993 - 2002 Tim Riker
-+#
-+# This package is free software; you can redistribute it and/or
-+# modify it under the terms of the license found in the file
-+# named LICENSE that should have accompanied this file.
-+#
-+# THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-+# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-+# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-+
-+PCXXFILES = \
-+ NetBSDPlatformFactory.cxx \
-+ XDisplay.cxx \
-+ XVisual.cxx \
-+ XWindow.cxx \
-+ NetBSDDisplay.cxx \
-+ NetBSDMedia.cxx \
-+ usbjoy.cxx \
-+ $(NULL)