add some missing NULL checks, a few parts of the code used a pointer then checked it for NULL after.
also made it more clear that some areas assume the pointer isnt null (remove redundant NULL checks).
This commit is contained in:
@@ -536,18 +536,18 @@ void RAS_MeshObject::SortPolygons(RAS_MeshSlot& ms, const MT_Transform &transfor
|
||||
const MT_Vector3 pnorm(transform.getBasis()[2]);
|
||||
// unneeded: const MT_Scalar pval = transform.getOrigin()[2];
|
||||
|
||||
vector<polygonSlot> slots(totpoly);
|
||||
vector<polygonSlot> poly_slots(totpoly);
|
||||
|
||||
/* get indices and z into temporary array */
|
||||
for (j=0; j<totpoly; j++)
|
||||
slots[j].get(it.vertex, it.index, j*nvert, nvert, pnorm);
|
||||
poly_slots[j].get(it.vertex, it.index, j*nvert, nvert, pnorm);
|
||||
|
||||
/* sort (stable_sort might be better, if flickering happens?) */
|
||||
std::sort(slots.begin(), slots.end(), backtofront());
|
||||
std::sort(poly_slots.begin(), poly_slots.end(), backtofront());
|
||||
|
||||
/* get indices from temporary array again */
|
||||
for (j=0; j<totpoly; j++)
|
||||
slots[j].set(it.index, j*nvert, nvert);
|
||||
poly_slots[j].set(it.index, j*nvert, nvert);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user