diff options
author | Aki <please@ignore.pl> | 2022-12-04 23:50:17 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-12-04 23:50:17 +0100 |
commit | 2860d6e665e908e8a66c147ea45ea6398959c628 (patch) | |
tree | 3ee087f282074410174415b679f0dcdccdc6f74c | |
parent | bb8f91d769970018a53e37f83a545967c8f150d0 (diff) | |
download | kurator-2860d6e665e908e8a66c147ea45ea6398959c628.zip kurator-2860d6e665e908e8a66c147ea45ea6398959c628.tar.gz kurator-2860d6e665e908e8a66c147ea45ea6398959c628.tar.bz2 |
Moved shooting lines below markers
-rw-r--r-- | kurator/src/Battle.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp index 8c35969..8d28dba 100644 --- a/kurator/src/Battle.cpp +++ b/kurator/src/Battle.cpp @@ -75,6 +75,15 @@ Battle::draw() const const int height = GetScreenHeight(); const double scale = std::min(width/30000.0, height/30000.0); auto& registry = battle->registry(); + auto lines = registry.view<Line>(); + for (const auto& [entity, line] : lines.each()) { + DrawLine( + width/2 + line.start.x*scale, + height/2 + line.start.y*scale, + width/2 + line.end.x*scale, + height/2 + line.end.y*scale, + line.color); + } auto view = registry.view<const Marker, const sim::Transform>(); for (auto [entity, marker, transform] : view.each()) { const int x = width/2 + transform.position.x*scale; @@ -89,15 +98,6 @@ Battle::draw() const const int y = height/2 + transform.position.y*scale - text.font_size/2 + offset.y; DrawText(text.text.c_str(), x, y, text.font_size, text.color); } - auto lines = registry.view<Line>(); - for (const auto& [entity, line] : lines.each()) { - DrawLine( - width/2 + line.start.x*scale, - height/2 + line.start.y*scale, - width/2 + line.end.x*scale, - height/2 + line.end.y*scale, - line.color); - } auto points = registry.view<sim::HitPoints, sim::Team>(); double totals[2] {0.0, 0.0}; // FIXME and extract for (const auto& [entity, points, team] : points.each()) { |