You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
/******************************************************************************
|
|
* File - tile_map.h
|
|
* Author - Joey Pollack
|
|
* Date - 2022/02/15 (y/m/d)
|
|
* Mod Date - 2022/02/15 (y/m/d)
|
|
* Description - Contains a single tile map
|
|
******************************************************************************/
|
|
|
|
#ifndef TILE_MAP_H_
|
|
#define TILE_MAP_H_
|
|
|
|
#include "definitions.h"
|
|
#include <core/types.h>
|
|
#include <utils/op_res.h>
|
|
#include <map>
|
|
|
|
namespace lunarium { class IGraphics; }
|
|
|
|
namespace lunarium { namespace editor
|
|
{
|
|
class TileSet;
|
|
|
|
class TileMap
|
|
{
|
|
public:
|
|
TileMap(Sizei tile_size);
|
|
[[NoDiscard]] OpRes AddTileSet(int id, TileSet*);
|
|
|
|
void MarkClean();
|
|
bool IsDirty() const;
|
|
|
|
void SetTile(TileRef, Vec2i location);
|
|
TileRef GetTile(Vec2i location);
|
|
|
|
void ClearMap();
|
|
void ResizeMap(Sizei size);
|
|
|
|
Sizei GetSizeInTiles();
|
|
Sizei GetSizeInPixels();
|
|
Sizei GetTileSize();
|
|
|
|
// Call during render to texture phase
|
|
void Render(lunarium::IGraphics* g);
|
|
|
|
private:
|
|
TileRef** mpMap;
|
|
Sizei mSizeInTiles;
|
|
Sizei mTileSize;
|
|
std::map<int, TileSet*> mTileSets;
|
|
bool mIsDirty;
|
|
|
|
};
|
|
}}
|
|
|
|
#endif // TILE_MAP_H_
|