diff --git a/source/bgmusic.c b/source/bgmusic.c index 68e1b68..2bfb9fa 100644 --- a/source/bgmusic.c +++ b/source/bgmusic.c @@ -25,6 +25,7 @@ #include "quakedef.h" #include "snd_codec.h" #include "bgmusic.h" +#include "cdaudio.h" #define MUSIC_DIRNAME "music" @@ -169,7 +170,7 @@ qboolean BGM_Init (void) } } - return true; + return CDAudio_Init (); } void BGM_Shutdown (void) @@ -178,6 +179,7 @@ void BGM_Shutdown (void) /* sever our connections to * midi_drv and snd_codec */ music_handlers = NULL; + CDAudio_Shutdown (); } static void BGM_Play_noext (const char *filename, unsigned int allowed_types) @@ -344,6 +346,7 @@ void BGM_Stop (void) bgmstream = NULL; s_rawend = 0; } + CDAudio_Stop(); } void BGM_Pause (void) @@ -353,6 +356,7 @@ void BGM_Pause (void) if (bgmstream->status == STREAM_PLAY) bgmstream->status = STREAM_PAUSE; } + CDAudio_Pause (); } void BGM_Resume (void) @@ -362,6 +366,7 @@ void BGM_Resume (void) if (bgmstream->status == STREAM_PAUSE) bgmstream->status = STREAM_PLAY; } + CDAudio_Resume (); } static void BGM_UpdateStream (void) @@ -465,5 +470,7 @@ void BGM_Update (void) } if (bgmstream) BGM_UpdateStream (); + + CDAudio_Update(); } diff --git a/source/cl_main.c b/source/cl_main.c index 5d870bd..110098d 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -107,7 +107,6 @@ void CL_Disconnect (void) // stop sounds (especially looping!) S_StopAllSounds (true); BGM_Stop(); - CDAudio_Stop(); // if running a local server, shut it down if (cls.demoplayback) @@ -446,7 +445,7 @@ void CL_RelinkEntities (void) { if (!ent->model) { // empty slot - + // ericw -- efrags are only used for static entities in GLQuake // ent can't be static, so this is a no-op. //if (ent->forcelink) @@ -791,7 +790,7 @@ void CL_Init (void) Cvar_RegisterVariable (&lookspring); Cvar_RegisterVariable (&lookstrafe); Cvar_RegisterVariable (&sensitivity); - + Cvar_RegisterVariable (&cl_alwaysrun); Cvar_RegisterVariable (&m_pitch); diff --git a/source/cl_parse.c b/source/cl_parse.c index 75bacda..401cc60 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -286,17 +286,17 @@ void CL_ParseServerInfo (void) if (cl.protocol == PROTOCOL_RMQ) { const unsigned int supportedflags = (PRFL_SHORTANGLE | PRFL_FLOATANGLE | PRFL_24BITCOORD | PRFL_FLOATCOORD | PRFL_EDICTSCALE | PRFL_INT32COORD); - + // mh - read protocol flags from server so that we know what protocol features to expect cl.protocolflags = (unsigned int) MSG_ReadLong (); - + if (0 != (cl.protocolflags & (~supportedflags))) { Con_Warning("PROTOCOL_RMQ protocolflags %i contains unsupported flags\n", cl.protocolflags); } } else cl.protocolflags = 0; - + // parse maxclients cl.maxclients = MSG_ReadByte (); if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) @@ -816,7 +816,7 @@ void CL_ParseClientdata (void) else cl.viewent.alpha = ENTALPHA_DEFAULT; //johnfitz - + //johnfitz -- lerping //ericw -- this was done before the upper 8 bits of cl.stats[STAT_WEAPON] were filled in, breaking on large maps like zendar.bsp if (cl.viewent.model != cl.model_precache[cl.stats[STAT_WEAPON]]) @@ -1124,15 +1124,9 @@ void CL_ParseServerMessage (void) case svc_setpause: cl.paused = MSG_ReadByte (); if (cl.paused) - { - CDAudio_Pause (); BGM_Pause (); - } else - { - CDAudio_Resume (); BGM_Resume (); - } break; case svc_signonnum: diff --git a/source/gl_vidsdl.c b/source/gl_vidsdl.c index 3efc324..34b67d8 100644 --- a/source/gl_vidsdl.c +++ b/source/gl_vidsdl.c @@ -485,7 +485,6 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb temp = scr_disabled_for_loading; scr_disabled_for_loading = true; - CDAudio_Pause (); BGM_Pause (); /* z-buffer depth */ @@ -599,7 +598,6 @@ static qboolean VID_SetMode (int width, int height, int refreshrate, int bpp, qb modestate = VID_GetFullscreen() ? MS_FULLSCREEN : MS_WINDOWED; - CDAudio_Resume (); BGM_Resume (); scr_disabled_for_loading = temp; diff --git a/source/host.c b/source/host.c index ad60160..8ebbe19 100644 --- a/source/host.c +++ b/source/host.c @@ -749,8 +749,6 @@ void _Host_Frame (float time) else S_Update (vec3_origin, vec3_origin, vec3_origin, vec3_origin); - CDAudio_Update(); - if (host_speeds.value) { pass1 = (time1 - time3)*1000; @@ -862,7 +860,6 @@ void Host_Init (void) SCR_Init (); R_Init (); S_Init (); - CDAudio_Init (); BGM_Init(); Sbar_Init (); CL_Init (); @@ -924,7 +921,6 @@ void Host_Shutdown(void) if (con_initialized) History_Shutdown (); BGM_Shutdown(); - CDAudio_Shutdown (); S_Shutdown (); IN_Shutdown (); VID_Shutdown(); diff --git a/source/quakedef.h b/source/quakedef.h index e767393..bb3ec39 100644 --- a/source/quakedef.h +++ b/source/quakedef.h @@ -241,7 +241,6 @@ typedef struct #include "input.h" #include "keys.h" #include "menu.h" -#include "cdaudio.h" #include "glquake.h"