I_SetInternalMusicVolume implementation

This commit is contained in:
mazmazz 2018-08-19 09:38:57 -04:00
parent 51228b328c
commit d5dfde240d
4 changed files with 16 additions and 0 deletions

View file

@ -247,6 +247,8 @@ UINT32 I_GetMusicPosition(void);
boolean I_SetSongTrack(INT32 track);
void I_SetInternalMusicVolume(UINT8 volume);
/** \brief The I_StartDigSong function
\param musicname music lump name

View file

@ -1476,6 +1476,11 @@ void S_StopMusic(void)
}
}
void S_SetInternalMusicVolume(INT32 volume)
{
I_SetInternalMusicVolume(min(max(volume, 0), 100));
}
void S_SetDigMusicVolume(INT32 volume)
{
if (volume < 0 || volume > 31)

View file

@ -180,6 +180,7 @@ void S_UpdateSounds(void);
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
void S_SetInternalMusicVolume(INT32 volume);
void S_SetDigMusicVolume(INT32 volume);
void S_SetMIDIMusicVolume(INT32 volume);
void S_SetSfxVolume(INT32 volume);

View file

@ -1160,6 +1160,14 @@ boolean I_SetSongTrack(int track)
return false;
}
void I_SetInternalMusicVolume(UINT8 volume)
{
internal_volume = volume;
if (!music)
return;
Mix_VolumeMusic(get_real_volume(midimode ? midi_volume : music_volume));
}
void I_StopFadingMusic()
{
if (fading_id)