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

rogueviz::pres::non_game_slide_scroll

This commit is contained in:
Zeno Rogue 2022-08-05 20:34:56 +02:00
parent 1f832faeba
commit f138bbb5c2
11 changed files with 21 additions and 26 deletions

View File

@ -248,6 +248,7 @@ void sync(int mode, flagtype flags) {
vid.use_smart_range = 2;
crystal::view_coordinates = (flags & VC);
smooth_scrolling = true;
tour::slide_backup(game_keys_scroll, true);
}
if(mode == pmKey && !(flags & NO_VC))
crystal::view_coordinates = !crystal::view_coordinates;
@ -404,6 +405,7 @@ auto explore_structure(int _shapeid) {
if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(smooth_scrolling, true);
tour::slide_backup(game_keys_scroll, true);
stop_game();
set_geometry(geometry == gCrystal534 ? gCrystal534 : gCrystal344);
enable_canvas();

View File

@ -124,10 +124,8 @@ auto hypcity_ah = arg::add3("-hypcity", enable)
geom3::switch_fpp();
}
setCanvas(mode, '0');
slide_backup(mapeditor::drawplayer, false);
if(mode == pmStart) {
slide_backup(canvas_default_wall, waInvisibleFloor);
slide_backup(smooth_scrolling, 1);
if(dim == 2) slide_backup(vid.camera, 0);
if(dim == 2) slide_backup(vid.depth, 0);
slide_backup(context_fog, false);
@ -135,6 +133,7 @@ auto hypcity_ah = arg::add3("-hypcity", enable)
start_game();
enable();
}
non_game_slide_scroll(mode);
}});
};

View File

@ -489,15 +489,12 @@ auto hooks =
auto load = [] (string s, ld x, int y) {
return [s, x, y] {
slide_backup(vid.cells_drawn_limit, 100);
slide_backup(smooth_scrolling, true);
slide_backup(ray::max_cells, 999999);
slide_backup(walking::on, true);
slide_backup(walking::eye_level, x);
mapstream::loadMap(s);
slide_backup(ray::fixed_map, true);
slide_backup(ray::max_iter_intra, y);
slide_backup(mapeditor::drawplayer, false);
slide_backup(playermoved, false);
#if CAP_VR
slide_backup(vrhr::hsm, vrhr::eHeadset::holonomy);
slide_backup(vrhr::eyes, vrhr::eEyes::truesim);
@ -518,6 +515,7 @@ auto hooks =
slide_action(mode, 'r', "run this visualization", loader);
slidecommand = "portal options";
if(mode == tour::pmKey) pushScreen(intra::show_portals);
rogueviz::pres::non_game_slide_scroll(mode);
}
});
};

View File

