summary refs log tree commit diff
path: root/src/loader.h
blob: 016b8b28b3e6bf0315334e30f612986b21b0968b (plain)
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
#pragma once

#include <stddef.h>
#include "entity.h"

typedef char * name_T;

struct blob {
	void *data;
	size_t size;
};

void res_init(void);

void res_init_texture(void);
void res_free_texture(void);
struct blob res_get_texture(name_T const name);

void res_init_map(void);
void res_free_map(void);
struct blob res_get_map(name_T const name);

void res_init_collision(void);
void res_free_collision(void);
struct blob res_get_collision(name_T const name);

void res_free_newfun(void);
void res_push_newfun(struct entity *(*newfun)(void), name_T name);
struct entity *(*res_get_newfun(name_T const name))(void);

void res_free_setfun(void);
void res_push_setfun(int (*setfun)(struct entity *const restrict self, char const *const restrict key, char const *const restrict value), name_T name);
int (*res_get_setfun(name_T const name))(struct entity *const restrict self, char const *const restrict key, char const *const restrict value);

int loadResources(char *filename);