1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-11 18:00:34 +00:00

fixed some pconf/vpconf bugs

This commit is contained in:
Zeno Rogue 2020-11-08 12:09:42 +01:00
parent 32a61367b0
commit d7351d169a
3 changed files with 8 additions and 4 deletions

View File

@ -305,7 +305,7 @@ transmatrix zforward_push(ld z) {
} }
EX void zoom_or_fov(ld t) { EX void zoom_or_fov(ld t) {
if(in_perspective()) { if(in_perspective_v()) {
auto tanfov = tan(vid.fov * degree / 2); auto tanfov = tan(vid.fov * degree / 2);
tanfov *= t; tanfov *= t;
vid.fov = atan(tanfov) * 2 / degree; vid.fov = atan(tanfov) * 2 / degree;

View File

@ -29,7 +29,11 @@ EX int detaillevel = 0;
EX bool first_cell_to_draw = true; EX bool first_cell_to_draw = true;
EX bool in_perspective() { EX bool in_perspective() {
return among(pmodel, mdPerspective, mdGeodesic); return among(pconf.model, mdPerspective, mdGeodesic);
}
EX bool in_perspective_v() {
return among(vpconf.model, mdPerspective, mdGeodesic);
} }
EX bool hide_player() { EX bool hide_player() {

View File

@ -434,12 +434,12 @@ EX namespace models {
dialog::add_action([] { edit_rotation(rotation); }); dialog::add_action([] { edit_rotation(rotation); });
// if(vpmodel == mdBand && sphere) // if(vpmodel == mdBand && sphere)
if(!in_perspective()) { if(!in_perspective_v()) {
dialog::addSelItem(XLAT("scale factor"), fts(vpconf.scale), 'z'); dialog::addSelItem(XLAT("scale factor"), fts(vpconf.scale), 'z');
dialog::add_action(editScale); dialog::add_action(editScale);
} }
if(abs(pconf.alpha-1) > 1e-3 && vpmodel != mdBall && vpmodel != mdHyperboloid && vpmodel != mdHemisphere && vpmodel != mdDisk) { if(abs(vpconf.alpha-1) > 1e-3 && vpmodel != mdBall && vpmodel != mdHyperboloid && vpmodel != mdHemisphere && vpmodel != mdDisk) {
dialog::addBreak(50); dialog::addBreak(50);
dialog::addInfo("NOTE: this works 'correctly' only if the Poincaré model/stereographic projection is used."); dialog::addInfo("NOTE: this works 'correctly' only if the Poincaré model/stereographic projection is used.");
dialog::addBreak(50); dialog::addBreak(50);