rnd-20020629-1-src
authorHolger Schemel <info@artsoft.org>
Sat, 29 Jun 2002 18:36:59 +0000 (20:36 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:37:59 +0000 (10:37 +0200)
src/game.c
src/libgame/sound.c
src/screens.c
src/timestamp.h

index f6956bc428fc091c9f73be2aa2e79ed503b29b8d..ea9bdb336d5e05ee60df278845e662a7561f239e 100644 (file)
@@ -140,6 +140,7 @@ static struct
   { ".burning",                SND_ACTION_BURNING,     TRUE },
   { ".growing",                SND_ACTION_UNKNOWN,     TRUE },
   { ".attacking",      SND_ACTION_UNKNOWN,     TRUE },
+  { ".activated",      SND_ACTION_UNKNOWN,     TRUE },
 
   /* other (non-loop) sound actions are optional */
   { ".stepping",       SND_ACTION_MOVING,      FALSE }, /* discrete moving */
@@ -4795,14 +4796,18 @@ void GameActions()
     else if (element == EL_SHIELD_PASSIVE)
     {
       DrawGraphicAnimation(x, y, GFX_SHIELD_PASSIVE, 6, 4, ANIM_NORMAL);
+#if 0
       if (!(FrameCounter % 4))
        PlaySoundLevel(x, y, SND_SHIELD_PASSIVE_ACTIVATED);
+#endif
     }
     else if (element == EL_SHIELD_ACTIVE)
     {
       DrawGraphicAnimation(x, y, GFX_SHIELD_ACTIVE, 6, 4, ANIM_NORMAL);
+#if 0
       if (!(FrameCounter % 4))
        PlaySoundLevel(x, y, SND_SHIELD_ACTIVE_ACTIVATED);
+#endif
     }
 
     if (game.magic_wall_active)
@@ -4966,6 +4971,19 @@ void GameActions()
       CloseAllOpenTimegates();
   }
 
+  for (i=0; i<MAX_PLAYERS; i++)
+  {
+    struct PlayerInfo *player = &stored_player[i];
+
+    if (SHIELD_ON(player))
+    {
+      if (player->shield_active_time_left)
+       PlaySoundLevel(player->jx, player->jy, SND_SHIELD_ACTIVE_ACTIVATED);
+      else if (player->shield_passive_time_left)
+       PlaySoundLevel(player->jx, player->jy, SND_SHIELD_PASSIVE_ACTIVATED);
+    }
+  }
+
   if (TimeFrames >= (1000 / GameFrameDelay))
   {
     TimeFrames = 0;
@@ -4973,12 +4991,14 @@ void GameActions()
 
     for (i=0; i<MAX_PLAYERS; i++)
     {
-      if (SHIELD_ON(&stored_player[i]))
+      struct PlayerInfo *player = &stored_player[i];
+
+      if (SHIELD_ON(player))
       {
-       stored_player[i].shield_passive_time_left--;
+       player->shield_passive_time_left--;
 
-       if (stored_player[i].shield_active_time_left > 0)
-         stored_player[i].shield_active_time_left--;
+       if (player->shield_active_time_left > 0)
+         player->shield_active_time_left--;
       }
     }
 
index ae4028d74589bd98e6d41f6eb32155f9d8263f71..68fe64b0af0fee35704dc8c7264825f011737ee2 100644 (file)
@@ -810,7 +810,12 @@ static void Mixer_InsertSound(SoundControl snd_ctrl)
 #endif
 
   if (IS_MUSIC(snd_ctrl))
+  {
+    if (num_music == 0)
+      return;
+
     snd_ctrl.nr = snd_ctrl.nr % num_music;
+  }
   else if (snd_ctrl.nr >= num_sounds)
     return;
 
index de9c097383a4626dd85ce693d189903dd4b81e0f..a09d3ec02c73c4fcb2535b3ed4855d5966034bc8 100644 (file)
@@ -837,8 +837,8 @@ void HandleHelpScreen(int button)
       for(i=0;i<MAX_HELPSCREEN_ELS;i++)
        helpscreen_step[i] = helpscreen_frame[i] = helpscreen_delay[i] = 0;
       helpscreen_state++;
-      DrawHelpScreenElText(helpscreen_state*MAX_HELPSCREEN_ELS);
-      DrawHelpScreenElAction(helpscreen_state*MAX_HELPSCREEN_ELS);
+      DrawHelpScreenElText(helpscreen_state * MAX_HELPSCREEN_ELS);
+      DrawHelpScreenElAction(helpscreen_state * MAX_HELPSCREEN_ELS);
     }
     else if (helpscreen_state <
             num_helpscreen_els_pages + num_helpscreen_music - 1)
@@ -869,9 +869,15 @@ void HandleHelpScreen(int button)
   {
     if (DelayReached(&hs_delay,GAME_FRAME_DELAY * 2))
     {
-      if (helpscreen_state<num_helpscreen_els_pages)
+      if (helpscreen_state < num_helpscreen_els_pages)
        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 !!! */
+    PlaySoundLoop(SND_MENU_INFO_SCREEN);
+
     DoAnimation();
   }
 
index 1c0e46dea77f3674afd55e48c06f84e8755f4c0e..31ddd1ca48b5e85081244f0d200f20feb4f90057 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2002-06-11 01:11]"
+#define COMPILE_DATE_STRING "[2002-06-29 20:35]"