]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Make cdda optional, server does not need to play music
authornikoli <nikoli@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Jul 2013 08:19:12 +0000 (08:19 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 26 Jul 2013 18:04:15 +0000 (20:04 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11981 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=97b79884ee55276e90c4dd60f9bfde8b9dbbff68

BSDmakefile
cl_parse.c
host.c
makefile
makefile.inc
menu.c
prvm_cmds.c
snd_main.c
vid_shared.c
vid_wgl.c

index 74496edcb1c9917d2bb776c694fe64a04d882c9f..61189afef4c2ba38f724e3fdb09bf568ac4ad76f 100644 (file)
@@ -7,7 +7,6 @@ DP_MAKE_TARGET=bsd
 .endif
 DP_ARCH != uname
 
-
 # Makefile name
 MAKEFILE=BSDmakefile
 
@@ -23,6 +22,16 @@ TARGETS_RELEASE=sv-release cl-release sdl-release
 TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
 TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
 
+###### Optional features #####
+DP_CDDA?=enabled
+.if $(DP_CDDA) == "enabled"
+       OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
+       OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
+.else
+       OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+       OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+.endif
+
 # X11 libs
 UNIX_X11LIBPATH=/usr/X11R6/lib
 
index c16b8eaae4d45bc3a644e3c824c6f4f6a6774200..0589218a45505cc6185be9cf5ee1aac2d5055a74 100644 (file)
@@ -20,7 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 // cl_parse.c  -- parse a message received from the server
 
 #include "quakedef.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 #include "cl_collision.h"
 #include "csprogs.h"
 #include "libcurl.h"
@@ -3608,10 +3610,12 @@ void CL_ParseServerMessage(void)
 
                        case qw_svc_cdtrack:
                                cl.cdtrack = cl.looptrack = MSG_ReadByte(&cl_message);
+#ifdef CONFIG_CD
                                if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
                                        CDAudio_Play ((unsigned char)cls.forcetrack, true);
                                else
                                        CDAudio_Play ((unsigned char)cl.cdtrack, true);
+#endif
                                break;
 
                        case qw_svc_intermission:
@@ -3730,10 +3734,12 @@ void CL_ParseServerMessage(void)
 
                        case qw_svc_setpause:
                                cl.paused = MSG_ReadByte(&cl_message) != 0;
+#ifdef CONFIG_CD
                                if (cl.paused)
                                        CDAudio_Pause ();
                                else
                                        CDAudio_Resume ();
+#endif
                                S_PauseGameSounds (cl.paused);
                                break;
                        }
@@ -4057,10 +4063,12 @@ void CL_ParseServerMessage(void)
 
                        case svc_setpause:
                                cl.paused = MSG_ReadByte(&cl_message) != 0;
+#ifdef CONFIG_CD
                                if (cl.paused)
                                        CDAudio_Pause ();
                                else
                                        CDAudio_Resume ();
+#endif
                                S_PauseGameSounds (cl.paused);
                                break;
 
@@ -4107,10 +4115,12 @@ void CL_ParseServerMessage(void)
                        case svc_cdtrack:
                                cl.cdtrack = MSG_ReadByte(&cl_message);
                                cl.looptrack = MSG_ReadByte(&cl_message);
+#ifdef CONFIG_CD
                                if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
                                        CDAudio_Play ((unsigned char)cls.forcetrack, true);
                                else
                                        CDAudio_Play ((unsigned char)cl.cdtrack, true);
+#endif
                                break;
 
                        case svc_intermission:
diff --git a/host.c b/host.c
index 0b97a4547183e3c6675ca0bf4ed550aa38ead26c..b236b0f12c051cff5946c31d268d5a82316f6166 100644 (file)
--- a/host.c
+++ b/host.c
@@ -23,7 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <time.h>
 #include "libcurl.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 #include "cl_video.h"
 #include "progsvm.h"
 #include "csprogs.h"
@@ -1024,8 +1026,10 @@ void Host_Main(void)
                        else
                                S_Update(&r_refdef.view.matrix);
 
+#ifdef CONFIG_CD
                        CDAudio_Update();
                        R_TimeReport("audio");
+#endif
 
                        // reset gathering of mouse input
                        in_mouse_x = in_mouse_y = 0;
@@ -1073,7 +1077,9 @@ void Host_StartVideo(void)
                // make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
                NetConn_UpdateSockets();
                VID_Start();
+#ifdef CONFIG_CD
                CDAudio_Startup();
+#endif
        }
 }
 
