1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-03 11:17:56 +00:00

redone hrmap::draw() function to keep DRY

This commit is contained in:
Zeno Rogue
2020-07-27 19:36:19 +02:00
parent 42446f1925
commit 67595a4ed3
15 changed files with 61 additions and 322 deletions

View File

@@ -176,27 +176,6 @@ struct hrmap_asonov : hrmap {
for(int a=0; a<S7; a++) if(h2 == h1->move(a)) return adjmatrix(a);
return coord_to_matrix(coords[h2], coords[h1]);
}
void draw() override {
dq::clear_all();
dq::enqueue_by_matrix(centerover->master, cview());
while(!dq::drawqueue.empty()) {
auto& p = dq::drawqueue.front();
heptagon *h = p.first;
shiftmatrix V = p.second;
dq::drawqueue.pop();
cell *c = h->c7;
if(!do_draw(c, V)) continue;
drawcell(c, V);
if(in_wallopt() && isWall3(c) && isize(dq::drawqueue) > 1000) continue;
for(int i=0; i<S7; i++)
dq::enqueue_by_matrix(h->cmove(i), V * adjmatrix(i));
}
}
};
EX hrmap *new_map() { return new hrmap_asonov; }