game_status = last_game_status; /* restore current game status */
}
-static void PlaySound_Menu_Start(int sound)
+static void PlayMenuSound()
{
+ int sound = menu.sound[game_status];
+
+ if (sound == SND_UNDEFINED)
+ return;
+
if (sound_info[sound].loop)
PlaySoundLoop(sound);
else
PlaySound(sound);
}
-static void PlaySound_Menu_Continue(int sound)
+static void PlayMenuSoundIfLoop()
{
+ int sound = menu.sound[game_status];
+
+ if (sound == SND_UNDEFINED)
+ return;
+
if (sound_info[sound].loop)
PlaySoundLoop(sound);
}
+static void PlayMenuMusic()
+{
+ int music = menu.music[game_status];
+
+ if (music == MUS_UNDEFINED)
+ return;
+
+ PlayMusic(music);
+}
+
void DrawHeadline()
{
- int text1_width = getTextWidth(PROGRAM_TITLE_STRING, FONT_TITLE_1);
- int text2_width = getTextWidth(WINDOW_SUBTITLE_STRING, FONT_TITLE_2);
+ int text1_width = getTextWidth(PROGRAM_TITLE_STRING, FONT_TITLE_1);
+ int text2_width = getTextWidth(PROGRAM_COPYRIGHT_STRING, FONT_TITLE_2);
int x1 = SX + (SXSIZE - text1_width) / 2;
int x2 = SX + (SXSIZE - text2_width) / 2;
- DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1);
- DrawText(x2, SY + 46, WINDOW_SUBTITLE_STRING, FONT_TITLE_2);
+ DrawText(x1, SY + 8, PROGRAM_TITLE_STRING, FONT_TITLE_1);
+ DrawText(x2, SY + 46, PROGRAM_COPYRIGHT_STRING, FONT_TITLE_2);
}
static void ToggleFullscreenIfNeeded()
int i;
UnmapAllGadgets();
- FadeSounds();
+ FadeSoundsAndMusic();
KeyboardAutoRepeatOn();
ActivateJoystick();
LoadTape(level_nr);
DrawCompleteVideoDisplay();
+ PlayMenuSound();
+ PlayMenuMusic();
+
OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
#if 0
int ystart = 150, ystep = 30;
int ybottom = SYSIZE - 20;
- FadeSounds();
+ FadeSoundsAndMusic();
ClearWindow();
DrawHeadline();
int ystart = 150, ystep = 30;
int ybottom = SYSIZE - 20;
- FadeSounds();
+ FadeSoundsAndMusic();
ClearWindow();
DrawHeadline();
FadeToFront();
InitAnimation();
-#if 0
- PlaySoundLoop(SND_BACKGROUND_INFO);
-#else
- PlaySound_Menu_Start(SND_BACKGROUND_INFO);
-#endif
+ PlayMenuSound();
+ PlayMenuMusic();
}
void HandleHelpScreen(int button)
}
else
{
- FadeSounds();
+ FadeSoundsAndMusic();
game_status = GAME_MODE_MAIN;
DrawMainMenu();
DrawHelpScreenElAction(helpscreen_state * MAX_HELPSCREEN_ELS);
}
- /* !!! workaround for playing "music" that is really a sound loop (and
- must therefore periodically be reactivated with the current sound
- engine !!! */
-#if 0
- PlaySoundLoop(SND_BACKGROUND_INFO);
-#else
- PlaySound_Menu_Continue(SND_BACKGROUND_INFO);
-#endif
+ PlayMenuSoundIfLoop();
}
DoAnimation();
SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
DrawChooseTree(&leveldir_current);
+
+ PlayMenuSound();
+ PlayMenuMusic();
}
void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
void DrawHallOfFame(int highlight_position)
{
UnmapAllGadgets();
- FadeSounds();
+ FadeSoundsAndMusic();
CloseDoor(DOOR_CLOSE_2);
if (highlight_position < 0)
HandleHallOfFame(highlight_position,0, 0,0, MB_MENU_INITIALIZE);
-#if 0
- PlaySound(SND_BACKGROUND_SCORES);
-#else
- PlaySound_Menu_Start(SND_BACKGROUND_SCORES);
-#endif
+ PlayMenuSound();
+ PlayMenuMusic();
}
static void drawHallOfFameList(int first_entry, int highlight_position)
DrawMainMenu();
}
-#if 1
if (game_status == GAME_MODE_SCORES)
- PlaySound_Menu_Continue(SND_BACKGROUND_SCORES);
-#endif
+ PlayMenuSoundIfLoop();
DoAnimation();
BackToFront();
{ TYPE_SWITCH, &setup.editor.el_custom, "Custom:" },
{ TYPE_SWITCH, &setup.editor.el_custom_more, "More Custom:" },
{ TYPE_SWITCH, &setup.editor.el_headlines, "Headlines:" },
+ { TYPE_SWITCH, &setup.editor.el_user_defined, "User defined:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
{ 0, NULL, NULL }
int xpos = MENU_SCREEN_VALUE_XPOS;
int ypos = MENU_SCREEN_START_YPOS + pos;
int font_nr = FONT_VALUE_1;
- char *value_string = getSetupValue(setup_info[pos].type & ~TYPE_GHOSTED,
- setup_info[pos].value);
+ int type = setup_info[pos].type;
+ void *value = setup_info[pos].value;
+ char *value_string = (!(type & TYPE_GHOSTED) ? getSetupValue(type, value) :
+ "n/a");
if (value_string == NULL)
return;
- if (setup_info[pos].type & TYPE_KEY)
+ if (type & TYPE_KEY)
{
xpos = 3;
- if (setup_info[pos].type & TYPE_QUERY)
+ if (type & TYPE_QUERY)
{
value_string = "<press key>";
font_nr = FONT_INPUT_1_ACTIVE;
}
}
- else if (setup_info[pos].type & TYPE_STRING)
+ else if (type & TYPE_STRING)
{
int max_value_len = (SCR_FIELDX - 2) * 2;
if (strlen(value_string) > max_value_len)
value_string[max_value_len] = '\0';
}
- else if (setup_info[pos].type & TYPE_BOOLEAN_STYLE)
+ else if (type & TYPE_BOOLEAN_STYLE)
{
- font_nr = (*(boolean *)(setup_info[pos].value) ? FONT_OPTION_ON :
- FONT_OPTION_OFF);
+ font_nr = (*(boolean *)value ? FONT_OPTION_ON : FONT_OPTION_OFF);
}
DrawText(mSX + xpos * 32, mSY + ypos * 32,
DrawChooseTree(&artwork.mus_current);
else
DrawSetupScreen_Generic();
+
+ PlayMenuSound();
+ PlayMenuMusic();
}
void HandleSetupScreen(int mx, int my, int dx, int dy, int button)