pasaeta loca de clang-format (despres m'arrepentiré pero bueno)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_FRect, SDL_FPoint
|
||||
#include <memory> // Para shared_ptr
|
||||
#include <SDL3/SDL.h> // Para SDL_FRect, SDL_FPoint
|
||||
|
||||
#include <memory> // Para shared_ptr
|
||||
|
||||
class Texture;
|
||||
|
||||
// Clase Sprite: representa un objeto gráfico básico con posición, tamaño y textura
|
||||
class Sprite
|
||||
{
|
||||
public:
|
||||
class Sprite {
|
||||
public:
|
||||
// --- Constructores y destructor ---
|
||||
Sprite(std::shared_ptr<Texture> texture, float x, float y, float w, float h);
|
||||
Sprite(std::shared_ptr<Texture> texture, SDL_FRect rect);
|
||||
@@ -16,8 +16,8 @@ public:
|
||||
virtual ~Sprite() = default;
|
||||
|
||||
// --- Renderizado y control ---
|
||||
virtual void render(); // Muestra el sprite por pantalla
|
||||
virtual void clear(); // Reinicia las variables a cero
|
||||
virtual void render(); // Muestra el sprite por pantalla
|
||||
virtual void clear(); // Reinicia las variables a cero
|
||||
|
||||
// --- Getters de posición y tamaño ---
|
||||
float getX() const { return pos_.x; }
|
||||
@@ -52,10 +52,10 @@ public:
|
||||
std::shared_ptr<Texture> getTexture() const { return texture_; }
|
||||
void setTexture(std::shared_ptr<Texture> texture) { texture_ = texture; }
|
||||
|
||||
protected:
|
||||
protected:
|
||||
// --- Variables internas ---
|
||||
std::shared_ptr<Texture> texture_; // Textura donde están todos los dibujos del sprite
|
||||
SDL_FRect pos_; // Posición y tamaño donde dibujar el sprite
|
||||
SDL_FRect sprite_clip_; // Rectángulo de origen de la textura que se dibujará en pantalla
|
||||
double zoom_ = 1.0f; // Zoom aplicado a la textura
|
||||
std::shared_ptr<Texture> texture_; // Textura donde están todos los dibujos del sprite
|
||||
SDL_FRect pos_; // Posición y tamaño donde dibujar el sprite
|
||||
SDL_FRect sprite_clip_; // Rectángulo de origen de la textura que se dibujará en pantalla
|
||||
double zoom_ = 1.0f; // Zoom aplicado a la textura
|
||||
};
|
||||
Reference in New Issue
Block a user