Merge pull request #5182 from sum2012/patch-2

Fix "Integer divide by zero"  in Spline.cpp
This commit is contained in:
Henrik Rydgård committed 2014-01-22 14:19:33 -08:00
commit f53ef47528
1 file changed
+2
+2
View File
@@ -816,6 +816,8 @@ void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int
// Simple approximation of the real tesselation factor.
// We shouldn't really split up into separate 4x4 patches, instead we should do something that works
// like the splines, so we subdivide across the whole "mega-patch".
if (num_patches_u == 0) num_patches_u = 1;
if (num_patches_v == 0) num_patches_v = 1;
int tess_u = gstate.getPatchDivisionU() / num_patches_u;
int tess_v = gstate.getPatchDivisionV() / num_patches_v;
if (tess_u < 4) tess_u = 4;