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_LIFE_GAME_H
23 #define HODJNPODJ_LIFE_GAME_H
24 
25 #include "bagel/boflib/sound.h"
26 #include "bagel/hodjnpodj/hnplibs/gamedll.h"
27 
28 namespace Bagel {
29 namespace HodjNPodj {
30 namespace Life {
31 
32 #define SPLASHSPEC ".\\art\\backgrnd.BMP"
33 
34 
35 #define CURLY_X 25 // Colony dimensions
36 #define CURLY_Y 24
37 
38 #define VILLAGES_PLACED 10 // Number of colonies pre-placed in meta-game mode
39 #define PLACE_COLS 10
40 #define PLACE_ROWS 10
41 #define OFFSET_X 6
42 #define OFFSET_Y 4
43 
44 #define SCROLL_BUTTON ".\\art\\SCROLBTN.BMP" // scroll commands button bmp
45 #define CALENDAR_BMP ".\\ART\\CALENDAR.BMP" // the blank calendar artwork
46 
47 // stat info
48 #define STATS_COLOR RGB(255, 255, 0) // color of visual game stats
49 #define STATS_FONT_SIZE 15
50 #define MONTH_COL_POS 17 // sprite calendar pos
51 #define MONTH_ROW_POS 140
52 
53 #define SCORE_LEFT_COL 459 // score pos
54 #define SCORE_LEFT_ROW 30
55 #define SCORE_RIGHT_COL 574
56 #define SCORE_RIGHT_ROW 52
57 
58 #define CURRENT_LEFT_COL 44 // current villages pos
59 #define CURRENT_LEFT_ROW 30
60 #define CURRENT_RIGHT_COL 220
61 #define CURRENT_RIGHT_ROW 52
62 
63 #define ROUND_LEFT_COL 15 // years past pos
64 #define ROUND_LEFT_ROW 315
65 #define ROUND_RIGHT_COL 62
66 #define ROUND_RIGHT_ROW 331
67 
68 #define ROUND_TEXT1_LEFT_COL 15
69 #define ROUND_TEXT1_LEFT_ROW 330
70 #define ROUND_TEXT1_RIGHT_COL 62
71 #define ROUND_TEXT1_RIGHT_ROW 352
72 
73 #define ROUND_TEXT2_LEFT_COL 15
74 #define ROUND_TEXT2_LEFT_ROW 351
75 #define ROUND_TEXT2_RIGHT_COL 62
76 #define ROUND_TEXT2_RIGHT_ROW 373
77 
78 #define VILLAGE_LEFT_COL 15 // villages left pos
79 #define VILLAGE_LEFT_ROW 423
80 #define VILLAGE_RIGHT_COL 62
81 #define VILLAGE_RIGHT_ROW 441
82 
83 #define VILLAGE_TEXT1_LEFT_COL 15
84 #define VILLAGE_TEXT1_LEFT_ROW 438
85 #define VILLAGE_TEXT1_RIGHT_COL 62
86 #define VILLAGE_TEXT1_RIGHT_ROW 459
87 
88 // Button Identifier codes (BIDs)
89 #define IDC_EVOLVE 101
90 #define IDC_COMMAND 102
91 
92 // Button positioning constants
93 #define QUIT_BUTTON_WIDTH 50
94 #define QUIT_BUTTON_HEIGHT 20
95 #define QUIT_BUTTON_OFFSET_X 10
96 #define QUIT_BUTTON_OFFSET_Y 10
97 
98 
99 #define COMMAND_BUTTON_WIDTH 80
100 #define COMMAND_BUTTON_HEIGHT 18
101 #define COMMAND_OFFSET_X 0
102 #define COMMAND_OFFSET_Y 0
103 
104 #define EVOLVE_BUTTON_WIDTH 94
105 #define EVOLVE_BUTTON_HEIGHT 20
106 #define EVOLVE_BUTTON_OFFSET_X 0
107 #define EVOLVE_BUTTON_OFFSET_Y 30
108 
109 // Timer ID's
110 #define EVOLVE_TIMER_ID 10001
111 #define EVOLVE_INTERVAL 100 // decaseconds
112 
114 
115 // CMainWindow:
116 // See game.cpp for the code to the member functions and the message map.
117 
118 class CLife;
119 
120 class CMainWindow : public CFrameWnd {
121 private:
122  CLife *m_cLife = nullptr;
123  LPGAMESTRUCT m_lpGameStruct = nullptr;
124  HWND m_hCallAppWnd = nullptr;
125  bool m_bGameActive = false;
126  CSound *m_pSound = nullptr;
127  CRect m_rNewGameButton;
128 
129 public:
130  CMainWindow(HWND, LPGAMESTRUCT);
131  ~CMainWindow();
132 
133  void initStatics();
134  void SplashScreen();
135  void DisplayStats();
136  void RefreshStats();
137  void NewGame();
138  void GamePause();
139  void GameResume();
140 
141 protected:
142  virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
143 
144  //{{AFX_MSG( CMainWindow )
145  afx_msg void OnPaint();
146  afx_msg void OnLButtonDown(unsigned int, CPoint);
147  afx_msg void OnLButtonDblClk(unsigned int, CPoint);
148  afx_msg void OnSysKeyDown(unsigned int, unsigned int, unsigned int);
149  afx_msg void OnSysChar(unsigned int, unsigned int, unsigned int);
150  afx_msg void OnKeyDown(unsigned int, unsigned int, unsigned int);
151  afx_msg void OnTimer(uintptr);
152  afx_msg void OnClose();
153  afx_msg void OnDestroy();
154  afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
155  afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
156  //}}AFX_MSG
157 
158  DECLARE_MESSAGE_MAP()
159 };
160 
161 
163 
164 // CTheApp:
165 // See game.cpp for the code to the InitInstance member function.
166 //
167 class CTheApp : public CWinApp {
168 public:
169  bool InitInstance();
170 };
171 
173 
175 // CWindowMain frame
176 
177 class CWindowMain : public CFrameWnd {
178  DECLARE_DYNCREATE(CWindowMain)
179 protected:
180  CWindowMain(); // protected constructor used by dynamic creation
181  virtual ~CWindowMain();
182 
183  // Generated message map functions
184  //{{AFX_MSG(CWindowMain)
185  // NOTE - the ClassWizard will add and remove member functions here.
186  //}}AFX_MSG
187  DECLARE_MESSAGE_MAP()
188 };
189 
190 } // namespace Life
191 } // namespace HodjNPodj
192 } // namespace Bagel
193 
194 #endif
Definition: life.h:53
Definition: afxwin.h:1125
Definition: afxwin.h:1514
Definition: atltypes.h:79
Definition: game.h:167
Definition: afxwin.h:1943
Definition: afxwin.h:27
Definition: atltypes.h:131