Quick refactor of the config system to make it easier to refactor config.cpp/hpp later.

This commit is contained in:
Zed A. Shaw 2025-09-16 11:59:30 -04:00
parent 47f659ae8e
commit e523aa8b02
29 changed files with 138 additions and 140 deletions

View file

@ -39,12 +39,12 @@ namespace textures {
}
void load_sprites() {
Config sprites("assets/config.json");
auto sprites = settings::get("config");
bool smooth = sprites["graphics"]["smooth_textures"];
load_sprite_textures(TMGR.sprite_textures, sprites["sprites"], smooth);
Config icons("assets/icons.json");
auto icons = settings::get("assets/icons.json");
load_sprite_textures(TMGR.icon_textures, icons.json(), smooth);
}
@ -56,7 +56,7 @@ namespace textures {
}
void load_tiles() {
Config assets("assets/tiles.json");
auto assets = settings::get("tiles");
auto &tiles = assets.json();
resize_shit(tiles.size());
@ -93,7 +93,7 @@ namespace textures {
}
void load_map_tiles() {
Config config("./assets/map_tiles.json");
auto config = settings::get("map_tiles");
json& tiles = config.json();
for(auto tile : tiles) {