@@ -1274,7 +1280,9 @@ static void Host_Init (void)
                VID_Init();
                Render_Init();
                S_Init();
+#ifdef CONFIG_CD
                CDAudio_Init();
+#endif
                Key_Init();
                CL_Init();
        }
@@ -1410,7 +1418,9 @@ void Host_Shutdown(void)
 
        Host_SaveConfig();
 
+#ifdef CONFIG_CD
        CDAudio_Shutdown ();
+#endif
        S_Terminate ();
        Curl_Shutdown ();
        NetConn_Shutdown ();
index 1469f7e7bd12f90cce58d9d5377c5454c0cf2e16..95e3da5951b1f4df0feb4afd04c72d041f7e7196 100644 (file)
--- a/makefile
+++ b/makefile
@@ -60,6 +60,20 @@ TARGETS_RELEASE=sv-release cl-release sdl-release
 TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile
 TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz
 
+###### Optional features #####
+DP_CDDA?=enabled
+ifeq ($(DP_CDDA), enabled)
+       OBJ_SDLCD=$(OBJ_CD_COMMON) cd_sdl.o
+       OBJ_LINUXCD=$(OBJ_CD_COMMON) cd_linux.o
+       OBJ_BSDCD=$(OBJ_CD_COMMON) cd_bsd.o
+       OBJ_WINCD=$(OBJ_CD_COMMON) cd_win.o
+else
+       OBJ_SDLCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+       OBJ_LINUXCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+       OBJ_BSDCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+       OBJ_WINCD=$(OBJ_CD_COMMON) $(OBJ_NOCD)
+endif
+
 # Linux configuration
 ifeq ($(DP_MAKE_TARGET), linux)
        DEFAULT_SNDAPI=ALSA
index 700f0cde9ed9521599e524683c3c4cde1dfe5f56..c3c18ae6a1dac5b9b51e3032754f28f04ad3aa23 100644 (file)
@@ -71,6 +71,7 @@ OBJ_SND_3DRAS=snd_3dras.o
 LIB_SND_3DRAS=
 
 # CD objects
+OBJ_CD_COMMON=cd_shared.o
 OBJ_NOCD=cd_null.o
 
 
@@ -81,7 +82,6 @@ OBJ_COMMON= \
        bih.o \
        cap_avi.o \
        cap_ogg.o \
-       cd_shared.o \
        crypto.o \
        cl_collision.o \
        cl_demo.o \
@@ -166,12 +166,14 @@ OBJ_COMMON= \
 # note that builddate.c is very intentionally not compiled to a .o before
 # being linked, because it should be recompiled every time an executable is
 # built to give the executable a proper date string
-OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_NOCD) $(OBJ_COMMON)
-OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $(OBJ_COMMON)
+OBJ_SV= builddate.c sys_linux.o vid_null.o thread_null.o $(OBJ_SND_NULL) $(OBJ_COMMON)
+OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o thread_sdl.o $(OBJ_SND_COMMON) snd_sdl.o $(OBJ_SDLCD) $(OBJ_COMMON)
 
 
 # Compilation
 CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_WARNINGS) $(CFLAGS_LIBZ) $(CFLAGS_LIBJPEG) $(CFLAGS_D3D) -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../
+CFLAGS_CLIENT=-DCONFIG_CD
+CFLAGS_SERVER=
 CFLAGS_DEBUG=-ggdb
 CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs
 CFLAGS_RELEASE=
@@ -224,11 +226,6 @@ CMD_UNIXMKDIR=mkdir -p
 
 ##### Linux specific variables #####
 
