MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSndInternalUpdateVoicePos

Function xSndInternalUpdateVoicePos

src/SB/Core/x/xSnd.cpp:201–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void xSndProcessSoundPos(const xVec3* pActual, xVec3* pProcessed) {
202 xVec3 playerDelta;
203 xVec3 temp_f;
204
205 F32 factor;
206 F32 inwardShift;
207
208 switch ((S32) gSnd.pos.x) {
209 case 0:
210 temp_f -= *pActual;
211 temp_f += temp_f;
212 playerDelta -= *pActual;
213 playerDelta += playerDelta;
214 factor = xVec3Length(&temp_f);
215 inwardShift = xVec3Length(&playerDelta);
216 if (inwardShift < factor) {
217 temp_f *= (factor - ((factor - inwardShift) * 0.5f)) / factor;
218 *pProcessed += temp_f;
219 *pProcessed += *pProcessed;
220 return;
221 }
222 *pProcessed += *pActual;
223 return;
224 case 1:
225 *pProcessed += *pActual;
226 return;
227 }
228}
229
230void xSndInternalUpdateVoicePos(xSndVoiceInfo* pVoice)
231{
232 if ((pVoice->flags & 1) && (pVoice->flags & 8))
233 {
234 if (pVoice->flags & 0x10)
235 {
236 if (pVoice->parentPos != NULL)
237 {

Callers 1

iSndVolUpdateFunction · 0.50

Calls 3

xVec3CopyFunction · 0.85
xEntGetPosFunction · 0.85
xSndProcessSoundPosFunction · 0.85

Tested by

no test coverage detected