MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SetMasterVolume

Method SetMasterVolume

sndlib/hlsoundlib.cpp:1379–1396  ·  view source on GitHub ↗

Sets the master volume

Source from the content-addressed store, hash-verified

1377}
1378// Sets the master volume
1379void hlsSystem::SetMasterVolume(float volume) {
1380 extern void StreamVolume(float master_volume);
1381 ASSERT(volume >= 0.0 && volume <= 1.0);
1382
1383 if (volume == 0) {
1384 StopAllSounds();
1385 CloseVoices();
1386 KillSoundLib(true);
1387 m_master_volume = 0;
1388 } else {
1389 if (m_master_volume == 0) {
1390 InitSoundLib(Descent, Sound_mixer, Sound_quality, false);
1391 InitVoices();
1392 }
1393 }
1394 m_master_volume = volume;
1395 StreamVolume(m_master_volume);
1396}
1397
1398// Gets the master volume
1399float hlsSystem::GetMasterVolume(void) { return m_master_volume; }

Callers 3

LoadGameSettingsFunction · 0.80
finishMethod · 0.80
processMethod · 0.80

Calls 3

CloseVoicesFunction · 0.85
InitVoicesFunction · 0.85
StreamVolumeFunction · 0.85

Tested by

no test coverage detected