mirror of
https://gitlab.com/Trygve/contour-creator.git
synced 2024-11-21 23:00:18 +00:00
Fixed stupid mistake in for loop
This commit is contained in:
parent
9d8df3256d
commit
4cd4f773bf
15
src/main.cpp
15
src/main.cpp
@ -63,23 +63,30 @@ std::vector<std::vector<Point>> vector_cellmap(HeightMap* heightmap, int interva
|
|||||||
if (candidate->x +1 == current->x && candidate->y == current->y) {
|
if (candidate->x +1 == current->x && candidate->y == current->y) {
|
||||||
current->next = candidate;
|
current->next = candidate;
|
||||||
candidate->previous = current;
|
candidate->previous = current;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (candidate->x -1 == current->x && candidate->y == current->y) {
|
else if (candidate->x -1 == current->x && candidate->y == current->y) {
|
||||||
current->next = candidate;
|
current->next = candidate;
|
||||||
candidate->previous = current;
|
candidate->previous = current;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (candidate->y +1 == current->y && candidate->x == current->x) {
|
else if (candidate->y +1 == current->y && candidate->x == current->x) {
|
||||||
current->next = candidate;
|
current->next = candidate;
|
||||||
candidate->previous = current;
|
candidate->previous = current;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (candidate->y -1 == current->y && candidate->x == current->x) {
|
else if (candidate->y -1 == current->y && candidate->x == current->x) {
|
||||||
current->next = candidate;
|
current->next = candidate;
|
||||||
candidate->previous = current;
|
candidate->previous = current;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (current->next == nullptr)
|
||||||
|
{
|
||||||
current->endpoint = true;
|
current->endpoint = true;
|
||||||
}
|
std::cout << "🤕";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -177,7 +184,7 @@ void write_output_file(std::vector<std::vector<Point>> all_points, const char *f
|
|||||||
|
|
||||||
|
|
||||||
std::vector<Point> points = all_points[j];
|
std::vector<Point> points = all_points[j];
|
||||||
Point* current = &points[0];
|
Point* current = &points[50];
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//int x_raw = i%width;
|
//int x_raw = i%width;
|
||||||
|
Loading…
Reference in New Issue
Block a user