From f848ad0e672d913c36fcb86533cbc11a9cf9d9ea Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 3 Nov 2022 18:25:28 +0000 Subject: Rename Shader to SceneShader --- game/network/network.h | 4 ++-- game/network/network.impl.h | 6 +++--- game/network/rail.cpp | 2 +- game/network/rail.h | 4 ++-- game/terrain.cpp | 8 ++++---- game/terrain.h | 4 ++-- game/vehicles/railVehicle.cpp | 2 +- game/vehicles/railVehicle.h | 4 ++-- game/vehicles/railVehicleClass.cpp | 5 +++-- game/vehicles/railVehicleClass.h | 4 ++-- game/vehicles/train.cpp | 2 +- game/vehicles/train.h | 4 ++-- 12 files changed, 25 insertions(+), 24 deletions(-) (limited to 'game') 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 class Texture; -class Shader; +class SceneShader; class Ray; template using GenDef = std::tuple...>; @@ -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 +#include #include template void -NetworkOf::render(const Shader & shader) const +NetworkOf::render(const SceneShader & shader) const { if constexpr (std::is_base_of_v) { - 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 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 #include -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 #include #include -#include +#include #include #include #include @@ -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 #include -class Shader; +class SceneShader; class Texture; class GeoData; @@ -15,7 +15,7 @@ class Terrain : public WorldObject, public Renderable { public: explicit Terrain(std::shared_ptr); - 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 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 #include -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 o, std::shared_ptr } void -RailVehicleClass::render(const Shader & shader, const Location & location, const std::array & bl) const +RailVehicleClass::render( + const SceneShader & shader, const Location & location, const std::array & 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 #include -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 &) const; + void render(const SceneShader &, const Location &, const std::array &) const; std::array 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 #include -class Shader; +class SceneShader; class Ray; class Train : public Vehicle, public Collection, public Can, public Can { @@ -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; -- cgit v1.2.3