mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
rogueviz:: cgi
This commit is contained in:
parent
2402dfeac9
commit
5ab26ee6c3
@ -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; t<c->type; 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)<c : (((t^1)&1) || c->move(t) < c))
|
||||
|
@ -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++;
|
||||
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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()));
|
||||
|
34
rogueviz.cpp
34
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<glvertex>& 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<darken; i++) part(c, i+1) = (part(c, i+1) + part(backcolor, 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);
|
||||
|
Loading…
Reference in New Issue
Block a user