-# If you want CD sound in Linux
-OBJ_LINUXCD=cd_linux.o
-# If you want no CD audio
-#OBJ_LINUXCD=$(OBJ_NOCD)
-
 # Link
 LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXCL)
 LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl
@@ -266,11 +263,6 @@ LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl $(LDFLAGS_UNIXSD
 
 ##### BSD specific variables #####
 
-#if you want CD sound in BSD
-OBJ_BSDCD=cd_bsd.o
-#if you want no CD audio
-#OBJ_BSDCD=$(OBJ_NOCD)
-
 # Link
 LDFLAGS_BSDCL=$(LDFLAGS_UNIXCOMMON) -lutil $(LDFLAGS_UNIXCL)
 LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) 
@@ -280,10 +272,6 @@ LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
 ##### Win32 specific variables #####
 
 WINDRES ?= windres
-#if you want CD sound in Win32
-OBJ_WINCD=cd_win.o
-#if you want no CD audio
-#OBJ_WINCD=$(OBJ_NOCD)
 
 OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON)
 
@@ -362,77 +350,77 @@ nexuiz :
 cl-debug :
        $(MAKE) bin-debug \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+               EXE="$(EXE_CL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
 
 cl-profile :
        $(MAKE) bin-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+               EXE="$(EXE_CL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
 
 cl-release :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+               EXE="$(EXE_CL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
 
 cl-release-profile :
        $(MAKE) bin-release-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+               EXE="$(EXE_CL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
 
 cl-nexuiz :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_CLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
+               EXE="$(EXE_CLNEXUIZ)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1
 
 sv-debug :
        $(MAKE) bin-debug \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+               EXE="$(EXE_SV)" CFLAGS_FEATURES=$(CFLAGS_SERVER) LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
 
 sv-profile :
        $(MAKE) bin-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+               EXE="$(EXE_SV)" CFLAGS_FEATURES=$(CFLAGS_SERVER) LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
 
 sv-release :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+               EXE="$(EXE_SV)" CFLAGS_FEATURES=$(CFLAGS_SERVER) LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
 
 sv-release-profile :
        $(MAKE) bin-release-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+               EXE="$(EXE_SV)" CFLAGS_FEATURES=$(CFLAGS_SERVER) LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
 
 sv-nexuiz :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SVNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
+               EXE="$(EXE_SVNEXUIZ)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1
 
 sdl-debug :
        $(MAKE) bin-debug \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+               EXE="$(EXE_SDL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
 
 sdl-profile :
        $(MAKE) bin-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+               EXE="$(EXE_SDL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
 
 sdl-release :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+               EXE="$(EXE_SDL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
 
 sdl-release-profile :
        $(MAKE) bin-release-profile \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+               EXE="$(EXE_SDL)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
 
 sdl-nexuiz :
        $(MAKE) bin-release \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               EXE="$(EXE_SDLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
+               EXE="$(EXE_SDLNEXUIZ)" CFLAGS_FEATURES=$(CFLAGS_CLIENT) LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1
 
 bin-debug :
        $(CHECKLEVEL1)
@@ -441,7 +429,7 @@ bin-debug :
        $(MAKE) prepare BUILD_DIR=obj/debug/$(EXE)
        $(MAKE) -C obj/debug/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
+               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
                LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)" LEVEL=2
 
 bin-profile :
@@ -451,7 +439,7 @@ bin-profile :
        $(MAKE) prepare BUILD_DIR=obj/profile/$(EXE)
        $(MAKE) -C obj/profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
+               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
                LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)" LEVEL=2
 
 bin-release :
@@ -461,7 +449,7 @@ bin-release :
        $(MAKE) prepare BUILD_DIR=obj/release/$(EXE)
        $(MAKE) -C obj/release/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
+               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
                LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
        $(STRIP) $(EXE)
 
@@ -472,7 +460,7 @@ bin-release-profile :
        $(MAKE) prepare BUILD_DIR=obj/release-profile/$(EXE)
        $(MAKE) -C obj/release-profile/$(EXE) -f ../../../$(MAKEFILE) $(EXE) \
                DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
