diff --git a/assets/map_tiles.json b/assets/map_tiles.json index 3523cd8..677aecf 100644 --- a/assets/map_tiles.json +++ b/assets/map_tiles.json @@ -8,121 +8,121 @@ { "centered": false, "display": 8284, - "x": 64, + "x": 32, "y": 0 }, { "centered": false, "display": 11590, - "x": 128, + "x": 64, "y": 0 }, { "centered": false, "display": 10899, - "x": 192, + "x": 96, "y": 0 }, { "centered": false, "display": 9256, - "x": 256, + "x": 128, "y": 0 }, { "centered": false, "display": 9608, - "x": 320, + "x": 160, "y": 0 }, { "centered": false, "display": 10747, - "x": 384, + "x": 192, "y": 0 }, { "centered": false, "display": 8285, - "x": 448, + "x": 224, "y": 0 }, { "centered": true, "display": 1003, - "x": 512, + "x": 256, "y": 0 }, { "centered": true, "display": 3848, - "x": 576, + "x": 288, "y": 0 }, { "centered": true, "display": 85, "x": 0, - "y": 64 + "y": 32 }, { "centered": true, "display": 8687, - "x": 64, - "y": 64 + "x": 32, + "y": 32 }, { "centered": true, "display": 10949, - "x": 128, - "y": 64 + "x": 64, + "y": 32 }, { "centered": true, "display": 8793, - "x": 192, - "y": 64 + "x": 96, + "y": 32 }, { "centered": true, "display": 95, - "x": 256, - "y": 64 + "x": 128, + "y": 32 }, { "centered": true, "display": 1898, - "x": 320, - "y": 64 + "x": 160, + "y": 32 }, { "centered": true, "display": 42586, - "x": 384, - "y": 64 + "x": 192, + "y": 32 }, { "centered": true, "display": 2189, - "x": 448, - "y": 64 + "x": 224, + "y": 32 }, { "centered": true, "display": 41981, - "x": 512, - "y": 64 + "x": 256, + "y": 32 }, { "centered": true, "display": 2220, - "x": 576, - "y": 64 + "x": 288, + "y": 32 }, { "centered": true, "display": 1218, "x": 0, - "y": 128 + "y": 64 } ] diff --git a/assets/map_tiles.png b/assets/map_tiles.png index 1c87bb7..f750379 100644 Binary files a/assets/map_tiles.png and b/assets/map_tiles.png differ diff --git a/constants.hpp b/constants.hpp index aff596c..5087749 100644 --- a/constants.hpp +++ b/constants.hpp @@ -15,6 +15,8 @@ constexpr const int RAY_VIEW_Y=0; constexpr const int GLOW_LIMIT=220; constexpr const int LIGHT_MULTIPLIER=2.5; constexpr const float AIMED_AT_BRIGHTNESS=0.2f; +constexpr const int MAP_TILE_DIM=32; +constexpr const int ICONGEN_MAP_TILE_DIM=32; constexpr const int BOSS_VIEW_WIDTH=1080; constexpr const int BOSS_VIEW_HEIGHT=SCREEN_HEIGHT; diff --git a/tests/map.cpp b/tests/map.cpp index 15eb3b7..8a0f0b4 100644 --- a/tests/map.cpp +++ b/tests/map.cpp @@ -96,7 +96,7 @@ TEST_CASE("map image test", "[map-sprite]") { auto &walls = level.map->tiles(); auto &tile_set = textures::get_map_tile_set(); - sf::Vector2i size{64,64}; + sf::Vector2i size{MAP_TILE_DIM,MAP_TILE_DIM}; matrix::dump("TILES?", walls); std::unordered_map sprite_coord; diff --git a/tools/icongen.cpp b/tools/icongen.cpp index 134e839..16ba758 100644 --- a/tools/icongen.cpp +++ b/tools/icongen.cpp @@ -13,7 +13,6 @@ namespace fs = std::filesystem; constexpr const int TILE_COUNT=10; constexpr const sf::Color DEFAULT_COLOR{255, 255, 255, 255}; -constexpr const size_t DEFAULT_DIM=64; using namespace nlohmann; using namespace shiterator; @@ -85,7 +84,6 @@ struct MapTileBuilder { void run_real_textures(MapConfig &config) { sf::Vector2u crop{$size.x * (unsigned int)config.it.width, ($size.y) * ((unsigned int)config.it.y + 1)}; - fmt::println("TEXTURE CROP: {},{}; size: {},{}", $size.x, $size.y, crop.x, crop.y); $render = std::make_shared(crop); $render->clear({0,0,0,0}); @@ -154,9 +152,6 @@ struct MapTileBuilder { dbc::check($size.x - t_size.x >= 0, "font too big on x"); dbc::check($size.y - t_size.y >= 0, "font too big on y"); - fmt::println("display: {}, bg: {},{},{},{}; fg: {},{},{},{}", - (int)display_char, bg.r, bg.g, bg.b, bg.a, fg.r, fg.g, fg.b, fg.a); - // draw the background first background.setFillColor(bg); @@ -223,20 +218,16 @@ void load_config(MapConfig& config, bool is_centered, std::string path, std::fun if(data.contains("foreground")) { auto fg_color = data["foreground"]; sf::Color fg{fg_color[0], fg_color[1], fg_color[2]}; - fmt::println("TILE {}, display: {} has foreground: {},{},{}", key, (int)display, fg.r, fg.g, fg.b); config.colors.insert_or_assign(display, fg); } else { - fmt::println("TILE {}, {} has DEFAULT COLOR", key, (int)display); config.colors.insert_or_assign(display, DEFAULT_COLOR); } if(data.contains("background")) { auto bg_color = data["background"]; sf::Color bg{bg_color[0], bg_color[1], bg_color[2]}; - fmt::println("TILE {} display: {} has background: {},{},{}", key, (int)display, bg.r, bg.g, bg.b); config.backgrounds.insert_or_assign(display, bg); } else { - fmt::println("TILE {} display: {} has transparent background", key, (int)display); sf::Color bg{0, 0, 0, 0}; config.backgrounds.insert_or_assign(display, bg); } @@ -269,7 +260,7 @@ int main() { load_config(config, true, "./assets/enemies.json", component_display); fmt::println("-----------------------------------------"); - MapTileBuilder builder(DEFAULT_DIM, DEFAULT_DIM); + MapTileBuilder builder(ICONGEN_MAP_TILE_DIM, ICONGEN_MAP_TILE_DIM); builder.run(config); builder.save_image("./assets/map_tiles.png");