From fded47666a0ca6c66d9cd3983a79dc470dbc5138 Mon Sep 17 00:00:00 2001 From: stevenaaus Date: Tue, 24 Aug 2010 10:06:16 +0000 Subject: [PATCH] Back out Oz's cd-sdl.c changes git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@297 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/cd_sdl.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/Quake/cd_sdl.c b/Quake/cd_sdl.c index 3186a9f3..195a7cd7 100644 --- a/Quake/cd_sdl.c +++ b/Quake/cd_sdl.c @@ -43,7 +43,6 @@ static qboolean playing = false; static qboolean wasPlaying = false; static qboolean enabled = true; static qboolean playLooping = false; -static qboolean cdplayer= false; // QuakeSpasm / S.A - cd player facility static byte remap[100]; static byte playTrack; static double endOfTrack = -1.0, pausetime = -1.0; @@ -229,7 +228,7 @@ void CDAudio_Resume(void) static void CD_f (void) { - const char *command; + const char *command,*arg2; int ret, n; if (Cmd_Argc() < 2) @@ -295,20 +294,20 @@ static void CD_f (void) if (Q_strcasecmp(command, "play") == 0) { - command = Cmd_Argv (2); - if (*command) - CDAudio_Play((byte)atoi(command), false); - else + arg2 = Cmd_Argv (2); + if (*arg2) + CDAudio_Play((byte)atoi(Cmd_Argv (2)), false); + else CDAudio_Play((byte)1, false); return; } if (Q_strcasecmp(command, "loop") == 0) { - command = Cmd_Argv (2); - if (*command) - CDAudio_Play((byte)atoi(command), true); - else + arg2 = Cmd_Argv (2); + if (*arg2) + CDAudio_Play((byte)atoi(Cmd_Argv (2)), true); + else CDAudio_Play((byte)1, true); return; } @@ -437,19 +436,13 @@ void CDAudio_Update(void) curstat = SDL_CDStatus(cd_handle); if (curstat != CD_PLAYING && curstat != CD_PAUSED) { - if (!cdplayer) { - playing = false; - endOfTrack = -1.0; - if (playLooping) - CDAudio_Play(playTrack, true); - } else { // QuakeSpasm / S.A endOfTrack = -1.0; if (playLooping) { playing = false; CDAudio_Play(playTrack, true); } - else CDAudio_Next(); - } + else + CDAudio_Next(); } } } @@ -586,9 +579,6 @@ int CDAudio_Init(void) Cmd_AddCommand ("cd", CD_f); - if (COM_CheckParm("-cd")) // QuakeSpasm / S.A - cd player facility - cdplayer = true; - // cd hardware volume: no SDL support at present. hw_vol_works = CD_GetVolume (NULL); if (hw_vol_works)