can play CDRom music and level intro speech at same time now
This commit is contained in:
parent
c40b5b22cb
commit
4a8994b96d
7 changed files with 19 additions and 11 deletions
src
game
include
sound
stratagus
ui
|
@ -538,7 +538,10 @@ global void ShowIntro(const Intro *intro)
|
|||
CallbackMusicOn();
|
||||
StopMusic();
|
||||
// FIXME: should this be GameMusic?
|
||||
PlayMusic(MenuMusic);
|
||||
if (CDMode == "off")
|
||||
{
|
||||
PlayMusic(MenuMusic);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue