]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_map.c
xcroll.exe needs testing on real hardware\!\!\!\! it is working but not flexible...
[16.git] / src / lib / 16_map.c
old mode 100644 (file)
new mode 100755 (executable)
index e598d36..2d266df
@@ -216,7 +216,6 @@ int newloadmap(char *mn, map_t *map) {
 //======\r
 \r
 \r
-#define MAPBUFINLM *(gvar->ca.mapsegs)\r
 int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar)\r
 {\r
        jsmn_parser p;\r
@@ -230,20 +229,22 @@ 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, (memptr *)&MAPBUFINLM, gvar);\r
-       tokcount = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, NULL, 0);\r
+       CA_LoadFile(mn, MEMPTRCONV MAPSEGINLM, gvar);\r
+       tokcount = jsmn_parse(&p, (char const *)MAPSEGINLM, 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, (char const *)MAPBUFINLM, file_s, tok, tokcount)) < 0)\r
+       if((status = jsmn_parse(&p, (char const *)MAPSEGINLM, 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((char const *)MAPBUFINLM, tok, tokcount, map);\r
+       extract_map((char const *)MAPSEGINLM, tok, tokcount, map);\r
 \r
+//     printf("freeing tok\n");\r
        free(tok);      //TODO: USE MM_ CA_ AND PM_\r
+//     printf("fclose fh\n");\r
        fclose(fh);     //TODO: USE MM_ CA_ AND PM_\r
 \r
        return 0;\r