mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-01 15:04:06 +00:00
rogueviz:: removed vizid
This commit is contained in:
parent
f9edc44a8a
commit
9ed06c7fee
@ -11,14 +11,12 @@ namespace collatz {
|
|||||||
|
|
||||||
edgetype *collatz1, *collatz2;
|
edgetype *collatz1, *collatz2;
|
||||||
|
|
||||||
int collatz_id;
|
|
||||||
|
|
||||||
void act(vertexdata& vd, cell *c, shmup::monster *m, int i);
|
void act(vertexdata& vd, cell *c, shmup::monster *m, int i);
|
||||||
void lookup(long long reached, int bits);
|
void lookup(long long reached, int bits);
|
||||||
void collatz_video(const string &fname);
|
void collatz_video(const string &fname);
|
||||||
|
|
||||||
void start() {
|
void start() {
|
||||||
init(&collatz_id, RV_GRAPH);
|
init(RV_GRAPH);
|
||||||
collatz1 = add_edgetype("1");
|
collatz1 = add_edgetype("1");
|
||||||
collatz2 = add_edgetype("2");
|
collatz2 = add_edgetype("2");
|
||||||
vdata.resize(1);
|
vdata.resize(1);
|
||||||
|
@ -48,8 +48,6 @@ namespace flocking {
|
|||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
int flock_id;
|
|
||||||
|
|
||||||
int N;
|
int N;
|
||||||
|
|
||||||
bool draw_lines = false;
|
bool draw_lines = false;
|
||||||
@ -464,7 +462,7 @@ namespace flocking {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stop_game();
|
stop_game();
|
||||||
rogueviz::init(&flock_id, RV_GRAPH);
|
rogueviz::init(RV_GRAPH);
|
||||||
rv_hook(shmup::hooks_turn, 100, turn);
|
rv_hook(shmup::hooks_turn, 100, turn);
|
||||||
rv_hook(hooks_frame, 100, flock_marker);
|
rv_hook(hooks_frame, 100, flock_marker);
|
||||||
rv_hook(hooks_o_key, 80, o_key);
|
rv_hook(hooks_o_key, 80, o_key);
|
||||||
|
@ -9,8 +9,6 @@ namespace rogueviz {
|
|||||||
|
|
||||||
namespace fullnet {
|
namespace fullnet {
|
||||||
|
|
||||||
int fullnet_id;
|
|
||||||
|
|
||||||
void drawExtra() {
|
void drawExtra() {
|
||||||
for(map<cell*, shiftmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
for(map<cell*, shiftmatrix>::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) {
|
||||||
cell *c = it->first;
|
cell *c = it->first;
|
||||||
@ -40,7 +38,7 @@ auto hooks =
|
|||||||
using namespace arg;
|
using namespace arg;
|
||||||
if(argis("-net")) {
|
if(argis("-net")) {
|
||||||
PHASE(3);
|
PHASE(3);
|
||||||
init(&fullnet_id, 0);
|
init(0);
|
||||||
rv_hook(hooks_frame, 0, drawExtra);
|
rv_hook(hooks_frame, 0, drawExtra);
|
||||||
linepatterns::patTriTree.color = 0x30;
|
linepatterns::patTriTree.color = 0x30;
|
||||||
linepatterns::patTriOther.color = 0x10;
|
linepatterns::patTriOther.color = 0x10;
|
||||||
|
@ -16,8 +16,6 @@ void clear();
|
|||||||
void create_neurons();
|
void create_neurons();
|
||||||
|
|
||||||
|
|
||||||
int kohonen_id;
|
|
||||||
|
|
||||||
int columns;
|
int columns;
|
||||||
|
|
||||||
typedef vector<double> kohvec;
|
typedef vector<double> kohvec;
|
||||||
@ -1770,7 +1768,7 @@ bool mark(cell *c) {
|
|||||||
|
|
||||||
void initialize_rv() {
|
void initialize_rv() {
|
||||||
if(state & KS_ROGUEVIZ) return;
|
if(state & KS_ROGUEVIZ) return;
|
||||||
init(&kohonen_id, RV_GRAPH | RV_HAVE_WEIGHT);
|
init(RV_GRAPH | RV_HAVE_WEIGHT);
|
||||||
state |= KS_ROGUEVIZ;
|
state |= KS_ROGUEVIZ;
|
||||||
|
|
||||||
rv_hook(hooks_frame, 50, levelline::draw);
|
rv_hook(hooks_frame, 50, levelline::draw);
|
||||||
|
@ -263,8 +263,6 @@ namespace anygraph {
|
|||||||
|
|
||||||
edgetype *any;
|
edgetype *any;
|
||||||
|
|
||||||
int vzid;
|
|
||||||
|
|
||||||
int N;
|
int N;
|
||||||
|
|
||||||
void fixedges() {
|
void fixedges() {
|
||||||
@ -280,7 +278,7 @@ namespace anygraph {
|
|||||||
void tst() {}
|
void tst() {}
|
||||||
|
|
||||||
void read(string fn, bool subdiv, bool doRebase, bool doStore) {
|
void read(string fn, bool subdiv, bool doRebase, bool doStore) {
|
||||||
init(&vzid, RV_GRAPH);
|
init(RV_GRAPH);
|
||||||
any = add_edgetype("embedded edges");
|
any = add_edgetype("embedded edges");
|
||||||
fname = fn;
|
fname = fn;
|
||||||
fhstream f(fn + "-coordinates.txt", "rt");
|
fhstream f(fn + "-coordinates.txt", "rt");
|
||||||
@ -888,7 +886,7 @@ void readcolor(const string& cfname) {
|
|||||||
|
|
||||||
void graph_rv_hooks();
|
void graph_rv_hooks();
|
||||||
|
|
||||||
void init(void *_vizid, flagtype _vizflags) {
|
void init(flagtype _vizflags) {
|
||||||
|
|
||||||
autocheat = true;
|
autocheat = true;
|
||||||
showstartmenu = false;
|
showstartmenu = false;
|
||||||
@ -911,7 +909,6 @@ void init(void *_vizid, flagtype _vizflags) {
|
|||||||
drawthemap();
|
drawthemap();
|
||||||
gmatrix0 = gmatrix;
|
gmatrix0 = gmatrix;
|
||||||
|
|
||||||
vizid = _vizid;
|
|
||||||
vizflags = _vizflags;
|
vizflags = _vizflags;
|
||||||
|
|
||||||
graph_rv_hooks();
|
graph_rv_hooks();
|
||||||
@ -937,7 +934,6 @@ void close() {
|
|||||||
cleanup.back()();
|
cleanup.back()();
|
||||||
cleanup.pop_back();
|
cleanup.pop_back();
|
||||||
}
|
}
|
||||||
vizid = nullptr;
|
|
||||||
relmatrices.clear();
|
relmatrices.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
namespace rogueviz {
|
namespace rogueviz {
|
||||||
using namespace hr;
|
using namespace hr;
|
||||||
|
|
||||||
inline void *vizid;
|
|
||||||
|
|
||||||
constexpr flagtype RV_GRAPH = 1;
|
constexpr flagtype RV_GRAPH = 1;
|
||||||
constexpr flagtype RV_WHICHWEIGHT = 2; // sag
|
constexpr flagtype RV_WHICHWEIGHT = 2; // sag
|
||||||
constexpr flagtype RV_AUTO_MAXWEIGHT = 4; // sag
|
constexpr flagtype RV_AUTO_MAXWEIGHT = 4; // sag
|
||||||
@ -34,7 +32,7 @@ namespace rogueviz {
|
|||||||
void drawExtra();
|
void drawExtra();
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
void init(void *vizid, flagtype flags);
|
void init(flagtype flags);
|
||||||
|
|
||||||
struct edgetype {
|
struct edgetype {
|
||||||
double visible_from;
|
double visible_from;
|
||||||
|
@ -13,8 +13,6 @@ namespace sag {
|
|||||||
|
|
||||||
bool turn(int delta);
|
bool turn(int delta);
|
||||||
|
|
||||||
int sag_id;
|
|
||||||
|
|
||||||
int sagpar = 0;
|
int sagpar = 0;
|
||||||
|
|
||||||
enum eSagmode { sagOff, sagHC, sagSA };
|
enum eSagmode { sagOff, sagHC, sagSA };
|
||||||
@ -422,7 +420,7 @@ namespace sag {
|
|||||||
|
|
||||||
void read(string fn) {
|
void read(string fn) {
|
||||||
fname = 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(rogueviz::hooks_close, 100, [] { sag::sagedges.clear(); });
|
||||||
rv_hook(shmup::hooks_turn, 100, turn);
|
rv_hook(shmup::hooks_turn, 100, turn);
|
||||||
|
@ -10,8 +10,6 @@ namespace rogueviz {
|
|||||||
|
|
||||||
namespace spiral {
|
namespace spiral {
|
||||||
|
|
||||||
int spiral_id;
|
|
||||||
|
|
||||||
ld mul;
|
ld mul;
|
||||||
|
|
||||||
transmatrix at(double d) {
|
transmatrix at(double d) {
|
||||||
@ -20,7 +18,7 @@ namespace spiral {
|
|||||||
|
|
||||||
void place(int N, ld _mul) {
|
void place(int N, ld _mul) {
|
||||||
mul = _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_alt_edges, 100, spiral_altedge);
|
||||||
rv_hook(hooks_frame, 0, drawExtra);
|
rv_hook(hooks_frame, 0, drawExtra);
|
||||||
weight_label = "extent";
|
weight_label = "extent";
|
||||||
|
@ -8,8 +8,6 @@ namespace rogueviz {
|
|||||||
|
|
||||||
namespace tree {
|
namespace tree {
|
||||||
|
|
||||||
int tree_id;
|
|
||||||
|
|
||||||
edgetype *tree_edge;
|
edgetype *tree_edge;
|
||||||
|
|
||||||
struct treevertex {
|
struct treevertex {
|
||||||
@ -63,7 +61,7 @@ namespace tree {
|
|||||||
|
|
||||||
void read(string fn) {
|
void read(string fn) {
|
||||||
fname = 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");
|
tree_edge = add_edgetype("tree edge");
|
||||||
printf("Reading the tree of life...\n");
|
printf("Reading the tree of life...\n");
|
||||||
FILE *f = fopen(fname.c_str(), "rt");
|
FILE *f = fopen(fname.c_str(), "rt");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user