summaryrefslogtreecommitdiff
path: root/game
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 18:25:28 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 18:25:28 +0000
commitf848ad0e672d913c36fcb86533cbc11a9cf9d9ea (patch)
treee8384bdb074a4e3e53fd9a218b9d9910e6a8256d /game
parentTidied Scene Renderer (diff)
downloadilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.tar.bz2
ilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.tar.xz
ilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.zip
Rename Shader to SceneShader
Diffstat (limited to 'game')
-rw-r--r--game/network/network.h4
-rw-r--r--game/network/network.impl.h6
-rw-r--r--game/network/rail.cpp2
-rw-r--r--game/network/rail.h4
-rw-r--r--game/terrain.cpp8
-rw-r--r--game/terrain.h4
-rw-r--r--game/vehicles/railVehicle.cpp2
-rw-r--r--game/vehicles/railVehicle.h4
-rw-r--r--game/vehicles/railVehicleClass.cpp5
-rw-r--r--game/vehicles/railVehicleClass.h4
-rw-r--r--game/vehicles/train.cpp2
-rw-r--r--game/vehicles/train.h4
12 files changed, 25 insertions, 24 deletions
diff --git a/game/network/network.h b/game/network/network.h
index 4a2f56a..e7a65b5 100644
--- a/game/network/network.h
+++ b/game/network/network.h
@@ -12,7 +12,7 @@
#include <variant>
class Texture;
-class Shader;
+class SceneShader;
class Ray;
template<size_t... n> using GenDef = std::tuple<glm::vec<n, float>...>;
@@ -96,7 +96,7 @@ public:
float findNodeDirection(Node::AnyCPtr) const override;
- void render(const Shader &) const override;
+ void render(const SceneShader &) const override;
protected:
Link::CCollection addJoins();
diff --git a/game/network/network.impl.h b/game/network/network.impl.h
index 597e3aa..5f60c80 100644
--- a/game/network/network.impl.h
+++ b/game/network/network.impl.h
@@ -1,13 +1,13 @@
#include "network.h"
-#include <gfx/gl/shader.h>
+#include <gfx/gl/sceneShader.h>
#include <gfx/models/texture.h>
template<typename T>
void
-NetworkOf<T>::render(const Shader & shader) const
+NetworkOf<T>::render(const SceneShader & shader) const
{
if constexpr (std::is_base_of_v<Renderable, T>) {
- shader.setModel(Location {}, Shader::Program::StaticPos);
+ shader.setModel(Location {}, SceneShader::Program::StaticPos);
texture->bind();
links.apply(&Renderable::render, shader);
}
diff --git a/game/network/rail.cpp b/game/network/rail.cpp
index 2efa87a..2f09d88 100644
--- a/game/network/rail.cpp
+++ b/game/network/rail.cpp
@@ -94,7 +94,7 @@ RailLink::defaultMesh(const std::span<Vertex> vertices)
}
void
-RailLink::render(const Shader &) const
+RailLink::render(const SceneShader &) const
{
mesh->Draw();
}
diff --git a/game/network/rail.h b/game/network/rail.h
index 6850463..8edc363 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -11,7 +11,7 @@
#include <span>
#include <special_members.hpp>
-class Shader;
+class SceneShader;
class Vertex;
struct Arc;
@@ -26,7 +26,7 @@ public:
using StraightLink = RailLinkStraight;
using CurveLink = RailLinkCurve;
- void render(const Shader &) const override;
+ void render(const SceneShader &) const override;
NO_COPY(RailLink);
NO_MOVE(RailLink);
diff --git a/game/terrain.cpp b/game/terrain.cpp
index 3a35c42..911a541 100644
--- a/game/terrain.cpp
+++ b/game/terrain.cpp
@@ -6,7 +6,7 @@
#include <cache.h>
#include <cstddef>
#include <filesystem>
-#include <gfx/gl/shader.h>
+#include <gfx/gl/sceneShader.h>
#include <gfx/image.h>
#include <gfx/models/mesh.h>
#include <gfx/models/vertex.hpp>
@@ -83,13 +83,13 @@ Terrain::tick(TickDuration dur)
}
void
-Terrain::render(const Shader & shader) const
+Terrain::render(const SceneShader & shader) const
{
- shader.setModel(Location {}, Shader::Program::LandMass);
+ shader.setModel(Location {}, SceneShader::Program::LandMass);
grass->bind();
meshes.apply(&Mesh::Draw);
- shader.setModel(Location {}, Shader::Program::Water);
+ shader.setModel(Location {}, SceneShader::Program::Water);
shader.setUniform("waves", {waveCycle, 0, 0});
water->bind();
meshes.apply(&Mesh::Draw);
diff --git a/game/terrain.h b/game/terrain.h
index b13efb6..70f947c 100644
--- a/game/terrain.h
+++ b/game/terrain.h
@@ -7,7 +7,7 @@
#include <gfx/renderable.h>
#include <memory>
-class Shader;
+class SceneShader;
class Texture;
class GeoData;
@@ -15,7 +15,7 @@ class Terrain : public WorldObject, public Renderable {
public:
explicit Terrain(std::shared_ptr<GeoData>);
- void render(const Shader & shader) const override;
+ void render(const SceneShader & shader) const override;
void tick(TickDuration) override;
float waveCycle {0.F};
diff --git a/game/vehicles/railVehicle.cpp b/game/vehicles/railVehicle.cpp
index fb42a28..0cf4e72 100644
--- a/game/vehicles/railVehicle.cpp
+++ b/game/vehicles/railVehicle.cpp
@@ -12,7 +12,7 @@
#include <ray.hpp>
void
-RailVehicle::render(const Shader & shader) const
+RailVehicle::render(const SceneShader & shader) const
{
rvClass->render(shader, location, bogies);
}
diff --git a/game/vehicles/railVehicle.h b/game/vehicles/railVehicle.h
index 5fbe1ed..39900cc 100644
--- a/game/vehicles/railVehicle.h
+++ b/game/vehicles/railVehicle.h
@@ -9,7 +9,7 @@
#include <memory>
#include <utility>
-class Shader;
+class SceneShader;
class Ray;
class Train;
@@ -19,7 +19,7 @@ public:
void move(const Train *, float & trailBy);
- void render(const Shader & shader) const override;
+ void render(const SceneShader & shader) const override;
[[nodiscard]] bool intersectRay(const Ray &, glm::vec2 *, float *) const override;
Location location;
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index 7eb4495..7d69338 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -1,5 +1,5 @@
#include "railVehicleClass.h"
-#include "gfx/gl/shader.h"
+#include "gfx/gl/sceneShader.h"
#include "gfx/models/mesh.h"
#include "gfx/models/obj.h"
#include "gfx/models/texture.h"
@@ -39,7 +39,8 @@ RailVehicleClass::RailVehicleClass(std::unique_ptr<ObjParser> o, std::shared_ptr
}
void
-RailVehicleClass::render(const Shader & shader, const Location & location, const std::array<Location, 2> & bl) const
+RailVehicleClass::render(
+ const SceneShader & shader, const Location & location, const std::array<Location, 2> & bl) const
{
texture->bind();
for (auto b = 0U; b < bogies.size(); ++b) {
diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h
index 604af6a..7249e76 100644
--- a/game/vehicles/railVehicleClass.h
+++ b/game/vehicles/railVehicleClass.h
@@ -5,7 +5,7 @@
#include <memory>
#include <string>
-class Shader;
+class SceneShader;
class Texture;
class ObjParser;
class Location;
@@ -14,7 +14,7 @@ class RailVehicleClass {
public:
explicit RailVehicleClass(const std::string & name);
- void render(const Shader &, const Location &, const std::array<Location, 2> &) const;
+ void render(const SceneShader &, const Location &, const std::array<Location, 2> &) const;
std::array<Mesh::Ptr, 2> bogies;
Mesh::Ptr bodyMesh;
diff --git a/game/vehicles/train.cpp b/game/vehicles/train.cpp
index d1122f8..8fb48f5 100644
--- a/game/vehicles/train.cpp
+++ b/game/vehicles/train.cpp
@@ -12,7 +12,7 @@
class Ray;
void
-Train::render(const Shader & shader) const
+Train::render(const SceneShader & shader) const
{
apply(&Renderable::render, shader);
}
diff --git a/game/vehicles/train.h b/game/vehicles/train.h
index 58e5e29..dfdcf62 100644
--- a/game/vehicles/train.h
+++ b/game/vehicles/train.h
@@ -13,7 +13,7 @@
#include <memory>
#include <vector>
-class Shader;
+class SceneShader;
class Ray;
class Train : public Vehicle, public Collection<RailVehicle, false>, public Can<Go>, public Can<Idle> {
@@ -26,7 +26,7 @@ public:
return objects.front()->location;
}
- void render(const Shader & shader) const override;
+ void render(const SceneShader & shader) const override;
[[nodiscard]] bool intersectRay(const Ray &, glm::vec2 *, float *) const override;