Soft particles: Disable Particle Stage "softeningRadius" keyword

this avoid breaking the game DLL ABI (framework/DeclParticle.h is part
of the SDK), and for now doesn't make a difference, because that keyword
was introduced by TDM and thus is only used in their particle defs.

When we break the game ABI/API anyway (probably for high FPS support),
this commit can just be reverted
This commit is contained in:
Daniel Gibson 2024-07-25 04:05:51 +02:00
parent b86d2c587d
commit 2e0b093c79
3 changed files with 17 additions and 6 deletions

View file

@ -410,7 +410,10 @@ idParticleStage *idDeclParticle::ParseParticleStage( idLexer &src ) {
continue; continue;
} }
if ( !token.Icmp( "softeningRadius" ) ) { // #3878 soft particles if ( !token.Icmp( "softeningRadius" ) ) { // #3878 soft particles
stage->softeningRadius = src.ParseFloat(); common->Warning( "Particle %s from %s has stage with \"softeningRadius\" attribute, which is currently ignored (we soften all suitable particles)\n",
this->GetName(), src.GetFileName() );
// DG: disable this for now to avoid breaking the game ABI
//stage->softeningRadius = src.ParseFloat();
continue; continue;
} }
@ -737,7 +740,9 @@ idParticleStage::idParticleStage( void ) {
hidden = false; hidden = false;
boundsExpansion = 0.0f; boundsExpansion = 0.0f;
bounds.Clear(); bounds.Clear();
softeningRadius = -2.0f; // -2 means "auto" - #3878 soft particles // DG: disable softeningRadius for now to avoid breaking the game ABI
// (will always behave like if softeningRadius = -2.0f)
//softeningRadius = -2.0f; // -2 means "auto" - #3878 soft particles
} }
/* /*
@ -811,7 +816,8 @@ void idParticleStage::Default() {
randomDistribution = true; randomDistribution = true;
entityColor = false; entityColor = false;
cycleMsec = ( particleLife + deadTime ) * 1000; cycleMsec = ( particleLife + deadTime ) * 1000;
softeningRadius = -2.0f; // -2 means "auto" - #3878 soft particles // DG: disable softeningRadius for now to avoid breaking game ABI
//softeningRadius = -2.0f; // -2 means "auto" - #3878 soft particles
} }
/* /*

View file

@ -202,7 +202,9 @@ public:
This is more flexible even when not using soft particles, as modelDepthHack This is more flexible even when not using soft particles, as modelDepthHack
can be turned off for specific stages to stop them poking through walls. can be turned off for specific stages to stop them poking through walls.
*/ */
float softeningRadius; // DG: disable this for now because it breaks the game DLL's ABI (re-enable in dhewm3 1.6.0 or 2.0.0)
// (this header is part of the SDK)
//float softeningRadius;
}; };

View file

@ -310,11 +310,14 @@ void idRenderModelPrt::SetSofteningRadii()
for ( int i = 0; i < particleSystem->stages.Num(); ++i ) for ( int i = 0; i < particleSystem->stages.Num(); ++i )
{ {
const idParticleStage* ps = particleSystem->stages[i]; const idParticleStage* ps = particleSystem->stages[i];
if ( ps->softeningRadius > -2.0f ) // User has specified a setting // DG: for now softeningRadius isn't configurable to avoid breaking the game DLL's ABI
// => always behave like if ps->softeningRadius == -2, which means "auto"
// (doesn't make a difference, so far only TDM particles set the softeningRadius)
/* if ( ps->softeningRadius > -2.0f ) // User has specified a setting
{ {
softeningRadii[i] = ps->softeningRadius; softeningRadii[i] = ps->softeningRadius;
} }
else if ( ps->orientation == POR_VIEW ) // Only view-aligned particle stages qualify for softening else */ if ( ps->orientation == POR_VIEW ) // Only view-aligned particle stages qualify for softening
{ {
float diameter = Max( ps->size.from, ps->size.to ); float diameter = Max( ps->size.from, ps->size.to );
float scale = Max( ps->aspect.from, ps->aspect.to ); float scale = Max( ps->aspect.from, ps->aspect.to );