1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 06:27:17 +00:00

readded presentations, and other changes

This commit is contained in:
Zeno Rogue 2024-07-23 23:26:05 +02:00
parent 199f8b2927
commit b048fdd6f1
3 changed files with 81 additions and 3 deletions

View File

@ -195,6 +195,8 @@ void compute_dists() {
visited.push_back(id);
};
if(N == 0) return;
visit(0, Id);
for(int i=0; i<isize(visited); i++) {
cell *c0 = sagcells[visited[i]].first;
@ -513,7 +515,7 @@ void init_cells() {
void init_snake_if_needed() {
if(!(state & SS_NEED_SNAKE)) return;
state &=~ SS_NEED_SNAKE;
init_snake(2 * isize(sagid));
init_snake(2 * isize(vdata));
compute_dists();
}

View File

@ -199,7 +199,6 @@ void after_data() {
/** load all the edges */
void read_weighted(const char *fname) {
println(hlog, "read_weighted called");
if(state & SS_DATA) return;
state |= SS_WEIGHTED;
init_cells();

View File

@ -351,7 +351,84 @@ void clear() {
state = 0;
}
int ah = addHook(hooks_args, 100, readArgs) + addHook(hooks_clearmemory, 100, clear);
string cname() {
if(euclid) return "coord-6.txt";
if(PURE) return "coord-7.txt";
return "coord-67.txt";
}
int ah = addHook(hooks_args, 100, readArgs) + addHook(hooks_clearmemory, 100, clear)
+ addHook_rvslides(120, [] (string s, vector<tour::slide>& v) {
if(s != "data") return;
using namespace pres;
string sagf = "SAG/";
v.push_back(
slide{sagf+"Roguelikes", 63, LEGAL::UNLIMITED | QUICKGEO,
"A visualization of roguelikes, based on discussion on /r/reddit. "
"See: http://www.roguetemple.com/z/hyper/reddit.php",
roguevizslide('0', [] () {
rogueviz::dftcolor = 0x282828FF;
rogueviz::showlabels = true;
part(rogueviz::default_edgetype.color, 0) = 181;
rogueviz::sag::edgepower = 1;
rogueviz::sag::edgemul = 1;
gmatrix.clear();
drawthemap();
gmatrix0 = gmatrix;
slide_backup(rogueviz::sag::legacy, true);
rogueviz::sag::read_weighted(RVPATH "sag/roguelikes/edges.csv");
rogueviz::readcolor(RVPATH "sag/roguelikes/color.csv");
rogueviz::sag::load_sag_solution(RVPATH "sag/roguelikes/" + cname());
})
}
);
v.push_back(slide {sagf+"Programming languages of GitHub", 64, LEGAL::UNLIMITED | QUICKGEO,
"A visualization of programming languages.",
roguevizslide('0', [] () {
rogueviz::dftcolor = 0x282828FF;
rogueviz::showlabels = true;
part(rogueviz::default_edgetype.color, 0) = 128;
rogueviz::sag::edgepower = .4;
rogueviz::sag::edgemul = .02;
gmatrix.clear();
drawthemap();
gmatrix0 = gmatrix;
slide_backup(rogueviz::sag::legacy, true);
rogueviz::sag::read_weighted(RVPATH "sag/lang/edges.csv");
rogueviz::readcolor(RVPATH "sag/lang/color.csv");
rogueviz::sag::load_sag_solution(RVPATH "sag/lang/" + cname());
if(euclid) rogueviz::legend.clear();
})
});
v.push_back(slide {sagf+"Boardgames", 62, LEGAL::UNLIMITED | QUICKGEO,
"A visualization of board games, based on discussions on Reddit.",
roguevizslide('0', [] () {
rogueviz::dftcolor = 0x282828FF;
rogueviz::showlabels = true;
part(rogueviz::default_edgetype.color, 0) = 157;
rogueviz::sag::edgepower = 1;
rogueviz::sag::edgemul = 1;
gmatrix.clear();
drawthemap();
gmatrix0 = gmatrix;
slide_backup(rogueviz::sag::legacy, true);
rogueviz::sag::read_weighted(RVPATH "sag/boardgames/edges.csv");
rogueviz::readcolor(RVPATH "sag/boardgames/color.csv");
rogueviz::sag::load_sag_solution(RVPATH "sag/boardgames/" + cname());
})
});
});
EX }