2021-04-08 18:04:24 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
/* Copyright (C) 2021 KikooDX */
|
|
|
|
#pragma once
|
|
|
|
|
2021-04-21 17:51:59 +02:00
|
|
|
#include <libimg.h>
|
2021-04-08 18:04:24 +02:00
|
|
|
|
|
|
|
#define MAX_PARTICLES 64
|
|
|
|
|
|
|
|
struct Particle {
|
2021-04-21 17:51:59 +02:00
|
|
|
img_t *texture;
|
2021-04-08 18:04:24 +02:00
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int frame_width;
|
|
|
|
int frame_height;
|
|
|
|
int frame_duration;
|
|
|
|
int frame;
|
2021-04-09 00:31:24 +02:00
|
|
|
int life_ini;
|
2021-04-08 18:04:24 +02:00
|
|
|
int life;
|
2021-04-09 00:31:24 +02:00
|
|
|
int looping;
|
2021-04-21 17:51:59 +02:00
|
|
|
int flip_h;
|
2021-04-08 18:04:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void particles_init(void);
|
|
|
|
void particles_update(void);
|
2021-04-21 17:51:59 +02:00
|
|
|
void particle_update(struct Particle *particle);
|
2021-04-08 18:04:24 +02:00
|
|
|
void particles_draw(void);
|
2021-04-21 17:51:59 +02:00
|
|
|
void particle_draw(struct Particle particle);
|
|
|
|
void particle_create(img_t *texture, int x, int y, int frame_width,
|
|
|
|
int frame_duration, int looping, int flip_h);
|
|
|
|
struct Particle particle_init(img_t *texture, int x, int y, int frame_width,
|
|
|
|
int frame_duration, int looping, int flip_h);
|