summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/CMakeLists.txt2
-rw-r--r--kurator/src/Battle.cpp8
-rw-r--r--kurator/src/projectiles.cpp (renamed from kurator/src/lines.cpp)10
-rw-r--r--kurator/src/projectiles.h (renamed from kurator/src/lines.h)6
4 files changed, 13 insertions, 13 deletions
diff --git a/kurator/CMakeLists.txt b/kurator/CMakeLists.txt
index 947aa52..04e0c19 100644
--- a/kurator/CMakeLists.txt
+++ b/kurator/CMakeLists.txt
@@ -9,12 +9,12 @@ add_executable(
src/ForceBalance.cpp
src/Grid.cpp
src/inspect.cpp
- src/lines.cpp
src/main.cpp
src/markers.cpp
src/Mouse.cpp
src/Pause.cpp
src/PopupEmitter.cpp
+ src/projectiles.cpp
src/ScenarioEditor.cpp
src/SceneBuilder.cpp
src/SceneFrame.cpp
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp
index 0eaeac1..1d0f872 100644
--- a/kurator/src/Battle.cpp
+++ b/kurator/src/Battle.cpp
@@ -20,10 +20,10 @@
#include "components.h"
#include "Grid.h"
#include "inspect.h"
-#include "lines.h"
#include "markers.h"
#include "Pause.h"
#include "PopupEmitter.h"
+#include "projectiles.h"
#include "Session.h"
#include "Summary.h"
@@ -96,7 +96,7 @@ Battle::update()
progress_timers(ctx);
move_ui_pops(ctx);
blink_crosses(ctx);
- animate_lines(ctx);
+ animate_projectiles(ctx);
balance.update(ctx.registry);
ImGui::SetNextWindowPos({GetScreenWidth()/2.0f, GetScreenHeight()-100.0f}, ImGuiCond_Once, {0.5f, 0.5f});
ImGui::SetNextWindowSize({240.0f, 0.0f}, ImGuiCond_Once);
@@ -158,7 +158,7 @@ Battle::draw() const
draw_turret_visuals(ctx);
draw_ai_visuals(ctx);
draw_crosses(ctx);
- draw_lines(ctx);
+ draw_projectiles(ctx);
draw_markers(ctx);
draw_pops(ctx);
controller.draw(ctx);
@@ -222,7 +222,7 @@ Battle::on_hit(const sim::Hit& hit)
popup.emit(ctx.registry, victim, hit.damage);
const auto line = ctx.registry.create();
ctx.registry.emplace<Timed>(line, 0.2, true);
- ctx.registry.emplace<Line>(
+ ctx.registry.emplace<ProjectileLine>(
line,
RED,
source.position,
diff --git a/kurator/src/lines.cpp b/kurator/src/projectiles.cpp
index 50c7138..9203625 100644
--- a/kurator/src/lines.cpp
+++ b/kurator/src/projectiles.cpp
@@ -1,4 +1,4 @@
-#include "lines.h"
+#include "projectiles.h"
#include <raylib.h>
@@ -10,18 +10,18 @@ namespace kurator
void
-animate_lines(sim::State& ctx)
+animate_projectiles(sim::State& ctx)
{
- auto lines = ctx.registry.view<Line>();
+ auto lines = ctx.registry.view<ProjectileLine>();
for (auto&& [entity, line] : lines.each())
line.position += (1.0 + line.hlength) / line.duration * ctx.clock.dt;
}
void
-draw_lines(const sim::State& ctx)
+draw_projectiles(const sim::State& ctx)
{
- auto lines = ctx.registry.view<Line>();
+ auto lines = ctx.registry.view<ProjectileLine>();
for (const auto& [entity, line] : lines.each()) {
const auto diff = line.end - line.start;
const auto fstart = line.position - line.hlength;
diff --git a/kurator/src/lines.h b/kurator/src/projectiles.h
index a9bed72..ccad75e 100644
--- a/kurator/src/lines.h
+++ b/kurator/src/projectiles.h
@@ -10,7 +10,7 @@ namespace kurator
{
-struct Line
+struct ProjectileLine
{
Color color;
engine::Point start;
@@ -21,8 +21,8 @@ struct Line
};
-void animate_lines(sim::State& ctx);
-void draw_lines(const sim::State& ctx);
+void animate_projectiles(sim::State& ctx);
+void draw_projectiles(const sim::State& ctx);
} // namespace kurator