Segmentation fault

This commit is contained in:
2023-05-07 18:08:36 +02:00
parent 90ebea4807
commit c1f8e16963
17 changed files with 163 additions and 73 deletions

View File

@@ -1,8 +1,10 @@
#include "sprite.h"
#include <iostream>
// Constructor
Sprite::Sprite(int x, int y, int w, int h, Texture *texture, SDL_Renderer *renderer)
{
//std::cout << "Construido Sprite" << std::endl;
// Establece la posición X,Y del sprite
this->x = x;
this->y = y;
@@ -28,6 +30,7 @@ Sprite::Sprite(int x, int y, int w, int h, Texture *texture, SDL_Renderer *rende
Sprite::Sprite(SDL_Rect rect, Texture *texture, SDL_Renderer *renderer)
{
//std::cout << "Construido Sprite" << std::endl;
// Establece la posición X,Y del sprite
this->x = rect.x;
this->y = rect.y;
@@ -51,6 +54,12 @@ Sprite::Sprite(SDL_Rect rect, Texture *texture, SDL_Renderer *renderer)
zoomH = 1.0f;
}
// Destructor
Sprite::~Sprite()
{
//std::cout << "Destruido Sprite" << std::endl;
}
// Muestra el sprite por pantalla
void Sprite::render()
{