Setting cdrom on/off partially working.

This commit is contained in:
nehalmistry 2002-04-07 00:14:10 +00:00
parent bb3e70f13c
commit c6b5acd451

View file

@ -73,6 +73,7 @@ local void GameShowCredits(void);
local void GameMenuObjectives(void);
local void GameMenuEndScenario(void);
local void GameOptions(void);
local void SetCdMode(Menuitem *mi);
local void EndScenarioRestart(void);
local void EndScenarioSurrender(void);
@ -756,7 +757,7 @@ local Menuitem GameOptionsMenuItems[] = {
{ MI_TYPE_TEXT, 144, 11, 0, LargeFont, NULL, NULL,
{ text:{ "Options", MI_TFLAGS_CENTERED} } },
{ MI_TYPE_GEM, 10, 42, 0, LargeFont, NULL, NULL,
{ gem:{ 0, 18, 18, MBUTTON_GEM_SQUARE, EndMenu} } },
{ gem:{ 4, 18, 18, MBUTTON_GEM_SQUARE, SetCdMode} } },
{ MI_TYPE_TEXT, 144, 44, 0, LargeFont, NULL, NULL,
{ text:{ "CD Audio Enabled", MI_TFLAGS_CENTERED} } },
{ MI_TYPE_BUTTON, 32, 90, MenuButtonSelected, LargeFont, NULL, NULL,
@ -1485,6 +1486,26 @@ local void GameOptions(void)
ProcessMenu(MENU_GAME_OPTIONS, 1);
}
local void SetCdMode(Menuitem *mi)
{
if (!strcmp(":off", CDMode)) {
// CDMode = ":random";
PlayMusic(":random");
} else {
#ifdef USE_SDLCD
SDL_CDStop(CDRom);
SDL_CDClose(CDRom);
#endif
#ifdef USE_LIBCDA
cd_stop();
cd_close();
cd_exit();
#endif
CDMode = ":off";
}
}
/**
** Show the game credits.
*/