diff --git a/include/dungeon/dungeon.h b/include/dungeon/dungeon.h index 2b92c96..f8214fd 100644 --- a/include/dungeon/dungeon.h +++ b/include/dungeon/dungeon.h @@ -73,6 +73,7 @@ bool dungeon_load(struct dungeon_context *ctx, int num); void dungeon_set_camera(int surface, float x, float y, float z, float angle, float angle_p); void dungeon_set_walked(int surface, int x, int y, int z, int flag); int dungeon_get_walked(int surface, int x, int y, int z); +void dungeon_set_walked_all(int surface); int dungeon_calc_conquer(int surface); bool dungeon_load_walk_data(int surface, int map, struct page **page); bool dungeon_save_walk_data(int surface, int map, struct page **page); diff --git a/src/dungeon/dungeon.c b/src/dungeon/dungeon.c index 54e7888..7063b45 100644 --- a/src/dungeon/dungeon.c +++ b/src/dungeon/dungeon.c @@ -326,6 +326,18 @@ void dungeon_set_walked(int surface, int x, int y, int z, int flag) } } +void dungeon_set_walked_all(int surface) +{ + struct dungeon_context *ctx = dungeon_get_context(surface); + if (!ctx) + return; + int nr_cells = dgn_nr_cells(ctx->dgn); + for (struct dgn_cell *c = ctx->dgn->cells; c < ctx->dgn->cells + nr_cells; c++) { + c->walked = 1; + dungeon_map_reveal(ctx, c->x, c->y, c->z, false); + } +} + int dungeon_get_walked(int surface, int x, int y, int z) { struct dungeon_context *ctx = dungeon_get_context(surface); diff --git a/src/hll/DrawDungeon.c b/src/hll/DrawDungeon.c index 2c4a5e1..e48211f 100644 --- a/src/hll/DrawDungeon.c +++ b/src/hll/DrawDungeon.c @@ -255,7 +255,6 @@ CELL_SETTER(DrawDungeon_SetTexDoorE, int, cell->east_door, true); HLL_QUIET_UNIMPLEMENTED( , void, DrawDungeon, SetDrawHalfFlag, int surface, int flag); HLL_QUIET_UNIMPLEMENTED(0, int, DrawDungeon, GetDrawHalfFlag, int surface); -//void DrawDungeon_SetWalkedAll(int surface); //int DrawDungeon_CalcNumofFloor(int surface); //int DrawDungeon_CalcNumofWalk(int surface); //int DrawDungeon_CalcNumofWalk2(int surface); @@ -384,7 +383,7 @@ HLL_QUIET_UNIMPLEMENTED( , void, DrawDungeon, RestartTimer, void); HLL_EXPORT(SetDrawHalfFlag, DrawDungeon_SetDrawHalfFlag), \ HLL_EXPORT(GetDrawHalfFlag, DrawDungeon_GetDrawHalfFlag), \ HLL_EXPORT(SetWalked, dungeon_set_walked), \ - HLL_TODO_EXPORT(SetWalkedAll, DrawDungeon_SetWalkedAll), \ + HLL_EXPORT(SetWalkedAll, dungeon_set_walked_all), \ HLL_TODO_EXPORT(CalcNumofFloor, DrawDungeon_CalcNumofFloor), \ HLL_TODO_EXPORT(CalcNumofWalk, DrawDungeon_CalcNumofWalk), \ HLL_TODO_EXPORT(CalcNumofWalk2, DrawDungeon_CalcNumofWalk2), \