ScummVM API documentation
fuge.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_FUGE_FUGE_H
23#define HODJNPODJ_FUGE_FUGE_H
24
25#include "bagel/afxwin.h"
26#include "bagel/hodjnpodj/hnplibs/stdinc.h"
27#include "bagel/hodjnpodj/hnplibs/sprite.h"
28#include "bagel/hodjnpodj/hnplibs/text.h"
29#include "bagel/boflib/error.h"
30#include "bagel/hodjnpodj/libs/vector.h"
31#include "bagel/hodjnpodj/hnplibs/button.h"
32#include "bagel/boflib/sound.h"
33
34namespace Bagel {
35namespace HodjNPodj {
36namespace Fuge {
37
38#define N_ROWS 6
39#define BRICKS_PER_ROW 16
40#define N_BRICKS (N_ROWS*BRICKS_PER_ROW)
41
42class CFugeWindow : public CFrameWnd {
43public:
45 void PlayGame();
46 void PaintScreen();
47 void LoadIniSettings();
48
49protected:
50 void initMembers();
51 void initStatics();
52 void GameReset();
53 void GamePause();
54 void GameResume();
55 void HandleError(ERROR_CODE);
56 void RealignVectors();
57 ERROR_CODE LoadMasterSprites();
58 void ReleaseMasterSprites();
59 ERROR_CODE LoadMasterSounds();
60 void ReleaseMasterSounds();
61 ERROR_CODE LoadNewPaddle(int);
62 void InitializeJoystick();
63 void RepaintSpriteList(CDC *);
64 void PaintBricks(CDC *);
65 void StartBall();
66 void EndBall();
67 void PaintBall();
68 void LaunchBall();
69 void StartPaddle();
70 void EndPaddle();
71 void PaintPaddle(bool);
72 CVector BallOnPaddle();
73 void StartBricks();
74 void EndBricks();
75 void EraseBrick(CDC *, int);
76 void LoseBall();
77 void BallvsPaddle();
78 void BallvsBrick(double);
79
80 virtual bool OnCommand(WPARAM wParam, LPARAM lParam) override;
81 long OnJoyStick(unsigned int, long);
82 void OnPaint();
83 void OnTimer(uintptr);
84 void OnMouseMove(unsigned int, CPoint);
85 void OnRButtonUp(unsigned int, CPoint);
86 void OnLButtonDown(unsigned int, CPoint);
87 void OnSysChar(unsigned int, unsigned int, unsigned int);
88 void OnSysKeyDown(unsigned int, unsigned int, unsigned int);
89 void OnKeyDown(unsigned int, unsigned int, unsigned int);
90 void OnActivate(unsigned int, CWnd *, bool) override;
91 LRESULT OnMCINotify(WPARAM, LPARAM);
92 LRESULT OnMMIONotify(WPARAM, LPARAM);
93 void OnSoundNotify(CSound *);
94 void OnClose();
95
96 DECLARE_MESSAGE_MAP()
97
98 bool m_bBrickVisible[N_BRICKS] = {};
99 CPoint m_ptOrigin;
100 CRect m_rNewGameButton;
101 CRect m_rBlackHole;
102 CVector m_vBallVector;
103 CVector m_ptBallLocation;
104 CPalette *m_pGamePalette = nullptr;
105 CBmpButton *m_pScrollButton = nullptr;
106 CSprite *m_pBall = nullptr;
107 CSprite *m_pPaddle = nullptr;
108 CSound *m_pSoundTrack = nullptr;
109
110 char * m_pBrickSound = nullptr;
111 char * m_pWallSound = nullptr;
112 char * m_pPaddleSound = nullptr;
113 char * m_pExtraLifeSound = nullptr;
114 HANDLE m_hBrickRes = nullptr;
115 HANDLE m_hWallRes = nullptr;
116 HANDLE m_hPaddleRes = nullptr;
117 HANDLE m_hExtraLifeRes = nullptr;
118
119 int m_nInitNumBalls = 0;
120 int m_nInitStartLevel = 0;
121 int m_nInitBallSpeed = 0;
122 int m_nInitPaddleSize = 0;
123 int m_nGForceFactor = 0;
124
125 double m_fTurboBoost = 0;
126 long m_lScore = 0;
127 long m_lExtraLifeScore = 0;
128 long m_nJoyOrgX = 0;
129 long m_nJoyOrgY = 0;
130 int m_nBricks = 0;
131 int m_nBalls = 0;
132 int m_nBallSpeed = 0;
133 int m_nNumRows = 0;
134 int m_nPaddleCelIndex = 0;
135 int m_nOldSize = -1;
136
137 bool m_bMovingPaddle = false;
138 bool m_bGameActive = false;
139 bool m_bPause = false;
140 bool m_bIgnoreScrollClick = false;
141 bool m_bPaddleHit = false;
142 bool m_bOutterWall = false;
143 bool m_bJoyActive = false;
144 bool m_bBallOnPaddle = false;
145
146 CVector gvCenter;
147};
148
149} // namespace Fuge
150} // namespace HodjNPodj
151} // namespace Bagel
152
153#endif
Definition: button.h:65
Definition: sprite.h:41
Definition: stdinc.h:38
Definition: afxwin.h:721
Definition: afxwin.h:1532
Definition: afxwin.h:667
Definition: atltypes.h:79
Definition: atltypes.h:131
Definition: afxwin.h:1141