more pattern editing for g46

This commit is contained in:
Zeno Rogue 2017-12-03 12:59:57 +01:00
parent 3b7ab293ba
commit c5324ff2f5
4 changed files with 18 additions and 6 deletions

View File

@ -731,7 +731,8 @@ bool ishex1(cell *c) {
int emeraldval(cell *c) {
if(euclid) return eupattern(c);
if(a46) return c->master->distance & 1;
if(a46) return ctof(c) ? ((c->master->emeraldval & 2) ? 1 : 0) :
((c->master->emeraldval & 1) ^ ((c->master->emeraldval & 2)>>1) ^ (c->spin(0)&1)) ? 8 : 4;
if(sphere) return 0;
if(ctof(c))
return c->master->emeraldval >> 3;

View File

@ -656,6 +656,7 @@ namespace mapeditor {
extern bool drawplayer;
extern char whichPattern, whichShape;
extern char whichCanvas;
extern bool symRotation, sym01, sym02, sym03;
extern int displaycodes;
int generateCanvas(cell *c);
void applyModelcell(cell *c);

View File

@ -379,7 +379,12 @@ namespace mapeditor {
case 'f': {
int t = emeraldval(c);
if(a46) return c->master->emeraldval ^ (c->master->distance & 1);
if(a46) {
if(ctof(c))
return (c->master->emeraldval & 1) ^ (c->master->emeraldval & 2 ? 1 : 0);
else
return ((c->mov[0]->master->emeraldval + c->spin(0)) & 1) ? 2 : 0;
}
if(euclid) return 0;
int tcdir = 0, tbest = (t&3);
for(int i=0; i<c->type; i++) {
@ -412,7 +417,12 @@ namespace mapeditor {
case 0: {
if(euclid) return 0;
if(a46) return c->master->emeraldval;
if(a46) {
if(ctof(c))
return c->master->emeraldval;
else
return ((c->mov[0]->master->emeraldval + c->spin(0)) & 1) ? 2 : 0;
}
int u = nopattern(c);
if(u == 6) {
@ -769,10 +779,10 @@ namespace mapeditor {
else if(!euclid) {
dialog::addBoolItem(XLAT("rotational symmetry"), (symRotation), '0');
dialog::addBoolItem(XLAT("symmetry 0-1"), (sym01), '1');
if(!a46) {
if(!a46 || !nontruncated)
dialog::addBoolItem(XLAT("symmetry 0-2"), (sym02), '2');
if(!a46)
dialog::addBoolItem(XLAT("symmetry 0-3"), (sym03), '3');
}
}
else
dialog::addBoolItem(XLAT("edit all three colors"), (symRotation), '0');

View File

@ -7,7 +7,7 @@
// rules for the emeraldvalues of heptagons.
int emerald_heptagon(int parent, int dir) {
if(a46) return (parent+dir)&1;
if(a46) return parent ^ (dir & 1) ^ 2;
if(S7 == 8 && dir > 3) dir--;