Slight refactoring of cdAudio_PlayTrack to use a switch on the enum, instead of an if, if-else structure
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5327 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
7af41b6f3a
commit
9fcaf6c08f
|
@ -127,17 +127,20 @@ BOOL cdAudio_PlayTrack(SONG_CONTEXT context)
|
|||
{
|
||||
debug(LOG_SOUND, "called(%d)", (int)context);
|
||||
|
||||
if (context == SONG_FRONTEND)
|
||||
switch (context)
|
||||
{
|
||||
return cdAudio_OpenTrack("music/menu.ogg");
|
||||
}
|
||||
else if (context == SONG_INGAME)
|
||||
{
|
||||
const char *filename = PlayList_CurrentSong();
|
||||
case SONG_FRONTEND:
|
||||
return cdAudio_OpenTrack("music/menu.ogg");
|
||||
|
||||
return cdAudio_OpenTrack(filename);
|
||||
case SONG_INGAME:
|
||||
{
|
||||
const char *filename = PlayList_CurrentSong();
|
||||
|
||||
return cdAudio_OpenTrack(filename);
|
||||
}
|
||||
}
|
||||
ASSERT(false, "Bad parameter value");
|
||||
|
||||
ASSERT(!"Invalid songcontext", "Invalid song context specified for playing: %u", (unsigned int)context);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue