[Scummvm-git-logs] scummvm master -> baf4679fc3ec71cf69a3b0aebdd1d355fcf27467
dreammaster
noreply at scummvm.org
Fri Sep 19 10:18:27 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:
baf4679fc3 BAGEL: MINIGAMES: Fix Poker redrawing on options menu
Commit: baf4679fc3ec71cf69a3b0aebdd1d355fcf27467
https://github.com/scummvm/scummvm/commit/baf4679fc3ec71cf69a3b0aebdd1d355fcf27467
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-09-19T03:18:21-07:00
Commit Message:
BAGEL: MINIGAMES: Fix Poker redrawing on options menu
Previously, when you changed a minigame setting from the options
dialog sub-menus, it triggered a game reset, which was then causing
parts of the minigame to draw on top of the returned to Options menu.
To get around this fact, due to ScummVM not currently having completely
separate surfaces for each window/control, instead of immediately
resetting the game, I simply flag a reset is needed, and when you close
the Options menu by clicking on 'Continue', if the flag is set then
it will silently switch it to starting the new game at that point.
Changed paths:
engines/bagel/hodjnpodj/poker/poker.cpp
engines/bagel/hodjnpodj/poker/poker.h
diff --git a/engines/bagel/hodjnpodj/poker/poker.cpp b/engines/bagel/hodjnpodj/poker/poker.cpp
index c8115c16db2..8802cd5c1ab 100644
--- a/engines/bagel/hodjnpodj/poker/poker.cpp
+++ b/engines/bagel/hodjnpodj/poker/poker.cpp
@@ -850,7 +850,7 @@ void CALLBACK lpfnOptionCallback(CWnd * pWnd) { // do t
nSetPayOff = dlgPayOff.DoModal();
nPayOff = nSetPayOff;
pcwndPoker->SetPayOffs(nSetPayOff); // the return is what set of payoffs was selected was clicked
- pcwndPoker->ResetGame();
+ pcwndPoker->FlagResetGame();
break;
case ID_SETUSERAMT: // if Set Amount button was hit, popup the Set Amount dialog
@@ -861,7 +861,7 @@ void CALLBACK lpfnOptionCallback(CWnd * pWnd) { // do t
pcwndPoker->m_lUserAmount = nSetAmount;
pcwndPoker->m_lStartingAmount = nSetAmount;
}
- pcwndPoker->ResetGame();
+ pcwndPoker->FlagResetGame();
break;
}
return;
@@ -886,7 +886,15 @@ bool CMainPokerWindow::OnCommand(WPARAM wParam, LPARAM lParam) {
pOptionButton->ShowWindow(SW_HIDE);
CSound::waitWaveSounds();
sndPlaySound(nullptr, 0);
+ _flagResetGame = false;
+
nMainOption = dlgMainOpts.DoModal();
+
+ // If the minigame options were changed, we need to reset the game
+ if (_flagResetGame && nMainOption == IDC_OPTIONS_RETURN)
+ nMainOption = IDC_OPTIONS_NEWGAME;
+ _flagResetGame = false;
+
switch (nMainOption) {
case IDC_OPTIONS_QUIT: // if Quit buttons was hit, quit
PostMessage(WM_CLOSE, 0, 0);
@@ -898,7 +906,10 @@ bool CMainPokerWindow::OnCommand(WPARAM wParam, LPARAM lParam) {
}
break;
+ default:
+ break;
}
+
m_bPlaySounds = m_lpGameStruct->bSoundEffectsEnabled;
if (m_lpGameStruct->bMusicEnabled) {
if (pGameSound == nullptr) {
diff --git a/engines/bagel/hodjnpodj/poker/poker.h b/engines/bagel/hodjnpodj/poker/poker.h
index d1deb5cc07e..3c8fe690f19 100644
--- a/engines/bagel/hodjnpodj/poker/poker.h
+++ b/engines/bagel/hodjnpodj/poker/poker.h
@@ -250,6 +250,7 @@ private:
LPGAMESTRUCT m_lpGameStruct = nullptr;
bool m_bMouseCaptured = false;
bool m_bEndHand = false;
+ bool _flagResetGame = false;
CRect MainRect; // screen area spanned by the game window
CRect BetRect1, // window area spanned by the Bet1 button
@@ -274,6 +275,9 @@ public:
void SplashScreen();
void SetPayOffs(int);
+ void FlagResetGame() {
+ _flagResetGame = true;
+ }
void ResetGame(long = 0L);
void SetBet(long);
More information about the Scummvm-git-logs
mailing list