diff --git a/config.cpp b/config.cpp index f7a3002f..bbed2083 100644 --- a/config.cpp +++ b/config.cpp @@ -628,6 +628,8 @@ EX void initConfig() { addsaver(nilv::nilperiod[0], "nilperiod_x"); addsaver(nilv::nilperiod[1], "nilperiod_y"); addsaver(nilv::nilperiod[2], "nilperiod_z"); + + addsaver(neon_mode, "neon_mode"); callhooks(hooks_configfile); @@ -1094,6 +1096,15 @@ EX void showGraphConfig() { dialog::extra_options = [] () { dialog::addBoolItem("finer lines at the boundary", vid.antialias & AA_LINEWIDTH, 'O'); dialog::add_action([] () { vid.antialias ^= AA_LINEWIDTH; }); + + dialog::addBoolItem("standard graphics", neon_mode == 0, 'A'); + dialog::add_action([] { neon_mode = 0; }); + dialog::addBoolItem("neon mode", neon_mode == 1, 'B'); + dialog::add_action([] { neon_mode = 1; }); + dialog::addBoolItem("no boundary mode", neon_mode == 2, 'C'); + dialog::add_action([] { neon_mode = 2; }); + dialog::addBoolItem("neon mode II", neon_mode == 3, 'D'); + dialog::add_action([] { neon_mode = 3; }); }; } diff --git a/drawing.cpp b/drawing.cpp index bb880e66..e907fb0c 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2016,6 +2016,8 @@ template T& queuea(PPR prio, U... u) { #endif #if CAP_SHAPES +EX int neon_mode = 0; + EX dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR prio) { if(prio == PPR::DEFAULT) prio = h.prio; @@ -2040,8 +2042,27 @@ EX dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, P part(col,1) = b; */ part(col,2) = part(col,3) = (part(col,2) * 2 + part(col,3) + 1)/3; } - ptd.color = (darkened(col >> 8) << 8) + (col & 0xFF); - ptd.outline = poly_outline; + if(neon_mode == 0 || (h.flags & POLY_TRIANGLES)) { + ptd.color = (darkened(col >> 8) << 8) + (col & 0xFF); + ptd.outline = poly_outline; + } + else switch(neon_mode) { + case 1: + ptd.color = (poly_outline & 0xFFFFFF00) | (col & 0xFF); + ptd.outline = (darkened(col >> 8) << 8) | (col & 0xFF); + if(col == 0xFF) ptd.outline = 0xFFFFFFFF; + break; + case 2: + ptd.color = (darkened(col >> 8) << 8) + (col & 0xFF); + ptd.outline = 0; + break; + case 3: + ptd.color = (darkened(col >> 8) << 8) + (col & 0xFF) + ((col & 0xFF) >> 2); + ptd.outline = (darkened(col >> 8) << 8) + (col & 0xFF); + if(col == 0xFF) ptd.outline = 0xFFFFFFFF; + if(poly_outline != 0xFF) ptd.outline = poly_outline; + break; + } ptd.linewidth = vid.linewidth; ptd.flags = h.flags; ptd.tinf = h.tinf;