jak-project/game/sound/989snd/sfxblock.cpp
water111 e81431bd21
Some checks are pending
Build / 🖥️ Windows (push) Waiting to run
Build / 🐧 Linux (push) Waiting to run
Build / 🍎 MacOS (push) Waiting to run
Inform Pages Repo / Generate Documentation (push) Waiting to run
Lint / 📝 Required Checks (push) Waiting to run
Lint / 📝 Optional Checks (push) Waiting to run
Lint / 📝 Formatting (push) Waiting to run
[wip] Jak 3 Overlord (#3567)
2024-07-26 09:42:28 -04:00

35 lines
948 B
C++

#include "sfxblock.h"
#include "blocksound_handler.h"
#include "sfxgrain.h"
#include "common/log/log.h"
namespace snd {
std::optional<std::unique_ptr<SoundHandler>> SFXBlock::MakeHandler(VoiceManager& vm,
u32 sound_id,
s32 vol,
s32 pan,
SndPlayParams& params) {
auto& SFX = Sounds[sound_id];
if (SFX.Grains.empty()) {
return std::nullopt;
}
auto handler = std::make_unique<BlockSoundHandler>(*this, SFX, vm, vol, pan, params, sound_id);
return handler;
}
std::optional<u32> SFXBlock::GetSoundByName(const char* name) {
auto sound = Names.find(name);
if (sound != Names.end()) {
return sound->second;
}
return std::nullopt;
}
} // namespace snd