Avoid division by zero in the fix surface compatibility routine
This commit is contained in:
parent
80de898d72
commit
98011e032d
|
@ -2148,6 +2148,7 @@ void RenderingServer::fix_surface_compatibility(SurfaceData &p_surface, const St
|
||||||
// The only difference for now is that Version 1 uses interleaved vertex positions while version 2 does not.
|
// The only difference for now is that Version 1 uses interleaved vertex positions while version 2 does not.
|
||||||
// I.e. PNTPNTPNT -> PPPNTNTNT.
|
// I.e. PNTPNTPNT -> PPPNTNTNT.
|
||||||
|
|
||||||
|
if (p_surface.vertex_data.size() > 0 && p_surface.vertex_count > 0) {
|
||||||
int vertex_size = 0;
|
int vertex_size = 0;
|
||||||
int normal_size = 0;
|
int normal_size = 0;
|
||||||
int tangent_size = 0;
|
int tangent_size = 0;
|
||||||
|
@ -2189,6 +2190,7 @@ void RenderingServer::fix_surface_compatibility(SurfaceData &p_surface, const St
|
||||||
p_surface.blend_shape_data = new_blend_shape_data;
|
p_surface.blend_shape_data = new_blend_shape_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
p_surface.format &= ~(ARRAY_FLAG_FORMAT_VERSION_MASK << ARRAY_FLAG_FORMAT_VERSION_SHIFT);
|
p_surface.format &= ~(ARRAY_FLAG_FORMAT_VERSION_MASK << ARRAY_FLAG_FORMAT_VERSION_SHIFT);
|
||||||
p_surface.format |= ARRAY_FLAG_FORMAT_CURRENT_VERSION & (ARRAY_FLAG_FORMAT_VERSION_MASK << ARRAY_FLAG_FORMAT_VERSION_SHIFT);
|
p_surface.format |= ARRAY_FLAG_FORMAT_CURRENT_VERSION & (ARRAY_FLAG_FORMAT_VERSION_MASK << ARRAY_FLAG_FORMAT_VERSION_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue