ScummVM API documentation
dfa.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_DFA_DFA_H
23#define HODJNPODJ_DFA_DFA_H
24
25#include "bagel/boflib/sound.h"
26#include "bagel/hodjnpodj/hnplibs/dibdoc.h"
27#include "bagel/hodjnpodj/hnplibs/gamedll.h"
28#include "bagel/hodjnpodj/dfa/globals.h"
29#include "bagel/hodjnpodj/dfa/resource.h"
30#include "bagel/hodjnpodj/hnplibs/cbofdlg.h" // header for the options library
31#include "bagel/hodjnpodj/hnplibs/mainmenu.h"
32#include "bagel/hodjnpodj/hnplibs/button.h"
33#include "bagel/hodjnpodj/hnplibs/rules.h"
34#include "bagel/hodjnpodj/hnplibs/text.h"
35#include "bagel/hodjnpodj/hnplibs/bitmaps.h"
36#include "bagel/hodjnpodj/hnplibs/sprite.h"
37
38namespace Bagel {
39namespace HodjNPodj {
40namespace DFA {
41
42// Button Identifier codes (BIDs)
43#define IDC_OPTION 100
44#define IDC_LETTERBUTTON 200 // to 480
45#define IDC_JUNK 999
46
47// Border width & height
48#define SIDE_BORDER 16
49#define TOP_BORDER 20
50
51// Rules File Identifiers
52#define RULESFILE "DFA.TXT"
53#define RULES_WAV "sound\\DAMFUR.WAV"
54
55// Sound files:
56#define GAME_THEME "sound\\DAMFUR.MID"
57#define HIT_1_WAV "sound\\OW1.WAV"
58#define HIT_2_WAV "sound\\OW2.WAV"
59#define HIT_3_WAV "sound\\OW3.WAV"
60#define HIT_4_WAV "sound\\OW4.WAV"
61#define HIT_5_WAV "sound\\OW5.WAV"
62#define HIT_6_WAV "sound\\OW6.WAV"
63#define HIT_7_WAV "sound\\OW7.WAV"
64#define HIT_8_WAV "sound\\OW8.WAV"
65#define HIT_9_WAV "sound\\OW9.WAV"
66#define HIT_10_WAV "sound\\OW10.WAV"
67#define HIT_11_WAV "sound\\OW11.WAV"
68#define MISS_1_WAV "sound\\HAHA.WAV"
69#define MISS_2_WAV "sound\\MISSED.WAV"
70#define MISS_3_WAV "sound\\MISSEDME.WAV"
71#define TICK_WAV "sound\\TICK.WAV"
72#define TIME_WAV "sound\\BUZZER.WAV"
73#define LAKE_WAV "sound\\LAKE.WAV"
74#define MOUNT_WAV "sound\\YODEL.WAV"
75#define BEE_WAV "sound\\BEE.WAV"
76#define WATCH_WAV "sound\\CUCKOO.WAV"
77
78#define NUM_HIT_SOUNDS 11 // Number of sounds available for a hit
79#define NUM_MISS_SOUNDS 3 // Number of sounds available for a missed hit
80#define NUM_BEAVERS 7 // Number of beavers to hit
81
82// Audio EasterEgg area constants
83#define LAKE_X 178
84#define LAKE_Y 152
85#define LAKE_DX 283
86#define LAKE_DY 38
87
88#define MOUNT_X 40
89#define MOUNT_Y 40
90#define MOUNT_DX 510
91#define MOUNT_DY 80
92
93#define FLOWERS_X 540
94#define FLOWERS_Y 325
95#define FLOWERS_DX 82
96#define FLOWERS_DY 136
97
98#define WATCH_X 437 // 436
99#define WATCH_Y 401 // 401
100#define WATCH_DX 70
101#define WATCH_DY 60
102
103// Bitmap Identifiers
104#define OPTSCROLL "ART\\SSCROLL.BMP"
105#define BEAVER1 "ART\\BEAVER1.BMP"
106#define BEAVER2 "ART\\BEAVER2.BMP"
107#define BEAVER3 "ART\\BEAVER3.BMP"
108#define BEAVER4 "ART\\BEAVER4.BMP"
109#define BEAVER5 "ART\\BEAVER5.BMP"
110#define BEAVER6 "ART\\BEAVER6.BMP"
111#define BEAVER7 "ART\\BEAVER7.BMP"
112
113// Button positioning constants
114#define OPTION_WIDTH 146
115#define OPTION_HEIGHT 23
116#define OPTION_LEFT 246
117#define OPTION_TOP 0
118
119#define NUMBEROFCOLS 20
120#define NUMBEROFROWS 14
121
123
124// CMainPackRatWindow:
125// See game.cpp for the code to the member functions and the message map.
126//
127
128class CMainDFAWindow : public CFrameWnd {
129public:
130 unsigned int m_nTimeForGame = 0;
131 int m_nBeaverDuration = 0;
132
133private:
134 bool m_bPlaySounds = false; // bool for am I playing a certain # of rounds
135 HWND m_hCallAppWnd = nullptr;
136 LPGAMESTRUCT m_lpGameStruct = nullptr;
137 bool m_bMouseCaptured = false;
138 long m_lScore = 0;
139 CRect MainRect; // screen area spanned by the game window
140 CRect ArtRect; // screen area inside the border trim
141 CRect OptionRect; // screen area spanned by the option button
142 CRect rNewGame; // screen area spanned by the name plate
143 CRect arBeaver[NUM_BEAVERS];
144
145 CString aHitFile[NUM_HIT_SOUNDS];
146 CString aMissFile[NUM_MISS_SOUNDS];
147
148public:
149 CMainDFAWindow(HWND, LPGAMESTRUCT);
150
151 void SplashScreen();
152
153 static void ReleaseResources();
154 static void FlushInputEvents();
155 void MainLoop();
156 void ResetGame();
157 void ClearGrid();
158 void LoadNewGrid(int = 1);
159 void CreateNewGrid();
160
161private:
162 void OnSoundNotify(CSound *pSound);
163
164protected:
165 virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
166 bool LoadBeaverSounds();
167 void ReleaseBeaverSounds();
168 //
169 // Sound as resource dudes:
170 //
171 char *m_pHitSound[NUM_HIT_SOUNDS] = {};
172 HANDLE m_hHitRes[NUM_HIT_SOUNDS] = {};
173 char *m_pMissSound[NUM_MISS_SOUNDS] = {};
174 HANDLE m_hMissRes[NUM_MISS_SOUNDS] = {};
175
176 //{{AFX_MSG( CMainPackRatWindow )
177 afx_msg void OnPaint();
178 afx_msg void OnClose();
179 afx_msg void OnDestroy();
180 afx_msg void OnTimer(uintptr);
181 afx_msg void OnRButtonDown(unsigned int, CPoint);
182 afx_msg void OnLButtonDown(unsigned int, CPoint);
183 afx_msg void OnLButtonUp(unsigned int, CPoint);
184 afx_msg void OnMouseMove(unsigned int, CPoint);
185 afx_msg void OnSysKeyDown(unsigned int, unsigned int, unsigned int);
186 afx_msg void OnKeyDown(unsigned int, unsigned int, unsigned int);
187 afx_msg bool OnEraseBkgnd(CDC *);
188 afx_msg void OnActivate(unsigned int nState, CWnd *pWndOther, bool bMinimized) override;
189 afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
190 afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
191 //}}AFX_MSG
192
193 DECLARE_MESSAGE_MAP()
194};
195
196} // namespace DFA
197} // namespace HodjNPodj
198} // namespace Bagel
199
200#endif
Definition: afxwin.h:721
Definition: afxwin.h:1532
Definition: atltypes.h:79
Definition: atltypes.h:131
Definition: afxstr.h:31
Definition: afxwin.h:1141