From 7233f4658e12a920b9e3d26325ed9598e6cee33d Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Sat, 12 Sep 2026 21:08:11 -0600 Subject: [PATCH 1/6] fix(WW3D2): Let Volume Particles assume default size if no size array is given --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 56c47e0f29f..7cc010dc050 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1790,7 +1790,7 @@ 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 ); + float shiftInc = t * (current_size ? *current_size : DefaultPointSize) * recipDepth; Vector3 volumeLayerShift; Vector3 cameraPosition = rinfo.Camera.Get_Position(); From ece90f12b66fe714df1877c0679b850bf440298e Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Tue, 15 Sep 2026 09:36:06 -0600 Subject: [PATCH 2/6] fix(pointgroup): Cache the pointSize check --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 7cc010dc050..aaa3265e2bc 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1791,6 +1791,8 @@ void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int float recipDepth = 0.1f / (float)depth; float shiftInc = t * (current_size ? *current_size : DefaultPointSize) * recipDepth; + const float pointSize = current_size ? *current_size : DefaultPointSize; + float shiftInc = t * pointSize * recipDepth; Vector3 volumeLayerShift; Vector3 cameraPosition = rinfo.Camera.Get_Position(); From d550499015a7740e0a32cbaa928e8390b6f546d8 Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Tue, 15 Sep 2026 09:43:01 -0600 Subject: [PATCH 3/6] fixup! fix(pointgroup): Cache the pointSize check --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index aaa3265e2bc..909e2cb3fc3 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1790,7 +1790,6 @@ 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 ? *current_size : DefaultPointSize) * recipDepth; const float pointSize = current_size ? *current_size : DefaultPointSize; float shiftInc = t * pointSize * recipDepth; From 841c2fb5023379423c1baa0c453039d897592307 Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Tue, 15 Sep 2026 09:51:05 -0600 Subject: [PATCH 4/6] fix(pointgroup): Add Null Guards to other possible derefrences --- .../Source/WWVegas/WW3D2/pointgr.cpp | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 909e2cb3fc3..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 From 7f48bf32ff48143690db294dde4d01c5c61641ac Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Wed, 16 Sep 2026 10:04:22 -0600 Subject: [PATCH 5/6] fix(pointgroup): Replace redundant null guards with assertions --- .../Source/WWVegas/WW3D2/pointgr.cpp | 53 ++++--------------- 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index 47b5c673a8b..e458eec670d 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1082,6 +1082,8 @@ void PointGroupClass::Update_Arrays( Vector3 *vertex_loc = &VertexLoc[0]; + // The selector guarantees the required arrays are present in each branch. + // Assert these requirements in the branches that use the arrays. /// @todo lorenzen sez: this switch statement may be done more compactly another way... look into it switch (loop_sel) { @@ -1106,12 +1108,7 @@ void PointGroupClass::Update_Arrays( case TRIS_SIZE_NOORIENT: { - if (!point_size) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_size); // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { @@ -1128,12 +1125,7 @@ void PointGroupClass::Update_Arrays( case TRIS_NOSIZE_ORIENT: { - if (!point_orientation) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_orientation); // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { @@ -1150,12 +1142,7 @@ void PointGroupClass::Update_Arrays( case TRIS_SIZE_ORIENT: { - if (!point_size || !point_orientation) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_size && point_orientation); // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { @@ -1192,12 +1179,7 @@ void PointGroupClass::Update_Arrays( case QUADS_SIZE_NOORIENT: { - if (!point_size) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_size); // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { @@ -1216,12 +1198,7 @@ void PointGroupClass::Update_Arrays( case QUADS_NOSIZE_ORIENT: { - if (!point_orientation) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_orientation); // Scale vertex offsets and add them to point locations to get vertex locations for (i = 0; i < active_points; i++) { @@ -1240,12 +1217,7 @@ void PointGroupClass::Update_Arrays( case QUADS_SIZE_ORIENT: { - if (!point_size || !point_orientation) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_size && point_orientation); Matrix4x4 view; Vector4 result; @@ -1354,12 +1326,7 @@ void PointGroupClass::Update_Arrays( case SCREEN_SIZE_NOORIENT: case SCREEN_SIZE_ORIENT: { - if (!point_size) - { - vnum = 0; - pnum = 0; - return; - } + WWASSERT(point_size); // Offsets need to be scaled to the current screen resolution @@ -1839,6 +1806,8 @@ void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int // 3 times per particle when we can do it once float recipDepth = 0.1f / (float)depth; + // TheSuperHackers @bugfix CryoTheRenegade 06/09/2026 Volume particles can use the default size without a size array. + // Match the size used by the NOSIZE branches in Update_Arrays. const float pointSize = current_size ? *current_size : DefaultPointSize; float shiftInc = t * pointSize * recipDepth; From 332fff0a0b2b06e3bd4f1f99e5d2dc8b2f780029 Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Wed, 16 Sep 2026 21:11:20 -0600 Subject: [PATCH 6/6] fix(pointgroup): Remove Comments --- Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp index e458eec670d..57a28f611e3 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp @@ -1082,8 +1082,6 @@ void PointGroupClass::Update_Arrays( Vector3 *vertex_loc = &VertexLoc[0]; - // The selector guarantees the required arrays are present in each branch. - // Assert these requirements in the branches that use the arrays. /// @todo lorenzen sez: this switch statement may be done more compactly another way... look into it switch (loop_sel) { @@ -1806,8 +1804,6 @@ void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int // 3 times per particle when we can do it once float recipDepth = 0.1f / (float)depth; - // TheSuperHackers @bugfix CryoTheRenegade 06/09/2026 Volume particles can use the default size without a size array. - // Match the size used by the NOSIZE branches in Update_Arrays. const float pointSize = current_size ? *current_size : DefaultPointSize; float shiftInc = t * pointSize * recipDepth;