added :wc2 cdmode
This commit is contained in:
parent
c162cd94d4
commit
3a8a0c9fdd
4 changed files with 16 additions and 11 deletions
src
|
@ -234,7 +234,7 @@ extern unsigned AllocatedSoundMemory;
|
|||
extern unsigned CompressedSoundMemory;
|
||||
#endif
|
||||
|
||||
/// cd play mode, ":off" ":random" or ":all"
|
||||
/// cd play mode, ":off" ":random" ":all" or ":wc2"
|
||||
extern char *CDMode;
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
/// FIXME: docu
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "iocompat.h"
|
||||
#include "sound.h"
|
||||
#include "sound_server.h"
|
||||
#include "menus.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Declaration
|
||||
|
@ -64,7 +65,7 @@
|
|||
global Sample* MusicSample; /// Music samples
|
||||
#endif
|
||||
|
||||
global char *CDMode = ":off"; /// cd play mode, ":off" ":random" or ":all"
|
||||
global char *CDMode = ":off"; /// cd play mode, ":off" ":random" ":all" or ":wc2"
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
global int CDTrack = 0; /// Current cd track
|
||||
#endif
|
||||
|
@ -287,7 +288,7 @@ global int PlayCDRom(const char* name)
|
|||
/**
|
||||
** Play music from cdrom.
|
||||
**
|
||||
** :all :random :off
|
||||
** :all :random :off :wc2
|
||||
**
|
||||
** @param name Name starting with ":".
|
||||
**
|
||||
|
@ -352,6 +353,11 @@ global int PlayCDRom(const char* name)
|
|||
CDMode = ":stopped";
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(name, ":wc2")) {
|
||||
CDMode = ":wc2";
|
||||
if (GuiGameStarted == 0)
|
||||
cd_play(15);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -243,11 +243,7 @@ global int CDRomCheck(void *unused __attribute__ ((unused)))
|
|||
if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")
|
||||
&& !cd_current_track()) {
|
||||
DebugLevel0Fn("Playing new track\n");
|
||||
if (!strcmp(CDMode, ":all")) {
|
||||
PlayCDRom(":all");
|
||||
} else if (!strcmp(CDMode, ":random")) {
|
||||
PlayCDRom(":random");
|
||||
}
|
||||
PlayCDRom(CDMode);
|
||||
} else if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")) {
|
||||
DebugLevel0Fn("get track\n");
|
||||
CDTrack = cd_current_track() + 1;
|
||||
|
|
|
@ -1074,9 +1074,12 @@ global void MenuLoop(char* filename, WorldMap* map)
|
|||
// Start new music for menus?
|
||||
// FIXME: If second loop?
|
||||
|
||||
if( !PlayingMusic && strcmp(TitleMusic,MenuMusic)
|
||||
&& (!strcmp(CDMode, ":off")) ) {
|
||||
PlayMusic(MenuMusic);
|
||||
if( !PlayingMusic && strcmp(TitleMusic,MenuMusic) ) {
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
PlayMusic(MenuMusic);
|
||||
} else {
|
||||
CDRomCheck(NULL);
|
||||
}
|
||||
}
|
||||
EnableRedraw=RedrawMenu;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue