Add support for SDL CD audio, rename --enable-sdlsound to

--enable-sdl-audio
This commit is contained in:
Jeff Teunissen 2000-12-11 09:50:26 +00:00
parent 5023108000
commit e886b0566d
4 changed files with 88 additions and 65 deletions

View file

@ -128,6 +128,9 @@ EXTRA_libqfsnd_a_SOURCES= snd_dma.c snd_mem.c snd_mix.c snd_alsa_0_5.c \
if CDTYPE_LINUX
libqfcd_a_SOURCES= cd_linux.c
endif
if CDTYPE_SDL
libqfcd_a_SOURCES= cd_sdl.c
endif
if CDTYPE_SGI
libqfcd_a_SOURCES= cd_sgi.c
endif

View file

@ -30,6 +30,8 @@
# include "config.h"
#endif
#include "qtypes.h"
void
CDAudio_Play (byte track, qboolean looping)
{

View file

@ -29,9 +29,12 @@
# include "config.h"
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <SDL.h>
#include <windows.h>
#include "qargs.h"
#include "console.h"
#include "cdaudio.h"
@ -44,13 +47,14 @@ static qboolean cdValid = false;
static qboolean initialized = false;
static qboolean enabled = true;
static qboolean playLooping = false;
static SDL_CD *cd_id;
static float cdvolume = 1.0;
static void CD_f ();
static SDL_CD *cd_id;
static float cdvolume = 1.0;
static void CD_f (void);
static void
CDAudio_Eject ()
CDAudio_Eject (void)
{
if (!cd_id || !enabled)
return;
@ -95,9 +99,8 @@ CDAudio_Play (byte track, qboolean looping)
playLooping = looping;
}
void
CDAudio_Stop ()
CDAudio_Stop (void)
{
int cdstate;
@ -112,7 +115,7 @@ CDAudio_Stop ()
}
void
CDAudio_Pause ()
CDAudio_Pause (void)
{
if (!cd_id || !enabled)
return;
@ -125,7 +128,7 @@ CDAudio_Pause ()
void
CDAudio_Resume ()
CDAudio_Resume (void)
{
if (!cd_id || !enabled)
return;
@ -137,7 +140,7 @@ CDAudio_Resume ()
}
void
CDAudio_Update ()
CDAudio_Update (void)
{
if (!cd_id || !enabled)
return;
@ -158,7 +161,7 @@ CDAudio_Update ()
}
int
CDAudio_Init ()
CDAudio_Init (void)
{
#ifdef UQUAKE
if (cls.state == ca_dedicated)
@ -198,7 +201,7 @@ CDAudio_Init ()
void
CDAudio_Shutdown ()
CDAudio_Shutdown (void)
{
if (!cd_id)
return;
@ -210,7 +213,7 @@ CDAudio_Shutdown ()
#define CD_f_DEFINED
static void
CD_f ()
CD_f (void)
{
char *command;
int cdstate;