]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_map.c
xcroll fuckings please ignore and go to e9a094cdce9001737f17d3961f49f27272dff4e4
[16.git] / src / lib / 16_map.c
old mode 100755 (executable)
new mode 100644 (file)
index 946c809..e598d36
  *\r
  */\r
 \r
+//TODO USE CA AND THIS FILE FORMAT\r
+\r
 #include "src/lib/16_map.h"\r
+#include <malloc.h>\r
 \r
 // Ideally, preprocess json during compilation and read serialized data\r
 \r
@@ -202,9 +205,9 @@ int newloadmap(char *mn, map_t *map) {
        else if(status != tokcount) { printf("Warning: used %d tok\n", status);}\r
        extract_map(js, tok, tokcount, map);\r
 \r
-       free(js);\r
-       free(tok);\r
-       fclose(fh);\r
+       free(js);       //TODO: USE MM_ CA_ AND PM_\r
+       free(tok);      //TODO: USE MM_ CA_ AND PM_\r
+       fclose(fh);     //TODO: USE MM_ CA_ AND PM_\r
 \r
        return 0;\r
 }\r
@@ -227,21 +230,21 @@ int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar)
        jsmn_init(&p);\r
 \r
        file_s = filesize(fh);\r
-       CA_LoadFile(mn, &MAPBUFINLM, gvar);\r
-       tokcount = jsmn_parse(&p, MAPBUFINLM, file_s, NULL, 0);\r
-       tok = malloc(tokcount*sizeof(jsmntok_t));\r
+       CA_LoadFile(mn, (memptr *)&MAPBUFINLM, gvar);\r
+       tokcount = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, NULL, 0);\r
+       tok = malloc(tokcount*sizeof(jsmntok_t));//TODO: USE MM_ CA_ AND PM_\r
 //     printf("Allocated %d tokens", tokcount);\r
        jsmn_init(&p);\r
-       if((status = jsmn_parse(&p, MAPBUFINLM, file_s, tok, tokcount)) < 0)\r
+       if((status = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, tok, tokcount)) < 0)\r
        {\r
                printf("Error: %d\n", status);\r
                return status;\r
        }\r
        else if(status != tokcount) { printf("Warning: used %d tok\n", status);}\r
-       extract_map(MAPBUFINLM, tok, tokcount, map);\r
+       extract_map((char const *)MAPBUFINLM, tok, tokcount, map);\r
 \r
-       free(tok);\r
-       fclose(fh);\r
+       free(tok);      //TODO: USE MM_ CA_ AND PM_\r
+       fclose(fh);     //TODO: USE MM_ CA_ AND PM_\r
 \r
        return 0;\r
 }\r