rnd-20070320-1-src
[rocksndiamonds.git] / src / tools.c
index bf4e262bfc9d4fa8aad1ac12dea5d04175e06260..c1509c1d09d81bd4a49a3a7a6a09432a49e125a6 100644 (file)
@@ -242,8 +242,7 @@ void DrawMaskedBorder_ALL()
 void DrawMaskedBorder(int redraw_mask)
 {
   /* do not draw masked screen borders when displaying title screens */
-  if (effectiveGameStatus() == GAME_MODE_TITLE ||
-      effectiveGameStatus() == GAME_MODE_MESSAGE)
+  if (effectiveGameStatus() == GAME_MODE_TITLE)
     return;
 
   if (redraw_mask & REDRAW_ALL)
@@ -546,8 +545,8 @@ void FadeExt(int fade_mask, int fade_mode)
     width  = WIN_XSIZE;
     height = WIN_YSIZE;
 
-    fade_delay = title.fade_delay_final;
-    post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay_final : 0);
+    fade_delay = title.fade_delay;
+    post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay : 0);
   }
 
   redraw_mask |= fade_mask;
@@ -1766,7 +1765,7 @@ static void DrawPreviewLevelExt(int from_x, int from_y)
   int real_preview_xsize = MIN(level_xsize, preview.xsize);
   int real_preview_ysize = MIN(level_ysize, preview.ysize);
   int dst_x = SX + ALIGNED_XPOS(preview.x, preview_width, preview.align);
-  int dst_y = SY + preview.y;
+  int dst_y = SY + ALIGNED_YPOS(preview.y, preview_height, preview.valign);
   int x, y;
 
   DrawBackground(dst_x, dst_y, preview_width, preview_height);
@@ -1838,10 +1837,6 @@ static void DrawPreviewLevelLabelExt(int mode)
     font_nr = FONT_TEXT_3;
 #endif
 
-#if 0
-  printf("??? %d, %d\n", game_status, font_nr);
-#endif
-
 #if 1
   max_len_label_text = getMaxTextLength(pos, font_nr);
 #else
@@ -1908,12 +1903,8 @@ void DrawPreviewLevel(boolean restart)
   int last_game_status = game_status;          /* save current game status */
 
 #if 0
-#if 1
-  game_status = GAME_MODE_MAIN;
-#else
   /* force PREVIEW font on preview level */
   game_status = GAME_MODE_PSEUDO_PREVIEW;
-#endif
 #endif
 
   if (restart)
@@ -2634,7 +2625,7 @@ boolean Request(char *text, unsigned int req_state)
   /* clear door drawing field */
   DrawBackground(DX, DY, DXSIZE, DYSIZE);
 
-  /* force DOOR font on preview level */
+  /* force DOOR font inside door area */
   game_status = GAME_MODE_PSEUDO_DOOR;
 
   /* write text for request */
@@ -6454,10 +6445,8 @@ void InitGraphicInfo_EM(void)
 #endif
 }
 
-void PlayMenuSound()
+void PlayMenuSoundExt(int sound)
 {
-  int sound = menu.sound[game_status];
-
   if (sound == SND_UNDEFINED)
     return;
 
@@ -6471,6 +6460,11 @@ void PlayMenuSound()
     PlaySound(sound);
 }
 
+void PlayMenuSound()
+{
+  PlayMenuSoundExt(menu.sound[game_status]);
+}
+
 void PlayMenuSoundStereo(int sound, int stereo_position)
 {
   if (sound == SND_UNDEFINED)
@@ -6486,10 +6480,8 @@ void PlayMenuSoundStereo(int sound, int stereo_position)
     PlaySoundStereo(sound, stereo_position);
 }
 
-void PlayMenuSoundIfLoop()
+void PlayMenuSoundIfLoopExt(int sound)
 {
-  int sound = menu.sound[game_status];
-
   if (sound == SND_UNDEFINED)
     return;
 
@@ -6501,10 +6493,13 @@ void PlayMenuSoundIfLoop()
     PlaySoundLoop(sound);
 }
 
-void PlayMenuMusic()
+void PlayMenuSoundIfLoop()
 {
-  int music = menu.music[game_status];
+  PlayMenuSoundIfLoopExt(menu.sound[game_status]);
+}
 
+void PlayMenuMusicExt(int music)
+{
   if (music == MUS_UNDEFINED)
     return;
 
@@ -6514,6 +6509,11 @@ void PlayMenuMusic()
   PlayMusic(music);
 }
 
+void PlayMenuMusic()
+{
+  PlayMenuMusicExt(menu.music[game_status]);
+}
+
 void PlaySoundActivating()
 {
 #if 0