ScummVM API documentation
game.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef HODJNPODJ_PEGGLE_GAME_H
23#define HODJNPODJ_PEGGLE_GAME_H
24
25#include "bagel/hodjnpodj/hnplibs/sprite.h"
26#include "bagel/boflib/sound.h"
27
28namespace Bagel {
29namespace HodjNPodj {
30namespace Peggle {
31
32#define NARRATIVESPEC "sound\\PEGG.WAV"
33#define RULESSPEC "PEGGLE.TXT"
34
35// Button positioning constants
36#define QUIT_BUTTON_WIDTH 50
37#define QUIT_BUTTON_HEIGHT 20
38#define QUIT_BUTTON_OFFSET_X 10
39#define QUIT_BUTTON_OFFSET_Y 10
40
41#define RESTART_BUTTON_WIDTH 63
42#define RESTART_BUTTON_HEIGHT 39
43#define RESTART_BUTTON_OFFSET_X 10
44#define RESTART_BUTTON_OFFSET_Y 150
45
46#define INIT_BUTTON_WIDTH 80
47#define INIT_BUTTON_HEIGHT 30
48#define INIT_BUTTON_OFFSET_X 280
49#define INIT_BUTTON_OFFSET_Y 20
50
51void SetUpBoard(CDC *pDC);
52void UndoMove(CDC *pDC);
53
55
56// CMainWindow:
57// See game.cpp for the code to the member functions and the message map.
58//
59class CMainWindow : public CFrameWnd {
60public:
62
63 void initStatics();
64 void SplashScreen();
65
66 static void UpdatePegPosition(CDC *pDC, CSprite *pSprite, int x, int y);
67 static CPoint GridToPoint(int i, int j);
68 static CPoint PointToGrid(CPoint point);
69 static void UndoMove(CDC *pDC);
70 void UndoTurn();
71
72private:
73 bool m_bProgramActive = false;
74 HWND m_hCallAppWnd = nullptr;
75 CRect ScrollRect;
76
77 void OnSoundNotify(CSound *pSound);
78
79protected:
80 virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
81
82 //{{AFX_MSG( CMainWindow )
83 afx_msg void OnPaint();
84 afx_msg void OnLButtonDown(unsigned int, CPoint);
85 afx_msg void OnLButtonUp(unsigned int, CPoint);
86 afx_msg void OnLButtonDblClk(unsigned int, CPoint);
87 afx_msg void OnMButtonDown(unsigned int, CPoint);
88 afx_msg void OnMButtonUp(unsigned int, CPoint);
89 afx_msg void OnMButtonDblClk(unsigned int, CPoint);
90 afx_msg void OnRButtonDown(unsigned int, CPoint);
91 afx_msg void OnRButtonUp(unsigned int, CPoint);
92 afx_msg void OnRButtonDblClk(unsigned int, CPoint);
93 afx_msg void OnMouseMove(unsigned int nFlags, CPoint point);
94 afx_msg void OnChar(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
95 afx_msg void OnSysChar(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
96 afx_msg void OnClose();
97 afx_msg void OnDestroy();
98 afx_msg void OnKeyDown(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
99 afx_msg void OnActivateApp(bool bActive, HTASK hTask);
100 afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
101 afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
102 //}}AFX_MSG
103
104 DECLARE_MESSAGE_MAP()
105};
106
107} // namespace Peggle
108} // namespace HodjNPodj
109} // namespace Bagel
110
111#endif
Definition: sprite.h:41
Definition: afxwin.h:721
Definition: afxwin.h:1532
Definition: atltypes.h:79
Definition: atltypes.h:131
Definition: afxwin.h:1141
Definition: minwindef.h:157