1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-10 22:36:02 +00:00

rogueviz:: used rv_hook in some viz

This commit is contained in:
Zeno Rogue
2021-03-31 00:23:01 +02:00
parent 19a1358607
commit 73c5b5e881
5 changed files with 123 additions and 112 deletions

View File

@@ -21,6 +21,8 @@ namespace spiral {
void place(int N, ld _mul) {
mul = _mul;
init(&spiral_id, RV_GRAPH | RV_HAVE_WEIGHT | RV_INVERSE_WEIGHT);
rv_hook(hooks_alt_edges, 100, spiral_altedge);
rv_hook(hooks_frame, 0, drawExtra);
weight_label = "extent";
vdata.resize(N);
@@ -65,7 +67,7 @@ namespace spiral {
}
bool spiral_altedge(edgeinfo* ei, bool store) {
bool onspiral = (vizid == &spiral::spiral_id) && abs(ei->i - ei->j) == 1;
bool onspiral = abs(ei->i - ei->j) == 1;
if(onspiral) {
const int prec = 20;
@@ -88,8 +90,6 @@ bool spiral_altedge(edgeinfo* ei, bool store) {
}
auto hooks =
addHook(hooks_frame, 0, drawExtra) +
addHook(hooks_alt_edges, 100, spiral_altedge) +
addHook(hooks_args, 100, [] {
using namespace arg;