diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-07-20 17:57:35 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-08-10 18:06:01 +0100 |
commit | 790599b583e1b819b5023a35b13b707ec9de3439 (patch) | |
tree | 71fd0359798a2792586695cdd8042829c4b820f6 | |
parent | Add missing truthy/falsy operators to AnyPtr (diff) | |
download | ilt-790599b583e1b819b5023a35b13b707ec9de3439.tar.bz2 ilt-790599b583e1b819b5023a35b13b707ec9de3439.tar.xz ilt-790599b583e1b819b5023a35b13b707ec9de3439.zip |
Apply StdTypeDefs for Texture
-rw-r--r-- | game/network/network.h | 13 | ||||
-rw-r--r-- | game/scenary/foliage.h | 4 | ||||
-rw-r--r-- | game/scenary/illuminator.h | 4 | ||||
-rw-r--r-- | game/terrain.h | 8 | ||||
-rw-r--r-- | game/vehicles/railVehicleClass.h | 5 | ||||
-rw-r--r-- | game/water.h | 8 | ||||
-rw-r--r-- | gfx/models/texture.h | 5 |
7 files changed, 23 insertions, 24 deletions
diff --git a/game/network/network.h b/game/network/network.h index 5725360..ca17581 100644 --- a/game/network/network.h +++ b/game/network/network.h @@ -1,19 +1,18 @@ #pragma once +#include "collection.h" #include "gfx/gl/instanceVertices.h" +#include "gfx/models/texture.h" +#include "gfx/renderable.h" #include "link.h" -#include <collection.h> -#include <gfx/renderable.h> +#include "sorting.h" +#include "special_members.h" #include <glm/glm.hpp> #include <memory> #include <set> -#include <sorting.h> -#include <special_members.h> #include <string> #include <utility> -#include <variant> -class Texture; class SceneShader; template<typename> class Ray; @@ -56,7 +55,7 @@ protected: using Nodes = std::set<Node::Ptr, PtrMemberSorter<Node::Ptr, &Node::pos>>; Nodes nodes; - std::shared_ptr<Texture> texture; + Texture::Ptr texture; }; template<typename LinkType> class NetworkLinkHolder { diff --git a/game/scenary/foliage.h b/game/scenary/foliage.h index 3beda89..0a4261c 100644 --- a/game/scenary/foliage.h +++ b/game/scenary/foliage.h @@ -2,16 +2,16 @@ #include "assetFactory/asset.h" #include "gfx/gl/instanceVertices.h" +#include "gfx/models/texture.h" #include "gfx/renderable.h" class SceneShader; class ShadowMapper; class Location; -class Texture; class Foliage : public Asset, public Renderable, public StdTypeDefs<Foliage> { Mesh::Ptr bodyMesh; - std::shared_ptr<Texture> texture; + Texture::Ptr texture; glVertexArray instanceVAO; public: diff --git a/game/scenary/illuminator.h b/game/scenary/illuminator.h index cd6073c..44bd583 100644 --- a/game/scenary/illuminator.h +++ b/game/scenary/illuminator.h @@ -2,15 +2,15 @@ #include "assetFactory/asset.h" #include "gfx/gl/instanceVertices.h" +#include "gfx/models/texture.h" #include "gfx/renderable.h" class SceneShader; class Location; -class Texture; class Illuminator : public Asset, public Renderable, public StdTypeDefs<Illuminator> { Mesh::Ptr bodyMesh; - std::shared_ptr<Texture> texture; + Texture::Ptr texture; glVertexArray instanceVAO; std::optional<glVertexArray> instancesSpotLightVAO, instancesPointLightVAO; diff --git a/game/terrain.h b/game/terrain.h index d088f89..1c79d19 100644 --- a/game/terrain.h +++ b/game/terrain.h @@ -4,12 +4,12 @@ #include "collection.h" #include "config/types.h" #include "game/worldobject.h" -#include <gfx/models/mesh.h> -#include <gfx/renderable.h> +#include "gfx/models/mesh.h" +#include "gfx/models/texture.h" +#include "gfx/renderable.h" #include <memory> class SceneShader; -class Texture; class GeoData; class Terrain : public WorldObject, public Renderable { @@ -32,5 +32,5 @@ private: std::shared_ptr<GeoData> geoData; Collection<MeshT<Vertex>, false> meshes; - std::shared_ptr<Texture> grass; + Texture::Ptr grass; }; diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h index 9d9d4c2..88f08c5 100644 --- a/game/vehicles/railVehicleClass.h +++ b/game/vehicles/railVehicleClass.h @@ -3,14 +3,13 @@ #include "assetFactory/asset.h" #include "gfx/gl/instanceVertices.h" #include "gfx/models/mesh.h" +#include "gfx/models/texture.h" #include "gfx/renderable.h" #include <array> #include <memory> -#include <string> class SceneShader; class ShadowMapper; -class Texture; class Location; class RailVehicleClass : public Renderable, public Asset { @@ -25,7 +24,7 @@ public: std::array<Mesh::Ptr, 2> bogies; Mesh::Ptr bodyMesh; - std::shared_ptr<Texture> texture; + Texture::Ptr texture; float wheelBase; float length; float maxSpeed; diff --git a/game/water.h b/game/water.h index ceb7bd2..ba46703 100644 --- a/game/water.h +++ b/game/water.h @@ -4,12 +4,12 @@ #include "collection.h" #include "config/types.h" #include "game/worldobject.h" -#include <gfx/models/mesh.h> -#include <gfx/renderable.h> +#include "gfx/models/mesh.h" +#include "gfx/models/texture.h" +#include "gfx/renderable.h" #include <memory> class SceneShader; -class Texture; class GeoData; class Water : public WorldObject, public Renderable { @@ -30,5 +30,5 @@ private: std::shared_ptr<GeoData> geoData; Collection<MeshT<Vertex>, false> meshes; - std::shared_ptr<Texture> water; + Texture::Ptr water; }; diff --git a/gfx/models/texture.h b/gfx/models/texture.h index 689d378..8cb8128 100644 --- a/gfx/models/texture.h +++ b/gfx/models/texture.h @@ -1,8 +1,9 @@ #pragma once #include "config/types.h" +#include "glArrays.h" +#include "stdTypeDefs.h" #include <filesystem> -#include <glArrays.h> #include <glm/fwd.hpp> class Image; @@ -20,7 +21,7 @@ struct TextureOptions { static GLint glMapMode(MapMode); }; -class Texture { +class Texture : public StdTypeDefs<Texture> { public: virtual ~Texture() = default; DEFAULT_MOVE_NO_COPY(Texture); |