fixed compilation without CAP_TEXTURE

This commit is contained in:
Zeno Rogue 2018-08-22 00:14:31 +02:00
parent 96d33046f2
commit 112a38dee9
4 changed files with 26 additions and 10 deletions

View File

@ -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); });

View File

@ -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)

View File

@ -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)";

View File

@ -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();