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

Function UpdateVoices

Descent3/voice.cpp:196–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196void UpdateVoices(void) {
197 char filename[_MAX_PATH];
198 int flags;
199
200 if (!CurrentVoiceHandle.inuse) {
201 // see if we have something waiting
202 if (vq.GetNextVoice(filename, &flags)) {
203 mprintf(0, "Playing queued voice %s\n", filename);
204 StartVoice(filename, flags);
205 return;
206 }
207 return;
208 }
209
210 // according to the handle, the current voice is inuse, lets make sure
211 if (Sound_system.IsSoundPlaying(CurrentVoiceHandle.handle))
212 return; // it is
213
214 // it isn't, so stop it and play the next voice in the queue if any
215 StopVoice();
216 if (vq.GetNextVoice(filename, &flags)) {
217 mprintf(0, "Playing queued voice %s\n", filename);
218 StartVoice(filename, flags);
219 }
220}
221
222//////////////////////
223// Voice Queue Implementation

Callers 1

GameFrameFunction · 0.85

Calls 4

StartVoiceFunction · 0.85
StopVoiceFunction · 0.85
GetNextVoiceMethod · 0.80
IsSoundPlayingMethod · 0.45

Tested by

no test coverage detected