From 514b240348a7c401fa6725ae74540d5f3ee29cfb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 19 Mar 2022 21:07:50 -0400 Subject: added fade in to new game and fixed music on new game --- src/muxer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/muxer.cpp') diff --git a/src/muxer.cpp b/src/muxer.cpp index c93c45a..6ae6936 100644 --- a/src/muxer.cpp +++ b/src/muxer.cpp @@ -26,11 +26,6 @@ Muxer::Muxer() { FMOD::Studio::Bank* stringsBank = nullptr; ERRCHECK(system_->loadBankFile("../res/fmod/Build/Desktop/Master Bank.strings.bank", FMOD_STUDIO_LOAD_BANK_NORMAL, &stringsBank)); - - FMOD::Studio::EventDescription* exploration_desc = nullptr; - ERRCHECK(system_->getEvent("event:/exploration", &exploration_desc)); - ERRCHECK(exploration_desc->createInstance(&exploration_event_)); - ERRCHECK(exploration_event_->start()); } void Muxer::setPlayerLoc(int x, int y) { @@ -96,6 +91,15 @@ void Muxer::setMusicLevel(int level) { } } +void Muxer::startMusic() { + FMOD::Studio::EventDescription* exploration_desc = nullptr; + ERRCHECK(system_->getEvent("event:/exploration", &exploration_desc)); + ERRCHECK(exploration_desc->createInstance(&exploration_event_)); + ERRCHECK(exploration_event_->start()); + + transition_state_ = TransitionState::Pre; +} + void Muxer::stopMusic() { switch (transition_state_) { case TransitionState::Pre: { -- cgit 1.4.1