-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathboss.h
237 lines (213 loc) · 5.03 KB
/
boss.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
/*
* $Id: boss.h,v 1.3 2003/04/04 03:46:20 kenta Exp $
*
* Copyright 2003 Kenta Cho. All rights reserved.
*/
/**
* Boss data.
*
* @version $Revision: 1.3 $
*/
#ifndef BOSS_H_
#define BOSS_H_
#define MORPH_PATTERN_MAX 8
#include "foe.h"
//senquack:
#include <GLES/gl.h>
#include <stdint.h>
#define IKA_FIX 0
#define IKA_ALTERNATE 1
#define IKA_HALF 2
#define IKA_ALTERNATE_SHOT 3
//senquack - conversion to fixed point:
//typedef struct {
// int barrageType, barrageIdx;
////senquack - complete conversion to floats:
//// double rank;
// float rank;
// int xReverse ,xrAlter;
// int morphIdx[MORPH_PATTERN_MAX];
// int morphCnt;
// int morphHalf;
// int morphType;
////senquack - complete conversion to floats:
//// double morphRank;
//// double speedRank;
// float morphRank;
// float speedRank;
// int ikaType;
//} Attack;
typedef struct
{
int barrageType, barrageIdx;
int xReverse, xrAlter;
int morphIdx[MORPH_PATTERN_MAX];
int morphCnt;
int morphHalf;
int morphType;
int ikaType;
#ifdef FIXEDMATH
//senquack - converted to fixed point:
GLfixed frank;
GLfixed fmorphRank;
GLfixed fspeedRank;
#else
//senquack - TODO: make sure converting from double to float here didn't mess anything up (bullet paterns, etc)
// converted these to floats from doubles:
float rank;
float morphRank;
float speedRank;
#endif //FIXEDMATH
} Attack;
typedef struct
{
struct foe *foe;
int x, y;
} Battery;
//senquack - partial conversion to fixed point
//typedef struct
//{
// int color;
// int bulletShape[BULLET_TYPE_NUM];
// float bulletSize[BULLET_TYPE_NUM];
//} BatteryShape;
typedef struct
{
int color;
int bulletShape[BULLET_TYPE_NUM];
#ifdef FIXEDMATH
GLfixed fbulletSize[BULLET_TYPE_NUM];
#else
float bulletSize[BULLET_TYPE_NUM];
#endif //FIXEDMATH
} BatteryShape;
struct limiter
{
int cnt, max;
int on;
};
typedef struct limiter Limiter;
#define BATTERY_PATTERN_MAX 6
#define BATTERY_MAX 3
typedef struct
{
Attack attack[BATTERY_PATTERN_MAX];
Battery battery[BATTERY_MAX];
int batteryNum;
BatteryShape shape;
Limiter limiter;
} BatteryGroup;
#define BATTERY_GROUP_MAX 10
#define MOVE_POINT_MAX 4
#define COLLISION_NUM 5
#define CREATING 0
#define ATTACKING 1
#define CHANGE 2
#define LAST_ATTACK 3
#define DESTROIED 4
#define DESTROIED_END 5
//senquack - conversion to fixed-point:
//typedef struct {
// Attack topAttack[BATTERY_PATTERN_MAX];
// Battery topBattery;
// Limiter topLimiter;
// BatteryShape shape;
// BatteryGroup batteryGroup[BATTERY_GROUP_MAX];
// int batteryGroupNum;
// int x, y, d;
// int mpx[MOVE_POINT_MAX], mpy[MOVE_POINT_MAX];
// int mpNum, mpIdx;
// int speed, md;
// int onRoute;
// int patternIdx, patternNum;
// int patternCnt, patternLgt;
//
// int color;
// int bulletShape[3];
// float bulletSize[3];
//
// int collisionX[COLLISION_NUM], collisionY[COLLISION_NUM], collisionYUp;
// int shield, patternChangeShield;
// int damaged, damageCnt, cnt;
// int state, stateCnt;
// int r, g, b;
//} Boss;
typedef struct
{
Attack topAttack[BATTERY_PATTERN_MAX];
Battery topBattery;
Limiter topLimiter;
BatteryShape shape;
BatteryGroup batteryGroup[BATTERY_GROUP_MAX];
int batteryGroupNum;
int x, y, d;
int mpx[MOVE_POINT_MAX], mpy[MOVE_POINT_MAX];
int mpNum, mpIdx;
int speed, md;
int onRoute;
int patternIdx, patternNum;
int patternCnt, patternLgt;
int color;
int bulletShape[3];
#ifdef FIXEDMATH
GLfixed fbulletSize[3];
#else
float bulletSize[3];
#endif //FIXEDMATH
int collisionX[COLLISION_NUM], collisionY[COLLISION_NUM], collisionYUp;
int shield, patternChangeShield;
int damaged, damageCnt, cnt;
int state, stateCnt;
int r, g, b;
} Boss;
#define BOSS_WING_MAX 2
//senquack - converting to fixed point
//typedef struct {
// float x[BOSS_WING_MAX][2], y[BOSS_WING_MAX][2], z[BOSS_WING_MAX][2];
// int wingNum;
// float size;
//} BossWing;
typedef struct
{
int wingNum;
#ifdef FIXEDMATH
GLfixed fx[BOSS_WING_MAX][2], fy[BOSS_WING_MAX][2], fz[BOSS_WING_MAX][2];
GLfixed fsize;
#else
float x[BOSS_WING_MAX][2], y[BOSS_WING_MAX][2], z[BOSS_WING_MAX][2];
float size;
#endif //FIXEDMATH
} BossWing;
#define TREE_MAX_LENGTH 5
//senquack - converting to fixed point
//typedef struct {
// float x[TREE_MAX_LENGTH], y[TREE_MAX_LENGTH], z[TREE_MAX_LENGTH];
// float ex[BATTERY_MAX], ey[BATTERY_MAX], ez[BATTERY_MAX];
// BossWing wing[TREE_MAX_LENGTH], eWing[BATTERY_MAX];
// int posNum, epNum;
// int diffuse;
//} BossTree;
typedef struct
{
#ifdef FIXEDMATH
GLfixed fx[TREE_MAX_LENGTH], fy[TREE_MAX_LENGTH], fz[TREE_MAX_LENGTH];
GLfixed fex[BATTERY_MAX], fey[BATTERY_MAX], fez[BATTERY_MAX];
#else
float x[TREE_MAX_LENGTH], y[TREE_MAX_LENGTH], z[TREE_MAX_LENGTH];
float ex[BATTERY_MAX], ey[BATTERY_MAX], ez[BATTERY_MAX];
#endif //FIXEDMATH
BossWing wing[TREE_MAX_LENGTH], eWing[BATTERY_MAX];
int posNum, epNum;
int diffuse;
} BossTree;
typedef struct
{
BossTree tree[BATTERY_GROUP_MAX];
int r, g, b;
int diffuse;
} BossShape;
extern "C"
{
#include "boss_mtd.h"
}
#endif