MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Find2DWaveOffsetSeconds

Method Find2DWaveOffsetSeconds

engine/Poseidon/Audio/SoundScene.cpp:488–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488float SoundScene::Find2DWaveOffsetSeconds(const char* nameSubstring) const
489{
490 if (!nameSubstring || !*nameSubstring)
491 return -1.f;
492 for (int i = 0; i < _all2DSounds.Size(); i++)
493 {
494 IWave* wave = _all2DSounds[i];
495 if (!wave)
496 continue;
497 // Case-insensitive substring match (DX8/OpenAL names are stored lowercased).
498 const char* haystack = (const char*)wave->Name();
499 if (!haystack)
500 continue;
501 if (strstr(haystack, nameSubstring) != nullptr)
502 return wave->GetCurrentOffsetSeconds();
503 }
504 return -1.f;
505}
506
507IWave* SoundScene::OpenAndPlayOnce2D(const char* filename, float volume, float frequency, bool accomodate)
508{

Callers 1

TriRadioWaveOffsetFunction · 0.80

Calls 3

SizeMethod · 0.45
NameMethod · 0.45

Tested by 1

TriRadioWaveOffsetFunction · 0.64