mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
separate color set for mirrored tiles in arb/arcm
This commit is contained in:
parent
30839fdb15
commit
3369adfc98
@ -45,6 +45,8 @@ constexpr ld INFINITE_BOTH = -3;
|
||||
struct shape {
|
||||
/** index in the arbi_tiling::shapes */
|
||||
int id;
|
||||
/** index in the original file */
|
||||
int orig_id;
|
||||
/** flags such as sfLINE and sfPH */
|
||||
int flags;
|
||||
/** list of vertices in the usual convention */
|
||||
@ -79,6 +81,8 @@ struct shape {
|
||||
vector<vector<ld>> vertex_angles;
|
||||
/** football types */
|
||||
int football_type;
|
||||
/** is it a mirrored version of an original tile */
|
||||
bool is_mirrored;
|
||||
};
|
||||
|
||||
struct slider {
|
||||
@ -135,6 +139,8 @@ struct arbi_tiling {
|
||||
|
||||
int min_valence, max_valence;
|
||||
bool is_football_colorable;
|
||||
bool was_unmirrored;
|
||||
bool was_split_for_football;
|
||||
|
||||
geometryinfo1& get_geometry();
|
||||
eGeometryClass get_class() { return get_geometry().kind; }
|
||||
@ -342,6 +348,8 @@ EX void load_tile(exp_parser& ep, arbi_tiling& c, bool unit) {
|
||||
c.shapes.emplace_back();
|
||||
auto& cc = c.shapes.back();
|
||||
cc.id = isize(c.shapes) - 1;
|
||||
cc.orig_id = cc.id;
|
||||
cc.is_mirrored = false;
|
||||
cc.flags = 0;
|
||||
cc.repeat_value = 1;
|
||||
while(ep.next() != ')') {
|
||||
@ -442,8 +450,10 @@ EX void unmirror(arbi_tiling& c) {
|
||||
int s = isize(sh);
|
||||
for(int i=0; i<s; i++)
|
||||
sh.push_back(sh[i]);
|
||||
for(int i=0; i<2*s; i++)
|
||||
for(int i=0; i<2*s; i++) {
|
||||
sh[i].id = i;
|
||||
if(i >= s) sh[i].is_mirrored = true;
|
||||
}
|
||||
for(int i=s; i<s+s; i++) {
|
||||
for(auto& v: sh[i].vertices)
|
||||
v[1] = -v[1];
|
||||
@ -686,6 +696,7 @@ EX void check_football_colorability(arbi_tiling& c) {
|
||||
}
|
||||
|
||||
c.is_football_colorable = true;
|
||||
c.was_split_for_football = true;
|
||||
for(auto&sh: c.shapes)
|
||||
if(sh.football_type == 7)
|
||||
c.is_football_colorable = false;
|
||||
@ -709,6 +720,7 @@ EX void check_football_colorability(arbi_tiling& c) {
|
||||
int ni = new_indices[i][t];
|
||||
if(ni == -1) continue;
|
||||
auto& sh = c.shapes[ni];
|
||||
sh.id = ni;
|
||||
for(int j=0; j<isize(sh); j++) {
|
||||
auto &co = sh.connections[j];
|
||||
auto assign = [&] (int tt) {
|
||||
@ -782,6 +794,8 @@ EX void set_defaults(arb::arbi_tiling& c, bool keep_sliders, string fname) {
|
||||
c.yendor_backsteps = 0;
|
||||
c.is_star = false;
|
||||
c.is_combinatorial = false;
|
||||
c.was_unmirrored = false;
|
||||
c.was_split_for_football = false;
|
||||
c.shapes.clear();
|
||||
if(!keep_sliders) {
|
||||
c.sliders.clear();
|
||||
|
20
pattern2.cpp
20
pattern2.cpp
@ -1544,6 +1544,13 @@ EX map<char, colortable> colortables = {
|
||||
0xF08040, 0xF04080, 0x40F080,
|
||||
0x4080F0, 0x8040F0, 0x80F040,
|
||||
0xFFD500 }},
|
||||
{'M', { // mirrored versions of 'A'
|
||||
0xF04060, 0x40F060, 0x4040D0,
|
||||
0xD0D040, 0xD000F0, 0x00D040,
|
||||
0xC0C0E0, 0x404060, 0x8080A0,
|
||||
0xF08060, 0xF040A0, 0x40F0A0,
|
||||
0x4080D0, 0x8040D0, 0x80F060,
|
||||
0xFFD540 }},
|
||||
{'B', {
|
||||
// trying to get colors as in Wikipedia [ https://en.wikipedia.org/wiki/Euclidean_tilings_by_convex_regular_polygons#k-uniform_tilings ]
|
||||
0, 0, 0xFFFFFF, 0xFFFF00,
|
||||
@ -1784,9 +1791,18 @@ EX namespace patterns {
|
||||
#endif
|
||||
case 'A':
|
||||
#if CAP_ARCM
|
||||
if(arcm::in()) return colortables['A'][arcm::current.tilegroup[arcm::id_of(c->master)]];
|
||||
if(arcm::in()) {
|
||||
int id = arcm::current.tilegroup[arcm::id_of(c->master)];
|
||||
return colortables[(id&1) ? 'M' : 'A'][id/2];
|
||||
}
|
||||
#endif
|
||||
if(arb::in()) return colortables['A'][shvid(c) + c->master->emeraldval * isize(arb::current.shapes)];
|
||||
if(arb::in()) {
|
||||
int id = shvid(c);
|
||||
auto& sh = arb::current.shapes[id];
|
||||
int oid = sh.orig_id;
|
||||
bool mirrored = c->master->emeraldval || sh.is_mirrored;
|
||||
return colortables[mirrored ? 'M' : 'A'][oid];
|
||||
}
|
||||
return colortables['A'][shvid(c)];
|
||||
case 'B':
|
||||
if(arb::is_apeirogonal(c)) return apeirogonal_color;
|
||||
|
Loading…
Reference in New Issue
Block a user