X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftools.c;h=b07e19d37ee75fd9b92f6835d43513a67fa55f74;hp=794174c1d1ccbe0ccf34b87a474b9fb59d596c4e;hb=8d71e6fb8309bd90ce5f2900d84c686b17950492;hpb=67b32ebb347487d2d3a9d926ad8d1c4ed3d9aec6 diff --git a/src/tools.c b/src/tools.c index 794174c1..b07e19d3 100644 --- a/src/tools.c +++ b/src/tools.c @@ -8398,7 +8398,37 @@ void PlayMenuMusicExt(int music) void PlayMenuMusic() { - PlayMenuMusicExt(menu.music[game_status]); + char *curr_music = getCurrentlyPlayingMusicFilename(); + char *next_music = getMusicListEntry(menu.music[game_status])->filename; + + if (!strEqual(curr_music, next_music)) + PlayMenuMusicExt(menu.music[game_status]); +} + +void PlayMenuSoundsAndMusic() +{ + PlayMenuSound(); + PlayMenuMusic(); +} + +static void FadeMenuSounds() +{ + FadeSounds(); +} + +static void FadeMenuMusic() +{ + char *curr_music = getCurrentlyPlayingMusicFilename(); + char *next_music = getMusicListEntry(menu.music[game_status])->filename; + + if (!strEqual(curr_music, next_music)) + FadeMusic(); +} + +void FadeMenuSoundsAndMusic() +{ + FadeMenuSounds(); + FadeMenuMusic(); } void PlaySoundActivating() @@ -8507,6 +8537,9 @@ void SetAnimStatus(int anim_status_new) void SetGameStatus(int game_status_new) { + if (game_status_new != game_status) + game_status_last_screen = game_status; + game_status = game_status_new; SetAnimStatus(game_status_new);