summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/network/network.cpp3
-rw-r--r--game/terrain.cpp4
-rw-r--r--gfx/gl/shadowMapper.h4
-rw-r--r--gfx/models/texture.cpp3
-rw-r--r--gfx/models/texture.h4
5 files changed, 5 insertions, 13 deletions
diff --git a/game/network/network.cpp b/game/network/network.cpp
index 8aa9adb..500742c 100644
--- a/game/network/network.cpp
+++ b/game/network/network.cpp
@@ -2,7 +2,6 @@
#include "routeWalker.h"
#include <array>
#include <cache.h>
-#include <filesystem>
#include <game/network/link.h>
#include <gfx/models/texture.h>
#include <glm/gtx/intersect.hpp>
@@ -10,7 +9,7 @@
#include <stdexcept>
#include <utility>
-Network::Network(const std::string & tn) : texture {Texture::cachedTexture.get(tn)} { }
+Network::Network(const std::string & tn) : texture {std::make_shared<Texture>(tn)} { }
Node::Ptr
Network::nodeAt(GlobalPosition3D pos)
diff --git a/game/terrain.cpp b/game/terrain.cpp
index 3778f3d..a4b6510 100644
--- a/game/terrain.cpp
+++ b/game/terrain.cpp
@@ -18,8 +18,8 @@
#include <vector>
Terrain::Terrain(std::shared_ptr<GeoData> tm) :
- geoData {std::move(tm)}, grass {Texture::cachedTexture.get("grass.png")},
- water {Texture::cachedTexture.get("water.png")}
+ geoData {std::move(tm)}, grass {std::make_shared<Texture>("grass.png")},
+ water {std::make_shared<Texture>("water.png")}
{
generateMeshes();
}
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h
index bf571f8..d1e4e10 100644
--- a/gfx/gl/shadowMapper.h
+++ b/gfx/gl/shadowMapper.h
@@ -3,13 +3,13 @@
#include "config/types.h"
#include "lib/glArrays.h"
#include "program.h"
+#include <gfx/models/texture.h>
#include <glm/vec2.hpp>
+#include <vector>
class SceneProvider;
class Camera;
-#include <gfx/models/texture.h>
-
class ShadowMapper {
public:
explicit ShadowMapper(const TextureAbsCoord & size);
diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp
index 0ebba08..51223aa 100644
--- a/gfx/models/texture.cpp
+++ b/gfx/models/texture.cpp
@@ -2,7 +2,6 @@
#include "config/types.h"
#include "glArrays.h"
#include "tga.h"
-#include <cache.h>
#include <fcntl.h>
#include <filesystem.h>
#include <gfx/image.h>
@@ -13,8 +12,6 @@
#include <stb/stb_image.h>
#include <sys/mman.h>
-Cache<Texture, std::filesystem::path> Texture::cachedTexture;
-
GLint
TextureOptions::glMapMode(TextureOptions::MapMode mm)
{
diff --git a/gfx/models/texture.h b/gfx/models/texture.h
index 5d40b39..689d378 100644
--- a/gfx/models/texture.h
+++ b/gfx/models/texture.h
@@ -1,12 +1,10 @@
#pragma once
#include "config/types.h"
-#include <cache.h>
#include <filesystem>
#include <glArrays.h>
#include <glm/fwd.hpp>
-// IWYU pragma: no_forward_declare Cache
class Image;
struct TextureOptions {
@@ -32,8 +30,6 @@ public:
explicit Texture(GLsizei width, GLsizei height, TextureOptions = {});
explicit Texture(GLsizei width, GLsizei height, const void * data, TextureOptions = {});
- static Cache<Texture, std::filesystem::path> cachedTexture;
-
virtual void bind(GLenum unit = GL_TEXTURE0) const;
void save(const char * path) const;