Start and stop some sounds and add a little bit of reverb to sounds so they fit the 'dungeon' theme.

This commit is contained in:
Zed A. Shaw 2025-02-28 10:48:45 -05:00
parent a8ae6df13b
commit 25d782df6d
18 changed files with 20 additions and 2 deletions

View file

@ -53,6 +53,19 @@ namespace sound {
}
}
void stop(const std::string name) {
dbc::check(initialized, "You need to call sound::init() first");
if(SMGR.sounds.contains(name)) {
// get the sound from the sound map
auto pair = SMGR.sounds.at(name);
pair.sound->stop();
} else {
dbc::log(fmt::format("Attempted to stop {} sound but not available.",
name));
}
}
void play_at(const std::string name, float x, float y, float z) {
dbc::check(initialized, "You need to call sound::init() first");
if(SMGR.sounds.contains(name)) {