[Scummvm-git-logs] scummvm master -> 22b7198c14410e6b190bf9f24ee1060ab00b24e9

sev- noreply at scummvm.org
Thu Oct 2 18:54:34 UTC 2025


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

Summary:
0798eb9fe3 GRAPHICS: MACGUI: Split blitting and painting for MacDialog
0f12970c09 GRAPHICS: MACGUI: Allow MacDialog subclassing
fa4debd5d2 WAGE: Draw volume control in About dialog
96e1251c28 GRAPHICS: MACGUI: Allow event processing override in MacDialog
7bee887a65 WAGE: Implement volume adjustment in AboutDialog
980a83160b WAGE: Play beep on volume change like in the original
1e270524fd WAGE: Switch sounds to SFX channel, so the volume controls have effect
22b7198c14 WAGE: Mark the angine as SFX-only via GUIO


Commit: 0798eb9fe3d2929a14b7cdd92544719af0791974
    https://github.com/scummvm/scummvm/commit/0798eb9fe3d2929a14b7cdd92544719af0791974
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:10+02:00

Commit Message:
GRAPHICS: MACGUI: Split blitting and painting for MacDialog

Changed paths:
    graphics/macgui/macdialog.cpp
    graphics/macgui/macdialog.h


diff --git a/graphics/macgui/macdialog.cpp b/graphics/macgui/macdialog.cpp
index 264f439c3c8..aa69a87d294 100644
--- a/graphics/macgui/macdialog.cpp
+++ b/graphics/macgui/macdialog.cpp
@@ -100,6 +100,9 @@ const Graphics::Font *MacDialog::getDialogFont() {
 }
 
 void MacDialog::paint() {
+	if (!_needsRedraw)
+		return;
+
 	Primitives &primitives = _wm->getDrawPrimitives();
 
 	MacPlotData pd(_screen, nullptr, &_wm->getPatterns(), 1, 0, 0, 1, _wm->_colorBlack, false);
@@ -136,17 +139,20 @@ void MacDialog::paint() {
 
 		drawOutline(button->bounds, buttonOutline, ARRAYSIZE(buttonOutline));
 	}
+	_needsRedraw = false;
+}
+
+void MacDialog::blit() {
+	paint();
 
 	g_system->copyRectToScreen(_screen->getBasePtr(_bbox.left, _bbox.top), _screen->pitch,
 							   _bbox.left, _bbox.top, _bbox.width() + 1, _bbox.height() + 1);
-
-	_needsRedraw = false;
 }
 
 void MacDialog::drawOutline(Common::Rect &bounds, int *spec, int speclen) {
 	Primitives &primitives = _wm->getDrawPrimitives();
 
-	MacPlotData pd(_screen, nullptr, &_wm->getPatterns(), 1, 0, 0, 1, _wm->_colorBlack, false);	
+	MacPlotData pd(_screen, nullptr, &_wm->getPatterns(), 1, 0, 0, 1, _wm->_colorBlack, false);
 	for (int i = 0; i < speclen; i++)
 		if (spec[i] != 0) {
 			Common::Rect r(bounds.left + i, bounds.top + i, bounds.right - i, bounds.bottom - i);
@@ -195,7 +201,7 @@ int MacDialog::run() {
 		}
 
 		if (_needsRedraw)
-			paint();
+			blit();
 
 		g_system->updateScreen();
 		g_system->delayMillis(50);
diff --git a/graphics/macgui/macdialog.h b/graphics/macgui/macdialog.h
index 389d33a67eb..360b5369f89 100644
--- a/graphics/macgui/macdialog.h
+++ b/graphics/macgui/macdialog.h
@@ -109,6 +109,7 @@ private:
 
 public:
 	void paint();
+	void blit();
 	void mouseMove(int x, int y);
 	void mouseClick(int x, int y);
 	int mouseRaise(int x, int y);


Commit: 0f12970c09d9dbbdbd465c494c17943806abaf83
    https://github.com/scummvm/scummvm/commit/0f12970c09d9dbbdbd465c494c17943806abaf83
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:10+02:00

Commit Message:
GRAPHICS: MACGUI: Allow MacDialog subclassing

Changed paths:
    graphics/macgui/macdialog.h


diff --git a/graphics/macgui/macdialog.h b/graphics/macgui/macdialog.h
index 360b5369f89..3c3fac02aaf 100644
--- a/graphics/macgui/macdialog.h
+++ b/graphics/macgui/macdialog.h
@@ -80,11 +80,11 @@ typedef Common::Array<MacDialogButton *> MacDialogButtonArray;
 class MacDialog {
 public:
 	MacDialog(ManagedSurface *screen, MacWindowManager *wm,  int width, MacText *mactext, int maxTextWidth, MacDialogButtonArray *buttons, uint defaultButton);
-	~MacDialog();
+	virtual ~MacDialog();
 
 	int run();
 
-private:
+protected:
 	ManagedSurface *_screen;
 	MacWindowManager *_wm;
 	ManagedSurface *_tempSurface;
@@ -108,7 +108,7 @@ private:
 	void drawOutline(Common::Rect &bounds, int *spec, int speclen);
 
 public:
-	void paint();
+	virtual void paint();
 	void blit();
 	void mouseMove(int x, int y);
 	void mouseClick(int x, int y);


Commit: fa4debd5d21fcd569c8176ed6fc02d158ecd4ada
    https://github.com/scummvm/scummvm/commit/fa4debd5d21fcd569c8176ed6fc02d158ecd4ada
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:10+02:00

Commit Message:
WAGE: Draw volume control in About dialog

Changed paths:
    engines/wage/gui.cpp


diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index f54468e8e3e..51be7f12c3a 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -46,6 +46,8 @@
 
 #include "common/timer.h"
 #include "common/system.h"
+#include "common/config-manager.h"
+
 #include "graphics/primitives.h"
 #include "graphics/macgui/macfontmanager.h"
 #include "graphics/macgui/macdialog.h"
@@ -487,12 +489,39 @@ void Gui::enableRevert() {
 	_menu->enableCommand(kMenuFile, kMenuActionRevert, true);
 }
 
-class AboutDialog : Graphics::MacDialog {
-	void paint();
+class AboutDialog : public Graphics::MacDialog {
+public:
+	AboutDialog(Graphics::ManagedSurface *screen, Graphics::MacWindowManager *wm, int width, Graphics::MacText *mactext, int maxTextWidth, Graphics::MacDialogButtonArray *buttons, uint defaultButton)
+		: Graphics::MacDialog(screen, wm, width, mactext, maxTextWidth, buttons, defaultButton) {}
+
+	virtual ~AboutDialog() {}
+
+	virtual void paint() override;
 };
 
 void AboutDialog::paint() {
 	Graphics::MacDialog::paint();
+
+	const char *volumeText = "-     Volume     +";
+	int w = _font->getStringWidth(volumeText);
+	int x = _bbox.left + (_bbox.width() - w) / 2;
+	int y = _bbox.bottom - 52;
+
+	_font->drawString(_screen, volumeText, x, y, _bbox.width(), kColorBlack);
+
+	uint32 volume = ConfMan.getInt("sfx_volume");
+
+	Graphics::Primitives &primitives = _wm->getDrawPrimitives();
+
+	const int volWidth = 160;
+	Common::Rect volBox(0, 0, volume * volWidth / 256, 12);
+	Common::Rect volFull(0, 0, volWidth, 12);
+	volBox.moveTo(_bbox.left + (_bbox.width() - volWidth) / 2, _bbox.bottom - 32);
+	volFull.moveTo(_bbox.left + (_bbox.width() - volWidth) / 2, _bbox.bottom - 32);
+
+	Graphics::MacPlotData pd(_screen, nullptr, &_wm->getPatterns(), 1, 0, 0, 1, _wm->_colorBlack, false);
+	primitives.drawFilledRect1(volBox, kColorBlack, &pd);
+	primitives.drawRect1(volFull, kColorBlack, &pd);
 }
 
 void Gui::aboutDialog() {
@@ -511,7 +540,7 @@ void Gui::aboutDialog() {
 
 	buttons.push_back(new Graphics::MacDialogButton("OK", 191, aboutMessage.getTextHeight() + 30, 68, 28));
 
-	Graphics::MacDialog about(&_screen, _wm, 450, &aboutMessage, 400, &buttons, 0);
+	AboutDialog about(&_screen, _wm, 450, &aboutMessage, 400, &buttons, 0);
 
 	int button = about.run();
 


Commit: 96e1251c2856cbab6ec47a2d4c6542b746ef3492
    https://github.com/scummvm/scummvm/commit/96e1251c2856cbab6ec47a2d4c6542b746ef3492
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:10+02:00

Commit Message:
GRAPHICS: MACGUI: Allow event processing override in MacDialog

Changed paths:
    graphics/macgui/macdialog.cpp
    graphics/macgui/macdialog.h


diff --git a/graphics/macgui/macdialog.cpp b/graphics/macgui/macdialog.cpp
index aa69a87d294..205037b5b84 100644
--- a/graphics/macgui/macdialog.cpp
+++ b/graphics/macgui/macdialog.cpp
@@ -172,6 +172,9 @@ int MacDialog::run() {
 		Common::Event event;
 
 		while (g_system->getEventManager()->pollEvent(event)) {
+			if (processEvent(event))
+				continue;
+
 			switch (event.type) {
 			case Common::EVENT_QUIT:
 				shouldQuitEngine = true;
diff --git a/graphics/macgui/macdialog.h b/graphics/macgui/macdialog.h
index 3c3fac02aaf..58229353ac7 100644
--- a/graphics/macgui/macdialog.h
+++ b/graphics/macgui/macdialog.h
@@ -50,6 +50,10 @@
 #include "common/str.h"
 #include "common/rect.h"
 
+namespace Common {
+struct Event;
+}
+
 namespace Graphics {
 
 class Font;
@@ -83,6 +87,7 @@ public:
 	virtual ~MacDialog();
 
 	int run();
+	virtual bool processEvent(const Common::Event &event) { return false; }
 
 protected:
 	ManagedSurface *_screen;


Commit: 7bee887a6533518fcbdf637a5406aefe2c396bf9
    https://github.com/scummvm/scummvm/commit/7bee887a6533518fcbdf637a5406aefe2c396bf9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:10+02:00

Commit Message:
WAGE: Implement volume adjustment in AboutDialog

Changed paths:
    engines/wage/gui.cpp


diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 51be7f12c3a..c67dc39aa09 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -491,14 +491,29 @@ void Gui::enableRevert() {
 
 class AboutDialog : public Graphics::MacDialog {
 public:
-	AboutDialog(Graphics::ManagedSurface *screen, Graphics::MacWindowManager *wm, int width, Graphics::MacText *mactext, int maxTextWidth, Graphics::MacDialogButtonArray *buttons, uint defaultButton)
-		: Graphics::MacDialog(screen, wm, width, mactext, maxTextWidth, buttons, defaultButton) {}
-
-	virtual ~AboutDialog() {}
+	AboutDialog(Graphics::ManagedSurface *screen, Graphics::MacWindowManager *wm, int width, Graphics::MacText *mactext, int maxTextWidth, Graphics::MacDialogButtonArray *buttons, uint defaultButton);
+	virtual ~AboutDialog() {
+		if (_volumeChanged)
+			ConfMan.flushToDisk();
+	}
 
 	virtual void paint() override;
+	virtual bool processEvent(const Common::Event &event) override;
+
+private:
+	Common::Rect _volBbox;
+
+	const int kVolWidth = 160;
+	bool _volumeChanged = false;
 };
 
+AboutDialog::AboutDialog(Graphics::ManagedSurface *screen, Graphics::MacWindowManager *wm, int width, Graphics::MacText *mactext, int maxTextWidth, Graphics::MacDialogButtonArray *buttons, uint defaultButton)
+		: Graphics::MacDialog(screen, wm, width, mactext, maxTextWidth, buttons, defaultButton) {
+	_volBbox = Common::Rect(0, 0, kVolWidth, 12);
+	_volBbox.moveTo(_bbox.left + (_bbox.width() - kVolWidth) / 2, _bbox.bottom - 32);
+}
+
+
 void AboutDialog::paint() {
 	Graphics::MacDialog::paint();
 
@@ -513,15 +528,32 @@ void AboutDialog::paint() {
 
 	Graphics::Primitives &primitives = _wm->getDrawPrimitives();
 
-	const int volWidth = 160;
-	Common::Rect volBox(0, 0, volume * volWidth / 256, 12);
-	Common::Rect volFull(0, 0, volWidth, 12);
-	volBox.moveTo(_bbox.left + (_bbox.width() - volWidth) / 2, _bbox.bottom - 32);
-	volFull.moveTo(_bbox.left + (_bbox.width() - volWidth) / 2, _bbox.bottom - 32);
+	Common::Rect volBox(0, 0, volume * kVolWidth / 256, 12);
+	volBox.moveTo(_bbox.left + (_bbox.width() - kVolWidth) / 2, _bbox.bottom - 32);
 
 	Graphics::MacPlotData pd(_screen, nullptr, &_wm->getPatterns(), 1, 0, 0, 1, _wm->_colorBlack, false);
 	primitives.drawFilledRect1(volBox, kColorBlack, &pd);
-	primitives.drawRect1(volFull, kColorBlack, &pd);
+	primitives.drawRect1(_volBbox, kColorBlack, &pd);
+}
+
+bool AboutDialog::processEvent(const Common::Event &event) {
+	if (event.type == Common::EVENT_LBUTTONUP) {
+		if (_volBbox.contains(event.mouse.x, event.mouse.y)) {
+			int delta = event.mouse.x - _volBbox.left;
+
+			int volume = delta * 256 / kVolWidth;
+			ConfMan.setInt("sfx_volume", volume);
+			_volumeChanged = true;
+
+			_needsRedraw = true;
+
+			g_wage->syncSoundSettings();
+
+			return true;
+		}
+	}
+
+	return false;
 }
 
 void Gui::aboutDialog() {


Commit: 980a83160b2ba5884cd0a82685d14a0cddc62584
    https://github.com/scummvm/scummvm/commit/980a83160b2ba5884cd0a82685d14a0cddc62584
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:11+02:00

Commit Message:
WAGE: Play beep on volume change like in the original

Changed paths:
    engines/wage/gui.cpp
    engines/wage/wage.cpp
    engines/wage/wage.h


diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index c67dc39aa09..4ea3ac76761 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -48,6 +48,8 @@
 #include "common/system.h"
 #include "common/config-manager.h"
 
+#include "audio/softsynth/pcspk.h"
+
 #include "graphics/primitives.h"
 #include "graphics/macgui/macfontmanager.h"
 #include "graphics/macgui/macdialog.h"
@@ -549,6 +551,8 @@ bool AboutDialog::processEvent(const Common::Event &event) {
 
 			g_wage->syncSoundSettings();
 
+			g_wage->_speaker->play(Audio::PCSpeaker::kWaveFormSquare, 500, 150);
+
 			return true;
 		}
 	}
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 86dd721b6b6..fc9e9667971 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -52,6 +52,8 @@
 #include "common/system.h"
 #include "common/text-to-speech.h"
 
+#include "audio/softsynth/pcspk.h"
+
 #include "engines/engine.h"
 #include "engines/util.h"
 
@@ -90,6 +92,8 @@ WageEngine::WageEngine(OSystem *syst, const ADGameDescription *desc) : Engine(sy
 
 	_resManager = NULL;
 
+	_speaker = NULL;
+
 	g_wage = this;
 
 	debug("WageEngine::WageEngine()");
@@ -152,6 +156,9 @@ Common::Error WageEngine::run() {
 	_system->setImGuiCallbacks(callbacks);
 #endif
 
+	_speaker = new Audio::PCSpeaker();
+	_speaker->init();
+
 	_temporarilyHidden = true;
 	performInitialSetup();
 	if (ConfMan.hasKey("save_slot")) {
@@ -209,6 +216,8 @@ void WageEngine::resetState() {
 	_commandWasQuick = false;
 	_shouldQuit = false;
 	_offer = nullptr;
+
+	delete _speaker;
 }
 
 void WageEngine::restart() {
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index 0085fc7f024..58297160f70 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -69,6 +69,10 @@ namespace Graphics {
 class MacDialog;
 }
 
+namespace Audio {
+class PCSpeaker;
+}
+
 namespace Wage {
 
 class Console;
@@ -219,6 +223,7 @@ public:
 
 	Common::List<int> _soundQueue;
 	Common::String _soundToPlay;
+	Audio::PCSpeaker *_speaker;
 
 	void playSound(Common::String soundName, bool blocking = true);
 	void updateSoundTimerForScene(Scene *scene, bool firstTime);


Commit: 1e270524fdfc73bb04be8ad47a1654210b54f9f7
    https://github.com/scummvm/scummvm/commit/1e270524fdfc73bb04be8ad47a1654210b54f9f7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:11+02:00

Commit Message:
WAGE: Switch sounds to SFX channel, so the volume controls have effect

Changed paths:
    engines/wage/sound.cpp


diff --git a/engines/wage/sound.cpp b/engines/wage/sound.cpp
index 91d14c41ee0..7eb3631aa39 100644
--- a/engines/wage/sound.cpp
+++ b/engines/wage/sound.cpp
@@ -93,7 +93,7 @@ void WageEngine::playSound(Common::String soundName, bool blocking) {
 
 	Audio::AudioStream *stream = Audio::makeRawStream(s->_data, 2 * s->_size, 11000, Audio::FLAG_UNSIGNED);
 
-	_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, stream,
+	_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream,
 		-1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO);
 
 	while (_mixer->isSoundHandleActive(_soundHandle) && !_shouldQuit && blocking) {


Commit: 22b7198c14410e6b190bf9f24ee1060ab00b24e9
    https://github.com/scummvm/scummvm/commit/22b7198c14410e6b190bf9f24ee1060ab00b24e9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-10-02T20:54:11+02:00

Commit Message:
WAGE: Mark the angine as SFX-only via GUIO

Changed paths:
    engines/wage/detection.cpp


diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp
index 6ffd088aee7..7d597ca4c4f 100644
--- a/engines/wage/detection.cpp
+++ b/engines/wage/detection.cpp
@@ -65,7 +65,7 @@ class WageMetaEngineDetection : public AdvancedMetaEngineDetection<ADGameDescrip
 public:
 	WageMetaEngineDetection() : AdvancedMetaEngineDetection(Wage::gameDescriptions, wageGames) {
 		_md5Bytes = 2 * 1024 * 1024;
-		_guiOptions = GUIO3(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS);
+		_guiOptions = GUIO4(GUIO_NOSPEECH, GUIO_NOMIDI, GAMEOPTION_TTS, GUIO_NOMUSIC);
 	}
 
 	const char *getName() const override {




More information about the Scummvm-git-logs mailing list