1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-29 16:32:53 +00:00

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); if(geometry != gArchimedean) targetgeometry = gArchimedean, stop_game_and_switch_mode(rg::geometry);
nonbitrunc = true; need_reset_geometry = true; gp::on = false; irr::on = false; nonbitrunc = true; need_reset_geometry = true; gp::on = false; irr::on = false;
patterns::whichPattern = 0; patterns::whichPattern = 0;
#if CAP_TEXTURE
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree)
patterns::whichPattern = patterns::PAT_COLORING; patterns::whichPattern = patterns::PAT_COLORING;
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball)
patterns::whichPattern = 0, patterns::subpattern_flags = patterns::SPF_FOOTBALL; patterns::whichPattern = 0, patterns::subpattern_flags = patterns::SPF_FOOTBALL;
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess)
patterns::whichPattern = patterns::PAT_CHESS; patterns::whichPattern = patterns::PAT_CHESS;
#endif
current = arct; current = arct;
start_game(); start_game();
} }
@ -994,11 +996,13 @@ void show() {
dialog::addBreak(100); dialog::addBreak(100);
if(edited.errors) if(edited.errors)
dialog::addInfo(edited.errormsg, 0xFF0000); dialog::addInfo(edited.errormsg, 0xFF0000);
#if CAP_TEXTURE
else if(texture::config.tstate == texture::tsActive && else if(texture::config.tstate == texture::tsActive &&
((texture::cgroup == cpThree && edited.support_threecolor() < 2) || ((texture::cgroup == cpThree && edited.support_threecolor() < 2) ||
(texture::cgroup == cpFootball && edited.support_football() < 2) || (texture::cgroup == cpFootball && edited.support_football() < 2) ||
(texture::cgroup == cpChess && !edited.support_chessboard()))) (texture::cgroup == cpChess && !edited.support_chessboard())))
dialog::addInfo(XLAT("Pattern incompatible."), 0xC0C000); dialog::addInfo(XLAT("Pattern incompatible."), 0xC0C000);
#endif
else else
dialog::addInfo(XLAT("OK"), 0x00FF00); dialog::addInfo(XLAT("OK"), 0x00FF00);
@ -1020,12 +1024,14 @@ void show() {
int shown = 0; int shown = 0;
while(nextpos < isize(tilings) && shown < 10) { while(nextpos < isize(tilings) && shown < 10) {
auto &ps = tilings[nextpos++]; auto &ps = tilings[nextpos++];
#if CAP_TEXTURE
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree && ps.support_threecolor() < 2) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree && ps.support_threecolor() < 2)
continue; continue;
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball && ps.support_football() < 2) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball && ps.support_football() < 2)
continue; continue;
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess && !ps.support_chessboard()) if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess && !ps.support_chessboard())
continue; continue;
#endif
dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°", 'a' + shown); dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°", 'a' + shown);
dialog::lastItem().color = ps.coloring; dialog::lastItem().color = ps.coloring;
dialog::add_action([&] () { enable(ps); }); dialog::add_action([&] () { enable(ps); });

View File

@ -405,7 +405,10 @@ void showEuclideanMenu() {
else if(binarytiling) { else if(binarytiling) {
dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), ""); dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), "");
dialog::reaction = [] () { dialog::reaction = [] () {
resetGeometry(); texture::config.remap(); resetGeometry();
#if CAP_TEXTURE
texture::config.remap();
#endif
}; };
} }
else // if(S3 == 3) else // if(S3 == 3)

View File

@ -692,6 +692,7 @@ namespace hr { namespace gp {
int min_quality_chess = 0; int min_quality_chess = 0;
int min_quality = 0; int min_quality = 0;
#if CAP_TEXTURE
if((texture::config.tstate == texture::tsActive) && (S7 % 2 == 1)) { if((texture::config.tstate == texture::tsActive) && (S7 % 2 == 1)) {
if(texture::cgroup == cpFootball || texture::cgroup == cpThree) min_quality = 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::config.tstate == texture::tsActive) && (S7 % 2 == 1) && (S3 == 4)) {
if(texture::cgroup == cpChess) min_quality = 1; if(texture::cgroup == cpChess) min_quality = 1;
} }
#endif
if(min_quality == 0 && min_quality_chess == 0) { if(min_quality == 0 && min_quality_chess == 0) {
dialog::addBoolItem(XLAT("OFF"), param == loc(1,0) && !irr::on, 'a'); dialog::addBoolItem(XLAT("OFF"), param == loc(1,0) && !irr::on, 'a');
dialog::lastItem().value = "GP(1,0)"; dialog::lastItem().value = "GP(1,0)";

View File

@ -1491,6 +1491,12 @@ namespace patterns {
}; };
} }
#if CAP_TEXTURE
#define REMAP_TEXTURE texture::config.remap()
#else
#define REMAP_TEXTURE
#endif
void showPattern() { void showPattern() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
{ {
@ -1616,39 +1622,39 @@ namespace patterns {
#if CAP_EDIT #if CAP_EDIT
mapeditor::modelcell.clear(); mapeditor::modelcell.clear();
#endif #endif
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni >= '0' && uni <= '5') { else if(uni >= '0' && uni <= '5') {
subpattern_flags ^= (1 << (uni - '0')); subpattern_flags ^= (1 << (uni - '0'));
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '=') { else if(uni == '=') {
subpattern_flags ^= SPF_EXTRASYM; subpattern_flags ^= SPF_EXTRASYM;
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '\'') { else if(uni == '\'') {
subpattern_flags ^= SPF_ALTERNATE; subpattern_flags ^= SPF_ALTERNATE;
// subpattern_flags &= ~SPF_FOOTBALL; // subpattern_flags &= ~SPF_FOOTBALL;
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '*') { else if(uni == '*') {
subpattern_flags ^= SPF_FOOTBALL; subpattern_flags ^= SPF_FOOTBALL;
// subpattern_flags &= ~SPF_ALTERNATE; // subpattern_flags &= ~SPF_ALTERNATE;
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '!') { else if(uni == '!') {
subpattern_flags ^= SPF_FULLSYM; subpattern_flags ^= SPF_FULLSYM;
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '@') { else if(uni == '@') {
subpattern_flags ^= SPF_DOCKS; subpattern_flags ^= SPF_DOCKS;
texture::config.remap(); REMAP_TEXTURE;
} }
else if(uni == '6' || uni == '7' || uni == '8' || uni == '9') { else if(uni == '6' || uni == '7' || uni == '8' || uni == '9') {
@ -1837,7 +1843,7 @@ namespace patterns {
subpattern_flags = g.subpattern_flags; subpattern_flags = g.subpattern_flags;
bool not_restarted = game_active; bool not_restarted = game_active;
start_game(); start_game();
if(not_restarted) texture::config.remap(); if(not_restarted) REMAP_TEXTURE;
} }
else if(uni == 'G' && (have_goldberg || have_variations)) else if(uni == 'G' && (have_goldberg || have_variations))
gp::configure(); gp::configure();