1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-26 03:17:39 +00:00

fixed singletype texture patterns

This commit is contained in:
Zeno Rogue
2018-08-02 22:25:08 +02:00
parent 6b4ed57152
commit bd59b4e23a
4 changed files with 48 additions and 15 deletions

View File

@@ -235,7 +235,7 @@ extern itemtype iinf[ittypes];
extern const landtype linf[landtypes]; extern const landtype linf[landtypes];
enum cpatterntype { enum cpatterntype {
cpFootball, cpThree, cpChess, cpSingle, cpLarge, cpZebra, cpUnknown cpFootball, cpThree, cpChess, cpSingle, cpSingleSym, cpOddEven, cpLarge, cpZebra, cpUnknown
}; };
struct landtacinfo { eLand l; int tries, multiplier; }; struct landtacinfo { eLand l; int tries, multiplier; };

View File

@@ -905,6 +905,7 @@ namespace patterns {
static const char PAT_COLORING = 'C'; static const char PAT_COLORING = 'C';
static const char PAT_SIBLING = 'S'; static const char PAT_SIBLING = 'S';
static const char PAT_CHESS = 'c'; static const char PAT_CHESS = 'c';
static const char PAT_SINGLETYPE = 't';
extern int subpattern_flags; extern int subpattern_flags;

View File

@@ -867,6 +867,13 @@ namespace patterns {
si.dir = 0; si.reflect = false; si.id = ctof(c); si.dir = 0; si.reflect = false; si.id = ctof(c);
si.symmetries = c->type; si.symmetries = c->type;
if(pat == PAT_SINGLETYPE) {
si.id = 0; si.symmetries = 1;
if(sub & SPF_TWOCOL) si.id = c->type & 1;
if(sub & SPF_EXTRASYM) si.reflect = true;
return si;
}
if(pat == PAT_ZEBRA && stdhyperbolic) { if(pat == PAT_ZEBRA && stdhyperbolic) {
si.id = zebra40(c); // 4 to 43 si.id = zebra40(c); // 4 to 43
@@ -1448,6 +1455,8 @@ namespace patterns {
else else
dialog::addBoolItem(XLAT("field pattern"), (whichPattern == PAT_FIELD), PAT_FIELD); dialog::addBoolItem(XLAT("field pattern"), (whichPattern == PAT_FIELD), PAT_FIELD);
dialog::addBoolItem(XLAT("single type"), (whichPattern == PAT_SINGLETYPE), PAT_SINGLETYPE);
if( if(
(whichPattern == PAT_EMERALD && (stdhyperbolic || a38)) || (whichPattern == PAT_EMERALD && (stdhyperbolic || a38)) ||
(whichPattern == PAT_PALACE && stdhyperbolic) || (whichPattern == PAT_PALACE && stdhyperbolic) ||
@@ -1485,6 +1494,11 @@ namespace patterns {
if(euclid && among(whichPattern, PAT_COLORING, 0)) if(euclid && among(whichPattern, PAT_COLORING, 0))
dialog::addBoolItem(XLAT("extra symmetries"), subpattern_flags & SPF_EXTRASYM, '='); dialog::addBoolItem(XLAT("extra symmetries"), subpattern_flags & SPF_EXTRASYM, '=');
if(whichPattern == PAT_SINGLETYPE) {
dialog::addBoolItem(XLAT("odd/even"), subpattern_flags & SPF_TWOCOL, '5');
dialog::addBoolItem(XLAT("extra symmetries"), subpattern_flags & SPF_EXTRASYM, '=');
}
if(euclid && among(whichPattern, PAT_COLORING, 0)) if(euclid && among(whichPattern, PAT_COLORING, 0))
dialog::addBoolItem(XLAT("full symmetry"), subpattern_flags & SPF_FULLSYM, '!'); dialog::addBoolItem(XLAT("full symmetry"), subpattern_flags & SPF_FULLSYM, '!');
@@ -1522,7 +1536,7 @@ namespace patterns {
keyhandler = [] (int sym, int uni) { keyhandler = [] (int sym, int uni) {
dialog::handleNavigation(sym, uni); dialog::handleNavigation(sym, uni);
if(among(uni, PAT_EMERALD, PAT_PALACE, PAT_ZEBRA, PAT_DOWN, PAT_FIELD, PAT_COLORING, PAT_SIBLING, PAT_CHESS)) { if(among(uni, PAT_EMERALD, PAT_PALACE, PAT_ZEBRA, PAT_DOWN, PAT_FIELD, PAT_COLORING, PAT_SIBLING, PAT_CHESS, PAT_SINGLETYPE)) {
if(whichPattern == uni) whichPattern = 0; if(whichPattern == uni) whichPattern = 0;
else whichPattern = uni; else whichPattern = uni;
#if CAP_EDIT #if CAP_EDIT
@@ -1630,16 +1644,34 @@ namespace patterns {
{g47, true, PAT_CHESS, 0} {g47, true, PAT_CHESS, 0}
}}, }},
{"single type", { {"single type", {
{gNormal, true, 0, 0}, {gNormal, true, PAT_SINGLETYPE, 0},
{gSphere, true, 0, SPF_EXTRASYM}, {gSphere, true, PAT_SINGLETYPE, 0},
{gEuclid, false, PAT_COLORING, SPF_EXTRASYM | SPF_ROT | SPF_FULLSYM}, {gEuclid, false, PAT_SINGLETYPE, 0},
{gOctagon, true, 0, SPF_EXTRASYM}, {gOctagon, true, PAT_SINGLETYPE, 0},
{g45, true, 0, 0}, {g45, true, PAT_SINGLETYPE, 0},
{g46, true, 0, 0}, {g46, true, PAT_SINGLETYPE, 0},
{g47, true, 0, 0}, {g47, true, PAT_SINGLETYPE, 0},
{gSmallSphere, true, 0, SPF_EXTRASYM}, {gSmallSphere, true, PAT_SINGLETYPE, 0},
{gTinySphere, true, 0, SPF_EXTRASYM}, {gTinySphere, true, PAT_SINGLETYPE, 0},
{gEuclidSquare, true, 0, SPF_EXTRASYM}, {gEuclidSquare, true, PAT_SINGLETYPE, 0},
}},
{"single type+symmetry", {
{gNormal, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{gSphere, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{gEuclid, false, PAT_SINGLETYPE, SPF_EXTRASYM},
{gOctagon, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{g45, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{g46, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{g47, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{gSmallSphere, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{gTinySphere, true, PAT_SINGLETYPE, SPF_EXTRASYM},
{gEuclidSquare, true, PAT_SINGLETYPE, SPF_EXTRASYM},
}},
{"odd/even", {
{gNormal, false, PAT_SINGLETYPE, SPF_TWOCOL},
{gSphere, false, PAT_SINGLETYPE, SPF_TWOCOL},
{g45, true, PAT_SINGLETYPE, SPF_TWOCOL},
{g47, true, PAT_SINGLETYPE, SPF_TWOCOL}
}}, }},
{"large picture", { {"large picture", {
{gNormal, false, PAT_PALACE, SPF_SYM0123}, {gNormal, false, PAT_PALACE, SPF_SYM0123},

View File

@@ -1425,7 +1425,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma
if(texture_map.count(si.id)) continue; if(texture_map.count(si.id)) continue;
int pshift = 0; int pshift = 0;
if(texture::cgroup == cpSingle) oldid = 1; if(texture::cgroup == cpSingle) oldid = 0;
if(texture::cgroup == cpFootball && patterns::cgroup == cpThree) { if(texture::cgroup == cpFootball && patterns::cgroup == cpThree) {
if(si.id == 4) pshift = 1; if(si.id == 4) pshift = 1;
oldid = !si.id; oldid = !si.id;
@@ -1450,7 +1450,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma
// printf("%08x remapping %d vertices to %d vertices\n", si.id, isize(mi.tvertices), isize(mi2.tvertices)); // printf("%08x remapping %d vertices to %d vertices\n", si.id, isize(mi.tvertices), isize(mi2.tvertices));
} }
catch(out_of_range&) { catch(out_of_range&) {
printf("Unexpected missing cell #%d/%d", si.id, oldid); printf("Unexpected missing cell #%d/%d\n", si.id, oldid);
addMessage(XLAT("Unexpected missing cell #%d/%d", its(si.id), its(oldid))); addMessage(XLAT("Unexpected missing cell #%d/%d", its(si.id), its(oldid)));
config.tstate_max = config.tstate = tsAdjusting; config.tstate_max = config.tstate = tsAdjusting;
return; return;