migrant a SDL3
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "texture.h" // Para Texture
|
||||
|
||||
// Constructor
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture, int x, int y, int w, int h)
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture, float x, float y, float w, float h)
|
||||
: texture_(texture),
|
||||
pos_((SDL_FRect){x, y, w, h}),
|
||||
sprite_clip_((SDL_FRect){0, 0, pos_.w, pos_.h}) {}
|
||||
@@ -14,7 +14,7 @@ Sprite::Sprite(std::shared_ptr<Texture> texture, SDL_FRect rect)
|
||||
|
||||
Sprite::Sprite(std::shared_ptr<Texture> texture)
|
||||
: texture_(texture),
|
||||
pos_({0, 0, texture_->getWidth(), texture_->getHeight()}),
|
||||
pos_(SDL_FRect{0, 0, static_cast<float>(texture_->getWidth()), static_cast<float>(texture_->getHeight())}),
|
||||
sprite_clip_(pos_) {}
|
||||
|
||||
// Muestra el sprite por pantalla
|
||||
@@ -24,14 +24,14 @@ void Sprite::render()
|
||||
}
|
||||
|
||||
// Establece la posición del objeto
|
||||
void Sprite::setPosition(int x, int y)
|
||||
void Sprite::setPosition(float x, float y)
|
||||
{
|
||||
pos_.x = x;
|
||||
pos_.y = y;
|
||||
}
|
||||
|
||||
// Establece la posición del objeto
|
||||
void Sprite::setPosition(SDL_Point p)
|
||||
void Sprite::setPosition(SDL_FPoint p)
|
||||
{
|
||||
pos_.x = p.x;
|
||||
pos_.y = p.y;
|
||||
|
||||
Reference in New Issue
Block a user