ScummVM API documentation
garfunkle.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_GARFUNKLE_GARFUNKLE_H
23 #define HODJNPODJ_GARFUNKLE_GARFUNKLE_H
24 
25 #include "bagel/boflib/sound.h"
26 
27 namespace Bagel {
28 namespace HodjNPodj {
29 namespace Garkfunkle {
30 
31 #define PLAY_FACTOR 150 // Multiply MilliSeconds by SpeedFactor for tenths of Seconds
32 #define ANIM_SLEEP 200 // Milliseconds
33 
34 // Button Identifier codes (BIDs)
35 #define IDC_A 100
36 #define IDC_B 101
37 #define IDC_C 102
38 #define IDC_D 103
39 #define IDC_E 104
40 #define IDC_F 105
41 #define IDC_START 106
42 
43 // Win condition values
44 #define LOW_WIN 8 // Minimum number of notes in completed
45 #define MEDIUM_WIN 10 //...sequence required to receive info
46 #define HIGH_WIN 12 //...when playing from the metagame
47 
48 // Backdrop bitmaps
49 #define MAINSCREEN ".\\ART\\GARFEMPT.BMP"
50 #define RIBBON ".\\ART\\RIBBON.BMP"
51 
52 #define RIBBON_X 139
53 #define RIBBON_Y 332
54 
55 #define SIGN_COLOR RGB( 0, 0, 0 ) // Color of the sign text
56 #define SIGN_LOCATION_X 117
57 #define SIGN_LOCATION_Y 310
58 #define SIGN_WIDTH 33
59 #define SIGN_HEIGHT 30
60 
61 #define VIOLIN_LOCATION_X 199
62 #define VIOLIN_LOCATION_Y 210
63 #define VIOLIN_WIDTH 57
64 #define VIOLIN_HEIGHT 96
65 
66 #define CELLO_LOCATION_X 257
67 #define CELLO_LOCATION_Y 206
68 #define CELLO_WIDTH 63
69 #define CELLO_HEIGHT 101
70 
71 #define DRUM_LOCATION_X 321
72 #define DRUM_LOCATION_Y 208
73 #define DRUM_WIDTH 57
74 #define DRUM_HEIGHT 92
75 
76 #define SAX_LOCATION_X 380
77 #define SAX_LOCATION_Y 208
78 #define SAX_WIDTH 55
79 #define SAX_HEIGHT 99
80 
81 #define HARP_LOCATION_X 141
82 #define HARP_LOCATION_Y 194
83 #define HARP_WIDTH 56
84 #define HARP_HEIGHT 107
85 
86 #define CLARINET_LOCATION_X 444
87 #define CLARINET_LOCATION_Y 180
88 #define CLARINET_WIDTH 46
89 #define CLARINET_HEIGHT 127
90 
91 #define NEWGAME_LOCATION_X 15
92 #define NEWGAME_LOCATION_Y 0
93 #define NEWGAME_WIDTH 217
94 #define NEWGAME_HEIGHT 20
95 
96 #define SIGN_LOCATION_X 117
97 #define SIGN_LOCATION_Y 310
98 #define SIGN_WIDTH 33
99 #define SIGN_HEIGHT 30
100 
101 #define WOODRIGHT_LOCATION_X 460
102 #define WOODRIGHT_LOCATION_Y 25
103 #define WOODRIGHT_WIDTH 164
104 #define WOODRIGHT_HEIGHT 137
105 
106 #define WOODLEFT_LOCATION_X 17
107 #define WOODLEFT_LOCATION_Y 25
108 #define WOODLEFT_WIDTH 137
109 #define WOODLEFT_HEIGHT 148
110 
111 #define BENCH_LOCATION_X 17
112 #define BENCH_LOCATION_Y 404
113 #define BENCH_WIDTH 610
114 #define BENCH_HEIGHT 62
115 
116 // Simon Button constants
117 #define MIN_BUTTONS 3
118 #define MAX_BUTTONS 6
119 #define MAX_SEQUENCE 25
120 
121 // Playback speed constants
122 #define MIN_SPEED 0
123 #define MAX_SPEED 11
124 #define NUM_SPEEDS 12
125 #define SLOW_DOWN 1 // take off this amount from time between notes on playback
126 
127 #define PLAYER_TIMER 3 // can't wait forever for a note!
128 #define ANIM_TIMER 4 // time to change frames
129 #define TIME_LIMIT 10000 // 10 seconds for player response
130 #define PAUSE_TIME 50 // in milliseconds, so = 1/2 sec
131 #define INCREMENT_RATE 5 // rate by which speed is increased
132 
133 #define RULES_TEXT "GARFUNK.TXT" // rules file
134 
135 #define WIN_SOUND ".\\SOUND\\FANFARE1.WAV"
136 #define WRONG_SOUND ".\\SOUND\\SOSORRY.WAV"
137 #define SLOW_SOUND ".\\SOUND\\ALARM.WAV"
138 #define SIGN_1_SOUND ".\\SOUND\\SIGN1.WAV"
139 #define SIGN_2_SOUND ".\\SOUND\\SIGN2.WAV"
140 #define SIGN_3_SOUND ".\\SOUND\\SIGN3.WAV"
141 #define SIGN_4_SOUND ".\\SOUND\\SIGN4.WAV"
142 #define SIGN_5_SOUND ".\\SOUND\\SIGN5.WAV"
143 #define BENCH_SOUND ".\\SOUND\\MYSEAT.WAV"
144 #define TREES_SOUND ".\\SOUND\\TIMBER.WAV"
145 #define RULES_SOUND ".\\SOUND\\GARFUNK.WAV"
146 
147 #define NUM_SIGN_SOUNDS 5
148 
149 #define VIOLIN_SOUND ".\\SOUND\\viol2.mid"
150 #define CELLO_SOUND ".\\SOUND\\cello2.mid"
151 #define DRUM_SOUND ".\\SOUND\\DRUM2.MID" //drum.mid" //DRUM.WAV"
152 #define SAX_SOUND ".\\SOUND\\sax2.mid"
153 #define HARP_SOUND ".\\SOUND\\harp2.mid"
154 #define CLARINET_SOUND ".\\SOUND\\clar2.mid"
155 
156 #define VIOLIN_ANIM ".\\ART\\violin2.bmp"
157 #define CELLO_ANIM ".\\ART\\cello2.bmp"
158 #define DRUM_ANIM ".\\ART\\drums2.bmp"
159 #define SAX_ANIM ".\\ART\\sax2.bmp"
160 #define HARP_ANIM ".\\ART\\harp2.bmp"
161 #define CLARINET_ANIM ".\\ART\\clari2.bmp"
162 
163 #define VIOLIN_CELS 14
164 #define CELLO_CELS 16
165 #define DRUM_CELS 20
166 #define SAX_CELS 14
167 #define HARP_CELS 17
168 #define CLARINET_CELS 18
169 
170 #define VIOLIN_OFFSET_X 2
171 #define CELLO_OFFSET_X 4
172 #define DRUM_OFFSET_X 0
173 #define SAX_OFFSET_X 2
174 #define HARP_OFFSET_X 2
175 #define CLARINET_OFFSET_X 5
176 
177 #define VIOLIN_OFFSET_Y 16
178 #define CELLO_OFFSET_Y 5
179 #define DRUM_OFFSET_Y 3
180 #define SAX_OFFSET_Y 4
181 #define HARP_OFFSET_Y 0
182 #define CLARINET_OFFSET_Y 4
183 
184 //bool wait_awhile(int);
185 
187 
188 // CMainWindow:
189 // See game.cpp for the code to the member functions and the message map.
190 //
191 class CMainWindow : public CFrameWnd {
192 public:
193  CMainWindow();
194  bool GetNewSequence(const char* pszFileName);
195  bool GetNewSequence(int nLength);
196  void ActivateButtons(unsigned int nNumActive, bool bState);
197  void PlayBackSeries(int nNumNotes);
198  void NewGame();
199  void StartAnimation();
200  void StopAnimation();
201  bool wait_awhile(int nHundSecs);
202 
203 //added data members:
204  virtual void SplashScreen();
205 
206 private:
207  void initStatics();
208  void OnSoundNotify(CSound *pSound);
209 
210  CRect rectMusic[MAX_BUTTONS]; // Musician locations
211 
212 protected:
213  virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
214  void OnDestroy();
215 
216  //{{AFX_MSG( CMainWindow )
217  afx_msg void OnPaint();
218  afx_msg void OnChar(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
219  afx_msg void OnSysChar(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
220  afx_msg void OnKeyDown(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
221  afx_msg void OnSysKeyDown(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
222 // afx_msg void OnKeyUp(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
223  afx_msg void OnTimer(uintptr nIDEvent);
224  afx_msg void OnLButtonDown(unsigned int nFlags, CPoint point);
225  afx_msg void OnLButtonUp(unsigned int nFlags, CPoint point);
226  afx_msg void OnRButtonDown(unsigned int nFlags, CPoint point);
227  afx_msg void OnMouseMove(unsigned int nFlags, CPoint point);
228  afx_msg void OnActivate(unsigned int, CWnd*, bool) override;
229  afx_msg void OnClose();
230  afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
231  afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
232  //}}AFX_MSG
233 
234  DECLARE_MESSAGE_MAP()
235 };
236 
237 } // namespace Garfunkle
238 } // namespace HodjNPodj
239 } // namespace Bagel
240 
241 #endif
Definition: afxwin.h:1125
Definition: afxwin.h:1514
Definition: atltypes.h:79
Definition: afxwin.h:27
Definition: atltypes.h:131