-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
260 lines (236 loc) · 4.44 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
// main.h
#include "MTypes.h"
void Initialize( void );
void RetrieveResources( void );
__declspec(noreturn) void Error( const char* extra );
void CenterRectOnScreen( MRect *rect, double locationX, double locationY );
MBoolean AnyKeyIsPressed( void );
void RefreshAll( void );
void ReserveMonitor( void );
void ReleaseMonitor( void );
void MaskRect( MRect *r );
void RefreshPlayerWindow( short player );
MBoolean IsRegistered( void );
int Warp( void );
void WaitForRelease( void );
void QuickFadeIn( MRGBColor* color );
void QuickFadeOut( MRGBColor* color );
MBoolean FileExists( const char* name );
void GoToBackground();
MBoolean ControlKeyIsPressed( void );
MBoolean OptionKeyIsPressed( void );
MBoolean DeleteKeyIsPressed( void );
MBoolean IsRegistered();
void InitRegistration();
void NoPaint();
void NeedRefresh();
const char* QuickResourceName( const char* prefix, int id, const char* extension );
void WaitForRegainFocus();
struct KeyList
{
short left, right, drop, rotate;
};
#define kGridAcross 6
#define kGridDown 13
enum
{
eNoState = 0,
eStartMenu,
eInGame,
eInGameOver,
eSharewareVictory,
eRegisteredVictory,
eFinished
};
enum
{
picBoard = 1000,
picBackdrop,
picNext,
picVictory,
picSelectDifficulty,
picBoardRight,
picBlob = 200,
picBlobMask,
picCharMask,
picNumber,
picNumberMask,
picBlast,
picBlastMask,
picFont = 250,
picHiScoreFont,
picContinueFont,
picBalloonFont,
picZapFont,
picZapOutlineFont,
picVictoryFont,
picBubbleFont,
picTinyFont,
picDashedLineFont,
picBatsuFont,
picTitle = 300,
picSharewareVictory,
picGameStart,
picGameOver,
picVictory1,
picVictory2,
picVictory3,
picVictory4,
picVictory5,
picVictory6,
picLogo = 500,
picLogoAlpha,
picLogoMask
};
enum
{
winPlayer = 128,
winBackdrop,
winNext,
winScore,
winOpponent,
winTitle,
winVictory,
winLevel
};
enum
{
rightRotate = 0,
downRotate,
leftRotate,
upRotate
};
enum
{
kEmpty = 0,
kBlob,
kBlob2,
kBlob3,
kBlob4,
kBlob5,
kBlob6,
kBlob7,
kBombTop,
kBombBottom,
kGray,
kLight,
kSun
};
enum
{
kNoSuction = 0,
kUp = 1,
kRight = 2,
kUpRight = 3,
kDown = 4,
kUpDown = 5,
kRightDown = 6,
kUpRightDown = 7,
kLeft = 8,
kLeftUp = 9,
kLeftRight = 10,
kLeftUpRight = 11,
kLeftDown = 12,
kLeftUpDown = 13,
kLeftRightDown = 14,
kLeftUpRightDown = 15,
kDying = 16,
kSquish = 17,
kSquash = 18,
kSquish1 = 19,
kSquish2 = 20,
kSquish3 = 21,
kSquish4 = 22,
kBlinkBlob = 23,
kSobBlob = 24,
kSob2Blob = 25,
kFlashDarkBlob = 26,
kFlashBrightBlob = 27,
kJiggle1 = 28,
kJiggle2 = 29,
kJiggle3 = 30,
kJiggle4 = 31,
kJiggle5 = 32,
kJiggle6 = 33,
kJiggle7 = 34,
kJiggle8 = 35,
kInDoubt = 36,
kInDeath = 37
};
enum
{
kNoCharring = 0,
kBombFuse1 = 0,
kBombFuse2 = 1,
kBombFuse3 = 2,
kBlinkBomb1 = 3,
kBlinkBomb2 = 4,
kBlinkBomb3 = 5,
kChar11,
kChar31,
kChar12,
kChar32,
kChar13,
kChar33,
kChar14,
kChar24,
kChar34
};
enum
{
kDarkChar = 0xF0,
kLightestChar = 0x00
};
enum
{
kFlashAnimation = 0,
kJiggleAnimation
};
#define kBlobFrames (kFlashBrightBlob+1)
enum
{
kGrayNoBlink = 0,
kGrayBlink1,
kGrayBlink2,
kGrayBlink3,
kSunGlow1,
kSunGlow2,
kSunGlow3,
kSunGlow4,
kSmallGray1,
kSmallGray1b,
kSmallGray2,
kSmallGray2b,
kSmallGray3,
kSmallGray3b,
kSmallGray4,
kSmallGray4b,
kSmallGray5,
kSmallGray5b,
kEasyGray = 25,
kHardGray,
kStageGray
};
#define kGrayFrames (kGrayDying4+1)
#define kFirstBlob kBlob
#define kLastBlob kBlob7
#define kBlobTypes (kLastBlob - kFirstBlob + 1)
#define pi M_PI
#define arrsize(x) int(sizeof((x)) / sizeof((x)[0]))
extern SDL_Renderer* g_renderer;
extern SDL_Window* g_window;
extern SDL_Texture* g_windowTexture;
extern SDL_Surface* g_frontSurface;
extern signed char nextA[2], nextB[2], nextM[2], nextG[2], colorA[2], colorB[2],
blobX[2], blobY[2], blobR[2], blobSpin[2], speed[2], role[2], halfway[2],
control[2], dropping[2], magic[2], grenade[2], anim[2];
extern int chain[2];
extern int blobTime[2], startTime, endTime;
extern MBoolean finished, pauseKey, showStartMenu;
extern signed char grid[2][kGridAcross][kGridDown], suction[2][kGridAcross][kGridDown],
charred[2][kGridAcross][kGridDown], glow[2][kGridAcross][kGridDown];
extern MRect playerWindowZRect, playerWindowRect[2];
extern MBoolean playerWindowVisible[2];
extern KeyList hitKey[2];
extern int backgroundID;
extern void (*DoFullRepaint)();