mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 15:36:59 +00:00
texture remapping to dual/bitruncated Archimedean
This commit is contained in:
parent
218709b899
commit
2c1b8c3b14
@ -1008,15 +1008,27 @@ void enable(archimedean_tiling& arct) {
|
|||||||
if(!archimedean) set_variation(eVariation::pure);
|
if(!archimedean) set_variation(eVariation::pure);
|
||||||
set_geometry(gArchimedean);
|
set_geometry(gArchimedean);
|
||||||
patterns::whichPattern = patterns::PAT_NONE;
|
patterns::whichPattern = patterns::PAT_NONE;
|
||||||
#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 = patterns::PAT_TYPES, patterns::subpattern_flags = patterns::SPF_FOOTBALL;
|
|
||||||
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess)
|
|
||||||
patterns::whichPattern = patterns::PAT_CHESS;
|
|
||||||
#endif
|
|
||||||
current = arct;
|
current = arct;
|
||||||
|
#if CAP_TEXTURE
|
||||||
|
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpThree) {
|
||||||
|
patterns::whichPattern = patterns::PAT_COLORING;
|
||||||
|
if(geosupport_threecolor() < 2) {
|
||||||
|
if(arct.support_threecolor() == 2) set_variation(eVariation::pure);
|
||||||
|
else if(arct.support_threecolor_bitruncated() == 2) set_variation(eVariation::bitruncated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball) {
|
||||||
|
patterns::whichPattern = patterns::PAT_TYPES, patterns::subpattern_flags = patterns::SPF_FOOTBALL;
|
||||||
|
if(geosupport_football() < 2) set_variation(eVariation::bitruncated);
|
||||||
|
}
|
||||||
|
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess) {
|
||||||
|
patterns::whichPattern = patterns::PAT_CHESS;
|
||||||
|
if(!geosupport_chessboard()) {
|
||||||
|
if(arct.support_chessboard()) set_variation(eVariation::pure);
|
||||||
|
else if(arct.support_threecolor_bitruncated() == 2) set_variation(eVariation::dual);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
need_reset_geometry = true;
|
need_reset_geometry = true;
|
||||||
start_game();
|
start_game();
|
||||||
}
|
}
|
||||||
@ -1058,13 +1070,6 @@ 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 &&
|
|
||||||
((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
|
else
|
||||||
dialog::addInfo(XLAT("OK"), 0x00FF00);
|
dialog::addInfo(XLAT("OK"), 0x00FF00);
|
||||||
|
|
||||||
@ -1091,15 +1096,26 @@ 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++];
|
||||||
|
bool valid = true;
|
||||||
|
string suffix = "";
|
||||||
#if CAP_TEXTURE
|
#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) {
|
||||||
continue;
|
valid = false;
|
||||||
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball && ps.support_football() < 2)
|
if(ps.support_threecolor() == 2) valid = true, suffix += bitruncnames[int(eVariation::pure)];
|
||||||
continue;
|
if(ps.support_threecolor_bitruncated() == 2) valid = true, suffix += bitruncnames[int(eVariation::bitruncated)];
|
||||||
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess && !ps.support_chessboard())
|
}
|
||||||
continue;
|
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpFootball) {
|
||||||
|
if(ps.support_football() == 2) suffix += bitruncnames[int(eVariation::pure)];
|
||||||
|
suffix += bitruncnames[int(eVariation::bitruncated)];
|
||||||
|
}
|
||||||
|
if(texture::config.tstate == texture::tsActive && texture::cgroup == cpChess && !ps.support_chessboard()) {
|
||||||
|
valid = false;
|
||||||
|
if(ps.support_chessboard()) valid = true, suffix += bitruncnames[int(eVariation::pure)];
|
||||||
|
if(ps.support_threecolor_bitruncated() == 2) valid = true, suffix += bitruncnames[int(eVariation::dual)];
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°", 'a' + shown);
|
if(!valid) continue;
|
||||||
|
dialog::addSelItem(ps.symbol, fts(ps.euclidean_angle_sum * 180) + "°" + suffix, 'a' + shown);
|
||||||
dialog::lastItem().color = ps.coloring;
|
dialog::lastItem().color = ps.coloring;
|
||||||
dialog::add_action([&] () { enable(ps); });
|
dialog::add_action([&] () { enable(ps); });
|
||||||
shown++;
|
shown++;
|
||||||
|
@ -1907,7 +1907,7 @@ namespace patterns {
|
|||||||
if(IRREGULAR)
|
if(IRREGULAR)
|
||||||
return irr::cellindex[c] << 8;
|
return irr::cellindex[c] << 8;
|
||||||
else if(archimedean)
|
else if(archimedean)
|
||||||
return arcm::id_of(c->master) << 8;
|
return (arcm::id_of(c->master) << 8) + (arcm::parent_index_of(c->master) << 16);
|
||||||
else if(!GOLDBERG) return 0;
|
else if(!GOLDBERG) return 0;
|
||||||
else if(c == c->master->c7) return (fixdir(si.dir, c) << 8);
|
else if(c == c->master->c7) return (fixdir(si.dir, c) << 8);
|
||||||
else return (get_code(gp::get_local_info(c)) << 16) | (fixdir(si.dir, c) << 8);
|
else return (get_code(gp::get_local_info(c)) << 16) | (fixdir(si.dir, c) << 8);
|
||||||
|
@ -292,9 +292,14 @@ void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const trans
|
|||||||
mi.M = T * applyPatterndir(c, si);
|
mi.M = T * applyPatterndir(c, si);
|
||||||
mi.triangles.clear();
|
mi.triangles.clear();
|
||||||
|
|
||||||
|
transmatrix iv = inverse(applyPatterndir(c, si));
|
||||||
|
|
||||||
|
int sd = si.dir;
|
||||||
|
if((NONSTDVAR) || binarytiling) sd = 0;
|
||||||
|
|
||||||
for(int i=0; i<c->type; i++) {
|
for(int i=0; i<c->type; i++) {
|
||||||
hyperpoint h1 = get_corner_position(c, (i + shift) % c->type);
|
hyperpoint h1 = iv * get_corner_position(c, (i + sd + shift) % c->type);
|
||||||
hyperpoint h2 = get_corner_position(c, (i + shift + 1) % c->type);
|
hyperpoint h2 = iv * get_corner_position(c, (i + sd + shift + 1) % c->type);
|
||||||
mi.triangles.emplace_back(make_array(C0, h1, h2), make_array(mi.M*C0, mi.M*h1, mi.M*h2));
|
mi.triangles.emplace_back(make_array(C0, h1, h2), make_array(mi.M*C0, mi.M*h1, mi.M*h2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user