uninitialized and unused value cleanups

(cherry picked from commit 1f08602cf0ad84409cd8b3520510f9c6ce7d5f9c)
This commit is contained in:
AzaezelX 2023-05-01 10:37:44 -05:00
parent 1230d0d280
commit 0d4221fa59
38 changed files with 176 additions and 360 deletions

View file

@ -347,8 +347,6 @@ void TerrainBaseMapFeatGLSL::processPix( Vector<ShaderComponent*> &componentLis
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
output = meta;
Var* viewToTangent = getInViewToTangent(componentList);
}
ShaderFeature::Resources TerrainBaseMapFeatGLSL::getResources( const MaterialFeatureData &fd )
@ -544,9 +542,6 @@ void TerrainDetailMapFeatGLSL::processPix( Vector<ShaderComponent*> &component
// Get the detail id.
Var *detailInfo = _getDetailIdStrengthParallax();
// This is done here to make sure the macro arrays are the correct size
Var* macroInfo = _getMacroIdStrengthParallax();
// Create the detail blend var.
Var *detailBlend = new Var;
detailBlend->setType( "float" );
@ -1324,7 +1319,6 @@ void TerrainHeightMapBlendGLSL::processPix(Vector<ShaderComponent*>& componentLi
{
for (S32 idx = 0; idx < detailCount; ++idx)
{
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx));
if (!blendHardness)

View file

@ -624,7 +624,7 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
Var *detailInfo = _getDetailIdStrengthParallax();
// Done here to keep array indexes aligned
Var* macroInfo = _getMacroIdStrengthParallax();
_getMacroIdStrengthParallax();
// Create the detail blend var.
Var *detailBlend = new Var;
@ -1414,7 +1414,6 @@ void TerrainHeightMapBlendHLSL::processPix(Vector<ShaderComponent*>& componentLi
{
for (S32 idx = 0; idx < detailCount; ++idx)
{
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx));
if (!blendHardness)

View file

@ -1172,7 +1172,7 @@ void TerrainBlock::_updatePhysics()
SAFE_DELETE( mPhysicsRep );
PhysicsCollision *colShape;
PhysicsCollision *colShape = NULL;
// If we can steal the collision shape from the local server
// object then do so as it saves us alot of cpu time and memory.
@ -1187,22 +1187,31 @@ void TerrainBlock::_updatePhysics()
}
else
{
// Get empty state of each vert
bool *holes = new bool[ getBlockSize() * getBlockSize() ];
for ( U32 row = 0; row < getBlockSize(); row++ )
for ( U32 column = 0; column < getBlockSize(); column++ )
holes[ row + (column * getBlockSize()) ] = mFile->isEmptyAt( row, column );
if (getBlockSize() > 0)
{
// Get empty state of each vert
bool* holes = new bool[getBlockSize() * getBlockSize()];
for (U32 row = 0; row < getBlockSize(); row++)
for (U32 column = 0; column < getBlockSize(); column++)
holes[row + (column * getBlockSize())] = mFile->isEmptyAt(row, column);
colShape = PHYSICSMGR->createCollision();
colShape->addHeightfield( mFile->getHeightMap().address(), holes, getBlockSize(), mSquareSize, MatrixF::Identity );
colShape = PHYSICSMGR->createCollision();
colShape->addHeightfield(mFile->getHeightMap().address(), holes, getBlockSize(), mSquareSize, MatrixF::Identity);
delete [] holes;
delete[] holes;
}
}
if (getBlockSize() > 0)
{
PhysicsWorld* world = PHYSICSMGR->getWorld(isServerObject() ? "server" : "client");
mPhysicsRep = PHYSICSMGR->createBody();
mPhysicsRep->init(colShape, 0, 0, this, world);
mPhysicsRep->setTransform(getTransform());
}
else
{
SAFE_DELETE(mPhysicsRep);
}
PhysicsWorld *world = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );
mPhysicsRep = PHYSICSMGR->createBody();
mPhysicsRep->init( colShape, 0, 0, this, world );
mPhysicsRep->setTransform( getTransform() );
}
void TerrainBlock::onRemove()
@ -1470,7 +1479,6 @@ bool TerrainBlock::renameTerrainMaterial(StringTableEntry oldMatName, StringTabl
{
if (mFile->mMaterials[i]->getInternalName() == oldMatName)
{
TerrainMaterial* oldMat = mFile->mMaterials[i];
mFile->mMaterials[i] = newMat;
}
}