summary refs log tree commit diff
path: root/src/loader.h
blob: b16fd28b75b1b09322c1940588631554412bb274 (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
36
37
#pragma once

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

typedef char * name_T;

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

struct funs {
	void *(*newfun)(struct entities *entities);
	int (*setfun)(void *const restrict self, char const *const restrict key, char const *const restrict value);
};

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_fun(void);
void res_push_fun(void *(*newfun)(struct entities *entities), int (*setfun)(void *const restrict self, char const *const restrict key, char const *const restrict value), name_T name);
struct funs res_get_fun(name_T const name);

int loadResources(char *filename);