summaryrefslogtreecommitdiff
path: root/game/network/rail.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-03-10 01:05:35 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-03-10 01:05:35 +0000
commit55e41471e7d4bac221aa82ca9504df7bec43e666 (patch)
treecf644dafd56b4be81f594afa7ca435f91466cfa5 /game/network/rail.h
parentPush RailLinks functionality into new base classes Network and NetworkOf<> (diff)
downloadilt-55e41471e7d4bac221aa82ca9504df7bec43e666.tar.bz2
ilt-55e41471e7d4bac221aa82ca9504df7bec43e666.tar.xz
ilt-55e41471e7d4bac221aa82ca9504df7bec43e666.zip
Vertices and indices vectors not required once mesh is created
Diffstat (limited to 'game/network/rail.h')
-rw-r--r--game/network/rail.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/game/network/rail.h b/game/network/rail.h
index 1d0ef68..c67dc67 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -1,10 +1,8 @@
#ifndef RAILLINKS_H
#define RAILLINKS_H
-#include "collection.hpp"
#include "game/worldobject.h"
#include "gfx/models/mesh.h"
-#include "gfx/models/vertex.hpp"
#include "gfx/renderable.h"
#include "link.h"
#include "network.h"
@@ -13,10 +11,11 @@
#include <maths.h>
#include <memory>
#include <set>
+#include <span>
#include <utility>
-#include <vector>
class Shader;
+class Vertex;
// A piece of rail track
class RailLink : public Link, public Renderable {
@@ -26,11 +25,9 @@ public:
void render(const Shader &) const override;
protected:
- void defaultMesh();
+ [[nodiscard]] static MeshPtr defaultMesh(const std::span<Vertex> vertices);
- Collection<Mesh, false> meshes;
- std::vector<Vertex> vertices;
- std::vector<unsigned int> indices;
+ MeshPtr mesh;
};
class RailLinkStraight : public RailLink {