aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-22 21:57:08 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-22 21:57:08 +0100
commit004ee3aafb6beb4e984877186bced560010f4ddb (patch)
tree9f6f79dd0a2c50e35bcc7bd5d76b0e41a20af7a7 /src/crepe/api/Texture.cpp
parent1499363d85abedbdb571e33801b821f4dfabc638 (diff)
fix RenderSystem unit test path resolution + reset Config before each testloek/hotfix
Diffstat (limited to 'src/crepe/api/Texture.cpp')
-rw-r--r--src/crepe/api/Texture.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp
index 9be9421..264d7b1 100644
--- a/src/crepe/api/Texture.cpp
+++ b/src/crepe/api/Texture.cpp
@@ -9,14 +9,9 @@
using namespace crepe;
using namespace std;
-Texture::Texture(unique_ptr<Asset> res) {
+Texture::Texture(const Asset & src) {
dbg_trace();
- this->load(std::move(res));
-}
-
-Texture::Texture(const char * src) {
- dbg_trace();
- this->load(make_unique<Asset>(src));
+ this->load(src);
}
Texture::~Texture() {
@@ -24,9 +19,9 @@ Texture::~Texture() {
this->texture.reset();
}
-void Texture::load(unique_ptr<Asset> res) {
+void Texture::load(const Asset & res) {
SDLContext & ctx = SDLContext::get_instance();
- this->texture = std::move(ctx.texture_from_path(res->get_path()));
+ this->texture = ctx.texture_from_path(res.get_path());
}
int Texture::get_width() const {