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

2d3d:: remove 3D options from the menu if not available

This commit is contained in:
Zeno Rogue 2019-05-11 08:19:38 +02:00
parent eb822f195b
commit 0dc552bac4
2 changed files with 14 additions and 3 deletions

View File

@ -1230,11 +1230,12 @@ void show3D() {
using namespace geom3;
dialog::init(XLAT("3D configuration"));
#if MAXMDIM >= 4
if(WDIM == 2) {
dialog::addBoolItem(XLAT("use the full 3D models"), geom3::always3, 'U');
dialog::add_action(geom3::switch_always3);
}
#endif
if(vid.use_smart_range == 0 && DIM == 2) {
dialog::addSelItem(XLAT("High detail range"), fts(highdetail), 'n');
dialog::addSelItem(XLAT("Mid detail range"), fts(middetail), 'm');
@ -1308,10 +1309,12 @@ void show3D() {
dialog::add_action(geom3::switch_tpp);
}
#if MAXMDIM >=4
if(WDIM == 2) {
dialog::addBoolItem(XLAT("configure FPP automatically"), DIM == 3, 'F');
dialog::add_action(geom3::switch_fpp);
}
#endif
if(0);
#if CAP_RUG
@ -1917,18 +1920,22 @@ int read_config_args() {
PHASEFROM(2);
nomenukey = true;
}
#if MAXMDIM >= 4
else if(argis("-switch-fpp")) {
PHASEFROM(2);
geom3::switch_fpp();
}
#endif
else if(argis("-switch-tpp")) {
PHASEFROM(2);
geom3::switch_tpp();
}
#if MAXMDIM >= 4
else if(argis("-switch-3d")) {
PHASEFROM(2);
geom3::switch_always3();
}
#endif
else if(argis("-nohelp")) {
PHASEFROM(2);
nohelp = true;

View File

@ -384,12 +384,14 @@ namespace geom3 {
}
}
void switch_always3() {
#if MAXMDIM >= 4
void switch_always3() {
geom3::always3 = !geom3::always3;
need_reset_geometry = true;
swapmatrix(View);
callhooks(hooks_swapdim);
}
#endif
void switch_tpp() {
if(pmodel == mdDisk && vid.camera_angle) {
@ -412,6 +414,7 @@ namespace geom3 {
}
void switch_fpp() {
#if MAXMDIM >= 4
if(!geom3::always3) {
geom3::always3 = true;
geom3::wall_height = 1.5;
@ -437,7 +440,8 @@ namespace geom3 {
swapmatrix(View);
callhooks(hooks_swapdim);
}
}
#endif
}
}