diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 22:23:36 +0200 | 
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-23 22:23:36 +0200 | 
| commit | 6e2c5e1b57210b10f8781f103e5c46308544339f (patch) | |
| tree | 9738592f2082de1881a0ea019bf3c99644134aef /src/crepe/api/Texture.cpp | |
| parent | 9b7be419c9dcc6ebd1e504713c7b2676ca3d2fdf (diff) | |
more nitpicking
Diffstat (limited to 'src/crepe/api/Texture.cpp')
| -rw-r--r-- | src/crepe/api/Texture.cpp | 19 | 
1 files changed, 10 insertions, 9 deletions
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp index c755fa9..7791b5b 100644 --- a/src/crepe/api/Texture.cpp +++ b/src/crepe/api/Texture.cpp @@ -1,31 +1,32 @@ +#include <SDL2/SDL_render.h> +#include "util/log.h"  #include "Asset.h"  #include "SdlContext.h" -#include "util/log.h" -  #include "Texture.h" -#include <SDL2/SDL_render.h>  using namespace crepe::api; +using namespace std; -Texture::Texture(std::unique_ptr<Asset> res) { +Texture::Texture(unique_ptr<Asset> res) {  	dbg_trace();  	this->load(std::move(res));  }  Texture::Texture(const char * src) {  	dbg_trace(); -	this->load(std::make_unique<Asset>(src)); +	this->load(make_unique<Asset>(src));  }  Texture::~Texture() {  	dbg_trace(); -	if (this->m_texture != nullptr) { -		SDL_DestroyTexture(m_texture); +	if (this->texture != nullptr) { +		SDL_DestroyTexture(this->texture);  	}  } -void Texture::load(std::unique_ptr<Asset> res) { + +void Texture::load(unique_ptr<Asset> res) {  	SdlContext & ctx = SdlContext::get_instance(); -	m_texture = ctx.texture_from_path(res->canonical()); +	this->texture = ctx.texture_from_path(res->canonical());  }  |