From b63ed062d8345b2b506dc4f8fdb175f0db43dfa0 Mon Sep 17 00:00:00 2001 From: avolkov Date: Sun, 17 Apr 2005 17:35:39 +0000 Subject: [PATCH] Normalize music volume throughout (bug #718) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1638 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/comm.c | 7 ++++--- sc2/src/sc2code/gameopt.c | 2 +- sc2/src/sc2code/libs/sndlib.h | 1 + sc2/src/sc2code/libs/sound/sound.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sc2/src/sc2code/comm.c b/sc2/src/sc2code/comm.c index 1b910e07b..b2e601466 100644 --- a/sc2/src/sc2code/comm.c +++ b/sc2/src/sc2code/comm.c @@ -53,8 +53,9 @@ static BOOLEAN getLineWithinWidth(TEXT *pText, const unsigned char **startNext, SIZE maxWidth, COUNT maxChars); #define MAX_RESPONSES 8 -#define BACKGROUND_VOL speechVolumeScale == 0.0f ? MAX_VOLUME : (MAX_VOLUME >> 1) -#define FOREGROUND_VOL MAX_VOLUME +#define BACKGROUND_VOL \ + (speechVolumeScale == 0.0f ? NORMAL_VOLUME : (NORMAL_VOLUME >> 1)) +#define FOREGROUND_VOL NORMAL_VOLUME #define SLIDER_Y 107 #define SLIDER_HEIGHT 15 @@ -1913,7 +1914,7 @@ DoCommunication (PENCOUNTER_STATE pES) StopMusic (); StopSound (); StopTrack (); - SleepThreadUntil (FadeMusic (FOREGROUND_VOL, 0) + ONE_SECOND / 60); + SleepThreadUntil (FadeMusic (NORMAL_VOLUME, 0) + ONE_SECOND / 60); return (FALSE); } diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index c9121f234..1324bd5d8 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -1007,7 +1007,7 @@ DoPickGame (PMENU_STATE pMS) pMS->CurFrame = 0; PauseMusic (); StopSound (); - FadeMusic (128, 0); + FadeMusic (NORMAL_VOLUME, 0); { extern FRAME PlayFrame; diff --git a/sc2/src/sc2code/libs/sndlib.h b/sc2/src/sc2code/libs/sndlib.h index 852d5b137..8c4b1fd75 100644 --- a/sc2/src/sc2code/libs/sndlib.h +++ b/sc2/src/sc2code/libs/sndlib.h @@ -59,6 +59,7 @@ extern BOOLEAN DestroyMusic (MUSIC_REF MusicRef); #define MAX_CHANNELS 8 #define MAX_VOLUME 255 +#define NORMAL_VOLUME 160 #define FIRST_SFX_CHANNEL 0 #define MIN_FX_CHANNEL 1 diff --git a/sc2/src/sc2code/libs/sound/sound.c b/sc2/src/sc2code/libs/sound/sound.c index f772d9eb7..8d865f513 100644 --- a/sc2/src/sc2code/libs/sound/sound.c +++ b/sc2/src/sc2code/libs/sound/sound.c @@ -24,7 +24,7 @@ static Task FadeTask; static SIZE TTotal; static SIZE volume_end; -int musicVolume = (MAX_VOLUME >> 1); +int musicVolume = NORMAL_VOLUME; float musicVolumeScale; float sfxVolumeScale; float speechVolumeScale;