Classe Screen melitonada

This commit is contained in:
2024-09-28 11:11:11 +02:00
parent f2cc0dc352
commit 92f7f540c0
19 changed files with 90 additions and 54 deletions

View File

@@ -1,9 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include "asset.h"
#include "screen.h"
#include "sprite.h"
// Modos de funcionamiento para el tileado de fondo
#define TILED_MODE_CIRCLE 0
@@ -23,17 +20,17 @@ class Tiledbg
private:
// Objetos y punteros
SDL_Renderer *renderer; // El renderizador de la ventana
Asset *asset; // Objeto que gestiona todos los ficheros de recursos
SDL_Rect window; // Ventana visible para la textura de fondo del titulo
SDL_Texture *canvas; // Textura donde dibujar el fondo formado por tiles
// Variables
SDL_Rect pos; // Posición y tamaña del mosaico
int counter; // Contador
int mode; // Tipo de movimiento del mosaico
float sin[360]; // Vector con los valores del seno precalculados
int tileWidth; // Ancho del tile
int tileHeight; // Alto del tile
std::string texturePath; // Fichero para usar en la textura
SDL_Rect pos; // Posición y tamaña del mosaico
int counter; // Contador
int mode; // Tipo de movimiento del mosaico
float sin[360]; // Vector con los valores del seno precalculados
int tileWidth; // Ancho del tile
int tileHeight; // Alto del tile
// Inicializa las variables
void init();
@@ -43,7 +40,7 @@ private:
public:
// Constructor
Tiledbg(SDL_Renderer *renderer, Asset *asset, SDL_Rect pos, int mode);
Tiledbg(std::string texturePath, SDL_Rect pos, int mode);
// Destructor
~Tiledbg();