mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
added some missing CAP_SOLV guards
This commit is contained in:
parent
90baab83eb
commit
8833251c8b
2
cell.cpp
2
cell.cpp
@ -913,7 +913,9 @@ EX int heptdistance(heptagon *h1, heptagon *h2) {
|
|||||||
#if CAP_CRYSTAL
|
#if CAP_CRYSTAL
|
||||||
if(cryst) return crystal::space_distance(h1->c7, h2->c7);
|
if(cryst) return crystal::space_distance(h1->c7, h2->c7);
|
||||||
#endif
|
#endif
|
||||||
|
#if CAP_SOLV
|
||||||
if(sol) return solv::approx_distance(h1, h2);
|
if(sol) return solv::approx_distance(h1, h2);
|
||||||
|
#endif
|
||||||
while(true) {
|
while(true) {
|
||||||
if(h1 == h2) return d;
|
if(h1 == h2) return d;
|
||||||
for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1;
|
for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1;
|
||||||
|
10
config.cpp
10
config.cpp
@ -508,8 +508,10 @@ EX void initConfig() {
|
|||||||
addsaver(vid.cells_drawn_limit, "limit on cells drawn", 10000);
|
addsaver(vid.cells_drawn_limit, "limit on cells drawn", 10000);
|
||||||
addsaver(vid.cells_generated_limit, "limit on cells generated", 25);
|
addsaver(vid.cells_generated_limit, "limit on cells generated", 25);
|
||||||
|
|
||||||
|
#if CAP_SOLV
|
||||||
addsaver(solv::solrange_xy, "solrange-xy");
|
addsaver(solv::solrange_xy, "solrange-xy");
|
||||||
addsaver(solv::solrange_z, "solrange-z");
|
addsaver(solv::solrange_z, "solrange-z");
|
||||||
|
#endif
|
||||||
addsaver(slr::steps, "slr-steps");
|
addsaver(slr::steps, "slr-steps");
|
||||||
addsaver(slr::range_xy, "slr-range-xy");
|
addsaver(slr::range_xy, "slr-range-xy");
|
||||||
|
|
||||||
@ -820,6 +822,7 @@ EX void add_cells_drawn(char c IS('C')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string solhelp() {
|
string solhelp() {
|
||||||
|
#if CAP_SOLV
|
||||||
return XLAT(
|
return XLAT(
|
||||||
"Solv (aka Sol) is a 3D space where directions work in different ways. It is described by the following metric:\n"
|
"Solv (aka Sol) is a 3D space where directions work in different ways. It is described by the following metric:\n"
|
||||||
"ds² = (eᶻdx)² + (e⁻ᶻdy)² + dz²\n\n"
|
"ds² = (eᶻdx)² + (e⁻ᶻdy)² + dz²\n\n"
|
||||||
@ -828,6 +831,9 @@ string solhelp() {
|
|||||||
"Cells with relative x,y coordinates both over %1 and z coordinate below %2 are not rendered for technical reasons"
|
"Cells with relative x,y coordinates both over %1 and z coordinate below %2 are not rendered for technical reasons"
|
||||||
" (geodesics to that points are too weird).", fts(solv::glitch_xy), fts(solv::glitch_z)
|
" (geodesics to that points are too weird).", fts(solv::glitch_xy), fts(solv::glitch_z)
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
return "";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void edit_sightrange() {
|
EX void edit_sightrange() {
|
||||||
@ -858,6 +864,7 @@ EX void edit_sightrange() {
|
|||||||
}
|
}
|
||||||
dialog::extra_options = [] () {
|
dialog::extra_options = [] () {
|
||||||
if(pmodel == mdGeodesic && sol) {
|
if(pmodel == mdGeodesic && sol) {
|
||||||
|
#if CAP_SOLV
|
||||||
dialog::addSelItem(XLAT("fog effect"), fts(sightranges[geometry]), 'R');
|
dialog::addSelItem(XLAT("fog effect"), fts(sightranges[geometry]), 'R');
|
||||||
dialog::add_action([] {
|
dialog::add_action([] {
|
||||||
auto xo = dialog::extra_options;
|
auto xo = dialog::extra_options;
|
||||||
@ -876,6 +883,7 @@ EX void edit_sightrange() {
|
|||||||
dialog::editNumber(solv::solrange_z, 0, 20, 0.1, 6, XLAT("max difference in Z coordinates"), solhelp());
|
dialog::editNumber(solv::solrange_z, 0, 20, 0.1, 6, XLAT("max difference in Z coordinates"), solhelp());
|
||||||
dialog::extra_options = xo; popScreen();
|
dialog::extra_options = xo; popScreen();
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(pmodel == mdGeodesic && sl2) {
|
else if(pmodel == mdGeodesic && sl2) {
|
||||||
dialog::addSelItem(XLAT("fog effect"), fts(sightranges[geometry]), 'R');
|
dialog::addSelItem(XLAT("fog effect"), fts(sightranges[geometry]), 'R');
|
||||||
@ -947,8 +955,10 @@ EX void edit_sightrange() {
|
|||||||
EX void menuitem_sightrange(char c IS('c')) {
|
EX void menuitem_sightrange(char c IS('c')) {
|
||||||
if(vid.use_smart_range)
|
if(vid.use_smart_range)
|
||||||
dialog::addSelItem(XLAT("minimum visible cell in pixels"), fts(WDIM == 3 ? vid.smart_range_detail_3 : vid.smart_range_detail), c);
|
dialog::addSelItem(XLAT("minimum visible cell in pixels"), fts(WDIM == 3 ? vid.smart_range_detail_3 : vid.smart_range_detail), c);
|
||||||
|
#if CAP_SOLV
|
||||||
else if(pmodel == mdGeodesic && sol)
|
else if(pmodel == mdGeodesic && sol)
|
||||||
dialog::addSelItem(XLAT("3D sight range"), fts(solv::solrange_xy) + "x" + fts(solv::solrange_z), c);
|
dialog::addSelItem(XLAT("3D sight range"), fts(solv::solrange_xy) + "x" + fts(solv::solrange_z), c);
|
||||||
|
#endif
|
||||||
else if(WDIM == 3)
|
else if(WDIM == 3)
|
||||||
dialog::addSelItem(XLAT("3D sight range"), fts(sightranges[geometry]), c);
|
dialog::addSelItem(XLAT("3D sight range"), fts(sightranges[geometry]), c);
|
||||||
else
|
else
|
||||||
|
@ -1130,7 +1130,9 @@ enum iePrecision { iLazy, iTable };
|
|||||||
|
|
||||||
/** inverse exponential function \see hr::direct_exp */
|
/** inverse exponential function \see hr::direct_exp */
|
||||||
EX hyperpoint inverse_exp(const hyperpoint h, iePrecision p, bool just_direction IS(true)) {
|
EX hyperpoint inverse_exp(const hyperpoint h, iePrecision p, bool just_direction IS(true)) {
|
||||||
|
#if CAP_SOLV
|
||||||
if(sol) return solv::get_inverse_exp(h, p == iLazy, just_direction);
|
if(sol) return solv::get_inverse_exp(h, p == iLazy, just_direction);
|
||||||
|
#endif
|
||||||
if(nil) return nilv::get_inverse_exp(h, p == iLazy ? 5 : 20);
|
if(nil) return nilv::get_inverse_exp(h, p == iLazy ? 5 : 20);
|
||||||
if(sl2) return slr::get_inverse_exp(h);
|
if(sl2) return slr::get_inverse_exp(h);
|
||||||
if(prod) return product::inverse_exp(h);
|
if(prod) return product::inverse_exp(h);
|
||||||
|
@ -968,7 +968,9 @@ EX bool in_smart_range(const transmatrix& T) {
|
|||||||
hyperpoint h = tC0(T);
|
hyperpoint h = tC0(T);
|
||||||
if(invalid_point(h)) return false;
|
if(invalid_point(h)) return false;
|
||||||
if(nil) return true;
|
if(nil) return true;
|
||||||
|
#if CAP_SOLV
|
||||||
if(pmodel == mdGeodesic) return solv::in_table_range(h);
|
if(pmodel == mdGeodesic) return solv::in_table_range(h);
|
||||||
|
#endif
|
||||||
hyperpoint h1;
|
hyperpoint h1;
|
||||||
applymodel(h, h1);
|
applymodel(h, h1);
|
||||||
if(invalid_point(h1)) return false;
|
if(invalid_point(h1)) return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user