rogueviz:: removed vizid

This commit is contained in:
Zeno Rogue 2021-03-31 01:10:45 +02:00
parent f9edc44a8a
commit 9ed06c7fee
9 changed files with 10 additions and 30 deletions

View File

@ -11,14 +11,12 @@ namespace collatz {
edgetype *collatz1, *collatz2;
int collatz_id;
void act(vertexdata& vd, cell *c, shmup::monster *m, int i);
void lookup(long long reached, int bits);
void collatz_video(const string &fname);
void start() {
init(&collatz_id, RV_GRAPH);
init(RV_GRAPH);
collatz1 = add_edgetype("1");
collatz2 = add_edgetype("2");
vdata.resize(1);

View File

@ -48,8 +48,6 @@ namespace flocking {
void init();
int flock_id;
int N;
bool draw_lines = false;
@ -464,7 +462,7 @@ namespace flocking {
return;
}
stop_game();
rogueviz::init(&flock_id, RV_GRAPH);
rogueviz::init(RV_GRAPH);
rv_hook(shmup::hooks_turn, 100, turn);
rv_hook(hooks_frame, 100, flock_marker);
rv_hook(hooks_o_key, 80, o_key);

View File

@ -9,8 +9,6 @@ namespace rogueviz {
namespace fullnet {
int fullnet_id;
void drawExtra() {
for(map<cell*, shiftmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
cell *c = it->first;
@ -40,7 +38,7 @@ auto hooks =
using namespace arg;
if(argis("-net")) {
PHASE(3);
init(&fullnet_id, 0);
init(0);
rv_hook(hooks_frame, 0, drawExtra);
linepatterns::patTriTree.color = 0x30;
linepatterns::patTriOther.color = 0x10;

View File

@ -16,8 +16,6 @@ void clear();
void create_neurons();
int kohonen_id;
int columns;
typedef vector<double> kohvec;
@ -1770,7 +1768,7 @@ bool mark(cell *c) {
void initialize_rv() {
if(state & KS_ROGUEVIZ) return;
init(&kohonen_id, RV_GRAPH | RV_HAVE_WEIGHT);
init(RV_GRAPH | RV_HAVE_WEIGHT);
state |= KS_ROGUEVIZ;
rv_hook(hooks_frame, 50, levelline::draw);

View File

@ -263,8 +263,6 @@ namespace anygraph {
edgetype *any;
int vzid;
int N;
void fixedges() {
@ -280,7 +278,7 @@ namespace anygraph {
void tst() {}
void read(string fn, bool subdiv, bool doRebase, bool doStore) {
init(&vzid, RV_GRAPH);
init(RV_GRAPH);
any = add_edgetype("embedded edges");
fname = fn;
fhstream f(fn + "-coordinates.txt", "rt");
@ -888,7 +886,7 @@ void readcolor(const string& cfname) {
void graph_rv_hooks();
void init(void *_vizid, flagtype _vizflags) {
void init(flagtype _vizflags) {
autocheat = true;
showstartmenu = false;
@ -911,7 +909,6 @@ void init(void *_vizid, flagtype _vizflags) {
drawthemap();
gmatrix0 = gmatrix;
vizid = _vizid;
vizflags = _vizflags;
graph_rv_hooks();
@ -937,7 +934,6 @@ void close() {
cleanup.back()();
cleanup.pop_back();
}
vizid = nullptr;
relmatrices.clear();
}

View File

@ -17,8 +17,6 @@
namespace rogueviz {
using namespace hr;
inline void *vizid;
constexpr flagtype RV_GRAPH = 1;
constexpr flagtype RV_WHICHWEIGHT = 2; // sag
constexpr flagtype RV_AUTO_MAXWEIGHT = 4; // sag
@ -34,7 +32,7 @@ namespace rogueviz {
void drawExtra();
void close();
void init(void *vizid, flagtype flags);
void init(flagtype flags);
struct edgetype {
double visible_from;

View File

@ -13,8 +13,6 @@ namespace sag {
bool turn(int delta);
int sag_id;
int sagpar = 0;
enum eSagmode { sagOff, sagHC, sagSA };
@ -422,7 +420,7 @@ namespace sag {
void read(string fn) {
fname = fn;
init(&sag_id, RV_GRAPH | RV_WHICHWEIGHT | RV_AUTO_MAXWEIGHT | RV_HAVE_WEIGHT);
init(RV_GRAPH | RV_WHICHWEIGHT | RV_AUTO_MAXWEIGHT | RV_HAVE_WEIGHT);
rv_hook(rogueviz::hooks_close, 100, [] { sag::sagedges.clear(); });
rv_hook(shmup::hooks_turn, 100, turn);

View File

@ -10,8 +10,6 @@ namespace rogueviz {
namespace spiral {
int spiral_id;
ld mul;
transmatrix at(double d) {
@ -20,7 +18,7 @@ namespace spiral {
void place(int N, ld _mul) {
mul = _mul;
init(&spiral_id, RV_GRAPH | RV_HAVE_WEIGHT | RV_INVERSE_WEIGHT);
init(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";

View File

@ -8,8 +8,6 @@ namespace rogueviz {
namespace tree {
int tree_id;
edgetype *tree_edge;
struct treevertex {
@ -63,7 +61,7 @@ namespace tree {
void read(string fn) {
fname = fn;
init(&tree_id, RV_GRAPH | RV_COMPRESS_LABELS | RV_COLOR_TREE);
init(RV_GRAPH | RV_COMPRESS_LABELS | RV_COLOR_TREE);
tree_edge = add_edgetype("tree edge");
printf("Reading the tree of life...\n");
FILE *f = fopen(fname.c_str(), "rt");