Assert that raytracing is going to finish at some point.
This commit is contained in:
parent
d9a943ee4a
commit
2d05fd03db
1 changed files with 2 additions and 0 deletions
|
@ -138,10 +138,12 @@ namespace curry {
|
||||||
const vec2us last_tile = pixel_to_world_tile(parWorld, parTo);
|
const vec2us last_tile = pixel_to_world_tile(parWorld, parTo);
|
||||||
while (parFunc(curr_tile) and last_tile != curr_tile) {
|
while (parFunc(curr_tile) and last_tile != curr_tile) {
|
||||||
if (max.x() < max.y()) {
|
if (max.x() < max.y()) {
|
||||||
|
assert(std::max(static_cast<uint16_t>(curr_tile.x() + step.x()), last_tile.x()) - std::min(static_cast<uint16_t>(curr_tile.x() + step.x()), last_tile.x()) < std::max(curr_tile.x(), last_tile.x()) - std::min(curr_tile.x(), last_tile.x()));
|
||||||
max.x() += delta.x();
|
max.x() += delta.x();
|
||||||
curr_tile.x() = static_cast<uint16_t>(curr_tile.x() + step.x());
|
curr_tile.x() = static_cast<uint16_t>(curr_tile.x() + step.x());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
assert(std::max(static_cast<uint16_t>(curr_tile.y() + step.y()), last_tile.y()) - std::min(static_cast<uint16_t>(curr_tile.y() + step.y()), last_tile.y()) < std::max(curr_tile.y(), last_tile.y()) - std::min(curr_tile.y(), last_tile.y()));
|
||||||
max.y() += delta.y();
|
max.y() += delta.y();
|
||||||
curr_tile.y() = static_cast<uint16_t>(curr_tile.y() + step.y());
|
curr_tile.y() = static_cast<uint16_t>(curr_tile.y() + step.y());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue