More boss fight UI done and a bit of ambient sound working.

This commit is contained in:
Zed A. Shaw 2025-02-28 00:52:48 -05:00
parent 64807174c0
commit a0c0308461
12 changed files with 111 additions and 58 deletions

View file

@ -37,13 +37,14 @@ namespace sound {
SMGR.sounds.try_emplace(name, buffer, sound);
}
void play(const std::string name) {
void play(const std::string name, bool loop) {
dbc::check(initialized, "You need to call sound::init() first");
if(muted) return;
if(SMGR.sounds.contains(name)) {
// get the sound from the sound map
auto pair = SMGR.sounds.at(name);
pair.sound->setLooping(loop);
// play it
pair.sound->play();
} else {