X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=libplomrogue.c;h=c340e38502d66df9f1fe2d35c3e3bc7d3a9866f9;hb=4baa56d0423a8d59f794e10f7e5f65747613265a;hp=d0b15a10bc5d260f4fcf1fc75af6551863e01157;hpb=a50806df8116a81729220bd79870639b18da9d8c;p=plomrogue
diff --git a/libplomrogue.c b/libplomrogue.c
index d0b15a1..c340e38 100644
--- a/libplomrogue.c
+++ b/libplomrogue.c
@@ -600,7 +600,8 @@ extern void age_some_memdepthmap_on_nonfov_cells(char * memdepthmap,
}
}
-extern uint8_t set_cells_passable_on_memmap_to_65534_on_scoremap(char * mem_map)
+extern uint8_t set_cells_passable_on_memmap_to_65534_on_scoremap(char * mem_map,
+ const char * symbols_passable)
{
if (!score_map)
{
@@ -610,10 +611,46 @@ extern uint8_t set_cells_passable_on_memmap_to_65534_on_scoremap(char * mem_map)
uint16_t pos;
for (pos = 0; pos < map_size; pos++)
{
- if ('.' == mem_map[pos])
+ if (NULL != strchr(symbols_passable, mem_map[pos]))
{
score_map[pos] = 65534;
}
}
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);
+}
+*/