From 077ee3fdd3632045b35984a998b9efecc437beb6 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 29 Jun 2002 20:36:59 +0200 Subject: [PATCH] rnd-20020629-1-src --- src/game.c | 28 ++++++++++++++++++++++++---- src/libgame/sound.c | 5 +++++ src/screens.c | 12 +++++++++--- src/timestamp.h | 2 +- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/game.c b/src/game.c index f6956bc4..ea9bdb33 100644 --- a/src/game.c +++ b/src/game.c @@ -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; ishield_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; ishield_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--; } } diff --git a/src/libgame/sound.c b/src/libgame/sound.c index ae4028d7..68fe64b0 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -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; diff --git a/src/screens.c b/src/screens.c index de9c0973..a09d3ec0 100644 --- a/src/screens.c +++ b/src/screens.c @@ -837,8 +837,8 @@ void HandleHelpScreen(int button) for(i=0;i