From 7b8de90699aea153e73b5f2cee05c69b966b81be Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Tue, 10 Dec 2024 16:21:05 +0100 Subject: implemented feedback wouter, improved animator. however if spritesheet aspect_ratio is not the same as the single frame then the scaling is wrong --- src/crepe/api/Texture.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/crepe/api/Texture.cpp (limited to 'src/crepe/api/Texture.cpp') diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp deleted file mode 100644 index b0863cb..0000000 --- a/src/crepe/api/Texture.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "../util/Log.h" -#include "manager/Mediator.h" -#include "facade/SDLContext.h" - -#include "Asset.h" -#include "Resource.h" -#include "Texture.h" -#include "types.h" - -using namespace crepe; -using namespace std; - -Texture::Texture(const Asset & src, Mediator & mediator) : Resource(src, mediator){ - dbg_trace(); - SDLContext & ctx = mediator.sdl_context; - this->texture = ctx.texture_from_path(src.get_path()); - this->size = ctx.get_size(*this); - this->aspect_ratio = static_cast(this->size.x) / this->size.y; -} - -Texture::~Texture() { - dbg_trace(); - this->texture.reset(); -} - -const ivec2 & Texture::get_size() const noexcept{ - return this->size; -} -const float & Texture::get_ratio() const noexcept{ - return this->aspect_ratio; -} - -SDL_Texture * Texture::get_img() const noexcept{ - return this->texture.get(); -} -- cgit v1.2.3