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

using new setCanvas function in RogueViz presentations

This commit is contained in:
Zeno Rogue 2024-06-16 16:16:56 +02:00
parent e76e32e214
commit 263ee56427
22 changed files with 77 additions and 113 deletions

View File

@ -1497,7 +1497,7 @@ void geodesic_screen(tour::presmode mode, int id) {
static hyperpoint start, middle, target, nlh, nlh1, nlh2; static hyperpoint start, middle, target, nlh, nlh1, nlh2;
const ld coord = 10; const ld coord = 10;
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(pmodel); slide_backup(pmodel);
slide_backup(pconf.clip_min); slide_backup(pconf.clip_min);
@ -1686,7 +1686,7 @@ slide embchess_slides[] = {
"to access various options. The next slides are slides from that video.\n\n", "to access various options. The next slides are slides from that video.\n\n",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
slide_url(mode, 'y', "YouTube link", "https://youtu.be/Rhjv_PazzZE"); slide_url(mode, 'y', "YouTube link", "https://youtu.be/Rhjv_PazzZE");
slide_action(mode, 'a', "activate / configure", act_or_config); slide_action(mode, 'a', "activate / configure", act_or_config);
if(mode == pmKey) act_or_config(); if(mode == pmKey) act_or_config();

View File

@ -469,7 +469,7 @@ auto fifteen_hook =
slide_error(mode, "file " + fname + " not found"); slide_error(mode, "file " + fname + " not found");
return; return;
} }
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(mapeditor::drawplayer, mapeditor::drawplayer); slide_backup(mapeditor::drawplayer, mapeditor::drawplayer);
slide_backup(vid.wallmode, 2); slide_backup(vid.wallmode, 2);

View File

@ -556,7 +556,7 @@ bool drawVertex(const shiftmatrix &V, cell *c, shmup::monster *m) {
void flock_slide(tour::presmode mode, int _N, reaction_t t) { void flock_slide(tour::presmode mode, int _N, reaction_t t) {
using namespace tour; using namespace tour;
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(mapeditor::drawplayer); slide_backup(mapeditor::drawplayer);
t(); t();

View File

@ -167,7 +167,7 @@ void heat_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc, tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc,
[t] (presmode mode) { [t] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
slide_backup(vid.use_smart_range, 2); slide_backup(vid.use_smart_range, 2);
slide_backup(vid.smart_range_detail, 1); slide_backup(vid.smart_range_detail, 1);
slide_backup(vid.cells_drawn_limit, 100000); slide_backup(vid.cells_drawn_limit, 100000);

View File

@ -131,16 +131,14 @@ auto hypcity_ah = arg::add3("-hypcity", enable)
if(mode == pmStart && dim == 2 && !vid.always3) { if(mode == pmStart && dim == 2 && !vid.always3) {
geom3::switch_fpp(); geom3::switch_fpp();
} }
setCanvas(mode, '0'); setWhiteCanvas(mode, [setter, dim] {
if(mode == pmStart) {
slide_backup(canvas_default_wall, waInvisibleFloor); slide_backup(canvas_default_wall, waInvisibleFloor);
if(dim == 2) slide_backup(vid.camera, 0); if(dim == 2) slide_backup(vid.camera, 0);
if(dim == 2) slide_backup(vid.depth, 0); if(dim == 2) slide_backup(vid.depth, 0);
slide_backup(context_fog, false); slide_backup(context_fog, false);
setter(); setter();
start_game(); });
enable(); if(mode == pmStart) enable();
}
non_game_slide_scroll(mode); non_game_slide_scroll(mode);
}}); }});
}; };

View File

@ -436,7 +436,7 @@ auto msc = arg::add3("-analogs", enable)
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 'y', "YouTube link (with description)", "https://youtu.be/H7NKhKTjHVE"); slide_url(mode, 'y', "YouTube link (with description)", "https://youtu.be/H7NKhKTjHVE");
slide_url(mode, 'm', "HyperRogue page about projections", "http://www.roguetemple.com/z/hyper/models.php"); slide_url(mode, 'm', "HyperRogue page about projections", "http://www.roguetemple.com/z/hyper/models.php");
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(mapeditor::drawplayer); slide_backup(mapeditor::drawplayer);
slide_backup(vid.use_smart_range); slide_backup(vid.use_smart_range);

View File

