diff --git a/rogueviz-banachtarski.cpp b/rogueviz-banachtarski.cpp index b7c0b182..3d614177 100644 --- a/rogueviz-banachtarski.cpp +++ b/rogueviz-banachtarski.cpp @@ -446,7 +446,7 @@ void bantar_stats() { for(auto p: parent) if(gmatrix.count(p.first) && gmatrix.count(p.second)) queueline(tC0(gmatrix[p.first]), tC0(gmatrix[p.second]), 0x00FF00FF, 4); - double x = hexvdist; + double x = cgi.hexvdist; for(auto gm: gmatrix) for(cell *c: {gm.first}) if(euclid || !pseudohept(c)) for(int t=0; ttype; t++) if(infos.count(c) && infos.count(c->move(t)) && c->move(t) && infos[c].gid != infos[c->move(t)].gid) if(euclid ? c->move(t)move(t) < c)) diff --git a/rogueviz-cvl.cpp b/rogueviz-cvl.cpp index 37dea039..98aa69e8 100644 --- a/rogueviz-cvl.cpp +++ b/rogueviz-cvl.cpp @@ -33,7 +33,7 @@ void cvl_marker() { for(auto& loc: l.second.locs) { if(gmatrix.count(loc.lviewctr.at->c7)) { transmatrix T = gmatrix[loc.lviewctr.at->c7] * inverse(spin(loc.lviewctr.spin*2*M_PI/S7 + master_to_c7_angle())) * inverse(loc.lView); - queuepoly(T, shAsymmetric, 0xFF00FFFF); + queuepoly(T, cgi.shAsymmetric, 0xFF00FFFF); queuestr(T, 1.0, its(l.first)+"/"+its(id), 0xFFFFFF); } id++; diff --git a/rogueviz-fundamental.cpp b/rogueviz-fundamental.cpp index 93b909ab..712b6b7f 100644 --- a/rogueviz-fundamental.cpp +++ b/rogueviz-fundamental.cpp @@ -200,11 +200,11 @@ void fundamental_marker() { int mc = (mirrored ? color1 : color2) >> 8; if(hdist(corner(cw), corner(next_corner[cw])) > 1e-3) { - queuestr(labelpos(corner(cw), corner(next_corner[cw])), label_scale/scalefactor, its(id), mc); + queuestr(labelpos(corner(cw), corner(next_corner[cw])), label_scale/cgi.scalefactor, its(id), mc); if(mirrored) - queuestr(labelpos(corner(cw1), corner(next_corner[cw1])), label_scale/scalefactor, its(id), mc); + queuestr(labelpos(corner(cw1), corner(next_corner[cw1])), label_scale/cgi.scalefactor, its(id), mc); else - queuestr(labelpos(corner(prev_corner[cw1]), corner(cw1)), label_scale/scalefactor, its(id), mc); + queuestr(labelpos(corner(prev_corner[cw1]), corner(cw1)), label_scale/cgi.scalefactor, its(id), mc); id++; } } diff --git a/rogueviz-kohonen.cpp b/rogueviz-kohonen.cpp index deb3a175..88c310b4 100644 --- a/rogueviz-kohonen.cpp +++ b/rogueviz-kohonen.cpp @@ -237,7 +237,7 @@ void distribute_neurons() { w.drawn_samples++; } - ld rad = .25 * scalefactor; + ld rad = .25 * cgi.scalefactor; for(auto p: sample_vdata_id) { int id = p.second; diff --git a/rogueviz-magiccube.cpp b/rogueviz-magiccube.cpp index e396ddbe..c5779764 100644 --- a/rogueviz-magiccube.cpp +++ b/rogueviz-magiccube.cpp @@ -53,7 +53,7 @@ void magic(int sides) { firstland = specialland = laCanvas; patterns::whichCanvas = 'g'; patterns::canvasback = 0; - need_reset_geometry = true; + check_cgi(); start_game(); build(crystal::c0, 0); diff --git a/rogueviz-pentagonal.cpp b/rogueviz-pentagonal.cpp index eb4c1839..537aca73 100644 --- a/rogueviz-pentagonal.cpp +++ b/rogueviz-pentagonal.cpp @@ -112,14 +112,13 @@ void run_snub(int v, int w) { set_geometry(gArchimedean); set_variation(eVariation::pure); arcm::current.parse("("+its(v)+",3," + its(w) + ",3,3) (2,3)(1,0)(4)"); + check_cgi(); + cgi.require_basics(); specialland = laCanvas; patterns::whichCanvas = 'A'; // vid.wallmode = 1; - need_reset_geometry = true; printf("start game\n"); - printf("distlimit = %d\n", base_distlimit); - precalc(); - printf("distlimit = %d\n", base_distlimit); + printf("distlimit = %d\n", cgi.base_distlimit); start_game(); printf("ok\n"); printf("allcells = %d\n", isize(currentmap->allcells())); diff --git a/rogueviz.cpp b/rogueviz.cpp index ac788aea..98795500 100644 --- a/rogueviz.cpp +++ b/rogueviz.cpp @@ -27,7 +27,6 @@ #include "rogueviz.h" -namespace hr { extern hpcshape shEagle, shMiniGhost, shGhost, shShark, shAnimatedEagle[30], shAnimatedTinyEagle[30]; } #if MAXMDIM >= 4 namespace hr { extern renderbuffer *floor_textures; } #endif @@ -1146,8 +1145,6 @@ void storeline(vector& tab, const hyperpoint& h1, const hyperpoint& h2 storelineto(tab, h1, h2); } -hpcshape *vshapes[4] = { &shDisk, &shDisk, &shHeptaMarker, &shSnowball }; - color_t darken_a(color_t c) { for(int p=0; p<3; p++) for(int i=0; i> 1; @@ -1168,7 +1165,10 @@ void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const str transmatrix V1; - auto& sh = *(vshapes[vertex_shape]); + auto& sh = + vertex_shape == 2 ? cgi.shHeptaMarker : + vertex_shape == 3 ? cgi.shSnowball : + cgi.shDisk; if(vertex_shape == 0) ; else if(DIM == 3 && among(cp.shade, 'b', 'f', 'g', 'B', 'F', 'G')) { @@ -1186,7 +1186,7 @@ void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const str queuepolyat(V, sh, 0x80, PPR::MONSTER_SHADOW); poly_outline = p; if(info) queueaction(PPR::MONSTER_HEAD, [info] () { SVG_LINK(*info); }); - queuepolyat(V1 = mscale(V, geom3::BODY), sh, darken_a(cp.color1), PPR::MONSTER_HEAD); + queuepolyat(V1 = mscale(V, cgi.BODY), sh, darken_a(cp.color1), PPR::MONSTER_HEAD); if(info) queueaction(PPR::MONSTER_HEAD, [] () { SVG_LINK(""); }); } else { @@ -1195,16 +1195,16 @@ void queuedisk(const transmatrix& V, const colorpair& cp, bool legend, const str if(info) queueaction(PPR::MONSTER_HEAD, [] () { SVG_LINK(""); }); } switch(cp.shade) { - case 't': queuepoly(V1, shDiskT, darken_a(cp.color2)); return; - case 's': queuepoly(V1, shDiskS, darken_a(cp.color2)); return; - case 'q': queuepoly(V1, shDiskSq, darken_a(cp.color2)); return; - case 'm': queuepoly(V1, shDiskM, darken_a(cp.color2)); return; - case 'b': queuepoly(V1, DIM == 3 ? shAnimatedTinyEagle[((long long)(ticks) * 30 / 1000+i) % 30] : shTinyBird, darken_a(cp.color2)); return; - case 'f': queuepoly(V1, shTinyShark, darken_a(cp.color2)); return; - case 'g': queuepoly(V1, shMiniGhost, darken_a(cp.color2)); return; - case 'B': queuepoly(V1, DIM == 3 ? shAnimatedEagle[((long long)(ticks) * 30 / 1000+i) % 30] : shEagle, darken_a(cp.color2)); return; - case 'F': queuepoly(V1, shShark, darken_a(cp.color2)); return; - case 'G': queuepoly(V1, shGhost, darken_a(cp.color2)); return; + case 't': queuepoly(V1, cgi.shDiskT, darken_a(cp.color2)); return; + case 's': queuepoly(V1, cgi.shDiskS, darken_a(cp.color2)); return; + case 'q': queuepoly(V1, cgi.shDiskSq, darken_a(cp.color2)); return; + case 'm': queuepoly(V1, cgi.shDiskM, darken_a(cp.color2)); return; + case 'b': queuepoly(V1, DIM == 3 ? cgi.shAnimatedTinyEagle[((long long)(ticks) * 30 / 1000+i) % 30] : cgi.shTinyBird, darken_a(cp.color2)); return; + case 'f': queuepoly(V1, cgi.shTinyShark, darken_a(cp.color2)); return; + case 'g': queuepoly(V1, cgi.shMiniGhost, darken_a(cp.color2)); return; + case 'B': queuepoly(V1, DIM == 3 ? cgi.shAnimatedEagle[((long long)(ticks) * 30 / 1000+i) % 30] : cgi.shEagle, darken_a(cp.color2)); return; + case 'F': queuepoly(V1, cgi.shShark, darken_a(cp.color2)); return; + case 'G': queuepoly(V1, cgi.shGhost, darken_a(cp.color2)); return; } } @@ -1416,7 +1416,7 @@ bool drawVertex(const transmatrix &V, cell *c, shmup::monster *m) { if(doshow && !behindsphere(V2)) { auto info = vd.info; if(info) queueaction(PPR::MONSTER_HEAD, [info] () { SVG_LINK(*info); }); - queuestr(V2, (svg::in ? .28 : .2) * crossf / hcrossf, vd.name, backcolor ? 0x000000 : 0xFFFF00, (svg::in || ISWEB) ? 0 : 1); + queuestr(V2, (svg::in ? .28 : .2) * cgi.crossf / cgi.hcrossf, vd.name, forecolor, (svg::in || ISWEB) ? 0 : 1); if(info) queueaction(PPR::MONSTER_HEAD, [] () { SVG_LINK(""); }); } } @@ -1527,7 +1527,7 @@ bool rogueviz_hud() { transmatrix V = atscreenpos(x, y, current_display->radius/8); poly_outline = t->color | 0xFF; - queuepolyat(V, shTriangle, 0, PPR::MONSTER_HEAD); + queuepolyat(V, cgi.shTriangle, 0, PPR::MONSTER_HEAD); poly_outline = OUTLINE_DEFAULT; queuestr(int(x-rad), int(y), 0, rad*(svg::in?5:3)/4, t->name, forecolor, 0, 16);