mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
rogueviz:: improved edges in multidraw
This commit is contained in:
parent
0c4ab20867
commit
dc0d3ea610
@ -1037,6 +1037,8 @@ void queuedisk(const transmatrix& V, const colorpair& cp, bool legend) {
|
||||
if(cp.shade == 'm') queuepoly(V1, shDiskM, cp.color2);
|
||||
}
|
||||
|
||||
unordered_map<pair<edgeinfo*, int>, int> drawn_edges;
|
||||
|
||||
void drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
if(m->dead) return;
|
||||
int i = m->pid;
|
||||
@ -1090,6 +1092,13 @@ void drawVertex(const transmatrix &V, cell *c, shmup::monster *m) {
|
||||
hyperpoint h1 = gm1 * vd1.m->at * C0;
|
||||
hyperpoint h2 = gm2 * vd2.m->at * C0;
|
||||
|
||||
if(multidraw) {
|
||||
int code = int(h1[0]) + int(h1[1]) * 12789117 + int(h2[0]) * 126081253 + int(h2[1]) * 126891531;
|
||||
int& lastdraw = drawn_edges[make_pair(ei, code)];
|
||||
if(lastdraw == frameid) continue;
|
||||
lastdraw = frameid;
|
||||
}
|
||||
|
||||
/* if(hdist0(h1) < .001 || hdist0(h2) < .001) {
|
||||
printf("h1 = %s\n", display(h1));
|
||||
printf("h2 = %s\n", display(h2));
|
||||
|
Loading…
Reference in New Issue
Block a user