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

Function D3MusicSetVolume

Descent3/d3music.cpp:174–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172float D3MusicGetVolume() { return Music_volume; }
173
174void D3MusicSetVolume(float vol) {
175 const float kEpsilon = std::numeric_limits<float>::min();
176 if (vol <= kEpsilon) {
177 Music_seq.Stop();
178 MusicAI.was_toggled_on = false;
179 Music_on = false;
180 } else if (Music_volume <= kEpsilon) {
181 Music_on = true;
182 MusicAI.was_toggled_on = true;
183 if (MusicAI.pending_region == -1) {
184 MusicAI.pending_region = D3MusicGetRegion();
185 }
186 Music_seq.Start();
187 }
188 Music_seq.SetVolume(vol);
189 Music_volume = vol;
190}
191
192// New Interface
193// Sequencing within level.

Callers 3

LoadGameSettingsFunction · 0.85
finishMethod · 0.85
processMethod · 0.85

Calls 4

D3MusicGetRegionFunction · 0.85
StopMethod · 0.45
StartMethod · 0.45
SetVolumeMethod · 0.45

Tested by

no test coverage detected