speed optimizations for LIBCDA

This commit is contained in:
nehalmistry 2002-04-11 08:03:44 +00:00
parent bc6491a763
commit 0b9ad23813
2 changed files with 8 additions and 4 deletions

View file

@ -226,13 +226,15 @@ local int PlayCDRom(const char* name)
{
if (!strcmp(CDMode, ":off")) {
if (!strncmp(name, ":", 1)) {
if (cd_init() < 0) {
if (cd_init()) {
fprintf(stderr, "Error initialising libcda \n");
CDMode = ":off";
return 1;
}
if (cd_get_tracks(&CDTrack, &NumCDTracks) == -1)
if (cd_get_tracks(&CDTrack, &NumCDTracks))
return 1;
if (NumCDTracks == 0) {
CDMode = ":off";
return 1;
}
--CDTrack;

View file

@ -1752,6 +1752,8 @@ global void SoundOptions(void)
#if defined(USE_LIBCDA) || defined(USE_SDLCD)
if (strcmp(":off", CDMode) && strcmp(":stopped", CDMode))
SoundOptionsMenuItems[i].d.gem.state = MI_GSTATE_CHECKED;
else
SoundOptionsMenuItems[i].d.gem.state = MI_GSTATE_UNCHECKED;
#ifdef USE_LIBCDA
cd_get_volume(&i, &i);
SoundOptionsMenuItems[14].d.hslider.percent = (i * 100) / 255;
@ -1837,14 +1839,14 @@ local void SetCdPower(Menuitem *mi)
/// Start Playing CD
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
PlayMusic(":random");
if (!cd_current_track())
SoundOptionsMenuItems[i].d.gem.state = MI_GSTATE_UNCHECKED;
} else {
/// Stop Playing CD
cd_stop();
CDMode = ":stopped";
}
#endif
EndMenu();
SoundOptions();
}
local void SetFogOfWar(Menuitem *mi)