mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
Added seven-coloring of the torus. 'Zebra triangles' line pattern used on the torus shows the big triangles.
This commit is contained in:
parent
c68de3c94f
commit
888e0c510a
24
pattern2.cpp
24
pattern2.cpp
@ -1287,7 +1287,8 @@ map<char, colortable> colortables = {
|
|||||||
{'t', {0x804040, 0x408040, 0x404080, 0x808040 }},
|
{'t', {0x804040, 0x408040, 0x404080, 0x808040 }},
|
||||||
{'c', {0x202020, 0xC0C0C0}},
|
{'c', {0x202020, 0xC0C0C0}},
|
||||||
{'F', {0xC0C0C0, 0x202020}},
|
{'F', {0xC0C0C0, 0x202020}},
|
||||||
{'w', {0x303030, 0xC0C0C0}}
|
{'w', {0x303030, 0xC0C0C0}},
|
||||||
|
{'v', {0xC00000, 0xC08000, 0xC0C000, 0x00C000, 0xC0C0, 0x00C0, 0xC000C0}},
|
||||||
};
|
};
|
||||||
|
|
||||||
color_t random_landscape(cell *c, int mul, int div, int step) {
|
color_t random_landscape(cell *c, int mul, int div, int step) {
|
||||||
@ -1313,6 +1314,12 @@ namespace patterns {
|
|||||||
char whichShape = 0;
|
char whichShape = 0;
|
||||||
char whichCanvas = 0;
|
char whichCanvas = 0;
|
||||||
|
|
||||||
|
int sevenval(cell *c) {
|
||||||
|
if(!euclid) return 0;
|
||||||
|
auto p = vec_to_pair(cell_to_vec(c));
|
||||||
|
return gmod(p.first - p.second * 2, 7);
|
||||||
|
}
|
||||||
|
|
||||||
int generateCanvas(cell *c) {
|
int generateCanvas(cell *c) {
|
||||||
switch(whichCanvas) {
|
switch(whichCanvas) {
|
||||||
case 'A':
|
case 'A':
|
||||||
@ -1385,6 +1392,8 @@ namespace patterns {
|
|||||||
return colortables['F'][pseudohept(c)];
|
return colortables['F'][pseudohept(c)];
|
||||||
case 'T':
|
case 'T':
|
||||||
return nestcolors[pattern_threecolor(c)];
|
return nestcolors[pattern_threecolor(c)];
|
||||||
|
case 'v':
|
||||||
|
return colortables['v'][sevenval(c)];
|
||||||
}
|
}
|
||||||
return canvasback;
|
return canvasback;
|
||||||
}
|
}
|
||||||
@ -1409,6 +1418,9 @@ namespace patterns {
|
|||||||
|
|
||||||
dialog::addItem(XLAT("nice coloring"), 'T');
|
dialog::addItem(XLAT("nice coloring"), 'T');
|
||||||
|
|
||||||
|
if(euclid6)
|
||||||
|
dialog::addItem(XLAT("seven-coloring"), 'v');
|
||||||
|
|
||||||
if(stdhyperbolic) {
|
if(stdhyperbolic) {
|
||||||
dialog::addSelItem(XLAT("emerald pattern"), "emerald", 'e');
|
dialog::addSelItem(XLAT("emerald pattern"), "emerald", 'e');
|
||||||
dialog::addSelItem(XLAT("four elements"), "palace", 'b');
|
dialog::addSelItem(XLAT("four elements"), "palace", 'b');
|
||||||
@ -1983,6 +1995,16 @@ namespace linepatterns {
|
|||||||
switch(id) {
|
switch(id) {
|
||||||
|
|
||||||
case patZebraTriangles:
|
case patZebraTriangles:
|
||||||
|
if(euclid) {
|
||||||
|
if(patterns::sevenval(c)) break;
|
||||||
|
queueline(tC0(V), V * tC0(eumove(-1, +3)), col, 3 + vid.linequality);
|
||||||
|
queueline(tC0(V), V * tC0(eumove(-3, +2)), col, 3 + vid.linequality);
|
||||||
|
queueline(tC0(V), V * tC0(eumove(-2, -1)), col, 3 + vid.linequality);
|
||||||
|
queueline(tC0(V), V * tC0(eumove(+1, -3)), col, 3 + vid.linequality);
|
||||||
|
queueline(tC0(V), V * tC0(eumove(+3, -2)), col, 3 + vid.linequality);
|
||||||
|
queueline(tC0(V), V * tC0(eumove(+2, +1)), col, 3 + vid.linequality);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if(zebra40(c) / 4 == 10) {
|
if(zebra40(c) / 4 == 10) {
|
||||||
bool all = true;
|
bool all = true;
|
||||||
hyperpoint tri[3];
|
hyperpoint tri[3];
|
||||||
|
Loading…
Reference in New Issue
Block a user