Merge pull request #1413 from Azaezel/alpha41/validValidators

consolidate addfieldV method contents to avoid duplication
This commit is contained in:
Brian Roberts 2025-03-18 10:43:42 -05:00 committed by GitHub
commit 1ebe48edbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 84 additions and 97 deletions

View file

@ -91,7 +91,7 @@ DecalData::DecalData()
matInst = NULL;
renderPriority = 10;
mRenderPriority = 10;
clippingMasks = STATIC_COLLISION_TYPEMASK;
clippingAngle = 89.0f;
@ -169,7 +169,7 @@ void DecalData::initPersistFields()
"fully faded out.\n\n"
"This should be a smaller value than #fadeStartPixelSize." );
addField( "renderPriority", TypeS8, Offset( renderPriority, DecalData ),
addField( "renderPriority", TypeS16, Offset( mRenderPriority, DecalData ),
"Default renderPriority for decals of this type (determines draw "
"order when decals overlap)." );
@ -235,7 +235,7 @@ void DecalData::onStaticModified( const char *slotName, const char *newValue )
}
else if ( dStricmp( slotName, "renderPriority" ) == 0 )
{
renderPriority = getMax( renderPriority, (U8)1 );
mRenderPriority = getMax(mRenderPriority, (S16)1 );
}
}
@ -270,7 +270,7 @@ void DecalData::packData( BitStream *stream )
stream->write( fadeStartPixelSize );
stream->write( fadeEndPixelSize );
stream->write( renderPriority );
stream->write( mRenderPriority );
stream->write( clippingMasks );
stream->write( clippingAngle );
@ -300,7 +300,7 @@ void DecalData::unpackData( BitStream *stream )
stream->read( &fadeStartPixelSize );
stream->read( &fadeEndPixelSize );
stream->read( &renderPriority );
stream->read( &mRenderPriority);
stream->read( &clippingMasks );
stream->read( &clippingAngle );

View file

@ -85,7 +85,7 @@ class DecalData : public SimDataBlock
String lookupName;
U8 renderPriority;
S16 mRenderPriority;
S32 clippingMasks;

View file

@ -88,7 +88,7 @@ class DecalInstance
U8 getRenderPriority() const
{
return mRenderPriority == 0 ? mDataBlock->renderPriority : mRenderPriority;
return mRenderPriority == 0 ? mDataBlock->mRenderPriority : mRenderPriority;
}
/// Calculates the size of this decal onscreen in pixels, used for LOD.

View file

@ -138,11 +138,11 @@ ParticleData::ParticleData()
//-----------------------------------------------------------------------------
FRangeValidator dragCoefFValidator(0.f, 5.f);
FRangeValidator gravCoefFValidator(-10.f, 10.f);
FRangeValidator spinRandFValidator(-1000.f, 1000.f);
FRangeValidator particleTimeFValidator(0.0f, 1.0f, 1<<8);
FRangeValidator particleSizeFValidator(0.0f, MaxParticleSize, 1<<16);
FRangeValidator dragCoefFValidator(0.f, 5.f, BIT(10));
FRangeValidator gravCoefFValidator(-10.f, 10.f, BIT(12));
FRangeValidator spinRandFValidator(-1000.f, 1000.f, BIT(11));
FRangeValidator particleTimeFValidator(0.0f, 1.0f, BIT(8));
FRangeValidator particleSizeFValidator(0.0f, MaxParticleSize, BIT(16));
//-----------------------------------------------------------------------------
// initPersistFields