@ -12,8 +12,6 @@ auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
using namespace tour;
return [=] (presmode mode) {
if(mode == pmStart) {
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(smooth_scrolling, true);
stop_game();
set_geometry(g);
if(g == gSphere) {
@ -39,6 +37,7 @@ auto geoslide(eGeometry g, char canvas, int jhole, int jblock) {
sightranges[gSol] = 4;
}
}
rogueviz::pres::non_game_slide_scroll(mode);
if(mode == pmStop && jblock < 0)
pmodel = mdGeodesic;
slidecommand = "switch raycaster";

View File

@ -1400,6 +1400,7 @@ void nk_launch() {
sightranges[geometry] = .5;
ray::max_cells = 600000;
smooth_scrolling = 1;
game_keys_scroll = true;
camera_speed = 10;
// panini_alpha = 1;
// fov = 150;
@ -1438,19 +1439,18 @@ void portal_slideshow(tour::ss::slideshow_callback cb) {
setCanvas(mode, '0');
if(youtube != "")
slide_url(mode, 'y', "YouTube link", youtube);
non_game_slide_scroll(mode);
slide_action(mode, 'r', "run", [=] {
slide_backup(margin);
slide_backup(mapeditor::drawplayer);
slide_backup(firstland);
slide_backup(specialland);
slide_backup(ray::max_cells, 600000);
slide_backup(smooth_scrolling, 1);
slide_backup(camera_speed, 10);
slide_backup(ray::exp_decay_poly, 30);
slide_backup(ray::fixed_map, true);
slide_backup(ray::max_iter_iso, 80);
slide_backup(vid.cells_drawn_limit, 100);
slide_backup(mapeditor::drawplayer, false);
#if CAP_VR
slide_backup(vrhr::hsm);
slide_backup(vrhr::eyes);

View File

@ -819,7 +819,6 @@ slide dmv_slides[] = {
ply_slide(mode, gCubeTiling, mdPerspective, false);
if(!ply::staircase.available()) return;
if(mode == pmStart) {
tour::slide_backup(smooth_scrolling, true);
tour::slide_backup(sightranges[geometry], 200);
tour::slide_backup(vid.cells_drawn_limit, 200);
tour::slide_backup(camera_speed, 5);
@ -831,6 +830,7 @@ slide dmv_slides[] = {
// tour::slide_backup(vid.fov, 120);
}
non_game_slide_scroll(mode);
if(mode == pmKey) {
println(hlog, ggmatrix(currentmap->gamestart()));
println(hlog, View);
@ -923,12 +923,10 @@ slide dmv_slides[] = {
set_geometry(gNil);
start_game();
rogueviz::rv_hook(hooks_drawcell, 100, rogueviz::nilcompass::draw_compass);
tour::slide_backup(smooth_scrolling, true);
tour::slide_backup(mapeditor::drawplayer, false);
View = Id;
shift_view(ztangent(.5));
playermoved = false;
}
non_game_slide_scroll(mode);
if(mode == pmStart || mode == pmKey)
rogueviz::nilcompass::zeroticks = ticks;
}
@ -1205,15 +1203,13 @@ slide dmv_slides[] = {
if(mode == pmStart) {
stop_game();
set_geometry(gNil);
tour::slide_backup(mapeditor::drawplayer, false);
rogueviz::cylon::enable();
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;
}
non_game_slide_scroll(mode);
}},
{"3D model (geodesic)", 999, LEGAL::NONE | QUICKGEO,
@ -1263,15 +1259,13 @@ slide dmv_slides[] = {
set_geometry(gNil);
check_cgi();
cgi.require_shapes();
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(smooth_scrolling, true);
start_game();
rogueviz::balls::initialize(1);
rogueviz::balls::balls.resize(3);
pmodel = mdEquidistant;
playermoved = false;
View = cspin(1, 2, M_PI/2);
}
non_game_slide_scroll(mode);
}
},

View File

@ -87,6 +87,11 @@ void non_game_slide(presmode mode) {
no_other_hud(mode);
}
void non_game_slide_scroll(presmode mode) {
non_game_slide(mode);
slide_backup(smooth_scrolling, true);
}
void white_screen(presmode mode, color_t col) {
if(mode == pmStart) {
tour::slide_backup(backcolor, col);

View File

@ -218,11 +218,11 @@ auto hooks =
slide_backup(ray::max_cells, 32768);
slide_backup(ray::fixed_map, true);
#endif
slide_backup(smooth_scrolling, true);
slide_backup(camera_speed, .1);
enable();
start_game();
}
rogueviz::pres::non_game_slide_scroll(mode);
if(mode == pmKey)
edit_stretch();
}});
@ -245,11 +245,11 @@ auto hooks =
slide_backup(ray::fixed_map, true);
slide_backup(ray::want_use, 2);
#endif
slide_backup(smooth_scrolling, true);
slide_backup(camera_speed, .1);
enable();
start_game();
}
rogueviz::pres::non_game_slide_scroll(mode);
if(mode == pmKey)
edit_stretch();
}});

View File

@ -230,6 +230,7 @@ function<void(presmode)> roguevizslide_action(char c, const T& t, const U& act)
void compare_projections(presmode mode, eModel a, eModel b);
void no_other_hud(presmode mode);
void non_game_slide(presmode mode);
void non_game_slide_scroll(presmode mode);
void white_screen(presmode mode, color_t col = 0xFFFFFFFF);
void empty_screen(presmode mode, color_t col = 0xFFFFFFFF);
void show_picture(presmode mode, string s);

View File

@ -192,15 +192,13 @@ void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
if(mode == pmStart) {
stop_game();
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup<ld>(snow_lambda, 1);
tour::slide_backup(snow_color, 0xC0C0C0FF);
tour::slide_backup(snow_intense, true);
tour::slide_backup(smooth_scrolling, true);
t();
start_game();
playermoved = false;
}
rogueviz::pres::non_game_slide_scroll(mode);
}}
);
}

View File

@ -504,10 +504,8 @@ void slide_itri(tour::presmode mode, int id) {
if(mode == pmStart) {
stop_game();
set_geometry(gNil);
tour::slide_backup(mapeditor::drawplayer, false);
tour::slide_backup(on, true);
tour::slide_backup(net, id == 2 ? true : false);
tour::slide_backup(smooth_scrolling, true);
tour::on_restore(nilv::set_flags);
if(id == 0)
tour::slide_backup(nilv::nilperiod, make_array(3, 3, 3));
@ -524,6 +522,7 @@ void slide_itri(tour::presmode mode, int id) {
playermoved = false;
tour::on_restore(reset);
}
rogueviz::pres::non_game_slide_scroll(mode);
}
string cap = "Impossible architecture in Nil/";