1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-02 12:19:18 +00:00

binary_tiling_width parameter

This commit is contained in:
Zeno Rogue 2018-08-14 10:18:18 +02:00
parent c54d01b50c
commit eb57d160d0
5 changed files with 16 additions and 6 deletions

View File

@ -148,7 +148,7 @@ namespace binary {
}
transmatrix parabolic(ld u) {
u = u / log(2);
u = u * vid.binary_width / log(2);
return transmatrix {{{-u*u/8+1, u/2, u*u/8}, {-u/2, 1, u/2}, {-u*u/8, u/2, u*u/8+1}}};
}

View File

@ -255,6 +255,7 @@ void initConfig() {
addsaver(vid.euclid_to_sphere, "euclid to sphere projection", 1.5);
addsaver(vid.twopoint_param, "twopoint parameter", 1);
addsaver(vid.stretch, "stretch", 1);
addsaver(vid.binary_width, "binary-tiling-width", 1);
addsaver(gp::on, "goldberg", false);
addsaver(gp::param.first, "goldberg-x", gp::param.first);

View File

@ -287,7 +287,7 @@ void showEuclideanMenu() {
if(ts == 6 && tv == 3)
dialog::addSelItem(XLAT("variations"), XLAT("does not matter"), 'v');
else if(binarytiling)
dialog::addSelItem(XLAT("variations"), XLAT("not implemented"), 'v');
dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v');
else {
dialog::addBoolItem(XLAT("variations"), nonbitrunc, 'v');
dialog::lastItem().value = gp::operation_name();
@ -392,7 +392,15 @@ void showEuclideanMenu() {
else if(uni == 'u')
showquotients = !showquotients;
else if(uni == 'v') {
if(euclid6 || binarytiling) ;
if(euclid6) ;
else if(binarytiling) {
dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), "");
dialog::reaction = [] () {
resetGeometry();
if(texture::config.tstate == texture::tsActive)
texture::config.remap(texture::tsActive, texture::tsActive);
};
}
else // if(S3 == 3)
gp::configure();
/* else {

View File

@ -810,7 +810,7 @@ extern reaction_t help_delegate;
struct videopar {
ld scale, alpha, sspeed, mspeed, yshift, camera_angle;
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch;
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch, binary_width;
int mobilecompasssize;
int aurastr, aurasmoothen;

View File

@ -323,7 +323,7 @@ int goldbergcode(cell *c, const patterns::patterninfo& si) {
void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const transmatrix& T, int shift = 0) {
mi.c = c;
mi.symmetries = si.symmetries;
mi.current_type = c->type;
mi.current_type = celltriangles(c);
if(gp::on) {
mi.M = T;
@ -882,6 +882,7 @@ void init_textureconfig() {
addsaver(vid.alpha, "projection", 1);
addsaver(vid.scale, "scale", 1);
addsaver(vid.stretch, "stretch", 1);
addsaver(vid.binary_width, "binary-tiling-width", 1);
addsaver(config.texturename, "texture filename", "");
addsaver(config.texture_tuner, "texture tuning", "");
@ -1504,7 +1505,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma
auto& mi = texture_map_orig.at(oldid);
int ncurr = isize(mi.tvertices);
int ntarget = ncurr * c->type / mi.current_type;
int ntarget = ncurr * celltriangles(c) / mi.current_type;
vector<glvertex> new_tvertices = mi.tvertices;
new_tvertices.resize(ntarget);
for(int i=ncurr; i<ntarget; i++) {