From e9bb38d3b114da665fa7ffafbc855e937a89512b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 23 Jul 2022 15:45:42 +0200 Subject: [PATCH] rogueviz::dhrg:: export some functions --- rogueviz/dhrg/dhrg.cpp | 16 ++++++++++------ rogueviz/dhrg/readgraph.cpp | 10 ++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/rogueviz/dhrg/dhrg.cpp b/rogueviz/dhrg/dhrg.cpp index 8683cede..b482b479 100644 --- a/rogueviz/dhrg/dhrg.cpp +++ b/rogueviz/dhrg/dhrg.cpp @@ -123,6 +123,14 @@ int ts_coords; int ts_vertices; bool stored; +void graphv(string s) { + dhrg_init(); read_graph(s, true, true, true); + next_timestamp++; + ts_rogueviz = next_timestamp; + ts_rbase = next_timestamp; + stored = true; + } + int dhrgArgs() { using namespace arg; @@ -141,11 +149,7 @@ int dhrgArgs() { } else if(argis("-graphv")) { - PHASE(3); shift(); dhrg_init(); read_graph(args(), true, true, true); - next_timestamp++; - ts_rogueviz = next_timestamp; - ts_rbase = next_timestamp; - stored = true; + PHASE(3); shift(); graphv(args()); } else if(argis("-analyze_grid")) { @@ -286,4 +290,4 @@ auto hook = #include "visualize.cpp" #endif -} +} diff --git a/rogueviz/dhrg/readgraph.cpp b/rogueviz/dhrg/readgraph.cpp index 746d02ee..8263e218 100644 --- a/rogueviz/dhrg/readgraph.cpp +++ b/rogueviz/dhrg/readgraph.cpp @@ -79,4 +79,14 @@ namespace dhrg { if(doStore) rogueviz::storeall(); } + void unsnap() { + for(int i=0; ibase = currentmap->gamestart(); + vdata[i].m->at = h; + virtualRebase(vdata[i].m); + } + fixedges(); + } }