X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_map.c;h=2d266df1d667f1b13bcf1dca438544f9849255fc;hb=63a6c9058ef704a718e623a317a7626b509cdfd1;hp=c20ab03b0341943064dbbe87dd80bec05fd32f08;hpb=e08355e15caf3345f9dc41411b3d0733175a93bb;p=16.git diff --git a/src/lib/16_map.c b/src/lib/16_map.c index c20ab03b..2d266df1 100755 --- a/src/lib/16_map.c +++ b/src/lib/16_map.c @@ -20,6 +20,8 @@ * */ +//TODO USE CA AND THIS FILE FORMAT + #include "src/lib/16_map.h" #include @@ -214,7 +216,6 @@ int newloadmap(char *mn, map_t *map) { //====== -#define MAPBUFINLM *(gvar->ca.mapsegs) int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar) { jsmn_parser p; @@ -228,20 +229,22 @@ int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar) jsmn_init(&p); file_s = filesize(fh); - CA_LoadFile(mn, &MAPBUFINLM, gvar); - tokcount = jsmn_parse(&p, MAPBUFINLM, file_s, NULL, 0); + CA_LoadFile(mn, MEMPTRCONV MAPSEGINLM, gvar); + tokcount = jsmn_parse(&p, (char const *)MAPSEGINLM, file_s, NULL, 0); tok = malloc(tokcount*sizeof(jsmntok_t));//TODO: USE MM_ CA_ AND PM_ // printf("Allocated %d tokens", tokcount); jsmn_init(&p); - if((status = jsmn_parse(&p, MAPBUFINLM, file_s, tok, tokcount)) < 0) + if((status = jsmn_parse(&p, (char const *)MAPSEGINLM, file_s, tok, tokcount)) < 0) { printf("Error: %d\n", status); return status; } else if(status != tokcount) { printf("Warning: used %d tok\n", status);} - extract_map(MAPBUFINLM, tok, tokcount, map); + extract_map((char const *)MAPSEGINLM, tok, tokcount, map); +// printf("freeing tok\n"); free(tok); //TODO: USE MM_ CA_ AND PM_ +// printf("fclose fh\n"); fclose(fh); //TODO: USE MM_ CA_ AND PM_ return 0;