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

rogueviz::nconf:: some fixes

This commit is contained in:
Zeno Rogue 2019-07-12 23:42:10 +02:00
parent 9f6d2a5d89
commit 5149dbeefd

View File

@ -449,7 +449,7 @@ void pick_algorithm() {
dialog::addItem("visualize (fast)", 'b'); dialog::addItem("visualize (fast)", 'b');
dialog::add_action([] { nconf_prepare(true); popScreen(); }); dialog::add_action([] { nconf_prepare(true); popScreen(); });
dialog::addSelItem("visualization speed", its(algo_speed), 'v'); dialog::addSelItem("visualization speed", its(algo_speed), 'v');
dialog::add_action([] { dialog::editNumber(algo_speed, 100, 1000000, 0.1, 10000, "", ""), dialog::scaleLog(), dialog::dialogflags = 0, dialog::numberdark = DONT_SHOW; }); dialog::add_action([] { dialog::editNumber(algo_speed, 100, 1000000, 0.1, 10000, "", ""), dialog::scaleLog(), dialog::dialogflags = 0, dialog::numberdark = dialog::DONT_SHOW; });
dialog::addBreak(50); dialog::addBreak(50);
dialog::addBoolItem_action("pretty corners", pretty, 'p'); dialog::addBoolItem_action("pretty corners", pretty, 'p');
dialog::addBreak(50); dialog::addBreak(50);
@ -524,11 +524,15 @@ void draw_ncee() {
curvepoint(h(x+1,y)); curvepoint(h(x+1,y));
curvepoint(h(x+1,y+1)); curvepoint(h(x+1,y+1));
curvepoint(h(x,y+1)); curvepoint(h(x,y+1));
#if CAP_NCONF
bool ineq = bool ineq =
in_visualization && fmap[y][x] == '1'; in_visualization && fmap[y][x] == '1';
#endif
queuecurve(0, queuecurve(0,
#if CAP_NCONF
(ineq && nconf::pts[y][x].state == 1) ? 0xFF8000FF : (ineq && nconf::pts[y][x].state == 1) ? 0xFF8000FF :
(ineq && nconf::pts[y][x].state == 2) ? 0x00FF00FF : (ineq && nconf::pts[y][x].state == 2) ? 0x00FF00FF :
#endif
(fmap[y][x] == '1' && show_mgrid && show_mapping) ? 0x404040FF : typecols[fmap[y][x] - '0'], PPR::LINE); (fmap[y][x] == '1' && show_mgrid && show_mapping) ? 0x404040FF : typecols[fmap[y][x] - '0'], PPR::LINE);
} }
@ -577,13 +581,13 @@ void draw_ncee() {
vmap[y][x] = hpxy(vx[y][x]/cscale * sca2 / 2, vy[y][x] * sca2 / 2+ map_ypos); vmap[y][x] = hpxy(vx[y][x]/cscale * sca2 / 2, vy[y][x] * sca2 / 2+ map_ypos);
for(int x=0; x<X-1; x++) for(int y=0; y<Y-1; y++) { for(int x=0; x<X-1; x++) for(int y=0; y<Y-1; y++) {
if(y < Y-2 && fmap[y][x] > '0' && fmap[y+1][x] > '0') { if(y < Y-2 && fmap[y][x] > '0' && fmap[y+1][x] > '0') {
color_t col = (pair(x,y) == mpt || pair(x,y+1) == mpt) ? 0xFFFF00FF : gridcol; color_t col = (make_pair(x,y) == mpt || make_pair(x,y+1) == mpt) ? 0xFFFF00FF : gridcol;
dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1)); dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1));
queueline(hc(x, y), hc(x, y+1), col, 0, PPR::CIRCLE); queueline(hc(x, y), hc(x, y+1), col, 0, PPR::CIRCLE);
queueline(vmap[y][x], vmap[y+1][x], col, 0, PPR::CIRCLE); queueline(vmap[y][x], vmap[y+1][x], col, 0, PPR::CIRCLE);
} }
if(x < X-2 && fmap[y][x] > '0' && fmap[y][x+1] > '0') { if(x < X-2 && fmap[y][x] > '0' && fmap[y][x+1] > '0') {
color_t col = (pair(x,y) == mpt || pair(x+1,y) == mpt) ? 0xFFFF00FF : gridcol; color_t col = (make_pair(x,y) == mpt || make_pair(x+1,y) == mpt) ? 0xFFFF00FF : gridcol;
dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1)); dynamicval<ld> lw(vid.linewidth, vid.linewidth * (col == 0xFFFF00FF ? 4 : 1));
queueline(hc(x, y), hc(x+1, y), col, 0, PPR::CIRCLE); queueline(hc(x, y), hc(x+1, y), col, 0, PPR::CIRCLE);
queueline(vmap[y][x], vmap[y][x+1], col, 0, PPR::CIRCLE); queueline(vmap[y][x], vmap[y][x+1], col, 0, PPR::CIRCLE);
@ -617,9 +621,11 @@ void ncee() {
if(ncee_map_prepared < 5) { cmode = sm::NORMAL; ncee_map_prepared++; if(ncee_map_prepared == 5) prepare_ncee_map(); gamescreen(2); return; } if(ncee_map_prepared < 5) { cmode = sm::NORMAL; ncee_map_prepared++; if(ncee_map_prepared == 5) prepare_ncee_map(); gamescreen(2); return; }
#if CAP_NCONF
if(in_visualization) if(in_visualization)
nconf_run(); nconf_run();
else else
#endif
iterate(); iterate();
draw_ncee(); draw_ncee();
@ -689,7 +695,7 @@ void ncee() {
if(uni == 's') show_mapping = !show_mapping; if(uni == 's') show_mapping = !show_mapping;
if(uni == 'g') show_mgrid = !show_mgrid; if(uni == 'g') show_mgrid = !show_mgrid;
if(uni == 't') pushScreen(conf_shapes); if(uni == 't') pushScreen(conf_shapes);
if(uni == 'y') dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", ""), dialog::dialogflags = 0, dialog::numberdark = DONT_SHOW; if(uni == 'y') dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", ""), dialog::dialogflags = 0, dialog::numberdark = dialog::DONT_SHOW;
if(uni == '-') { if(uni == '-') {
int x = (mousex - cd->xcenter - xc - x0) / siz; int x = (mousex - cd->xcenter - xc - x0) / siz;
int y = (mousey - cd->ycenter - yc - y0) / siz; int y = (mousey - cd->ycenter - yc - y0) / siz;
@ -701,7 +707,6 @@ void ncee() {
}; };
} }
#if ISWEB
extern "C" { extern "C" {
void nconf_view(int i) { void nconf_view(int i) {
if(i == 1) if(i == 1)
@ -736,7 +741,6 @@ extern "C" {
fmap = snake, reset_vxy(); fmap = snake, reset_vxy();
} }
} }
#endif
int niceArgs() { int niceArgs() {
using namespace arg; using namespace arg;