48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
#pragma once
|
|
#include "animatedsprite.h"
|
|
#include "asset.h"
|
|
#include "jail_audio.h"
|
|
#include "utils.h"
|
|
|
|
#ifndef MAP_H
|
|
#define MAP_H
|
|
|
|
// The player
|
|
class Map
|
|
{
|
|
private:
|
|
LTexture *texture_tile; // Textura con los gráficos de los tiles
|
|
LTexture *texture_actor; // Textura con los gráficos de los actores
|
|
LTexture *texture_bg; // Textura con los gráficos de fondo
|
|
Asset *asset; // Objeto con los ficheros de recursos
|
|
AnimatedSprite *sprite_tile; // Sprite de los tiles del mapa
|
|
AnimatedSprite *sprite_actor; // Sprite de los actores
|
|
Sprite *background; // Fondo de la pantalla
|
|
SDL_Rect src_rect; // Ni puta idea
|
|
SDL_Rect dst_rect; // Ni puta idea
|
|
Uint8 *tile; // Vector con los tiles
|
|
Uint8 *actor; // Vector con los acores
|
|
Uint8 w; // Anchura en habitaciones del mapa
|
|
Uint8 h; // Altura en habitaciones del mapa
|
|
Uint8 room; // Habitación actual del mapa
|
|
std::string mapfile; // Ruta con el fichero del mapa
|
|
|
|
public:
|
|
// Constructor
|
|
Map(SDL_Renderer *renderer, std::string file, Asset *asset);
|
|
|
|
// Destructor
|
|
~Map();
|
|
|
|
// Carga el mapa a partir de un fichero
|
|
void loadFromFile(std::string file);
|
|
|
|
// Actualiza todas las variables
|
|
void update();
|
|
|
|
// Dibuja el objeto
|
|
void render();
|
|
};
|
|
|
|
#endif
|