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

@ -13,10 +13,10 @@ class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
typedef GuiInspectorTypeFileName Parent;
public:
GuiTextCtrl* mLabel;
GuiBitmapButtonCtrl* mPreviewBorderButton;
GuiBitmapCtrl* mPreviewImage;
GuiButtonCtrl* mEditButton;
GuiTextCtrl* mLabel = NULL;
GuiBitmapButtonCtrl* mPreviewBorderButton = NULL;
GuiBitmapCtrl* mPreviewImage = NULL;
GuiButtonCtrl* mEditButton = NULL;
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
static void consoleInit();

View file

@ -592,9 +592,6 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
// Animate the shape once.
shape->animate(0);
// So we don't have to change it everywhere.
const GFXFormat format = GFXFormatR8G8B8A8;
GBitmap* imposter = NULL;
GBitmap* imposterNrml = NULL;
@ -605,8 +602,6 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
MatrixF angMat;
S32 mip = 0;
PROFILE_START(ShapeAsset_generateCachedPreviewImage);
//dMemset(destBmp.getWritableBits(mip), 0, destBmp.getWidth(mip) * destBmp.getHeight(mip) * GFXFormat_getByteSize(format));

View file

@ -104,9 +104,6 @@ ConsoleSetType(TypeTerrainAssetId)
// Was a single argument specified?
if (argc == 1)
{
// Yes, so fetch field value.
const char* pFieldValue = argv[0];
*((const char**)dptr) = StringTable->insert(argv[0]);
return;

View file

@ -638,7 +638,7 @@ AssetImportObject* AssetImporter::addImportingAsset(String assetType, Torque::Pa
U32 pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}");
while (pos < dStrlen(sanitizedStr))
{
dStrcpy(sanitizedStr + pos, sanitizedStr + pos + 1, len - pos);
dStrcpy(sanitizedStr + pos, sanitizedStr + pos + 1, (dsize_t)(len - pos));
pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}");
}
@ -1903,7 +1903,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
//Check to see if our target module has a matching assetId for this slot already based on our trimmed mat name
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
bool localAssetFound = false;
localAssetFound = false;
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
localAssetFound = true;
@ -2792,7 +2792,7 @@ void AssetImporter::acquireAssets(AssetImportObject* assetItem)
if (AssetDatabase.isDeclaredAsset(assetId))
{
AssetBase* assetDef = AssetDatabase.acquireAsset<AssetBase>(assetId);
AssetDatabase.acquireAsset<AssetBase>(assetId);
AssetDatabase.releaseAsset(assetId);
}
}

View file

@ -1370,48 +1370,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
}
//Build the buffer for our default material
/*if (mVertCount > 0)
{
mVertexBuffer.set(GFX, mVertCount, GFXBufferTypeStatic);
VertexType *pVert = mVertexBuffer.lock();
for (S32 i = 0; i < faceList.size(); i++)
{
if (mSurfaceUVs[i].matID == -1)
{
const ConvexShape::Face &face = faceList[i];
const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[i % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent);
pVert++;
}
}
}
}
mVertexBuffer.unlock();
// Allocate PB
mPrimitiveBuffer.set(GFX, mPrimCount * 3, mPrimCount, GFXBufferTypeStatic);
U16 *pIndex;
mPrimitiveBuffer.lock(&pIndex);
for (U16 i = 0; i < mPrimCount * 3; i++)
{
*pIndex = i;
pIndex++;
}
mPrimitiveBuffer.unlock();
}*/
//
//
for (U32 i = 0; i < mSurfaceBuffers.size(); i++)
{
if (mSurfaceBuffers[i].mVertCount > 0)
@ -1428,7 +1386,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
const ConvexShape::Face &face = faceList[f];
const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[f % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent);
@ -1439,7 +1396,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
pVert->normal = face.normal;
pVert->T = face.tangent;
pVert->B = mCross(face.normal,face.tangent);
//pVert->color = faceColor;
pVert->point = pointList[facePntMap[triangles[j][k]]];
pVert->texCoord = face.texcoords[triangles[j][k]];
pVert->texCoord2 = pVert->texCoord;
@ -1469,56 +1425,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
mSurfaceBuffers[i].mPrimitiveBuffer.unlock();
}
}
//
//
/*// Allocate VB and copy in data.
for (S32 i = 0; i < faceList.size(); i++)
{
mVertexBuffer.set(GFX, mVertCount, GFXBufferTypeStatic);
VertexType *pVert = mVertexBuffer.lock();
for (S32 i = 0; i < faceList.size(); i++)
{
const ConvexShape::Face &face = faceList[i];
const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[i % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent);
for (S32 j = 0; j < triangles.size(); j++)
{
for (S32 k = 0; k < 3; k++)
{
pVert->normal = face.normal;
pVert->tangent = face.tangent;
pVert->color = faceColor;
pVert->point = pointList[facePntMap[triangles[j][k]]];
pVert->texCoord = face.texcoords[triangles[j][k]];
pVert++;
}
}
}
mVertexBuffer.unlock();
// Allocate PB
mPrimitiveBuffer.set(GFX, mPrimCount * 3, mPrimCount, GFXBufferTypeStatic);
U16 *pIndex;
mPrimitiveBuffer.lock(&pIndex);
for (U16 i = 0; i < mPrimCount * 3; i++)
{
*pIndex = i;
pIndex++;
}
mPrimitiveBuffer.unlock();
}*/
}
void ConvexShape::_updateCollision()

View file

@ -56,7 +56,7 @@
extern bool gEditingMission;
extern ColorI gCanvasClearColor;
bool ReflectionProbe::smRenderPreviewProbes = true;
static MatrixF sEditingTransformMat;
IMPLEMENT_CO_NETOBJECT_V1(ReflectionProbe);
ConsoleDocClass(ReflectionProbe,
@ -371,10 +371,10 @@ const MatrixF& ReflectionProbe::getTransform() const
return mObjToWorld;
else
{
MatrixF transformMat = MatrixF::Identity;
transformMat.setPosition(mProbeRefOffset);
sEditingTransformMat = MatrixF::Identity;
sEditingTransformMat.setPosition(mProbeRefOffset);
return transformMat;
return sEditingTransformMat;
}
}

View file

@ -112,7 +112,18 @@ public:
bool mCanDamp;
public:
ProbeInfo() : mScore(0) {}
ProbeInfo()
{
mScore = 0;
mAtten = 0.0f;
mCanDamp = false;
mDirty = false;
mIsEnabled = true;
mObject = NULL;
mPriority = 0;
mProbeShapeType = Box;
mRadius = 10.0f;
}
~ProbeInfo() {}
// Copies data passed in from light