X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=libplomrogue.c;h=c340e38502d66df9f1fe2d35c3e3bc7d3a9866f9;hb=2f7c446f698dbcf510a4997e1689e3a2df3e24be;hp=d0b656b657f23c225cd0fafe140dcfe92660ca6c;hpb=2d78939fd39c64a41742a73558708628e38e282d;p=plomrogue diff --git a/libplomrogue.c b/libplomrogue.c index d0b656b..c340e38 100644 --- a/libplomrogue.c +++ b/libplomrogue.c @@ -618,3 +618,39 @@ extern uint8_t set_cells_passable_on_memmap_to_65534_on_scoremap(char * mem_map, } return 0; } + + +extern void update_mem_and_memdepthmap_via_fovmap(char * map, char * fovmap, + char * memdepthmap, + char * memmap) +{ + uint32_t map_size = maplength * maplength; + uint16_t pos; + for (pos = 0; pos < map_size; pos++) + { + if ('v' == fovmap[pos]) + { + memdepthmap[pos] = '0'; + memmap[pos] = map[pos]; + } + } +} + +/* USEFUL FOR DEBUGGING +extern void write_score_map() +{ + FILE *f = fopen("score_map", "a"); + + fprintf(f, "\n---------------------------------------------------------\n"); + uint32_t y, x; + for (y = 0; y < maplength; y++) + { + for (x = 0; x < maplength; x++) + { + fprintf(f, "%2X", score_map[y * maplength + x] % 256); + } + fprintf(f, "\n"); + } + fclose(f); +} +*/