From 2e25faae6f6199f00a6e35b2ba092cd6c87d2770 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 8 Feb 2017 13:28:03 -0600 Subject: [PATCH] WWWWWWWWWWWWwwwwwwwwwwWWWWWWWwwwwWWwwWWwwWwwWww --- src/lib/16_map.c | 14 -------------- src/lib/16_map.h | 4 ++-- src/scroll.c | 2 +- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/lib/16_map.c b/src/lib/16_map.c index 91199e55..3d97e863 100755 --- a/src/lib/16_map.c +++ b/src/lib/16_map.c @@ -400,18 +400,6 @@ int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar) jsmn_init(&p); file_s = filesize(fh); - /*js = malloc(file_s); - if(js == NULL) { - fprintf(stderr, "malloc(): errno = %d", 2); - fclose(fh); - return 3; - } - if(fread(js, 1, file_s, fh) != file_s) { - fprintf(stderr, "Map read error"); - free(js); - fclose(fh); - return 1; - }*/ CA_LoadFile(mn, &MAPBUFINLM, gvar); tokcount = jsmn_parse(&p, MAPBUFINLM, file_s, NULL, 0); tok = malloc(tokcount*sizeof(jsmntok_t)); @@ -424,9 +412,7 @@ int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar) } else if(status != tokcount) { printf("Warning: used %d tok\n", status);} extract_map(MAPBUFINLM, tok, tokcount, map); - //CA_mapdump(MAPBUFINLM, tok, p.toknext, map, 0, gvar); - //free(js); free(tok); fclose(fh); diff --git a/src/lib/16_map.h b/src/lib/16_map.h index 26901678..e8290486 100755 --- a/src/lib/16_map.h +++ b/src/lib/16_map.h @@ -42,8 +42,8 @@ int jsoneq(const char *json, jsmntok_t *tok, const char *s); //word dump(const char *js, jsmntok_t *t, size_t count, word indent, char *js_sv, map_t *map, dword q); -int loadmap(char *mn, map_t *map, global_game_variables_t *gvar); -int newloadmap(char *mn, map_t *map); +//int loadmap(char *mn, map_t *map, global_game_variables_t *gvar); +//int newloadmap(char *mn, map_t *map); int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar); #endif/*_16_LIB__H_*/ diff --git a/src/scroll.c b/src/scroll.c index 56660597..7c3dd4fe 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -55,7 +55,7 @@ void main(int argc, char *argv[]) /* create the map */ // fprintf(stderr, "testing map load~ "); - loadmap("data/test.map", &map, &gvar); + CA_loadmap("data/test.map", &map, &gvar); chkmap(&map, 0); // printf("chkmap ok "); // fprintf(stderr, "yay map loaded~~\n"); -- 2.39.5