more updates for wc2 cdmode
This commit is contained in:
parent
4f4e87f07e
commit
a0af9ff561
4 changed files with 21 additions and 3 deletions
src
|
@ -540,6 +540,8 @@ global void ShowIntro(const Intro *intro)
|
|||
// FIXME: should this be GameMusic?
|
||||
if( !strcmp(CDMode, ":off") ) {
|
||||
PlayMusic(MenuMusic);
|
||||
} else {
|
||||
CDRomCheck(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include "iocompat.h"
|
||||
#include "sound.h"
|
||||
#include "sound_server.h"
|
||||
#include "menus.h"
|
||||
#include "interface.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Declaration
|
||||
|
@ -300,6 +300,7 @@ global int PlayCDRom(const char* name)
|
|||
{
|
||||
int i;
|
||||
int data_cd;
|
||||
int track;
|
||||
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
if (!strncmp(name, ":", 1)) {
|
||||
|
@ -358,8 +359,18 @@ global int PlayCDRom(const char* name)
|
|||
// FIXME: remove :wc2
|
||||
if (!strcmp(name, ":wc2")) {
|
||||
CDMode = ":wc2";
|
||||
if (GuiGameStarted == 0)
|
||||
track = cd_current_track();
|
||||
if (!GameRunning && track != 15) {
|
||||
cd_play(15);
|
||||
} else if (GameRunning && !ThisPlayer->Race && (track < 3 || track > 7)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 3;
|
||||
while (CDTrack < 3 || CDTrack > 7);
|
||||
cd_play(CDTrack);
|
||||
} else if (GameRunning && ThisPlayer->Race && (track < 11 || track > 14)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 9;
|
||||
while (CDTrack < 11 || CDTrack > 14);
|
||||
cd_play(CDTrack);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -241,10 +241,13 @@ global int CDRomCheck(void *unused __attribute__ ((unused)))
|
|||
}
|
||||
#elif defined(USE_LIBCDA)
|
||||
if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")
|
||||
&& !cd_current_track()) {
|
||||
&& !cd_current_track() && strcmp(CDMode, ":wc2")) {
|
||||
DebugLevel0Fn("Playing new track\n");
|
||||
PlayCDRom(CDMode);
|
||||
} else if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")) {
|
||||
if (!strcmp(CDMode, ":wc2")) {
|
||||
PlayCDRom(CDMode);
|
||||
}
|
||||
DebugLevel0Fn("get track\n");
|
||||
CDTrack = cd_current_track() + 1;
|
||||
if (CDTrack > NumCDTracks) {
|
||||
|
|
|
@ -636,6 +636,8 @@ global void GameMainLoop(void)
|
|||
|
||||
MultiPlayerReplayEachCycle();
|
||||
|
||||
CDRomCheck(NULL);
|
||||
|
||||
while( GameRunning ) {
|
||||
#if defined(DEBUG) && defined(HIERARCHIC_PATHFINDER)
|
||||
if (setjmp (MainLoopJmpBuf)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue