diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 56c47e0f29f..47b5c673a8b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1106,6 +1106,13 @@ void PointGroupClass::Update_Arrays( case TRIS_SIZE_NOORIENT: { + if (!point_size) + { + vnum = 0; + pnum = 0; + return; + } + // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { vertex_loc[vert + 0] = point_loc[i] + @@ -1121,6 +1128,13 @@ void PointGroupClass::Update_Arrays( case TRIS_NOSIZE_ORIENT: { + if (!point_orientation) + { + vnum = 0; + pnum = 0; + return; + } + // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { vertex_loc[vert + 0] = point_loc[i] + @@ -1136,6 +1150,13 @@ void PointGroupClass::Update_Arrays( case TRIS_SIZE_ORIENT: { + if (!point_size || !point_orientation) + { + vnum = 0; + pnum = 0; + return; + } + // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { vertex_loc[vert + 0] = point_loc[i] + @@ -1171,6 +1192,13 @@ void PointGroupClass::Update_Arrays( case QUADS_SIZE_NOORIENT: { + if (!point_size) + { + vnum = 0; + pnum = 0; + return; + } + // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { vertex_loc[vert + 0] = point_loc[i] + @@ -1188,6 +1216,13 @@ void PointGroupClass::Update_Arrays( case QUADS_NOSIZE_ORIENT: { + if (!point_orientation) + { + vnum = 0; + pnum = 0; + return; + } + // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { vertex_loc[vert + 0] = point_loc[i] + @@ -1205,6 +1240,13 @@ void PointGroupClass::Update_Arrays( case QUADS_SIZE_ORIENT: { + if (!point_size || !point_orientation) + { + vnum = 0; + pnum = 0; + return; + } + Matrix4x4 view; Vector4 result; if (!Billboard) { @@ -1312,6 +1354,13 @@ void PointGroupClass::Update_Arrays( case SCREEN_SIZE_NOORIENT: case SCREEN_SIZE_ORIENT: { + if (!point_size) + { + vnum = 0; + pnum = 0; + return; + } + // Offsets need to be scaled to the current screen resolution // First find x and y scale factors (sizes in pixels need to be @@ -1790,7 +1839,8 @@ void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int // 3 times per particle when we can do it once float recipDepth = 0.1f / (float)depth; - float shiftInc = ( t * *current_size * recipDepth ); + const float pointSize = current_size ? *current_size : DefaultPointSize; + float shiftInc = t * pointSize * recipDepth; Vector3 volumeLayerShift; Vector3 cameraPosition = rinfo.Camera.Get_Position();