mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-01 03:23:52 +00:00
extra option for terrain block to disable the update of the basetexture
file
This commit is contained in:
parent
aa6d9b8ec2
commit
a6297e2c32
2 changed files with 12 additions and 2 deletions
|
|
@ -197,7 +197,8 @@ TerrainBlock::TerrainBlock()
|
|||
mBaseTexScaleConst( NULL ),
|
||||
mBaseTexIdConst( NULL ),
|
||||
mPhysicsRep( NULL ),
|
||||
mZoningDirty( false )
|
||||
mZoningDirty( false ),
|
||||
mUpdateBasetex ( true )
|
||||
{
|
||||
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
||||
mNetFlags.set(Ghostable | ScopeAlways);
|
||||
|
|
@ -962,7 +963,7 @@ bool TerrainBlock::onAdd()
|
|||
// If the cached base texture is older that the terrain file or
|
||||
// it doesn't exist then generate and cache it.
|
||||
String baseCachePath = _getBaseTexCacheFileName();
|
||||
if ( Platform::compareModifiedTimes( baseCachePath, mTerrFileName ) < 0 )
|
||||
if ( Platform::compareModifiedTimes( baseCachePath, mTerrFileName ) < 0 && mUpdateBasetex )
|
||||
_updateBaseTexture( true );
|
||||
|
||||
// The base texture should have been cached by now... so load it.
|
||||
|
|
@ -1146,6 +1147,8 @@ void TerrainBlock::initPersistFields()
|
|||
"Light map dimensions in pixels." );
|
||||
|
||||
addField( "screenError", TypeS32, Offset( mScreenError, TerrainBlock ), "Not yet implemented." );
|
||||
|
||||
addField( "updateBasetex", TypeBool, Offset( mUpdateBasetex, TerrainBlock ), "Whether or not to update the Base Texture" );
|
||||
|
||||
endGroup( "Misc" );
|
||||
|
||||
|
|
@ -1199,6 +1202,8 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
|||
stream->write( mScreenError );
|
||||
|
||||
stream->writeInt(mBaseTexFormat, 32);
|
||||
|
||||
stream->writeFlag( mUpdateBasetex );
|
||||
|
||||
return retMask;
|
||||
}
|
||||
|
|
@ -1268,6 +1273,8 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
|||
stream->read( &mScreenError );
|
||||
|
||||
mBaseTexFormat = (BaseTexFormat)stream->readInt(32);
|
||||
|
||||
mUpdateBasetex = stream->readFlag();
|
||||
}
|
||||
|
||||
void TerrainBlock::getMinMaxHeight( F32 *minHeight, F32 *maxHeight ) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue