-1,
MUS_BACKGROUND
},
+ {
+ GFX_SPECIAL_ARG_TITLE,
+ MUS_BACKGROUND_TITLE
+ },
{
GFX_SPECIAL_ARG_MAIN,
MUS_BACKGROUND_MAIN
}
gamemode_to_sound[] =
{
+ {
+ GFX_SPECIAL_ARG_TITLE,
+ SND_BACKGROUND_TITLE
+ },
{
GFX_SPECIAL_ARG_MAIN,
SND_BACKGROUND_MAIN
struct ConfigInfo music_config[] =
{
{ "background", UNDEFINED_FILENAME },
+ { "background.TITLE", UNDEFINED_FILENAME },
{ "background.MAIN", UNDEFINED_FILENAME },
{ "background.LEVELS", UNDEFINED_FILENAME },
{ "background.SCORES", UNDEFINED_FILENAME },
/* values for music configuration */
#define MUS_BACKGROUND 0
-#define MUS_BACKGROUND_MAIN 1
-#define MUS_BACKGROUND_LEVELS 2
-#define MUS_BACKGROUND_SCORES 3
-#define MUS_BACKGROUND_EDITOR 4
-#define MUS_BACKGROUND_INFO 5
-#define MUS_BACKGROUND_SETUP 6
+#define MUS_BACKGROUND_TITLE 1
+#define MUS_BACKGROUND_MAIN 2
+#define MUS_BACKGROUND_LEVELS 3
+#define MUS_BACKGROUND_SCORES 4
+#define MUS_BACKGROUND_EDITOR 5
+#define MUS_BACKGROUND_INFO 6
+#define MUS_BACKGROUND_SETUP 7
-#define NUM_MUSIC_FILES 7
+#define NUM_MUSIC_FILES 8
#endif /* CONF_MUS_H */
{ "door.opening", "oeffnen.wav" },
{ "door.closing", "oeffnen.wav" },
+ { "background.TITLE", UNDEFINED_FILENAME },
{ "background.MAIN", UNDEFINED_FILENAME },
{ "background.LEVELS", UNDEFINED_FILENAME },
{ "background.SCORES", "halloffame.wav" },
#define SND_GAME_SOKOBAN_SOLVING 179
#define SND_DOOR_OPENING 180
#define SND_DOOR_CLOSING 181
-#define SND_BACKGROUND_MAIN 182
-#define SND_BACKGROUND_LEVELS 183
-#define SND_BACKGROUND_SCORES 184
-#define SND_BACKGROUND_EDITOR 185
-#define SND_BACKGROUND_INFO 186
-#define SND_BACKGROUND_SETUP 187
+#define SND_BACKGROUND_TITLE 182
+#define SND_BACKGROUND_MAIN 183
+#define SND_BACKGROUND_LEVELS 184
+#define SND_BACKGROUND_SCORES 185
+#define SND_BACKGROUND_EDITOR 186
+#define SND_BACKGROUND_INFO 187
+#define SND_BACKGROUND_SETUP 188
-#define NUM_SOUND_FILES 188
+#define NUM_SOUND_FILES 189
#endif /* CONF_SND_H */
-#define COMPILE_DATE_STRING "[2006-04-30 16:56]"
+#define COMPILE_DATE_STRING "[2006-04-30 17:49]"
switch(game_status)
{
+ case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
case GAME_MODE_LEVELS:
case GAME_MODE_SETUP:
game_status = last_game_status; /* restore current game status */
}
-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 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()
{
DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, PROGRAM_TITLE_STRING);
dst_x = (WIN_XSIZE - width) / 2;
dst_y = (WIN_YSIZE - height) / 2;
-#if 1
ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
-#else
- DrawBackground(0, 0, WIN_XSIZE, WIN_YSIZE);
-#endif
if (DrawingOnBackground(dst_x, dst_y))
BlitBitmapMasked(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y);
SetMainBackgroundImage(IMG_BACKGROUND_TITLE);
-#if 0
- CloseDoor(DOOR_CLOSE_1);
-#endif
-
PlayMenuSound();
PlayMenuMusic();
HandleTitleScreen(0, 0, 0, 0, MB_MENU_INITIALIZE);
-#if 0
-#if 1
- FadeIn(1000);
-#else
- FadeToFront();
-#endif
-#endif
-
StopAnimation();
}
audio.sound_deactivated = FALSE;
+#if 1
+ GetPlayerConfig();
+#endif
+
/* needed if last screen was the playing screen, invoked from level editor */
if (level_editor_test_game)
{
if (setup.handicap && level_nr > leveldir_current->handicap_level)
level_nr = leveldir_current->handicap_level;
+#if 0
GetPlayerConfig();
+#endif
LoadLevel(level_nr);
SetMainBackgroundImage(IMG_BACKGROUND_MAIN);
#endif
#if 1
- if (fade_delay > 0)
- FadeIn(fade_delay);
- else
- BackToFront();
+ FadeIn(fade_delay);
InitAnimation();
#endif
drawto = drawto_last;
if (use_cross_fading)
- FadeCross(bitmap_db_title, fade_delay);
+ FadeCross(fade_delay);
else
FadeIn(fade_delay);
}
void FadeIn(int fade_delay)
{
+ if (fade_delay == 0)
+ {
+ BackToFront();
+
+ return;
+ }
+
FadeScreen(NULL, FADE_MODE_FADE_IN, fade_delay, 0);
redraw_mask = REDRAW_NONE;
void FadeOut(int fade_delay, int post_delay)
{
+ if (fade_delay == 0)
+ {
+ ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE);
+ BackToFront();
+
+ return;
+ }
+
FadeScreen(NULL, FADE_MODE_FADE_OUT, fade_delay, post_delay);
redraw_mask = REDRAW_NONE;
}
-void FadeCross(Bitmap *bitmap, int fade_delay)
+void FadeCross(int fade_delay)
{
- FadeScreen(bitmap, FADE_MODE_CROSSFADE, fade_delay, 0);
+ if (fade_delay == 0)
+ {
+ BlitBitmap(bitmap_db_title, backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0);
+ BackToFront();
+
+ return;
+ }
+
+ FadeScreen(bitmap_db_title, FADE_MODE_CROSSFADE, fade_delay, 0);
redraw_mask = REDRAW_NONE;
}
game.envelope_active = TRUE; /* needed for RedrawPlayfield() events */
- PlaySoundStereo(sound_opening, SOUND_MIDDLE);
+ PlayMenuSoundStereo(sound_opening, SOUND_MIDDLE);
if (anim_mode == ANIM_DEFAULT)
AnimateEnvelope(envelope_nr, ANIM_DEFAULT, ACTION_OPENING);
else
WaitForEventToContinue();
- PlaySoundStereo(sound_closing, SOUND_MIDDLE);
+ PlayMenuSoundStereo(sound_closing, SOUND_MIDDLE);
if (anim_mode != ANIM_NONE)
AnimateEnvelope(envelope_nr, main_anim_mode, ACTION_CLOSING);
{
/* opening door sound has priority over simultaneously closing door */
if (door_state & (DOOR_OPEN_1 | DOOR_OPEN_2))
- PlaySoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE);
+ PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE);
else if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2))
- PlaySoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE);
+ PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE);
}
for (k = start; k <= end && !(door_1_done && door_2_done); k += stepsize)
exit(0);
#endif
}
+
+void PlayMenuSound()
+{
+ int sound = menu.sound[game_status];
+
+ if (sound == SND_UNDEFINED)
+ return;
+
+ if ((!setup.sound_simple && !IS_LOOP_SOUND(sound)) ||
+ (!setup.sound_loops && IS_LOOP_SOUND(sound)))
+ return;
+
+ if (IS_LOOP_SOUND(sound))
+ PlaySoundLoop(sound);
+ else
+ PlaySound(sound);
+}
+
+void PlayMenuSoundStereo(int sound, int stereo_position)
+{
+ if (sound == SND_UNDEFINED)
+ return;
+
+ if ((!setup.sound_simple && !IS_LOOP_SOUND(sound)) ||
+ (!setup.sound_loops && IS_LOOP_SOUND(sound)))
+ return;
+
+ if (IS_LOOP_SOUND(sound))
+ PlaySoundExt(sound, SOUND_MAX_VOLUME, stereo_position, SND_CTRL_PLAY_LOOP);
+ else
+ PlaySoundStereo(sound, stereo_position);
+}
+
+void PlayMenuSoundIfLoop()
+{
+ int sound = menu.sound[game_status];
+
+ if (sound == SND_UNDEFINED)
+ return;
+
+ if ((!setup.sound_simple && !IS_LOOP_SOUND(sound)) ||
+ (!setup.sound_loops && IS_LOOP_SOUND(sound)))
+ return;
+
+ if (IS_LOOP_SOUND(sound))
+ PlaySoundLoop(sound);
+}
+
+void PlayMenuMusic()
+{
+ int music = menu.music[game_status];
+
+ if (music == MUS_UNDEFINED)
+ return;
+
+ PlayMusic(music);
+}
void FadeIn(int);
void FadeOut(int, int);
-void FadeCross(Bitmap *, int);
+void FadeCross(int);
void ClearWindow();
void SetMainBackgroundImageIfDefined(int);
unsigned int InitRND(long);
void InitGraphicInfo_EM(void);
+void PlayMenuSound();
+void PlayMenuSoundStereo(int, int);
+void PlayMenuSoundIfLoop();
+void PlayMenuMusic();
+
#endif /* TOOLS_H */