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

Function xSFXPlay

src/SB/Core/x/xSFX.cpp:232–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static void xSFXPlay(xSFX* t)
233{
234 st_PKR_ASSET_TOCINFO ainfo;
235 U32 converted_flags = xSFXConvertFlags(t->asset->flagsSFX);
236
237 if (t->asset->flagsSFX & 0x2)
238 {
239 if (t->asset->flagsSFX & 0x8)
240 {
241 if (xSTGetAssetInfo(t->asset->attachID, &ainfo) == 0)
242 {
243 return;
244 }
245
246 if (ainfo.typeref->typetag == 'MRKR')
247 {
248 t->sndID = xSndPlay3D(t->asset->soundAssetID, 0.77f * ((F32)t->asset->volume / 100.0f),
249 t->asset->freq * t->asset->freqm, (U32)t->asset->priority, converted_flags,
250 (const xVec3*)ainfo.mempos, t->asset->innerRadius,
251 t->asset->outerRadius, SND_CAT_GAME, 0.0f);
252 }
253 else
254 {
255 xEnt* attach = (xEnt*)zSceneFindObject(t->asset->attachID);
256 if (!attach)
257 {
258 xSTAssetName(t->id);
259 xSTAssetName(t->asset->attachID);
260 }
261 else if (attach->model != NULL)
262 {
263 t->sndID = xSndPlay3D(t->asset->soundAssetID, 0.77f * ((F32)t->asset->volume / 100.0f),
264 t->asset->freq * t->asset->freqm, (U32)t->asset->priority, converted_flags,
265 attach, t->asset->innerRadius,
266 t->asset->outerRadius, SND_CAT_GAME, 0.0f);
267 }
268 else
269 {
270 t->sndID = xSndPlay3D(t->asset->soundAssetID, 0.77f * ((F32)t->asset->volume / 100.0f),
271 t->asset->freq * t->asset->freqm, (U32)t->asset->priority, converted_flags,
272 (const xVec3*)&t->asset->pos, t->asset->innerRadius,
273 t->asset->outerRadius, SND_CAT_GAME, 0.0f);
274 return;
275 }
276 }
277 }
278 else
279 {
280 t->sndID = xSndPlay3D(t->asset->soundAssetID, 0.77f * ((F32)t->asset->volume / 100.0f),
281 t->asset->freq * t->asset->freqm, (U32)t->asset->priority, converted_flags,
282 (const xVec3*)&t->asset->pos, t->asset->innerRadius,
283 t->asset->outerRadius, SND_CAT_GAME, 0.0f);
284 }
285 }
286 else
287 {
288 t->sndID =
289 xSndPlay(t->asset->soundAssetID, 0.77f * (t->asset->volume / 100.0f), t->asset->freq * t->asset->freqm,

Callers 2

xSFXEventCBFunction · 0.70

Calls 7

xSFXConvertFlagsFunction · 0.85
zSceneFindObjectFunction · 0.85
xSTGetAssetInfoFunction · 0.70
xSndPlay3DFunction · 0.70
xSTAssetNameFunction · 0.70
xSndPlayFunction · 0.70

Tested by

no test coverage detected