Initial commit
This commit is contained in:
452
engines/bagel/hodjnpodj/poker/amtdlg.cpp
Normal file
452
engines/bagel/hodjnpodj/poker/amtdlg.cpp
Normal file
@@ -0,0 +1,452 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/stdafx.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
#include "bagel/hodjnpodj/poker/dialogs.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
static CPalette *pSetAmountPalette;
|
||||
CText *ptxtAmount = nullptr;
|
||||
long lCAmount;
|
||||
|
||||
static CColorButton *pAmountButton = nullptr;
|
||||
static CColorButton *pCancelButton = nullptr;
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* COptionsDlg
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Constructor sends the input to the COptions constructor and
|
||||
* the intializes the private members
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* Those needed to contruct a COptions dialog: pParent,pPalette, nID
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* private member m_nCurrentAmount
|
||||
* globals rectDisplayAmount and pSetAmountPalette
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
CSetAmountDlg::CSetAmountDlg(CWnd *pParent, CPalette *pPalette, unsigned int nID)
|
||||
: CBmpDialog(pParent, pPalette, nID, ".\\ART\\SSCROLL.BMP") {
|
||||
CDC *pDC = GetDC();
|
||||
|
||||
pSetAmountPalette = pPalette;
|
||||
rectDisplayAmount.SetRect(95, 65, 150, 81);
|
||||
m_nCurrentAmount = 1000;
|
||||
|
||||
ptxtAmount = new CText(pDC, pSetAmountPalette, &rectDisplayAmount, JUSTIFY_LEFT);
|
||||
|
||||
ReleaseDC(pDC);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnCommand
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Process the "Set" and "Cancel" buttons
|
||||
*
|
||||
* This function is called when a WM_COMMAND message is issued,
|
||||
* typically in order to process control related activities.
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* wParam identifier for the button to be processed
|
||||
* lParam type of message to be processed
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
bool CSetAmountDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
|
||||
// What ever button is clicked, end the dialog and send the ID of the button
|
||||
// clicked as the return from the dialog
|
||||
if (HIWORD(lParam) == BN_CLICKED) {
|
||||
switch (wParam) {
|
||||
case IDC_SETSTARTAMOUNT:
|
||||
ClearDialogImage();
|
||||
EndDialog(m_nCurrentAmount);
|
||||
return 1;
|
||||
break;
|
||||
case ID_CANCEL:
|
||||
ClearDialogImage();
|
||||
EndDialog(0);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CDialog::OnCommand(wParam, lParam);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnInitDialog
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This initializes the options dialog to enable and disable
|
||||
* buttons when necessary
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* bool to tell windows that it has dealt this function
|
||||
*
|
||||
****************************************************************/
|
||||
bool CSetAmountDlg::OnInitDialog() {
|
||||
bool bSuccess;
|
||||
|
||||
CBmpDialog::OnInitDialog();
|
||||
|
||||
pAmountButton = new CColorButton();
|
||||
ASSERT(pAmountButton != nullptr);
|
||||
pAmountButton->SetPalette(pSetAmountPalette);
|
||||
bSuccess = pAmountButton->SetControl(IDC_SETSTARTAMOUNT, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pCancelButton = new CColorButton();
|
||||
ASSERT(pCancelButton != nullptr);
|
||||
pCancelButton->SetPalette(pSetAmountPalette);
|
||||
bSuccess = pCancelButton->SetControl(ID_CANCEL, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* SetInitialOptions
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This sets the privates to the inputted values
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* lCurrentAmount = the current amount the user has
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* m_nCurrentAmount = (int)min( AMOUNTMAX, lCurrentAmount)
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
*
|
||||
****************************************************************/
|
||||
void CSetAmountDlg::SetInitialOptions(long lCurrentAmount) {
|
||||
lCAmount = lCurrentAmount;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnPaint
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Repaint the screen whenever needed; e.g. when uncovered by an
|
||||
* overlapping window, when maximized from an icon, and when it the
|
||||
* window is initially created.
|
||||
*
|
||||
* This uses the COptions Paint as its base, and displays the current
|
||||
* amount chosen from the scrollbar
|
||||
*
|
||||
* This routine is called whenever Windows sends a WM_PAINT message.
|
||||
* Note that creating a CPaintDC automatically does a BeginPaint and
|
||||
* an EndPaint call is done when it is destroyed at the end of this
|
||||
* function. CPaintDC's constructor needs the window (this).
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
void CSetAmountDlg::OnPaint() {
|
||||
CDC *pDC;
|
||||
CString strHowMuch1 = "How much would you";
|
||||
CString strHowMuch2 = "like (0 - 1000)?";
|
||||
char cDisplay[40];
|
||||
int nOldBkMode;
|
||||
CText *ptxtCAmount = nullptr;
|
||||
CRect rectCAmount(42, 102, 200, 117);
|
||||
CScrollBar *pSetAmountSB = nullptr;
|
||||
int nScrollPos = 0;
|
||||
|
||||
// call COptions onpaint, to paint the background
|
||||
CBmpDialog::OnPaint();
|
||||
|
||||
pDC = GetDC();
|
||||
// now paint in my text with a transparent background
|
||||
|
||||
nOldBkMode = pDC->SetBkMode(TRANSPARENT);
|
||||
pDC->TextOut(42, 35, strHowMuch1);
|
||||
pDC->TextOut(42, 50, strHowMuch2);
|
||||
pDC->SetBkMode(nOldBkMode);
|
||||
|
||||
Common::sprintf_s(m_cAmount, "%i", m_nCurrentAmount);
|
||||
ptxtAmount->DisplayString(pDC, m_cAmount, 16, FW_BOLD, RGB(0, 0, 0));
|
||||
|
||||
|
||||
ptxtCAmount = new CText(pDC, pSetAmountPalette, &rectCAmount, JUSTIFY_LEFT);
|
||||
Common::sprintf_s(cDisplay, "Current Amount: %li", lCAmount);
|
||||
ptxtCAmount->DisplayString(pDC, cDisplay, 14, FW_BOLD, RGB(0, 0, 0));
|
||||
|
||||
switch (m_nCurrentAmount) {
|
||||
case 10:
|
||||
nScrollPos = 1;
|
||||
break;
|
||||
case 25:
|
||||
nScrollPos = 2;
|
||||
break;
|
||||
case 50:
|
||||
nScrollPos = 3;
|
||||
break;
|
||||
case 100:
|
||||
nScrollPos = 4;
|
||||
break;
|
||||
case 250:
|
||||
nScrollPos = 5;
|
||||
break;
|
||||
case 500:
|
||||
nScrollPos = 6;
|
||||
break;
|
||||
case 1000:
|
||||
nScrollPos = 7;
|
||||
break;
|
||||
case 2500:
|
||||
nScrollPos = 8;
|
||||
break;
|
||||
case 5000:
|
||||
nScrollPos = 9;
|
||||
break;
|
||||
case 10000:
|
||||
nScrollPos = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
pSetAmountSB = (CScrollBar *)GetDlgItem(IDC_SETAMT_BAR);
|
||||
pSetAmountSB->SetScrollRange(AMOUNTMIN, AMOUNTMAX, true);
|
||||
pSetAmountSB->SetScrollPos(nScrollPos, true);
|
||||
|
||||
ReleaseDC(pDC);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnHScroll
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This is the functionality of the scroll bar
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
void CSetAmountDlg::OnHScroll(unsigned int nSBCode, unsigned int nPos, CScrollBar* pScrollBar) {
|
||||
int oldAmnt = 0;
|
||||
int newAmnt = 0;
|
||||
CDC *pDC;
|
||||
|
||||
// first set the range of the scoll bar
|
||||
pScrollBar->SetScrollRange(AMOUNTMIN, AMOUNTMAX, true);
|
||||
|
||||
// get the scroll bar's current position, i.e. the current amount set
|
||||
oldAmnt = pScrollBar->GetScrollPos();
|
||||
newAmnt = oldAmnt;
|
||||
|
||||
// switching off of what the scroll bar wants to do, act accordingly.
|
||||
switch (nSBCode) {
|
||||
case SB_LEFT:
|
||||
case SB_LINELEFT:
|
||||
case SB_PAGELEFT:
|
||||
if (oldAmnt != 0)
|
||||
newAmnt--;
|
||||
else
|
||||
newAmnt = 0;
|
||||
break;
|
||||
case SB_RIGHT:
|
||||
case SB_LINERIGHT:
|
||||
case SB_PAGERIGHT:
|
||||
if (oldAmnt != AMOUNTMAX)
|
||||
newAmnt++;
|
||||
else
|
||||
newAmnt = AMOUNTMAX;
|
||||
break;
|
||||
|
||||
case SB_THUMBPOSITION:
|
||||
case SB_THUMBTRACK:
|
||||
newAmnt = nPos;
|
||||
break;
|
||||
}
|
||||
|
||||
// set the scroll bar to the new position
|
||||
pScrollBar->SetScrollPos(newAmnt, true);
|
||||
|
||||
// set the current amount to the new amount just set
|
||||
switch (newAmnt) {
|
||||
case 1:
|
||||
m_nCurrentAmount = 10;
|
||||
break;
|
||||
case 2:
|
||||
m_nCurrentAmount = 25;
|
||||
break;
|
||||
case 3:
|
||||
m_nCurrentAmount = 50;
|
||||
break;
|
||||
case 4:
|
||||
m_nCurrentAmount = 100;
|
||||
break;
|
||||
case 5:
|
||||
m_nCurrentAmount = 250;
|
||||
break;
|
||||
case 6:
|
||||
m_nCurrentAmount = 500;
|
||||
break;
|
||||
case 7:
|
||||
m_nCurrentAmount = 1000;
|
||||
break;
|
||||
case 8:
|
||||
m_nCurrentAmount = 2500;
|
||||
break;
|
||||
case 9:
|
||||
m_nCurrentAmount = 5000;
|
||||
break;
|
||||
case 10:
|
||||
m_nCurrentAmount = 10000;
|
||||
break;
|
||||
}
|
||||
|
||||
// paint this new amount onto the screen
|
||||
pDC = GetDC();
|
||||
Common::sprintf_s(m_cAmount, "%i", m_nCurrentAmount);
|
||||
ptxtAmount->DisplayString(pDC, m_cAmount, 16, FW_BOLD, RGB(0, 0, 0));
|
||||
ReleaseDC(pDC);
|
||||
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
bool CSetAmountDlg::OnEraseBkgnd(CDC *pDC) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSetAmountDlg::ClearDialogImage() {
|
||||
|
||||
if (pAmountButton != nullptr) {
|
||||
delete pAmountButton;
|
||||
pAmountButton = nullptr;
|
||||
}
|
||||
|
||||
if (pCancelButton != nullptr) {
|
||||
delete pCancelButton;
|
||||
pCancelButton = nullptr;
|
||||
}
|
||||
|
||||
ValidateRect(nullptr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetAmountDlg::OnDestroy() {
|
||||
// send a message to the calling app to tell it the user has quit the game
|
||||
delete ptxtAmount;
|
||||
CBmpDialog::OnDestroy();
|
||||
}
|
||||
|
||||
// Message Map
|
||||
BEGIN_MESSAGE_MAP(CSetAmountDlg, CBmpDialog)
|
||||
//{{AFX_MSG_MAP( CMainPokerWindow )
|
||||
ON_WM_PAINT()
|
||||
ON_WM_HSCROLL()
|
||||
ON_WM_DESTROY()
|
||||
ON_WM_ERASEBKGND()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
228
engines/bagel/hodjnpodj/poker/c1btndlg.cpp
Normal file
228
engines/bagel/hodjnpodj/poker/c1btndlg.cpp
Normal file
@@ -0,0 +1,228 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/afxwin.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/cbofdlg.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/text.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
#include "bagel/hodjnpodj/poker/c1btndlg.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define TEXT_COLOR RGB(0, 0, 0) // displayed text color
|
||||
|
||||
#define MESSAGE_COL 16 // first message box positioning
|
||||
#define MESSAGE_ROW 40
|
||||
|
||||
#define MESSAGE_WIDTH 186 // standard message box dims
|
||||
#define MESSAGE_HEIGHT 20
|
||||
|
||||
#define MESSAGE2_ROW_OFFSET ( MESSAGE_HEIGHT + 4 ) // Row offset from first
|
||||
// message box
|
||||
|
||||
#define IDD_1BTNDLG 321
|
||||
|
||||
|
||||
|
||||
C1ButtonDialog::C1ButtonDialog(CWnd *pParent, CPalette *pPalette,
|
||||
const char *pszButton1Text, const char *pszText1,
|
||||
const char *pszText2, const char *pszText3)
|
||||
: CBmpDialog(pParent, pPalette, IDD_1BTNDLG, ".\\ART\\MSSCROLL.BMP") {
|
||||
assert(pParent != nullptr);
|
||||
assert(pPalette != nullptr);
|
||||
assert(pszText1 != nullptr);
|
||||
assert(pszButton1Text != nullptr);
|
||||
|
||||
// Initialize all members
|
||||
//
|
||||
m_pPalette = pPalette;
|
||||
m_pszMessage1 = pszText1;
|
||||
m_pszMessage2 = pszText2;
|
||||
m_pszMessage3 = pszText3;
|
||||
m_pszButton1Text = pszButton1Text;
|
||||
|
||||
m_cTextMessage1 = nullptr;
|
||||
m_cTextMessage2 = nullptr;
|
||||
m_cTextMessage3 = nullptr;
|
||||
|
||||
//{{AFX_DATA_INIT(C1ButtonDialog)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void C1ButtonDialog::ClearDialogImage() {
|
||||
if (m_pButton1 != nullptr) { // release the 1st button
|
||||
delete m_pButton1;
|
||||
m_pButton1 = nullptr;
|
||||
}
|
||||
|
||||
ValidateRect(nullptr);
|
||||
}
|
||||
|
||||
void C1ButtonDialog::OnDestroy() {
|
||||
if (m_cTextMessage1 != nullptr) {
|
||||
delete m_cTextMessage1;
|
||||
m_cTextMessage1 = nullptr;
|
||||
}
|
||||
|
||||
if (m_cTextMessage2 != nullptr) {
|
||||
delete m_cTextMessage2;
|
||||
m_cTextMessage2 = nullptr;
|
||||
}
|
||||
|
||||
if (m_cTextMessage3 != nullptr) {
|
||||
delete m_cTextMessage3;
|
||||
m_cTextMessage3 = nullptr;
|
||||
}
|
||||
|
||||
CBmpDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void C1ButtonDialog::DoDataExchange(CDataExchange* pDX) {
|
||||
CBmpDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(C1ButtonDialog)
|
||||
// NOTE: the ClassWizard will add DDX and DDV calls here
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(C1ButtonDialog, CBmpDialog)
|
||||
//{{AFX_MSG_MAP(C1ButtonDialog)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_ERASEBKGND()
|
||||
ON_WM_DESTROY()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// C1ButtonDialog message handlers
|
||||
|
||||
bool C1ButtonDialog::OnInitDialog() {
|
||||
CRect statsRect; // game stats displays
|
||||
int nStat_col_offset; // game stats placement
|
||||
int nStat_row_offset;
|
||||
int nStatWidth, nStatHeight;
|
||||
bool bAssertCheck;
|
||||
CDC *pDC;
|
||||
|
||||
CBmpDialog::OnInitDialog();
|
||||
|
||||
pDC = GetDC();
|
||||
|
||||
nStat_col_offset = MESSAGE_COL;
|
||||
nStat_row_offset = MESSAGE_ROW;
|
||||
nStatWidth = MESSAGE_WIDTH;
|
||||
nStatHeight = MESSAGE_HEIGHT;
|
||||
statsRect.SetRect(
|
||||
nStat_col_offset,
|
||||
nStat_row_offset,
|
||||
nStat_col_offset + nStatWidth,
|
||||
nStat_row_offset + nStatHeight
|
||||
);
|
||||
|
||||
if ((m_cTextMessage1 = new CText()) != nullptr) {
|
||||
bAssertCheck = (*m_cTextMessage1).SetupText(pDC, m_pPalette, &statsRect, JUSTIFY_CENTER);
|
||||
ASSERT(bAssertCheck); // initialize the text objext
|
||||
}
|
||||
|
||||
nStat_row_offset += MESSAGE2_ROW_OFFSET;
|
||||
statsRect.SetRect(nStat_col_offset,
|
||||
nStat_row_offset,
|
||||
nStat_col_offset + nStatWidth,
|
||||
nStat_row_offset + nStatHeight
|
||||
);
|
||||
|
||||
if ((m_cTextMessage2 = new CText()) != nullptr) {
|
||||
bAssertCheck = (*m_cTextMessage2).SetupText(pDC, m_pPalette, &statsRect, JUSTIFY_CENTER);
|
||||
ASSERT(bAssertCheck); // initialize the text objext
|
||||
}
|
||||
|
||||
nStat_row_offset += MESSAGE2_ROW_OFFSET;
|
||||
statsRect.SetRect(nStat_col_offset,
|
||||
nStat_row_offset,
|
||||
nStat_col_offset + nStatWidth,
|
||||
nStat_row_offset + nStatHeight
|
||||
);
|
||||
|
||||
if ((m_cTextMessage3 = new CText()) != nullptr) {
|
||||
bAssertCheck = m_cTextMessage3->SetupText(pDC, m_pPalette, &statsRect, JUSTIFY_CENTER);
|
||||
ASSERT(bAssertCheck); // initialize the text objext
|
||||
}
|
||||
|
||||
ReleaseDC(pDC);
|
||||
|
||||
if ((m_pButton1 = new CColorButton) != nullptr) { // build the first color button
|
||||
(*m_pButton1).SetPalette(m_pPalette); // set the palette to use
|
||||
(*m_pButton1).SetControl(IDOK, this); // tie to the dialog control
|
||||
(*m_pButton1).SetWindowText(m_pszButton1Text);
|
||||
}
|
||||
|
||||
return true; // return true unless you set the focus to a control
|
||||
}
|
||||
|
||||
void C1ButtonDialog::OnPaint() {
|
||||
// TODO: Add your message handler code here
|
||||
CDC *pDC;
|
||||
bool bAssertCheck;
|
||||
|
||||
CBmpDialog::OnPaint();
|
||||
// Do not call CDialog::OnPaint() for painting messages
|
||||
|
||||
pDC = GetDC();
|
||||
|
||||
if (m_pszMessage1 != nullptr) {
|
||||
bAssertCheck = (*m_cTextMessage1).DisplayString(pDC, m_pszMessage1, 21, FW_BOLD, TEXT_COLOR);
|
||||
ASSERT(bAssertCheck);
|
||||
}
|
||||
|
||||
if (m_pszMessage2 != nullptr) {
|
||||
bAssertCheck = (*m_cTextMessage2).DisplayString(pDC, m_pszMessage2, 21, FW_BOLD, TEXT_COLOR);
|
||||
ASSERT(bAssertCheck);
|
||||
}
|
||||
|
||||
if (m_pszMessage3 != nullptr) {
|
||||
bAssertCheck = (*m_cTextMessage3).DisplayString(pDC, m_pszMessage3, 21, FW_BOLD, TEXT_COLOR);
|
||||
ASSERT(bAssertCheck);
|
||||
}
|
||||
|
||||
ReleaseDC(pDC);
|
||||
}
|
||||
|
||||
void C1ButtonDialog::OnOK() {
|
||||
ClearDialogImage();
|
||||
EndDialog(IDOK);
|
||||
}
|
||||
|
||||
void C1ButtonDialog::OnCancel() {
|
||||
ClearDialogImage();
|
||||
EndDialog(IDCANCEL);
|
||||
}
|
||||
|
||||
bool C1ButtonDialog::OnEraseBkgnd(CDC *) {
|
||||
// Prevents refreshing of background
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
81
engines/bagel/hodjnpodj/poker/c1btndlg.h
Normal file
81
engines/bagel/hodjnpodj/poker/c1btndlg.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_C1BTNDLG_H
|
||||
#define HODJNPODJ_POKER_C1BTNDLG_H
|
||||
|
||||
#include "bagel/afxwin.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/text.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/cbofdlg.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define CBUTTON1 IDOK
|
||||
#define CBUTTON2 IDCANCEL
|
||||
|
||||
class C1ButtonDialog : public CBmpDialog {
|
||||
public:
|
||||
|
||||
// standard constructor
|
||||
C1ButtonDialog(CWnd *, CPalette *, const char *, const char *, const char *pszText2 = nullptr, const char *pszText3 = nullptr);
|
||||
|
||||
private:
|
||||
void ClearDialogImage();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(C1ButtonDialog)
|
||||
// NOTE: the ClassWizard will add data members here
|
||||
//}}AFX_DATA
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange *pDX) override; // DDX/DDV support
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(C1ButtonDialog)
|
||||
afx_msg void OnPaint();
|
||||
virtual void OnOK() override;
|
||||
virtual void OnCancel() override;
|
||||
virtual bool OnInitDialog() override;
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg bool OnEraseBkgnd(CDC *pDC);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
CText *m_cTextMessage1 = nullptr;
|
||||
CText *m_cTextMessage2 = nullptr;
|
||||
CText *m_cTextMessage3 = nullptr;
|
||||
const char *m_pszMessage1 = nullptr;
|
||||
const char *m_pszMessage2 = nullptr;
|
||||
const char *m_pszMessage3 = nullptr;
|
||||
const char *m_pszButton1Text = nullptr;
|
||||
CColorButton *m_pButton1 = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
154
engines/bagel/hodjnpodj/poker/dialogs.h
Normal file
154
engines/bagel/hodjnpodj/poker/dialogs.h
Normal file
@@ -0,0 +1,154 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_DIALOGS_H
|
||||
#define HODJNPODJ_POKER_DIALOGS_H
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/cbofdlg.h"
|
||||
#include "bagel/hodjnpodj/poker/poker.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define AMOUNTMAX 10
|
||||
#define AMOUNTMIN 1
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////// Options Specific to Poker
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class COptionsDlg : public CBmpDialog {
|
||||
private:
|
||||
bool m_bSoundOn = false; // bool for telling me should I play sounds or not
|
||||
bool m_bDisableSets = false; // bool for telling me should I disable the
|
||||
// "Set Amount" and "Set Payoffs" buttons
|
||||
|
||||
public:
|
||||
COptionsDlg(CWnd* pParent = nullptr, CPalette *pPalette = nullptr, unsigned int = IDD_OPTIONS);
|
||||
void SetInitialOptions(bool = false, bool = true); // Sets the private members
|
||||
void ClearDialogImage();
|
||||
|
||||
protected:
|
||||
virtual bool OnCommand(WPARAM, LPARAM) override;
|
||||
virtual bool OnInitDialog() override;
|
||||
afx_msg void OnPaint();
|
||||
afx_msg bool OnEraseBkgnd(CDC *pDC);
|
||||
afx_msg void OnDestroy();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////// Set Current Number of Crowns
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class CSetAmountDlg : public CBmpDialog {
|
||||
private:
|
||||
int m_nCurrentAmount = 0; // contains the current amount set
|
||||
char m_cAmount[6] = {};
|
||||
CRect rectDisplayAmount;
|
||||
|
||||
public:
|
||||
CSetAmountDlg(CWnd* pParent = nullptr, CPalette *pPalette = nullptr, unsigned int = IDD_SETAMOUNT);
|
||||
void SetInitialOptions(long = 0); // Sets the private members
|
||||
void ClearDialogImage();
|
||||
bool OnInitDialog() override;
|
||||
|
||||
protected:
|
||||
//{{AFX_MSG(COptions)
|
||||
virtual bool OnCommand(WPARAM, LPARAM) override;
|
||||
afx_msg void OnHScroll(unsigned int nSBCode, unsigned int nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg bool OnEraseBkgnd(CDC *pDC);
|
||||
afx_msg void OnDestroy();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////// Set the Payoffs
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class CSetPayoffsDlg : public CBmpDialog {
|
||||
private:
|
||||
char m_cPair[6] = {};
|
||||
char m_cPairJacksPlus[6] = {};
|
||||
char m_cTwoPair[6] = {};
|
||||
char m_cThreeOAK[6] = {};
|
||||
char m_cStriaght[6] = {};
|
||||
char m_cFlush[6] = {};
|
||||
char m_cFullHouse[6] = {};
|
||||
char m_cFourOAK[6] = {};
|
||||
char m_cStraightFlush[6] = {};
|
||||
char m_cRoyalFlush[6] = {};
|
||||
int m_nSetOfOdds = 0;
|
||||
bool m_bJustDisplay = false;
|
||||
CRect crectRedraw;
|
||||
CRect rectPair, rectPairJacks;
|
||||
CRect rectTwoPair, rectThree;
|
||||
CRect rectStraight, rectFlush;
|
||||
CRect rectFullHouse, rectFour;
|
||||
CRect rectStraightFlush;
|
||||
CRect rectRoyalFlush;
|
||||
|
||||
public:
|
||||
CSetPayoffsDlg(CWnd* pParent = nullptr, CPalette *pPalette = nullptr, unsigned int = IDD_WINRATIO, int = IDC_POPO, bool = false);
|
||||
void ClearDialogImage();
|
||||
void OnKlingon(bool = true);
|
||||
void OnKuwaiti(bool = true);
|
||||
void OnMartian(bool = true);
|
||||
void OnPopo(bool = true);
|
||||
void OnVegas(bool = true);
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange *) override;
|
||||
virtual bool OnInitDialog() override;
|
||||
afx_msg void OnSetpayoffs();
|
||||
virtual bool OnCommand(WPARAM, LPARAM) override;
|
||||
afx_msg void OnCancel() override;
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg bool OnEraseBkgnd(CDC *pDC);
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////// User won dialog
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
class CUserWonDlg : public CBmpDialog {
|
||||
private:
|
||||
int m_nWinPhrase = 0;
|
||||
|
||||
public:
|
||||
CUserWonDlg(CWnd *pParent = nullptr, CPalette *pPalette = nullptr, unsigned int = IDD_USERWON);
|
||||
void SetInitialOptions(int = 0);
|
||||
void ClearDialogImage();
|
||||
bool OnInitDialog() override;
|
||||
|
||||
protected:
|
||||
virtual void OnOK() override;
|
||||
virtual bool OnCommand(WPARAM, LPARAM) override;
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
91
engines/bagel/hodjnpodj/poker/init.cpp
Normal file
91
engines/bagel/hodjnpodj/poker/init.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/afxwin.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
#include "bagel/hodjnpodj/poker/poker.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
HINSTANCE hDLLInst;
|
||||
HINSTANCE hExeInst;
|
||||
|
||||
CMainPokerWindow *pcwndPoker = nullptr; // pointer to the poker's main window
|
||||
CPalette *pTestPalette = nullptr;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Public C interface
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* RunPoker
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This is the API function for the DLL. It is what the calling app
|
||||
* calls to invoke poker
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* hParentWnd, lpGameInfo
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
HWND FAR PASCAL RunPoker(HWND hParentWnd, LPGAMESTRUCT lpGameInfo) {
|
||||
// if the pointer has garbage in it, the clean it out
|
||||
if (pcwndPoker != nullptr) {
|
||||
pcwndPoker = nullptr;
|
||||
}
|
||||
|
||||
// create a my poker window and show it
|
||||
pcwndPoker = new CMainPokerWindow(hParentWnd, lpGameInfo);
|
||||
pcwndPoker->SetActiveWindow();
|
||||
pcwndPoker->ResetGame();
|
||||
|
||||
// return the handle to this window
|
||||
hDLLInst = (HINSTANCE)GetWindowWord(pcwndPoker->m_hWnd, GWW_HINSTANCE);
|
||||
hExeInst = (HINSTANCE)GetWindowWord(hParentWnd, GWW_HINSTANCE);
|
||||
|
||||
if (lpGameInfo->bPlayingMetagame == false) {
|
||||
pcwndPoker->UpdateWindow();
|
||||
MFC::PostMessage(pcwndPoker->m_hWnd, WM_COMMAND, IDC_OPTION, BN_CLICKED);
|
||||
}
|
||||
|
||||
return pcwndPoker->m_hWnd;
|
||||
}
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
38
engines/bagel/hodjnpodj/poker/init.h
Normal file
38
engines/bagel/hodjnpodj/poker/init.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_DLLINIT_H
|
||||
#define HODJNPODJ_POKER_DLLINIT_H
|
||||
|
||||
#include "bagel/afxwin.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/gamedll.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
HWND FAR PASCAL RunPoker(HWND, LPGAMESTRUCT);
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
266
engines/bagel/hodjnpodj/poker/optdlg.cpp
Normal file
266
engines/bagel/hodjnpodj/poker/optdlg.cpp
Normal file
@@ -0,0 +1,266 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/stdafx.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
#include "bagel/hodjnpodj/poker/dialogs.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
static CPalette *m_pOptionsPalette = nullptr;
|
||||
|
||||
static CColorButton *pAmountButton = nullptr;
|
||||
static CColorButton *pPayoffButton = nullptr;
|
||||
static CColorButton *pCancelButton = nullptr;
|
||||
/*****************************************************************
|
||||
*
|
||||
* COptionsDlg
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Constructor sends the input to the COptions constructor and
|
||||
* the intializes the private members
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* Those needed to contruct a COptions dialog: pParent,pPalette, nID
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* m_bSoundOn, m_bDisableSets
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
COptionsDlg::COptionsDlg(CWnd *pParent, CPalette *pPalette, unsigned int nID)
|
||||
: CBmpDialog(pParent, pPalette, nID, ".\\ART\\SSCROLL.BMP") {
|
||||
m_bSoundOn = true;
|
||||
m_bDisableSets = false;
|
||||
m_pOptionsPalette = pPalette;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnCommand
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Process the Toggle Sound, "Set Amount", and "Set Payoffs" buttons
|
||||
*
|
||||
* This function is called when a WM_COMMAND message is issued,
|
||||
* typically in order to process control related activities.
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* wParam identifier for the button to be processed
|
||||
* lParam type of message to be processed
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
bool COptionsDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
|
||||
// What ever button is clicked, end the dialog and send the ID of the button
|
||||
// clicked as the return from the dialog
|
||||
if (HIWORD(lParam) == BN_CLICKED) {
|
||||
switch (wParam) {
|
||||
case ID_TOGGLESOUND:
|
||||
ClearDialogImage();
|
||||
EndDialog(ID_TOGGLESOUND);
|
||||
return 1;
|
||||
break;
|
||||
case ID_SETUSERAMT:
|
||||
ClearDialogImage();
|
||||
EndDialog(ID_SETUSERAMT);
|
||||
return 1;
|
||||
break;
|
||||
case ID_SETPAYOFFS:
|
||||
ClearDialogImage();
|
||||
EndDialog(ID_SETPAYOFFS);
|
||||
return 1;
|
||||
break;
|
||||
case ID_CANCEL:
|
||||
ClearDialogImage();
|
||||
EndDialog(0);
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return CDialog::OnCommand(wParam, lParam);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnInitDialog
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This initializes the options dialog to enable and disable
|
||||
* buttons when necessary
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* bool to tell windows that it has dealt this function
|
||||
*
|
||||
****************************************************************/
|
||||
bool COptionsDlg::OnInitDialog() {
|
||||
bool bSuccess;
|
||||
|
||||
CBmpDialog::OnInitDialog();
|
||||
|
||||
pPayoffButton = new CColorButton();
|
||||
ASSERT(pPayoffButton != nullptr);
|
||||
pPayoffButton->SetPalette(m_pOptionsPalette);
|
||||
bSuccess = pPayoffButton->SetControl(ID_SETPAYOFFS, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pAmountButton = new CColorButton();
|
||||
ASSERT(pAmountButton != nullptr);
|
||||
pAmountButton->SetPalette(m_pOptionsPalette);
|
||||
bSuccess = pAmountButton->SetControl(ID_SETUSERAMT, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pCancelButton = new CColorButton();
|
||||
ASSERT(pCancelButton != nullptr);
|
||||
pCancelButton->SetPalette(m_pOptionsPalette);
|
||||
bSuccess = pCancelButton->SetControl(ID_CANCEL, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
// if we are in the middle of a hand, or we are playing from the metagame
|
||||
// then disable the "Set Amount" and "Set Payoffs" buttons
|
||||
if (m_bDisableSets) {
|
||||
GetDlgItem(ID_SETUSERAMT)->EnableWindow(false);
|
||||
GetDlgItem(ID_SETPAYOFFS)->EnableWindow(false);
|
||||
}
|
||||
|
||||
// if the sound is on, set the text of the Toggle Sound button to "Sound Off"
|
||||
if (m_bSoundOn)
|
||||
SetDlgItemText(ID_TOGGLESOUND, "Sound Off");
|
||||
// otherwise set the text of the Toggle Sound button to "Sound On"
|
||||
else
|
||||
SetDlgItemText(ID_TOGGLESOUND, "Sound On");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* SetInitialOptions
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This sets the privates to the inputted values
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* bDisableSets = Should I disable the bet buttons
|
||||
* bSoundOn = Is the sound turned on
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* m_bDisableSets = bDisableSets
|
||||
* m_bSoundOn = bSoundOn
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
*
|
||||
****************************************************************/
|
||||
void COptionsDlg::SetInitialOptions(bool bDisableSets, bool bSoundOn) {
|
||||
m_bDisableSets = bDisableSets;
|
||||
m_bSoundOn = bSoundOn;
|
||||
return;
|
||||
}
|
||||
|
||||
bool COptionsDlg::OnEraseBkgnd(CDC *pDC) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void COptionsDlg::OnDestroy() {
|
||||
CBmpDialog::OnDestroy();
|
||||
}
|
||||
|
||||
void COptionsDlg::ClearDialogImage() {
|
||||
|
||||
if (pAmountButton != nullptr) {
|
||||
delete pAmountButton;
|
||||
pAmountButton = nullptr;
|
||||
}
|
||||
if (pPayoffButton != nullptr) {
|
||||
delete pPayoffButton;
|
||||
pPayoffButton = nullptr;
|
||||
}
|
||||
if (pCancelButton != nullptr) {
|
||||
delete pCancelButton;
|
||||
pCancelButton = nullptr;
|
||||
}
|
||||
|
||||
ValidateRect(nullptr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/// Message Map
|
||||
BEGIN_MESSAGE_MAP(COptionsDlg, CBmpDialog)
|
||||
//{{AFX_MSG_MAP( CMainPokerWindow )
|
||||
ON_WM_DESTROY()
|
||||
ON_WM_ERASEBKGND()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
89
engines/bagel/hodjnpodj/poker/options.h
Normal file
89
engines/bagel/hodjnpodj/poker/options.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_OPTIONS_H
|
||||
#define HODJNPODJ_POKER_OPTIONS_H
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/dibdoc.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/rules.h"
|
||||
#include "bagel/hodjnpodj/globals.h"
|
||||
#include "bagel/hodjnpodj/poker/poker.h"
|
||||
#include "bagel/hodjnpodj/poker/optres.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
class COptions : public CDialog {
|
||||
private:
|
||||
|
||||
int m_iDlgId;
|
||||
|
||||
// Construction
|
||||
public:
|
||||
// COptions(CWnd* pParent = nullptr, CPalette *pPalette = nullptr); // standard constructor
|
||||
COptions(CWnd* pParent, CPalette *pPalette, int iDlgId) ;
|
||||
// #include "options.inc" // put in your own include file
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(COptions)
|
||||
enum { IDD = IDD_OPTIONS_DIALOG };
|
||||
// NOTE: the ClassWizard will add data members here
|
||||
//}}AFX_DATA
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
void RefreshBackground();
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
|
||||
void OnCancel();
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(COptions)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
virtual bool OnInitDialog();
|
||||
afx_msg bool OnEraseBkgnd(CDC *pDC);
|
||||
virtual void OnOK();
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnShowWindow(bool bShow, unsigned int nStatus);
|
||||
afx_msg void OnSize(unsigned int nType, int cx, int cy);
|
||||
afx_msg void OnMouseMove(unsigned int nFlags, CPoint point);
|
||||
afx_msg void OnLButtonDown(unsigned int nFlags, CPoint point);
|
||||
afx_msg void OnClickedRules() ;
|
||||
afx_msg void OnClickedNewgame() ;
|
||||
afx_msg void OnClickedOptions() ;
|
||||
afx_msg void OnClickedReturn();
|
||||
afx_msg void OnClickedQuit();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
CFont *m_pFont;
|
||||
CBitmap *m_pDlgBackground;
|
||||
};
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
56
engines/bagel/hodjnpodj/poker/optres.h
Normal file
56
engines/bagel/hodjnpodj/poker/optres.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_OPTRES_H
|
||||
#define HODJNPODJ_POKER_OPTRES_H
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define IDC_OPTIONS_ARROWUP 503
|
||||
#define IDC_OPTIONS_ARROWDN 504
|
||||
|
||||
#define ID_OPTIONS_CODES 450
|
||||
|
||||
#define IDR_BITMAP_SCROLL 451
|
||||
#if 0
|
||||
#define IDD_OPTIONS_DIALOG 452
|
||||
|
||||
#define IDC_OPTIONS_RETURN 453
|
||||
#define IDC_OPTIONS_QUIT 454
|
||||
#define IDC_OPTIONS_RULES 455
|
||||
#define IDC_OPTIONS_NEWGAME 456
|
||||
#define IDC_OPTIONS_OPTIONS 457
|
||||
#define IDC_OPTIONS_AUDIO 458
|
||||
#endif
|
||||
#define IDC_SUB_OKAY 9
|
||||
#define IDC_SUB_CANCEL 10
|
||||
#define IDC_SUB_CROSS 11
|
||||
#define IDC_SUB_CROSSPLUS 12
|
||||
#define IDC_SUB_TRIANGLE 13
|
||||
#define IDC_SUB_TRIANGLEPLUS 14
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
615
engines/bagel/hodjnpodj/poker/poffsdlg.cpp
Normal file
615
engines/bagel/hodjnpodj/poker/poffsdlg.cpp
Normal file
@@ -0,0 +1,615 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/stdafx.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
#include "bagel/hodjnpodj/poker/dialogs.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
CPalette *pPayoffPalette = nullptr;
|
||||
|
||||
CText *ptxtPair = nullptr;
|
||||
CText *ptxtPairJacks = nullptr;
|
||||
CText *ptxtTwoPair = nullptr;
|
||||
CText *ptxtThreeOAK = nullptr;
|
||||
CText *ptxtStraight = nullptr;
|
||||
CText *ptxtFlush = nullptr;
|
||||
CText *ptxtFullHouse = nullptr;
|
||||
CText *ptxtFourOAK = nullptr;
|
||||
CText *ptxtStraightFlush = nullptr;
|
||||
CText *ptxtRoyalFlush = nullptr;
|
||||
|
||||
static CColorButton *pSetPayButton = nullptr;
|
||||
static CColorButton *pCancelButton = nullptr;
|
||||
static CColorButton *pOKButton = nullptr;
|
||||
|
||||
static CRadioButton *pKlingonButton = nullptr;
|
||||
static CRadioButton *pVegasButton = nullptr;
|
||||
static CRadioButton *pPoPorButton = nullptr;
|
||||
static CRadioButton *pKuwaitiButton = nullptr;
|
||||
static CRadioButton *pMartianButton = nullptr;
|
||||
|
||||
CSetPayoffsDlg::CSetPayoffsDlg(CWnd *pParent, CPalette *pPalette, unsigned int nID, int nOdds, bool bJustDisplay)
|
||||
: CBmpDialog(pParent, pPalette, nID, ".\\ART\\MSCROLL.BMP"),
|
||||
crectRedraw(10, 140, 44, 290),
|
||||
rectPair(10, 131, 80, 146),
|
||||
rectPairJacks(10, 145, 80, 160),
|
||||
rectTwoPair(10, 159, 80, 174),
|
||||
rectThree(10, 173, 80, 188),
|
||||
rectStraight(10, 187, 80, 202),
|
||||
rectFlush(10, 201, 80, 216),
|
||||
rectFullHouse(10, 215, 80, 230),
|
||||
rectFour(10, 229, 80, 244),
|
||||
rectStraightFlush(10, 243, 80, 258),
|
||||
rectRoyalFlush(10, 257, 80, 272) {
|
||||
ptxtPair = new CText;
|
||||
ptxtPairJacks = new CText;
|
||||
ptxtTwoPair = new CText;
|
||||
ptxtThreeOAK = new CText;
|
||||
ptxtStraight = new CText;
|
||||
ptxtFlush = new CText;
|
||||
ptxtFullHouse = new CText;
|
||||
ptxtFourOAK = new CText;
|
||||
ptxtStraightFlush = new CText;
|
||||
ptxtRoyalFlush = new CText;
|
||||
|
||||
m_bJustDisplay = bJustDisplay;
|
||||
m_nSetOfOdds = nOdds;
|
||||
|
||||
pPayoffPalette = pPalette;
|
||||
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::DoDataExchange(CDataExchange *pDX) {
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
bool CSetPayoffsDlg::OnInitDialog() {
|
||||
bool bSuccess = false;
|
||||
|
||||
CBmpDialog::OnInitDialog();
|
||||
|
||||
pOKButton = new CColorButton();
|
||||
ASSERT(pOKButton != nullptr);
|
||||
pOKButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pOKButton->SetControl(ID_CANCEL_VIEW, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pSetPayButton = new CColorButton();
|
||||
ASSERT(pSetPayButton != nullptr);
|
||||
pSetPayButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pSetPayButton->SetControl(ID_SETPAYOFFS, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pCancelButton = new CColorButton();
|
||||
ASSERT(pCancelButton != nullptr);
|
||||
pCancelButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pCancelButton->SetControl(ID_CANCEL, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pKlingonButton = new CRadioButton();
|
||||
ASSERT(pKlingonButton != nullptr);
|
||||
pKlingonButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pKlingonButton->SetControl(ID_KLINGON, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pVegasButton = new CRadioButton();
|
||||
ASSERT(pVegasButton != nullptr);
|
||||
pVegasButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pVegasButton->SetControl(ID_VEGAS, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pPoPorButton = new CRadioButton();
|
||||
ASSERT(pPoPorButton != nullptr);
|
||||
pPoPorButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pPoPorButton->SetControl(ID_POPO, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pKuwaitiButton = new CRadioButton();
|
||||
ASSERT(pKuwaitiButton != nullptr);
|
||||
pKuwaitiButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pKuwaitiButton->SetControl(ID_KUWAITI, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
pMartianButton = new CRadioButton();
|
||||
ASSERT(pMartianButton != nullptr);
|
||||
pMartianButton->SetPalette(pPayoffPalette);
|
||||
bSuccess = pMartianButton->SetControl(ID_MARTIAN, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
switch (m_nSetOfOdds) {
|
||||
case IDC_KLINGON:
|
||||
OnKlingon(false);
|
||||
break;
|
||||
case IDC_VEGAS:
|
||||
OnVegas(false);
|
||||
break;
|
||||
case IDC_MARTIAN:
|
||||
OnMartian(false);
|
||||
break;
|
||||
case IDC_KUWAITI:
|
||||
OnKuwaiti(false);
|
||||
break;
|
||||
case IDC_POPO:
|
||||
default:
|
||||
OnPopo(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_bJustDisplay) {
|
||||
pKlingonButton->EnableWindow(false);
|
||||
pVegasButton->EnableWindow(false);
|
||||
pPoPorButton->EnableWindow(false);
|
||||
pKuwaitiButton->EnableWindow(false);
|
||||
pMartianButton->EnableWindow(false);
|
||||
pSetPayButton->ShowWindow(SW_HIDE);
|
||||
pCancelButton->ShowWindow(SW_HIDE);
|
||||
pOKButton->SetFocus();
|
||||
} else {
|
||||
pOKButton->ShowWindow(SW_HIDE);
|
||||
pSetPayButton->SetFocus();
|
||||
}
|
||||
|
||||
// SetDefID( ID_POPO );
|
||||
return true;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnCommand
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Process the "Set" and "Cancel" buttons
|
||||
*
|
||||
* This function is called when a WM_COMMAND message is issued,
|
||||
* typically in order to process control related activities.
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* wParam identifier for the button to be processed
|
||||
* lParam type of message to be processed
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
bool CSetPayoffsDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
|
||||
|
||||
// What ever button is clicked, end the dialog and send the ID of the button
|
||||
// clicked as the return from the dialog
|
||||
|
||||
if (HIWORD(lParam) == BN_CLICKED) {
|
||||
switch (wParam) {
|
||||
case IDC_KLINGON:
|
||||
OnKlingon();
|
||||
break;
|
||||
case IDC_VEGAS:
|
||||
OnVegas();
|
||||
break;
|
||||
case IDC_POPO:
|
||||
OnPopo();
|
||||
break;
|
||||
case IDC_MARTIAN:
|
||||
OnMartian();
|
||||
break;
|
||||
case IDC_KUWAITI:
|
||||
OnKuwaiti();
|
||||
break;
|
||||
case ID_SETPAYOFFS:
|
||||
case IDC_SETPAYOFFS:
|
||||
OnSetpayoffs();
|
||||
break;
|
||||
case IDC_CANCEL:
|
||||
case ID_CANCEL:
|
||||
case ID_CANCEL_VIEW:
|
||||
OnCancel();
|
||||
break;
|
||||
default:
|
||||
CBmpDialog::OnCommand(wParam, lParam);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnPaint
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Repaint the screen whenever needed; e.g. when uncovered by an
|
||||
* overlapping window, when maximized from an icon, and when it the
|
||||
* window is initially created.
|
||||
*
|
||||
* This uses the COptions Paint as its base, and displays the current
|
||||
* amount chosen from the scrollbar
|
||||
*
|
||||
* This routine is called whenever Windows sends a WM_PAINT message.
|
||||
* Note that creating a CPaintDC automatically does a BeginPaint and
|
||||
* an EndPaint call is done when it is destroyed at the end of this
|
||||
* function. CPaintDC's constructor needs the window (this).
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
void CSetPayoffsDlg::OnPaint() {
|
||||
CDC *pDC;
|
||||
int nOldBkMode;
|
||||
|
||||
// call COptions onpaint, to paint the background
|
||||
CBmpDialog::OnPaint();
|
||||
|
||||
pDC = GetDC();
|
||||
|
||||
// now paint in my text with a transparent background
|
||||
ptxtPair->SetupText(pDC, pPayoffPalette, &rectPair, JUSTIFY_RIGHT);
|
||||
ptxtPairJacks->SetupText(pDC, pPayoffPalette, &rectPairJacks, JUSTIFY_RIGHT);
|
||||
ptxtTwoPair->SetupText(pDC, pPayoffPalette, &rectTwoPair, JUSTIFY_RIGHT);
|
||||
ptxtThreeOAK->SetupText(pDC, pPayoffPalette, &rectThree, JUSTIFY_RIGHT);
|
||||
ptxtStraight->SetupText(pDC, pPayoffPalette, &rectStraight, JUSTIFY_RIGHT);
|
||||
ptxtFlush->SetupText(pDC, pPayoffPalette, &rectFlush, JUSTIFY_RIGHT);
|
||||
ptxtFullHouse->SetupText(pDC, pPayoffPalette, &rectFullHouse, JUSTIFY_RIGHT);
|
||||
ptxtFourOAK->SetupText(pDC, pPayoffPalette, &rectFour, JUSTIFY_RIGHT);
|
||||
ptxtStraightFlush->SetupText(pDC, pPayoffPalette, &rectStraightFlush, JUSTIFY_RIGHT);
|
||||
ptxtRoyalFlush->SetupText(pDC, pPayoffPalette, &rectRoyalFlush, JUSTIFY_RIGHT);
|
||||
|
||||
nOldBkMode = pDC->SetBkMode(TRANSPARENT);
|
||||
pDC->TextOut(65, 24, "Choose a set of payoffs.");
|
||||
pDC->TextOut(85, 130, "Pair");
|
||||
pDC->TextOut(85, 144, "Pair (Jacks or higher)");
|
||||
pDC->TextOut(85, 158, "Two Pairs");
|
||||
pDC->TextOut(85, 172, "Three of a kind");
|
||||
pDC->TextOut(85, 186, "Straight");
|
||||
pDC->TextOut(85, 200, "Flush");
|
||||
pDC->TextOut(85, 214, "Full House");
|
||||
pDC->TextOut(85, 228, "Four of a Kind");
|
||||
pDC->TextOut(85, 242, "Straight Flush");
|
||||
pDC->TextOut(85, 256, "Royal Flush");
|
||||
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
|
||||
pDC->SetBkMode(nOldBkMode);
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
void CSetPayoffsDlg::OnSetpayoffs() {
|
||||
// RefreshBackground();
|
||||
ClearDialogImage();
|
||||
EndDialog(m_nSetOfOdds);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnCancel() {
|
||||
// RefreshBackground();
|
||||
ClearDialogImage();
|
||||
EndDialog(0);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnKlingon(bool bDisplay) {
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
|
||||
pKlingonButton->SetCheck(1);
|
||||
Common::strcpy_s(m_cPair, 5, "0");
|
||||
Common::strcpy_s(m_cPairJacksPlus, 5, "0");
|
||||
Common::strcpy_s(m_cTwoPair, 5, "1");
|
||||
Common::strcpy_s(m_cThreeOAK, 5, "2");
|
||||
Common::strcpy_s(m_cStriaght, 5, "3");
|
||||
Common::strcpy_s(m_cFlush, 5, "4");
|
||||
Common::strcpy_s(m_cFullHouse, 5, "5");
|
||||
Common::strcpy_s(m_cFourOAK, 5, "10");
|
||||
Common::strcpy_s(m_cStraightFlush, 5, "20");
|
||||
Common::strcpy_s(m_cRoyalFlush, 5, "50");
|
||||
m_nSetOfOdds = IDC_KLINGON;
|
||||
|
||||
if (bDisplay) {
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
}
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnKuwaiti(bool bDisplay) {
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
|
||||
pKuwaitiButton->SetCheck(1);
|
||||
Common::strcpy_s(m_cPair, 5, "2");
|
||||
Common::strcpy_s(m_cPairJacksPlus, 5, "3");
|
||||
Common::strcpy_s(m_cTwoPair, 5, "5");
|
||||
Common::strcpy_s(m_cThreeOAK, 5, "10");
|
||||
Common::strcpy_s(m_cStriaght, 5, "15");
|
||||
Common::strcpy_s(m_cFlush, 5, "20");
|
||||
Common::strcpy_s(m_cFullHouse, 5, "50");
|
||||
Common::strcpy_s(m_cFourOAK, 5, "100");
|
||||
Common::strcpy_s(m_cStraightFlush, 5, "250");
|
||||
Common::strcpy_s(m_cRoyalFlush, 5, "1000");
|
||||
m_nSetOfOdds = IDC_KUWAITI;
|
||||
|
||||
if (bDisplay) {
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
}
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnMartian(bool bDisplay) {
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
|
||||
pMartianButton->SetCheck(1);
|
||||
Common::strcpy_s(m_cPair, 5, "2");
|
||||
Common::strcpy_s(m_cPairJacksPlus, 5, "2");
|
||||
Common::strcpy_s(m_cTwoPair, 5, "13");
|
||||
Common::strcpy_s(m_cThreeOAK, 5, "3");
|
||||
Common::strcpy_s(m_cStriaght, 5, "89");
|
||||
Common::strcpy_s(m_cFlush, 5, "98");
|
||||
Common::strcpy_s(m_cFullHouse, 5, "177");
|
||||
Common::strcpy_s(m_cFourOAK, 5, "4");
|
||||
Common::strcpy_s(m_cStraightFlush, 5, "23");
|
||||
Common::strcpy_s(m_cRoyalFlush, 5, "11");
|
||||
m_nSetOfOdds = IDC_MARTIAN;
|
||||
|
||||
if (bDisplay) {
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
}
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnPopo(bool bDisplay) {
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
|
||||
pPoPorButton->SetCheck(1);
|
||||
Common::strcpy_s(m_cPair, 5, "1");
|
||||
Common::strcpy_s(m_cPairJacksPlus, 5, "2");
|
||||
Common::strcpy_s(m_cTwoPair, 5, "3");
|
||||
Common::strcpy_s(m_cThreeOAK, 5, "5");
|
||||
Common::strcpy_s(m_cStriaght, 5, "8");
|
||||
Common::strcpy_s(m_cFlush, 5, "10");
|
||||
Common::strcpy_s(m_cFullHouse, 5, "15");
|
||||
Common::strcpy_s(m_cFourOAK, 5, "50");
|
||||
Common::strcpy_s(m_cStraightFlush, 5, "100");
|
||||
Common::strcpy_s(m_cRoyalFlush, 5, "500");
|
||||
m_nSetOfOdds = IDC_POPO;
|
||||
|
||||
if (bDisplay) {
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
}
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnVegas(bool bDisplay) {
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
|
||||
pVegasButton->SetCheck(1);
|
||||
Common::strcpy_s(m_cPair, 5, "0");
|
||||
Common::strcpy_s(m_cPairJacksPlus, 5, "1");
|
||||
Common::strcpy_s(m_cTwoPair, 5, "2");
|
||||
Common::strcpy_s(m_cThreeOAK, 5, "3");
|
||||
Common::strcpy_s(m_cStriaght, 5, "4");
|
||||
Common::strcpy_s(m_cFlush, 5, "6");
|
||||
Common::strcpy_s(m_cFullHouse, 5, "9");
|
||||
Common::strcpy_s(m_cFourOAK, 5, "25");
|
||||
Common::strcpy_s(m_cStraightFlush, 5, "50");
|
||||
Common::strcpy_s(m_cRoyalFlush, 5, "250");
|
||||
m_nSetOfOdds = IDC_VEGAS;
|
||||
|
||||
if (bDisplay) {
|
||||
ptxtPair->DisplayString(pDC, m_cPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtPairJacks->DisplayString(pDC, m_cPairJacksPlus, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtTwoPair->DisplayString(pDC, m_cTwoPair, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtThreeOAK->DisplayString(pDC, m_cThreeOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraight->DisplayString(pDC, m_cStriaght, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFlush->DisplayString(pDC, m_cFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFullHouse->DisplayString(pDC, m_cFullHouse, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtFourOAK->DisplayString(pDC, m_cFourOAK, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtStraightFlush->DisplayString(pDC, m_cStraightFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
ptxtRoyalFlush->DisplayString(pDC, m_cRoyalFlush, 12, FW_BOLD, RGB(0, 0, 200));
|
||||
}
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::OnDestroy() {
|
||||
// send a message to the calling app to tell it the user has quit the game
|
||||
delete ptxtPair;
|
||||
delete ptxtPairJacks;
|
||||
delete ptxtTwoPair;
|
||||
delete ptxtThreeOAK;
|
||||
delete ptxtStraight;
|
||||
delete ptxtFlush;
|
||||
delete ptxtFullHouse;
|
||||
delete ptxtFourOAK;
|
||||
delete ptxtStraightFlush;
|
||||
delete ptxtRoyalFlush;
|
||||
|
||||
if (pSetPayButton != nullptr) {
|
||||
delete pSetPayButton;
|
||||
pSetPayButton = nullptr;
|
||||
}
|
||||
if (pCancelButton != nullptr) {
|
||||
delete pCancelButton;
|
||||
pCancelButton = nullptr;
|
||||
}
|
||||
if (pOKButton != nullptr) {
|
||||
delete pOKButton;
|
||||
pOKButton = nullptr;
|
||||
}
|
||||
if (pKlingonButton != nullptr) {
|
||||
delete pKlingonButton;
|
||||
pKlingonButton = nullptr;
|
||||
}
|
||||
if (pVegasButton != nullptr) {
|
||||
delete pVegasButton;
|
||||
pVegasButton = nullptr;
|
||||
}
|
||||
if (pPoPorButton != nullptr) {
|
||||
delete pPoPorButton;
|
||||
pPoPorButton = nullptr;
|
||||
}
|
||||
if (pKuwaitiButton != nullptr) {
|
||||
delete pKuwaitiButton;
|
||||
pKuwaitiButton = nullptr;
|
||||
}
|
||||
if (pMartianButton != nullptr) {
|
||||
delete pMartianButton;
|
||||
pMartianButton = nullptr;
|
||||
}
|
||||
|
||||
CBmpDialog::OnDestroy();
|
||||
}
|
||||
|
||||
bool CSetPayoffsDlg::OnEraseBkgnd(CDC *pDC) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSetPayoffsDlg::ClearDialogImage() {
|
||||
|
||||
if (pSetPayButton != nullptr) {
|
||||
delete pSetPayButton;
|
||||
pSetPayButton = nullptr;
|
||||
}
|
||||
if (pOKButton != nullptr) {
|
||||
delete pOKButton;
|
||||
pOKButton = nullptr;
|
||||
}
|
||||
if (pCancelButton != nullptr) {
|
||||
delete pCancelButton;
|
||||
pCancelButton = nullptr;
|
||||
}
|
||||
if (pKlingonButton != nullptr) {
|
||||
delete pKlingonButton;
|
||||
pKlingonButton = nullptr;
|
||||
}
|
||||
if (pVegasButton != nullptr) {
|
||||
delete pVegasButton;
|
||||
pVegasButton = nullptr;
|
||||
}
|
||||
if (pPoPorButton != nullptr) {
|
||||
delete pPoPorButton;
|
||||
pPoPorButton = nullptr;
|
||||
}
|
||||
if (pKuwaitiButton != nullptr) {
|
||||
delete pKuwaitiButton;
|
||||
pKuwaitiButton = nullptr;
|
||||
}
|
||||
if (pMartianButton != nullptr) {
|
||||
delete pMartianButton;
|
||||
pMartianButton = nullptr;
|
||||
}
|
||||
|
||||
ValidateRect(nullptr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CSetPayoffsDlg, CBmpDialog)
|
||||
//{{AFX_MSG_MAP( CMainPokerWindow )
|
||||
ON_WM_PAINT()
|
||||
ON_WM_DESTROY()
|
||||
ON_WM_ERASEBKGND()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
2376
engines/bagel/hodjnpodj/poker/poker.cpp
Normal file
2376
engines/bagel/hodjnpodj/poker/poker.cpp
Normal file
File diff suppressed because it is too large
Load Diff
321
engines/bagel/hodjnpodj/poker/poker.h
Normal file
321
engines/bagel/hodjnpodj/poker/poker.h
Normal file
@@ -0,0 +1,321 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_POKER_H
|
||||
#define HODJNPODJ_POKER_POKER_H
|
||||
|
||||
#include "bagel/hodjnpodj/globals.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/dibdoc.h"
|
||||
#include "bagel/boflib/sound.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/text.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/cbofdlg.h" // header for the options library
|
||||
#include "bagel/hodjnpodj/hnplibs/mainmenu.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/gamedll.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
|
||||
// Button Identifier codes (BIDs)
|
||||
#define IDC_STARTAMOUNT 105
|
||||
#define IDC_ODDS 106
|
||||
#define IDC_OPTION 119
|
||||
#define IDC_BET1 120
|
||||
#define IDC_BET5 121
|
||||
#define IDC_BET10 122
|
||||
#define IDC_BET25 123
|
||||
#define IDC_BET100 124
|
||||
#define IDC_BET1000 125
|
||||
#define IDC_BETALL 126
|
||||
#define IDC_CLEARBET 127
|
||||
#define IDC_HOLD1 128
|
||||
#define IDC_HOLD2 129
|
||||
#define IDC_HOLD3 130
|
||||
#define IDC_HOLD4 131
|
||||
#define IDC_HOLD5 132
|
||||
#define IDC_DEAL 133
|
||||
#define IDC_DRAW 134
|
||||
#define IDC_JUNK 999
|
||||
|
||||
// Sound File Identifiers
|
||||
#define CARDSOUND ".\\SOUND\\CARDDEAL.WAV" //FWAP.WAV"
|
||||
#define WAV_PLACE ".\\SOUND\\COIN.WAV"
|
||||
#define WAV_CLEAR ".\\SOUND\\CEARBET.WAV"
|
||||
#define WAV_HOLD ".\\SOUND\\CLICK.WAV"
|
||||
#define WAV_PAY ".\\SOUND\\PAYOFF.WAV"
|
||||
#define WAV_NOPAY ".\\SOUND\\BUZZER2.WAV"
|
||||
#define WAV_BROKE ".\\SOUND\\SOSORRY.WAV"
|
||||
//
|
||||
// Easter Egg sound files
|
||||
#define WAV_CLOCK ".\\SOUND\\BIGBEN.WAV"
|
||||
#define WAV_BOOM ".\\SOUND\\EXPLODE.WAV"
|
||||
#define WAV_STAR ".\\SOUND\\TOMTOMS.WAV"
|
||||
#define WAV_PENCIL ".\\SOUND\\PENCIL.WAV"
|
||||
#define WAV_CHAIR ".\\SOUND\\SQUEAK.WAV"
|
||||
#define WAV_WINDOW ".\\SOUND\\WINDOW.WAV"
|
||||
#define WAV_LIGHT ".\\SOUND\\LIGHTING.WAV"
|
||||
//
|
||||
// Easter Egg art files
|
||||
#define CLOCK_ANIM ".\\ART\\CLOCK.BMP"
|
||||
#define BOOM_ANIM ".\\ART\\BOOM.BMP"
|
||||
#define CLOCK_FRAMES 16
|
||||
#define BOOM_FRAMES 25
|
||||
#define CLOCK_SLEEP 175
|
||||
#define BOOM_SLEEP 100
|
||||
//
|
||||
// Easter Egg locations
|
||||
#define CLOCK_X 572
|
||||
#define CLOCK_Y 74
|
||||
#define CLOCK_DX 52
|
||||
#define CLOCK_DY 91
|
||||
|
||||
#define BOOM_X 569
|
||||
#define BOOM_Y 162
|
||||
#define BOOM_DX 56
|
||||
#define BOOM_DY 78
|
||||
|
||||
#define PENCIL_X 16
|
||||
#define PENCIL_Y 420
|
||||
#define PENCIL_DX 55
|
||||
#define PENCIL_DY 21
|
||||
|
||||
#define CHAIR_X 562
|
||||
#define CHAIR_Y 225
|
||||
#define CHAIR_DX 40
|
||||
#define CHAIR_DY 136
|
||||
|
||||
#define WINDOW_X 16
|
||||
#define WINDOW_Y 83
|
||||
#define WINDOW_DX 55
|
||||
#define WINDOW_DY 148
|
||||
|
||||
#define LIGHT_X 21
|
||||
#define LIGHT_Y 24
|
||||
#define LIGHT_DX 47
|
||||
#define LIGHT_DY 46
|
||||
|
||||
// Bitmap Identifiers
|
||||
#define SPLASHSPEC "ART\\POKER.BMP"
|
||||
#define OPTSCROLL "ART\\OPTSCRL.BMP"
|
||||
#define CARDBACKBMP "ART\\CARDBACK.BMP"
|
||||
|
||||
// Button positioning constants
|
||||
#define OPTION_WIDTH 146
|
||||
#define OPTION_HEIGHT 23
|
||||
#define OPTION_LEFT 246
|
||||
#define OPTION_TOP 0
|
||||
|
||||
#define HOLD_TOP 202
|
||||
#define HOLD1_LEFT 120
|
||||
#define HOLD2_LEFT 206
|
||||
#define HOLD3_LEFT 288
|
||||
#define HOLD4_LEFT 369
|
||||
#define HOLD5_LEFT 454
|
||||
#define HOLD_WIDTH 66
|
||||
#define HOLD_HEIGHT 62
|
||||
|
||||
#define AMOUNT_WIDTH 135
|
||||
#define AMOUNT_HEIGHT 18
|
||||
|
||||
#define USER_AMOUNT_X 282
|
||||
#define USER_AMOUNT_Y 375
|
||||
|
||||
#define POT_AMOUNT_X 282
|
||||
#define POT_AMOUNT_Y 300
|
||||
|
||||
#define DEAL_LEFT 436
|
||||
#define DEAL_TOP 270
|
||||
#define DEAL_WIDTH 92
|
||||
#define DEAL_HEIGHT 67
|
||||
|
||||
#define DRAW_LEFT 436
|
||||
#define DRAW_TOP 355
|
||||
#define DRAW_WIDTH 92
|
||||
#define DRAW_HEIGHT 68
|
||||
|
||||
#define CARD_WIDTH 72
|
||||
#define CARD_HEIGHT 103
|
||||
#define CARD_TOP 93
|
||||
#define CARD_LEFT 112
|
||||
#define CARD_OFFSET 85
|
||||
|
||||
#define BET1_LEFT 116
|
||||
#define BET1_TOP 263
|
||||
#define BET1_WIDTH 46
|
||||
#define BET1_HEIGHT 42
|
||||
|
||||
#define BET5_LEFT 116
|
||||
#define BET5_TOP 306
|
||||
#define BET5_WIDTH 46
|
||||
#define BET5_HEIGHT 41
|
||||
|
||||
#define BET10_LEFT 116
|
||||
#define BET10_TOP 347
|
||||
#define BET10_WIDTH 46
|
||||
#define BET10_HEIGHT 42
|
||||
|
||||
#define BET25_LEFT 220
|
||||
#define BET25_TOP 263
|
||||
#define BET25_WIDTH 48
|
||||
#define BET25_HEIGHT 42
|
||||
|
||||
#define BET100_LEFT 220
|
||||
#define BET100_TOP 305
|
||||
#define BET100_WIDTH 46
|
||||
#define BET100_HEIGHT 42
|
||||
|
||||
#define BET1000_LEFT 220
|
||||
#define BET1000_TOP 347
|
||||
#define BET1000_WIDTH 46
|
||||
#define BET1000_HEIGHT 41
|
||||
|
||||
#define BETALL_LEFT 168
|
||||
#define BETALL_TOP 304
|
||||
#define BETALL_WIDTH 48
|
||||
#define BETALL_HEIGHT 44
|
||||
|
||||
#define CLEARBET_LEFT 122
|
||||
#define CLEARBET_TOP 393
|
||||
#define CLEARBET_WIDTH 139
|
||||
#define CLEARBET_HEIGHT 27
|
||||
|
||||
#define NUMBEROFROUNDS 4
|
||||
|
||||
#define HOLD_BMP_GRID_WITDH 66
|
||||
#define HOLD_BMP_GRID_TOP1 0
|
||||
#define HOLD_BMP_GRID_TOP2 62
|
||||
#define HOLD_BMP_GRID_TOP3 124
|
||||
#define HOLD_BMP_GRID_TOP4 186
|
||||
|
||||
#define BET_BMP_GRID_WITDH 48
|
||||
#define BET_BMP_GRID_TOP1 0
|
||||
#define BET_BMP_GRID_TOP2 44
|
||||
#define BET_BMP_GRID_TOP3 88
|
||||
|
||||
|
||||
void PlayEasterEgg(CDC *, CWnd *, CPalette *, const char *,
|
||||
const char *, int, int, int, int, bool);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// CMainPokerWindow:
|
||||
// See game.cpp for the code to the member functions and the message map.
|
||||
//
|
||||
|
||||
class CMainPokerWindow : public CFrameWnd {
|
||||
public:
|
||||
bool m_bPlaySounds = false; // Bool for should I play sounds
|
||||
bool m_bMiddleOfHand = false; // Bool for am I in the middle of a hand
|
||||
bool m_bPlayRounds = false; // Bool for am I playing a certain # of rounds
|
||||
long m_lUserAmount = 0;
|
||||
long m_lStartingAmount = 0;
|
||||
|
||||
private:
|
||||
bool abHoldArray[5] = { false }; // Contains the state of the hold buttons
|
||||
int aDealtArray[10][2] = {}; // Contains the list of cards already dealt
|
||||
// the second element is 1 if the card is shown
|
||||
long m_lUserBet = 0; // The amount of money the player currently has
|
||||
int m_nRound = 0; // the amount of the current bet
|
||||
int m_nPayOffRoyalFlush = 0; // the pay off ratios
|
||||
int m_nPayOffStraightFlush = 0;
|
||||
int m_nPayOffFourofaKind = 0;
|
||||
int m_nPayOffStraight = 0;
|
||||
int m_nPayOffFullHouse = 0;
|
||||
int m_nPayOffFlush = 0;
|
||||
int m_nPayOffThreeofaKind = 0;
|
||||
int m_nPayOffTwoPair = 0;
|
||||
int m_nPayOffPairJackorHigher = 0;
|
||||
int m_nPayOffPair = 0;
|
||||
HWND m_hCallAppWnd = nullptr;
|
||||
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
|
||||
BetRect5, // window area spanned by the Bet5 button
|
||||
BetRect10, // window area spanned by the Bet10 button
|
||||
BetRect25, // window area spanned by the Bet25 button
|
||||
BetRect100, // window area spanned by the Bet100 button
|
||||
BetRect1000, // window area spanned by the Bet1000 button
|
||||
BetRectAll, // window area spanned by the BetAll button
|
||||
ClearBetRect, // window area spanned by the ClearBet button
|
||||
DealRect, // window area spanned by the Deal button
|
||||
DrawRect, // window area spanned by the Draw button
|
||||
OptionRect, // window area spanned by the Option button
|
||||
arCardRect[5]; // window area spanned by the Cards
|
||||
|
||||
CRect JunkRect;
|
||||
CRect NewGameRect;
|
||||
|
||||
public:
|
||||
CMainPokerWindow(HWND, LPGAMESTRUCT);
|
||||
void initStatics();
|
||||
|
||||
void SplashScreen();
|
||||
void SetPayOffs(int);
|
||||
void FlagResetGame() {
|
||||
_flagResetGame = true;
|
||||
}
|
||||
void ResetGame(long = 0L);
|
||||
void SetBet(long);
|
||||
|
||||
static void ReleaseResources();
|
||||
static void FlushInputEvents();
|
||||
|
||||
private:
|
||||
int DealNewCard();
|
||||
void ShowNewCard(int, int);
|
||||
void SetHoldList(int);
|
||||
void EnableBets();
|
||||
void CheckWinningHand();
|
||||
int Mod(int, int);
|
||||
void OnSoundNotify(CSound *pSound);
|
||||
|
||||
protected:
|
||||
virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
|
||||
|
||||
//{{AFX_MSG( CMainPokerWindow )
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnLButtonDown(unsigned int, CPoint);
|
||||
afx_msg void OnRButtonDown(unsigned int, CPoint);
|
||||
afx_msg void OnLButtonUp(unsigned int, CPoint);
|
||||
afx_msg void OnKeyDown(unsigned int, unsigned int, unsigned int);
|
||||
afx_msg void OnDrawItem(int, LPDRAWITEMSTRUCT);
|
||||
afx_msg bool OnEraseBkgnd(CDC *);
|
||||
afx_msg void OnActivate(unsigned int nState, CWnd *pWndOther, bool bMinimized) override;
|
||||
afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
|
||||
afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
198
engines/bagel/hodjnpodj/poker/resource.h
Normal file
198
engines/bagel/hodjnpodj/poker/resource.h
Normal file
@@ -0,0 +1,198 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_RESOURCE_H
|
||||
#define HODJNPODJ_POKER_RESOURCE_H
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define IDI_POKER 2
|
||||
#define IDB_BITMAP1 154
|
||||
#define IDB_BITMAP2 155
|
||||
#define IDB_BITMAP3 156
|
||||
#define IDB_BITMAP4 157
|
||||
#define IDB_BITMAP5 158
|
||||
#define IDB_BITMAP6 159
|
||||
#define IDB_BITMAP7 160
|
||||
#define IDB_BITMAP8 161
|
||||
#define IDB_BITMAP9 162
|
||||
#define IDB_BITMAP10 163
|
||||
#define IDB_BITMAP11 164
|
||||
#define IDB_BITMAP12 165
|
||||
#define IDB_BITMAP13 166
|
||||
#define IDB_BITMAP14 167
|
||||
#define IDB_BITMAP15 168
|
||||
#define IDB_BITMAP16 169
|
||||
#define IDB_BITMAP17 170
|
||||
#define IDB_BITMAP18 171
|
||||
#define IDB_BITMAP19 172
|
||||
#define IDB_BITMAP20 173
|
||||
#define IDB_BITMAP21 174
|
||||
#define IDB_BITMAP22 175
|
||||
#define IDB_BITMAP23 176
|
||||
#define IDB_BITMAP24 177
|
||||
#define IDB_BITMAP25 178
|
||||
#define IDB_BITMAP26 179
|
||||
#define IDB_BITMAP27 180
|
||||
#define IDB_BITMAP28 181
|
||||
#define IDB_BITMAP29 182
|
||||
#define IDB_BITMAP30 183
|
||||
#define IDB_BITMAP31 184
|
||||
#define IDB_BITMAP32 185
|
||||
#define IDB_BITMAP33 186
|
||||
#define IDB_BITMAP34 187
|
||||
#define IDB_BITMAP35 188
|
||||
#define IDB_BITMAP36 189
|
||||
#define IDB_BITMAP37 190
|
||||
#define IDB_BITMAP38 191
|
||||
#define IDB_BITMAP39 192
|
||||
#define IDB_BITMAP40 193
|
||||
#define IDB_BITMAP41 194
|
||||
#define IDB_BITMAP42 195
|
||||
#define IDB_BITMAP43 196
|
||||
#define IDB_BITMAP44 197
|
||||
#define IDB_BITMAP45 198
|
||||
#define IDB_BITMAP46 199
|
||||
#define IDB_BITMAP47 200
|
||||
#define IDB_BITMAP48 201
|
||||
#define IDB_BITMAP49 202
|
||||
#define IDB_BITMAP50 203
|
||||
#define IDB_BITMAP51 204
|
||||
#define IDB_BITMAP52 205
|
||||
#define IDD_SETAMOUNT 235
|
||||
#define IDD_DIALOG1 236
|
||||
#define IDD_WINRATIO 237
|
||||
#define IDD_DIALOG2 238
|
||||
#define IDD_OPTIONS 239
|
||||
#define IDB_GRABAGE 242
|
||||
#define IDB_BET1000UP 248
|
||||
#define IDB_BET100UP 249
|
||||
#define IDB_BET10UP 250
|
||||
#define IDB_BET1DISABLED 251
|
||||
#define IDB_BET1DOWN 252
|
||||
#define IDB_BET1UP 253
|
||||
#define IDB_BET25UP 254
|
||||
#define IDB_BET5UP 255
|
||||
#define IDB_BETALLUP 256
|
||||
#define IDB_CLEARUP 257
|
||||
#define IDB_DEALDISABLED 258
|
||||
#define IDB_DEALDOWN 259
|
||||
#define IDB_DEALUP 260
|
||||
#define IDB_DRAWDIABLED 261
|
||||
#define IDB_DRAWDOWN 262
|
||||
#define IDB_DRAWUP 263
|
||||
#define IDB_HOLDLIT 264
|
||||
#define IDB_HOLDDARK 265
|
||||
#define IDB_HOLDDISABLED 266
|
||||
#define IDB_HOLDDOWN 267
|
||||
#define IDB_LSCROLLB 268
|
||||
#define IDB_LSCROLLM 269
|
||||
#define IDB_LSCROLLT 270
|
||||
#define IDB_POKER 271
|
||||
#define IDB_SSCROLL 272
|
||||
#define IDD_USERWON 273
|
||||
#define IDB_BITMAP53 274
|
||||
#define IDB_JOKER 274
|
||||
#define IDB_CARDBACK 275
|
||||
#define IDB_HOLD1DISABLED 276
|
||||
#define IDB_HOLD1DOWN 277
|
||||
#define IDB_HOLD1HALF 278
|
||||
#define IDB_HOLD1LIT 279
|
||||
#define IDB_HOLD2DISABLED 280
|
||||
#define IDB_HOLD2DOWN 281
|
||||
#define IDB_HOLD2HALF 282
|
||||
#define IDB_HOLD2LIT 283
|
||||
#define IDB_HOLD3DISABLED 284
|
||||
#define IDB_HOLD3DOWN 285
|
||||
#define IDB_HOLD3HALF 286
|
||||
#define IDB_HOLD3LIT 287
|
||||
#define IDB_HOLD4DISABLED 288
|
||||
#define IDB_HOLD4DOWN 289
|
||||
#define IDB_HOLD4HALF 290
|
||||
#define IDB_HOLD4LIT 291
|
||||
#define IDB_HOLD5DISABLED 292
|
||||
#define IDB_HOLD5DOWN 293
|
||||
#define IDB_HOLD5HALF 294
|
||||
#define IDB_HOLD5LIT 295
|
||||
#define IDB_OPTIONSCROLL 296
|
||||
#define IDB_DEALGRAY 298
|
||||
#define IDD_USERAMOUNT 301
|
||||
#define IDB_DRAWGRAY 301
|
||||
#define IDC_USERAMOUNTDISPLAY 302
|
||||
#define IDC_SETAMT_BAR 303
|
||||
#define IDB_BET100DOWN 303
|
||||
#define IDC_POPO 304
|
||||
#define ID_POPO 304
|
||||
#define IDB_BET100GRAY 304
|
||||
#define IDC_KLINGON 305
|
||||
#define ID_KLINGON 305
|
||||
#define IDC_VEGAS 306
|
||||
#define ID_VEGAS 306
|
||||
#define IDB_BET10DOWN 306
|
||||
#define IDC_MARTIAN 307
|
||||
#define ID_MARTIAN 307
|
||||
#define IDB_BET10GRAY 307
|
||||
#define IDC_KUWAITI 308
|
||||
#define ID_KUWAITI 308
|
||||
#define IDC_PAIR 309
|
||||
#define IDC_PAIR2 310
|
||||
#define IDB_BET1GRAY 310
|
||||
#define ID_SETUSERAMT 311
|
||||
#define IDB_BET1000DOWN 311
|
||||
#define IDC_3OFAKIND 312
|
||||
#define IDB_BET1000GRAY 312
|
||||
#define IDC_RULES 313
|
||||
#define ID_SETPAYOFFS 314
|
||||
#define IDC_TWOPAIR 315
|
||||
#define IDB_BET25DOWN 315
|
||||
#define IDC_SETSTARTAMOUNT 316
|
||||
#define IDB_BET25GRAY 316
|
||||
#define ID_TOGGLESOUND 317
|
||||
#define IDC_STRAIGHT 318
|
||||
#define IDB_BET5DOWN 318
|
||||
#define IDC_FLUSH 319
|
||||
#define IDB_BET5GRAY 319
|
||||
#define IDC_QUIT 320
|
||||
#define IDC_FULLHOUSE 321
|
||||
#define IDB_BETALLDOWN 321
|
||||
#define IDC_4OFAKIND 322
|
||||
#define IDB_BETALLGRAY 322
|
||||
#define IDC_STRAIGHTFLUSH 323
|
||||
#define IDC_ROYALFLUSH 324
|
||||
#define IDC_SETPAYOFFS 325
|
||||
#define IDB_CLEARBETDOWN 327
|
||||
#define IDB_CLEARBETGRAY 328
|
||||
#define IDB_CLEARBETUP 329
|
||||
#define IDD_RULES_DIALOG 900
|
||||
#define IDC_RULES_OKAY 900
|
||||
#define IDC_CANCEL 1019
|
||||
#define IDC_OPTIONOK 1020
|
||||
#define ID_CANCEL 1021
|
||||
#define ID_CANCEL2 1021
|
||||
#define ID_CANCEL_VIEW 1027
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
45
engines/bagel/hodjnpodj/poker/traceres.h
Normal file
45
engines/bagel/hodjnpodj/poker/traceres.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HODJNPODJ_POKER_TRACERES_H
|
||||
#define HODJNPODJ_POKER_TRACERES_H
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
#define IDD_PROMPT 101
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define IDC_BIT0 256
|
||||
#define IDC_BIT1 257
|
||||
#define IDC_BIT2 258
|
||||
#define IDC_BIT3 259
|
||||
#define IDC_BIT4 260
|
||||
#define IDC_ENABLEALL 512
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
|
||||
#endif
|
||||
282
engines/bagel/hodjnpodj/poker/uwondlg.cpp
Normal file
282
engines/bagel/hodjnpodj/poker/uwondlg.cpp
Normal file
@@ -0,0 +1,282 @@
|
||||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "bagel/hodjnpodj/hnplibs/stdafx.h"
|
||||
#include "bagel/hodjnpodj/hnplibs/button.h"
|
||||
#include "bagel/hodjnpodj/poker/resource.h"
|
||||
#include "bagel/hodjnpodj/poker/dialogs.h"
|
||||
|
||||
namespace Bagel {
|
||||
namespace HodjNPodj {
|
||||
namespace Poker {
|
||||
|
||||
static CPalette *pUWonPalette;
|
||||
|
||||
CColorButton *pOKButton = nullptr;
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* COptionsDlg
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Constructor sends the input to the COptions constructor and
|
||||
* the intializes the private members
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* Those needed to contruct a COptions dialog: pParent,pPalette, nID
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* private member m_nCurrentAmount
|
||||
* globals rectDisplayAmount and pSetAmountPalette
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
CUserWonDlg::CUserWonDlg(CWnd *pParent, CPalette *pPalette, unsigned int nID)
|
||||
: CBmpDialog(pParent, pPalette, nID, ".\\ART\\SSCROLL.BMP") {
|
||||
pUWonPalette = pPalette;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnCommand
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Process the "Set" and "Cancel" buttons
|
||||
*
|
||||
* This function is called when a WM_COMMAND message is issued,
|
||||
* typically in order to process control related activities.
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* wParam identifier for the button to be processed
|
||||
* lParam type of message to be processed
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
bool CUserWonDlg::OnCommand(WPARAM wParam, LPARAM lParam) {
|
||||
// What ever button is clicked, end the dialog and send the ID of the button
|
||||
// clicked as the return from the dialog
|
||||
if (HIWORD(lParam) == BN_CLICKED) {
|
||||
switch (wParam) {
|
||||
case IDOK:
|
||||
ClearDialogImage();
|
||||
EndDialog(0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return CDialog::OnCommand(wParam, lParam);
|
||||
}
|
||||
|
||||
void CUserWonDlg::OnOK() {
|
||||
ClearDialogImage();
|
||||
EndDialog(0);
|
||||
return;
|
||||
}
|
||||
|
||||
void CUserWonDlg::ClearDialogImage() {
|
||||
|
||||
if (pOKButton != nullptr) {
|
||||
delete pOKButton;
|
||||
pOKButton = nullptr;
|
||||
}
|
||||
|
||||
ValidateRect(nullptr);
|
||||
|
||||
return;
|
||||
}
|
||||
/*****************************************************************
|
||||
*
|
||||
* SetInitialOptions
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* This sets the privates to the inputted values
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* lCurrentAmount = the current amount the user has
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* m_nCurrentAmount = (int)min( AMOUNTMAX, lCurrentAmount)
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
*
|
||||
****************************************************************/
|
||||
void CUserWonDlg::SetInitialOptions(int nWhichPhrase) {
|
||||
m_nWinPhrase = nWhichPhrase;
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
*
|
||||
* OnPaint
|
||||
*
|
||||
* FUNCTIONAL DESCRIPTION:
|
||||
*
|
||||
* Repaint the screen whenever needed; e.g. when uncovered by an
|
||||
* overlapping window, when maximized from an icon, and when it the
|
||||
* window is initially created.
|
||||
*
|
||||
* This uses the COptions Paint as its base, and displays the current
|
||||
* amount chosen from the scrollbar
|
||||
*
|
||||
* This routine is called whenever Windows sends a WM_PAINT message.
|
||||
* Note that creating a CPaintDC automatically does a BeginPaint and
|
||||
* an EndPaint call is done when it is destroyed at the end of this
|
||||
* function. CPaintDC's constructor needs the window (this).
|
||||
*
|
||||
* FORMAL PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT INPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* IMPLICIT OUTPUT PARAMETERS:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
* RETURN VALUE:
|
||||
*
|
||||
* n/a
|
||||
*
|
||||
****************************************************************/
|
||||
void CUserWonDlg::OnPaint() {
|
||||
CDC *pDC;
|
||||
int nOldBkMode;
|
||||
|
||||
// call COptions onpaint, to paint the background
|
||||
CBmpDialog::OnPaint();
|
||||
|
||||
pDC = GetDC();
|
||||
|
||||
// now paint in my text with a transparent background
|
||||
nOldBkMode = pDC->SetBkMode(TRANSPARENT);
|
||||
|
||||
switch (m_nWinPhrase) {
|
||||
case 1:
|
||||
pDC->TextOut(62, 60, "You got a Pair!");
|
||||
break;
|
||||
case 2:
|
||||
pDC->TextOut(63, 60, "You got a Pair");
|
||||
pDC->TextOut(57, 80, "of Jacks or higher!");
|
||||
break;
|
||||
case 3:
|
||||
pDC->TextOut(52, 60, "You got Two Pairs!");
|
||||
break;
|
||||
case 4:
|
||||
pDC->TextOut(61, 60, "You got a Three");
|
||||
pDC->TextOut(83, 80, "of a kind!");
|
||||
break;
|
||||
case 5:
|
||||
pDC->TextOut(52, 60, "You got a Straight!");
|
||||
break;
|
||||
case 6:
|
||||
pDC->TextOut(62, 60, "You got a Flush!");
|
||||
break;
|
||||
case 7:
|
||||
pDC->TextOut(42, 60, "You got a Full House!");
|
||||
break;
|
||||
case 8:
|
||||
pDC->TextOut(62, 60, "You got a Four");
|
||||
pDC->TextOut(83, 80, "of a kind!");
|
||||
break;
|
||||
case 9:
|
||||
pDC->TextOut(33, 60, "You got a Straight Flush!");
|
||||
break;
|
||||
case 10:
|
||||
pDC->TextOut(38, 60, "You got a Royal Flush!");
|
||||
break;
|
||||
default:
|
||||
pDC->TextOut(61, 60, "You got nothin'!");
|
||||
break;
|
||||
}
|
||||
|
||||
pDC->SetBkMode(nOldBkMode);
|
||||
ReleaseDC(pDC);
|
||||
return;
|
||||
}
|
||||
|
||||
bool CUserWonDlg::OnInitDialog() {
|
||||
bool bSuccess;
|
||||
|
||||
CBmpDialog::OnInitDialog();
|
||||
|
||||
pOKButton = new CColorButton();
|
||||
ASSERT(pOKButton != nullptr);
|
||||
pOKButton->SetPalette(pUWonPalette);
|
||||
bSuccess = pOKButton->SetControl(IDOK, this);
|
||||
ASSERT(bSuccess);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CUserWonDlg::OnDestroy() {
|
||||
// send a message to the calling app to tell it the user has quit the game
|
||||
if (pOKButton != nullptr) {
|
||||
delete pOKButton;
|
||||
pOKButton = nullptr;
|
||||
}
|
||||
|
||||
CBmpDialog::OnDestroy();
|
||||
}
|
||||
|
||||
|
||||
// Message Map
|
||||
BEGIN_MESSAGE_MAP(CUserWonDlg, CBmpDialog)
|
||||
//{{AFX_MSG_MAP( CMainPokerWindow )
|
||||
ON_WM_PAINT()
|
||||
ON_WM_DESTROY()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
} // namespace Poker
|
||||
} // namespace HodjNPodj
|
||||
} // namespace Bagel
|
||||
Reference in New Issue
Block a user