2018-02-08 23:40:26 +00:00
|
|
|
// Hyperbolic Rogue -- the 'experiments with geometry' menu
|
2019-08-10 11:43:24 +00:00
|
|
|
// Copyright (C) 2011-2019 Zeno Rogue, see 'hyper.cpp' for details
|
2018-02-08 23:40:26 +00:00
|
|
|
|
2019-08-10 11:43:24 +00:00
|
|
|
/** \file geom-exp.cpp
|
|
|
|
* \brief The 'experiments with geometry' menu
|
|
|
|
*
|
|
|
|
* Implementation of this menu, and computation of the statistics shown there
|
|
|
|
*/
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
namespace hr {
|
|
|
|
|
2017-11-06 20:18:40 +00:00
|
|
|
int eupage = 0;
|
|
|
|
int euperpage = 21;
|
|
|
|
|
|
|
|
string euchelp =
|
|
|
|
"If you want to know how much the gameplay is affected by the "
|
|
|
|
"hyperbolic geometry in HyperRogue, this mode is for you!\n\n"
|
|
|
|
|
|
|
|
"You can try many different geometries here. We start by gluing "
|
|
|
|
"n-gons in such a way that k of them meet in every vertex. "
|
|
|
|
"Depending on n and k, this either folds into a sphere, unfolds into a plane, "
|
2018-01-06 21:34:03 +00:00
|
|
|
"or requires a hyperbolic space. The result may be then 'bitrunc' by "
|
2017-11-06 20:18:40 +00:00
|
|
|
"replacing each vertex by a 2k-gon. Furthermore, you can play "
|
|
|
|
"with quotient geometries. For example, the elliptic geometry is "
|
|
|
|
"obtained from the sphere by making the antipodes be the same point, "
|
|
|
|
"so you return to the same spot (but as a mirror image) after going there. "
|
|
|
|
"Have fun experimenting! "
|
|
|
|
"Achievements and leaderboards do not work in geometry experiments, "
|
|
|
|
"except some specific ones.\n\n"
|
2018-01-06 21:34:03 +00:00
|
|
|
"In standard geometry (bitrunc or not), you can play the full game, but in other geometries "
|
2017-11-06 20:18:40 +00:00
|
|
|
"you select a particular land. Lands are unlocked by visiting them in this "
|
|
|
|
"session, or permanently by collecting 25 treasure. Try Crossroads in Euclidean "
|
|
|
|
"or chaos mode in non-standard non-quotient hyperbolic to visit many lands. "
|
|
|
|
"Highlights:\n"
|
|
|
|
"* Crystal World and Warped Coast can be understood as extra geometries.\n"
|
|
|
|
"* Halloween is specially designed for spherical geometry.\n"
|
|
|
|
"* To see the difference, try Hunting Grounds in Euclidean -- it is impossible.\n";
|
|
|
|
|
2019-02-17 17:33:15 +00:00
|
|
|
#if CAP_FIELD
|
2017-11-06 23:40:46 +00:00
|
|
|
void showQuotientConfig() {
|
2017-11-07 13:39:26 +00:00
|
|
|
using namespace fieldpattern;
|
2017-11-06 23:40:46 +00:00
|
|
|
gamescreen(2);
|
|
|
|
dialog::init(XLAT("advanced configuration"));
|
|
|
|
fgeomextra& gxcur = fgeomextras[current_extra];
|
2018-06-22 12:47:24 +00:00
|
|
|
for(int i=0; i<isize(fgeomextras); i++) {
|
2017-11-06 23:40:46 +00:00
|
|
|
auto& g = fgeomextras[i];
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addBoolItem(ginf[g.base].tiling_name, g.base == gxcur.base, 'a'+i);
|
2017-11-06 23:40:46 +00:00
|
|
|
}
|
|
|
|
nextPrimes(gxcur);
|
2018-06-22 12:47:24 +00:00
|
|
|
for(int i=0; i<isize(gxcur.primes); i++) {
|
2017-11-06 23:40:46 +00:00
|
|
|
auto& p = gxcur.primes[i];
|
2018-01-08 22:23:00 +00:00
|
|
|
dialog::addBoolItem(XLAT("order %1%2 (non-bitruncated cells: %3)", its(p.p), p.squared ? "²" : "", its(p.cells)), i == gxcur.current_prime_id, 'A'+i);
|
2017-11-06 23:40:46 +00:00
|
|
|
}
|
|
|
|
|
2018-06-22 12:47:24 +00:00
|
|
|
if(isize(gxcur.primes) < 6) {
|
2017-11-06 23:40:46 +00:00
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addHelp(
|
|
|
|
"This geometry is obtained by applying the same 'generators' which "
|
|
|
|
"lead to creating the given basic hyperbolic geometry, "
|
|
|
|
"but using a fixed finite field instead of the field of reals. "
|
|
|
|
"It can be also interpreted as a quotient of the given basic geometry. "
|
|
|
|
"Warning: field patterns based on large primes might generate for a long time."
|
|
|
|
);
|
|
|
|
dialog::addBreak(100);
|
|
|
|
}
|
|
|
|
|
|
|
|
dialog::addItem("find the next prime", 'p');
|
|
|
|
dialog::addItem("activate", 'x');
|
|
|
|
dialog::addItem("default", 'c');
|
|
|
|
|
|
|
|
keyhandler = [&gxcur] (int sym, int uni) {
|
2018-06-22 12:47:24 +00:00
|
|
|
if(uni >= 'a' && uni < 'a' + isize(fgeomextras))
|
2017-11-06 23:40:46 +00:00
|
|
|
current_extra = uni - 'a';
|
2018-06-22 12:47:24 +00:00
|
|
|
else if(uni >= 'A' && uni < 'A' + isize(gxcur.primes))
|
2017-11-06 23:40:46 +00:00
|
|
|
gxcur.current_prime_id = uni - 'A';
|
|
|
|
else if(uni == 'p')
|
|
|
|
nextPrime(gxcur);
|
2018-12-14 17:21:52 +00:00
|
|
|
else if(uni == 'x' || uni == '\n') dialog::do_if_confirmed([&gxcur] {
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gxcur.base);
|
2017-11-06 23:40:46 +00:00
|
|
|
enableFieldChange();
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gFieldQuotient);
|
2018-06-10 22:58:38 +00:00
|
|
|
start_game();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
|
|
|
else if(uni == 'c') dialog::do_if_confirmed([] {
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gEuclid);
|
2017-11-06 23:40:46 +00:00
|
|
|
fieldpattern::quotient_field_changed = false;
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gFieldQuotient);
|
2018-06-10 22:58:38 +00:00
|
|
|
start_game();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
2017-11-06 23:40:46 +00:00
|
|
|
else if(doexiton(sym, uni))
|
|
|
|
popScreen();
|
|
|
|
};
|
|
|
|
|
|
|
|
dialog::display();
|
|
|
|
}
|
2019-02-17 17:33:15 +00:00
|
|
|
#endif
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2018-01-06 21:34:03 +00:00
|
|
|
bool torus_bitrunc;
|
2017-12-28 15:46:10 +00:00
|
|
|
|
2018-11-11 10:06:32 +00:00
|
|
|
void prepare_torusconfig() {
|
|
|
|
torusconfig::newdy = torusconfig::dy;
|
|
|
|
torusconfig::newqty = torusconfig::qty;
|
|
|
|
torusconfig::newsdx = torusconfig::sdx;
|
|
|
|
torusconfig::newsdy = torusconfig::sdy;
|
|
|
|
torusconfig::newmode = torusconfig::torus_mode;
|
|
|
|
torus_bitrunc = PURE;
|
|
|
|
}
|
|
|
|
|
2017-11-06 20:18:40 +00:00
|
|
|
void showTorusConfig() {
|
2018-12-13 16:02:10 +00:00
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
2018-11-27 01:33:39 +00:00
|
|
|
if(euclid) cmode |= sm::TORUSCONFIG;
|
2017-11-06 20:18:40 +00:00
|
|
|
gamescreen(2);
|
|
|
|
|
2017-11-06 23:40:46 +00:00
|
|
|
dialog::init(XLAT("advanced configuration"));
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2017-12-28 15:46:10 +00:00
|
|
|
auto& mode = torusconfig::tmodes[torusconfig::newmode];
|
|
|
|
|
2018-11-27 01:32:37 +00:00
|
|
|
for(int i=0; i<isize(torusconfig::tmodes); i++) {
|
|
|
|
char let = "0123456789!@#" [i];
|
|
|
|
dialog::addBoolItem(torusconfig::tmodes[i].name, torusconfig::newmode == i, let);
|
|
|
|
dialog::add_action([i] () { torusconfig::newmode = torusconfig::eTorusMode(i); });
|
|
|
|
}
|
2017-12-28 15:46:10 +00:00
|
|
|
|
|
|
|
bool single = (mode.flags & torusconfig::TF_SINGLE);
|
|
|
|
bool square = (mode.flags & torusconfig::TF_SQUARE);
|
|
|
|
bool simple = (mode.flags & torusconfig::TF_SIMPLE);
|
2018-11-27 01:32:11 +00:00
|
|
|
bool cyl = (mode.flags & torusconfig::TF_CYL);
|
|
|
|
bool klein = (mode.flags & torusconfig::TF_KLEIN);
|
2017-12-28 15:46:10 +00:00
|
|
|
|
|
|
|
if(single) {
|
|
|
|
dialog::addSelItem(XLAT("number of cells (n)"), its(torusconfig::newqty), 'n');
|
2018-07-09 19:04:23 +00:00
|
|
|
if(mode.flags & torusconfig::TF_HEX)
|
2017-12-28 15:46:10 +00:00
|
|
|
dialog::addSelItem(XLAT("cell bottom-right from 0 (d)"), its(torusconfig::newdy), 'd');
|
|
|
|
else
|
|
|
|
dialog::addSelItem(XLAT("cell below 0 (d)"), its(torusconfig::newdy), 'd');
|
|
|
|
}
|
2018-11-27 01:32:11 +00:00
|
|
|
else if(cyl) {
|
|
|
|
dialog::addSelItem(XLAT("period (x)"), its(torusconfig::newsdx), 'x');
|
|
|
|
dialog::addSelItem(XLAT("period (y)"), its(torusconfig::newsdy), 'y');
|
|
|
|
}
|
2017-12-28 15:46:10 +00:00
|
|
|
else {
|
|
|
|
if(torusconfig::newsdx < 1) torusconfig::newsdx = 1;
|
|
|
|
if(torusconfig::newsdy < 1) torusconfig::newsdy = 1;
|
|
|
|
dialog::addSelItem(XLAT("width (x)"), its(torusconfig::newsdx), 'x');
|
|
|
|
dialog::addSelItem(XLAT("height (y)"), its(torusconfig::newsdy), 'y');
|
|
|
|
}
|
|
|
|
|
2019-04-08 11:47:56 +00:00
|
|
|
if(square) dialog::addBoolItem(XLAT("bitruncated"), torus_bitrunc, 't');
|
2017-12-28 15:46:10 +00:00
|
|
|
else dialog::addInfo("", 100);
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2017-12-28 15:46:10 +00:00
|
|
|
int valid = 2;
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2018-11-27 01:32:11 +00:00
|
|
|
int adx = torusconfig::newsdx, ady = torusconfig::newsdy;
|
2017-12-28 15:46:10 +00:00
|
|
|
if(single) {
|
|
|
|
if(square) {
|
|
|
|
dialog::addInfo("this mode has bad patterns", 0x808080), valid = 1;
|
2019-04-08 11:47:56 +00:00
|
|
|
if(torus_bitrunc && valid == 1 && (torusconfig::newqty%2 || torusconfig::newdy % 2 == 0))
|
2018-01-06 21:34:03 +00:00
|
|
|
dialog::addInfo("incompatible with bitruncating", 0x808080), valid = 0;
|
2017-12-28 15:46:10 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(torusconfig::newqty % 3)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "n", "3"), 0x808080), valid = 1;
|
|
|
|
if((torusconfig::newdy + 999999) % 3 != 2)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "d+1", "3"), 0x808080), valid = 1;
|
|
|
|
}
|
|
|
|
}
|
2018-11-27 01:32:11 +00:00
|
|
|
else if(cyl) {
|
|
|
|
if(torusconfig::sdx == 0 && torusconfig::sdy == 0)
|
|
|
|
dialog::addInfo(XLAT("period cannot be 0"), 0x800000), valid = 0;
|
|
|
|
else if(square) {
|
|
|
|
if(torusconfig::newsdy & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "y", "2"), 0x808080), valid = 1;
|
|
|
|
if(torusconfig::newsdx & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "x", "2"), 0x808080), valid = 1;
|
2019-04-08 11:47:56 +00:00
|
|
|
if(torus_bitrunc && valid == 1)
|
2018-11-27 01:32:11 +00:00
|
|
|
dialog::addInfo("incompatible with bitruncating", 0x808080), valid = 0;
|
2018-11-27 15:17:20 +00:00
|
|
|
if(klein && !torusconfig::mobius_symmetric(square, adx, ady))
|
2018-11-27 01:32:11 +00:00
|
|
|
dialog::addInfo("Möbius band requires a symmetric period", 0x800000), valid = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(torusconfig::newsdy % 3)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "y", "3"), 0x808080), valid = 1;
|
|
|
|
if(torusconfig::newsdx % 3)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "x", "3"), 0x808080), valid = 1;
|
2018-11-27 15:17:20 +00:00
|
|
|
if(klein && !torusconfig::mobius_symmetric(square, adx, ady))
|
2018-11-27 01:32:11 +00:00
|
|
|
dialog::addInfo("Möbius band requires a symmetric period", 0x800000), valid = 0;
|
|
|
|
}
|
|
|
|
}
|
2017-12-28 15:46:10 +00:00
|
|
|
else {
|
|
|
|
if(square) {
|
|
|
|
if(torusconfig::newsdx & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "x", "2"), 0x808080), valid = 1;
|
|
|
|
if(torusconfig::newsdy & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "y", "2"), 0x808080), valid = 1;
|
2019-04-08 11:47:56 +00:00
|
|
|
if(torus_bitrunc && valid == 1)
|
2018-01-06 21:34:03 +00:00
|
|
|
dialog::addInfo("incompatible with bitruncating", 0x808080), valid = 0;
|
2017-12-28 15:46:10 +00:00
|
|
|
}
|
|
|
|
else if(simple) {
|
2018-11-27 01:32:56 +00:00
|
|
|
if(torusconfig::newsdx % 3)
|
2017-12-28 15:46:10 +00:00
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "x", "3"), 0x808080), valid = 1;
|
2018-11-27 01:32:56 +00:00
|
|
|
if(torusconfig::newsdy % 3)
|
2017-12-28 15:46:10 +00:00
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "y", "3"), 0x808080), valid = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(torusconfig::newsdx & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "x", "3"), 0x808080), valid = 1;
|
|
|
|
if(torusconfig::newsdy & 1)
|
|
|
|
dialog::addInfo(XLAT("best if %1 is divisible by %2", "y", "2"), 0x808080), valid = 0;
|
|
|
|
}
|
|
|
|
}
|
2018-11-27 20:17:00 +00:00
|
|
|
if(cyl) {
|
|
|
|
if(!(square && klein)) {
|
|
|
|
dialog::addBoolItem(XLAT("set y=-2x for Crossroads"), ady == -2 * adx, 'C');
|
|
|
|
dialog::add_action([] () { torusconfig::newsdy = -2 * torusconfig::newsdx; });
|
|
|
|
}
|
|
|
|
dialog::addBoolItem(XLAT("set y=0 for Crossroads IV and Chaos Mode"), ady == 0, 'D');
|
|
|
|
dialog::add_action([] () { torusconfig::newsdy = 0; });
|
|
|
|
}
|
2017-11-06 20:18:40 +00:00
|
|
|
|
|
|
|
dialog::addSelItem(XLAT("scale factor"), fts(vid.scale), 'z');
|
|
|
|
|
|
|
|
#if CAP_RUG
|
2019-08-15 13:05:43 +00:00
|
|
|
if(GDIM == 2) dialog::addBoolItem(XLAT("hypersian rug mode"), (rug::rugged), 'u');
|
2017-11-06 20:18:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
dialog::addItem("activate", 'a');
|
|
|
|
dialog::addItem("default", 'c');
|
|
|
|
|
2017-12-28 15:46:10 +00:00
|
|
|
keyhandler = [=] (int sym, int uni) {
|
2018-11-27 20:17:00 +00:00
|
|
|
dialog::handleNavigation(sym, uni);
|
2018-11-27 01:32:37 +00:00
|
|
|
if(uni == 'n' && single)
|
2017-11-06 20:18:40 +00:00
|
|
|
dialog::editNumber(torusconfig::newqty, 0, 1000, 3, torusconfig::def_qty, XLAT("number of cells (n)"), "");
|
2017-12-28 15:46:10 +00:00
|
|
|
else if(uni == 'd' && single)
|
|
|
|
dialog::editNumber(torusconfig::newdy, -1000, 1000, 3, -torusconfig::def_dy, XLAT("cell below 0 (d)"), "");
|
|
|
|
else if(uni == 'x' && !single)
|
|
|
|
dialog::editNumber(torusconfig::newsdx, 0, 1000, square ? 2 : 3, 12, XLAT("width (x)"), "");
|
|
|
|
else if(uni == 'y' && !single)
|
|
|
|
dialog::editNumber(torusconfig::newsdy, 0, 1000, square ? 2 : simple ? 3 : 2, 12, XLAT("height (y)"), "");
|
|
|
|
else if(uni == 't')
|
2018-01-06 21:34:03 +00:00
|
|
|
torus_bitrunc = !torus_bitrunc;
|
2018-12-14 17:21:52 +00:00
|
|
|
else if((uni == 'a' || uni == '\n') && torusconfig::newqty >= 3 && valid) dialog::do_if_confirmed([square] {
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gNormal);
|
2017-12-28 15:46:10 +00:00
|
|
|
torusconfig::torus_mode = torusconfig::newmode;
|
2017-11-06 20:18:40 +00:00
|
|
|
torusconfig::qty = torusconfig::newqty;
|
|
|
|
torusconfig::dy = torusconfig::newdy;
|
2017-12-28 15:46:10 +00:00
|
|
|
torusconfig::sdx = torusconfig::newsdx;
|
|
|
|
torusconfig::sdy = torusconfig::newsdy;
|
|
|
|
torusconfig::activate();
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gTorus);
|
|
|
|
set_variation((torus_bitrunc || !square) ? eVariation::bitruncated : eVariation::pure);
|
2018-06-10 22:58:38 +00:00
|
|
|
start_game();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
|
|
|
else if(uni == 'c') dialog::do_if_confirmed([] {
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gEuclid);
|
2017-12-28 15:46:10 +00:00
|
|
|
torusconfig::torus_mode = torusconfig::tmSingle;
|
2017-11-06 20:18:40 +00:00
|
|
|
torusconfig::qty = torusconfig::def_qty;
|
|
|
|
torusconfig::dy = torusconfig::def_dy;
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gTorus);
|
2018-06-10 22:58:38 +00:00
|
|
|
start_game();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
2017-11-06 20:18:40 +00:00
|
|
|
else if(uni == 'z') editScale();
|
2017-11-07 12:09:46 +00:00
|
|
|
#if CAP_RUG
|
2019-08-15 13:05:43 +00:00
|
|
|
else if(uni == 'u' && GDIM == 2) rug::select();
|
2017-11-07 12:09:46 +00:00
|
|
|
#endif
|
2017-11-06 20:18:40 +00:00
|
|
|
else if(doexiton(sym, uni))
|
|
|
|
popScreen();
|
|
|
|
};
|
|
|
|
|
|
|
|
dialog::display();
|
|
|
|
}
|
|
|
|
|
2019-08-10 08:57:14 +00:00
|
|
|
EX string bitruncnames[5] = {" (b)", " (n)", " (g)", " (i)", " (d)"};
|
2017-12-19 13:35:34 +00:00
|
|
|
|
2018-06-17 17:04:17 +00:00
|
|
|
void validity_info() {
|
|
|
|
int vccolors[4] = {0xFF0000, 0xFF8000, 0xFFFF00, 0x00FF00};
|
|
|
|
auto lv = land_validity(specialland);
|
|
|
|
if(lv.flags & lv::display_error_message)
|
|
|
|
dialog::addInfo(XLAT(lv.msg), vccolors[lv.quality_level]);
|
|
|
|
else
|
|
|
|
dialog::addBreak(100);
|
|
|
|
}
|
|
|
|
|
2018-06-21 23:48:46 +00:00
|
|
|
bool showquotients;
|
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
string validclasses[4] = {" (X)", " (½)", "", " (!)"};
|
|
|
|
|
|
|
|
void ge_land_selection() {
|
2018-12-13 16:02:10 +00:00
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
2017-11-06 20:18:40 +00:00
|
|
|
gamescreen(0);
|
2019-02-06 15:34:22 +00:00
|
|
|
|
2017-11-06 20:18:40 +00:00
|
|
|
if(cheater) for(int i=0; i<landtypes; i++) landvisited[i] = true;
|
2019-02-06 15:34:22 +00:00
|
|
|
|
2017-11-06 20:18:40 +00:00
|
|
|
for(int i=0; i<landtypes; i++)
|
|
|
|
if(hiitemsMax(treasureType(eLand(i))) >= 25) landvisited[i] = true;
|
|
|
|
landvisited[laCrossroads] = true;
|
2018-01-08 22:11:29 +00:00
|
|
|
landvisited[laCrossroads4] = true;
|
2017-11-06 20:18:40 +00:00
|
|
|
landvisited[laIce] = true;
|
|
|
|
landvisited[laHunting] = true;
|
|
|
|
landvisited[laMirrorOld] = true;
|
|
|
|
landvisited[laPrincessQuest] = cheater || princess::everSaved;
|
|
|
|
landvisited[laWildWest] = true;
|
|
|
|
landvisited[laHalloween] = true;
|
|
|
|
landvisited[laWarpCoast] = true;
|
|
|
|
landvisited[laGraveyard] = true;
|
|
|
|
landvisited[laDual] = true;
|
2018-01-05 13:19:56 +00:00
|
|
|
landvisited[laDocks] |= landvisited[laWarpCoast];
|
|
|
|
landvisited[laSnakeNest] |= landvisited[laRedRock];
|
2019-01-14 21:55:19 +00:00
|
|
|
landvisited[laCamelot] |= hiitemsMax(treasureType(laCamelot)) >= 1;
|
2017-11-06 20:18:40 +00:00
|
|
|
landvisited[laCA] = true;
|
2019-04-07 01:09:01 +00:00
|
|
|
landvisited[laAsteroids] = true;
|
2018-06-17 17:04:17 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::init(XLAT("experiment with geometry"));
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
// dialog::addSelItem(XLAT("geometry"), XLAT(bitruncnames[int(variation)]), '5');
|
|
|
|
// dialog::addBreak(50);
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
generateLandList([] (eLand l) { return land_validity(l).flags & lv::appears_in_geom_exp; });
|
|
|
|
stable_sort(landlist.begin(), landlist.end(), [] (eLand l1, eLand l2) { return land_validity(l1).quality_level > land_validity(l2).quality_level; });
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
for(int i=0; i<euperpage; i++) {
|
|
|
|
if(euperpage * eupage + i >= isize(landlist)) { dialog::addBreak(100); break; }
|
|
|
|
eLand l = landlist[euperpage * eupage + i];
|
|
|
|
char ch;
|
|
|
|
if(i < 26) ch = 'a' + i;
|
|
|
|
else ch = 'A' + (i-26);
|
|
|
|
string s = XLAT1(linf[l].name);
|
|
|
|
|
|
|
|
if(landvisited[l]) {
|
|
|
|
dialog::addBoolItem(s, l == specialland, ch);
|
2017-11-06 20:18:40 +00:00
|
|
|
}
|
2018-08-29 19:16:45 +00:00
|
|
|
else {
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(s, XLAT("(locked)"), ch);
|
2018-08-29 19:16:45 +00:00
|
|
|
}
|
2019-02-06 15:34:22 +00:00
|
|
|
|
|
|
|
dialog::lastItem().color = linf[l].color;
|
|
|
|
dialog::lastItem().value += validclasses[land_validity(l).quality_level];
|
|
|
|
dialog::add_action([l] {
|
2019-05-29 13:52:49 +00:00
|
|
|
if(landvisited[l]) dialog::do_if_confirmed(dual::mayboth([l] {
|
2019-02-06 15:34:22 +00:00
|
|
|
stop_game_and_switch_mode(tactic::on ? rg::tactic : rg::nothing);
|
|
|
|
firstland = specialland = l;
|
|
|
|
start_game();
|
|
|
|
popScreen();
|
2019-05-29 13:52:49 +00:00
|
|
|
}));
|
2019-02-06 15:34:22 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
dialog::addBreak(50);
|
|
|
|
if(chaosUnlocked && !quotient && !euclid && !sphere) {
|
|
|
|
dialog::addItem(XLAT("Chaos mode"), '1');
|
2019-05-29 13:52:49 +00:00
|
|
|
dialog::add_action(dual::mayboth([] {
|
2019-02-06 15:34:22 +00:00
|
|
|
if(chaosUnlocked) dialog::do_if_confirmed([] {
|
|
|
|
stop_game_and_switch_mode(rg::chaos);
|
|
|
|
start_game();
|
|
|
|
});
|
2019-05-29 13:52:49 +00:00
|
|
|
}));
|
2019-02-06 15:34:22 +00:00
|
|
|
}
|
|
|
|
dialog::addItem(XLAT("next page"), '-');
|
|
|
|
|
|
|
|
dialog::addBreak(25);
|
|
|
|
validity_info();
|
|
|
|
dialog::addBreak(25);
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-05-29 13:52:49 +00:00
|
|
|
dual::add_choice();
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addBack();
|
|
|
|
dialog::display();
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
keyhandler = [] (int sym, int uni) {
|
|
|
|
dialog::handleNavigation(sym, uni);
|
|
|
|
|
|
|
|
if(uni == '-' || uni == PSEUDOKEY_WHEELUP || uni == PSEUDOKEY_WHEELDOWN) {
|
|
|
|
eupage++;
|
|
|
|
if(eupage * euperpage >= isize(landlist)) eupage = 0;
|
|
|
|
}
|
|
|
|
else if(doexiton(sym, uni)) popScreen();
|
|
|
|
};
|
|
|
|
}
|
2018-11-30 14:26:50 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
vector<eGeometry> tilinglist = {
|
|
|
|
gTinySphere, gSmallSphere, gSphere, gEuclid, gNormal, gOctagon,
|
|
|
|
gOctahedron, gEuclidSquare, g45, g46, g47,
|
2019-07-25 10:24:02 +00:00
|
|
|
gArchimedean, gBinary4, gBinaryTiling, gKiteDart2
|
2019-02-06 15:34:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vector<eGeometry> quotientlist = {
|
|
|
|
gElliptic,
|
|
|
|
gZebraQuotient, gFieldQuotient, gTorus,
|
|
|
|
gSmallElliptic,
|
|
|
|
gKleinQuartic, gBolza, gBolza2, gMinimal,
|
|
|
|
gMacbeath, gBring, gSchmutzM2, gSchmutzM3, gCrystal
|
|
|
|
};
|
|
|
|
|
2019-02-25 23:42:38 +00:00
|
|
|
vector<eGeometry> list3d = {
|
2019-03-15 12:46:23 +00:00
|
|
|
gBinary3, gHoroTris, gHoroRec, gHoroHex,
|
2019-03-02 23:43:31 +00:00
|
|
|
gSpace534, gSpace435,
|
2019-03-15 12:46:23 +00:00
|
|
|
gField534, gField435,
|
2019-03-02 23:43:31 +00:00
|
|
|
gCubeTiling, gRhombic3, gBitrunc3,
|
|
|
|
gCell120, gECell120,
|
|
|
|
gCell600, gECell600,
|
|
|
|
gCell24, gECell24,
|
|
|
|
gCell16, gECell16,
|
|
|
|
gCell8, gECell8,
|
2019-08-27 07:18:21 +00:00
|
|
|
gCell5, gKiteDart3, gSol, gNil, gProduct, gRotSpace
|
2019-02-25 23:42:38 +00:00
|
|
|
};
|
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
void ge_select_tiling(const vector<eGeometry>& lst) {
|
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
|
|
|
gamescreen(0);
|
|
|
|
|
|
|
|
dialog::init(XLAT("experiment with geometry"));
|
2019-03-02 23:49:37 +00:00
|
|
|
|
2019-06-18 12:17:51 +00:00
|
|
|
/* if(&lst == &list3d)
|
|
|
|
dialog::addInfo("3D geometries are a work in progress", 0x800000); */
|
2019-02-06 15:34:22 +00:00
|
|
|
|
|
|
|
char letter = 'a';
|
|
|
|
for(eGeometry i: lst) {
|
|
|
|
bool on = geometry == i;
|
|
|
|
dynamicval<eGeometry> cg(geometry, eGeometry(i));
|
2019-02-17 17:28:20 +00:00
|
|
|
if(archimedean && !CAP_ARCM) continue;
|
2019-08-22 10:14:39 +00:00
|
|
|
if(cryst && !CAP_CRYSTAL) continue;
|
2019-02-17 17:33:15 +00:00
|
|
|
if(geometry == gFieldQuotient && !CAP_FIELD) continue;
|
2019-08-26 14:21:05 +00:00
|
|
|
dialog::addBoolItem(XLAT(
|
2019-08-27 07:18:21 +00:00
|
|
|
(geometry == gProduct && !hybri) ? XLAT("current geometry x E") :
|
|
|
|
(geometry == gRotSpace && !hybri) ? XLAT("space of rotations in current geometry") :
|
2019-08-26 14:21:05 +00:00
|
|
|
ginf[i].menu_displayed_name), on, letter++);
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
2019-06-18 12:19:24 +00:00
|
|
|
dialog::add_action(dual::mayboth([i] {
|
2019-02-06 15:34:22 +00:00
|
|
|
eGeometry targetgeometry = eGeometry(i);
|
2019-02-17 17:28:20 +00:00
|
|
|
if(0) ;
|
|
|
|
#if CAP_CRYSTAL
|
|
|
|
else if(targetgeometry == gCrystal)
|
2019-02-06 15:34:22 +00:00
|
|
|
pushScreen(crystal::show);
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_ARCM
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(targetgeometry == gArchimedean)
|
|
|
|
pushScreen(arcm::show);
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
else dialog::do_if_confirmed([targetgeometry] () {
|
2019-08-27 07:18:21 +00:00
|
|
|
bool th = among(targetgeometry, gProduct, gRotSpace);
|
2019-08-26 13:09:08 +00:00
|
|
|
if(th && (WDIM == 3 || euclid)) {
|
2019-08-18 21:12:36 +00:00
|
|
|
addMessage(XLAT("Only works with 2D non-Euclidean geometries"));
|
|
|
|
return;
|
|
|
|
}
|
2019-08-27 07:18:21 +00:00
|
|
|
if(targetgeometry == gRotSpace) {
|
2019-08-26 13:09:08 +00:00
|
|
|
bool ok = true;
|
|
|
|
if(archimedean) ok = PURE;
|
|
|
|
else if(binarytiling || penrose) ok = false;
|
|
|
|
else ok = PURE || BITRUNCATED;
|
|
|
|
if(!ok) addMessage(XLAT("Only works with (semi-)regular tilings"));
|
|
|
|
}
|
2019-02-06 15:34:22 +00:00
|
|
|
set_geometry(targetgeometry);
|
|
|
|
start_game();
|
|
|
|
if(euwrap) {
|
|
|
|
prepare_torusconfig();
|
|
|
|
pushScreen(showTorusConfig);
|
|
|
|
}
|
2019-02-17 17:33:15 +00:00
|
|
|
#if CAP_FIELD
|
2019-02-06 15:34:22 +00:00
|
|
|
if(geometry == gFieldQuotient) {
|
|
|
|
pushScreen(showQuotientConfig);
|
|
|
|
}
|
2019-02-17 17:33:15 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
});
|
2019-06-18 12:19:24 +00:00
|
|
|
}));
|
2019-02-06 15:34:22 +00:00
|
|
|
}
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-06-18 12:19:24 +00:00
|
|
|
dual::add_choice();
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addBack();
|
|
|
|
dialog::display();
|
|
|
|
}
|
|
|
|
|
2019-08-10 00:16:48 +00:00
|
|
|
EX string current_proj_name() {
|
2019-08-06 19:01:21 +00:00
|
|
|
if(pmodel != mdDisk || nonisotropic)
|
2019-08-09 22:58:50 +00:00
|
|
|
return models::get_model_name(pmodel);
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(hyperbolic && vid.alpha == 1)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("Poincaré model");
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(hyperbolic && vid.alpha == 0)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("Klein-Beltrami model");
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(hyperbolic && vid.alpha == -1)
|
2019-04-04 15:13:15 +00:00
|
|
|
return XLAT("inverted Poincaré model");
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(sphere && vid.alpha == 1)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("stereographic projection");
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(sphere && vid.alpha == 0)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("gnomonic projection");
|
2019-03-20 01:12:37 +00:00
|
|
|
else if(sphere && vid.alpha >= 999)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("orthographic projection");
|
2019-03-20 01:12:37 +00:00
|
|
|
else if(hyperbolic && vid.alpha >= 999)
|
2019-04-05 11:59:55 +00:00
|
|
|
return XLAT("Gans model");
|
2019-02-06 15:34:22 +00:00
|
|
|
else
|
2019-03-20 01:12:37 +00:00
|
|
|
return XLAT("general perspective");
|
2019-02-06 15:34:22 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 20:07:03 +00:00
|
|
|
EX void showEuclideanMenu() {
|
2019-02-06 15:34:22 +00:00
|
|
|
// for(int i=2; i<lt; i++) landvisited[i] = true;
|
|
|
|
|
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
|
|
|
gamescreen(0);
|
|
|
|
|
|
|
|
dialog::init(XLAT("experiment with geometry"));
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("basic tiling"), XLAT(ginf[geometry].tiling_name), 't');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push([] { ge_select_tiling(tilinglist); });
|
2018-11-27 01:32:11 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
int ts = ginf[geometry].sides;
|
|
|
|
int tv = ginf[geometry].vertex;
|
|
|
|
int nom = (BITRUNCATED ? tv+ts : tv) * 4;
|
|
|
|
int denom = (2*ts + 2*tv - ts * tv);
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_GP
|
2019-02-06 15:34:22 +00:00
|
|
|
if(GOLDBERG && S3)
|
2019-05-26 16:04:02 +00:00
|
|
|
nom = 2 * (2*tv + ts * (cgi.gpdata->area-1));
|
2018-11-30 14:26:50 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
if(GOLDBERG && S3 == 4)
|
2019-05-26 16:04:02 +00:00
|
|
|
nom = 2 * (2*tv + 2 * ts * (cgi.gpdata->area-1));
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
|
|
|
|
int worldsize;
|
2018-08-29 19:16:45 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
int euler = 0;
|
|
|
|
if(euclid) euler = 0;
|
|
|
|
else if(sphere && nonorientable) euler = 1;
|
|
|
|
else if(sphere) euler = 2;
|
|
|
|
else if(!bounded) euler = -2;
|
2019-05-08 16:33:08 +00:00
|
|
|
else if(WDIM == 3) euler = 0;
|
2019-02-06 15:34:22 +00:00
|
|
|
else switch(geometry) {
|
|
|
|
case gFieldQuotient:
|
|
|
|
worldsize = isize(currentmap->allcells());
|
|
|
|
euler = 2 * worldsize * denom / nom;
|
|
|
|
break;
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
case gMinimal:
|
|
|
|
euler = -1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gZebraQuotient:
|
|
|
|
case gBolza:
|
|
|
|
euler = -2;
|
|
|
|
break;
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
case gKleinQuartic:
|
|
|
|
case gSchmutzM2:
|
|
|
|
case gBolza2:
|
|
|
|
euler = -4;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gSchmutzM3:
|
|
|
|
case gBring:
|
|
|
|
euler = -6;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case gMacbeath:
|
|
|
|
euler = -12;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
println(hlog, "warning: Euler characteristics unknown");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
nom *= euler;
|
|
|
|
denom *= 2;
|
|
|
|
|
|
|
|
int g = gcd(nom, denom);
|
|
|
|
if(g) {
|
|
|
|
nom /= g;
|
|
|
|
denom /= g;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(fulltorus) {
|
|
|
|
using namespace torusconfig;
|
|
|
|
auto& mode = tmodes[torus_mode];
|
|
|
|
if(mode.flags & TF_SINGLE)
|
|
|
|
worldsize = qty;
|
2017-11-06 20:18:40 +00:00
|
|
|
else
|
2019-02-06 15:34:22 +00:00
|
|
|
worldsize = sdx * sdy;
|
|
|
|
}
|
|
|
|
else worldsize = denom ? nom / denom : 0;
|
|
|
|
|
|
|
|
if(euler < 0 && !bounded)
|
|
|
|
worldsize = -worldsize;
|
|
|
|
|
|
|
|
string spf = its(ts);
|
2019-02-17 17:28:20 +00:00
|
|
|
if(0) ;
|
|
|
|
#if CAP_ARCM
|
|
|
|
else if(archimedean) {
|
2019-02-06 15:34:22 +00:00
|
|
|
spf = "";
|
|
|
|
for(int i: arcm::current.faces) {
|
|
|
|
if(spf != "") spf += ",";
|
|
|
|
spf += its(i);
|
|
|
|
}
|
|
|
|
if(BITRUNCATED) spf = "[" + spf + "]," + its(arcm::current.N * 2) + "," + its(arcm::current.N * 2);
|
|
|
|
if(DUAL) spf = its(arcm::current.N) + "^[" + spf + "]";
|
2017-11-06 20:18:40 +00:00
|
|
|
}
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_BT
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(binarytiling)
|
|
|
|
spf = "6,[6,7],7";
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(BITRUNCATED && !euclid6)
|
|
|
|
spf = spf + "," + its(S6) + "," + its(S6);
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_IRR
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(IRREGULAR && irr::bitruncations_performed)
|
|
|
|
spf = "[4..8],6,6";
|
|
|
|
else if(IRREGULAR)
|
|
|
|
spf = "[4..8]^3";
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_GP
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(GOLDBERG && S3 == 4 && gp::param == gp::loc(1, 1))
|
|
|
|
spf = spf + ",4," + spf + ",4";
|
|
|
|
else if(GOLDBERG && S3 == 4 && gp::param == gp::loc(2, 0))
|
|
|
|
spf = spf + ",4,4,4";
|
|
|
|
else if(GOLDBERG && S3 == 4)
|
|
|
|
spf = "[" + spf + ",4],4,4,4";
|
|
|
|
else if(GOLDBERG && S3 == 3)
|
|
|
|
spf = "[" + spf + ",6],6,6";
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2017-11-06 20:18:40 +00:00
|
|
|
else {
|
2019-02-06 15:34:22 +00:00
|
|
|
string spf0 = spf;
|
|
|
|
for(int z=1; z<S3; z++) spf = spf + "," + spf0;
|
|
|
|
}
|
|
|
|
|
|
|
|
string qstring = ginf[geometry].quotient_name;
|
|
|
|
|
|
|
|
if(qstring == "none")
|
|
|
|
dialog::addBoolItem(XLAT("quotient space"), false, 'q');
|
|
|
|
else
|
|
|
|
dialog::addSelItem(XLAT("quotient space"), XLAT(qstring), 'q');
|
|
|
|
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push([] { ge_select_tiling(quotientlist); });
|
2019-02-06 15:34:22 +00:00
|
|
|
|
2019-05-06 23:08:49 +00:00
|
|
|
#if MAXMDIM >= 4
|
2019-05-08 16:33:08 +00:00
|
|
|
dialog::addSelItem(XLAT("dimension"), its(WDIM), 'd');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push([] { ge_select_tiling(list3d); });
|
2019-05-06 23:08:49 +00:00
|
|
|
#endif
|
2019-02-25 23:42:38 +00:00
|
|
|
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_IRR
|
2019-02-06 15:34:22 +00:00
|
|
|
if(hyperbolic && IRREGULAR) {
|
|
|
|
nom = isize(irr::cells);
|
|
|
|
// both Klein Quartic and Bolza2 are double the Zebra quotiennt
|
|
|
|
denom = -2;
|
|
|
|
if(!quotient) worldsize = nom / denom;
|
|
|
|
}
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
|
2019-08-18 21:12:36 +00:00
|
|
|
if(prod) {
|
|
|
|
dialog::addSelItem(XLAT("Z-level height factor"), fts(vid.plevel_factor), 'Z');
|
|
|
|
dialog::add_action([] {
|
|
|
|
dialog::editNumber(vid.plevel_factor, 0, 2, 0.1, 0.7, XLAT("Z-level height factor"), "");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
else if(ts == 6 && tv == 3)
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("variations"), XLAT("does not matter"), 'v');
|
|
|
|
else if(binarytiling) {
|
|
|
|
dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v');
|
|
|
|
dialog::add_action([] {
|
|
|
|
dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), "");
|
|
|
|
dialog::reaction = [] () {
|
|
|
|
#if CAP_TEXTURE
|
|
|
|
texture::config.remap();
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
});
|
2019-05-09 15:54:30 +00:00
|
|
|
extern void add_edit_wall_quality(char);
|
|
|
|
add_edit_wall_quality('W');
|
2019-02-06 15:34:22 +00:00
|
|
|
}
|
2019-07-25 10:24:02 +00:00
|
|
|
else if(WDIM == 3 || penrose) dialog::addBreak(100);
|
2019-02-06 15:34:22 +00:00
|
|
|
else {
|
|
|
|
dialog::addSelItem(XLAT("variations"), gp::operation_name(), 'v');
|
|
|
|
dialog::add_action([] {
|
2019-02-25 23:42:38 +00:00
|
|
|
if(0) ;
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_ARCM
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(archimedean) arcm::next_variation();
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
else if(euclid4 || !CAP_GP) dialog::do_if_confirmed([] {
|
2019-02-06 15:34:22 +00:00
|
|
|
set_variation(PURE ? eVariation::bitruncated : eVariation::pure);
|
|
|
|
start_game();
|
|
|
|
});
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_GP
|
2019-02-06 15:34:22 +00:00
|
|
|
else // if(S3 == 3)
|
|
|
|
gp::configure();
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-22 10:14:39 +00:00
|
|
|
if(euwrap || geometry == gFieldQuotient || cryst || archimedean || (euclid && WDIM == 3)) {
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addItem(XLAT("advanced parameters"), '4');
|
|
|
|
dialog::add_action([] {
|
2019-02-17 17:28:20 +00:00
|
|
|
if(0);
|
|
|
|
#if CAP_ARCM
|
|
|
|
else if(archimedean)
|
2019-02-06 15:34:22 +00:00
|
|
|
pushScreen(arcm::show);
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_CRYSTAL
|
2019-08-22 10:14:39 +00:00
|
|
|
else if(cryst)
|
2019-02-06 15:34:22 +00:00
|
|
|
pushScreen(crystal::show);
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-04-15 21:29:07 +00:00
|
|
|
#if MAXMDIM == 4
|
2019-05-08 16:33:08 +00:00
|
|
|
else if(euclid && WDIM == 3)
|
2019-04-15 21:29:07 +00:00
|
|
|
euclid3::prepare_torus3(),
|
|
|
|
pushScreen(euclid3::show_torus3);
|
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(euwrap)
|
|
|
|
prepare_torusconfig(),
|
|
|
|
pushScreen(showTorusConfig);
|
2019-02-17 17:33:15 +00:00
|
|
|
#if CAP_FIELD
|
2019-02-06 15:34:22 +00:00
|
|
|
else if(geometry == gFieldQuotient)
|
|
|
|
pushScreen(showQuotientConfig);
|
2019-02-17 17:33:15 +00:00
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
else dialog::addBreak(100);
|
|
|
|
|
|
|
|
dialog::addBreak(50);
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("land"), XLAT1(linf[specialland].name), 'l');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(ge_land_selection);
|
2019-04-04 12:36:45 +00:00
|
|
|
|
|
|
|
if(specialland == laMinefield && bounded) {
|
|
|
|
dialog::addSelItem(XLAT("number of mines"), its(bounded_mine_quantity), 'm');
|
|
|
|
dialog::add_action([] {
|
2019-04-04 15:14:46 +00:00
|
|
|
dialog::editNumber(bounded_mine_quantity, 0, bounded_mine_max, 1, (bounded_mine_max+5)/10,
|
2019-04-04 12:36:45 +00:00
|
|
|
XLAT("number of mines"), "");
|
|
|
|
dialog::reaction = [] {
|
|
|
|
if(bounded_mine_quantity < 0) bounded_mine_quantity = 0;
|
|
|
|
if(bounded_mine_quantity > bounded_mine_max) bounded_mine_quantity = bounded_mine_max;
|
|
|
|
};
|
|
|
|
dialog::reaction_final = [] {
|
|
|
|
bounded_mine_percentage = bounded_mine_quantity * 1. / bounded_mine_max;
|
|
|
|
stop_game();
|
|
|
|
start_game();
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
2019-04-08 12:58:54 +00:00
|
|
|
|
2019-04-08 14:16:16 +00:00
|
|
|
if(specialland == laMinefield && geometry_has_alt_mine_rule()) {
|
2019-05-08 16:33:08 +00:00
|
|
|
dialog::addSelItem(XLAT("mine adjacency rule"), XLAT(mine_adjacency_rule ? "vertex" : WDIM == 3 ? "face" : "edge"), 'M');
|
2019-04-08 12:58:54 +00:00
|
|
|
dialog::add_action([] {
|
|
|
|
stop_game();
|
|
|
|
mine_adjacency_rule = !mine_adjacency_rule;
|
|
|
|
start_game();
|
|
|
|
});
|
|
|
|
}
|
2019-04-04 12:36:45 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addBoolItem(XLAT("pattern"), specialland == laCanvas, 'p');
|
|
|
|
if(specialland == laCanvas) dialog::lastItem().value = patterns::whichCanvas;
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(patterns::showPrePattern);
|
2019-02-06 15:34:22 +00:00
|
|
|
validity_info();
|
2019-05-08 16:33:08 +00:00
|
|
|
if(WDIM == 3) {
|
2019-03-20 01:10:53 +00:00
|
|
|
dialog::addItem(XLAT("3D configuration"), '9');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(show3D);
|
2019-02-28 02:41:12 +00:00
|
|
|
}
|
2019-03-20 01:10:53 +00:00
|
|
|
dialog::addSelItem(XLAT("projection"), current_proj_name(), '1');
|
2019-08-09 22:58:50 +00:00
|
|
|
dialog::add_action_push(models::model_menu);
|
2019-08-06 10:00:46 +00:00
|
|
|
if(nonisotropic)
|
|
|
|
dialog::addBoolItem_action(XLAT("geodesic movement in Sol/Nil"), nisot::geodesic_movement, 'G');
|
2019-03-06 15:36:10 +00:00
|
|
|
#if CAP_CRYSTAL && MAXMDIM >= 4
|
|
|
|
crystal::add_crystal_transform('x');
|
|
|
|
#endif
|
2019-02-06 15:34:22 +00:00
|
|
|
|
|
|
|
dialog::addBreak(50);
|
|
|
|
|
2019-02-08 15:52:44 +00:00
|
|
|
#if CAP_SHOT
|
2019-04-04 15:13:15 +00:00
|
|
|
dialog::addItem(XLAT("take screenshot"), 's');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(shot::menu);
|
2019-02-08 15:52:44 +00:00
|
|
|
#endif
|
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addHelp();
|
|
|
|
dialog::addBack();
|
|
|
|
|
|
|
|
dialog::addBreak(150);
|
|
|
|
|
|
|
|
string fgname = XLAT(ginf[geometry].tiling_name);
|
|
|
|
if(qstring != "none") fgname += " " + XLAT(qstring);
|
|
|
|
if(!euclid6) fgname = gp::operation_name() + " " + fgname;
|
|
|
|
|
|
|
|
dialog::addTitle(XLAT("info about: %1", fgname), 0xFFFFFF, 150);
|
|
|
|
|
2019-05-08 16:33:08 +00:00
|
|
|
if(WDIM == 2) dialog::addSelItem(XLAT("faces per vertex"), spf, 0);
|
2019-02-25 23:42:38 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("size of the world"),
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_BT
|
2019-05-21 22:01:30 +00:00
|
|
|
binarytiling ? fts(8 * M_PI * sqrt(2) * log(2) / pow(vid.binary_width, WDIM-1), 4) + " exp(∞)" :
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_ARCM
|
2019-02-06 15:34:22 +00:00
|
|
|
archimedean ? arcm::current.world_size() :
|
|
|
|
(archimedean && sphere) ? its(isize(currentmap->allcells())) :
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
|
|
|
#if CAP_CRYSTAL
|
2019-08-22 10:14:39 +00:00
|
|
|
cryst ? "∞^" + its(ts/2) :
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-05-08 16:33:08 +00:00
|
|
|
WDIM == 3 && bounded ? its(isize(currentmap->allcells())) :
|
|
|
|
WDIM == 3 && euclid ? "∞" :
|
2019-02-06 15:34:22 +00:00
|
|
|
worldsize < 0 ? (nom%denom ? its(nom)+"/"+its(denom) : its(-worldsize)) + " exp(∞)":
|
|
|
|
(euwrap && !fulltorus) ? "∞" :
|
|
|
|
worldsize == 0 ? "∞²" :
|
|
|
|
its(worldsize),
|
|
|
|
'3');
|
|
|
|
|
2019-05-08 16:33:08 +00:00
|
|
|
if(WDIM == 2) dialog::add_action([] {
|
2019-02-06 15:34:22 +00:00
|
|
|
if(!viewdists) { enable_viewdists(); pushScreen(viewdist_configure_dialog); }
|
|
|
|
else if(viewdists) viewdists = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
if(bounded) {
|
2019-05-08 16:33:08 +00:00
|
|
|
if(WDIM == 3) euler = 0;
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("Euler characteristics"), its(euler), 0);
|
2019-05-08 16:33:08 +00:00
|
|
|
if(WDIM == 3) ;
|
2019-02-25 23:42:38 +00:00
|
|
|
else if(nonorientable)
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("demigenus"), its(2-euler), 0);
|
|
|
|
else
|
|
|
|
dialog::addSelItem(XLAT("genus"), its((2-euler)/2), 0);
|
|
|
|
}
|
|
|
|
else dialog::addBreak(200);
|
|
|
|
|
|
|
|
switch(ginf[geometry].cclass) {
|
2019-08-06 09:56:53 +00:00
|
|
|
case gcHyperbolic:
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("hyperbolic"), 0);
|
|
|
|
break;
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-08-06 09:56:53 +00:00
|
|
|
case gcEuclid:
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("flat"), 0);
|
|
|
|
break;
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-08-06 09:56:53 +00:00
|
|
|
case gcSphere:
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("spherical"), 0);
|
|
|
|
break;
|
2019-07-23 13:06:03 +00:00
|
|
|
|
2019-08-06 09:56:53 +00:00
|
|
|
case gcSol:
|
2019-07-23 13:06:03 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("Sol"), 0);
|
|
|
|
break;
|
2019-07-28 09:17:25 +00:00
|
|
|
|
2019-08-06 10:00:46 +00:00
|
|
|
case gcNil:
|
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("Nil"), 0);
|
|
|
|
break;
|
|
|
|
|
2019-08-24 09:55:45 +00:00
|
|
|
case gcSL2:
|
2019-08-26 14:21:05 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("~SL(2,R)~"), 0);
|
2019-08-24 09:55:45 +00:00
|
|
|
break;
|
|
|
|
|
2019-08-17 21:28:41 +00:00
|
|
|
case gcProduct:
|
2019-07-28 09:17:25 +00:00
|
|
|
dialog::addSelItem(XLAT("Curvature"), XLAT("Product"), 0);
|
2019-08-17 21:28:41 +00:00
|
|
|
break;
|
2019-02-06 15:34:22 +00:00
|
|
|
}
|
2017-11-06 20:18:40 +00:00
|
|
|
|
2019-02-06 15:34:22 +00:00
|
|
|
dialog::display();
|
2017-11-06 20:18:40 +00:00
|
|
|
}
|
|
|
|
|
2019-08-10 08:57:14 +00:00
|
|
|
EX void runGeometryExperiments() {
|
2019-03-10 18:15:48 +00:00
|
|
|
if(!geometry && specialland == laIce)
|
2018-08-17 22:46:45 +00:00
|
|
|
specialland = getLandForList(cwt.at);
|
2017-11-06 20:18:40 +00:00
|
|
|
pushScreen(showEuclideanMenu);
|
|
|
|
}
|
|
|
|
|
2018-07-19 21:46:58 +00:00
|
|
|
#if CAP_COMMANDLINE
|
2019-03-06 15:32:38 +00:00
|
|
|
|
|
|
|
eGeometry readGeo(const string& ss) {
|
|
|
|
bool numeric = true;
|
|
|
|
for(char c: ss) if(c < '0' || c > '9') numeric = false;
|
|
|
|
if(numeric) return eGeometry(atoi(ss.c_str()));
|
|
|
|
for(int i=0; i<isize(ginf); i++) if(appears(ginf[i].menu_displayed_name, ss)) {
|
|
|
|
return eGeometry(i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return gNormal;
|
|
|
|
}
|
|
|
|
|
2018-07-19 21:46:58 +00:00
|
|
|
int read_geom_args() {
|
|
|
|
using namespace arg;
|
2019-02-17 17:33:15 +00:00
|
|
|
if(0) ;
|
|
|
|
#if CAP_FIELD
|
|
|
|
else if(argis("-qpar")) {
|
2018-07-19 21:46:58 +00:00
|
|
|
int p;
|
|
|
|
shift(); sscanf(argcs(), "%d,%d,%d",
|
|
|
|
&p, "ientspace::rvadd, "ientspace::rvdir
|
|
|
|
);
|
|
|
|
autocheat = true;
|
|
|
|
currfp.init(p);
|
|
|
|
}
|
|
|
|
else if(argis("-qpar2")) {
|
|
|
|
stop_game_and_switch_mode(rg::nothing);
|
|
|
|
int a, b;
|
|
|
|
shift(); sscanf(argcs(), "%d,%d", &a, &b);
|
|
|
|
using namespace fieldpattern;
|
|
|
|
current_extra = a;
|
|
|
|
|
|
|
|
auto& gxcur = fgeomextras[current_extra];
|
|
|
|
while(b >= isize(gxcur.primes)) nextPrime(gxcur);
|
|
|
|
|
|
|
|
fgeomextras[current_extra].current_prime_id = b;
|
|
|
|
enableFieldChange();
|
2018-08-28 15:17:34 +00:00
|
|
|
set_geometry(gFieldQuotient);
|
2018-07-19 21:46:58 +00:00
|
|
|
}
|
|
|
|
else if(argis("-cs")) {
|
|
|
|
shift(); cheat();
|
|
|
|
fieldpattern::matrix M = currfp.strtomatrix(args());
|
|
|
|
fieldpattern::subpathid = currfp.matcode[M];
|
|
|
|
fieldpattern::subpathorder = currfp.order(M);
|
|
|
|
}
|
|
|
|
else if(argis("-csp")) {
|
|
|
|
cheat();
|
|
|
|
currfp.findsubpath();
|
|
|
|
}
|
2019-02-17 17:33:15 +00:00
|
|
|
#endif
|
2019-04-08 12:58:54 +00:00
|
|
|
else if(argis("-mineadj")) {
|
|
|
|
shift(); mine_adjacency_rule = argi();
|
|
|
|
}
|
2018-07-19 21:46:58 +00:00
|
|
|
else if(argis("-tpar")) {
|
|
|
|
torusconfig::torus_mode = torusconfig::tmSingle;
|
|
|
|
shift(); sscanf(argcs(), "%d,%d,%d",
|
|
|
|
&torusconfig::qty,
|
|
|
|
&torusconfig::dx,
|
|
|
|
&torusconfig::dy
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else if(argis("-tparx")) {
|
|
|
|
shift();
|
2019-05-24 20:35:13 +00:00
|
|
|
int tmode;
|
|
|
|
sscanf(argcs(), "%d,%d,%d", &tmode,
|
2018-07-19 21:46:58 +00:00
|
|
|
&torusconfig::sdx,
|
|
|
|
&torusconfig::sdy
|
|
|
|
);
|
2019-05-24 20:35:13 +00:00
|
|
|
if(tmode < 0 || tmode >= isize(torusconfig::tmodes)) {
|
|
|
|
println(hlog, "bad tmode");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
torusconfig::torus_mode = torusconfig::eTorusMode(tmode);
|
2018-07-19 21:46:58 +00:00
|
|
|
if(torusconfig::torus_mode == torusconfig::tmSingle)
|
|
|
|
torusconfig::qty = torusconfig::sdx,
|
|
|
|
torusconfig::dy = torusconfig::sdy;
|
|
|
|
torusconfig::activate();
|
|
|
|
}
|
2018-08-28 15:17:34 +00:00
|
|
|
TOGGLE('7', PURE, set_variation(PURE ? eVariation::bitruncated : eVariation::pure))
|
2018-07-19 21:46:58 +00:00
|
|
|
else if(argis("-geo")) {
|
2018-08-17 11:29:00 +00:00
|
|
|
PHASEFROM(2);
|
2018-08-28 15:17:34 +00:00
|
|
|
shift();
|
2019-03-06 15:32:38 +00:00
|
|
|
set_geometry(readGeo(args()));
|
2018-07-19 21:46:58 +00:00
|
|
|
}
|
2019-02-17 17:28:20 +00:00
|
|
|
#if CAP_GP
|
2018-07-19 21:46:58 +00:00
|
|
|
else if(argis("-gp")) {
|
|
|
|
PHASEFROM(2);
|
|
|
|
shift(); gp::param.first = argi();
|
|
|
|
shift(); gp::param.second = argi();
|
2018-08-28 15:17:34 +00:00
|
|
|
set_variation(eVariation::goldberg);
|
2018-07-19 21:46:58 +00:00
|
|
|
}
|
2019-02-17 17:28:20 +00:00
|
|
|
#endif
|
2019-02-17 17:33:15 +00:00
|
|
|
#if CAP_FIELD
|
2018-07-19 21:46:58 +00:00
|
|
|
else if(argis("-fi")) {
|
|
|
|
fieldpattern::info();
|
|
|
|
exit(0);
|
|
|
|
}
|
2018-07-19 22:04:23 +00:00
|
|
|
else if(argis("-qs")) {
|
|
|
|
cheat();
|
|
|
|
shift(); currfp.qpaths.push_back(args());
|
|
|
|
}
|
2018-11-11 10:06:32 +00:00
|
|
|
else if(argis("-d:quotient"))
|
|
|
|
launch_dialog(showQuotientConfig);
|
2019-02-17 17:33:15 +00:00
|
|
|
#endif
|
2018-11-11 10:06:32 +00:00
|
|
|
else if(argis("-d:torus")) {
|
|
|
|
launch_dialog(showTorusConfig);
|
|
|
|
prepare_torusconfig();
|
|
|
|
}
|
|
|
|
else if(argis("-d:geom"))
|
|
|
|
launch_dialog(showEuclideanMenu);
|
2018-07-19 21:46:58 +00:00
|
|
|
else return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto ah_geom = addHook(hooks_args, 0, read_geom_args);
|
|
|
|
#endif
|
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
}
|