mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +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 ),
|
mBaseTexScaleConst( NULL ),
|
||||||
mBaseTexIdConst( NULL ),
|
mBaseTexIdConst( NULL ),
|
||||||
mPhysicsRep( NULL ),
|
mPhysicsRep( NULL ),
|
||||||
mZoningDirty( false )
|
mZoningDirty( false ),
|
||||||
|
mUpdateBasetex ( true )
|
||||||
{
|
{
|
||||||
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
||||||
mNetFlags.set(Ghostable | ScopeAlways);
|
mNetFlags.set(Ghostable | ScopeAlways);
|
||||||
|
|
@ -962,7 +963,7 @@ bool TerrainBlock::onAdd()
|
||||||
// If the cached base texture is older that the terrain file or
|
// If the cached base texture is older that the terrain file or
|
||||||
// it doesn't exist then generate and cache it.
|
// it doesn't exist then generate and cache it.
|
||||||
String baseCachePath = _getBaseTexCacheFileName();
|
String baseCachePath = _getBaseTexCacheFileName();
|
||||||
if ( Platform::compareModifiedTimes( baseCachePath, mTerrFileName ) < 0 )
|
if ( Platform::compareModifiedTimes( baseCachePath, mTerrFileName ) < 0 && mUpdateBasetex )
|
||||||
_updateBaseTexture( true );
|
_updateBaseTexture( true );
|
||||||
|
|
||||||
// The base texture should have been cached by now... so load it.
|
// The base texture should have been cached by now... so load it.
|
||||||
|
|
@ -1147,6 +1148,8 @@ void TerrainBlock::initPersistFields()
|
||||||
|
|
||||||
addField( "screenError", TypeS32, Offset( mScreenError, TerrainBlock ), "Not yet implemented." );
|
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" );
|
endGroup( "Misc" );
|
||||||
|
|
||||||
Parent::initPersistFields();
|
Parent::initPersistFields();
|
||||||
|
|
@ -1200,6 +1203,8 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
||||||
|
|
||||||
stream->writeInt(mBaseTexFormat, 32);
|
stream->writeInt(mBaseTexFormat, 32);
|
||||||
|
|
||||||
|
stream->writeFlag( mUpdateBasetex );
|
||||||
|
|
||||||
return retMask;
|
return retMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1268,6 +1273,8 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
||||||
stream->read( &mScreenError );
|
stream->read( &mScreenError );
|
||||||
|
|
||||||
mBaseTexFormat = (BaseTexFormat)stream->readInt(32);
|
mBaseTexFormat = (BaseTexFormat)stream->readInt(32);
|
||||||
|
|
||||||
|
mUpdateBasetex = stream->readFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainBlock::getMinMaxHeight( F32 *minHeight, F32 *maxHeight ) const
|
void TerrainBlock::getMinMaxHeight( F32 *minHeight, F32 *maxHeight ) const
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,9 @@ protected:
|
||||||
/// True if the zoning needs to be recalculated for the terrain.
|
/// True if the zoning needs to be recalculated for the terrain.
|
||||||
bool mZoningDirty;
|
bool mZoningDirty;
|
||||||
|
|
||||||
|
/// For disabling of Basetexture generation
|
||||||
|
bool mUpdateBasetex;
|
||||||
|
|
||||||
String _getBaseTexCacheFileName() const;
|
String _getBaseTexCacheFileName() const;
|
||||||
|
|
||||||
void _rebuildQuadtree();
|
void _rebuildQuadtree();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue