- Nuevo sistema AppLogo que muestra el logo cada 20 segundos por 5 segundos - Fade in/out suave de 0.5 segundos con alpha blending - Máquina de estados: HIDDEN → FADE_IN → VISIBLE → FADE_OUT - Logo posicionado en cuadrante inferior derecho (1/4 de pantalla) - Añadido método setAlpha() a Texture para control de transparencia - Habilitado SDL_BLENDMODE_BLEND en todas las texturas - Filtrado LINEAR para suavizado del logo escalado - Desactivado automáticamente en modo SANDBOX 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
56 lines
1.6 KiB
C++
56 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <SDL3/SDL_rect.h> // Para SDL_FRect
|
|
#include <SDL3/SDL_render.h> // Para SDL_Renderer, SDL_Texture
|
|
|
|
#include <string> // Para std::string
|
|
#include <vector> // Para std::vector
|
|
|
|
class Texture {
|
|
private:
|
|
SDL_Renderer *renderer_;
|
|
SDL_Texture *texture_;
|
|
|
|
// Dimensiones de la imagen
|
|
int width_;
|
|
int height_;
|
|
|
|
public:
|
|
// Sistema de recursos empaquetados (inicializar desde main)
|
|
static void initResourceSystem(const std::string& packFilePath);
|
|
static std::vector<std::string> getPackResourceList();
|
|
static bool isPackLoaded();
|
|
|
|
// Inicializa las variables
|
|
explicit Texture(SDL_Renderer *renderer);
|
|
Texture(SDL_Renderer *renderer, const std::string &file_path);
|
|
|
|
// Libera la memoria
|
|
~Texture();
|
|
|
|
// Carga una imagen desde la ruta especificada
|
|
bool loadFromFile(const std::string &path);
|
|
|
|
// Libera la textura
|
|
void free();
|
|
|
|
// Renderiza la textura en el punto especificado
|
|
void render(SDL_FRect *src = nullptr, SDL_FRect *dst = nullptr);
|
|
|
|
// Obtiene las dimensiones de la imagen
|
|
int getWidth();
|
|
int getHeight();
|
|
|
|
// Modula el color de la textura
|
|
void setColor(int r, int g, int b);
|
|
|
|
// Modula el alpha (transparencia) de la textura
|
|
void setAlpha(int alpha);
|
|
|
|
// Configurar modo de escalado (NEAREST para pixel art, LINEAR para suavizado)
|
|
void setScaleMode(SDL_ScaleMode mode);
|
|
|
|
// Getter para batch rendering
|
|
SDL_Texture *getSDLTexture() const { return texture_; }
|
|
};
|