use the the same basic sndio backend code as found in other quake

ports
ok claudio@ (maintainer)
This commit is contained in:
jakemsr 2010-09-01 00:29:06 +00:00
parent 86bc93df4d
commit 77e7feb02b
7 changed files with 398 additions and 66 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.17 2010/05/26 16:27:32 jasper Exp $
# $OpenBSD: Makefile,v 1.18 2010/09/01 00:29:06 jakemsr Exp $
ONLY_FOR_ARCHS= amd64 i386
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ SHARED_ONLY= Yes
COMMENT= first person shooter
DISTNAME= quake2-0.3
PKGNAME= ${DISTNAME}p11
PKGNAME= ${DISTNAME}p12
CATEGORIES= games
HOMEPAGE= http://www.quakeforge.net/
@ -31,9 +31,13 @@ USE_X11= Yes
USE_LIBTOOL= Yes
LIBTOOL_FLAGS= --tag=disable-static
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS+= --with-opengl=${X11BASE} --without-svgalib
CONFIGURE_ARGS+= --with-opengl=${X11BASE} --without-svgalib \
--without-ao
NO_REGRESS= Yes
CFLAGS+= -pthread -g
post-extract:
cp ${FILESDIR}/snd_sndio.c ${WRKSRC}/src
.include <bsd.port.mk>

View File

@ -0,0 +1,174 @@
/*
* Copyright (c) 2010 Jacob Meuser <jakemsr@sdf.lonestar.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <sndio.h>
#include "client.h"
#include "snd_loc.h"
static struct sio_hdl *hdl;
static int snd_inited;
unsigned char *dma_buffer;
size_t dma_buffer_size, dma_ptr;
struct sndinfo *si;
qboolean
SNDDMA_Init(struct sndinfo *s)
{
struct sio_par par;
int i;
if (snd_inited)
return true;
si = s;
/* si->device->string */
hdl = sio_open(NULL, SIO_PLAY, 1);
if (hdl == NULL) {
si->Com_Printf("Could not open sndio device\n");
return false;
}
si->dma->samplebits = (int)si->bits->value;
if (si->dma->samplebits != 8 && si->dma->samplebits != 16) {
si->Com_Printf("using 16-bit samples\n");
si->dma->samplebits = 16;
}
si->dma->channels = (int)si->channels->value;
if (si->dma->channels != 1 && si->dma->channels != 2) {
si->Com_Printf("using 2 channels\n");
si->dma->channels = 2;
}
si->dma->speed = (int)si->speed->value;
if (!si->dma->speed)
si->dma->speed = 44100;
sio_initpar(&par);
par.pchan = si->dma->channels;
par.rate = si->dma->speed;
par.bits = si->dma->samplebits;
par.sig = par.bits == 16 ? 1 : 0;
par.le = SIO_LE_NATIVE;
par.appbufsz = par.rate / 10; /* 1/10 second latency */
if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) {
si->Com_Printf("Error setting audio parameters\n");
sio_close(hdl);
return false;
}
if ((par.pchan != 1 && par.pchan != 2) ||
!((par.bits == 16 && par.sig == 1) ||
(par.bits == 8 && par.sig == 0))) {
si->Com_Printf("Could not set appropriate audio parameters\n");
sio_close(hdl);
return false;
}
si->dma->speed = par.rate;
si->dma->channels = par.pchan;
si->dma->samplebits = par.bits;
/*
* find the smallest power of two larger than the buffer size
* and use it as the internal buffer's size
*/
for (i = 1; i < par.appbufsz; i <<= 2)
; /* nothing */
si->dma->samples = i * par.pchan;
dma_buffer_size = si->dma->samples * si->dma->samplebits / 8;
dma_buffer = calloc(1, dma_buffer_size);
if (dma_buffer == NULL) {
si->Com_Printf("Could not allocate audio ring buffer\n");
return false;
}
dma_ptr = 0;
si->dma->buffer = dma_buffer;
if (!sio_start(hdl)) {
si->Com_Printf("Could not start audio\n");
sio_close(hdl);
return false;
}
si->dma->submission_chunk = 1;
si->dma->samplepos = 0;
snd_inited = true;
return true;
}
void
SNDDMA_Shutdown(void)
{
if (snd_inited == true) {
sio_close(hdl);
snd_inited = false;
}
free(dma_buffer);
}
int
SNDDMA_GetDMAPos(void)
{
if (!snd_inited)
return (0);
si->dma->samplepos = dma_ptr / (si->dma->samplebits / 8);
return si->dma->samplepos;
}
void
SNDDMA_Submit(void)
{
struct pollfd pfd;
size_t count, todo, avail;
int n;
n = sio_pollfd(hdl, &pfd, POLLOUT);
while (poll(&pfd, n, 0) < 0 && errno == EINTR)
;
if (!(sio_revents(hdl, &pfd) & POLLOUT))
return;
avail = dma_buffer_size;
while (avail > 0) {
todo = dma_buffer_size - dma_ptr;
if (todo > avail)
todo = avail;
count = sio_write(hdl, dma_buffer + dma_ptr, todo);
if (count == 0)
break;
dma_ptr += count;
if (dma_ptr >= dma_buffer_size)
dma_ptr -= dma_buffer_size;
avail -= count;
}
}
void
SNDDMA_BeginPainting(void)
{
}

