Arreglos varios al codi
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
#include "texture.h" // for Texture
|
||||
|
||||
// Constructor
|
||||
Sprite::Sprite(int x, int y, int w, int h, Texture *texture) : x(x), y(y), w(w), h(h), texture(texture)
|
||||
Sprite::Sprite(int x, int y, int w, int h, Texture *texture)
|
||||
: x(x), y(y), w(w), h(h), texture(texture)
|
||||
{
|
||||
// Establece el rectangulo de donde coger la imagen
|
||||
spriteClip = {0, 0, w, h};
|
||||
@@ -11,7 +12,8 @@ Sprite::Sprite(int x, int y, int w, int h, Texture *texture) : x(x), y(y), w(w),
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
Sprite::Sprite(SDL_Rect rect, Texture *texture): x(rect.x), y(rect.y), w(rect.w), h(rect.h), texture(texture)
|
||||
Sprite::Sprite(SDL_Rect rect, Texture *texture)
|
||||
: x(rect.x), y(rect.y), w(rect.w), h(rect.h), texture(texture)
|
||||
{
|
||||
// Establece el rectangulo de donde coger la imagen
|
||||
spriteClip = {0, 0, w, h};
|
||||
@@ -20,12 +22,6 @@ Sprite::Sprite(SDL_Rect rect, Texture *texture): x(rect.x), y(rect.y), w(rect.w)
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Sprite::~Sprite()
|
||||
{
|
||||
texture = nullptr;
|
||||
}
|
||||
|
||||
// Muestra el sprite por pantalla
|
||||
void Sprite::render()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user