From 75f58766a268cc325d9f885eb552e6617f855c1c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 5 Jul 2022 11:51:06 +0200 Subject: [PATCH] made background screen darkening consistent and optional --- arbitrile.cpp | 4 ++-- archimedean.cpp | 2 +- asonov.cpp | 2 +- config.cpp | 56 +++++++++++++++++++++++++++++++----------------- control.cpp | 2 +- crystal.cpp | 5 +++-- debug.cpp | 5 +++-- dialogs.cpp | 17 +++++---------- euclid.cpp | 2 +- expansion.cpp | 2 +- geom-exp.cpp | 19 +++++++++------- goldberg.cpp | 2 +- graph.cpp | 35 ++++++++++++++++++++++-------- help.cpp | 4 ++-- history.cpp | 4 ++-- hyperweb.cpp | 3 ++- intra.cpp | 3 ++- inventory.cpp | 4 ++-- irregular.cpp | 2 +- mapeditor.cpp | 6 +++--- menus.cpp | 14 +++++++----- models.cpp | 8 +++---- multi.cpp | 7 +++--- netgen.cpp | 2 +- nonisotropic.cpp | 4 ++-- pattern2.cpp | 8 +++---- pcmove.cpp | 3 ++- quit.cpp | 4 ++-- racing.cpp | 12 ++++++----- raycaster.cpp | 4 ++-- reg3.cpp | 2 +- rug.cpp | 4 ++-- rulegen.cpp | 2 +- savemem.cpp | 2 +- screenshot.cpp | 32 +++++++++++++-------------- surface.cpp | 2 +- textures.cpp | 4 ++-- vr.cpp | 4 ++-- wfcgen.cpp | 2 +- 39 files changed, 170 insertions(+), 129 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index 6b837b10..d66eb97a 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -936,7 +936,7 @@ string primes(int i) { void connection_debugger() { cmode = sm::SIDE | sm::DIALOG_STRICT_X; - gamescreen(0); + gamescreen(); auto& last = debug_polys.back(); @@ -1331,7 +1331,7 @@ EX void sliders_changed(bool need_restart, bool need_start) { EX void set_sliders() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("tessellation sliders")); dialog::addHelp(current.comment); char ch = 'A'; diff --git a/archimedean.cpp b/archimedean.cpp index 5cc92d43..1acebb0a 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -1323,7 +1323,7 @@ EX void show() { } } cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("Archimedean tilings")); if(symbol_editing) { diff --git a/asonov.cpp b/asonov.cpp index 35661db2..91e38d43 100644 --- a/asonov.cpp +++ b/asonov.cpp @@ -226,7 +226,7 @@ EX void prepare_config() { EX void show_config() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("Solv quotient spaces")); dialog::addSelItem(XLAT("%1 period", "X/Y"), its(period_xy_edit), 'x'); diff --git a/config.cpp b/config.cpp index 408f2e52..2634ee74 100644 --- a/config.cpp +++ b/config.cpp @@ -738,6 +738,10 @@ EX void initConfig() { param_enum(vid.graphglyph, "graphglyph", "graphical items/kills", 1) -> editable({{"letters", ""}, {"auto", ""}, {"images", ""}}, "inventory/kill mode", 'd'); + param_i(menu_darkening, "menu_darkening", 2) + -> editable(0, 8, 1, "menu map darkening", "A larger number means darker game map in the background. Set to 8 to disable the background.", 'd') + -> set_sets([] { dialog::bound_low(0); dialog::bound_up(8); dialog::dialogflags |= sm::DARKEN; }); + addsaver(vid.flasheffects, "flasheffects", 1); param_f(vid.binary_width, "bwidth", "binary-tiling-width", 1); @@ -1355,7 +1359,7 @@ EX void edit_sightrange() { #if CAP_RUG USING_NATIVE_GEOMETRY_IN_RUG; #endif - gamescreen(0); + gamescreen(); dialog::init("sight range settings"); add_edit(vid.use_smart_range); if(vid.use_smart_range) @@ -1476,7 +1480,7 @@ EX void menuitem_sightrange(char c IS('c')) { EX void sets_sfx_volume() { #if CAP_AUDIO - dialog::numberdark = dialog::DONT_SHOW; + dialog::dialogflags = sm::NOSCR; #if ISANDROID dialog::reaction = [] () { settingsChanged = true; @@ -1489,7 +1493,7 @@ EX void sets_sfx_volume() { EX void sets_music_volume() { #if CAP_AUDIO - dialog::numberdark = dialog::DONT_SHOW; + dialog::dialogflags = sm::NOSCR; dialog::reaction = [] () { #if CAP_SDLAUDIO Mix_VolumeMusic(musicvolume); @@ -1510,7 +1514,7 @@ EX void sets_music_volume() { EX void showSpecialEffects() { cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("extra graphical effects")); dialog::addBoolItem_action(XLAT("particles on attack"), (vid.particles), 'p'); @@ -1526,7 +1530,7 @@ EX void showSpecialEffects() { EX void show_vector_settings() { cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("vector settings")); dialog::addSelItem(XLAT("line width"), fts(vid.linewidth), 'w'); @@ -1575,7 +1579,7 @@ EX void show_vector_settings() { EX void showGraphConfig() { cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("graphics configuration")); @@ -1755,7 +1759,8 @@ EX void edit_whatever(char type, int index) { } EX void configureOther() { - gamescreen(3); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("other settings")); @@ -1793,7 +1798,8 @@ EX void configureOther() { } EX void configureInterface() { - gamescreen(3); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("interface")); #if CAP_TRANS @@ -1838,6 +1844,8 @@ EX void configureInterface() { dialog::add_action([] { dialog::openColorDialog(crosshair_color); }); }; }); + + add_edit(menu_darkening); dialog::addBreak(50); dialog::addBack(); @@ -1847,7 +1855,8 @@ EX void configureInterface() { #if CAP_SDLJOY EX void showJoyConfig() { - gamescreen(4); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("joystick configuration")); @@ -2018,7 +2027,7 @@ bool supported_ods() { EX void showStereo() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("stereo vision config")); add_edit(vid.stereo_mode); @@ -2137,7 +2146,7 @@ EX void edit_levellines(char c) { EX void show3D() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("3D configuration")); if(GDIM == 2) { @@ -2479,7 +2488,8 @@ EX void showCustomizeChar() { cc_footphase += hypot(mousex - lmousex, mousey - lmousey); lmousex = mousex; lmousey = mousey; - gamescreen(4); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("Customize character")); if(shmup::on || multi::players) multi::cpid = multi::cpid_edit % multi::players; @@ -2562,7 +2572,7 @@ EX void refresh_canvas() { EX void edit_color_table(colortable& ct, const reaction_t& r IS(reaction_t()), bool has_bit IS(false)) { cmode = sm::SIDE; - gamescreen(0); + gamescreen(); dialog::init(XLAT("colors & aura")); for(int i=0; i void add_edit(T& val) { #endif EX void find_setting() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("find a setting")); if(dialog::infix != "") mouseovers = dialog::infix; @@ -2903,7 +2916,8 @@ EX void find_setting() { } EX void edit_all_settings() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("recently changed settings")); for(auto &fs: params) fs.second->check_change(); @@ -2925,7 +2939,8 @@ void list_setting::show_edit_option(char key) { dialog::addSelItem(XLAT(menu_item_name), XLAT(opt), key); dialog::add_action_push([this] { add_to_changed(this); - gamescreen(2); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT(menu_item_name)); dialog::addBreak(100); int q = isize(options); @@ -2945,7 +2960,8 @@ void list_setting::show_edit_option(char key) { } EX void showSettings() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("settings")); dialog::addItem(XLAT("interface"), 'i'); diff --git a/control.cpp b/control.cpp index 5a4d85a7..91857771 100644 --- a/control.cpp +++ b/control.cpp @@ -1405,7 +1405,7 @@ void delayed_reset() { EX void show() { #if CAP_ORIENTATION cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("scrolling by device rotation")); diff --git a/crystal.cpp b/crystal.cpp index 7c164751..a81c9bdb 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -1443,7 +1443,8 @@ string make_help() { } EX void crystal_knight_help() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(); dialog::addHelp(XLAT( @@ -1467,7 +1468,7 @@ EX void crystal_knight_help() { EX void show() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("dimensional crystal")); for(int i=5; i<=14; i++) { string s; diff --git a/debug.cpp b/debug.cpp index 4fa0ec56..a5f66f39 100644 --- a/debug.cpp +++ b/debug.cpp @@ -293,7 +293,7 @@ struct debugScreen { void operator () () { cmode = sm::SIDE | sm::DIALOG_STRICT_X; - gamescreen(0); + gamescreen(); getcstat = '-'; dialog::init(show_debug_data ? XLAT("debug values") : XLAT("internal details")); @@ -468,7 +468,8 @@ EX void push_debug_screen() { /** show the cheat menu */ EX void showCheatMenu() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init("cheat menu"); for(auto& ch: cheats) { dialog::addItem(XLAT(ch.desc), ch.key); diff --git a/dialogs.cpp b/dialogs.cpp index 853857e4..0b212cad 100644 --- a/dialogs.cpp +++ b/dialogs.cpp @@ -683,7 +683,7 @@ EX namespace dialog { EX void drawColorDialog() { cmode = sm::NUMBER | dialogflags; - if(cmode & sm::SIDE) gamescreen(0); + if(cmode & sm::SIDE) gamescreen(); else emptyscreen(); dcenter = vid.xres/2; @@ -827,8 +827,6 @@ EX namespace dialog { }; } - EX int numberdark; - EX void formula_keyboard(bool lr) { addKeyboardItem("1234567890"); addKeyboardItem("=+-*/^()\x3"); @@ -891,9 +889,7 @@ EX namespace dialog { EX void drawNumberDialog() { cmode = sm::NUMBER | dialogflags; - if(numberdark < DONT_SHOW) - gamescreen(numberdark); - else emptyscreen(); + gamescreen(); init(ne.title); addInfo(ne.s); if(ne.intval && ne.sc.direct == &identity_f) @@ -1057,7 +1053,6 @@ EX namespace dialog { reaction = reaction_t(); reaction_final = reaction_t(); extra_options = reaction_t(); - numberdark = 0; ne.animatable = true; #if CAP_ANIMATIONS anims::get_parameter_animation(x, ne.s); @@ -1297,9 +1292,7 @@ EX namespace dialog { EX void string_edit_dialog() { cmode = sm::NUMBER | dialogflags; - if(numberdark < DONT_SHOW) - gamescreen(numberdark); - else emptyscreen(); + gamescreen(); init(ne.title); addInfo(view_edited_string()); addBreak(100); @@ -1336,11 +1329,11 @@ EX namespace dialog { pushScreen(string_edit_dialog); reaction = reaction_t(); extra_options = reaction_t(); - numberdark = 0; } EX void confirm_dialog(const string& text, const reaction_t& act) { - gamescreen(1); + cmode = sm::DARKEN; + gamescreen(); dialog::addBreak(250); dialog::init(XLAT("WARNING"), 0xFF0000, 150, 100); dialog::addHelp(text); diff --git a/euclid.cpp b/euclid.cpp index 4db630b0..e10fe406 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -882,7 +882,7 @@ EX namespace euc { auto& T_edit = eu_edit.user_axes; auto& twisted_edit = eu_edit.twisted; cmode = sm::SIDE | sm::MAYDARK | sm::TORUSCONFIG; - gamescreen(1); + gamescreen(); dialog::init(XLAT("Euclidean quotient spaces")); for(int y=0; y available_filters = { &gf_hyperbolic, &gf_spherical, void ge_select_filter() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(2); + gamescreen(); dialog::init(XLAT("geometries")); @@ -365,7 +367,7 @@ bool same_tiling(eGeometry g2) { void ge_select_tiling() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); if(!current_filter) { popScreen(); return; } dialog::init(); @@ -447,7 +449,8 @@ EX string dim_name() { EX void showQuotientConfig3() { using namespace fieldpattern; - gamescreen(2); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("field quotient")); auto& ds = discoveries[cginf.tiling_name]; @@ -546,7 +549,7 @@ EX string geometry_name() { EX void select_quotient_screen() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("quotient spaces in ") + ginf[geometry].tiling_name); char key = 'a'; @@ -932,7 +935,7 @@ EX void showEuclideanMenu() { // for(int i=2; isidescreen && !inHighQual) { - _darken += 2; + darken = 0; + + if(!inHighQual && !vrhr::active()) { + if((cmode & sm::MAYDARK) && !current_display->sidescreen) + darken += menu_darkening; + else if(cmode & sm::DARKEN) + darken += menu_darkening; + } + if(vid.highlightmode == (hiliteclick ? 0 : 2)) + darken++; + if(darken >= 8) { + emptyscreen(); + return; } - darken = _darken; - if(vrhr::active()) darken = 0; - if(history::includeHistory) history::restore(); anims::apply(); @@ -5434,7 +5449,7 @@ EX void normalscreen() { if(GDIM == 3 || !outofmap(mouseh.h)) getcstat = '-'; cmode = sm::NORMAL | sm::DOTOUR | sm::CENTER; if(viewdists && show_distance_lists) cmode |= sm::SIDE | sm::MAYDARK; - gamescreen((vid.highlightmode == (hiliteclick ? 0 : 2)) ? 1 : 0); drawStats(); + gamescreen(); drawStats(); if(nomenukey || ISMOBILE) ; #if CAP_TOUR @@ -5491,6 +5506,8 @@ namespace sm { static const int VR_MENU = (1<<18); // always show the menu in VR static const int SHOWCURSOR = (1<<19); // despite MAP/DRAW always show the cursor, no panning static const int PANNING = (1<<20); // smooth scrolling works + static const int DARKEN = (1<<21); // darken the game background + static const int NOSCR = (1<<22); // do not show the game background } #endif diff --git a/help.cpp b/help.cpp index 8c63bb15..cfe8bb7b 100644 --- a/help.cpp +++ b/help.cpp @@ -1072,14 +1072,14 @@ EX void describeMouseover() { } EX void showHelp() { - cmode = sm::HELP | sm::DOTOUR; + cmode = sm::HELP | sm::DOTOUR | sm::DARKEN; getcstat = SDLK_ESCAPE; if(help == "HELPFUN") { help_delegate(); return; } - gamescreen(2); + gamescreen(); string help2; if(help[0] == '@') { int iv = help.find("\t"); diff --git a/history.cpp b/history.cpp index 4ffa3bb8..238d8d9f 100644 --- a/history.cpp +++ b/history.cpp @@ -190,7 +190,7 @@ EX namespace history { int lastprogress; EX void progress_screen() { - gamescreen(0); + gamescreen(); mouseovers = ""; } @@ -570,7 +570,7 @@ EX namespace history { EX void history_menu() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("history mode")); diff --git a/hyperweb.cpp b/hyperweb.cpp index a5cc0b6c..5352fc2e 100644 --- a/hyperweb.cpp +++ b/hyperweb.cpp @@ -136,7 +136,8 @@ void toggleanim(bool v) { } void showDemo() { - gamescreen(2); + cmode = sm::DARKEN; + gamescreen(); getcstat = ' '; diff --git a/intra.cpp b/intra.cpp index 900d5342..70e836a4 100644 --- a/intra.cpp +++ b/intra.cpp @@ -644,7 +644,8 @@ void erase_unconnected(cellwalker cw) { int edit_spin; EX void show_portals() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("manage portals")); diff --git a/inventory.cpp b/inventory.cpp index 32c31ffb..1f0c116d 100644 --- a/inventory.cpp +++ b/inventory.cpp @@ -490,10 +490,10 @@ EX namespace inv { if(remaining[itOrbSword]) items[itOrbSword]++; if(remaining[itOrbSword2]) items[itOrbSword2]++; - gamescreen(2); + cmode = sm::CENTER | sm::DARKEN; + gamescreen(); if(remaining[itOrbSword]) items[itOrbSword]--; if(remaining[itOrbSword2]) items[itOrbSword2]--; - cmode = sm::CENTER; orbcoord.clear(); for(int y=-3; y<=3; y++) for(int x=-5; x<=5; x++) if(x+y<=6 && x+y >= -6 && (x||y)) diff --git a/irregular.cpp b/irregular.cpp index b7b1dc8a..1f8b7f62 100644 --- a/irregular.cpp +++ b/irregular.cpp @@ -868,7 +868,7 @@ bool too_small_euclidean() { void show_gridmaker() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("irregular grid")); dialog::addSelItem(XLAT("density"), fts(density), 'd'); dialog::add_action([] { diff --git a/mapeditor.cpp b/mapeditor.cpp index bd909215..44c65867 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1361,7 +1361,7 @@ EX namespace mapeditor { EX void showMapEditor() { cmode = sm::MAP | sm::PANNING; - gamescreen(0); + gamescreen(); int fs = editor_fsize(); @@ -2042,7 +2042,7 @@ EX namespace mapeditor { EX void showDrawEditor() { #if CAP_POLY cmode = sm::DRAW | sm::PANNING; - gamescreen(0); + gamescreen(); drawGrid(); if(callhandlers(false, hooks_prestats)) return; @@ -3159,7 +3159,7 @@ EX namespace mapeditor { EX void map_settings() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("Map settings")); diff --git a/menus.cpp b/menus.cpp index cd670ec4..57e53970 100644 --- a/menus.cpp +++ b/menus.cpp @@ -221,7 +221,7 @@ EX const char *hlmodes[3] = {"press Alt", "highlight", "super-highlight"}; EX void showGraphQuickKeys() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("quick options")); @@ -309,7 +309,7 @@ EX void switch_casual() { EX void showCreative() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(3); + gamescreen(); dialog::init(XLAT("creative mode")); #if CAP_EDIT @@ -382,7 +382,8 @@ EX void showCreative() { } EX void show_chaos() { - gamescreen(3); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("land structure")); chaosUnlocked = chaosUnlocked || autocheat; @@ -439,7 +440,8 @@ EX void show_chaos() { } EX void mode_higlights() { - gamescreen(3); + cmode = sm::NOSCR; + gamescreen(); dialog::init(XLAT("highlights & achievements")); dialog::addBigItem(XLATN("Space Rocks"), 'r'); @@ -623,7 +625,8 @@ EX void menuitem_land_structure(char key) { } EX void showChangeMode() { - gamescreen(3); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("special modes")); dialog::addBoolItem(XLAT("experiment with geometry"), geometry || CHANGED_VARIATION || viewdists, 'e'); @@ -752,6 +755,7 @@ EX void showStartMenu() { getcstat = ' '; #if CAP_STARTANIM + cmode = sm::DARKEN; startanims::display(); #endif diff --git a/models.cpp b/models.cpp index b0e79c13..41c94e9e 100644 --- a/models.cpp +++ b/models.cpp @@ -361,7 +361,7 @@ EX namespace models { EX void model_list() { cmode = sm::SIDE | sm::MAYDARK | sm::CENTER; - gamescreen(0); + gamescreen(); dialog::init(XLAT("models & projections")); #if CAP_RUG USING_NATIVE_GEOMETRY_IN_RUG; @@ -417,7 +417,7 @@ EX namespace models { EX void model_menu() { cmode = sm::SIDE | sm::MAYDARK | sm::CENTER; - gamescreen(0); + gamescreen(); #if CAP_RUG USING_NATIVE_GEOMETRY_IN_RUG; #endif @@ -704,8 +704,8 @@ EX namespace models { } EX void quick_model() { - cmode = sm::CENTER; - gamescreen(1); + cmode = sm::CENTER | sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init("models & projections"); if(GDIM == 2 && !euclid) { diff --git a/multi.cpp b/multi.cpp index 85a1b904..7bad90a4 100644 --- a/multi.cpp +++ b/multi.cpp @@ -393,8 +393,8 @@ struct shmup_configurer { void operator()() { #if CAP_SDL - cmode = sm::SHMUPCONFIG; - gamescreen(3); + cmode = sm::SHMUPCONFIG | sm::SIDE | sm::DARKEN; + gamescreen(); dialog::init(XLAT("keyboard & joysticks")); bool haveconfig = shmup::on || players > 1 || multi::alwaysuse; @@ -503,7 +503,8 @@ EX void configure() { } EX void showConfigureMultiplayer() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init("multiplayer"); for(int i=1; i <= MAXPLAYER; i++) { diff --git a/netgen.cpp b/netgen.cpp index da047f90..b51fa664 100644 --- a/netgen.cpp +++ b/netgen.cpp @@ -699,7 +699,7 @@ EX namespace netgen { void show() { cmode = sm::SIDE; - gamescreen(0); + gamescreen(); if(true) { initquickqueue(); for(int i=0; i dc(displaycodes, whichPattern); - gamescreen(0); + gamescreen(); } dialog::init(); @@ -2466,7 +2466,7 @@ EX namespace patterns { cmode = sm::SIDE | sm::MAYDARK; { dynamicval dc(displaycodes, true); - gamescreen(0); + gamescreen(); } dialog::init(); for(int i=0; i landmap; @@ -959,7 +959,7 @@ void track_chooser(bool official) { void race_projection() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("racing projections")); @@ -1065,7 +1065,8 @@ void race_projection() { #if MAXMDIM >= 4 EX void thurston_racing() { - gamescreen(1); + cmode = sm::NOSCR; + gamescreen(); dialog::init(XLAT("racing in Thurston geometries")); dialog::addBreak(100); @@ -1119,7 +1120,8 @@ void race_projection() { void raceconfigurer() { - gamescreen(1); + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); dialog::init(XLAT("Racing")); diff --git a/raycaster.cpp b/raycaster.cpp index fe4850da..5a87742a 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -2745,7 +2745,7 @@ EX void random_fog() { EX void menu() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("volumetric raycasting")); if(!cheater) { @@ -2797,7 +2797,7 @@ EX } EX void configure() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("raycasting configuration")); dialog::addBoolItem(XLAT("available in current geometry"), available(), 0); diff --git a/reg3.cpp b/reg3.cpp index 66100bbd..ec16ad81 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -2507,7 +2507,7 @@ int target_subcube_count; EX void edit_variation() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("variations")); dialog::addBoolItem(XLAT("pure"), target_variation == eVariation::pure, 'p'); diff --git a/rug.cpp b/rug.cpp index af8cc4cc..c7af552f 100644 --- a/rug.cpp +++ b/rug.cpp @@ -1511,7 +1511,7 @@ ld old_distance; EX void rug_geometry_choice() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100); USING_NATIVE_GEOMETRY; @@ -1540,7 +1540,7 @@ EX void rug_geometry_choice() { EX void show() { cmode = sm::SIDE | sm::MAYDARK | sm::PANNING; - gamescreen(0); + gamescreen(); dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100); dialog::addBoolItem(XLAT("enable the Hypersian Rug mode"), rug::rugged, 'u'); diff --git a/rulegen.cpp b/rulegen.cpp index ed8a764b..c438c519 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -2437,7 +2437,7 @@ EX void verify_parsed_treestates(arb::arbi_tiling& c) { EX void show() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("strict tree maps")); dialog::addHelp(XLAT( diff --git a/savemem.cpp b/savemem.cpp index 7bf9e74c..bc806516 100644 --- a/savemem.cpp +++ b/savemem.cpp @@ -231,7 +231,7 @@ EX void memory_for_lib() { } EX void show_memory_menu() { - gamescreen(0); + gamescreen(); dialog::init(XLAT("memory")); dialog::addHelp(XLAT( diff --git a/screenshot.cpp b/screenshot.cpp index bf46c407..d370fb2e 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -670,7 +670,7 @@ EX int shot_aa = 1; EX void default_screenshot_content() { - gamescreen(0); + gamescreen(); if(caption != "") displayfr(vid.xres/2, vid.fsize+vid.fsize/4, 3, vid.fsize*2, caption, forecolor, 8); @@ -934,7 +934,7 @@ EX string format_extension() { EX void choose_screenshot_format() { cmode = sm::SIDE; - gamescreen(0); + gamescreen(); dialog::init(XLAT("screenshots"), iinf[itPalace].color, 150, 100); #if CAP_PNG dialog::addItem(XLAT("PNG"), 'p'); @@ -954,7 +954,7 @@ EX void choose_screenshot_format() { EX void menu() { cmode = sm::SIDE; - gamescreen(0); + gamescreen(); if(format == screenshot_format::svg && !CAP_SVG) format = screenshot_format::png; if(format == screenshot_format::png && !CAP_PNG) @@ -1530,7 +1530,7 @@ EX void rug_angle_options() { EX void show() { cmode = sm::SIDE; needs_highqual = false; animation_lcm = 1; - gamescreen(0); + gamescreen(); animation_period = 2 * M_PI * animation_lcm / animation_factor; dialog::init(XLAT("animations"), iinf[itPalace].color, 150, 100); dialog::addSelItem(XLAT("period"), fts(period)+ " ms", 'p'); @@ -1905,7 +1905,7 @@ void explorable(reaction_t ee) { void no_init() { } -startanim null_animation { "", no_init, [] { gamescreen(2); }}; +startanim null_animation { "", no_init, [] { gamescreen(); }}; #if CAP_STARTANIM startanim joukowsky { "Joukowsky transform", no_init, [] { @@ -1915,7 +1915,7 @@ startanim joukowsky { "Joukowsky transform", no_init, [] { dynamicval ds(pconf.scale, 1/4.); models::configure(); dynamicval dc(ringcolor, 0); - gamescreen(2); + gamescreen(); explorable([] { pmodel = mdJoukowskyInverted; pushScreen(models::model_menu); }); }}; @@ -1924,7 +1924,7 @@ startanim bandspin { "spinning in the band model", no_init, [] { dynamicval dt(pconf.model_orientation, ticks / 25.); dynamicval dv(vid.use_smart_range, 2); models::configure(); - gamescreen(2); + gamescreen(); explorable([] { pmodel = mdJoukowskyInverted; pushScreen(models::model_menu); }); }}; @@ -1937,7 +1937,7 @@ startanim perspective { "projection distance", no_init, [] { dynamicval da(pconf.alpha, x); dynamicval ds(pconf.scale, (1+x)/2); calcparam(); - gamescreen(2); + gamescreen(); explorable(projectionDialog); }}; @@ -1953,7 +1953,7 @@ startanim rug { "Hypersian Rug", [] { dynamicval b(rug::rugged, true); rug::physics(); dynamicval t(rug::rugView, cspin(1, 2, ticks / 3000.) * rug::rugView); - gamescreen(2); + gamescreen(); if(!rug::rugged) current = &null_animation; explorable([] { rug::rugged = true; pushScreen(rug::show); }); #endif @@ -1965,7 +1965,7 @@ startanim spin_around { "spinning around", no_init, [] { ld alpha = 2 * M_PI * ticks / 10000.; ld circle_radius = acosh(2.); dynamicval dv(View, spin(-cos_auto(circle_radius)*alpha) * xpush(circle_radius) * spin(alpha) * View); - gamescreen(2); + gamescreen(); }}; #endif @@ -1995,7 +1995,7 @@ startanim row_of_ghosts { "row of ghosts", no_init, [] { } }); dynamicval rd(mapeditor::drawplayer, false); - gamescreen(2); + gamescreen(); }}; startanim army_of_ghosts { "army of ghosts", no_init, [] { @@ -2020,7 +2020,7 @@ startanim army_of_ghosts { "army of ghosts", no_init, [] { } } }); - gamescreen(2); + gamescreen(); }}; startanim ghost_spiral { "ghost spiral", no_init, [] { @@ -2030,7 +2030,7 @@ startanim ghost_spiral { "ghost spiral", no_init, [] { draw_ghost(spin(t * i * 2 * M_PI) * xpush(asinh(15. / i)) * spin(M_PI/2), 1); } }); - gamescreen(2); + gamescreen(); }}; startanim fib_ghosts { "Fibonacci ghosts", no_init, [] { @@ -2047,14 +2047,14 @@ startanim fib_ghosts { "Fibonacci ghosts", no_init, [] { draw_ghost(T, i); } }); - gamescreen(2); + gamescreen(); }}; startanim fpp { "first-person perspective", no_init, [] { if(MAXMDIM == 3) { current = &null_animation; return; } geom3::switch_fpp(); View = cspin(0, 2, ticks / 5000.) * View; - gamescreen(2); + gamescreen(); View = cspin(0, 2, -ticks / 5000.) * View; geom3::switch_fpp(); }}; @@ -2066,7 +2066,7 @@ startanim fpp { "first-person perspective", no_init, [] { EX startanim *current = &null_animation; EX void pick() { - if(((gold() > 0 || tkills() > 0) && canmove) || geometry != gNormal || ISWEB || ISMOBILE || vid.always3 || pmodel || rug::rugged || vid.wallmode < 2 || vid.monmode < 2 || glhr::noshaders || !vid.usingGL) { + if(((gold() > 0 || tkills() > 0) && canmove) || geometry != gNormal || ISWEB || ISMOBILE || vid.always3 || pmodel || rug::rugged || vid.wallmode < 2 || vid.monmode < 2 || glhr::noshaders || !vid.usingGL || !enabled) { current = &null_animation; return; } diff --git a/surface.cpp b/surface.cpp index 0047bcfb..2bca9180 100644 --- a/surface.cpp +++ b/surface.cpp @@ -676,7 +676,7 @@ transmatrix coverage_matrix; EX void show_surfaces() { cmode = sm::SIDE; - gamescreen(0); + gamescreen(); dialog::init(XLAT("constant curvature surfaces"), iinf[itPalace].color, 150, 0); bool b = rug::rugged || coverage_style; diff --git a/textures.cpp b/textures.cpp index 527abda0..5a747348 100644 --- a/textures.cpp +++ b/textures.cpp @@ -1168,7 +1168,7 @@ bool texture_config::load() { void showMagicMenu() { cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; - gamescreen(0); + gamescreen(); dialog::init(XLAT("texture auto-adjustment")); @@ -1270,7 +1270,7 @@ EX void start_editor() { EX void showMenu() { cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; - gamescreen(0); + gamescreen(); if(config.tstate == tsAdjusting) { ptds.clear(); config.mark_triangles(); diff --git a/vr.cpp b/vr.cpp index db620736..0ae46b8e 100644 --- a/vr.cpp +++ b/vr.cpp @@ -1153,7 +1153,7 @@ EX void render() { EX void show_vr_demos() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("VR demos")); dialog::addInfo(XLAT("warning: these will restart your game!")); @@ -1325,7 +1325,7 @@ EX void reference_button() { EX void show_vr_settings() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); + gamescreen(); dialog::init(XLAT("VR settings")); dialog::addItem(XLAT("VR demos"), 'D'); diff --git a/wfcgen.cpp b/wfcgen.cpp index eb7041c0..8a7ea162 100644 --- a/wfcgen.cpp +++ b/wfcgen.cpp @@ -241,7 +241,7 @@ void use_probs() { EX void wfc_menu() { cmode = sm::SIDE | sm::MAYDARK; - gamescreen(1); + gamescreen(); dialog::init(XLAT("Wave Function Collapse")); dialog::addSelItem(XLAT("import the current map"), XLAT("rules: %1", its(isize(probs))), 'i');