Crimson Engine
1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Toggle main menu visibility
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
6
namespace
Engine
{
7
15
// [ReflectClass]
16
struct
ENGINE_API
TilemapComponent
{
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
40
#include "
meta/ComponentReflection.hpp
"
41
REGISTER_COMPONENT
(
Engine::TilemapComponent
,
"Rendering & Lights/Tilemap"
);
42
ComponentReflection.hpp
REGISTER_COMPONENT
#define REGISTER_COMPONENT(Type, MenuPath)
Definition
ComponentReflection.hpp:156
EngineAPI.hpp
ENGINE_API
#define ENGINE_API
Definition
EngineAPI.hpp:10
Engine
Definition
Application.hpp:16
Engine::TilemapComponent
Represents a 2D tile grid in the scene. References a tileset by its disk path (.tileset file)....
Definition
Tilemap.hpp:16
Engine::TilemapComponent::isDirty
bool isDirty
Flag requesting mesh + collision rebuild next frame.
Definition
Tilemap.hpp:35
Engine::TilemapComponent::tiles
std::vector< int > tiles
1D tile grid of size width*height. Value = index into TilesetAsset::tiles[]. -1 = empty cell.
Definition
Tilemap.hpp:32
Engine::TilemapComponent::width
int width
Definition
Tilemap.hpp:18
Engine::TilemapComponent::height
int height
Definition
Tilemap.hpp:20
Engine::TilemapComponent::tilesetPath
std::string tilesetPath
Definition
Tilemap.hpp:25
Engine::TilemapComponent::tileSize
float tileSize
Definition
Tilemap.hpp:22
engine
include
ecs
components
Tilemap.hpp
Generated by
1.17.0