tweak(particlesys): Cleanup volume particle depth handling and add INI field to control it - #3188
Conversation
PR Summary by QodoParticleSys: Make volume particle depth configurable while preserving retail defaults
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Vol depth 0 ignored
|
bbbc607 to
a596261
Compare
|
The overall direction looks good, but I think two issues should be addressed before merging:
Other than these configuration and round-trip concerns, the change looks clean and the CI results are good. |
a596261 to
291a2e3
Compare
291a2e3 to
53eef90
Compare
53eef90 to
c32d92c
Compare
|
Fixed based on feedback and did a little more cleanup around it as well. |
c32d92c to
ffa3dc6
Compare
|
Updated with recent suggestions along with a little extra cleanup around the same area. |
ffa3dc6 to
1034a5b
Compare
1034a5b to
34eb57d
Compare
34eb57d to
7b77fd1
Compare
|
Merged to generals, i didn't realise at first that one of the files was not in core. Should be good to merge now. |
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/GameClient/ParticleSys.h | Defines explicit depth constants and exposes the stored depth and volume-particle type through const accessors. |
| Core/GameEngine/Source/Common/INI/INIParticleSys.cpp | Runs template validation after all particle-system INI fields have been parsed. |
| Core/GameEngine/Source/GameClient/System/ParticleSys.cpp | Parses configurable depth, preserves configured volume values, applies retail and normal defaults, and copies the result into runtime particle systems. |
| Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DParticleSys.cpp | Selects volume rendering only for volume-particle systems whose validated depth exceeds the normal-render default. |
| Core/Libraries/Source/WWVegas/WW3D2/pointgr.cpp | Names the normal-render depth threshold while retaining the renderer’s existing upper clamp. |
| Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp | Serializes particle depth into Generals particle-system INI output. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp | Mirrors particle-depth serialization for the Zero Hour variant. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
INI[Particle INI definition] --> Parse[Parse Type and VolParticleDepth]
Parse --> Validate{Particle type}
Validate -- Volume and depth 0 --> RetailDefault[Set depth to 6]
Validate -- Volume and configured --> Preserve[Preserve configured depth]
Validate -- Non-volume --> NormalDefault[Set depth to 1]
RetailDefault --> Instance[Create ParticleSystem]
Preserve --> Instance
NormalDefault --> Instance
Instance --> Gate{Volume type and depth above 1?}
Gate -- Yes --> VolumeRender[RenderVolumeParticle]
Gate -- No --> NormalRender[Render]
Reviews (2): Last reviewed commit: "refactor(particlesys): Cleanup retail vo..." | Re-trigger Greptile
7b77fd1 to
99a9983
Compare












This PR is a refactor to cleanup the handling of volume depth for volume type and normal particles.
The particle system class originally returned a hard coded value from
getVolumeParticleDepth()instead of returning the variablem_volumeParticleDepth.This value is now retrieved from the particle template and exposed to configuration through the ini field of
VolParticleDepth.To preserve the retail particle behaviour, we identify uninitialised volume particles and set their particle depth to the original hard coded value. Otherwise the configured by ini value will be used.
EDIT - For normal particles we now also initialise their depth to 1.