From d0b3cfa08c141957b95cd19e11f949cd4c53b535 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 10 Oct 2020 23:36:18 -0700 Subject: [PATCH] Don't hardcode MIX_MAX_VOLUME value of 128 The value of the macro might not change in the future, but it's there for a reason. That reason being to improve code readability, because otherwise 128 would just be a magic number that plopped in out of nowhere. Sometimes the game uses MIX_MAX_VOLUME, other times it uses 128, so to be consistent I'm just going to enforce MIX_MAX_VOLUME entirely. --- desktop_version/src/Music.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 8f41a9b3..61d6712a 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -132,7 +132,7 @@ void musicclass::init() safeToProcessMusic= false; m_doFadeInVol = false; - musicVolume = 128; + musicVolume = MIX_MAX_VOLUME; FadeVolAmountPerFrame = 0; currentsong = 0; @@ -177,7 +177,7 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade t += num_mmmmmm_tracks; } safeToProcessMusic = true; - Mix_VolumeMusic(128); + Mix_VolumeMusic(MIX_MAX_VOLUME); if (currentsong !=t) { if (t != -1)