Skip to content

Commit 3c50948

Browse files
committed
fix volume handling during intro sequence
1 parent aba4f19 commit 3c50948

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Menu/IntroState.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ namespace OpenXcom
4040
*/
4141
IntroState::IntroState(Game *game, bool wasLetterBoxed) : State(game), _wasLetterBoxed(wasLetterBoxed)
4242
{
43-
_game->setVolume(Options::soundVolume, Options::soundVolume/2, -1);
43+
_oldVolume = Options::musicVolume;
44+
Options::musicVolume = Options::soundVolume;
45+
_game->setVolume(Options::soundVolume, Options::musicVolume, -1);
4446
_introFile = CrossPlatform::getDataFile("UFOINTRO/UFOINT.FLI");
4547
_introSoundFileDOS = CrossPlatform::getDataFile("SOUND/INTRO.CAT");
4648
_introSoundFileWin = CrossPlatform::getDataFile("SOUND/SAMPLE3.CAT");
@@ -443,7 +445,7 @@ void IntroState::init()
443445
}
444446
_game->getScreen()->clear();
445447
_game->getScreen()->flip();
446-
448+
Options::musicVolume = _oldVolume;
447449
_game->setVolume(Options::soundVolume, Options::musicVolume, Options::uiVolume);
448450

449451
#ifndef __NO_MUSIC

src/Menu/IntroState.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class IntroState : public State
3232
private:
3333
std::string _introFile, _introSoundFileDOS, _introSoundFileWin;
3434
bool _wasLetterBoxed;
35+
int _oldVolume;
3536
public:
3637
/// Creates the Intro state.
3738
IntroState(Game *game, bool wasLetterBoxed);

0 commit comments

Comments
 (0)