mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-20 19:12:03 +00:00
bgmusic.c: remove some unnecessary comments.
(BGM_Play): call BGM_Stop() before anything else. don't do anything if there are no music handlers. (BGM_PlayCDtrack): remove commented out code. if CDAudio_Play() call failed and there are no music handlers, don't do anything else. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@388 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
3d0026615c
commit
1a2f871517
1 changed files with 8 additions and 19 deletions
|
@ -197,8 +197,6 @@ static void BGM_Play_noext (const char *filename, unsigned int allowed_types)
|
||||||
}
|
}
|
||||||
if (!handler->is_available)
|
if (!handler->is_available)
|
||||||
{
|
{
|
||||||
/* skip handlers which failed to initialize */
|
|
||||||
/* TODO: implement re-init, make BGM aware of it */
|
|
||||||
handler = handler->next;
|
handler = handler->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -230,14 +228,17 @@ void BGM_Play (const char *filename)
|
||||||
const char *ext;
|
const char *ext;
|
||||||
music_handler_t *handler;
|
music_handler_t *handler;
|
||||||
|
|
||||||
|
BGM_Stop();
|
||||||
|
|
||||||
|
if (music_handlers == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!filename || !*filename)
|
if (!filename || !*filename)
|
||||||
{
|
{
|
||||||
Con_DPrintf("null music file name\n");
|
Con_DPrintf("null music file name\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BGM_Stop();
|
|
||||||
|
|
||||||
ext = S_FileExtension(filename);
|
ext = S_FileExtension(filename);
|
||||||
if (!ext) /* try all things */
|
if (!ext) /* try all things */
|
||||||
{
|
{
|
||||||
|
@ -248,8 +249,6 @@ void BGM_Play (const char *filename)
|
||||||
handler = music_handlers;
|
handler = music_handlers;
|
||||||
while (handler)
|
while (handler)
|
||||||
{
|
{
|
||||||
/* skip handlers which failed to initialize */
|
|
||||||
/* TODO: implement re-init, make BGM aware of it */
|
|
||||||
if (handler->is_available &&
|
if (handler->is_available &&
|
||||||
!Q_strcasecmp(ext, handler->ext))
|
!Q_strcasecmp(ext, handler->ext))
|
||||||
break;
|
break;
|
||||||
|
@ -281,19 +280,6 @@ void BGM_Play (const char *filename)
|
||||||
|
|
||||||
void BGM_PlayCDtrack (byte track, qboolean looping)
|
void BGM_PlayCDtrack (byte track, qboolean looping)
|
||||||
{
|
{
|
||||||
#if 0 /* see below */
|
|
||||||
char tmp[MAX_QPATH];
|
|
||||||
|
|
||||||
BGM_Stop();
|
|
||||||
|
|
||||||
bgmloop = looping;
|
|
||||||
|
|
||||||
if (CDAudio_Play(track, looping) == 0)
|
|
||||||
return; /* success */
|
|
||||||
|
|
||||||
q_snprintf(tmp, sizeof(tmp), "track%02d", (int)track);
|
|
||||||
BGM_Play_noext(tmp, CDRIP_TYPES);
|
|
||||||
#endif
|
|
||||||
/* instead of searching by the order of music_handlers, do so by
|
/* instead of searching by the order of music_handlers, do so by
|
||||||
* the order of searchpath priority: the file from the searchpath
|
* the order of searchpath priority: the file from the searchpath
|
||||||
* with the highest path_id is most likely from our own gamedir
|
* with the highest path_id is most likely from our own gamedir
|
||||||
|
@ -310,6 +296,9 @@ void BGM_PlayCDtrack (byte track, qboolean looping)
|
||||||
if (CDAudio_Play(track, looping) == 0)
|
if (CDAudio_Play(track, looping) == 0)
|
||||||
return; /* success */
|
return; /* success */
|
||||||
|
|
||||||
|
if (music_handlers == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (no_extmusic || !bgm_extmusic.value)
|
if (no_extmusic || !bgm_extmusic.value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue