mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
extra option for terrain block to disable the update of the basetexture
This commit is contained in:
parent
76c5e30869
commit
f87dde254d
1 changed files with 10 additions and 3 deletions
|
|
@ -202,7 +202,8 @@ TerrainBlock::TerrainBlock()
|
||||||
mPhysicsRep( NULL ),
|
mPhysicsRep( NULL ),
|
||||||
mScreenError( 16 ),
|
mScreenError( 16 ),
|
||||||
mCastShadows( true ),
|
mCastShadows( true ),
|
||||||
mZoningDirty( false )
|
mZoningDirty( false ),
|
||||||
|
mUpdateBasetex ( true )
|
||||||
{
|
{
|
||||||
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
||||||
mNetFlags.set(Ghostable | ScopeAlways);
|
mNetFlags.set(Ghostable | ScopeAlways);
|
||||||
|
|
@ -304,7 +305,7 @@ bool TerrainBlock::_setBaseTexFormat(void *obj, const char *index, const char *d
|
||||||
// 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 = terrain->_getBaseTexCacheFileName();
|
String baseCachePath = terrain->_getBaseTexCacheFileName();
|
||||||
if (Platform::compareModifiedTimes(baseCachePath, terrain->mTerrainAsset->getTerrainFilePath()) < 0)
|
if (Platform::compareModifiedTimes(baseCachePath, terrain->mTerrainAsset->getTerrainFilePath()) < 0 && mUpdateBasetex)
|
||||||
terrain->_updateBaseTexture(true);
|
terrain->_updateBaseTexture(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -409,7 +410,7 @@ void TerrainBlock::setFile(const Resource<TerrainFile>& terr)
|
||||||
// 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, mTerrainAsset->getTerrainFilePath()) < 0)
|
if (Platform::compareModifiedTimes(baseCachePath, mTerrainAsset->getTerrainFilePath()) < 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.
|
||||||
|
|
@ -1285,6 +1286,8 @@ void TerrainBlock::initPersistFields()
|
||||||
"Light map dimensions in pixels." );
|
"Light map dimensions in pixels." );
|
||||||
|
|
||||||
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" );
|
||||||
|
|
||||||
|
|
@ -1342,6 +1345,8 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
||||||
stream->write( mScreenError );
|
stream->write( mScreenError );
|
||||||
|
|
||||||
stream->writeInt(mBaseTexFormat, 32);
|
stream->writeInt(mBaseTexFormat, 32);
|
||||||
|
|
||||||
|
stream->writeFlag(mUpdateBasetex);
|
||||||
stream->writeFlag(mIgnoreZodiacs);
|
stream->writeFlag(mIgnoreZodiacs);
|
||||||
|
|
||||||
return retMask;
|
return retMask;
|
||||||
|
|
@ -1409,6 +1414,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();
|
||||||
mIgnoreZodiacs = stream->readFlag();
|
mIgnoreZodiacs = stream->readFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue