[Scummvm-git-logs] scummvm master -> fba3c95fa42491c64c6f2b23cdff0b01cf011d27

dreammaster noreply at scummvm.org
Mon Sep 29 07:24:33 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:
fba3c95fa4 BAGEL: METAGAME: Fix background for Item Dialog Ok button


Commit: fba3c95fa42491c64c6f2b23cdff0b01cf011d27
    https://github.com/scummvm/scummvm/commit/fba3c95fa42491c64c6f2b23cdff0b01cf011d27
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-09-29T00:21:46-07:00

Commit Message:
BAGEL: METAGAME: Fix background for Item Dialog Ok button

Not sure if it's correct or not, but currently when the CDC
drawing code converts RGB values to palette indexes, it uses
the currently active system palette to do so. But for the
item dialog that shows when you receive an item after playing
a minigame in the boardgame, the screen is black, and there's
no correct color to use. Even though a palette is manually
passed to the dialog when it's created. Maybe the CDC is meant
to use the passed palette directly somehow? In any case, as
a hack to at least get it working, I added an OnActivate
event handler for the dialog to set the passed palette to be
the system palette. And that fixes the button's rendering.

Changed paths:
    engines/bagel/hodjnpodj/metagame/gtl/citemdlg.cpp
    engines/bagel/hodjnpodj/metagame/gtl/citemdlg.h


diff --git a/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.cpp b/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.cpp
index aef829632be..ae8616712eb 100644
--- a/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.cpp
+++ b/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.cpp
@@ -30,6 +30,7 @@ namespace Gtl {
 
 BEGIN_MESSAGE_MAP(CItemDialog, CBmpDialog)
 	//{{AFX_MSG_MAP(CItemDialog)
+	ON_WM_ACTIVATE()
 	ON_WM_PAINT()
 	ON_WM_ERASEBKGND()
 	ON_WM_DESTROY()
@@ -136,6 +137,14 @@ bool CItemDialog::OnInitDialog() {
 	return true;
 }
 
+void CItemDialog::OnActivate(unsigned int nState, CWnd *, bool) {
+	// FIXME: Hack realize palette so button background draws correctly
+	if (nState == WA_ACTIVE) {
+		Graphics::Palette *pal = m_pPalette->palette();
+		AfxGetApp()->setPalette(*pal);
+	}
+}
+
 void CItemDialog::OnPaint() {
 	CDC     *pDC;
 	bool    bSuccess;
diff --git a/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.h b/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.h
index b3baf85f91b..a203555e2d5 100644
--- a/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.h
+++ b/engines/bagel/hodjnpodj/metagame/gtl/citemdlg.h
@@ -89,6 +89,7 @@ protected:
 
 	// Generated message map functions
 	//{{AFX_MSG(CItemDialog)
+	afx_msg void OnActivate(unsigned int nState, CWnd *, bool);
 	afx_msg void OnPaint();
 	virtual void OnOK() override;
 	virtual void OnCancel() override;




More information about the Scummvm-git-logs mailing list