From 112a38dee904f1a63c99655bffc10401d62f7cb6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 22 Aug 2018 00:14:31 +0200 Subject: [PATCH] fixed compilation without CAP_TEXTURE --- archimedean.cpp | 6 ++++++ geom-exp.cpp | 5 ++++- goldberg.cpp | 3 ++- pattern2.cpp | 22 ++++++++++++++-------- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index 705cf27f..39ba3b10 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -947,12 +947,14 @@ void enable(archimedean_tiling& arct) { if(geometry != gArchimedean) targetgeometry = gArchimedean, stop_game_and_switch_mode(rg::geometry); nonbitrunc = true; need_reset_geometry = true; gp::on = false; irr::on = false; patterns::whichPattern = 0; +#if CAP_TEXTURE if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree) patterns::whichPattern = patterns::PAT_COLORING; if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball) patterns::whichPattern = 0, patterns::subpattern_flags = patterns::SPF_FOOTBALL; if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess) patterns::whichPattern = patterns::PAT_CHESS; +#endif current = arct; start_game(); } @@ -994,11 +996,13 @@ void show() { dialog::addBreak(100); if(edited.errors) dialog::addInfo(edited.errormsg, 0xFF0000); +#if CAP_TEXTURE else if(texture::config.tstate == texture::tsActive && ((texture::cgroup == cpThree && edited.support_threecolor() < 2) || (texture::cgroup == cpFootball && edited.support_football() < 2) || (texture::cgroup == cpChess && !edited.support_chessboard()))) dialog::addInfo(XLAT("Pattern incompatible."), 0xC0C000); +#endif else dialog::addInfo(XLAT("OK"), 0x00FF00); @@ -1020,12 +1024,14 @@ void show() { int shown = 0; while(nextpos < isize(tilings) && shown < 10) { auto &ps = tilings[nextpos++]; +#if CAP_TEXTURE if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree && ps.support_threecolor() < 2) continue; if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball && ps.support_football() < 2) continue; if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess && !ps.support_chessboard()) continue; +#endif dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°", 'a' + shown); dialog::lastItem().color = ps.coloring; dialog::add_action([&] () { enable(ps); }); diff --git a/geom-exp.cpp b/geom-exp.cpp index 8f90d69c..a2a31b3a 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -405,7 +405,10 @@ void showEuclideanMenu() { else if(binarytiling) { dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), ""); dialog::reaction = [] () { - resetGeometry(); texture::config.remap(); + resetGeometry(); + #if CAP_TEXTURE + texture::config.remap(); + #endif }; } else // if(S3 == 3) diff --git a/goldberg.cpp b/goldberg.cpp index 2a1f5273..7abfea71 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -692,6 +692,7 @@ namespace hr { namespace gp { int min_quality_chess = 0; int min_quality = 0; +#if CAP_TEXTURE if((texture::config.tstate == texture::tsActive) && (S7 % 2 == 1)) { if(texture::cgroup == cpFootball || texture::cgroup == cpThree) min_quality = 1; } @@ -699,7 +700,7 @@ namespace hr { namespace gp { if((texture::config.tstate == texture::tsActive) && (S7 % 2 == 1) && (S3 == 4)) { if(texture::cgroup == cpChess) min_quality = 1; } - +#endif if(min_quality == 0 && min_quality_chess == 0) { dialog::addBoolItem(XLAT("OFF"), param == loc(1,0) && !irr::on, 'a'); dialog::lastItem().value = "GP(1,0)"; diff --git a/pattern2.cpp b/pattern2.cpp index 6ef1938e..e5732eaa 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1490,6 +1490,12 @@ namespace patterns { else if(doexiton(sym, uni)) popScreen(); }; } + +#if CAP_TEXTURE +#define REMAP_TEXTURE texture::config.remap() +#else +#define REMAP_TEXTURE +#endif void showPattern() { cmode = sm::SIDE | sm::MAYDARK; @@ -1616,39 +1622,39 @@ namespace patterns { #if CAP_EDIT mapeditor::modelcell.clear(); #endif - texture::config.remap(); + REMAP_TEXTURE; } else if(uni >= '0' && uni <= '5') { subpattern_flags ^= (1 << (uni - '0')); - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '=') { subpattern_flags ^= SPF_EXTRASYM; - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '\'') { subpattern_flags ^= SPF_ALTERNATE; // subpattern_flags &= ~SPF_FOOTBALL; - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '*') { subpattern_flags ^= SPF_FOOTBALL; // subpattern_flags &= ~SPF_ALTERNATE; - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '!') { subpattern_flags ^= SPF_FULLSYM; - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '@') { subpattern_flags ^= SPF_DOCKS; - texture::config.remap(); + REMAP_TEXTURE; } else if(uni == '6' || uni == '7' || uni == '8' || uni == '9') { @@ -1837,7 +1843,7 @@ namespace patterns { subpattern_flags = g.subpattern_flags; bool not_restarted = game_active; start_game(); - if(not_restarted) texture::config.remap(); + if(not_restarted) REMAP_TEXTURE; } else if(uni == 'G' && (have_goldberg || have_variations)) gp::configure();