summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/src/Battle.cpp18
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()) {