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:
Areloch 2021-07-19 01:07:08 -05:00
parent 83b0432283
commit 5525f8ecdd
1708 changed files with 19619 additions and 4596 deletions

View file

@ -259,6 +259,12 @@ WaterObject::WaterObject()
mMatrixSet = reinterpret_cast<MatrixSet *>(dMalloc_aligned(sizeof(MatrixSet), 16));
constructInPlace(mMatrixSet);
INIT_IMAGEASSET(RippleTex);
INIT_IMAGEASSET(FoamTex);
INIT_IMAGEASSET(DepthGradientTex);
mCubemapName = StringTable->EmptyString();
}
WaterObject::~WaterObject()
@ -292,8 +298,8 @@ void WaterObject::initPersistFields()
addField( "overallWaveMagnitude", TypeF32, Offset( mOverallWaveMagnitude, WaterObject ), "Master variable affecting entire body"
" of water's undulation" );
addField( "rippleTex", TypeImageFilename, Offset( mRippleTexName, WaterObject ), "Normal map used to simulate small surface ripples" );
INITPERSISTFIELD_IMAGEASSET(RippleTex, WaterObject, "Normal map used to simulate small surface ripples");
addArray( "Ripples (texture animation)", MAX_WAVES );
@ -307,7 +313,7 @@ void WaterObject::initPersistFields()
addField( "overallRippleMagnitude", TypeF32, Offset( mOverallRippleMagnitude, WaterObject ), "Master variable affecting entire surface");
addField( "foamTex", TypeImageFilename, Offset( mFoamTexName, WaterObject ), "Diffuse texture for foam in shallow water (advanced lighting only)" );
INITPERSISTFIELD_IMAGEASSET(FoamTex, WaterObject, "Diffuse texture for foam in shallow water (advanced lighting only)");
addArray( "Foam", MAX_FOAM );
@ -358,8 +364,9 @@ void WaterObject::initPersistFields()
endGroup( "Underwater Fogging" );
addGroup( "Misc" );
addField( "depthGradientTex", TypeImageFilename, Offset( mDepthGradientTexName, WaterObject ), "1D texture defining the base water color by depth" );
INITPERSISTFIELD_IMAGEASSET(DepthGradientTex, WaterObject, "1D texture defining the base water color by depth");
addField( "depthGradientMax", TypeF32, Offset( mDepthGradientMax, WaterObject ), "Depth in world units, the max range of the color gradient texture." );
endGroup( "Misc" );
@ -539,10 +546,11 @@ U32 WaterObject::packUpdate( NetConnection * conn, U32 mask, BitStream *stream )
if ( stream->writeFlag( mask & TextureMask ) )
{
stream->write( mRippleTexName );
stream->write( mDepthGradientTexName );
stream->write( mFoamTexName );
stream->write( mCubemapName );
PACK_IMAGEASSET(conn, RippleTex);
PACK_IMAGEASSET(conn, DepthGradientTex);
PACK_IMAGEASSET(conn, FoamTex);
stream->writeString( mCubemapName );
}
if( stream->writeFlag( mask & SoundMask ) )
@ -660,10 +668,11 @@ void WaterObject::unpackUpdate( NetConnection * conn, BitStream *stream )
// TextureMask
if ( stream->readFlag() )
{
stream->read( &mRippleTexName );
stream->read( &mDepthGradientTexName );
stream->read( &mFoamTexName );
stream->read( &mCubemapName );
UNPACK_IMAGEASSET(conn, RippleTex);
UNPACK_IMAGEASSET(conn, DepthGradientTex);
UNPACK_IMAGEASSET(conn, FoamTex);
mCubemapName = stream->readSTString();
if ( isProperlyAdded() )
initTextures();
@ -1161,25 +1170,10 @@ bool WaterObject::initMaterial( S32 idx )
void WaterObject::initTextures()
{
if ( mRippleTexName.isNotEmpty() )
mRippleTex.set( mRippleTexName, &GFXStaticTextureProfile, "WaterObject::mRippleTex" );
if ( mRippleTex.isNull() )
mRippleTex.set( GFXTextureManager::getWarningTexturePath(), &GFXStaticTextureProfile, "WaterObject::mRippleTex" );
if ( mDepthGradientTexName.isNotEmpty() )
mDepthGradientTex.set( mDepthGradientTexName, &GFXStaticTextureSRGBProfile, "WaterObject::mDepthGradientTex" );
if ( mDepthGradientTex.isNull() )
mDepthGradientTex.set( GFXTextureManager::getWarningTexturePath(), &GFXStaticTextureSRGBProfile, "WaterObject::mDepthGradientTex" );
if ( mNamedDepthGradTex.isRegistered() )
mNamedDepthGradTex.setTexture( mDepthGradientTex );
if ( mFoamTexName.isNotEmpty() )
mFoamTex.set( mFoamTexName, &GFXStaticTextureSRGBProfile, "WaterObject::mFoamTex" );
if ( mFoamTex.isNull() )
mFoamTex.set( GFXTextureManager::getWarningTexturePath(), &GFXStaticTextureSRGBProfile, "WaterObject::mFoamTex" );
if ( mCubemapName.isNotEmpty() )
if ( mCubemapName != StringTable->EmptyString() )
Sim::findObject( mCubemapName, mCubemap );
if ( mCubemap )
mCubemap->createMap();