Skip to content

Commit

Permalink
Gracefully reset audio when resetting canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Desdaemon committed Dec 11, 2024
1 parent aa4b168 commit 5104594
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/platform/emscripten/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ bool Emscripten_Interface_Private::UploadFontStep2(std::string filename, int buf
}

bool Emscripten_Interface::ResetCanvas() {
DisplayUi->GetAudio().BGM_Stop();
DisplayUi->GetAudio().SE_Stop();
DisplayUi.reset();
DisplayUi = BaseUi::CreateUi(Player::screen_width, Player::screen_height, Player::ParseCommandLine());
return DisplayUi != nullptr;
Expand Down

0 comments on commit 5104594

Please sign in to comment.