cmasmasizat el codi

This commit is contained in:
2025-03-24 13:28:54 +01:00
parent 4a2e5c27e2
commit e2e3b7c779
6 changed files with 75 additions and 111 deletions
+5 -5
View File
@@ -1,13 +1,13 @@
#include "sprite.h"
// Constructor
Sprite::Sprite(Texture *texture)
Sprite::Sprite(std::shared_ptr<Texture> texture)
: texture_(texture),
pos_{0, 0, 0, 0},
clip_{0, 0, 0, 0} {}
pos_{0.0f, 0.0f, 0.0f, 0.0f},
clip_{0.0f, 0.0f, 0.0f, 0.0f} {}
// Establece la posición del sprite
void Sprite::setPos(SDL_Point pos)
void Sprite::setPos(SDL_FPoint pos)
{
pos_.x = pos.x;
pos_.y = pos.y;
@@ -26,7 +26,7 @@ void Sprite::setClip(SDL_FRect clip)
}
// Establece el tamaño del sprite
void Sprite::setSize(int w, int h)
void Sprite::setSize(float w, float h)
{
pos_.w = w;
pos_.h = h;