ScummVM API documentation
beacon.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_BEACON_BEACON_H
23#define HODJNPODJ_BEACON_BEACON_H
24
25#include "bagel/boflib/sound.h"
26
27namespace Bagel {
28namespace HodjNPodj {
29namespace Beacon {
30
31#define ABS(a) ( (a > 0) ? (a) : (-a) )
32
33// Border info
34#define TOP_BORDER 24 //25
35#define BOTTOM_BORDER 16
36#define SIDE_BORDER 16
37
38#define BEACON_TIMER 1
39#define MIN_SPEED 0
40#define MAX_SPEED 2
41#define SPEED_BASE 70
42#define SPEED_STEP 10
43
44#define NUM_BEAMS 120
45#define CHANGE_BEAM 144
46#define START_ENTRY 55 // Starting entry of available palette slots
47#define BUTTON_ENTRY 176 // First entry of the Button palette slots
48
49#define GRID_WIDTH 8 //5 // Number of pixels
50#define GRID_HEIGHT 8 //5
51
52// Game playing area
53#define ART_WIDTH 488
54#define ART_HEIGHT 440
55
56#define NUM_BUTTONS 16 // Number of buttons
57#define NUM_COLUMNS (ART_WIDTH / GRID_WIDTH)
58#define NUM_ROWS (ART_HEIGHT / GRID_HEIGHT)
59
60// Lighthouse bitmap placement
61#define LTHOUSE_OFFSET_X 20
62#define LTHOUSE_OFFSET_Y 15
63#define LTHOUSE_WIDTH 50
64#define LTHOUSE_HEIGHT 70
65
66// Start area
67#define START_OFFSET_X 36 // GRID_WIDTH * 4.5
68#define START_OFFSET_Y 28 // GRID_HEIGHT * 3.5
69#define START_WIDTH 72 // GRID_WIDTH * 9
70#define START_HEIGHT 88 // GRID_HEIGHT * 11
71
72// Color Button placement
73#define BLOCK_SPACE_X 6
74#define BLOCK_SPACE_Y 6
75#define BLOCK_OFFSET_X (ART_WIDTH + SIDE_BORDER + BLOCK_SPACE_X)
76#define BLOCK_OFFSET_Y 74 // TOP_BORDER + 50
77#define BLOCK_WIDTH 50
78#define BLOCK_HEIGHT 40
79
80#define SELECT_COLOR 0 // Always use Black for highlighting selected beacon color
81#define HILITE_BORDER 4 // The highlighting frame is three pixels wide
82#define XTRALITE_TRIM 42 // Color Index of lightest trim color
83#define LITE_TRIM 30 // Color Index of light trim color
84#define MEDIUM_TRIM 45 // Color Index of medium trim color
85#define DARK_TRIM 46 // Color Index of dark trim color
86
87// Starting value defaults
88#define MAX_SWEEPS 300
89#define MIN_SWEEPS 5
90
91// Sound files
92#define MID_SOUND "sound\\bong.wav"
93#define PICK_SOUND "sound\\pick.wav"
94#define LOSE_SOUND "sound\\buzzer.wav"
95#define WIN_SOUND "sound\\SOUNDWON.WAV"
96
97#define GAME_THEME "sound\\beacon.mid"
98#define RULES_WAV "sound\\BEACON.WAV"
99#define RULES_TEXT "BEACON.TXT"
100
101// Backdrop bitmaps
102#define MAINSCREEN "art\\BEACBRDR.BMP"
103#define BEAMSCREEN "art\\BEAMS3.BMP"
104
105// Artwork data file constants
106#define DATA_FILE "BEACON.DAT"
107#define MAX_FILE_LENGTH 20
108
109// New Game button area
110#define NEWGAME_LOCATION_X 15
111#define NEWGAME_LOCATION_Y 0
112#define NEWGAME_WIDTH 217
113#define NEWGAME_HEIGHT 20
114
116
117// CMainWindow:
118// See game.cpp for the code to the member functions and the message map.
119//
120class CMainWindow : public CFrameWnd {
121private:
122 struct BLOCK {
123 CRect rLocation;
124 unsigned int nColorIndex;
125 } colorBlock[NUM_BUTTONS];
126
127 void initStatics();
128
129public:
130 CMainWindow();
131 void NewGame();
132 void DrawBeams(CDC *pDC);
133 void MoveBeam();
134 void CheckUnderBeam();
135 void SetBeamEntries(CDC *pDC);
136 static void DrawPart(CDC *pDC, CPoint Src, CPoint Dst, int nWidth, int nHeight);
137 static bool CompareColors(CDC *pDC, CPoint point);
138 static bool UnderLighthouse(CPoint point);
139 static bool InPictureSquare(CPoint point);
140 static CPoint PointToGrid(CPoint point);
141 bool LoadArtWork(CDC *pDC);
142
143//added data members:
144private:
145 void OnSoundNotify(CSound *pSound);
146
147protected:
148 virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
149
150 //{{AFX_MSG( CMainWindow )
151 afx_msg void OnPaint();
152 afx_msg void OnChar(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
153 afx_msg void OnSysKeyDown(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
154 afx_msg void OnKeyDown(unsigned int nChar, unsigned int nRepCnt, unsigned int nFlags);
155 afx_msg void OnTimer(uintptr nIDEvent);
156 afx_msg void OnLButtonDown(unsigned int nFlags, CPoint point);
157 afx_msg void OnLButtonUp(unsigned int nFlags, CPoint point);
158 afx_msg void OnMouseMove(unsigned int nFlags, CPoint point);
159 afx_msg void OnClose();
160 afx_msg LRESULT OnMCINotify(WPARAM, LPARAM);
161 afx_msg LRESULT OnMMIONotify(WPARAM, LPARAM);
162 //}}AFX_MSG
163
164 DECLARE_MESSAGE_MAP()
165};
166
167} // namespace Beacon
168} // namespace HodjNPodj
169} // namespace Bagel
170
171#endif
Definition: afxwin.h:721
Definition: afxwin.h:1532
Definition: atltypes.h:79
Definition: atltypes.h:131