mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-04 03:55:12 +00:00
Converts all game, gui editor, and system classes to utilize assets
Processed core, tools and default modules to utilize assets Converted all console types that were string based, such as TypeImageFilename to utilize const char*/the string table, which avoids a lot of type swapping shenanigans and avoids string corruption Removed unneeded MainEditor mockup module Removed some unused/duplicate image assets from the tools
This commit is contained in:
parent
83b0432283
commit
5525f8ecdd
1708 changed files with 19619 additions and 4596 deletions
|
|
@ -978,8 +978,17 @@ void TerrainBlock::addMaterial( const String &name, U32 insertAt )
|
|||
{
|
||||
TerrainMaterial *mat = TerrainMaterial::findOrCreate( name );
|
||||
|
||||
StringTableEntry newMatName = StringTable->insert(name.c_str());
|
||||
|
||||
if ( insertAt == -1 )
|
||||
{
|
||||
//Check to ensure we're not trying to add one that already exists, as that'd be kinda dumb
|
||||
for (U32 i = 0; i < mFile->mMaterials.size(); i++)
|
||||
{
|
||||
if (mFile->mMaterials[i]->getInternalName() == newMatName)
|
||||
return;
|
||||
}
|
||||
|
||||
mFile->mMaterials.push_back( mat );
|
||||
mFile->_initMaterialInstMapping();
|
||||
|
||||
|
|
@ -1332,13 +1341,6 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
|||
if ( stream->writeFlag( mask & TransformMask ) )
|
||||
mathWrite( *stream, getTransform() );
|
||||
|
||||
if ( stream->writeFlag( mask & FileMask ) )
|
||||
{
|
||||
S32 idasdasdf = getId();
|
||||
stream->write(mCRC);
|
||||
stream->writeString( mTerrainAsset.getAssetId() );
|
||||
}
|
||||
|
||||
if ( stream->writeFlag( mask & SizeMask ) )
|
||||
stream->write( mSquareSize );
|
||||
|
||||
|
|
@ -1350,6 +1352,12 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
|||
stream->write( mLightMapSize );
|
||||
}
|
||||
|
||||
if ( stream->writeFlag( mask & FileMask ) )
|
||||
{
|
||||
stream->write(mCRC);
|
||||
stream->writeString( mTerrainAsset.getAssetId() );
|
||||
}
|
||||
|
||||
stream->writeFlag( mask & HeightMapChangeMask );
|
||||
|
||||
if ( stream->writeFlag( mask & MiscMask ) )
|
||||
|
|
@ -1374,20 +1382,13 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
|||
setTransform( mat );
|
||||
}
|
||||
|
||||
if ( stream->readFlag() ) // FileMask
|
||||
{
|
||||
stream->read(&mCRC);
|
||||
|
||||
char buffer[256];
|
||||
stream->readString(buffer);
|
||||
bool validAsset = setTerrainAsset(StringTable->insert(buffer));
|
||||
}
|
||||
|
||||
if ( stream->readFlag() ) // SizeMask
|
||||
stream->read( &mSquareSize );
|
||||
|
||||
mCastShadows = stream->readFlag();
|
||||
|
||||
bool baseTexSizeChanged = false;
|
||||
if ( stream->readFlag() ) // MaterialMask
|
||||
{
|
||||
U32 baseTexSize;
|
||||
|
|
@ -1395,8 +1396,7 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
|||
if ( mBaseTexSize != baseTexSize )
|
||||
{
|
||||
mBaseTexSize = baseTexSize;
|
||||
if ( isProperlyAdded() )
|
||||
_updateBaseTexture( NONE );
|
||||
baseTexSizeChanged = true;
|
||||
}
|
||||
|
||||
U32 lightMapSize;
|
||||
|
|
@ -1412,6 +1412,18 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
|||
}
|
||||
}
|
||||
|
||||
if (stream->readFlag()) // FileMask
|
||||
{
|
||||
stream->read(&mCRC);
|
||||
|
||||
char buffer[256];
|
||||
stream->readString(buffer);
|
||||
bool validAsset = setTerrainAsset(StringTable->insert(buffer));
|
||||
_updateBaseTexture(NONE);
|
||||
}
|
||||
if (baseTexSizeChanged && isProperlyAdded())
|
||||
_updateBaseTexture(NONE);
|
||||
|
||||
if ( stream->readFlag() && isProperlyAdded() ) // HeightMapChangeMask
|
||||
{
|
||||
_updateBounds();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue