[Scummvm-git-logs] scummvm master -> 5b48ceb68a48c199880c3285be11858a71418021

sev- noreply at scummvm.org
Sun Apr 9 10:56:25 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5b48ceb68a ENGINES: Initialize mixer volume levels to levels from config so engine isn't required to call syncSoundSettings at star


Commit: 5b48ceb68a48c199880c3285be11858a71418021
    https://github.com/scummvm/scummvm/commit/5b48ceb68a48c199880c3285be11858a71418021
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T12:56:22+02:00

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

Changed paths:
    engines/engine.cpp
    engines/engine.h


diff --git a/engines/engine.cpp b/engines/engine.cpp
index fb305159f39..5bea2fbb1dc 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -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");
diff --git a/engines/engine.h b/engines/engine.h
index 4bbc4c4a86e..e2d1e6e1a86 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -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();
 };
 
 




More information about the Scummvm-git-logs mailing list