blob: 6d97cf749e6de1eee9e7283e153aa06e55f666d3 (
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
61
62
63
64
65
66
67
68
69
|
#ifndef HUMAN_PLAYER_H
#define HUMAN_PLAYER_H
#include <camera.h>
#include <instance.h>
#include <pad.h>
#include <player.h>
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C"
{
#endif
enum {MAX_SELECTED_INSTANCES = 4};
struct human_player
{
struct player pl;
struct camera cam;
struct pad pad;
struct sel_instance
{
enum sel_type
{
INSTANCE_TYPE_UNIT,
INSTANCE_TYPE_BUILDING,
INSTANCE_TYPE_RESOURCE
} type;
union sel_data
{
const struct unit *u;
const struct building *b;
const struct resource *r;
const struct instance *i;
struct unit *rw_u;
} d;
} sel[MAX_SELECTED_INSTANCES];
struct
{
const struct instance *ins;
unsigned char t, n;
bool render;
} target;
size_t n_sel;
bool top_gui;
unsigned long gui_res[MAX_RESOURCE_TYPES];
};
struct human_player_cfg
{
struct player_cfg pl;
int padn;
};
int human_player_init(const struct human_player_cfg *cfg, struct human_player *h);
bool human_player_update(struct human_player *h, struct player_others *o);
int human_player_render(const struct human_player *h, const struct player_others *o);
#ifdef __cplusplus
}
#endif
#endif /* HUMAN_PLAYER_H */
|