ENGINES: Initialize mixer volume levels to levels from config so engine isn't required to call syncSoundSettings at startup.

This commit is contained in:
elasota 2023-04-02 10:48:59 -04:00 committed by Eugene Sandulenko
parent bd23058120
commit 5b48ceb68a
2 changed files with 12 additions and 0 deletions

View File

@ -178,6 +178,8 @@ Engine::Engine(OSystem *syst)
// Note: Using this dummy palette will actually disable cursor
// palettes till the user enables it again.
CursorMan.pushCursorPalette(NULL, 0, 0);
defaultSyncSoundSettings();
}
Engine::~Engine() {
@ -793,6 +795,10 @@ void Engine::setGameToLoadSlot(int slot) {
}
void Engine::syncSoundSettings() {
defaultSyncSoundSettings();
}
void Engine::defaultSyncSoundSettings() {
// Sync the engine with the config manager
int soundVolumeMusic = ConfMan.getInt("music_volume");
int soundVolumeSFX = ConfMan.getInt("sfx_volume");

View File

@ -657,6 +657,12 @@ public:
virtual int getAutosaveSlot() const {
return 0;
}
protected:
/**
* Syncs the engine's mixer using the default volume syncing behavior.
*/
void defaultSyncSoundSettings();
};