From 4e7b95e3465db535682407d34242cf53e69c5bdd Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 15 Oct 2022 22:55:33 +0200 Subject: [PATCH] ads-game:: new view modes are now available in the menu --- rogueviz/ads/ads-game.cpp | 8 ++++ rogueviz/ads/globals.cpp | 3 ++ rogueviz/ads/menu.cpp | 80 +++++++++++++++++++++++++++++++++++---- rogueviz/ads/views.cpp | 9 +++++ 4 files changed, 93 insertions(+), 7 deletions(-) diff --git a/rogueviz/ads/ads-game.cpp b/rogueviz/ads/ads-game.cpp index b4777fb2..bcfd59e4 100644 --- a/rogueviz/ads/ads-game.cpp +++ b/rogueviz/ads/ads-game.cpp @@ -246,6 +246,14 @@ auto shot_hooks = param_i(talpha, "ds_talpha") -> editable(0, 255, 16, "dS texture intensity", "", 't'); + param_f(spacetime_step, "ads_spacetime_step") + -> editable(0, 1, 0.05, "step size in the spacetime display", "", 's'); + + param_i(spacetime_qty, "ads_spacetime_qty") + -> editable(0, 100, 5, "step quantity in the spacetime display", "", 'q'); + + addsaver(ghost_color, "color:ghost"); + rsrc_config(); }); diff --git a/rogueviz/ads/globals.cpp b/rogueviz/ads/globals.cpp index 0a5cc2e7..c70aac04 100644 --- a/rogueviz/ads/globals.cpp +++ b/rogueviz/ads/globals.cpp @@ -140,4 +140,7 @@ extern int use_duality; ld spacetime_step = 0.1; int spacetime_qty = 30; + +color_t ghost_color = 0x800080FF; + }} diff --git a/rogueviz/ads/menu.cpp b/rogueviz/ads/menu.cpp index b25f9eee..6d9f8d02 100644 --- a/rogueviz/ads/menu.cpp +++ b/rogueviz/ads/menu.cpp @@ -77,6 +77,76 @@ void edit_particles() { dialog::display(); } +void edit_view_mode() { + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); + + dialog::init(XLAT("spacetime views"), 0xC0C0FFFF, 150, 100); + + dialog::addBoolItem(XLAT("view replay"), in_replay, 'r'); + dialog::add_action(switch_replay); + + dialog::addBreak(100); + + if(!main_rock) add_edit(auto_rotate); + if(!main_rock) add_edit(auto_angle); + + dialog::addBoolItem("view the current time", !in_spacetime() && which_cross == 0, 'z'); + dialog::add_action([] { + switch_spacetime_to(false); which_cross = 0; + }); + + dialog::addBoolItem("view the visible state", !in_spacetime() && which_cross == -1, 'x'); + dialog::add_action([] { + switch_spacetime_to(false); which_cross = -1; + }); + + dialog::addBoolItem("view the future", !in_spacetime() && which_cross == 1, 'c'); + dialog::add_action([] { + switch_spacetime_to(false); which_cross = 1; + }); + + dialog::addBoolItem("view the spacetime", in_spacetime() && pmodel == mdRelPerspective && !use_duality, 'v'); + dialog::add_action([] { + switch_spacetime_to(true); pmodel = mdRelPerspective; use_duality = 0; + }); + + if(main_rock) { + dialog::addBoolItem("view the dual space", in_spacetime() && pmodel == mdPerspective, 'v'); + dialog::add_action([] { + switch_spacetime_to(true); + pmodel = mdPerspective; + }); + } + + else { + dialog::addBoolItem("view the dual spacetime", in_spacetime() && use_duality == 1, 'b'); + dialog::add_action([] { + switch_spacetime_to(true); + use_duality = 1; + }); + + dialog::addBoolItem("fake dual spacetime", in_spacetime() && use_duality == 2, 'n'); + dialog::add_action([] { + switch_spacetime_to(true); + use_duality = 2; + }); + } + + if(in_spacetime()) { + add_edit(spacetime_step); + add_edit(spacetime_qty); + + if(main_rock) { + dialog::addColorItem(XLAT("ultra-ideal ghost color"), ghost_color, 'X'); + dialog::add_action([] { dialog::openColorDialog(ghost_color); }); + } + + } + + dialog::display(); + } + void game_menu() { cmode = sm::SIDE | sm::MAYDARK; gamescreen(); @@ -89,8 +159,9 @@ void game_menu() { add_edit(pause_speed); add_edit(view_proper_times); add_edit(DS_(time_unit)); - if(!main_rock) add_edit(auto_rotate); - if(!main_rock) add_edit(auto_angle); + + dialog::addItem(XLAT("set view mode"), 'v'); + dialog::add_action_push(edit_view_mode); dialog::addItem(XLAT("particle/texture settings"), 'p'); dialog::add_action_push(edit_particles); @@ -107,11 +178,6 @@ void game_menu() { dialog::addItem(XLAT("recenter cheat"), 'C'); dialog::add_action([] { current.T = Id; vctrV = Id; }); - if(paused) { - dialog::addBoolItem(XLAT("view replay"), in_replay, 'V'); - dialog::add_action(switch_replay); - } - dialog::addItem("configure keys", 'k'); dialog::add_action_push(multi::get_key_configurer(1, move_names, "Relative Hell keys")); diff --git a/rogueviz/ads/views.cpp b/rogueviz/ads/views.cpp index f85148e0..399a4a45 100644 --- a/rogueviz/ads/views.cpp +++ b/rogueviz/ads/views.cpp @@ -50,9 +50,12 @@ void switch_spacetime() { check_cgi(); cgi.require_basics(); cgi.use_count++; + vid.grid = true; + stdgridcolor = 0xFFFFFFFF; initcells(); initgame(); + vid.fov = 150; models::desitter_projections = true; } @@ -61,6 +64,7 @@ void switch_spacetime() { variation = eVariation::bitruncated; swap(currentmap, map_hyp); pmodel = mdDisk; + pconf.scale = .95; check_cgi(); } @@ -77,11 +81,16 @@ void switch_spacetime() { NLP = Id; Duality = Id; for(int a=0; a<4; a++) for(int b=0; b<4; b++) Duality[a][b] = (a^2) == b; + vid.fov = 150; + vid.grid = false; + slr::range_xy = 2; + slr::range_z = 2; } else if(hybri) { hybrid::switch_to_underlying(); pmodel = mdDisk; + pconf.scale = .95; } cgi.use_count++; }