37 lines
No EOL
892 B
C++
37 lines
No EOL
892 B
C++
#ifndef _H_TILE_H
|
|
#define _H_TILE_H
|
|
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include <memory>
|
|
#include <glad/glad.h>
|
|
|
|
enum class TileType;
|
|
class Texture;
|
|
|
|
// TODO: Decide how this struct will be used.
|
|
// This holds only the texture data of the tile, this texture data will be held in
|
|
// a further struct called Tile
|
|
struct TileTexture {
|
|
Texture* texture = nullptr;
|
|
unsigned VAO, VBO, EBO;
|
|
};
|
|
|
|
// TODO: Finished replacing the Sprite version of tile set with this one
|
|
// This class is NOT for game logic, only for the storage of the tile pointers that point to the TileTexture
|
|
class TileSet
|
|
{
|
|
public:
|
|
TileSet(const char* tileSetImage, float frameSize);
|
|
void setupTiles(float frameSize);
|
|
~TileSet();
|
|
|
|
const std::shared_ptr<TileTexture>& getTileTexture(TileType tileType) const;
|
|
|
|
private:
|
|
Texture* texture;
|
|
|
|
std::unordered_map<TileType, std::shared_ptr<TileTexture>> tiles;
|
|
};
|
|
|
|
#endif |