summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-06 20:48:33 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 01:02:02 +0000
commit2f8d7643d03f39fa848576692264d0fe3a37ed91 (patch)
treef4578e2ce3020c04a206f9eb0bc02587de5b3d6a /game
parentDon't request a specific OpenGL version, just check we get something sufficie... (diff)
downloadilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.bz2
ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.tar.xz
ilt-2f8d7643d03f39fa848576692264d0fe3a37ed91.zip
Reformat with new clang-format
Diffstat (limited to 'game')
-rw-r--r--game/activity.h2
-rw-r--r--game/gamestate.h1
-rw-r--r--game/geoData.cpp1
-rw-r--r--game/geoData.h1
-rw-r--r--game/network/link.h2
-rw-r--r--game/network/rail.cpp1
-rw-r--r--game/network/rail.h2
-rw-r--r--game/objective.h2
-rw-r--r--game/orders.h1
-rw-r--r--game/vehicles/railVehicle.h1
-rw-r--r--game/vehicles/railVehicleClass.h1
-rw-r--r--game/vehicles/vehicle.h1
12 files changed, 16 insertions, 0 deletions
diff --git a/game/activity.h b/game/activity.h
index e0585f7..38f6524 100644
--- a/game/activity.h
+++ b/game/activity.h
@@ -16,10 +16,12 @@ public:
template<typename T> class Of;
};
+
using ActivityPtr = std::unique_ptr<Activity>;
template<typename T>
concept ActivityConcept = std::is_base_of_v<Activity, T>;
+
template<ActivityConcept AC> class Can {
public:
Can() = default;
diff --git a/game/gamestate.h b/game/gamestate.h
index 6f3f382..f07f844 100644
--- a/game/gamestate.h
+++ b/game/gamestate.h
@@ -19,4 +19,5 @@ public:
std::shared_ptr<GeoData> geoData;
AssetFactory::Assets assets;
};
+
extern GameState * gameState;
diff --git a/game/geoData.cpp b/game/geoData.cpp
index 34a1030..76550cc 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -100,6 +100,7 @@ GeoData::positionAt(const glm::vec2 wcoord) const
}
GeoData::RayTracer::RayTracer(glm::vec2 p0, glm::vec2 p1) : RayTracer {p0, p1, glm::abs(p1)} { }
+
GeoData::RayTracer::RayTracer(glm::vec2 p0, glm::vec2 p1, glm::vec2 d) :
RayTracer {p0, d, byAxis(p0, p1, d, 0), byAxis(p0, p1, d, 1)}
{
diff --git a/game/geoData.h b/game/geoData.h
index f433a5c..f9a7d7b 100644
--- a/game/geoData.h
+++ b/game/geoData.h
@@ -15,6 +15,7 @@ public:
struct Node {
float height {-1.5F};
};
+
using Quad = std::array<glm::vec3, 4>;
using Limits = std::pair<glm::ivec2, glm::ivec2>;
diff --git a/game/network/link.h b/game/network/link.h
index 4a9f83f..0d66c42 100644
--- a/game/network/link.h
+++ b/game/network/link.h
@@ -71,6 +71,7 @@ public:
[[nodiscard]] Location positionAt(float dist, unsigned char start) const override;
[[nodiscard]] bool intersectRay(const Ray &) const override;
};
+
LinkStraight::~LinkStraight() = default;
class LinkCurve : public virtual Link {
@@ -87,4 +88,5 @@ public:
float radius;
Arc arc;
};
+
LinkCurve::~LinkCurve() = default;
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index bd24a2b..5a4f1e1 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -21,6 +21,7 @@ constexpr auto RAIL_CROSSSECTION_VERTICES {5U};
constexpr glm::vec3 RAIL_HEIGHT {0, 0, .25F};
RailLinks::RailLinks() : NetworkOf<RailLink> {"rails.jpg"} { }
+
void
RailLinks::tick(TickDuration)
{
diff --git a/game/network/rail.h b/game/network/rail.h
index 611eb67..6684801 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -18,6 +18,7 @@ struct Arc;
// A piece of rail track
class RailLinkStraight;
class RailLinkCurve;
+
class RailLink : public virtual Link, public Renderable {
public:
RailLink() = default;
@@ -36,6 +37,7 @@ protected:
Mesh::Ptr mesh;
};
+
RailLink::~RailLink() = default;
class RailLinkStraight : public RailLink, public LinkStraight {
diff --git a/game/objective.h b/game/objective.h
index 130015f..f5c6e48 100644
--- a/game/objective.h
+++ b/game/objective.h
@@ -10,6 +10,7 @@ class Orders;
class Objective {
public:
explicit Objective(Orders * os) : orders(os) { }
+
DEFAULT_MOVE_COPY(Objective);
virtual ~Objective() = default;
@@ -19,4 +20,5 @@ public:
Orders * orders;
};
+
using ObjectivePtr = std::unique_ptr<Objective>;
diff --git a/game/orders.h b/game/orders.h
index f29e208..ca5cfdb 100644
--- a/game/orders.h
+++ b/game/orders.h
@@ -10,4 +10,5 @@ public:
[[nodiscard]] Objective * current() const;
Objective * next();
};
+
using OrdersPtr = std::shared_ptr<Orders>;
diff --git a/game/vehicles/railVehicle.h b/game/vehicles/railVehicle.h
index f34643e..be88142 100644
--- a/game/vehicles/railVehicle.h
+++ b/game/vehicles/railVehicle.h
@@ -25,4 +25,5 @@ public:
BLocation location;
std::array<BLocation, 2> bogies;
};
+
using RailVehiclePtr = std::unique_ptr<RailVehicle>;
diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h
index 80b3fda..4668d7d 100644
--- a/game/vehicles/railVehicleClass.h
+++ b/game/vehicles/railVehicleClass.h
@@ -41,4 +41,5 @@ private:
glVertexArray instanceVAO;
std::array<glVertexArray, 2> instancesBogiesVAO;
};
+
using RailVehicleClassPtr = std::shared_ptr<RailVehicleClass>;
diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h
index 763ade9..354f904 100644
--- a/game/vehicles/vehicle.h
+++ b/game/vehicles/vehicle.h
@@ -27,4 +27,5 @@ protected:
void move(TickDuration dur);
LinkHistory linkHist;
};
+
using VehicleWPtr = std::weak_ptr<Vehicle>;