X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Ftilemaze.c;fp=src%2Ftilemaze.c;h=1d413d940b4149c4ed60aa43750091497a698754;hp=0000000000000000000000000000000000000000;hb=94b31f853e22eea059754d66ad27536e6308231f;hpb=3b52c25b520e0e1b9143cafaee2670e57c89ef0d diff --git a/src/tilemaze.c b/src/tilemaze.c new file mode 100644 index 0000000..1d413d9 --- /dev/null +++ b/src/tilemaze.c @@ -0,0 +1,62 @@ +#include +#include "tilemaze.h" +#include "mesh.h" + +struct object { + char *name; + struct g3d_mesh mesh; + + void *texels; + int tex_width, tex_height; + + struct object *next; +}; + +struct tile { + struct object *objlist; +}; + +struct tilemaze { + struct tile *tileset; + int num_tiles; + + struct object *objects; +}; + + +struct tilemaze *load_tilemaze(const char *fname) +{ + struct tilemaze *tmz; + + if(!(tmz = calloc(sizeof *tmz, 1))) { + return 0; + } + /* TODO */ + return tmz; +} + +void destroy_tilemaze(struct tilemaze *tmz) +{ + if(!tmz) return; + + free(tmz->tileset); + + while(tmz->objects) { + struct object *o = tmz->objects; + tmz->objects = tmz->objects->next; + + free(o->mesh.varr); + free(o->mesh.iarr); + free(o); + } + + free(tmz); +} + +void update_tilemaze(struct tilemaze *tmz) +{ +} + +void draw_tilemaze(struct tilemaze *tmz) +{ +}