Map is back.

This commit is contained in:
Zed A. Shaw 2025-05-25 22:39:42 -04:00
parent af2947c50a
commit 8453e7c3b9
4 changed files with 17 additions and 16 deletions

View file

@ -36,6 +36,7 @@ namespace textures {
Config assets("assets/tiles.json");
auto &tiles = assets.json();
TMGR.surfaces.resize(tiles.size());
TMGR.tile_set.resize(tiles.size());
for(auto &el : tiles.items()) {
auto &config = el.value();
@ -44,8 +45,10 @@ namespace textures {
if(surface_i >= tiles.size()) {
TMGR.surfaces.resize(surface_i + 1);
TMGR.tile_set.resize(surface_i + 1);
}
TMGR.tile_set[surface_i] = config["display"];
TMGR.surfaces[surface_i] = load_image(texture_fname);
}
}
@ -80,6 +83,10 @@ namespace textures {
return texture;
}
std::vector<wchar_t>& get_tile_set() {
return TMGR.tile_set;
}
const uint32_t* get_surface(size_t num) {
return (const uint32_t *)TMGR.surfaces[num].getPixelsPtr();
}