starting tile-maze
[dosdemo] / src / tilemaze.c
1 #include <stdlib.h>
2 #include "tilemaze.h"
3 #include "mesh.h"
4
5 struct object {
6         char *name;
7         struct g3d_mesh mesh;
8
9         void *texels;
10         int tex_width, tex_height;
11
12         struct object *next;
13 };
14
15 struct tile {
16         struct object *objlist;
17 };
18
19 struct tilemaze {
20         struct tile *tileset;
21         int num_tiles;
22
23         struct object *objects;
24 };
25
26
27 struct tilemaze *load_tilemaze(const char *fname)
28 {
29         struct tilemaze *tmz;
30
31         if(!(tmz = calloc(sizeof *tmz, 1))) {
32                 return 0;
33         }
34         /* TODO */
35         return tmz;
36 }
37
38 void destroy_tilemaze(struct tilemaze *tmz)
39 {
40         if(!tmz) return;
41
42         free(tmz->tileset);
43
44         while(tmz->objects) {
45                 struct object *o = tmz->objects;
46                 tmz->objects = tmz->objects->next;
47
48                 free(o->mesh.varr);
49                 free(o->mesh.iarr);
50                 free(o);
51         }
52
53         free(tmz);
54 }
55
56 void update_tilemaze(struct tilemaze *tmz)
57 {
58 }
59
60 void draw_tilemaze(struct tilemaze *tmz)
61 {
62 }