diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-09 08:22:44 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-12-09 08:22:44 -0500 |
commit | 04481c298a5df5dd0327d64284db9ed80bf619e4 (patch) | |
tree | 5313fd693846a8d7e922dca9d6f4c742c2a9ae21 | |
parent | 380137ca06c2c74806c1838cb10ef3a17dda8406 (diff) |
music fading
-rw-r--r-- | include/ui.h | 2 | ||||
-rw-r--r-- | src/gameplay.cpp | 1 | ||||
-rw-r--r-- | src/ui.cpp | 5 | ||||
-rw-r--r-- | src/world.cpp | 6 |
4 files changed, 10 insertions, 4 deletions
diff --git a/include/ui.h b/include/ui.h index a5a2ec0..97e4bbf 100644 --- a/include/ui.h +++ b/include/ui.h @@ -27,7 +27,7 @@ namespace ui { extern unsigned int fontSize; extern bool dialogBoxExists; extern unsigned char dialogOptChosen; - extern bool edown; + extern bool dialogImportant; /* * Initializes the FreeType system. diff --git a/src/gameplay.cpp b/src/gameplay.cpp index f665b38..07f5572 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -52,6 +52,7 @@ void CUTSCENEEE2(Mob *callee){ void story(Mob *callee){ player->vel.x = 0; + Mix_FadeOutMusic(0); ui::importantText("It was a dark and stormy night..."); ui::waitForDialog(); ui::importantText("...and Clyne wanted to hear what the click track sounds like."); @@ -50,8 +50,6 @@ static float dialogOptLoc[4][3]; static unsigned char dialogOptCount = 0; static bool typeOutDone = true; -static bool dialogImportant = false; - Mix_Chunk *dialogClick; extern void mainLoop(void); @@ -91,7 +89,8 @@ namespace ui { * Dialog stuff that needs to be 'public'. */ - bool dialogBoxExists=false; + bool dialogBoxExists = false; + bool dialogImportant = false; unsigned char dialogOptChosen = 0; /* diff --git a/src/world.cpp b/src/world.cpp index cb5f3ec..2fd3591 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -285,6 +285,12 @@ void World::update(Player *p,unsigned int delta){ else if(e->vel.x > 0)e->left = false; } } + + if(ui::dialogImportant){ + Mix_FadeOutMusic(2000); + }else if(!Mix_PlayingMusic()){ + Mix_FadeInMusic(bgmObj,-1,2000); + } } void World::setBGM(const char *path){ |