mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
fixed crash
This commit is contained in:
parent
5edcfaa38b
commit
c41f5e27ef
1 changed files with 6 additions and 6 deletions
|
@ -430,10 +430,10 @@ bool CoverageRegion::mergeItemsInArray(VoxelProjectedPolygon* seed, bool seedInA
|
||||||
otherPolygon->merge(*seed);
|
otherPolygon->merge(*seed);
|
||||||
|
|
||||||
if (seedInArray) {
|
if (seedInArray) {
|
||||||
int* IGNORED = NULL;
|
int* IGNORED_ADDRESS = NULL;
|
||||||
// remove this otherOtherPolygon for our polygon array
|
// remove this otherOtherPolygon for our polygon array
|
||||||
_polygonCount = removeFromSortedArrays((void*)seed,
|
_polygonCount = removeFromSortedArrays((void*)seed,
|
||||||
(void**)_polygons, _polygonDistances, IGNORED,
|
(void**)_polygons, _polygonDistances, IGNORED_ADDRESS,
|
||||||
_polygonCount, _polygonArraySize);
|
_polygonCount, _polygonArraySize);
|
||||||
_totalPolygons--;
|
_totalPolygons--;
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,8 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
|
||||||
// in the list. We still check to see if the polygon is "in front" of the target polygon before we test occlusion. Since
|
// in the list. We still check to see if the polygon is "in front" of the target polygon before we test occlusion. Since
|
||||||
// sometimes things come out of order.
|
// sometimes things come out of order.
|
||||||
const bool SORT_BY_SIZE = false;
|
const bool SORT_BY_SIZE = false;
|
||||||
int IGNORED = 0;
|
const int IGNORED = 0;
|
||||||
|
int* IGNORED_ADDRESS = NULL;
|
||||||
if (SORT_BY_SIZE) {
|
if (SORT_BY_SIZE) {
|
||||||
// This old code assumes that polygons will always be added in z-buffer order, but that doesn't seem to
|
// This old code assumes that polygons will always be added in z-buffer order, but that doesn't seem to
|
||||||
// be a good assumption. So instead, we will need to sort this by distance. Use a binary search to find the
|
// be a good assumption. So instead, we will need to sort this by distance. Use a binary search to find the
|
||||||
|
@ -488,12 +489,11 @@ void CoverageRegion::storeInArray(VoxelProjectedPolygon* polygon) {
|
||||||
float reverseArea = 4.0f - area;
|
float reverseArea = 4.0f - area;
|
||||||
//qDebug("store by size area=%f reverse area=%f\n", area, reverseArea);
|
//qDebug("store by size area=%f reverse area=%f\n", area, reverseArea);
|
||||||
_polygonCount = insertIntoSortedArrays((void*)polygon, reverseArea, IGNORED,
|
_polygonCount = insertIntoSortedArrays((void*)polygon, reverseArea, IGNORED,
|
||||||
(void**)_polygons, _polygonSizes, &IGNORED,
|
(void**)_polygons, _polygonSizes, IGNORED_ADDRESS,
|
||||||
_polygonCount, _polygonArraySize);
|
_polygonCount, _polygonArraySize);
|
||||||
} else {
|
} else {
|
||||||
int IGNORED = 0;
|
|
||||||
_polygonCount = insertIntoSortedArrays((void*)polygon, polygon->getDistance(), IGNORED,
|
_polygonCount = insertIntoSortedArrays((void*)polygon, polygon->getDistance(), IGNORED,
|
||||||
(void**)_polygons, _polygonDistances, &IGNORED,
|
(void**)_polygons, _polygonDistances, IGNORED_ADDRESS,
|
||||||
_polygonCount, _polygonArraySize);
|
_polygonCount, _polygonArraySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue