a bit more cleanup with more _null deaths

This commit is contained in:
Bill Currie 2003-01-31 23:16:28 +00:00
parent e6a6f7099b
commit 3fcc6ae176
13 changed files with 27 additions and 254 deletions

View file

@ -943,7 +943,7 @@ fi
if test "$SOUND_TYPES"; then
AC_MSG_RESULT([$SOUND_TYPES])
else
AC_MSG_RESULT([no, using null sound driver])
AC_MSG_RESULT([no])
fi
dnl Tests for joystick support
@ -977,7 +977,7 @@ dnl Checks for CD-ROM
dnl ==================================================================
CD_CFLAGS=""
CD_PLUGIN_TARGETS="cd_null.la"
CD_PLUGIN_TARGETS=""
unset CDTYPE
AC_MSG_CHECKING(for CD audio support)
@ -1035,7 +1035,7 @@ QF_maGiC_VALUE
if test "$CDTYPE"; then
AC_MSG_RESULT([$CDTYPE])
else
AC_MSG_RESULT([no, using null CD driver])
AC_MSG_RESULT([no])
fi
AC_SUBST(CD_LIBS)
@ -1514,7 +1514,7 @@ CAN_BUILD_SW32=no
CAN_BUILD_SW=no
CD_TARGETS=""
SND_PLUGIN_TARGETS="snd_output_disk.la snd_output_null.la"
SND_PLUGIN_TARGETS="snd_output_disk.la"
SND_REND_TARGETS=""
SND_TARGETS=""
VID_MODEL_TARGETS=""

View file

@ -1,3 +1,3 @@
AUTOMAKE_OPTIONS= foreign
SUBDIRS= audio console gamecode models video util gib
SUBDIRS= audio console gamecode gib models video util

View file

