[Scummvm-git-logs] scummvm master -> 00f1e9ecc620225b2f50e29135d2f9bd3936d4a8

aquadran noreply at scummvm.org
Tue Sep 16 11:23:12 UTC 2025


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

Summary:
00f1e9ecc6 WINTERMUTE: Small sync with original code


Commit: 00f1e9ecc620225b2f50e29135d2f9bd3936d4a8
    https://github.com/scummvm/scummvm/commit/00f1e9ecc620225b2f50e29135d2f9bd3936d4a8
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2025-09-16T13:23:07+02:00

Commit Message:
WINTERMUTE: Small sync with original code

Changed paths:
    engines/wintermute/base/base_frame.cpp
    engines/wintermute/base/base_game.cpp
    engines/wintermute/base/sound/base_sound.cpp
    engines/wintermute/base/sound/base_sound.h
    engines/wintermute/base/sound/base_sound_buffer.cpp
    engines/wintermute/base/sound/base_sound_manager.cpp
    engines/wintermute/base/sound/base_sound_manager.h


diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index 0f63ce1a492..707d1f6b26c 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -262,7 +262,7 @@ bool BaseFrame::loadBuffer(char *buffer, int lifeTime, bool keepLoaded) {
 			}
 			_sound = new BaseSound(_game);
 			if (!_sound || DID_FAIL(_sound->setSound(params, TSoundType::SOUND_SFX, false))) {
-				if (BaseEngine::instance().getSoundMgr()->_soundAvailable) {
+				if (_game->_soundMgr->_soundAvailable) {
 					_game->LOG(0, "Error loading sound '%s'.", params);
 				}
 				SAFE_DELETE(_sound);
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index 984ff0da619..5ed084d9bb8 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -505,6 +505,7 @@ bool BaseGame::initialize1() {
 		if (_fontStorage == nullptr) {
 			break;
 		}
+
 		_fileManager = BaseFileManager::getEngineInstance();
 		if (_fileManager == nullptr) {
 			break;
@@ -5738,6 +5739,9 @@ bool BaseGame::miniUpdate() {
 	}
 
 	if (BasePlatform::getTime() - _lastMiniUpdate > 200) {
+		if (_soundMgr) {
+			_soundMgr->initLoop();
+		}
 		_lastMiniUpdate = BasePlatform::getTime();
 	}
 	return true;
diff --git a/engines/wintermute/base/sound/base_sound.cpp b/engines/wintermute/base/sound/base_sound.cpp
index 5969e9dd5b9..abbead97c9a 100644
--- a/engines/wintermute/base/sound/base_sound.cpp
+++ b/engines/wintermute/base/sound/base_sound.cpp
@@ -40,7 +40,7 @@ BaseSound::BaseSound(BaseGame *inGame) : BaseClass(inGame) {
 	_sound = nullptr;
 	_soundFilename = nullptr;
 
-	_soundType = SOUND_SFX;
+	_soundType = TSoundType::SOUND_SFX;
 	_soundStreamed = false;
 	_soundLooping = false;
 	_soundPlaying = false;
diff --git a/engines/wintermute/base/sound/base_sound.h b/engines/wintermute/base/sound/base_sound.h
index 1609dd70fd4..08af2c2ce02 100644
--- a/engines/wintermute/base/sound/base_sound.h
+++ b/engines/wintermute/base/sound/base_sound.h
@@ -66,7 +66,7 @@ public:
 	TSoundType _soundType;
 	char *_soundFilename;
 	bool setSoundSimple();
-	bool setSound(const char *filename, TSoundType type = SOUND_SFX, bool streamed = false);
+	bool setSound(const char *filename, TSoundType type = TSoundType::SOUND_SFX, bool streamed = false);
 	BaseSound(BaseGame *inGame);
 	~BaseSound() override;
 
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp
index ec001172f4f..48d9f231cd2 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.cpp
+++ b/engines/wintermute/base/sound/base_sound_buffer.cpp
@@ -66,7 +66,7 @@ BaseSoundBuffer::BaseSoundBuffer(BaseGame *inGame) : BaseClass(inGame) {
 	_loopStart = 0;
 	_startPos = 0;
 
-	_type = SOUND_SFX;
+	_type = TSoundType::SOUND_SFX;
 
 	_freezePaused = false;
 }
diff --git a/engines/wintermute/base/sound/base_sound_manager.cpp b/engines/wintermute/base/sound/base_sound_manager.cpp
index 035ddd2ec22..12a76e9c21b 100644
--- a/engines/wintermute/base/sound/base_sound_manager.cpp
+++ b/engines/wintermute/base/sound/base_sound_manager.cpp
@@ -187,13 +187,13 @@ bool BaseSoundMgr::setVolume(TSoundType type, int volume) {
 	}
 
 	switch (type) {
-	case SOUND_SFX:
+	case TSoundType::SOUND_SFX:
 		ConfMan.setInt("sfx_volume", volume);
 		break;
-	case SOUND_SPEECH:
+	case TSoundType::SOUND_SPEECH:
 		ConfMan.setInt("speech_volume", volume);
 		break;
-	case SOUND_MUSIC:
+	case TSoundType::SOUND_MUSIC:
 		ConfMan.setInt("music_volume", volume);
 		break;
 	default:
@@ -216,11 +216,11 @@ byte BaseSoundMgr::getVolumePercent(TSoundType type) {
 	int volume = 0;
 
 	switch (type) {
-	case SOUND_SFX:
+	case TSoundType::SOUND_SFX:
 		volume = g_system->getMixer()->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
-	case SOUND_SPEECH:
+	case TSoundType::SOUND_SPEECH:
 		volume = g_system->getMixer()->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType);
-	case SOUND_MUSIC:
+	case TSoundType::SOUND_MUSIC:
 		volume = g_system->getMixer()->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
 		break;
 	default:
@@ -250,7 +250,7 @@ byte BaseSoundMgr::getMasterVolumePercent() {
 bool BaseSoundMgr::pauseAll(bool includingMusic) {
 
 	for (int32 i = 0; i < _sounds.getSize(); i++) {
-		if (_sounds[i]->isPlaying() && (_sounds[i]->getType() != SOUND_MUSIC || includingMusic)) {
+		if (_sounds[i]->isPlaying() && (_sounds[i]->getType() != TSoundType::SOUND_MUSIC || includingMusic)) {
 			_sounds[i]->pause();
 			_sounds[i]->setFreezePaused(true);
 		}
diff --git a/engines/wintermute/base/sound/base_sound_manager.h b/engines/wintermute/base/sound/base_sound_manager.h
index e57b719b032..3b07082449d 100644
--- a/engines/wintermute/base/sound/base_sound_manager.h
+++ b/engines/wintermute/base/sound/base_sound_manager.h
@@ -50,8 +50,8 @@ public:
 	bool setVolume(TSoundType type, int volume);
 	int32 _volumeMaster;
 	bool removeSound(BaseSoundBuffer *sound);
-	BaseSoundBuffer *addSound(const char *filename, TSoundType type = SOUND_SFX, bool streamed = false);
-	bool addSound(BaseSoundBuffer *sound, TSoundType type = SOUND_SFX);
+	BaseSoundBuffer *addSound(const char *filename, TSoundType type = TSoundType::SOUND_SFX, bool streamed = false);
+	bool addSound(BaseSoundBuffer *sound, TSoundType type = TSoundType::SOUND_SFX);
 	bool initLoop();
 	bool initialize();
 	bool _soundAvailable;




More information about the Scummvm-git-logs mailing list