mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-05 00:19:44 +01:00
Move the mute logic to musicclass.
This moves the last of the SDL_mixer calls to Music.cpp.
This commit is contained in:
parent
579f0f763a
commit
1eda3647ff
3 changed files with 24 additions and 18 deletions
|
@ -620,3 +620,25 @@ bool musicclass::halted(void)
|
|||
{
|
||||
return Mix_PausedMusic() == 1;
|
||||
}
|
||||
|
||||
void musicclass::updatemutestate(void)
|
||||
{
|
||||
if (game.muted)
|
||||
{
|
||||
Mix_VolumeMusic(0);
|
||||
Mix_Volume(-1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mix_Volume(-1, MIX_MAX_VOLUME * user_sound_volume / USER_VOLUME_MAX);
|
||||
|
||||
if (game.musicmuted)
|
||||
{
|
||||
Mix_VolumeMusic(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mix_VolumeMusic(musicVolume * user_music_volume / USER_VOLUME_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
void resumeef(void);
|
||||
|
||||
bool halted(void);
|
||||
void updatemutestate(void);
|
||||
|
||||
std::vector<SoundTrack> soundTracks;
|
||||
std::vector<MusicTrack> musicTracks;
|
||||
|
|
|
@ -855,24 +855,7 @@ static enum LoopCode loop_end(void)
|
|||
game.musicmutebutton--;
|
||||
}
|
||||
|
||||
if (game.muted)
|
||||
{
|
||||
Mix_VolumeMusic(0) ;
|
||||
Mix_Volume(-1,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mix_Volume(-1,MIX_MAX_VOLUME * music.user_sound_volume / USER_VOLUME_MAX);
|
||||
|
||||
if (game.musicmuted)
|
||||
{
|
||||
Mix_VolumeMusic(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mix_VolumeMusic(music.musicVolume * music.user_music_volume / USER_VOLUME_MAX);
|
||||
}
|
||||
}
|
||||
music.updatemutestate();
|
||||
|
||||
if (key.resetWindow)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue