This commit is contained in:
2025-10-27 18:35:53 +01:00
parent b1dca32a5b
commit 3179a08dac
63 changed files with 686 additions and 693 deletions
+7 -5
View File
@@ -1,20 +1,22 @@
#include "core/rendering/surface_sprite.hpp"
#include <utility>
#include "core/rendering/surface.hpp" // Para Surface
// Constructor
SurfaceSprite::SurfaceSprite(std::shared_ptr<Surface> surface, float x, float y, float w, float h)
: surface_(surface),
: surface_(std::move(std::move(surface))),
pos_((SDL_FRect){x, y, w, h}),
clip_((SDL_FRect){0.0F, 0.0F, pos_.w, pos_.h}) {}
SurfaceSprite::SurfaceSprite(std::shared_ptr<Surface> surface, SDL_FRect rect)
: surface_(surface),
: surface_(std::move(std::move(surface))),
pos_(rect),
clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
SurfaceSprite::SurfaceSprite(std::shared_ptr<Surface> surface)
: surface_(surface),
: surface_(std::move(std::move(surface))),
pos_((SDL_FRect){0.0F, 0.0F, surface_->getWidth(), surface_->getHeight()}),
clip_(pos_) {}
@@ -41,6 +43,6 @@ void SurfaceSprite::setPosition(SDL_FPoint p) {
// Reinicia las variables a cero
void SurfaceSprite::clear() {
pos_ = {0, 0, 0, 0};
clip_ = {0, 0, 0, 0};
pos_ = {.x = 0, .y = 0, .w = 0, .h = 0};
clip_ = {.x = 0, .y = 0, .w = 0, .h = 0};
}