Skip to content

Commit 3da3586

Browse files
committed
fix story music not playing
Signed-off-by: SheridanR <[email protected]>
1 parent 6c819fd commit 3da3586

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/engine/audio/defines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ FMOD::Sound* caveslairmusic = nullptr;
5353
FMOD::Sound* bramscastlemusic = nullptr;
5454
FMOD::Sound* hamletmusic = nullptr;
5555
FMOD::Sound* tutorialmusic = nullptr;
56-
FMOD::Sound* introstorymusic = nullptr;
5756
FMOD::Sound* gameovermusic = nullptr;
57+
FMOD::Sound* introstorymusic = nullptr;
5858
bool levelmusicplaying = false;
5959

6060
FMOD::Channel* music_channel = nullptr;

src/engine/audio/sound.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ OPENAL_BUFFER* caveslairmusic = NULL;
537537
OPENAL_BUFFER* bramscastlemusic = NULL;
538538
OPENAL_BUFFER* hamletmusic = NULL;
539539
OPENAL_BUFFER* tutorialmusic = nullptr;
540-
OPENAL_BUFFER* introstorymusic = nullptr;
541540
OPENAL_BUFFER* gameovermusic = nullptr;
541+
OPENAL_BUFFER* introstorymusic = nullptr;
542542
bool levelmusicplaying = false;
543543

544544
OPENAL_SOUND* music_channel = nullptr;
@@ -1160,6 +1160,7 @@ bool physfsSearchMusicToUpdate()
11601160
themeMusic.push_back("music/hamlet.ogg");
11611161
themeMusic.push_back("music/tutorial.ogg");
11621162
themeMusic.push_back("sound/Death.ogg");
1163+
themeMusic.push_back("sound/ui/StoryMusicV3.ogg");
11631164

11641165
for ( std::vector<std::string>::iterator it = themeMusic.begin(); it != themeMusic.end(); ++it )
11651166
{
@@ -1281,6 +1282,7 @@ void physfsReloadMusic(bool &introMusicChanged, bool reloadAll) //TODO: This sho
12811282
themeMusic.push_back("music/hamlet.ogg");
12821283
themeMusic.push_back("music/tutorial.ogg");
12831284
themeMusic.push_back("sound/Death.ogg");
1285+
themeMusic.push_back("sound/ui/StoryMusicV3.ogg");
12841286

12851287
int index = 0;
12861288
#ifdef USE_OPENAL
@@ -1583,6 +1585,20 @@ void physfsReloadMusic(bool &introMusicChanged, bool reloadAll) //TODO: This sho
15831585
fmod_result = fmod_system->createStream(musicDir.c_str(), FMOD_DEFAULT, nullptr, &gameovermusic);
15841586
}
15851587
break;
1588+
case 20:
1589+
if ( introstorymusic )
1590+
{
1591+
introstorymusic->release();
1592+
}
1593+
if ( musicPreload )
1594+
{
1595+
fmod_result = fmod_system->createSound(musicDir.c_str(), FMOD_DEFAULT, nullptr, &introstorymusic);
1596+
}
1597+
else
1598+
{
1599+
fmod_result = fmod_system->createStream(musicDir.c_str(), FMOD_DEFAULT, nullptr, &introstorymusic);
1600+
}
1601+
break;
15861602
default:
15871603
break;
15881604
}

src/init_game.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ void deinitGame()
558558
bramscastlemusic->release();
559559
hamletmusic->release();
560560
tutorialmusic->release();
561-
introstorymusic->release();
562561
gameovermusic->release();
562+
introstorymusic->release();
563563

564564
for ( int c = 0; c < NUMMINESMUSIC; c++ )
565565
{

0 commit comments

Comments
 (0)