diff --git a/assets/map_tiles.png b/assets/map_tiles.png index 33cd57b..5cb4c96 100644 Binary files a/assets/map_tiles.png and b/assets/map_tiles.png differ diff --git a/assets/palette.json b/assets/palette.json index 1f132f6..b61f138 100644 --- a/assets/palette.json +++ b/assets/palette.json @@ -1,6 +1,7 @@ { "color": { - "transparent": [255, 255, 255, 255] + "transparent": [255, 255, 255, 255], + "BAD": [255, 0, 0] }, "gui/theme": { "black": [0, 0, 0, 255], @@ -18,34 +19,46 @@ "border_color": "gui/theme:dark_dark", "bg_color_dark": "gui/theme:black" }, + "map/theme": { + "black": [0, 0, 0, 255], + "dark_dark": [10, 10, 10, 255], + "dark_mid": [30, 30, 30, 255], + "dark_light": [60, 60, 60, 255], + "mid": [100, 100, 100, 255], + "light_dark": [150, 150, 150, 255], + "light_mid": [200, 200, 200, 255], + "light_light": [230, 230, 230, 255], + "white": [255, 255, 255, 255] + }, "items/fg": { - "flame": [24, 120, 189], - "potion": [255, 205, 189] + "flame": "map/theme:white", + "potion": "map/theme:white" }, "enemies/fg": { - "player": [255, 200, 125], - "gold_savior": [131, 213, 238], - "knight": [131, 213, 238], - "axe_ranger": [156, 172, 197], - "rat_giant": [205, 164, 246], - "spider_giant": [205, 164, 246] + "player": "map/theme:white", + "gold_savior": "map/theme:white", + "knight": "map/theme:white", + "axe_ranger": "map/theme:white", + "rat_giant": "map/theme:white", + "spider_giant": "map/theme:white" }, "tiles/fg": { - "floor_tile": [40, 40, 40], - "wall_plain": [100, 100, 100], - "wall_moss": [100, 150, 100], - "ceiling_black": [100, 100, 100], + "floor_tile": "map/theme:mid", + "wall_plain": "map/theme:dark_mid", + "wall_moss": "map/theme:dark_light", + "ceiling_black": "color:transparent", "lava_floor": [200, 100, 100], "gray_stone_floor_light": [40, 60, 180], - "wood_wall": [70, 70, 70], - "BAD": [255, 0, 0] + "wood_wall": "map/theme:dark_mid" }, "tiles/bg": { - "wall_plain": [10, 10, 10], - "wall_moss": [100, 100, 180], - "lava_floor": [100, 100, 50], - "gray_stone_floor_light": [80, 80, 80], - "wood_wall": [100, 100, 100] + "floor_tile": "map/theme:dark_dark", + "wall_plain": "map/theme:dark_dark", + "wall_moss": "map/theme:light_dark", + "ceiling_black": "color:transparent", + "lava_floor": "map/theme:dark_dark", + "gray_stone_floor_light": "map/theme:dark_mid", + "wood_wall": "map/theme:dark_dark" }, "devices/fg": { "stairs_down": [24, 205, 189], diff --git a/assets/tiles.json b/assets/tiles.json index b3908e9..49fbee7 100644 --- a/assets/tiles.json +++ b/assets/tiles.json @@ -6,6 +6,7 @@ "ceiling": "ceiling_black", "light": 0, "foreground": "tiles/fg:floor_tile", + "background": "tiles/bg:floor_tile", "id": 0 }, "wall_plain": { @@ -22,8 +23,8 @@ "collision": true, "display": 9256, "light": 20, - "background": "tiles/bg:wall_moss", "foreground": "tiles/fg:wall_moss", + "background": "tiles/bg:wall_moss", "id": 2 }, "ceiling_black": { @@ -32,6 +33,7 @@ "display": 35, "light": 0, "foreground": "tiles/fg:ceiling_black", + "background": "tiles/bg:ceiling_black", "id": 4 }, "lava_floor": { @@ -68,7 +70,8 @@ "collision": false, "display": 8285, "light": 0, - "foreground": "tiles/fg:BAD", + "foreground": "color:BAD", + "background": "color:BAD", "id": 7 } } diff --git a/tools/icongen.cpp b/tools/icongen.cpp index 63d2759..8fa53cb 100644 --- a/tools/icongen.cpp +++ b/tools/icongen.cpp @@ -217,20 +217,17 @@ void load_config(MapConfig& config, bool is_centered, std::string path, std::fun fmt::format("duplicate color for display={} key={}", (int)display, (std::string)key)); - if(data.contains("foreground")) { - auto fg = palette::get(data["foreground"]); - config.colors.insert_or_assign(display, fg); - } else { - config.colors.insert_or_assign(display, DEFAULT_COLOR); - } + dbc::check(data.contains("foreground"), + fmt::format("{} has no foreground", std::string(key))); - if(data.contains("background")) { - auto bg = palette::get(data["background"]); - config.backgrounds.insert_or_assign(display, bg); - } else { - sf::Color bg{0, 0, 0, 0}; - config.backgrounds.insert_or_assign(display, bg); - } + auto fg = palette::get(data["foreground"]); + config.colors.insert_or_assign(display, fg); + + dbc::check(data.contains("background"), + fmt::format("{} has no background", std::string(key))); + + auto bg = palette::get(data["background"]); + config.backgrounds.insert_or_assign(display, bg); } }