From 4d3a9081a9e118ea4b98a5d5d8b3be2a3d047452 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 8 Jun 2022 18:03:32 +0200 Subject: [PATCH] dynamic-wfc: animation --- rogueviz/dynamic-wfc.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/rogueviz/dynamic-wfc.cpp b/rogueviz/dynamic-wfc.cpp index a29966ff..9bb6d573 100644 --- a/rogueviz/dynamic-wfc.cpp +++ b/rogueviz/dynamic-wfc.cpp @@ -18,6 +18,8 @@ namespace hr { namespace dynamic_wfc { +bool animated = false; + vector generate_pd_list(celllister& cl) { cell *croot = cl.lst.back(); @@ -117,6 +119,12 @@ vector global_list; int wfctype, wfcrad, cutoff; +void wfc_clear() { + trans.clear(); + ctf.clear(); + global_list.clear(); + } + void wfc_build() { int code_at = trans.back().news; int cpos = isize(ctf); @@ -279,10 +287,24 @@ void wfc() { */ long long tfreq = 0; + + if(animated) + for(int j=0; jlandparam = 0x202020; for(int i=0; ilandparam = multiplicity[c] ? 0xFFFF00 : 0x00FF00; + for(auto& nns: new_neighborhoods[i]) for(auto c: nns) c->landparam = 0xFFFFFF; + + history::progress(s); + } + inpath.push_back(l[i]); int sh = cpo * (isize(inpath)-1); @@ -378,6 +400,7 @@ void wfc() { println(hlog, "tfreq = ", format("%lld", tfreq)); println(hlog, "trans size = ", isize(trans)); println(hlog, "next code = ", nextcode); + clearMessages(); wfc_build(); }