-
Notifications
You must be signed in to change notification settings - Fork 245
refactor(particlesys): Cleanup retail volume particle depth handling #3188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,4 +54,19 @@ void INI::parseParticleSystemDefinition( INI* ini ) | |
|
|
||
| // parse the ini definition | ||
| ini->initFromINI( sysTemplate, sysTemplate->getFieldParse() ); | ||
|
|
||
| #if PRESERVE_RETAIL_PARTICLES | ||
| // TheSuperHackers @info Hack to allow isUsingSmudge() functionality with retail smudge particles | ||
| // The retail data template for smudge particles is not correctly configured with the smudge particle type | ||
| if (sysTemplate->m_particleType != ParticleSystemInfo::SMUDGE && sysTemplate->m_particleTypeName.startsWithNoCase("SMUDGE.")) | ||
| { | ||
| sysTemplate->m_particleType = ParticleSystemInfo::SMUDGE; | ||
| } | ||
|
|
||
| // In retail, volume particle depth was not setup through ini and was hard coded to a particle depth of 6 | ||
| if (sysTemplate->m_particleType == ParticleSystemInfo::VOLUME_PARTICLE && sysTemplate->m_volumeParticleDepth == DEFAULT_VOLUME_PARTICLE_DEPTH) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means if someone now sets
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zero and One are invalid settings anyway. There are tests in the render code for the volume depth being greater than One. The value is also initialised to zero in the template.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the particle depth is set to zero or one, then the volume particle just gets rendered as a standard particle in this instance. void PointGroupClass::RenderVolumeParticle(RenderInfoClass &rinfo, unsigned int depth )
{
if ( depth <= 1 ) //oops,wrong number
{
Render( rinfo );
return;
}Which kind of voids the point of it being a volume particle. But seems more like a safety net.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When looking further into the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about do Then initialize particle template depth with invalid, and then depending on the particle type parsed from ini, choose 1 or 6, regardless of retail.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well the problem is that we only consider getting as far as the rendering if the volume is 2 or higher anyway. That's where i added the So even set to 1 the volume particle is never rendered. Even if it the rendering code has a failsafe to render as a regular particle. The workaround was always more about catching the non configured particles from retail. For non retail and mod's the particle editor should always put a minimum of 2 as the particle depth if a volume particle is selected. Otherwise it should be considered misconfigured and not render etc. This is more just a hack to keep retail particles working that lack the configuration essentially while opening up the particle depth option for mods and future etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont quite follow. The proposed flow is to initialize with invalid, and then set 1 or 6 depending on the type wehn invalid. This way it always works the same way reliably and needs to retail guarding. |
||
| { | ||
| sysTemplate->m_volumeParticleDepth = OPTIMUM_VOLUME_PARTICLE_DEPTH; | ||
| } | ||
| #endif | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.