Quick refactor of the config system to make it easier to refactor config.cpp/hpp later.
This commit is contained in:
parent
47f659ae8e
commit
e523aa8b02
29 changed files with 138 additions and 140 deletions
|
|
@ -203,7 +203,7 @@ struct MapTileBuilder {
|
|||
|
||||
void load_config(MapConfig& config, bool is_centered, std::string path, std::function<json&(json&)> finder)
|
||||
{
|
||||
Config tiles(path);
|
||||
auto tiles = settings::get(path);
|
||||
|
||||
for(auto [key, val] : tiles.json().items()) {
|
||||
config.it.next();
|
||||
|
|
@ -248,13 +248,13 @@ int main() {
|
|||
palette::init();
|
||||
MapConfig config;
|
||||
|
||||
load_config(config, false, "./assets/tiles.json", [](json& val) -> json& {
|
||||
load_config(config, false, "tiles", [](json& val) -> json& {
|
||||
return val;
|
||||
});
|
||||
|
||||
load_config(config, true, "./assets/items.json", component_display);
|
||||
load_config(config, true, "./assets/devices.json", component_display);
|
||||
load_config(config, true, "./assets/enemies.json", component_display);
|
||||
load_config(config, true, "items", component_display);
|
||||
load_config(config, true, "devices", component_display);
|
||||
load_config(config, true, "enemies", component_display);
|
||||
|
||||
fmt::println("-----------------------------------------");
|
||||
MapTileBuilder builder(ICONGEN_MAP_TILE_DIM, ICONGEN_MAP_TILE_DIM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue