mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-23 23:47:00 +00:00
intra:: select edge ratio
This commit is contained in:
parent
64a613572a
commit
0639c9c027
31
intra.cpp
31
intra.cpp
@ -809,6 +809,15 @@ EX void show_portals() {
|
|||||||
dialog::add_action_push(ray::configure);
|
dialog::add_action_push(ray::configure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(prod && point_direction < mouseover2->type - 2) {
|
||||||
|
ld r = get_ratio_edge(mouseover2, point_direction);
|
||||||
|
dialog::addSelItem(XLAT("height-to-width ratio"), fts(r), 'r');
|
||||||
|
dialog::add_action([] {
|
||||||
|
be_ratio_edge(mouseover2, point_direction);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else dialog::addBreak(100);
|
||||||
|
|
||||||
walking::add_options();
|
walking::add_options();
|
||||||
|
|
||||||
dialog::addHelp();
|
dialog::addHelp();
|
||||||
@ -847,14 +856,28 @@ EX void be_ratio(ld v IS(1)) {
|
|||||||
cgi.require_basics();
|
cgi.require_basics();
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void be_ratio_edge(int i, ld v IS(1)) {
|
EX ld get_edge_length(cell *c, int i) {
|
||||||
start_game();
|
auto c1 = hybrid::get_where(c).first;
|
||||||
ld len = hdist(currentmap->get_corner(cwt.at, i), currentmap->get_corner(cwt.at, (i+1)%cwt.at->type));
|
return PIU( hdist(currentmap->get_corner(c1, i), currentmap->get_corner(c1, (i+c1->type-1)%c1->type)) );
|
||||||
PIU( vid.plevel_factor = v * len / cgi.scalefactor );
|
}
|
||||||
|
|
||||||
|
EX ld get_ratio_edge(cell *c, int i) {
|
||||||
|
ld len = get_edge_length(c, i);
|
||||||
|
return PIU( vid.plevel_factor * cgi.scalefactor / len );
|
||||||
|
}
|
||||||
|
|
||||||
|
EX void be_ratio_edge(cell *c, int i, ld v IS(1)) {
|
||||||
|
ld len = get_edge_length(c, i);
|
||||||
|
vid.plevel_factor = v * len / cgi.scalefactor;
|
||||||
check_cgi();
|
check_cgi();
|
||||||
cgi.require_basics();
|
cgi.require_basics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX void be_ratio_edge(int i, ld v IS(1)) {
|
||||||
|
start_game();
|
||||||
|
be_ratio_edge(cwt.at, i, v);
|
||||||
|
}
|
||||||
|
|
||||||
/** Remove the space with the given id. Turns off intra */
|
/** Remove the space with the given id. Turns off intra */
|
||||||
EX void kill(int id) {
|
EX void kill(int id) {
|
||||||
if(in) become();
|
if(in) become();
|
||||||
|
Loading…
Reference in New Issue
Block a user