Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
Tilemap.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4#include "core/EngineAPI.hpp"
5
6namespace Engine {
7
15 // [ReflectClass]
17 // [ReflectField]
18 int width = 0;
19 // [ReflectField]
20 int height = 0;
21 // [ReflectField]
22 float tileSize = 1.0f;
23
24 // [ReflectField]
25 std::string tilesetPath;
26
27
32 std::vector<int> tiles;
33
35 bool isDirty = true;
36 };
37
38} // namespace Engine
39
41REGISTER_COMPONENT(Engine::TilemapComponent, "Rendering & Lights/Tilemap");
42
#define REGISTER_COMPONENT(Type, MenuPath)
Definition ComponentReflection.hpp:156
#define ENGINE_API
Definition EngineAPI.hpp:10
Definition Application.hpp:16
Represents a 2D tile grid in the scene. References a tileset by its disk path (.tileset file)....
Definition Tilemap.hpp:16
bool isDirty
Flag requesting mesh + collision rebuild next frame.
Definition Tilemap.hpp:35
std::vector< int > tiles
1D tile grid of size width*height. Value = index into TilesetAsset::tiles[]. -1 = empty cell.
Definition Tilemap.hpp:32
int width
Definition Tilemap.hpp:18
int height
Definition Tilemap.hpp:20
std::string tilesetPath
Definition Tilemap.hpp:25
float tileSize
Definition Tilemap.hpp:22