@ -247,7 +247,7 @@ vector<cell*> current_list;
void mine_slide(tour::presmode mode, reaction_t set_geom, function<vector<cell*>()> celllister, function<void(cell*)> assigner) { void mine_slide(tour::presmode mode, reaction_t set_geom, function<vector<cell*>()> celllister, function<void(cell*)> assigner) {
using namespace tour; using namespace tour;
ccolor::plain.ctab = {0}; ccolor::plain.ctab = {0};
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(mapeditor::drawplayer, false); slide_backup(mapeditor::drawplayer, false);
slide_backup(no_find_player, true); slide_backup(no_find_player, true);
@ -299,7 +299,7 @@ using namespace rogueviz::pres;
void wfc_slide(presmode mode, int type, int rad, int cutoff) { void wfc_slide(presmode mode, int type, int rad, int cutoff) {
static vector<pair<cell*, int>> colors; static vector<pair<cell*, int>> colors;
setCanvas(mode, '0'); setWhiteCanvas(mode);
dynamic_wfc::wfctype = type; dynamic_wfc::wfctype = type;
dynamic_wfc::wfcrad = rad; dynamic_wfc::wfcrad = rad;
dynamic_wfc::cutoff = cutoff; dynamic_wfc::cutoff = cutoff;
@ -419,7 +419,7 @@ slide sweeper_slides[] = {
{"Variants: HyperRogue minefield", 123, LEGAL::ANY | QUICKGEO, {"Variants: HyperRogue minefield", 123, LEGAL::ANY | QUICKGEO,
"The other one is the Minefield land in HyperRogue. It is heavily modified from the original but the basic idea stays the same.", "The other one is the Minefield land in HyperRogue. It is heavily modified from the original but the basic idea stays the same.",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
stop_game(); stop_game();
firstland = specialland = laMinefield; firstland = specialland = laMinefield;
@ -509,7 +509,7 @@ slide sweeper_slides[] = {
"For creatures restricted to just this surface, they are indeed striaght lines!\n\n" "For creatures restricted to just this surface, they are indeed striaght lines!\n\n"
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false); tour::slide_backup(mapeditor::drawplayer, false);
enable_earth(); enable_earth();
@ -538,17 +538,13 @@ slide sweeper_slides[] = {
"The hyperbolic geometry is the opposite. We can have a pentagon with five right angles.\n\n" "The hyperbolic geometry is the opposite. We can have a pentagon with five right angles.\n\n"
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, 'c'); setCanvas(mode, &ccolor::chessboard, [] {
if(mode == pmStart) {
stop_game();
set_geometry(g45); set_geometry(g45);
set_variation(eVariation::pure); set_variation(eVariation::pure);
tour::slide_backup(ccolor::chessboard.ctab[0], 0x104010); tour::slide_backup(ccolor::chessboard.ctab, colortable{0x104010, 0x10F010});
tour::slide_backup(ccolor::chessboard.ctab[1], 0x10F010);
tour::slide_backup(vid.use_smart_range, 2); tour::slide_backup(vid.use_smart_range, 2);
tour::slide_backup(vid.smart_range_detail, 1); tour::slide_backup(vid.smart_range_detail, 1);
start_game(); });
}
// mine_slide(mode, geom_pentagos, cl_pentagons, chessboard_assigner); // mine_slide(mode, geom_pentagos, cl_pentagons, chessboard_assigner);
non_game_slide_scroll(mode); non_game_slide_scroll(mode);
tour::slide_backup(draw_centerover, false); tour::slide_backup(draw_centerover, false);
@ -559,14 +555,12 @@ slide sweeper_slides[] = {
"The hyperbolic plane has a tree-like structure. It is best seen in the 'binary tiling'. Press '5' to show the pattern.\n\n" "The hyperbolic plane has a tree-like structure. It is best seen in the 'binary tiling'. Press '5' to show the pattern.\n\n"
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, 'g'); setCanvasColor(mode, 0x10A010, [] {
non_game_slide_scroll(mode);
if(mode == pmStart) {
tour::slide_backup(ccolor::plain.ctab[0], 0x10A010);
stop_game();
set_geometry(gBinary4); set_geometry(gBinary4);
set_variation(eVariation::pure); set_variation(eVariation::pure);
start_game(); });
non_game_slide_scroll(mode);
if(mode == pmStart) {
tour::slide_backup(vid.use_smart_range, 2); tour::slide_backup(vid.use_smart_range, 2);
tour::slide_backup(vid.smart_range_detail, 1); tour::slide_backup(vid.smart_range_detail, 1);
View = spin90(); View = spin90();
@ -589,13 +583,12 @@ slide sweeper_slides[] = {
"Other hyperbolic tessellations have a similar structure, just a bit more complicated...\n\n" "Other hyperbolic tessellations have a similar structure, just a bit more complicated...\n\n"
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode, [] {
non_game_slide_scroll(mode);
if(mode == pmStart) {
stop_game();
set_variation(eVariation::pure); set_variation(eVariation::pure);
tour::slide_backup(vid.creature_scale, 0.5); tour::slide_backup(vid.creature_scale, 0.5);
start_game(); });
non_game_slide_scroll(mode);
if(mode == pmStart) {
tour::slide_backup(viewdists, true); tour::slide_backup(viewdists, true);
using linepatterns::patTree; using linepatterns::patTree;
tour::slide_backup(patTree.color, 0xFFFFFFFF); tour::slide_backup(patTree.color, 0xFFFFFFFF);
@ -837,14 +830,12 @@ slide sweeper_slides[] = {
"To see this, let's remind you of the binary tiling..." "To see this, let's remind you of the binary tiling..."
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, 'g'); setCanvasColor(mode, 0x10A010, [] {
non_game_slide_scroll(mode);
if(mode == pmStart) {
tour::slide_backup(ccolor::plain.ctab[0], 0x10A010);
stop_game();
set_geometry(gBinary4); set_geometry(gBinary4);
set_variation(eVariation::pure); set_variation(eVariation::pure);
start_game(); });
non_game_slide_scroll(mode);
if(mode == pmStart) {
tour::slide_backup(vid.use_smart_range, 2); tour::slide_backup(vid.use_smart_range, 2);
tour::slide_backup(vid.smart_range_detail, 1); tour::slide_backup(vid.smart_range_detail, 1);
View = spin90(); View = spin90();

View File

@ -284,7 +284,12 @@ auto hchook =
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 'y', "YouTube link", "https://youtu.be/3WejR74o6II"); slide_url(mode, 'y', "YouTube link", "https://youtu.be/3WejR74o6II");
setCanvas(mode, '0'); setWhiteCanvas(mode, [] {
set_geometry(gNil);
tour::on_restore(nilv::set_flags);
tour::slide_backup(nilv::nilperiod, make_array(3, 3, 3));
nilv::set_flags();
});
slidecommand = "animation"; slidecommand = "animation";
if(mode == pmKey) { if(mode == pmKey) {
@ -292,14 +297,8 @@ auto hchook =
} }
if(mode == pmStart) { if(mode == pmStart) {
stop_game();
set_geometry(gNil);
tour::slide_backup(mapeditor::drawplayer, false); tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(smooth_scrolling, true); tour::slide_backup(smooth_scrolling, true);
tour::on_restore(nilv::set_flags);
tour::slide_backup(nilv::nilperiod, make_array(3, 3, 3));
nilv::set_flags();
start_game();
playermoved = false; playermoved = false;
enable(); enable();
} }

View File

@ -324,7 +324,7 @@ auto hook = arg::add3("-inner-map", enable)
, ,
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 't', "Twitter link (with description)", "https://twitter.com/zenorogue/status/1212408644941295619"); slide_url(mode, 't', "Twitter link (with description)", "https://twitter.com/zenorogue/status/1212408644941295619");
setCanvas(mode, 'r'); setCanvas(mode, &ccolor::random, [] { slide_backup(ccolor::rwalls, 0); });
if(mode == pmStart) { if(mode == pmStart) {
if(!shmup::on) restart_game(rg::shmup); if(!shmup::on) restart_game(rg::shmup);

View File

@ -598,7 +598,7 @@ auto hooks =
v.push_back(tour::slide{ v.push_back(tour::slide{
s, 10, tour::LEGAL::NONE | tour::QUICKSKIP | tour::QUICKGEO | tour::ALWAYS_TEXT, desc, s, 10, tour::LEGAL::NONE | tour::QUICKSKIP | tour::QUICKGEO | tour::ALWAYS_TEXT, desc,
[=] (tour::presmode mode) { [=] (tour::presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
if(youtube != "") if(youtube != "")
slide_url(mode, 'y', "YouTube link", youtube); slide_url(mode, 'y', "YouTube link", youtube);
if(twitter != "") if(twitter != "")

View File

@ -12,8 +12,7 @@ bool in_special = false;
auto geoslide(eGeometry g, char canvas, int jhole, int jblock) { auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
using namespace tour; using namespace tour;
return [=] (presmode mode) { return [=] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode, [&] {
if(mode == pmStart) {
set_geometry(g); set_geometry(g);
if(g == gSphere) { if(g == gSphere) {
set_geometry(gProduct); set_geometry(gProduct);
@ -31,12 +30,11 @@ auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
tour::slide_backup(ccolor::jblock, jblock); tour::slide_backup(ccolor::jblock, jblock);
tour::slide_backup(ccolor::which, ccolor::legacy(canvas)); tour::slide_backup(ccolor::which, ccolor::legacy(canvas));
tour::slide_backup(vid.linewidth, vid.linewidth / 10); tour::slide_backup(vid.linewidth, vid.linewidth / 10);
start_game();
if(jblock < 0) { if(jblock < 0) {
pmodel = mdDisk; pmodel = mdDisk;
sightranges[gSol] = 4; sightranges[gSol] = 4;
} }
} });
rogueviz::pres::non_game_slide_scroll(mode); rogueviz::pres::non_game_slide_scroll(mode);
if(mode == pmStop && jblock < 0) if(mode == pmStop && jblock < 0)
pmodel = mdGeodesic; pmodel = mdGeodesic;
@ -163,11 +161,9 @@ tour::slide *gen_noniso_demo() {
"This is a presentation of non-isotropic geometries.", "This is a presentation of non-isotropic geometries.",
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 'p', "paper about non-isotropic geometries", "https://arxiv.org/abs/2002.09533"); slide_url(mode, 'p', "paper about non-isotropic geometries", "https://arxiv.org/abs/2002.09533");
setCanvas(mode, 'r'); setCanvas(mode, &ccolor::random, [] {
if(mode == pmStart) {
set_geometry(gCubeTiling); set_geometry(gCubeTiling);
start_game(); });
}
} }
}); });

View File

@ -1443,7 +1443,7 @@ void portal_slideshow(tour::ss::slideshow_callback cb) {
portal_slides.emplace_back( portal_slides.emplace_back(
tour::slide{s, 100, LEGAL::NONE | QUICKGEO | QUICKSKIP | ALWAYS_TEXT, text, tour::slide{s, 100, LEGAL::NONE | QUICKGEO | QUICKSKIP | ALWAYS_TEXT, text,
[=] (presmode mode) { [=] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
if(youtube != "") if(youtube != "")
slide_url(mode, 'y', "YouTube link", youtube); slide_url(mode, 'y', "YouTube link", youtube);
non_game_slide_scroll(mode); non_game_slide_scroll(mode);

View File

@ -328,7 +328,7 @@ auto xhook =
"Move the mouse nearer and further away from the X.", "Move the mouse nearer and further away from the X.",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
slide_url(mode, 'u', "open the URL", "http://www.roguetemple.com/z/sims/snub/"); slide_url(mode, 'u', "open the URL", "http://www.roguetemple.com/z/sims/snub/");
slide_backup(rug::model_distance); slide_backup(rug::model_distance);
slide_backup(vid.rug_config.model); slide_backup(vid.rug_config.model);

View File

@ -526,11 +526,12 @@ auto msc =
, ,
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 't', "Twitter link (with description)", "https://twitter.com/ZenoRogue/status/1339946298460483589"); slide_url(mode, 't', "Twitter link (with description)", "https://twitter.com/ZenoRogue/status/1339946298460483589");
setCanvas(mode, '0'); setPlainCanvas(mode, [] {
set_geometry(gSphere);
});
if(mode == pmStart) { if(mode == pmStart) {
enable(); enable();
set_geometry(gSphere);
slide_backup(canvas_default_wall, waInvisibleFloor); slide_backup(canvas_default_wall, waInvisibleFloor);
slide_backup(pmodel, mdDisk); slide_backup(pmodel, mdDisk);
slide_backup(pconf.scale, 1000); slide_backup(pconf.scale, 1000);

View File

@ -827,7 +827,7 @@ auto chk = arg::add3("-platformer", enable)
slide_url(mode, 'y', "non-Euclidean platformer (YouTube)", "https://www.youtube.com/watch?v=eb2DhCcGH7U"); slide_url(mode, 'y', "non-Euclidean platformer (YouTube)", "https://www.youtube.com/watch?v=eb2DhCcGH7U");
slide_url(mode, 't', "non-Euclidean platformer (Twitter)", "https://twitter.com/ZenoRogue/status/1467233150380089345"); slide_url(mode, 't', "non-Euclidean platformer (Twitter)", "https://twitter.com/ZenoRogue/status/1467233150380089345");
slide_url(mode, 'g', "how to edit this", "https://github.com/zenorogue/hyperrogue/blob/master/rogueviz/platformer.cpp"); slide_url(mode, 'g', "how to edit this", "https://github.com/zenorogue/hyperrogue/blob/master/rogueviz/platformer.cpp");
setCanvas(mode, '0'); setPlainCanvas(mode);
using namespace tour; using namespace tour;
if(mode == pmStart) { if(mode == pmStart) {
mapstream::loadMap("platformer.lev"); mapstream::loadMap("platformer.lev");

View File

@ -91,7 +91,7 @@ struct dmv_grapher : grapher {
void nil_screen(presmode mode, int id) { void nil_screen(presmode mode, int id) {
use_angledir(mode, id == 0); use_angledir(mode, id == 0);
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(pmodel); slide_backup(pmodel);
slide_backup(pconf.clip_min); slide_backup(pconf.clip_min);
@ -287,7 +287,7 @@ void geodesic_screen(presmode mode, int id) {
use_angledir(mode, id == 0); use_angledir(mode, id == 0);
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
slide_backup(pmodel); slide_backup(pmodel);
slide_backup(pconf.clip_min); slide_backup(pconf.clip_min);
@ -471,7 +471,7 @@ void geodesic_screen(presmode mode, int id) {
void brick_slide(int i, presmode mode, eGeometry geom, eModel md, int anim) { void brick_slide(int i, presmode mode, eGeometry geom, eModel md, int anim) {
using namespace tour; using namespace tour;
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
set_geometry(geom); set_geometry(geom);
start_game(); start_game();
@ -511,7 +511,7 @@ void ply_slide(tour::presmode mode, eGeometry geom, eModel md, bool anim) {
check_cgi(); check_cgi();
cgi.require_shapes(); cgi.require_shapes();
} }
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
set_geometry(geom); set_geometry(geom);
start_game(); start_game();
@ -534,7 +534,7 @@ void ply_slide(tour::presmode mode, eGeometry geom, eModel md, bool anim) {
void impossible_ring_slide(tour::presmode mode) { void impossible_ring_slide(tour::presmode mode) {
using namespace tour; using namespace tour;
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
set_geometry(gCubeTiling); set_geometry(gCubeTiling);
start_game(); start_game();
@ -626,20 +626,14 @@ slide dmv_slides[] = {
"The sum of angles of a triangle is 180 degrees.\n\n", "The sum of angles of a triangle is 180 degrees.\n\n",
[] (presmode mode) { [] (presmode mode) {
if(mode == pmStartAll) enable_canvas(); if(mode == pmStartAll) enable_canvas();
setCanvas(mode, 'F'); setCanvas(mode, &ccolor::football, [] {
if(mode == pmStart) {
stop_game();
slide_backup(firstland, laCanvas);
slide_backup(specialland, laCanvas);
set_geometry(gArchimedean); arcm::current.parse("3^6"); set_geometry(gArchimedean); arcm::current.parse("3^6");
set_variation(eVariation::pure); set_variation(eVariation::pure);
slide_backup(ccolor::which->ctab, colortable{0xC0FFC0, 0x80FF80});
slide_backup(ccolor::football.ctab[0], 0xC0FFC0); });
slide_backup(ccolor::football.ctab[1], 0x80FF80); if(mode == pmStart) {
slide_backup(pconf.alpha, 1); slide_backup(pconf.alpha, 1);
slide_backup(pconf.scale, 1); slide_backup(pconf.scale, 1);
start_game();
slide_backup(patterns::whichShape, '9'); slide_backup(patterns::whichShape, '9');
slide_backup(vid.use_smart_range, 2); slide_backup(vid.use_smart_range, 2);
slide_backup(mapeditor::drawplayer, false); slide_backup(mapeditor::drawplayer, false);
@ -664,7 +658,7 @@ slide dmv_slides[] = {
"For creatures restricted to just this surface, they are indeed striaght lines!\n\n" "For creatures restricted to just this surface, they are indeed striaght lines!\n\n"
, ,
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false); tour::slide_backup(mapeditor::drawplayer, false);
enable_earth(); enable_earth();
@ -701,19 +695,15 @@ slide dmv_slides[] = {
"In hyperbolic geometry, the sum of angles of a triangle is less than 180 degrees.\n\n", "In hyperbolic geometry, the sum of angles of a triangle is less than 180 degrees.\n\n",
[] (presmode mode) { [] (presmode mode) {
if(mode == pmStartAll) enable_canvas(); if(mode == pmStartAll) enable_canvas();
setCanvas(mode, 'F'); setCanvas(mode, &ccolor::football, [] {
if(mode == pmStart) {
stop_game();
slide_backup(firstland, laCanvas);
slide_backup(specialland, laCanvas);
set_geometry(gNormal); set_geometry(gNormal);
set_variation(eVariation::bitruncated); set_variation(eVariation::bitruncated);
slide_backup(ccolor::football.ctab[0], 0xC0FFC0); slide_backup(ccolor::which->ctab, colortable{0xC0FFC0, 0x80FF80});
slide_backup(ccolor::football.ctab[1], 0x80FF80); });
if(mode == pmStart) {
slide_backup(pconf.alpha, 1); slide_backup(pconf.alpha, 1);
slide_backup(pconf.scale, 1); slide_backup(pconf.scale, 1);
slide_backup(rug::mouse_control_rug, true); slide_backup(rug::mouse_control_rug, true);
start_game();
slide_backup(patterns::whichShape, '9'); slide_backup(patterns::whichShape, '9');
} }
if(mode == pmStart) { if(mode == pmStart) {
@ -759,10 +749,9 @@ slide dmv_slides[] = {
slide_backup(vid.fov, 120); slide_backup(vid.fov, 120);
} }
setCanvas(mode, '0'); setPlainCanvas(mode, [] { set_geometry(gSpace534); });
if(mode == pmStart) { if(mode == pmStart) {
set_geometry(gSpace534);
/* /*
static bool solved = false; static bool solved = false;
if(!solved) { if(!solved) {
@ -917,12 +906,10 @@ slide dmv_slides[] = {
"(press Home/End and arrow keys to move)", "(press Home/End and arrow keys to move)",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode, [] { set_geometry(gNil); });
slidecommand = "highlight dimensions"; slidecommand = "highlight dimensions";
if(mode == pmStart) { if(mode == pmStart) {
tour::slide_backup(pmodel, mdGeodesic); tour::slide_backup(pmodel, mdGeodesic);
set_geometry(gNil);
start_game();
rogueviz::rv_hook(hooks_drawcell, 100, rogueviz::nilcompass::draw_compass); rogueviz::rv_hook(hooks_drawcell, 100, rogueviz::nilcompass::draw_compass);
View = Id; View = Id;
shift_view(ztangent(.5)); shift_view(ztangent(.5));
@ -1199,22 +1186,19 @@ slide dmv_slides[] = {
"Here is how it looks in Nil. Press '5' to animate.\n", "Here is how it looks in Nil. Press '5' to animate.\n",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode, [] {
set_geometry(gNil);
tour::on_restore(nilv::set_flags);
tour::slide_backup(nilv::nilperiod, make_array(3, 3, 3));
nilv::set_flags();
});
slidecommand = "animation"; slidecommand = "animation";
if(mode == pmKey) { if(mode == pmKey) {
tour::slide_backup(rogueviz::cylon::cylanim, !rogueviz::cylon::cylanim); tour::slide_backup(rogueviz::cylon::cylanim, !rogueviz::cylon::cylanim);
} }
if(mode == pmStart) { if(mode == pmStart) rogueviz::cylon::enable();
stop_game();
set_geometry(gNil);
rogueviz::cylon::enable();
tour::on_restore(nilv::set_flags);
tour::slide_backup(nilv::nilperiod, make_array(3, 3, 3));
nilv::set_flags();
start_game();
}
non_game_slide_scroll(mode); non_game_slide_scroll(mode);
}}, }},
@ -1261,13 +1245,8 @@ slide dmv_slides[] = {
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 'y', "YouTube link", "https://www.youtube.com/watch?v=mxvUAcgN3go"); slide_url(mode, 'y', "YouTube link", "https://www.youtube.com/watch?v=mxvUAcgN3go");
slide_url(mode, 'n', "Nil Rider", "https://zenorogue.itch.io/nil-rider"); slide_url(mode, 'n', "Nil Rider", "https://zenorogue.itch.io/nil-rider");
setCanvas(mode, '0'); setWhiteCanvas(mode, [] { set_geometry(gNil); });
if(mode == pmStart) { if(mode == pmStart) {
stop_game();
set_geometry(gNil);
check_cgi();
cgi.require_shapes();
start_game();
rogueviz::balls::initialize(1); rogueviz::balls::initialize(1);
rogueviz::balls::balls.resize(3); rogueviz::balls::balls.resize(3);
pmodel = mdEquidistant; pmodel = mdEquidistant;

View File

@ -211,7 +211,7 @@ auto hooks =
"You can also obtain a different geometry (Berger sphere) by stretching along the fibers. Press 5 to stretch."+bonus "You can also obtain a different geometry (Berger sphere) by stretching along the fibers. Press 5 to stretch."+bonus
, ,
[m] (presmode mode) { [m] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
slide_url(mode, 't', "Twitter link", "https://twitter.com/ZenoRogue/status/1166723332840001536"); slide_url(mode, 't', "Twitter link", "https://twitter.com/ZenoRogue/status/1166723332840001536");
slide_url(mode, 's', "stretched Twitter link", "https://twitter.com/ZenoRogue/status/1258035231996682244"); slide_url(mode, 's', "stretched Twitter link", "https://twitter.com/ZenoRogue/status/1258035231996682244");
if(mode == pmStart) { if(mode == pmStart) {
@ -238,7 +238,7 @@ auto hooks =
"Again, press 5 to stretch."+bonus "Again, press 5 to stretch."+bonus
, ,
[m] (presmode mode) { [m] (presmode mode) {
setCanvas(mode, '0'); setWhiteCanvas(mode);
slide_url(mode, 's', "stretched Twitter link", "https://twitter.com/ZenoRogue/status/1259143275115687936"); slide_url(mode, 's', "stretched Twitter link", "https://twitter.com/ZenoRogue/status/1259143275115687936");
if(mode == pmStart) { if(mode == pmStart) {
set_geometry(gKleinQuartic); set_geometry(gKleinQuartic);

View File

@ -160,7 +160,7 @@ void rw_slide(vector<tour::slide>& v, string title, string desc, reaction_t t) {
tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc, tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc,
[t] (presmode mode) { [t] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false); tour::slide_backup(mapeditor::drawplayer, false);

View File

@ -210,7 +210,7 @@ void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc, tour::slide{cap + title, 18, LEGAL::NONE | QUICKGEO, desc,
[t] (presmode mode) { [t] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
slidecommand = "auto-movement"; slidecommand = "auto-movement";
if(mode == pmKey) { if(mode == pmKey) {

View File

@ -248,7 +248,7 @@ int phooks = arg::add3("-stair", enable)
"Press '5' to change the curvature or other parameters.", "Press '5' to change the curvature or other parameters.",
[] (presmode mode) { [] (presmode mode) {
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) staircase::make_staircase(); if(mode == pmStart) staircase::make_staircase();
slidecommand = "staircase menu"; slidecommand = "staircase menu";
if(mode == pmKey) pushScreen(staircase::showMenu); if(mode == pmKey) pushScreen(staircase::showMenu);

View File

@ -332,7 +332,7 @@ auto hook = 0
[] (presmode mode) { [] (presmode mode) {
slide_url(mode, 'y', "YouTube link", "https://www.youtube.com/watch?v=bKzibaNqEog"); slide_url(mode, 'y', "YouTube link", "https://www.youtube.com/watch?v=bKzibaNqEog");
slide_url(mode, 't', "Twitter link", "https://twitter.com/ZenoRogue/status/1247900522905886723"); slide_url(mode, 't', "Twitter link", "https://twitter.com/ZenoRogue/status/1247900522905886723");
setCanvas(mode, '0'); setPlainCanvas(mode);
if((mode == pmStop || mode == pmGeometry) && rug::rugged) rug::close(); if((mode == pmStop || mode == pmGeometry) && rug::rugged) rug::close();

View File

@ -500,7 +500,7 @@ bool draw_ptriangle(cell *c, const shiftmatrix& V) {
#if CAP_RVSLIDES #if CAP_RVSLIDES
void slide_itri(tour::presmode mode, int id) { void slide_itri(tour::presmode mode, int id) {
using namespace tour; using namespace tour;
setCanvas(mode, '0'); setPlainCanvas(mode);
if(mode == pmStart) { if(mode == pmStart) {
stop_game(); stop_game();