blob: c6f20d298c55440ad07189d4c743714edf31ccb6 (
plain) (
blame)
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
|
#ifndef INSTANCE_H
#define INSTANCE_H
#include <camera.h>
#include <gfx.h>
#include <util.h>
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
#endif
struct instance
{
bool alive;
struct util_rect r;
};
typedef void (*instance_done_cb)(struct instance *i, void *op);
struct instance_render_cfg
{
const struct instance *i;
const struct camera *cam;
enum
{
INSTANCE_RENDER_CFG_SPRITE,
INSTANCE_RENDER_CFG_QUAD
} prim_type;
union
{
struct sprite *s;
const struct instance_render_quad
{
struct quad *q;
short w, h;
uint8_t u;
bool xflip;
} *quad;
} prim;
bool sel;
const struct instance_render_off
{
short x, y;
} *off;
};
int instance_render(const struct instance_render_cfg *cfg);
int instance_render_target(const struct instance *const i, const struct camera *cam);
void instance_cyclic(void);
#ifdef __cplusplus
}
#endif
#endif /* INSTANCE_H */
|