-               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)"\
+               CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_FEATURES) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE_PROFILE) $(OPTIM_RELEASE)"\
                LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2
        $(STRIP) $(EXE)
 
diff --git a/menu.c b/menu.c
index 184ae366dc96c75b2aff943c6841f85c5f8afab8..34a8de7f964059932023ee112d15b8241570c785 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -18,7 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 */
 #include "quakedef.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 #include "image.h"
 #include "progsvm.h"
 
@@ -1699,7 +1701,9 @@ static void M_Options_Draw (void)
        M_Options_PrintSlider(  "            Brightness", true, v_contrast.value, 1, 2);
        M_Options_PrintSlider(  "                 Gamma", true, v_gamma.value, 0.5, 3);
        M_Options_PrintSlider(  "          Sound Volume", snd_initialized.integer, volume.value, 0, 1);
+#ifdef CONFIG_CD
        M_Options_PrintSlider(  "          Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1);
+#endif
        M_Options_PrintCommand( "     Customize Effects", true);
        M_Options_PrintCommand( "       Effects:  Quake", true);
        M_Options_PrintCommand( "       Effects: Normal", true);
index 1c9c8099b7c26fcb03b9981561b6cdd81f86e60c..00c9ede9fcd5dc6ad0fa253d6ede33caf399fa0b 100644 (file)
@@ -2872,7 +2872,9 @@ VM_gettime
 float  gettime(prvm_prog_t *prog)
 =========
 */
+#ifdef CONFIG_CD
 float CDAudio_GetPosition(void);
+#endif
 void VM_gettime(prvm_prog_t *prog)
 {
        int timer_index;
@@ -2900,9 +2902,11 @@ void VM_gettime(prvm_prog_t *prog)
                        case 3: // GETTIME_UPTIME
                                PRVM_G_FLOAT(OFS_RETURN) = realtime;
                                break;
+#ifdef CONFIG_CD
                        case 4: // GETTIME_CDTRACK
                                PRVM_G_FLOAT(OFS_RETURN) = CDAudio_GetPosition();
                                break;
+#endif
                        default:
                                VM_Warning(prog, "VM_gettime: %s: unsupported timer specified, returning realtime\n", prog->name);
                                PRVM_G_FLOAT(OFS_RETURN) = realtime;
index ab3ff1ac9b5c6f5e6775e3417212f8679751f016..ceb230defb46e4f8c0e486f163e4799fec20b001 100644 (file)
@@ -26,7 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "snd_modplug.h"
 #include "csprogs.h"
 #include "cl_collision.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 
 
 #define SND_MIN_SPEED 8000
@@ -1821,8 +1823,10 @@ void S_StopAllSounds (void)
        if (snd_renderbuffer == NULL)
                return;
 
+#ifdef CONFIG_CD
        // stop CD audio because it may be using a faketrack
        CDAudio_Stop();
+#endif
 
        if (simsound || SndSys_LockRenderBuffer ())
        {
index 719d6299c4b3c2d2ea696cab14cd6898e6e30f7a..df04ab04817f3695dd86d5aa1973152c97730da4 100644 (file)
@@ -1,6 +1,8 @@
 
 #include "quakedef.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 #include "image.h"
 
 #ifdef SUPPORTD3D
index ffa665891a6bc5b7ce9d65ad4f9eefebff379129..f427957024fdf9bb50735e2f58dbf4836867ac81 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -511,7 +511,9 @@ void Sys_SendKeyEvents (void)
        }
 }
 
+#ifdef CONFIG_CD
 LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+#endif
 
 static keynum_t buttonremap[16] =
 {
@@ -688,7 +690,9 @@ LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM  wParam, LPARAM lParam)
                //      break;
 
                case MM_MCINOTIFY:
+#ifdef CONFIG_CD
                        lRet = CDAudio_MessageHandler (hWnd, uMsg, wParam, lParam);
+#endif
                        break;
 
                default: