2021-07-25 18:53:15 +00:00
|
|
|
/// Everything here needs to be kept in sync with the ASM versions in
|
|
|
|
/// gather.inc!
|
|
|
|
|
2022-04-04 04:12:44 +00:00
|
|
|
enum gather_flag_t {
|
|
|
|
GF_FREE = 0,
|
|
|
|
GF_ALIVE = 1,
|
|
|
|
GF_DONE = 2,
|
|
|
|
|
|
|
|
_gather_flag_t_FORCE_UINT8 = 0xFF
|
|
|
|
};
|
|
|
|
|
2020-03-31 16:25:15 +00:00
|
|
|
// Shrinking gather circles. Can fire bullets according to the included
|
|
|
|
// template once their radius reaches GATHER_RADIUS_END, unless
|
|
|
|
// [bullet_template.spawn_type] is set to BST_GATHER_ONLY.
|
|
|
|
struct gather_t {
|
2022-04-04 04:12:44 +00:00
|
|
|
gather_flag_t flag;
|
2020-03-31 16:25:15 +00:00
|
|
|
uint4_t col;
|
2021-06-30 14:30:06 +00:00
|
|
|
PlayfieldMotion center;
|
2020-03-31 16:25:15 +00:00
|
|
|
Subpixel radius_cur;
|
|
|
|
int ring_points;
|
|
|
|
// Added to the automatically calculated angle of each ring point
|
|
|
|
unsigned char angle_cur;
|
|
|
|
// Added to [angle_cur] every frame
|
|
|
|
unsigned char angle_delta;
|
|
|
|
#if GAME == 4
|
|
|
|
bullet_template_t bullet_template;
|
|
|
|
#endif
|
|
|
|
Subpixel radius_prev; // never read
|
|
|
|
// *Subtracted* from [radius_cur] every frame
|
|
|
|
Subpixel radius_delta;
|
|
|
|
#if GAME == 5
|
|
|
|
bullet_template_t bullet_template;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct gather_template_t {
|
|
|
|
SPPoint center;
|
|
|
|
SPPoint velocity;
|
|
|
|
Subpixel radius;
|
|
|
|
int ring_points;
|
|
|
|
uint4_t col;
|
|
|
|
unsigned char angle_delta;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define GATHER_POINT_W 8
|
|
|
|
#define GATHER_POINT_H 8
|
|
|
|
#define GATHER_FRAMES 32
|
2021-06-27 13:28:58 +00:00
|
|
|
#define GATHER_RADIUS_START 64.0f
|
2022-04-04 04:12:44 +00:00
|
|
|
#define GATHER_RADIUS_END to_sp(2.0f)
|
2020-03-31 16:25:15 +00:00
|
|
|
|
|
|
|
#define GATHER_COUNT 16
|
|
|
|
#if GAME == 5
|
|
|
|
# define GATHER_CAP 8
|
|
|
|
#else
|
|
|
|
# define GATHER_CAP GATHER_COUNT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern gather_t gather_circles[GATHER_COUNT];
|
|
|
|
extern gather_template_t gather_template;
|
|
|
|
|
2022-04-23 18:56:19 +00:00
|
|
|
inline void gather_template_init(void) {
|
|
|
|
gather_template.radius.set(GATHER_RADIUS_START);
|
|
|
|
gather_template.angle_delta = 0x02;
|
|
|
|
gather_template.ring_points = 8;
|
|
|
|
}
|
|
|
|
|
2020-03-31 16:25:15 +00:00
|
|
|
// Adds a gather circle based on the current global [gather_template], with a
|
|
|
|
// copy of the current global [bullet_template]. These bullets will be fired
|
|
|
|
// once the new circle's radius reaches GATHER_RADIUS_END.
|
|
|
|
void near gather_add_bullets(void);
|
|
|
|
|
|
|
|
// Adds a gather circle based on the current global [gather_template] which
|
|
|
|
// won't fire bullets at GATHER_RADIUS_END.
|
|
|
|
void near gather_add_only(void);
|
|
|
|
|
2020-04-01 13:52:11 +00:00
|
|
|
// Calls gather_add_only() to add one of the three circles in a 3-stack gather
|
|
|
|
// animation, based on the value of [frame]. The three circles are added at
|
|
|
|
// [frame] 0, 2, and 4, respectively, using the given colors. Will do nothing
|
|
|
|
// for any other value of [frame].
|
|
|
|
void pascal near gather_add_only_3stack(
|
2022-03-31 00:53:40 +00:00
|
|
|
int frame, int col_for_0, int col_for_2_and_4
|
2021-07-14 12:47:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
// Blits the gather point sprite to ([left], [top]). Assumptions:
|
|
|
|
// • ES is already be set to the beginning of a VRAM segment
|
|
|
|
// • The GRCG is active, and set to the intended color
|
|
|
|
void __fastcall near gather_point_render(screen_x_t left, vram_y_t top);
|
2020-04-01 13:52:11 +00:00
|
|
|
|
2022-04-04 04:12:44 +00:00
|
|
|
void gather_update(void);
|
2021-07-14 12:47:44 +00:00
|
|
|
void gather_render(void);
|