Clip the portals when running the test cases.

When the portals are too big, floats break down and break the tests. This
might not be much of an issue in real maps, but my tests use "infinite"
planes.
This commit is contained in:
Bill Currie 2011-11-28 08:57:42 +09:00
parent 2abff68089
commit ab2ec644d6

View file

@ -477,6 +477,14 @@ run_test (test_t *test)
goto nodeleaf_bail;
}
for (p = portal_list; p; p = p->next) {
for (j = 0; j < p->portal->winding->numpoints; j++) {
p->portal->winding->points[j][0]
= bound (-8192, p->portal->winding->points[j][0], 8192);
p->portal->winding->points[j][1]
= bound (-8192, p->portal->winding->points[j][1], 8192);
p->portal->winding->points[j][2]
= bound (-8192, p->portal->winding->points[j][2], 8192);
}
for (j = 0; j < 2; j++) {
int found = 0;