INNER CODE UNIT · C++
build_borders
symphony-of-empires/symphony-of-empires · eng3d/eng3d/borders.cpp:142
static void build_borders(std::vector<std::vector<glm::vec3>>& borders, const uint32_t* pixels, int width, int height) {
BorderGenerator generator(borders, pixels, width, height);
borders.push_back(std::vector<glm::vec3>());
for(int y = 0; y < height; y++) {
for(int x = 0; x < width; x++) {
int curr_index = x + y * width;
if(generator.check_neighbor(x, y) && !generator.walked_positions.count(curr_index)) {
generator.get_border(curr_index, 1);
generator.clear_stack();
}
}
}
}
};
void Eng3D::Borders::build_borders() {
auto border_tex = std::make_unique<Eng3D::BinaryImage>(s.package_man.get_unique("map/provinces.png")->abs_path);
int height = border_tex->height;