MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getVolumeForSoundId

Function getVolumeForSoundId

src/OpenLoco/src/Audio/Audio.cpp:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390 } };
391
392 static int32_t getVolumeForSoundId(SoundId id)
393 {
394 if (isObjectSoundId(id))
395 {
396 auto obj = getSoundObject(id);
397 if (obj != nullptr)
398 {
399 return obj->volume;
400 }
401 return 0;
402 }
403 else
404 {
405 return kSoundVolumeTable[static_cast<int32_t>(id)];
406 }
407 }
408
409 static int32_t calculateVolumeFromViewport([[maybe_unused]] SoundId id, const World::Pos3& mpos, const Viewport& viewport)
410 {

Callers 1

playSoundFunction · 0.85

Calls 2

isObjectSoundIdFunction · 0.85
getSoundObjectFunction · 0.85

Tested by

no test coverage detected