4#include <unordered_map>
7#include <vulkan/vulkan.h>
#define ENGINE_API
Definition EngineAPI.hpp:10
Manages loading, caching, and GPU memory uploads for textures and glTF model meshes.
Definition ResourceManager.hpp:46
Manages core Vulkan pipeline states, device interaction, frames, buffers, and command submissions.
Definition VulkanRenderer.hpp:127
Definition Application.hpp:16
ENGINE_API TilesetAsset * loadOrGetTileset(const std::string &path, VulkanRenderer &renderer)
Loads a TilesetAsset from disk (or returns a cached copy). If the tileset file changes on disk,...
Definition TilesetAsset.cpp:34
ENGINE_API std::unordered_map< std::string, TilesetAsset > & getTilesetCache()
Returns a reference to the process-wide TilesetAsset cache. The TilemapSystem uses this to avoid relo...
Definition TilesetAsset.cpp:20
ENGINE_API void invalidateTilesetCache(const std::string &path="")
Evicts the specified entry (or all entries if path is empty) from the cache.
Definition TilesetAsset.cpp:25
Represents one tile slot in a tileset. Saved to disk as a small <name>.tile JSON file.
Definition TilesetAsset.hpp:19
int gridY
Row on the infinite palette grid (can be negative).
Definition TilesetAsset.hpp:33
bool isSolid
True = solid collider spawned for cells containing this tile.
Definition TilesetAsset.hpp:27
glm::vec4 atlasUV
Normalised UV rect in the runtime atlas: (u0, v0, u1, v1).
Definition TilesetAsset.hpp:37
int gridX
Column on the infinite palette grid (can be negative).
Definition TilesetAsset.hpp:31
std::string texturePath
Project-relative path to the tile's texture image.
Definition TilesetAsset.hpp:25
std::string name
Display name shown in the palette.
Definition TilesetAsset.hpp:23
Definition TilesetAsset.hpp:64
std::vector< uint8_t > pixels
Packed atlas pixel data (RGBA8, CPU side).
Definition TilesetAsset.hpp:66
int atlasWidth
Definition TilesetAsset.hpp:67
VkDescriptorSet descriptorSet
Vulkan descriptor set for the atlas texture (owned by ResourceManager).
Definition TilesetAsset.hpp:70
int atlasHeight
Definition TilesetAsset.hpp:68
bool valid
Definition TilesetAsset.hpp:71
A disk asset (.tileset JSON) that owns an ordered list of TileAssets. At runtime, a CPU-side atlas is...
Definition TilesetAsset.hpp:47
void destroyAtlas(VulkanRenderer &renderer)
Frees the GPU-side atlas resources if they exist.
Definition TilesetAsset.cpp:297
void buildAtlas(VulkanRenderer &renderer)
Rebuilds the CPU-side atlas from tiles[].texturePath entries, uploads it as a Vulkan texture,...
Definition TilesetAsset.cpp:205
std::string filePath
Absolute (or project-relative) path to the .tileset file.
Definition TilesetAsset.hpp:51
std::string name
Display name of the tileset.
Definition TilesetAsset.hpp:49
std::vector< TileAsset > tiles
Ordered list of tile slots. tiles[i].id == i. Index is the value stored in TilemapComponent::tiles[].
Definition TilesetAsset.hpp:61
static void saveTileFile(const TileAsset &tile, const std::string &path)
Saves a single TileAsset to a .tile JSON file.
Definition TilesetAsset.cpp:93
static TilesetAsset loadFromFile(const std::string &path)
Loads a TilesetAsset from a .tileset JSON file. Individual tile paths listed in the file are loaded a...
Definition TilesetAsset.cpp:114
AtlasCache atlas
Definition TilesetAsset.hpp:73
static TileAsset loadTileFile(const std::string &path)
Loads a single TileAsset from a .tile JSON file.
Definition TilesetAsset.cpp:63
static void saveToFile(const TilesetAsset &ts)
Saves the TilesetAsset to its filePath on disk (.tileset JSON). Does NOT write individual ....
Definition TilesetAsset.cpp:168
int tileWidth
Width of each tile cell in the packed atlas (pixels).
Definition TilesetAsset.hpp:53
int tileHeight
Height of each tile cell in the packed atlas (pixels).
Definition TilesetAsset.hpp:55