aboutsummaryrefslogtreecommitdiff
path: root/src/container/inc/container.h
blob: 59ab5fdafbf06be4bfdd25111c037707f92027ad (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
#ifndef CONTAINER_H
#define CONTAINER_H

#include <container/port.h>
#include <gfx.h>
#include <sfx.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C"
{
#endif

struct container
{
    const char *path;

    enum
    {
        CONTAINER_TYPE_SPRITE,
        CONTAINER_TYPE_SOUND
    } type;

    union
    {
        struct sprite *sprite;
        struct sound *sound;
    } data;

    struct container_rt
    {
        struct container *c;
    } *rt;
};

int container_load_ex(const char *path, const struct container *list, size_t n);
void container_free(const struct container *list, size_t n);

#ifdef __cplusplus
}
#endif

#endif /* CONTAINER_H */