@ -94,8 +94,12 @@ int
CDAudio_Init (void)
{
PI_RegisterPlugins (cd_plugin_list);
cd_plugin = Cvar_Get ("cd_plugin", "null", CVAR_ROM, NULL,
cd_plugin = Cvar_Get ("cd_plugin", "", CVAR_ROM, NULL,
"CD Plugin to use");
if (!*cd_plugin->string) {
Sys_Printf ("Not loading CD due to no driver\n");
return 0;
}
cdmodule = PI_LoadPlugin ("cd", cd_plugin->string);
if (!cdmodule) {
Sys_Printf ("Loading of cd module: %s failed!\n", cd_plugin->string);

View file

@ -11,7 +11,7 @@ EXEEXT=
plugin_PROGRAMS= @CD_PLUGIN_TARGETS@
noinst_PROGRAMS= @CD_PLUGIN_STATIC@
EXTRA_PROGRAMS= cd_linux.la cd_sdl.la cd_sgi.la cd_win.la cd_null.la cd_xmms.la
EXTRA_PROGRAMS= cd_linux.la cd_sdl.la cd_sgi.la cd_win.la cd_xmms.la
cd_linux_la_LDFLAGS= $(plugin_ldflags)
cd_linux_la_SOURCES= cd_linux.c
@ -33,7 +33,3 @@ cd_sgi_la_SOURCES= cd_sgi.c
cd_win_la_LDFLAGS= $(plugin_ldflags)
cd_win_la_LDADD= $(plugin_libadd)
cd_win_la_SOURCES= cd_win.c
cd_null_la_LDFLAGS= $(plugin_ldflags)
cd_null_la_LDADD= $(plugin_libadd)
cd_null_la_SOURCES= cd_null.c

View file

@ -80,6 +80,7 @@ static byte maxTrack;
static int cdfile = -1;
static cvar_t *mus_cddevice;
static cvar_t *bgmvolume;
static void
@ -450,6 +451,8 @@ I_CDAudio_Init (void)
{
mus_cddevice = Cvar_Get("mus_cddevice", "/dev/cdrom", CVAR_NONE,
Mus_CDChange, "device to use for CD music");
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"Volume of CD music");
}
QFPLUGIN plugin_t *PLUGIN_INFO(cd, linux) (void);

View file

@ -1,112 +0,0 @@
/*
cd_null.c
support for no cd audio
Copyright (C) 1996-1997 Id Software, Inc.
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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
static __attribute__ ((unused)) const char rcsid[] =
"$Id$";
#include "QF/cdaudio.h"
#include "QF/plugin.h"
static plugin_t plugin_info;
static plugin_data_t plugin_info_data;
static plugin_funcs_t plugin_info_funcs;
static general_data_t plugin_info_general_data;
static general_funcs_t plugin_info_general_funcs;
//static cd_data_t plugin_info_cd_data;
static cd_funcs_t plugin_info_cd_funcs;
static void
I_CDAudio_Pause (void)
{
}
static void
I_CDAudio_Play (int track, qboolean looping)
{
}
static void
I_CDAudio_Resume (void)
{
}
static void
I_CDAudio_Shutdown (void)
{
}
static void
I_CDAudio_Update (void)
{
}
static void
I_CDAudio_Init (void)
{
}
static void
I_CD_f (void)
{
}
QFPLUGIN plugin_t *PLUGIN_INFO(cd, null) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(cd, null) (void)
{
plugin_info.type = qfp_cd;
plugin_info.api_version = QFPLUGIN_VERSION;
plugin_info.plugin_version = "0.1";
plugin_info.description = "Null CD Audio output"
"Copyright (C) 2001 contributors of the QuakeForge project\n"
"Please see the file \"AUTHORS\" for a list of contributors\n";
plugin_info.functions = &plugin_info_funcs;
plugin_info.data = &plugin_info_data;
plugin_info_data.general = &plugin_info_general_data;
// plugin_info_data.cd = &plugin_info_cd_data;
plugin_info_data.input = NULL;
plugin_info_funcs.general = &plugin_info_general_funcs;
plugin_info_funcs.cd = &plugin_info_cd_funcs;
plugin_info_funcs.input = NULL;
plugin_info_general_funcs.p_Init = I_CDAudio_Init;
plugin_info_general_funcs.p_Shutdown = I_CDAudio_Shutdown;
plugin_info_cd_funcs.pCDAudio_Pause = I_CDAudio_Pause;
plugin_info_cd_funcs.pCDAudio_Play = I_CDAudio_Play;
plugin_info_cd_funcs.pCDAudio_Resume = I_CDAudio_Resume;
plugin_info_cd_funcs.pCDAudio_Update = I_CDAudio_Update;
plugin_info_cd_funcs.pCD_f = I_CD_f;
return &plugin_info;
}

View file

@ -66,6 +66,7 @@ static qboolean playLooping = false;
static SDL_CD *cd_id;
static float cdvolume = 1.0;
static cvar_t *bgmvolume;
static void
I_CDAudio_Eject (void)
@ -274,6 +275,9 @@ I_CDAudio_Init (void)
Sys_Printf ("CDAudio_Init: CD contains no audio tracks.\n");
cdValid = false;
}
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"Volume of CD music");
Sys_Printf ("CD Audio Initialized.\n");
}

View file

@ -64,6 +64,7 @@ static byte playTrack;
static char cd_dev[64] = "/dev/cdrom";
static CDPLAYER *cdp = NULL;
static cvar_t *bgmvolume;
static void
I_SGI_Eject (void)
@ -336,6 +337,8 @@ I_SGI_Init (void)
if (COM_CheckParm ("-nocdaudio"))
return ;
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"Volume of CD music");
if ((i = COM_CheckParm ("-cddev")) != 0 && i < com_argc - 1) {
strncpy (cd_dev, com_argv[i + 1], sizeof (cd_dev));
cd_dev[sizeof (cd_dev) - 1] = 0;

View file

@ -69,6 +69,7 @@ static UINT wDeviceID;
static void I_CDAudio_Play (int track, qboolean looping);
static void I_CDAudio_Stop (void);
static cvar_t *bgmvolume;
static void
I_CDAudio_CloseDoor (void)
@ -489,6 +490,9 @@ I_CDAudio_Init (void)
initialized = true;
enabled = true;
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"Volume of CD music");
if (I_CDAudio_GetAudioDiskInfo ()) {
Sys_Printf ("CDAudio_Init: No CD in player.\n");
cdValid = false;

View file

@ -851,8 +851,6 @@ SND_Init_Cvars (void)
"Set to turn sound off");
precache = Cvar_Get ("precache", "1", CVAR_NONE, NULL,
"Toggle the use of a precache");
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"Volume of CD music");
volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL,
"Set the volume for sound playback");
snd_interp = Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL,

View file

@ -44,11 +44,10 @@ static __attribute__ ((unused)) const char rcsid[] =
// FIXME - should be put in one place
// =======================================================================
volatile dma_t *shm = 0;
cvar_t *snd_loadas8bit;
int paintedtime; // sample PAIRS
qboolean snd_initialized = false;
cvar_t *bgmvolume;
cvar_t *snd_loadas8bit;
cvar_t *volume;
cvar_t *snd_interp;
@ -117,8 +116,6 @@ S_Init_Cvars (void)
"Volume level of sounds");
snd_loadas8bit = Cvar_Get ("snd_loadas8bit", "0", CVAR_NONE, NULL,
"Load samples as 8-bit");
bgmvolume = Cvar_Get ("bgmvolume", "1", CVAR_ARCHIVE, NULL,
"CD music volume");
snd_interp = Cvar_Get ("snd_interp", "1", CVAR_ARCHIVE, NULL,
"control sample interpolation");
#ifdef _WIN32

View file

@ -13,7 +13,7 @@ noinst_PROGRAMS= @SND_PLUGIN_STATIC@
EXTRA_PROGRAMS= \
snd_output_sdl.la snd_output_alsa0_5.la snd_output_alsa0_9.la \
snd_output_oss.la snd_output_sgi.la snd_output_sun.la \
snd_output_win.la snd_output_null.la snd_output_disk.la
snd_output_win.la snd_output_disk.la
snd_output_sdl_la_LDFLAGS= $(plugin_ldflags)
snd_output_sdl_la_LDADD= $(SDL_LIBS) $(plugin_libadd)
@ -53,8 +53,3 @@ snd_output_disk_la_LDFLAGS= $(plugin_ldflags)
snd_output_disk_la_LDADD= $(plugin_libadd)
snd_output_disk_la_CFLAGS=
snd_output_disk_la_SOURCES= snd_disk.c
snd_output_null_la_LDFLAGS= $(plugin_ldflags)
snd_output_null_la_LDADD= $(plugin_libadd)
snd_output_null_la_CFLAGS=
snd_output_null_la_SOURCES= snd_null.c

View file

@ -1,119 +0,0 @@
/*
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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
static __attribute__ ((unused)) const char rcsid[] =
"$Id$";
#include "QF/plugin.h"
#include "QF/sound.h"
#include "QF/sys.h"
static plugin_t plugin_info;
static plugin_data_t plugin_info_data;
static plugin_funcs_t plugin_info_funcs;
static general_data_t plugin_info_general_data;
static general_funcs_t plugin_info_general_funcs;
static snd_output_data_t plugin_info_snd_output_data;
static snd_output_funcs_t plugin_info_snd_output_funcs;
static qboolean
SNDDMA_Init (void)
{
Sys_Printf ("SNDDMA_Init: null sound driver always fails :)\n");
return false;
}
static void
SNDDMA_Init_Cvars (void)
{
}
static void
SNDDMA_Shutdown (void)
{
}
static void
SNDDMA_BlockSound (void)
{
}
static int
SNDDMA_GetDMAPos (void)
{
return 0;
}
static void
SNDDMA_Submit (void)
{
}
static void
SNDDMA_UnblockSound (void)
{
}
QFPLUGIN plugin_t *PLUGIN_INFO(snd_output, null) (void);
QFPLUGIN plugin_t *
PLUGIN_INFO(snd_output, null) (void) {
plugin_info.type = qfp_snd_output;
plugin_info.api_version = QFPLUGIN_VERSION;
plugin_info.plugin_version = "0.1";
plugin_info.description = "Null sound output driver";
plugin_info.copyright = "Copyright (C) 1996-1997 id Software, Inc.\n"
"Copyright (C) 1999,2000,2001 contributors of the QuakeForge project\n"
"Please see the file \"AUTHORS\" for a list of contributors";
plugin_info.functions = &plugin_info_funcs;
plugin_info.data = &plugin_info_data;
plugin_info_data.general = &plugin_info_general_data;
plugin_info_data.input = NULL;
plugin_info_data.snd_output = &plugin_info_snd_output_data;
plugin_info_funcs.general = &plugin_info_general_funcs;
plugin_info_funcs.input = NULL;
plugin_info_funcs.snd_output = &plugin_info_snd_output_funcs;
plugin_info_general_funcs.p_Init = SNDDMA_Init_Cvars;
plugin_info_general_funcs.p_Shutdown = NULL;
plugin_info_snd_output_funcs.pS_O_Init = SNDDMA_Init;
plugin_info_snd_output_funcs.pS_O_Shutdown = SNDDMA_Shutdown;
plugin_info_snd_output_funcs.pS_O_BlockSound = SNDDMA_BlockSound;
plugin_info_snd_output_funcs.pS_O_GetDMAPos = SNDDMA_GetDMAPos;
plugin_info_snd_output_funcs.pS_O_Submit = SNDDMA_Submit;
plugin_info_snd_output_funcs.pS_O_UnblockSound = SNDDMA_UnblockSound;
return &plugin_info;
}