Commit de vesprà tirada a la brossa
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user