ScummVM API documentation
main.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_ARCHEROIDS_MAIN_H
23#define HODJNPODJ_ARCHEROIDS_MAIN_H
24
25#include "bagel/afxwin.h"
26
27#include "bagel/boflib/error.h"
28#include "bagel/hodjnpodj/hnplibs/stdinc.h"
29#include "bagel/boflib/sound.h"
30#include "bagel/hodjnpodj/hnplibs/sprite.h"
31#include "bagel/boflib/llist.h"
32#include "bagel/hodjnpodj/archeroids/usercfg.h"
33
34namespace Bagel {
35namespace HodjNPodj {
36namespace Archeroids {
37
38class CMainWindow : public CFrameWnd {
39public:
41 void PlayGame();
42 void PlayNextWave();
43 void PaintScreen();
44 ERROR_CODE RepaintSpriteList(CDC *);
45 void LoadIniSettings();
46 bool MainLoop();
47
48protected:
49 void FlushInputEvents();
50 bool CheckMessages();
51 ERROR_CODE LoadMasterSprites();
52 void ReleaseMasterSprites();
53 ERROR_CODE LoadMasterSounds();
54 void ReleaseMasterSounds();
55 void InitializeJoystick();
56 void GameReset();
57 void WaveReset();
58 CSprite *NewLife(int);
59 ERROR_CODE CreateLives();
60 ERROR_CODE CreateGoodGuy();
61 ERROR_CODE CreateBadGuys();
62 ERROR_CODE CreateHay();
63 ERROR_CODE CreateBurningHay(CPoint);
64 ERROR_CODE CreateGoodArrow();
65 ERROR_CODE CreateBadArrow(CSprite *);
66 void GamePause();
67 void GameResume();
68
69 void DestroyGoodArrow(CLList *);
70 void DestroyBadArrow(CLList *);
71 void DestroyBadGuy(CLList *, CDC *);
72 void PruneDeadBadGuys();
73 void DestroyHay(CLList *, CRect, CDC *, bool);
74 void DeleteSprite(CSprite *);
75 bool MoveArrows(CDC *);
76 bool MoveBadGuys(CDC *);
77 void MoveHodj(int);
78 void LoseLife(CDC *, bool);
79 void HandleError(ERROR_CODE);
80 void KillAnimation();
81 void OnSoundNotify(CSound *pSound);
82 POINT GetLeftMostBadGuy();
83
84 virtual bool OnCommand(WPARAM, LPARAM) override;
85 void OnPaint();
86 void OnSysKeyDown(unsigned int, unsigned int, unsigned int);
87 void OnKeyDown(unsigned int, unsigned int, unsigned int);
88 void OnSysChar(unsigned int, unsigned int, unsigned int);
89 void OnTimer(uintptr);
90 void OnClose();
91 long OnJoyStick(unsigned int, long);
92 void OnActivate(unsigned int, CWnd *, bool) override;
93 void OnLButtonDown(unsigned int, CPoint);
94 void OnRButtonUp(unsigned int, CPoint);
95 void OnMouseMove(unsigned int, CPoint);
96 LRESULT OnMCINotify(WPARAM, LPARAM);
97 LRESULT OnMMIONotify(WPARAM, LPARAM);
98
99 DECLARE_MESSAGE_MAP()
100
101 //
102 // protected data members
103 //
104 CRect m_rNewGameButton;
105 CPalette *m_pGamePalette = nullptr;
106 CSprite *m_pMasterBadArrow = nullptr;
107 CSprite *m_pMasterGoodArrow = nullptr;
108 CSprite *m_pMasterBurn = nullptr;
109 CSprite *m_pMasterBadWalk = nullptr;
110 CSprite *m_pMasterBadShoot = nullptr;
111 CSprite *m_pMasterBadDie = nullptr;
112 CSprite *m_pMasterGoodWalk = nullptr;
113 CSprite *m_pMasterGoodShoot = nullptr;
114 CSprite *m_pMasterGoodDie = nullptr;
115 CSprite *m_pMasterHeart = nullptr;
116 CSprite *m_pHodj = nullptr;
117 CSprite *m_pScrollSprite = nullptr;
118 CSprite *m_pLives[LIVES_MAX] = {};
119 CLList *m_pBadGuyList = nullptr;
120 CLList *m_pBadArrowList = nullptr;
121 CLList *m_pGoodArrowList = nullptr;
122 CLList *m_pHayList = nullptr;
123 CLList *m_pFXList = nullptr;
124 CSound *m_pSoundTrack = nullptr;
125
126 char * m_pBadDieSound = nullptr;
127 char * m_pBoltSound = nullptr;
128 char * m_pArrowSound = nullptr;
129 char * m_pBurnSound = nullptr;
130 char * m_pExtraLifeSound = nullptr;
131 HANDLE m_hBadDieRes = nullptr;
132 HANDLE m_hBoltRes = nullptr;
133 HANDLE m_hArrowRes = nullptr;
134 HANDLE m_hBurnRes = nullptr;
135 HANDLE m_hExtraLifeRes = nullptr;
136
137 POINT m_ptAnchor;
138 unsigned long m_lScore = 0;
139 unsigned long m_lNewLifeScore = 0;
140 int m_nGoodArrows, m_nBadArrows = 0;
141 int m_nGameSpeed = 0;
142 unsigned int m_nBadGuySpeed = 0;
143 unsigned int m_nArrowSpeed = 0;
144 unsigned int m_nState = 0;
145 int m_nMoveArrows = 0;
146 int m_nBadGuys = 0;
147 int m_nLives = 0;
148 int m_nLevel = 0;
149 int m_nWave = 0;
150 unsigned int m_nJoyLast = 0;
151 bool m_bPause = false;
152 bool m_bGameActive = false;
153 bool m_bJoyActive = false;
154 bool m_bMoveMode = false;
155 bool m_bInMenu = false;
156 bool m_bNewGame = false;
157 bool m_bAnimationsOn = false;
158 bool m_bTimerActive = false;
159
160
161 // User Setup variables
162 //
163 int m_nInitGameSpeed = 0;
164 int m_nInitArcherLevel = 0;
165 int m_nInitNumLives = 0;
166 int m_nInitNumBadGuys = 0;
167};
168
170//
171// CTheApp:
172//
173class CTheApp : public CWinApp {
174public:
175 bool InitInstance();
176 virtual int ExitInstance();
177};
178
179} // namespace Archeroids
180} // namespace HodjNPodj
181} // namespace Bagel
182
183#endif
Definition: llist.h:31
Definition: sprite.h:41
Definition: afxwin.h:721
Definition: afxwin.h:1532
Definition: afxwin.h:667
Definition: atltypes.h:79
Definition: atltypes.h:131
Definition: afxwin.h:1966
Definition: afxwin.h:1141
Definition: minwindef.h:161