Terrain baseTex support multiple formats

DDS, PNG, JPG or NONE
This commit is contained in:
LukasPJ 2014-09-23 07:49:27 +02:00
parent f2a3a1e2a6
commit 431d8a9b66
3 changed files with 44 additions and 8 deletions

View file

@ -186,6 +186,7 @@ TerrainBlock::TerrainBlock()
mCell( NULL ),
mCRC( 0 ),
mBaseTexSize( 1024 ),
mBaseTexFormat( TerrainBlock::JPG ),
mBaseMaterial( NULL ),
mDefaultMatInst( NULL ),
mBaseTexScaleConst( NULL ),
@ -961,7 +962,7 @@ String TerrainBlock::_getBaseTexCacheFileName() const
{
Torque::Path basePath( mTerrFileName );
basePath.setFileName( basePath.getFileName() + "_basetex" );
basePath.setExtension( "dds" );
basePath.setExtension( formatToExtension(mBaseTexFormat) );
return basePath.getFullPath();
}
@ -1200,7 +1201,7 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
{
mBaseTexSize = baseTexSize;
if ( isProperlyAdded() )
_updateBaseTexture( false );
_updateBaseTexture( NONE );
}
U32 lightMapSize;