Move common variables in snd_dma.c and snd_null.c into snd_common.c

This commit is contained in:
Adam Olsen 2001-04-11 02:41:12 +00:00
parent 2b4d8ecc97
commit 320bd35f1e
4 changed files with 77 additions and 27 deletions

View File

@ -9,33 +9,34 @@ sound_ASM= snd_mixa.S
# #
# ... Audio targets # ... Audio targets
# #
common_sound_files= snd_common.c snd_dma.c snd_mem.c snd_mix.c
if SNDTYPE_SDL if SNDTYPE_SDL
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_sdl.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_sdl.c $(sound_ASM)
endif endif
if SNDTYPE_ALSA_0_5 if SNDTYPE_ALSA_0_5
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_alsa_0_5.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_alsa_0_5.c $(sound_ASM)
endif endif
if SNDTYPE_ALSA_0_9 if SNDTYPE_ALSA_0_9
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_alsa_0_9.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_alsa_0_9.c $(sound_ASM)
endif endif
# No idea what this is. it's in configure.in though... # No idea what this is. it's in configure.in though...
#if SNDTYPE_MME #if SNDTYPE_MME
#libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_mme.c $(sound_ASM) #libQFsound_la_SOURCES= $(common_sound_files) snd_mme.c $(sound_ASM)
#endif #endif
if SNDTYPE_OSS if SNDTYPE_OSS
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_oss.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_oss.c $(sound_ASM)
endif endif
if SNDTYPE_SGI if SNDTYPE_SGI
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_sgi.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_sgi.c $(sound_ASM)
endif endif
if SNDTYPE_SUN if SNDTYPE_SUN
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_sun.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_sun.c $(sound_ASM)
endif endif
if SNDTYPE_WIN32 if SNDTYPE_WIN32
libQFsound_la_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_win.c $(sound_ASM) libQFsound_la_SOURCES= $(common_sound_files) snd_win.c $(sound_ASM)
endif endif
if SNDTYPE_NULL if SNDTYPE_NULL
libQFsound_la_SOURCES= snd_null.c libQFsound_la_SOURCES= snd_common.c snd_null.c
endif endif
LIBLIST = libQFsound.la @LIBRARY_SEARCH_PATH@ LIBLIST = libQFsound.la @LIBRARY_SEARCH_PATH@

View File

@ -0,0 +1,49 @@
/*
snd_null.c
include this instead of all the other snd_* files to have no sound
code whatsoever
Copyright (C) 1996-1997 Id Software, Inc.
Copyright (C) 1999,2000 contributors of the QuakeForge project
Please see the file "AUTHORS" for a list of contributors
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
#include "QF/qtypes.h"
#include "QF/sound.h"
// =======================================================================
// Various variables also defined in snd_dma.c
// FIXME - should be put in one place
// =======================================================================
channel_t channels[MAX_CHANNELS];
int total_channels;
volatile dma_t *shm = 0;
cvar_t *loadas8bit;
int paintedtime; // sample PAIRS
qboolean snd_initialized = false;
cvar_t *bgmvolume;
cvar_t *volume;
cvar_t *snd_interp;

View File

@ -65,16 +65,16 @@ void S_StopAllSoundsC (void);
// Internal sound data & structures // Internal sound data & structures
// ======================================================================= // =======================================================================
channel_t channels[MAX_CHANNELS]; extern channel_t channels[MAX_CHANNELS];
int total_channels; extern int total_channels;
extern double host_frametime; // From host.h extern double host_frametime; // From host.h
int snd_blocked = 0; int snd_blocked = 0;
static qboolean snd_ambient = 1; static qboolean snd_ambient = 1;
qboolean snd_initialized = false; extern qboolean snd_initialized;
// pointer should go away // pointer should go away
volatile dma_t *shm = 0; extern volatile dma_t *shm;
volatile dma_t sn; volatile dma_t sn;
vec3_t listener_origin; vec3_t listener_origin;
@ -84,7 +84,7 @@ vec3_t listener_up;
vec_t sound_nominal_clip_dist = 1000.0; vec_t sound_nominal_clip_dist = 1000.0;
int soundtime; // sample PAIRS int soundtime; // sample PAIRS
int paintedtime; // sample PAIRS extern int paintedtime; // sample PAIRS
#define MAX_SFX 512 #define MAX_SFX 512
@ -98,8 +98,8 @@ int desired_bits = 16;
int sound_started = 0; int sound_started = 0;
cvar_t *bgmvolume; extern cvar_t *bgmvolume;
cvar_t *volume; extern cvar_t *volume;
cvar_t *snd_device; cvar_t *snd_device;
cvar_t *snd_rate; cvar_t *snd_rate;
@ -107,12 +107,12 @@ cvar_t *snd_bits;
cvar_t *snd_stereo; cvar_t *snd_stereo;
cvar_t *nosound; cvar_t *nosound;
cvar_t *precache; cvar_t *precache;
cvar_t *loadas8bit; extern cvar_t *loadas8bit;
cvar_t *ambient_level; cvar_t *ambient_level;
cvar_t *ambient_fade; cvar_t *ambient_fade;
cvar_t *snd_noextraupdate; cvar_t *snd_noextraupdate;
cvar_t *snd_show; cvar_t *snd_show;
cvar_t *snd_interp; extern cvar_t *snd_interp;
cvar_t *snd_phasesep; cvar_t *snd_phasesep;
cvar_t *snd_volumesep; cvar_t *snd_volumesep;
cvar_t *_snd_mixahead; cvar_t *_snd_mixahead;

View File

@ -36,16 +36,16 @@
// Various variables also defined in snd_dma.c // Various variables also defined in snd_dma.c
// FIXME - should be put in one place // FIXME - should be put in one place
// ======================================================================= // =======================================================================
channel_t channels[MAX_CHANNELS]; extern channel_t channels[MAX_CHANNELS];
int total_channels; extern int total_channels;
volatile dma_t *shm = 0; extern volatile dma_t *shm;
cvar_t *loadas8bit; extern cvar_t *loadas8bit;
int paintedtime; // sample PAIRS extern int paintedtime; // sample PAIRS
qboolean snd_initialized = false; extern qboolean snd_initialized;
cvar_t *bgmvolume; extern cvar_t *bgmvolume;
cvar_t *volume; extern cvar_t *volume;
cvar_t *snd_interp; extern cvar_t *snd_interp;
void void