summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-03 22:29:42 +0100
committerAki <please@ignore.pl>2023-02-03 22:29:42 +0100
commitec3ae653a0965c6c19920ed46030a0abde0fee1c (patch)
treedfa4cb9abece077f0456cf76012a339dd5c39adb
parent9b453277059fd015703873172d0dc87b4a29cb55 (diff)
downloadkurator-ec3ae653a0965c6c19920ed46030a0abde0fee1c.zip
kurator-ec3ae653a0965c6c19920ed46030a0abde0fee1c.tar.gz
kurator-ec3ae653a0965c6c19920ed46030a0abde0fee1c.tar.bz2
Moved Camera to engine
-rw-r--r--engine/include/kurator/engine/Camera.h (renamed from kurator/src/Camera.h)7
-rw-r--r--kurator/src/Battle.cpp1
-rw-r--r--kurator/src/Battle.h4
-rw-r--r--kurator/src/Grid.cpp4
-rw-r--r--kurator/src/Grid.h4
5 files changed, 11 insertions, 9 deletions
diff --git a/kurator/src/Camera.h b/engine/include/kurator/engine/Camera.h
index 6056c7a..abe0ffe 100644
--- a/kurator/src/Camera.h
+++ b/engine/include/kurator/engine/Camera.h
@@ -1,17 +1,20 @@
#pragma once
-#include <kurator/engine/Point.h>
+#include "Point.h"
namespace kurator
{
+namespace engine
+{
struct Camera
{
- engine::Point offset = {};
+ Point offset = {};
double scale = 1.0;
};
+} // namespace engine
} // namespace kurator
diff --git a/kurator/src/Battle.cpp b/kurator/src/Battle.cpp
index d300011..40390ee 100644
--- a/kurator/src/Battle.cpp
+++ b/kurator/src/Battle.cpp
@@ -18,7 +18,6 @@
#include <kurator/universe/ShipType.h>
#include <kurator/universe/UniqueIdentifier.h>
-#include "Camera.h"
#include "colors.h"
#include "components.h"
#include "Grid.h"
diff --git a/kurator/src/Battle.h b/kurator/src/Battle.h
index e7813d7..c25f6b8 100644
--- a/kurator/src/Battle.h
+++ b/kurator/src/Battle.h
@@ -4,12 +4,12 @@
#include <memory>
#include <kurator/campaign/Scenario.h>
+#include <kurator/engine/Camera.h>
#include <kurator/sim/Battle.h>
#include <kurator/sim/events.h>
#include <kurator/stats/EventLog.h>
#include <kurator/stats/events.h>
-#include "Camera.h"
#include "ForceBalance.h"
#include "Scene.h"
#include "Session.h"
@@ -35,7 +35,7 @@ public:
private:
std::shared_ptr<Session> session;
std::unique_ptr<sim::Battle> battle;
- Camera camera;
+ engine::Camera camera;
ForceBalance balance;
stats::EventLog log;
float time_factor;
diff --git a/kurator/src/Grid.cpp b/kurator/src/Grid.cpp
index 53f7b47..4243bc9 100644
--- a/kurator/src/Grid.cpp
+++ b/kurator/src/Grid.cpp
@@ -2,7 +2,7 @@
#include <raylib.h>
-#include "Camera.h"
+#include <kurator/engine/Camera.h>
namespace kurator
@@ -10,7 +10,7 @@ namespace kurator
void
-Grid::draw(const Camera& camera) const
+Grid::draw(const engine::Camera& camera) const
{
const int width = GetScreenWidth();
const int height = GetScreenHeight();
diff --git a/kurator/src/Grid.h b/kurator/src/Grid.h
index cf9a00d..72660cb 100644
--- a/kurator/src/Grid.h
+++ b/kurator/src/Grid.h
@@ -1,6 +1,6 @@
#pragma once
-#include "Camera.h"
+#include <kurator/engine/Camera.h>
namespace kurator
@@ -10,7 +10,7 @@ namespace kurator
class Grid
{
public:
- void draw(const Camera& camera) const;
+ void draw(const engine::Camera& camera) const;
};