diff --git a/include/config/config_debug.h b/include/config/config_debug.h index 7ed67cac9..e64c86b78 100644 --- a/include/config/config_debug.h +++ b/include/config/config_debug.h @@ -75,6 +75,12 @@ */ // #define COMPLETE_SAVE_FILE +/** + * Mute all level and secondary music. Useful for still being able to listen to game sound effects + * during development without being subject to the same old music over and over and over and over... + */ +// #define MUTE_MUSIC_PLAYERS + /** * Removes the limit on FPS. */ diff --git a/include/config/config_safeguards.h b/include/config/config_safeguards.h index cf64afa8f..9441b2166 100644 --- a/include/config/config_safeguards.h +++ b/include/config/config_safeguards.h @@ -65,6 +65,7 @@ #undef VISUAL_DEBUG #undef UNLOCK_ALL #undef COMPLETE_SAVE_FILE + #undef MUTE_MUSIC_PLAYERS #undef UNLOCK_FPS #undef VANILLA_DEBUG #undef DEBUG_FORCE_CRASH_ON_BOOT diff --git a/src/audio/effects.c b/src/audio/effects.c index 4fd6dc15f..5dae03532 100644 --- a/src/audio/effects.c +++ b/src/audio/effects.c @@ -66,10 +66,21 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) { if (!hasProcessedChannel) { hasProcessedChannel = TRUE; +#ifdef MUTE_MUSIC_PLAYERS + if (seqChannel->seqPlayer == &gSequencePlayers[SEQ_PLAYER_SFX]) { + channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume; + if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) { + channelVolume *= seqChannel->seqPlayer->muteVolumeScale; + } + } else { + channelVolume = 0; + } +#else channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume; if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) { channelVolume *= seqChannel->seqPlayer->muteVolumeScale; } +#endif panFromChannel = seqChannel->pan * seqChannel->panChannelWeight; panLayerWeight = 1.0f - seqChannel->panChannelWeight;