can play CDRom music and level intro speech at same time now

This commit is contained in:
nehalmistry 2003-02-12 18:58:16 +00:00
parent c40b5b22cb
commit 4a8994b96d
7 changed files with 19 additions and 11 deletions

View file

@ -538,7 +538,10 @@ global void ShowIntro(const Intro *intro)
CallbackMusicOn();
StopMusic();
// FIXME: should this be GameMusic?
PlayMusic(MenuMusic);
if (CDMode == "off")
{
PlayMusic(MenuMusic);
}
}
/**

View file

@ -123,6 +123,8 @@ extern void PlayMusic(const char* name);
/// Stop music playing
extern void StopMusic(void);
extern int PlayCDRom(const char* name);
/// Turn music stopped callback on
#define CallbackMusicOn() \
CallbackMusic=1;

View file

@ -64,8 +64,8 @@
global Sample* MusicSample; /// Music samples
#endif
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
global char *CDMode = ":off"; /// cd play mode, ":off" ":random" or ":all"
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
global int CDTrack = 0; /// Current cd track
#endif
@ -74,7 +74,6 @@ global SDL_CD *CDRom; /// SDL cdrom device
#elif defined(USE_LIBCDA)
global int NumCDTracks; /// Number of tracks on the cd
#elif defined(USE_CDDA)
// FIXME: fill up
global int NumCDTracks;
global int CDDrive;
global struct cdrom_tochdr CDchdr;
@ -240,7 +239,7 @@ local Sample* LoadMod(const char* name,int flags __attribute__((unused)))
**
** @return True if name is handled by the cdrom module.
*/
local int PlayCDRom(const char* name)
global int PlayCDRom(const char* name)
{
// Old mode off, starting cdrom play.
if (!strcmp(CDMode, ":off")) {
@ -294,7 +293,7 @@ local int PlayCDRom(const char* name)
**
** @return True if name is handled by the cdrom module.
*/
local int PlayCDRom(const char* name)
global int PlayCDRom(const char* name)
{
int i;
int data_cd;
@ -441,6 +440,7 @@ global void PlayMusic(const char* name)
Sample* sample;
#endif
/*
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
if (PlayCDRom(name)) {
return;
@ -449,6 +449,7 @@ global void PlayMusic(const char* name)
return;
}
#endif
*/
if (MusicOff) {
return;

View file

@ -379,7 +379,7 @@ local SCM CclSetCdMode(SCM mode)
char *str;
if ( !gh_null_p(mode) ) {
PlayMusic(str = gh_scm2newstr(mode,NULL));
PlayCDRom(str = gh_scm2newstr(mode,NULL));
free(str);
}
#endif

View file

@ -1200,7 +1200,7 @@ global int InitSound(void)
DebugLevel0Fn("FIXME: must write non GLIB hash functions\n");
#endif
if( TitleMusic ) {
if( TitleMusic && (CDMode == "off") ) {
PlayMusic(TitleMusic);
}

View file

@ -1073,7 +1073,9 @@ global void MenuLoop(char* filename, WorldMap* map)
NetPlayers = 0;
// Start new music for menus?
// FIXME: If second loop?
if( !PlayingMusic && strcmp(TitleMusic,MenuMusic) ) {
if( !PlayingMusic && strcmp(TitleMusic,MenuMusic)
&& (CDMode == "off") ) {
PlayMusic(MenuMusic);
}
EnableRedraw=RedrawMenu;

View file

@ -1797,7 +1797,7 @@ local void SetCdPower(Menuitem *mi __attribute__((unused)))
#ifdef USE_WIN32
SDL_CDResume(CDRom);
#endif
PlayMusic(":random");
PlayCDRom(":random");
} else {
// Stop Playing CD
SDL_CDPause(CDRom);
@ -1809,7 +1809,7 @@ local void SetCdPower(Menuitem *mi __attribute__((unused)))
#elif defined(USE_LIBCDA)
// Start Playing CD
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
PlayMusic(":random");
PlayCDRom(":random");
} else {
// Stop Playing CD
cd_pause();
@ -1818,7 +1818,7 @@ local void SetCdPower(Menuitem *mi __attribute__((unused)))
#elif defined(USE_CDDA)
// Start Playing CD
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
PlayMusic(":random");
PlayCDRom(":random");
} else {
// Stop Playing CD
StopMusic();