]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/mapread.c
fack!! oh well~
[16.git] / src / lib / mapread.c
index f0e8ac0eb6c88bcc8340497920ae9ad11fd0b9e9..8f84071a6cf11411ae4b0a95ac2d96c54db34aee 100644 (file)
@@ -9,7 +9,7 @@ static int jsoneq(const char *json, jsmntok_t *tok, const char *s) {
 }
 
 //this function is quite messy ^^; sorry! it is a quick and dirty fix~
-static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *js_sv,*/ map_t *map, int q/*, int *w*/) {
+static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *js_sv,*/ map_t *map, int q) {
        int i, j, k;
        bitmap_t bp;
        if (count == 0) {
@@ -26,7 +26,7 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
 
                                FUCK well i am stuck.... wwww
                        */
-                       map->data[q] = (byte)strtol(js+t->start, &(char *)t->end, 10)%4;
+                       map->data[q] = (byte)strtol(js+t->start, (char **)t->end, 10);
 //                     printf("%d[%d]", q, map->data[q]);
                }
                else
@@ -50,9 +50,8 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
                        map->data = malloc(sizeof(byte) * (t+1)->size);
                        map->tiles = malloc(sizeof(tiles_t));
                        //map->tiles->data = malloc(sizeof(bitmap_t));
-                       printf("ed.pcx\n");
+                       //fix this
                        bp = bitmapLoadPcx("data/ed.pcx");
-                       printf("ed.pcx\n");
                        map->tiles->data = &bp;
                        //map->tiles->data->data = malloc((16/**2*/)*16);
                        //map->tiles->data->width = (16/**2*/);\r
@@ -77,9 +76,9 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
                j = 0;
                for (i = 0; i < t->size; i++) {
                        //for (k = 0; k < indent; k++) printf("\t");
-                       j += dump(js, t+1+j, count-j, indent+1, map, i/*, w*/);
+                       j += dump(js, t+1+j, count-j, indent+1, map, i);
                        //printf(": ");
-                       j += dump(js, t+1+j, count-j, indent+1, map, i/*, w*/);
+                       j += dump(js, t+1+j, count-j, indent+1, map, i);
                        //printf("\n");
                }
                return j+1;
@@ -89,7 +88,7 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
                for (i = 0; i < t->size; i++) {
                        //for (k = 0; k < indent-1; k++) printf("\t");
                        //printf("\t-");
-                       j += dump(js, t+1+j, count-j, indent+1, map, i/*, &t->size*/);
+                       j += dump(js, t+1+j, count-j, indent+1, map, i);
                        //printf("==\n");
                }
                return j+1;
@@ -97,7 +96,7 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
        return 0;
 }
 
-static int loadmap(char *mn, map_t *map/*, word w*/)
+static int loadmap(char *mn, map_t *map)
 {
        int r;
        int eof_expected = 0;