7 #ifndef NAZARA_TILEMAP_HPP 8 #define NAZARA_TILEMAP_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Graphics/InstancedRenderable.hpp> 12 #include <Nazara/Graphics/Material.hpp> 19 using TileMapConstRef = ObjectRef<const TileMap>;
20 using TileMapLibrary = ObjectLibrary<TileMap>;
21 using TileMapRef = ObjectRef<TileMap>;
25 friend TileMapLibrary;
33 TileMap(TileMap&&) =
delete;
36 void AddToRenderQueue(
AbstractRenderQueue* renderQueue,
const InstanceData& instanceData)
const override;
38 inline void DisableTile(
const Vector2ui& tilePos);
39 inline void DisableTiles();
40 inline void DisableTiles(
const Vector2ui* tilesPos, std::size_t tileCount);
42 inline void EnableIsometricMode(
bool isometric);
44 inline void EnableTile(
const Vector2ui& tilePos,
const Rectf& coords,
const Color& color = Color::White, std::size_t materialIndex = 0U);
45 inline void EnableTile(
const Vector2ui& tilePos,
const Rectui& rect,
const Color& color = Color::White, std::size_t materialIndex = 0U);
46 inline void EnableTiles(
const Rectf& coords,
const Color& color = Color::White, std::size_t materialIndex = 0U);
47 inline void EnableTiles(
const Rectui& rect,
const Color& color = Color::White, std::size_t materialIndex = 0U);
48 inline void EnableTiles(
const Vector2ui* tilesPos, std::size_t tileCount,
const Rectf& coords,
const Color& color = Color::White, std::size_t materialIndex = 0U);
49 inline void EnableTiles(
const Vector2ui* tilesPos, std::size_t tileCount,
const Rectui& rect,
const Color& color = Color::White, std::size_t materialIndex = 0U);
51 inline const Vector2ui& GetMapSize()
const;
53 inline const Tile& GetTile(
const Vector2ui& tilePos)
const;
54 inline const Vector2f& GetTileSize()
const;
56 inline bool IsIsometricModeEnabled()
const;
60 inline TileMap& operator=(
const TileMap& TileMap);
61 TileMap& operator=(TileMap&& TileMap) =
delete;
63 template<
typename... Args>
static TileMapRef New(Args&&... args);
67 std::size_t layerIndex = 0U;
68 Color color = Color::White;
74 void MakeBoundingVolume()
const override;
75 void UpdateData(InstanceData* instanceData)
const override;
77 static bool Initialize();
78 static void Uninitialize();
82 std::set<std::size_t> tiles;
85 std::vector<Tile> m_tiles;
86 std::vector<Layer> m_layers;
89 bool m_isometricModeEnabled;
91 static TileMapLibrary::LibraryMap s_library;
95 #include <Nazara/Graphics/TileMap.inl> 97 #endif // NAZARA_TILEMAP_HPP Core class that represents a color.
Definition: Color.hpp:18
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the module initializer of Graphics.
Definition: Graphics.hpp:15
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
void SetMaterial(std::size_t matIndex, MaterialRef material)
Changes the material used at the specified index by another one.
Definition: InstancedRenderable.inl:216
Graphics class that represents an instancer renderable.
Definition: InstancedRenderable.hpp:30
Core class that represents a reference to an object.
Definition: ObjectRef.hpp:18
static Rect Zero()
Shorthand for the rectangle (0, 0, 0, 0)
Definition: Rect.inl:795
Graphics class that represent several tiles of the same size assembled into a grid This class is far ...
Definition: TileMap.hpp:23