mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-19 20:40:10 +00:00
added some missing CAP_ guards
This commit is contained in:
parent
53483005cf
commit
d108f27dcf
@ -2277,6 +2277,7 @@ EX void display_embedded_errors() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(meuclid && spatial_embedding == seProductS) {
|
if(meuclid && spatial_embedding == seProductS) {
|
||||||
|
#if CAP_RUG
|
||||||
rug::clifford_torus ct;
|
rug::clifford_torus ct;
|
||||||
bool err = sqhypot_d(2, ct.xh) < 1e-3 && sqhypot_d(2, ct.yh) < 1e-3;
|
bool err = sqhypot_d(2, ct.xh) < 1e-3 && sqhypot_d(2, ct.yh) < 1e-3;
|
||||||
if(err) {
|
if(err) {
|
||||||
@ -2290,6 +2291,9 @@ EX void display_embedded_errors() {
|
|||||||
geom3::apply_settings_full(); start_game(); }); });
|
geom3::apply_settings_full(); start_game(); }); });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
dialog::addInfo(XLAT("error: not supported"), 0xC00000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(msphere && !among(spatial_embedding, seNone, seDefault, seLowerCurvature, seMuchLowerCurvature, seProduct, seProductS)) {
|
if(msphere && !among(spatial_embedding, seNone, seDefault, seLowerCurvature, seMuchLowerCurvature, seProduct, seProductS)) {
|
||||||
dialog::addInfo(XLAT("error: this method does not work in spherical geometry"), 0xC00000);
|
dialog::addInfo(XLAT("error: this method does not work in spherical geometry"), 0xC00000);
|
||||||
@ -2330,6 +2334,7 @@ EX void show_spatial_embedding() {
|
|||||||
if(emb == geom3::seNone) {
|
if(emb == geom3::seNone) {
|
||||||
dialog::addBoolItem(XLAT("third-person perspective"), in_tpp(), 'T');
|
dialog::addBoolItem(XLAT("third-person perspective"), in_tpp(), 'T');
|
||||||
dialog::add_action(geom3::switch_tpp);
|
dialog::add_action(geom3::switch_tpp);
|
||||||
|
#if CAP_RUG
|
||||||
dialog::addBoolItem(XLAT("Hypersian Rug"), rug::rugged, 'u');
|
dialog::addBoolItem(XLAT("Hypersian Rug"), rug::rugged, 'u');
|
||||||
dialog::add_action([] {
|
dialog::add_action([] {
|
||||||
if(in_tpp()) geom3::switch_tpp();
|
if(in_tpp()) geom3::switch_tpp();
|
||||||
@ -2338,6 +2343,7 @@ EX void show_spatial_embedding() {
|
|||||||
}
|
}
|
||||||
else rug::close();
|
else rug::close();
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2463,10 +2469,12 @@ EX void show3D() {
|
|||||||
dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M');
|
dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M');
|
||||||
dialog::add_action_push(models::model_menu);
|
dialog::add_action_push(models::model_menu);
|
||||||
}
|
}
|
||||||
|
#if CAP_RUG
|
||||||
if(GDIM == 2) {
|
if(GDIM == 2) {
|
||||||
dialog::addItem(XLAT("configure Hypersian Rug"), 'u');
|
dialog::addItem(XLAT("configure Hypersian Rug"), 'u');
|
||||||
dialog::add_action_push(rug::show);
|
dialog::add_action_push(rug::show);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MAXMDIM >= 4
|
#if MAXMDIM >= 4
|
||||||
if(GDIM == 3) add_edit_fov('f');
|
if(GDIM == 3) add_edit_fov('f');
|
||||||
|
@ -68,9 +68,13 @@ EX namespace geom3 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
EX bool clifford_torus_valid() {
|
EX bool clifford_torus_valid() {
|
||||||
|
#if CAP_RUG
|
||||||
rug::clifford_torus ct;
|
rug::clifford_torus ct;
|
||||||
ld h = ct.xh | ct.yh;
|
ld h = ct.xh | ct.yh;
|
||||||
return !(sqhypot_d(2, ct.xh) < 1e-3 || sqhypot_d(2, ct.yh) < 1e-3 || abs(h) > 1e-3);
|
return !(sqhypot_d(2, ct.xh) < 1e-3 || sqhypot_d(2, ct.yh) < 1e-3 || abs(h) > 1e-3);
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX string why_wrong(eSpatialEmbedding sp) {
|
EX string why_wrong(eSpatialEmbedding sp) {
|
||||||
@ -198,6 +202,7 @@ EX namespace geom3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EX void configure_clifford_torus() {
|
EX void configure_clifford_torus() {
|
||||||
|
#if CAP_RUG
|
||||||
dynamicval<ld> dtessf(cgi.tessf, 1);
|
dynamicval<ld> dtessf(cgi.tessf, 1);
|
||||||
rug::clifford_torus ct;
|
rug::clifford_torus ct;
|
||||||
|
|
||||||
@ -220,9 +225,11 @@ EX namespace geom3 {
|
|||||||
vid.depth = alpha - 1;
|
vid.depth = alpha - 1;
|
||||||
vid.wall_height = min(1 / euclid_embed_scale_mean(), (90._deg - alpha) * 0.9);
|
vid.wall_height = min(1 / euclid_embed_scale_mean(), (90._deg - alpha) * 0.9);
|
||||||
vid.eye = vid.wall_height / 2 - vid.depth;
|
vid.eye = vid.wall_height / 2 - vid.depth;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void configure_cylinder() {
|
EX void configure_cylinder() {
|
||||||
|
#if CAP_RUG
|
||||||
dynamicval<ld> dtessf(cgi.tessf, 1);
|
dynamicval<ld> dtessf(cgi.tessf, 1);
|
||||||
rug::clifford_torus ct;
|
rug::clifford_torus ct;
|
||||||
hyperpoint vec;
|
hyperpoint vec;
|
||||||
@ -233,6 +240,7 @@ EX namespace geom3 {
|
|||||||
euclid_embed_scale = TAU / hypot_d(2, vec);
|
euclid_embed_scale = TAU / hypot_d(2, vec);
|
||||||
euclid_embed_scale_y = 1;
|
euclid_embed_scale_y = 1;
|
||||||
euclid_embed_rotate = atan2(vec[1], vec[0]) / degree;
|
euclid_embed_rotate = atan2(vec[1], vec[0]) / degree;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX }
|
EX }
|
||||||
@ -425,22 +433,26 @@ struct emb_none : embedding_method {
|
|||||||
struct emb_actual : embedding_method {
|
struct emb_actual : embedding_method {
|
||||||
|
|
||||||
hyperpoint base_to_logical(hyperpoint h) override {
|
hyperpoint base_to_logical(hyperpoint h) override {
|
||||||
|
#if CAP_BT
|
||||||
if(bt::in()) {
|
if(bt::in()) {
|
||||||
auto h1 = bt::inverse_horopoint(h);
|
auto h1 = bt::inverse_horopoint(h);
|
||||||
h1[2] = 0; h1[3] = 1;
|
h1[2] = 0; h1[3] = 1;
|
||||||
return h1;
|
return h1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
h /= h[2];
|
h /= h[2];
|
||||||
h[2] = 0; h[3] = 1;
|
h[2] = 0; h[3] = 1;
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
hyperpoint logical_to_base(hyperpoint h) override {
|
hyperpoint logical_to_base(hyperpoint h) override {
|
||||||
|
#if CAP_BT
|
||||||
if(bt::in()) {
|
if(bt::in()) {
|
||||||
auto h1 = bt::get_horopoint(h);
|
auto h1 = bt::get_horopoint(h);
|
||||||
h1[3] = 1;
|
h1[3] = 1;
|
||||||
return h1;
|
return h1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
h[2] = 1; h = normalize(h);
|
h[2] = 1; h = normalize(h);
|
||||||
h[3] = 1;
|
h[3] = 1;
|
||||||
return h;
|
return h;
|
||||||
|
@ -694,6 +694,7 @@ EX void world_list() {
|
|||||||
switch_to(c);
|
switch_to(c);
|
||||||
dialog::end_list();
|
dialog::end_list();
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
|
#if CAP_EDIT
|
||||||
dialog::addItem("add a saved world to the scene", 'a');
|
dialog::addItem("add a saved world to the scene", 'a');
|
||||||
dialog::add_action([] {
|
dialog::add_action([] {
|
||||||
dialog::openFileDialog(levelfile, XLAT("level to load:"), ".lev", [] () {
|
dialog::openFileDialog(levelfile, XLAT("level to load:"), ".lev", [] () {
|
||||||
@ -713,6 +714,7 @@ EX void world_list() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
dialog::addBack();
|
dialog::addBack();
|
||||||
dialog::display();
|
dialog::display();
|
||||||
}
|
}
|
||||||
|
2
sky.cpp
2
sky.cpp
@ -532,7 +532,9 @@ EX struct renderbuffer *airbuf;
|
|||||||
EX void swap_if_missing(bool missing) {
|
EX void swap_if_missing(bool missing) {
|
||||||
if(!missing) return;
|
if(!missing) return;
|
||||||
arb::swap_vertices();
|
arb::swap_vertices();
|
||||||
|
#if CAP_IRR
|
||||||
irr::swap_vertices();
|
irr::swap_vertices();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void make_air() {
|
EX void make_air() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user