product:: selectable from menu
This commit is contained in:
parent
14b70224a8
commit
1a1725dec8
16
geom-exp.cpp
16
geom-exp.cpp
|
@ -398,7 +398,7 @@ vector<eGeometry> list3d = {
|
||||||
gCell24, gECell24,
|
gCell24, gECell24,
|
||||||
gCell16, gECell16,
|
gCell16, gECell16,
|
||||||
gCell8, gECell8,
|
gCell8, gECell8,
|
||||||
gCell5, gKiteDart3, gSol, gNil
|
gCell5, gKiteDart3, gSol, gNil, gProduct
|
||||||
};
|
};
|
||||||
|
|
||||||
void ge_select_tiling(const vector<eGeometry>& lst) {
|
void ge_select_tiling(const vector<eGeometry>& lst) {
|
||||||
|
@ -417,7 +417,7 @@ void ge_select_tiling(const vector<eGeometry>& lst) {
|
||||||
if(archimedean && !CAP_ARCM) continue;
|
if(archimedean && !CAP_ARCM) continue;
|
||||||
if(geometry == gCrystal && !CAP_CRYSTAL) continue;
|
if(geometry == gCrystal && !CAP_CRYSTAL) continue;
|
||||||
if(geometry == gFieldQuotient && !CAP_FIELD) continue;
|
if(geometry == gFieldQuotient && !CAP_FIELD) continue;
|
||||||
dialog::addBoolItem(XLAT(ginf[i].menu_displayed_name), on, letter++);
|
dialog::addBoolItem(XLAT((geometry == gProduct && !on) ? XLAT("current geometry x E") : ginf[i].menu_displayed_name), on, letter++);
|
||||||
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
dialog::lastItem().value += validclasses[land_validity(specialland).quality_level];
|
||||||
dialog::add_action(dual::mayboth([i] {
|
dialog::add_action(dual::mayboth([i] {
|
||||||
eGeometry targetgeometry = eGeometry(i);
|
eGeometry targetgeometry = eGeometry(i);
|
||||||
|
@ -431,6 +431,10 @@ void ge_select_tiling(const vector<eGeometry>& lst) {
|
||||||
pushScreen(arcm::show);
|
pushScreen(arcm::show);
|
||||||
#endif
|
#endif
|
||||||
else dialog::do_if_confirmed([targetgeometry] () {
|
else dialog::do_if_confirmed([targetgeometry] () {
|
||||||
|
if(targetgeometry == gProduct && (WDIM == 3 || euclid)) {
|
||||||
|
addMessage(XLAT("Only works with 2D non-Euclidean geometries"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
set_geometry(targetgeometry);
|
set_geometry(targetgeometry);
|
||||||
start_game();
|
start_game();
|
||||||
if(euwrap) {
|
if(euwrap) {
|
||||||
|
@ -624,7 +628,13 @@ EX void showEuclideanMenu() {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(ts == 6 && tv == 3)
|
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)
|
||||||
dialog::addSelItem(XLAT("variations"), XLAT("does not matter"), 'v');
|
dialog::addSelItem(XLAT("variations"), XLAT("does not matter"), 'v');
|
||||||
else if(binarytiling) {
|
else if(binarytiling) {
|
||||||
dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v');
|
dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v');
|
||||||
|
|
|
@ -855,6 +855,8 @@ EX void check_cgi() {
|
||||||
|
|
||||||
if(binarytiling || GDIM == 3) V("WQ", its(vid.texture_step));
|
if(binarytiling || GDIM == 3) V("WQ", its(vid.texture_step));
|
||||||
|
|
||||||
|
if(prod) V("PL", fts(vid.plevel_factor));
|
||||||
|
|
||||||
if(binarytiling) V("BT", fts(vid.binary_width));
|
if(binarytiling) V("BT", fts(vid.binary_width));
|
||||||
|
|
||||||
if(GDIM == 2) {
|
if(GDIM == 2) {
|
||||||
|
|
|
@ -554,7 +554,6 @@ EX namespace product {
|
||||||
geometry = gProduct;
|
geometry = gProduct;
|
||||||
ginf[gProduct] = ginf[underlying];
|
ginf[gProduct] = ginf[underlying];
|
||||||
ginf[gProduct].cclass = gcProduct;
|
ginf[gProduct].cclass = gcProduct;
|
||||||
pmodel = mdPerspective;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EX int current_view_level;
|
EX int current_view_level;
|
||||||
|
@ -643,9 +642,11 @@ EX namespace product {
|
||||||
}
|
}
|
||||||
|
|
||||||
EX hyperpoint get_corner(cell *c, int i, ld z) {
|
EX hyperpoint get_corner(cell *c, int i, ld z) {
|
||||||
|
ld lev = cgi.plevel * z / 2;
|
||||||
|
println(hlog, "getcorner ", i, " @ ", lev);
|
||||||
dynamicval<eGeometry> g(geometry, underlying);
|
dynamicval<eGeometry> g(geometry, underlying);
|
||||||
dynamicval<geometry_information*> gc(cgip, underlying_cgip);
|
dynamicval<geometry_information*> gc(cgip, underlying_cgip);
|
||||||
return mscale(get_corner_position(c, i), exp(cgi.plevel * z/2));
|
return mscale(get_corner_position(c, i), exp(lev));
|
||||||
}
|
}
|
||||||
|
|
||||||
EX int wall_offset(cell *c) {
|
EX int wall_offset(cell *c) {
|
||||||
|
@ -655,7 +656,7 @@ EX namespace product {
|
||||||
if(wo == -1) {
|
if(wo == -1) {
|
||||||
cell *c1 = get_where(c).first;
|
cell *c1 = get_where(c).first;
|
||||||
wo = isize(cgi.shWall3D);
|
wo = isize(cgi.shWall3D);
|
||||||
println(hlog, "generating a model for ", c->type-2, "+2");
|
println(hlog, "generating a model for ", c->type-2, "+2", " while plevel is ", cgi.plevel);
|
||||||
int won = wo + c->type;
|
int won = wo + c->type;
|
||||||
cgi.shWall3D.resize(won);
|
cgi.shWall3D.resize(won);
|
||||||
cgi.shPlainWall3D.resize(won);
|
cgi.shPlainWall3D.resize(won);
|
||||||
|
@ -876,9 +877,7 @@ EX namespace nisot {
|
||||||
}
|
}
|
||||||
else if(argis("-product")) {
|
else if(argis("-product")) {
|
||||||
PHASEFROM(2);
|
PHASEFROM(2);
|
||||||
stop_game();
|
set_geometry(gProduct);
|
||||||
product::configure();
|
|
||||||
if(vid.texture_step < 4) vid.texture_step = 4;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -1158,6 +1158,7 @@ EX void set_geometry(eGeometry target) {
|
||||||
int old_DIM = GDIM;
|
int old_DIM = GDIM;
|
||||||
stop_game();
|
stop_game();
|
||||||
ors::reset();
|
ors::reset();
|
||||||
|
if(target == gProduct) product::configure();
|
||||||
geometry = target;
|
geometry = target;
|
||||||
|
|
||||||
if(chaosmode && bounded) chaosmode = false;
|
if(chaosmode && bounded) chaosmode = false;
|
||||||
|
@ -1180,12 +1181,13 @@ EX void set_geometry(eGeometry target) {
|
||||||
if(DUAL && geometry != gArchimedean)
|
if(DUAL && geometry != gArchimedean)
|
||||||
variation = ginf[geometry].default_variation;
|
variation = ginf[geometry].default_variation;
|
||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
if(binarytiling || WDIM == 3 || penrose) variation = eVariation::pure;
|
if(binarytiling || WDIM == 3 || penrose) if(!prod) variation = eVariation::pure;
|
||||||
#endif
|
#endif
|
||||||
if(GDIM == 3 && old_DIM == 2 && pmodel == mdDisk) pmodel = mdPerspective;
|
if(GDIM == 3 && old_DIM == 2 && pmodel == mdDisk) pmodel = mdPerspective;
|
||||||
if(nonisotropic && old_DIM == 2) pmodel = mdGeodesic;
|
if(nonisotropic && old_DIM == 2) pmodel = mdGeodesic;
|
||||||
if(GDIM == 2 && among(pmodel, mdPerspective, mdGeodesic)) pmodel = mdDisk;
|
if(GDIM == 2 && among(pmodel, mdPerspective, mdGeodesic)) pmodel = mdDisk;
|
||||||
if(nonisotropic && old_DIM == 2 && vid.texture_step < 4) vid.texture_step = 4;
|
if(nonisotropic && old_DIM == 2 && vid.texture_step < 4) vid.texture_step = 4;
|
||||||
|
if(prod) { pmodel = mdPerspective; if(vid.texture_step < 4) vid.texture_step = 4; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue