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

using addHook_rvslides and addHook_slideshows in various rogueviz demos

This commit is contained in:
Zeno Rogue 2021-06-25 13:53:23 +02:00
parent b3bb235ac9
commit 28d334c660
26 changed files with 33 additions and 28 deletions

View File

@ -558,7 +558,7 @@ int readArgs() {
auto hook = addHook(hooks_args, 100, readArgs)
+ addHook(hooks_initgame, 100, bantar)
+ addHook(hooks_frame, 100, bantar_stats)
+ addHook(pres::hooks_build_rvtour, 140, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(140, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace pres;
v.push_back(

View File

@ -324,7 +324,7 @@ int readArgs() {
}
int ah = addHook(hooks_args, 100, readArgs) +
addHook(pres::hooks_build_rvtour, 42, [] (string s, vector<tour::slide>& v) {
addHook_rvslides(42, [] (string s, vector<tour::slide>& v) {
if(s != "data") return;
using namespace tour;
v.push_back(

View File

@ -444,7 +444,7 @@ auto fifteen_hook =
param_b(show_dots, "fifteen_dots");
param_b(show_triangles, "fifteen_tris");
})
+ addHook(tour::ss::hooks_extra_slideshows, 120, [] (tour::ss::slideshow_callback cb) {
+ addHook_slideshows(120, [] (tour::ss::slideshow_callback cb) {
using namespace rogueviz::pres;
static vector<slide> fifteen_slides;

View File

@ -593,7 +593,7 @@ bool drawVertex(const shiftmatrix &V, cell *c, shmup::monster *m) {
}
auto hooks = addHook(hooks_args, 100, readArgs)
+ addHook(rogueviz::pres::hooks_build_rvtour, 187, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(187, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;
string cap = "flocking simulation/";

View File

@ -495,8 +495,7 @@ auto hook = addHook(hooks_args, 100, readArgsG)
}
})
+ addHook(hooks_initialize, 100, create_grigorchuk_geometry)
+ addHook(rogueviz::pres::hooks_build_rvtour, 140, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(140, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace rogueviz::pres;
v.push_back(tour::slide{

View File

@ -185,7 +185,7 @@ auto heathook = arg::add3("-heatx", enable)
param_i(simulation_range, "heat_range")
->editable(0, 100000, 1000, "heat simulation range", "number of cells to consider", 'r');
})
+ addHook(rogueviz::pres::hooks_build_rvtour, 180, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(180, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
heat_slide(v, "squares",
"A simple heat simulation. In each turn, the temperature changes towards the average of temperatures of adjacent cells.\n\n"

View File

@ -447,6 +447,7 @@ void house(int sides, int shape = 10) {
start_game();
}
#if CAP_RVSLIDES
tour::slide *gen_high_demo() {
high_slides.clear();
using namespace tour;
@ -643,9 +644,10 @@ tour::slide *gen_high_demo() {
pres::add_end(v);
return &high_slides[0];
}
#endif
auto highdim_hooks =
addHook(tour::ss::hooks_extra_slideshows, 120, [] (tour::ss::slideshow_callback cb) {
addHook_slideshows(120, [] (tour::ss::slideshow_callback cb) {
if(high_slides.empty()) gen_high_demo();

View File

@ -100,7 +100,7 @@ void enable() {
}
auto hypcity_ah = arg::add3("-hypcity", enable)
+ addHook(tour::ss::hooks_extra_slideshows, 120, [] (tour::ss::slideshow_callback cb) {
+ addHook_slideshows(120, [] (tour::ss::slideshow_callback cb) {
using namespace rogueviz::pres;
static vector<slide> hypcity_slides;

View File

@ -418,7 +418,7 @@ auto msc = arg::add3("-analogs", enable)
param_b(textured, "analogs_texture")
->editable("draw Earth", 'T');
})
+ addHook(rogueviz::pres::hooks_build_rvtour, 131, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(131, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;

View File

@ -274,7 +274,7 @@ auto hchook =
param_f(cylball, "cylball");
})
+ addHook(pres::hooks_build_rvtour, 167, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(167, [] (string s, vector<tour::slide>& v) {
if(s != "noniso") return;
using namespace tour;
v.push_back(

View File

@ -274,7 +274,7 @@ auto hook = arg::add3("-inner-map", enable)
'i')
->set_reaction(need_redo);
})
+ addHook(rogueviz::pres::hooks_build_rvtour, 52, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(52, [] (string s, vector<tour::slide>& v) {
if(s != "projections") return;
using namespace tour;

View File

@ -147,6 +147,7 @@ void honey(string s, vector<tour::slide>& v) {
}
#if CAP_RVSLIDES
vector<tour::slide> noniso_slides;
tour::slide *gen_noniso_demo() {
noniso_slides.clear();
@ -168,9 +169,10 @@ tour::slide *gen_noniso_demo() {
pres::add_end(noniso_slides);
return &noniso_slides[0];
}
#endif
auto hooks = addHook(pres::hooks_build_rvtour, 163, honey)
+ addHook(tour::ss::hooks_extra_slideshows, 120, [] (tour::ss::slideshow_callback cb) {
auto hooks = addHook_rvslides(163, honey)
+ addHook_slideshows(120, [] (tour::ss::slideshow_callback cb) {
if(noniso_slides.empty())
gen_noniso_demo();

View File

@ -1482,7 +1482,7 @@ auto shot_hooks = addHook(hooks_initialize, 100, create_notknot)
param_i(loop_any, "nk_loopany");
})
#ifndef NOTKNOT
+ addHook(rogueviz::pres::hooks_build_rvtour, 180, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(180, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
v.push_back(tour::slide{
"weird portals", 10, tour::LEGAL::NONE | tour::QUICKSKIP,

View File

@ -319,7 +319,7 @@ void enable_hooks() {
auto xhook =
arg::add3("-snub", [] { run_snub(arg::shift_argi(), 3); })
+ arg::add3("-snub4", [] { run_snub(arg::shift_argi(), 4); })
+ addHook(pres::hooks_build_rvtour, 143, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(143, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;
v.push_back(

View File

@ -511,7 +511,7 @@ auto msc =
param_f(prec, "moon_precision")
->editable(0, 30, .5, "precision", "larger values are less precise", 'p');
})
+ addHook(rogueviz::pres::hooks_build_rvtour, 51, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(51, [] (string s, vector<tour::slide>& v) {
if(s != "projections") return;
using namespace tour;

View File

@ -1131,7 +1131,7 @@ slide dmv_slides[] = {
int phooks =
0 +
addHook(tour::ss::hooks_extra_slideshows, 100, [] (tour::ss::slideshow_callback cb) {
addHook_slides(tour::ss::hooks_extra_slideshows, 100, [] (tour::ss::slideshow_callback cb) {
cb(XLAT("Playing with Impossibility"), &dmv_slides[0], 'p');
});

View File

@ -387,7 +387,7 @@ int pres_hooks =
dialog::add_action_push(choose_presentation);
}
}) +
addHook(tour::ss::hooks_extra_slideshows, 300, [] (tour::ss::slideshow_callback cb) {
addHook_slideshows(300, [] (tour::ss::slideshow_callback cb) {
if(rogueviz::pres::rvslides_data.empty()) pres::gen_rvtour_data();
cb(XLAT("non-Euclidean geometry in data analysis"), &pres::rvslides_data[0], 'd');

View File

@ -192,7 +192,7 @@ int args() {
auto hooks =
addHook(hooks_args, 100, args)
+ addHook(rogueviz::pres::hooks_build_rvtour, 180, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(180, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;
for(int m: {1,2}) {

View File

@ -192,7 +192,7 @@ void enable() {
auto msc =
addHook(hooks_args, 100, args)
+ addHook(pres::hooks_build_rvtour, 180, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(180, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
v.push_back(tour::slide{
cap+"random walk visualization", 10, tour::LEGAL::NONE | tour::QUICKSKIP,

View File

@ -50,7 +50,9 @@
#include "ascending-descending.cpp"
#include "balls.cpp"
#include "pentaroll.cpp"
#if CAP_RVSLIDES
#include "playing-with-impossibility.cpp"
#endif
#include "highdim-demo.cpp"
//#endif

View File

@ -617,7 +617,7 @@ string cname() {
}
int ah = addHook(hooks_args, 100, readArgs)
+ addHook(pres::hooks_build_rvtour, 120, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(120, [] (string s, vector<tour::slide>& v) {
if(s != "data") return;
using namespace pres;
string sagf = "SAG/";

View File

@ -234,7 +234,7 @@ auto hchook = addHook(hooks_drawcell, 100, draw_snow)
})
#endif
+ addHook(pres::hooks_build_rvtour, 161, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(161, [] (string s, vector<tour::slide>& v) {
if(s != "noniso") return;
v.push_back(tour::slide{
cap+"snowball visualization", 10, tour::LEGAL::NONE | tour::QUICKSKIP,

View File

@ -234,7 +234,7 @@ void enable() {
}
int phooks = arg::add3("-stair", enable)
+ addHook(pres::hooks_build_rvtour, 141, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(141, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;
v.push_back(

View File

@ -267,7 +267,7 @@ auto hook = 0
#if CAP_COMMANDLINE
+ addHook(hooks_args, 100, readArgs)
#endif
+ addHook(pres::hooks_build_rvtour, 144, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(144, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
using namespace tour;
v.push_back(

View File

@ -106,7 +106,7 @@ namespace tree {
}
int ah = arg::add3("-tree", [] { tree::read(arg::shift_args()); })
+ addHook(pres::hooks_build_rvtour, 120, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(120, [] (string s, vector<tour::slide>& v) {
if(s != "data") return;
using namespace pres;
v.push_back(

View File

@ -549,7 +549,7 @@ auto hchook = addHook(hooks_drawcell, 100, draw_ptriangle)
return 0;
})
+ addHook(pres::hooks_build_rvtour, 166, [] (string s, vector<tour::slide>& v) {
+ addHook_rvslides(166, [] (string s, vector<tour::slide>& v) {
using namespace tour;
if(s != "noniso") return;