Commit de vesprà tirada a la brossa

This commit is contained in:
2024-10-16 22:35:19 +02:00
parent 5585f996cb
commit db884cb422
32 changed files with 450 additions and 463 deletions

View File

@@ -1,12 +1,12 @@
#include "sprite.h"
// Constructor
Sprite::Sprite(int x, int y, int w, int h, std::shared_ptr<Texture> texture)
Sprite::Sprite(std::shared_ptr<Texture> texture, int x, int y, int w, int h)
: texture_(texture),
pos_((SDL_Rect){x, y, w, h}),
sprite_clip_((SDL_Rect){0, 0, pos_.w, pos_.h}) {}
Sprite::Sprite(SDL_Rect rect, std::shared_ptr<Texture> texture)
Sprite::Sprite(std::shared_ptr<Texture> texture, SDL_Rect rect)
: texture_(texture),
pos_(rect),
sprite_clip_((SDL_Rect){0, 0, pos_.w, pos_.h}) {}
@@ -23,13 +23,13 @@ void Sprite::render()
}
// Obten el valor de la variable
int Sprite::getIntPosX() const
int Sprite::getPosX() const
{
return pos_.x;
}
// Obten el valor de la variable
int Sprite::getIntPosY() const
int Sprite::getPosY() const
{
return pos_.y;
}