@@ -24,7 +24,7 @@ Game_Map load_tiled_map(const std::filesystem::path &map_json, const std::vector
2424 for (const auto &search_path : search_paths) {
2525 spdlog::debug (" Trying search path '{}'" , search_path.string ());
2626 const auto path = search_path / map_json;
27- if (std::error_code ec ; std::filesystem::is_regular_file (path, ec )) { return load_tiled_map (path); }
27+ if (std::error_code error ; std::filesystem::is_regular_file (path, error )) { return load_tiled_map (path); }
2828 }
2929
3030 throw std::runtime_error (fmt::format (" Unable to find map in any search path: {}" , map_json.string ()));
@@ -62,7 +62,7 @@ Game_Map load_tiled_map(const std::filesystem::path &map_json)// NOLINT cognitiv
6262 result.emplace_back (parent_path / tsj_image_path, tile_size, start_gid);
6363
6464 for (const auto &tile : tsj[" tiles" ]) {
65- std::size_t id = tile[" id" ];
65+ std::size_t tile_id = tile[" id" ];
6666
6767 bool passable = true ;
6868
@@ -73,7 +73,7 @@ Game_Map load_tiled_map(const std::filesystem::path &map_json)// NOLINT cognitiv
7373 }
7474 }
7575
76- result.back ().properties [start_gid + id ] = Tile_Set::Tile_Properties{ .passable = passable };
76+ result.back ().properties [start_gid + tile_id ] = Tile_Set::Tile_Properties{ .passable = passable };
7777 }
7878 }
7979 return result;
@@ -111,19 +111,19 @@ Game_Map load_tiled_map(const std::filesystem::path &map_json)// NOLINT cognitiv
111111 }
112112 }
113113
114- std::size_t x = 0 ;
115- std::size_t y = 0 ;
114+ std::size_t cur_x = 0 ;
115+ std::size_t cur_y = 0 ;
116116 for (const auto &tile : layer[" data" ]) {
117117
118118 std::size_t tileid = tile;
119119
120- points[Point{ x, y }].push_back (
120+ points[Point{ cur_x, cur_y }].push_back (
121121 Layer_Info{ .tileid = tileid, .background = background, .foreground = foreground });
122122
123- ++x ;
124- if (x == width) {
125- x = 0 ;
126- ++y ;
123+ ++cur_x ;
124+ if (cur_x == width) {
125+ cur_x = 0 ;
126+ ++cur_y ;
127127 }
128128 }
129129 }
@@ -140,9 +140,9 @@ Game_Map load_tiled_map(const std::filesystem::path &map_json)// NOLINT cognitiv
140140
141141 if ((layer == Layer::Background && !tile.foreground ) || (layer == Layer::Foreground && tile.foreground )) {
142142 const auto &tile_pixels = tile_sets[0 ].at (tile.tileid );
143- for (std::size_t y = 0 ; y < pixels.size ().height ; ++y ) {
144- for (std::size_t x = 0 ; x < pixels.size ().width ; ++x ) {
145- Point current_pixel{ x, y };
143+ for (std::size_t cur_y = 0 ; cur_y < pixels.size ().height ; ++cur_y ) {
144+ for (std::size_t cur_x = 0 ; cur_x < pixels.size ().width ; ++cur_x ) {
145+ Point current_pixel{ cur_x, cur_y };
146146
147147 if (first_tile && !tile.foreground ) {
148148 pixels.at (current_pixel) = tile_pixels.at (current_pixel);
0 commit comments