Merge remote-tracking branch 'devhead/Preview4_0' into tsneo

# Conflicts:
#	Templates/BaseGame/game/data/ui/guis/loadingGui.gui
#	Templates/BaseGame/game/data/ui/guis/mainMenu.gui
#	Templates/BaseGame/game/tools/MainEditor/guis/MainEditorWindow.gui
#	Templates/BaseGame/game/tools/assetBrowser/guis/assetPreviewButtonsTemplate.gui
#	Templates/BaseGame/game/tools/forestEditor/brushes.tscript
This commit is contained in:
Jeff Hutchinson 2021-08-13 20:14:39 -04:00
commit 717c7acca9
2266 changed files with 48780 additions and 26034 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();