From 8833251c8b2983f333f70f1f1e6ceae4b59d768d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 13 Sep 2019 19:50:12 +0200 Subject: [PATCH] added some missing CAP_SOLV guards --- cell.cpp | 2 ++ config.cpp | 10 ++++++++++ hyperpoint.cpp | 2 ++ hypgraph.cpp | 2 ++ 4 files changed, 16 insertions(+) diff --git a/cell.cpp b/cell.cpp index d940e3d2..e23db125 100644 --- a/cell.cpp +++ b/cell.cpp @@ -913,7 +913,9 @@ EX int heptdistance(heptagon *h1, heptagon *h2) { #if CAP_CRYSTAL if(cryst) return crystal::space_distance(h1->c7, h2->c7); #endif + #if CAP_SOLV if(sol) return solv::approx_distance(h1, h2); + #endif while(true) { if(h1 == h2) return d; for(int i=0; imove(i) == h2) return d + 1; diff --git a/config.cpp b/config.cpp index bfcefd50..5db1784d 100644 --- a/config.cpp +++ b/config.cpp @@ -508,8 +508,10 @@ EX void initConfig() { addsaver(vid.cells_drawn_limit, "limit on cells drawn", 10000); addsaver(vid.cells_generated_limit, "limit on cells generated", 25); + #if CAP_SOLV addsaver(solv::solrange_xy, "solrange-xy"); addsaver(solv::solrange_z, "solrange-z"); + #endif addsaver(slr::steps, "slr-steps"); addsaver(slr::range_xy, "slr-range-xy"); @@ -820,6 +822,7 @@ EX void add_cells_drawn(char c IS('C')) { } string solhelp() { +#if CAP_SOLV return XLAT( "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" @@ -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" " (geodesics to that points are too weird).", fts(solv::glitch_xy), fts(solv::glitch_z) ); +#else + return ""; +#endif } EX void edit_sightrange() { @@ -858,6 +864,7 @@ EX void edit_sightrange() { } dialog::extra_options = [] () { if(pmodel == mdGeodesic && sol) { + #if CAP_SOLV dialog::addSelItem(XLAT("fog effect"), fts(sightranges[geometry]), 'R'); dialog::add_action([] { 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::extra_options = xo; popScreen(); }); + #endif } else if(pmodel == mdGeodesic && sl2) { 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')) { 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); + #if CAP_SOLV else if(pmodel == mdGeodesic && sol) dialog::addSelItem(XLAT("3D sight range"), fts(solv::solrange_xy) + "x" + fts(solv::solrange_z), c); + #endif else if(WDIM == 3) dialog::addSelItem(XLAT("3D sight range"), fts(sightranges[geometry]), c); else diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 30f90496..9532045a 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -1130,7 +1130,9 @@ enum iePrecision { iLazy, iTable }; /** inverse exponential function \see hr::direct_exp */ 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); + #endif if(nil) return nilv::get_inverse_exp(h, p == iLazy ? 5 : 20); if(sl2) return slr::get_inverse_exp(h); if(prod) return product::inverse_exp(h); diff --git a/hypgraph.cpp b/hypgraph.cpp index a1a34c24..204eb79f 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -968,7 +968,9 @@ EX bool in_smart_range(const transmatrix& T) { hyperpoint h = tC0(T); if(invalid_point(h)) return false; if(nil) return true; + #if CAP_SOLV if(pmodel == mdGeodesic) return solv::in_table_range(h); + #endif hyperpoint h1; applymodel(h, h1); if(invalid_point(h1)) return false;