View File

@ -1,6 +1,21 @@
$OpenBSD: patch-configure,v 1.2 2010/04/26 16:37:24 jakemsr Exp $
$OpenBSD: patch-configure,v 1.3 2010/09/01 00:29:07 jakemsr Exp $
--- configure.orig Tue Mar 16 02:38:24 2004
+++ configure Tue Jan 20 03:37:35 2009
+++ configure Mon May 3 02:17:09 2010
@@ -21844,10 +21844,10 @@ rm -f conftest.err conftest.$ac_objext \
fi
-if test "x$HAVE_SDL" = xyes ; then
- SNDDRIVERS="$SNDDRIVERS snd_sdl.la"
- BUILD_SNDSDL="yes"
-fi
+#if test "x$HAVE_SDL" = xyes ; then
+# SNDDRIVERS="$SNDDRIVERS snd_sdl.la"
+# BUILD_SNDSDL="yes"
+#fi
if test "x$BUILD_SNDSDL" = xyes; then
@@ -22152,7 +22152,7 @@ rm -f conftest*
fi

View File

@ -0,0 +1,187 @@
$OpenBSD: patch-src_Makefile_in,v 1.1 2010/09/01 00:29:07 jakemsr Exp $
--- src/Makefile.in.orig Tue Mar 16 02:38:18 2004
+++ src/Makefile.in Mon May 3 02:11:04 2010
@@ -16,7 +16,7 @@
-SOURCES = $(ref_glx_la_SOURCES) $(EXTRA_ref_glx_la_SOURCES) $(ref_sdlgl_la_SOURCES) $(ref_soft_la_SOURCES) $(EXTRA_ref_soft_la_SOURCES) $(ref_softsdl_la_SOURCES) $(EXTRA_ref_softsdl_la_SOURCES) $(ref_softx_la_SOURCES) $(EXTRA_ref_softx_la_SOURCES) $(ref_tdfx_la_SOURCES) $(EXTRA_ref_tdfx_la_SOURCES) $(snd_alsa_la_SOURCES) $(snd_ao_la_SOURCES) $(snd_oss_la_SOURCES) $(snd_sdl_la_SOURCES) $(snd_solaris_la_SOURCES) $(quake2_SOURCES) $(EXTRA_quake2_SOURCES)
+SOURCES = $(ref_glx_la_SOURCES) $(EXTRA_ref_glx_la_SOURCES) $(ref_sdlgl_la_SOURCES) $(ref_soft_la_SOURCES) $(EXTRA_ref_soft_la_SOURCES) $(ref_softsdl_la_SOURCES) $(EXTRA_ref_softsdl_la_SOURCES) $(ref_softx_la_SOURCES) $(EXTRA_ref_softx_la_SOURCES) $(ref_tdfx_la_SOURCES) $(EXTRA_ref_tdfx_la_SOURCES) $(snd_alsa_la_SOURCES) $(snd_ao_la_SOURCES) $(snd_oss_la_SOURCES) $(snd_sndio_la_SOURCES) $(snd_sdl_la_SOURCES) $(snd_solaris_la_SOURCES) $(quake2_SOURCES) $(EXTRA_quake2_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -178,6 +178,10 @@ snd_oss_la_DEPENDENCIES =
am__snd_oss_la_SOURCES_DIST = snd_oss.c
@BUILD_SNDOSS_TRUE@am_snd_oss_la_OBJECTS = snd_oss_la-snd_oss.lo
snd_oss_la_OBJECTS = $(am_snd_oss_la_OBJECTS)
+snd_sndio_la_DEPENDENCIES =
+am__snd_sndio_la_SOURCES_DIST = snd_sndio.c
+am_snd_sndio_la_OBJECTS = snd_sndio_la-snd_sndio.lo
+snd_sndio_la_OBJECTS = $(am_snd_sndio_la_OBJECTS)
snd_sdl_la_DEPENDENCIES =
am__snd_sdl_la_SOURCES_DIST = snd_sdl.c
@BUILD_SNDSDL_TRUE@am_snd_sdl_la_OBJECTS = snd_sdl_la-snd_sdl.lo
@@ -267,6 +271,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-snd_mem.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-snd_mix.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-snd_oss.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/quake2-snd_sndio.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-snd_sdl.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-sv_ccmds.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/quake2-sv_ents.Po \
@@ -388,6 +393,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/snd_alsa_la-snd_alsa.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/snd_ao_la-snd_ao.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/snd_oss_la-snd_oss.Plo \
+@AMDEP_TRUE@ ./$(DEPDIR)/snd_sndio_la-snd_sndio.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/snd_sdl_la-snd_sdl.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/snd_solaris_la-snd_solaris.Plo
CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
@@ -407,7 +413,7 @@ SOURCES = $(ref_glx_la_SOURCES) $(EXTRA_ref_glx_la_SOU
$(EXTRA_ref_softsdl_la_SOURCES) $(ref_softx_la_SOURCES) \
$(EXTRA_ref_softx_la_SOURCES) $(ref_tdfx_la_SOURCES) \
$(EXTRA_ref_tdfx_la_SOURCES) $(snd_alsa_la_SOURCES) \
- $(snd_ao_la_SOURCES) $(snd_oss_la_SOURCES) \
+ $(snd_ao_la_SOURCES) $(snd_oss_la_SOURCES) $(snd_sndio_la_SOURCES) \
$(snd_sdl_la_SOURCES) $(snd_solaris_la_SOURCES) \
$(quake2_SOURCES) $(EXTRA_quake2_SOURCES)
DIST_SOURCES = $(am__ref_glx_la_SOURCES_DIST) \
@@ -419,6 +425,7 @@ DIST_SOURCES = $(am__ref_glx_la_SOURCES_DIST) \
$(am__ref_tdfx_la_SOURCES_DIST) $(EXTRA_ref_tdfx_la_SOURCES) \
$(am__snd_alsa_la_SOURCES_DIST) $(am__snd_ao_la_SOURCES_DIST) \
$(am__snd_oss_la_SOURCES_DIST) $(am__snd_sdl_la_SOURCES_DIST) \
+ $(am__snd_sndio_la_SOURCES_DIST) \
$(am__snd_solaris_la_SOURCES_DIST) $(am__quake2_SOURCES_DIST) \
$(EXTRA_quake2_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -538,7 +545,7 @@ SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-SNDDRIVERS = @SNDDRIVERS@
+SNDDRIVERS = @SNDDRIVERS@ snd_sndio.la
SOLARIS_CFLAGS = @SOLARIS_CFLAGS@
SOLARIS_LIBS = @SOLARIS_LIBS@
STRIP = @STRIP@
@@ -602,10 +609,10 @@ unamepath = @unamepath@
SUBDIRS = . baseq2 ctf xatrix rogue
std_cflags = -pipe @WARN_CFLAGS@ @OPT_CFLAGS@
module_ldflags = -module -avoid-version -rpath $(pkglibdir)
-pkglib_LTLIBRARIES = @VID_REFS@ @SNDDRIVERS@
+pkglib_LTLIBRARIES = @VID_REFS@ @SNDDRIVERS@ snd_sndio.la
EXTRA_LTLIBRARIES = ref_soft.la ref_softx.la ref_softsdl.la \
ref_glx.la ref_sdlgl.la ref_tdfx.la \
- snd_oss.la snd_alsa.la snd_ao.la snd_sdl.la \
+ snd_oss.la snd_sndio.la snd_alsa.la snd_ao.la snd_sdl.la \
snd_solaris.la
@@ -668,7 +675,7 @@ EXTRA_ref_tdfx_la_SOURCES = rw_in_svgalib.c gl_fxmesa.
EXTRA_ref_softx_la_SOURCES = rw_x11.c
EXTRA_quake2_SOURCES = snd_mixa.S cd_sdl.c snd_sdl.c snd_dma.c \
snd_mix.c snd_mem.c cd.c \
- snd_oss.c snd_ao.c snd_alsa.c
+ snd_oss.c snd_sndio.c snd_ao.c snd_alsa.c
quake2_CFLAGS = $(std_cflags)
quake2_LDADD = @DL_LIBS@ @SYSTEM_LIBS@ -lm
@@ -679,6 +686,12 @@ quake2_LDADD = @DL_LIBS@ @SYSTEM_LIBS@ -lm
@BUILD_SNDOSS_TRUE@snd_oss_la_LIBADD = @OSS_LIBS@
@BUILD_SNDOSS_TRUE@snd_oss_la_LDFLAGS = $(module_ldflags)
+# sndio sound driver
+snd_sndio_la_SOURCES = snd_sndio.c
+snd_sndio_la_CFLAGS = $(std_cflags) -fPIC
+snd_sndio_la_LIBADD = -lsndio
+snd_sndio_la_LDFLAGS = $(module_ldflags)
+
# alsa sound driver
@BUILD_SNDALSA_TRUE@snd_alsa_la_SOURCES = snd_alsa.c
@BUILD_SNDALSA_TRUE@snd_alsa_la_CFLAGS = $(std_cflags) -fPIC @ALSA_CFLAGS@
@@ -822,6 +835,8 @@ snd_ao.la: $(snd_ao_la_OBJECTS) $(snd_ao_la_DEPENDENCI
$(LINK) $(snd_ao_la_LDFLAGS) $(snd_ao_la_OBJECTS) $(snd_ao_la_LIBADD) $(LIBS)
snd_oss.la: $(snd_oss_la_OBJECTS) $(snd_oss_la_DEPENDENCIES)
$(LINK) $(snd_oss_la_LDFLAGS) $(snd_oss_la_OBJECTS) $(snd_oss_la_LIBADD) $(LIBS)
+snd_sndio.la: $(snd_sndio_la_OBJECTS) $(snd_sndio_la_DEPENDENCIES)
+ $(LINK) $(snd_sndio_la_LDFLAGS) $(snd_sndio_la_OBJECTS) $(snd_sndio_la_LIBADD) $(LIBS)
snd_sdl.la: $(snd_sdl_la_OBJECTS) $(snd_sdl_la_DEPENDENCIES)
$(LINK) $(snd_sdl_la_LDFLAGS) $(snd_sdl_la_OBJECTS) $(snd_sdl_la_LIBADD) $(LIBS)
snd_solaris.la: $(snd_solaris_la_OBJECTS) $(snd_solaris_la_DEPENDENCIES)
@@ -904,6 +919,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-snd_mem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-snd_mix.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-snd_oss.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-snd_sndio.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-snd_sdl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-sv_ccmds.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quake2-sv_ents.Po@am__quote@
@@ -1025,6 +1041,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_alsa_la-snd_alsa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_ao_la-snd_ao.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_oss_la-snd_oss.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_sndio_la-snd_sndio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_sdl_la-snd_sdl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snd_solaris_la-snd_solaris.Plo@am__quote@
@@ -3701,6 +3718,30 @@ snd_oss_la-snd_oss.lo: snd_oss.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_oss_la_CFLAGS) $(CFLAGS) -c -o snd_oss_la-snd_oss.lo `test -f 'snd_oss.c' || echo '$(srcdir)/'`snd_oss.c
+snd_sndio_la-snd_sndio.o: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -MT snd_sndio_la-snd_sndio.o -MD -MP -MF "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" -c -o snd_sndio_la-snd_sndio.o `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" "$(DEPDIR)/snd_sndio_la-snd_sndio.Po"; else rm -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='snd_sndio_la-snd_sndio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/snd_sndio_la-snd_sndio.Po' tmpdepfile='$(DEPDIR)/snd_sndio_la-snd_sndio.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -c -o snd_sndio_la-snd_sndio.o `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c
+
+snd_sndio_la-snd_sndio.obj: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -MT snd_sndio_la-snd_sndio.obj -MD -MP -MF "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" -c -o snd_sndio_la-snd_sndio.obj `if test -f 'snd_sndio.c'; then $(CYGPATH_W) 'snd_sndio.c'; else $(CYGPATH_W) '$(srcdir)/snd_sndio.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" "$(DEPDIR)/snd_sndio_la-snd_sndio.Po"; else rm -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='snd_sndio_la-snd_sndio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/snd_sndio_la-snd_sndio.Po' tmpdepfile='$(DEPDIR)/snd_sndio_la-snd_sndio.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -c -o snd_sndio_la-snd_sndio.obj `if test -f 'snd_sndio.c'; then $(CYGPATH_W) 'snd_sndio.c'; else $(CYGPATH_W) '$(srcdir)/snd_sndio.c'; fi`
+
+snd_sndio_la-snd_sndio.lo: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -MT snd_sndio_la-snd_sndio.lo -MD -MP -MF "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" -c -o snd_sndio_la-snd_sndio.lo `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo" "$(DEPDIR)/snd_sndio_la-snd_sndio.Plo"; else rm -f "$(DEPDIR)/snd_sndio_la-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='snd_sndio_la-snd_sndio.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/snd_sndio_la-snd_sndio.Plo' tmpdepfile='$(DEPDIR)/snd_sndio_la-snd_sndio.TPlo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sndio_la_CFLAGS) $(CFLAGS) -c -o snd_sndio_la-snd_sndio.lo `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c
+
snd_sdl_la-snd_sdl.o: snd_sdl.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(snd_sdl_la_CFLAGS) $(CFLAGS) -MT snd_sdl_la-snd_sdl.o -MD -MP -MF "$(DEPDIR)/snd_sdl_la-snd_sdl.Tpo" -c -o snd_sdl_la-snd_sdl.o `test -f 'snd_sdl.c' || echo '$(srcdir)/'`snd_sdl.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/snd_sdl_la-snd_sdl.Tpo" "$(DEPDIR)/snd_sdl_la-snd_sdl.Po"; else rm -f "$(DEPDIR)/snd_sdl_la-snd_sdl.Tpo"; exit 1; fi
@@ -4924,6 +4965,30 @@ quake2-snd_oss.lo: snd_oss.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/quake2-snd_oss.Plo' tmpdepfile='$(DEPDIR)/quake2-snd_oss.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -c -o quake2-snd_oss.lo `test -f 'snd_oss.c' || echo '$(srcdir)/'`snd_oss.c
+
+quake2-snd_sndio.o: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -MT quake2-snd_sndio.o -MD -MP -MF "$(DEPDIR)/quake2-snd_sndio.Tpo" -c -o quake2-snd_sndio.o `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/quake2-snd_sndio.Tpo" "$(DEPDIR)/quake2-snd_sndio.Po"; else rm -f "$(DEPDIR)/quake2-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='quake2-snd_sndio.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/quake2-snd_sndio.Po' tmpdepfile='$(DEPDIR)/quake2-snd_sndio.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -c -o quake2-snd_sndio.o `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c
+
+quake2-snd_sndio.obj: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -MT quake2-snd_sndio.obj -MD -MP -MF "$(DEPDIR)/quake2-snd_sndio.Tpo" -c -o quake2-snd_sndio.obj `if test -f 'snd_sndio.c'; then $(CYGPATH_W) 'snd_sndio.c'; else $(CYGPATH_W) '$(srcdir)/snd_sndio.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/quake2-snd_sndio.Tpo" "$(DEPDIR)/quake2-snd_sndio.Po"; else rm -f "$(DEPDIR)/quake2-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='quake2-snd_sndio.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/quake2-snd_sndio.Po' tmpdepfile='$(DEPDIR)/quake2-snd_sndio.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -c -o quake2-snd_sndio.obj `if test -f 'snd_sndio.c'; then $(CYGPATH_W) 'snd_sndio.c'; else $(CYGPATH_W) '$(srcdir)/snd_sndio.c'; fi`
+
+quake2-snd_sndio.lo: snd_sndio.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -MT quake2-snd_sndio.lo -MD -MP -MF "$(DEPDIR)/quake2-snd_sndio.Tpo" -c -o quake2-snd_sndio.lo `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/quake2-snd_sndio.Tpo" "$(DEPDIR)/quake2-snd_sndio.Plo"; else rm -f "$(DEPDIR)/quake2-snd_sndio.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='snd_sndio.c' object='quake2-snd_sndio.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/quake2-snd_sndio.Plo' tmpdepfile='$(DEPDIR)/quake2-snd_sndio.TPlo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -c -o quake2-snd_sndio.lo `test -f 'snd_sndio.c' || echo '$(srcdir)/'`snd_sndio.c
quake2-snd_ao.o: snd_ao.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(quake2_CFLAGS) $(CFLAGS) -MT quake2-snd_ao.o -MD -MP -MF "$(DEPDIR)/quake2-snd_ao.Tpo" -c -o quake2-snd_ao.o `test -f 'snd_ao.c' || echo '$(srcdir)/'`snd_ao.c; \

View File

@ -1,12 +1,16 @@
$OpenBSD: patch-src_snd_dma_c,v 1.1 2010/04/26 16:37:24 jakemsr Exp $
--- src/snd_dma.c.orig Tue Jan 20 03:20:20 2009
+++ src/snd_dma.c Tue Jan 20 03:21:26 2009
@@ -164,7 +164,7 @@ void S_Init (void)
$OpenBSD: patch-src_snd_dma_c,v 1.2 2010/09/01 00:29:07 jakemsr Exp $
--- src/snd_dma.c.orig Mon Mar 15 04:50:39 2004
+++ src/snd_dma.c Mon May 3 17:43:55 2010
@@ -164,10 +164,10 @@ void S_Init (void)
struct stat st;
/* load sound driver */
- snddriver = Cvar_Get("snddriver", "oss", CVAR_ARCHIVE);
+ snddriver = Cvar_Get("snddriver", "sdl", CVAR_ARCHIVE);
+ snddriver = Cvar_Get("snddriver", "sndio", CVAR_ARCHIVE);
Com_Printf("loading %s sound output driver", snddriver->string);
snprintf(fn, MAX_OSPATH, PKGLIBDIR"/snd_%s.so", snddriver->string);
- snprintf(fn, MAX_OSPATH, PKGLIBDIR"/snd_%s.so", snddriver->string);
+ snprintf(fn, MAX_OSPATH, PKGLIBDIR"/snd_%s.so", "sndio");
if (stat(fn, &st) == -1) {
Com_Printf("\nload %s failed: %s\n", fn, strerror(errno));
return;

View File

@ -1,52 +0,0 @@
$OpenBSD: patch-src_snd_sdl_c,v 1.1 2010/04/26 16:37:24 jakemsr Exp $
--- src/snd_sdl.c.orig Mon Mar 15 04:50:39 2004
+++ src/snd_sdl.c Wed Feb 10 12:38:45 2010
@@ -63,12 +63,12 @@ SNDDMA_Init (struct sndinfo * s)
if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
- Com_Printf ("Couldn't init SDL audio: %s\n", SDL_GetError ());
+ s->Com_Printf ("Couldn't init SDL audio: %s\n", SDL_GetError ());
return 0;
}
} else if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
- Com_Printf ("Couldn't init SDL audio: %s\n", SDL_GetError ());
+ s->Com_Printf ("Couldn't init SDL audio: %s\n", SDL_GetError ());
return 0;
}
}
@@ -97,7 +97,7 @@ SNDDMA_Init (struct sndinfo * s)
desired.format = AUDIO_S16LSB;
break;
default:
- Com_Printf ("Unknown number of audio bits: %d\n", desired_bits);
+ si->Com_Printf ("Unknown number of audio bits: %d\n", desired_bits);
return 0;
}
desired.channels = si->channels->value;
@@ -108,12 +108,14 @@ SNDDMA_Init (struct sndinfo * s)
desired.samples = 1024;
else
desired.samples = 512;
+
+ desired.samples *= 2;
desired.callback = paint_audio;
/* Open the audio device */
if (SDL_OpenAudio (&desired, &obtained) < 0) {
- Com_Printf ("Couldn't open SDL audio: %s\n", SDL_GetError ());
+ si->Com_Printf ("Couldn't open SDL audio: %s\n", SDL_GetError ());
return 0;
}
@@ -136,7 +138,7 @@ SNDDMA_Init (struct sndinfo * s)
/* Not supported -- force SDL to do our bidding */
SDL_CloseAudio ();
if (SDL_OpenAudio (&desired, NULL) < 0) {
- Com_Printf ("Couldn't open SDL audio: %s\n", SDL_GetError ());
+ si->Com_Printf ("Couldn't open SDL audio: %s\n", SDL_GetError ());
return 0;
}
memcpy (&obtained, &desired, sizeof (desired));

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.5 2010/04/26 16:37:24 jakemsr Exp $
@comment $OpenBSD: PLIST,v 1.6 2010/09/01 00:29:07 jakemsr Exp $
@bin bin/quake2
lib/quake2/
lib/quake2/baseq2/
@ -15,8 +15,8 @@ lib/quake2/ref_softsdl.la
lib/quake2/ref_softsdl.so
lib/quake2/ref_softx.la
lib/quake2/ref_softx.so
lib/quake2/snd_sdl.la
lib/quake2/snd_sdl.so
lib/quake2/snd_sndio.la
lib/quake2/snd_sndio.so
share/quake2/
share/quake2/baseq2/
share/quake2/baseq2/config.cfg