Browse Source

uninitialized and unused value cleanups

(cherry picked from commit 1f08602cf0ad84409cd8b3520510f9c6ce7d5f9c)
AzaezelX 2 years ago
parent
commit
0d4221fa59
38 changed files with 179 additions and 363 deletions
  1. 4 4
      Engine/source/T3D/assets/ImageAssetInspectors.h
  2. 0 5
      Engine/source/T3D/assets/ShapeAsset.cpp
  3. 0 3
      Engine/source/T3D/assets/TerrainAsset.cpp
  4. 3 3
      Engine/source/T3D/assets/assetImporter.cpp
  5. 0 94
      Engine/source/T3D/convexShape.cpp
  6. 4 4
      Engine/source/T3D/lighting/reflectionProbe.cpp
  7. 12 1
      Engine/source/T3D/lighting/reflectionProbe.h
  8. 1 1
      Engine/source/core/util/tSignal.h
  9. 5 1
      Engine/source/core/util/uuid.h
  10. 3 3
      Engine/source/environment/meshRoad.cpp
  11. 1 1
      Engine/source/environment/skySphere.cpp
  12. 4 3
      Engine/source/environment/skySphere.h
  13. 1 1
      Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp
  14. 0 3
      Engine/source/gfx/gl/gfxGLCubemap.cpp
  15. 43 105
      Engine/source/gui/controls/guiGameSettingsCtrl.cpp
  16. 2 2
      Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp
  17. 2 2
      Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp
  18. 23 5
      Engine/source/materials/sceneData.h
  19. 1 1
      Engine/source/platform/threads/threadSafeRefCount.h
  20. 1 1
      Engine/source/platformWin32/winCPUInfo.cpp
  21. 2 2
      Engine/source/sfx/openal/sfxALDevice.cpp
  22. 2 3
      Engine/source/sfx/openal/sfxALProvider.cpp
  23. 2 2
      Engine/source/sfx/sfxProvider.h
  24. 0 1
      Engine/source/sfx/sfxSystem.cpp
  25. 1 1
      Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp
  26. 2 21
      Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp
  27. 1 1
      Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp
  28. 0 24
      Engine/source/shaderGen/HLSL/debugVizFeatureHLSL.cpp
  29. 5 20
      Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp
  30. 2 2
      Engine/source/shaderGen/shaderFeature.h
  31. 0 6
      Engine/source/terrain/glsl/terrFeatureGLSL.cpp
  32. 1 2
      Engine/source/terrain/hlsl/terrFeatureHLSL.cpp
  33. 23 15
      Engine/source/terrain/terrData.cpp
  34. 1 2
      Engine/source/ts/tsLastDetail.cpp
  35. 0 2
      Engine/source/ts/tsShapeInstance.cpp
  36. 22 11
      Engine/source/ts/tsShapeInstance.h
  37. 1 1
      Engine/source/windowManager/platformWindow.h
  38. 4 4
      Engine/source/windowManager/windowInputGenerator.h

+ 4 - 4
Engine/source/T3D/assets/ImageAssetInspectors.h

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

+ 0 - 5
Engine/source/T3D/assets/ShapeAsset.cpp

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

+ 0 - 3
Engine/source/T3D/assets/TerrainAsset.cpp

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

+ 3 - 3
Engine/source/T3D/assets/assetImporter.cpp

@@ -638,7 +638,7 @@ AssetImportObject* AssetImporter::addImportingAsset(String assetType, Torque::Pa
    U32 pos = dStrcspn(sanitizedStr, "-+*/%$&�=()[].?\\\"#,;!~<>|�^{}");
    U32 pos = dStrcspn(sanitizedStr, "-+*/%$&�=()[].?\\\"#,;!~<>|�^{}");
    while (pos < dStrlen(sanitizedStr))
    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, "-+*/%$&�=()[].?\\\"#,;!~<>|�^{}");
       pos = dStrcspn(sanitizedStr, "-+*/%$&�=()[].?\\\"#,;!~<>|�^{}");
    }
    }
 
 
@@ -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
                         //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");
                         testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
-                        bool localAssetFound = false;
+                        localAssetFound = false;
 
 
                         if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
                         if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
                            localAssetFound = true;
                            localAssetFound = true;
@@ -2792,7 +2792,7 @@ void AssetImporter::acquireAssets(AssetImportObject* assetItem)
 
 
       if (AssetDatabase.isDeclaredAsset(assetId))
       if (AssetDatabase.isDeclaredAsset(assetId))
       {
       {
-         AssetBase* assetDef = AssetDatabase.acquireAsset<AssetBase>(assetId);
+         AssetDatabase.acquireAsset<AssetBase>(assetId);
          AssetDatabase.releaseAsset(assetId);
          AssetDatabase.releaseAsset(assetId);
       }
       }
    }
    }

+ 0 - 94
Engine/source/T3D/convexShape.cpp

@@ -1370,48 +1370,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
 	}
 	}
 
 
    //Build the buffer for our default material
    //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++)
    for (U32 i = 0; i < mSurfaceBuffers.size(); i++)
    {
    {
       if (mSurfaceBuffers[i].mVertCount > 0)
       if (mSurfaceBuffers[i].mVertCount > 0)
@@ -1428,7 +1386,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
                const ConvexShape::Face &face = faceList[f];
                const ConvexShape::Face &face = faceList[f];
                const Vector< U32 > &facePntMap = face.points;
                const Vector< U32 > &facePntMap = face.points;
                const Vector< ConvexShape::Triangle > &triangles = face.triangles;
                const Vector< ConvexShape::Triangle > &triangles = face.triangles;
-               const ColorI &faceColor = sgConvexFaceColors[f % sgConvexFaceColorCount];
 
 
                const Point3F binormal = mCross(face.normal, face.tangent);
                const Point3F binormal = mCross(face.normal, face.tangent);
 
 
@@ -1439,7 +1396,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
                      pVert->normal = face.normal;
                      pVert->normal = face.normal;
                      pVert->T = face.tangent;
                      pVert->T = face.tangent;
                      pVert->B = mCross(face.normal,face.tangent);
                      pVert->B = mCross(face.normal,face.tangent);
-                     //pVert->color = faceColor;
                      pVert->point = pointList[facePntMap[triangles[j][k]]];
                      pVert->point = pointList[facePntMap[triangles[j][k]]];
                      pVert->texCoord = face.texcoords[triangles[j][k]];
                      pVert->texCoord = face.texcoords[triangles[j][k]];
                      pVert->texCoord2 = pVert->texCoord;
                      pVert->texCoord2 = pVert->texCoord;
@@ -1469,56 +1425,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
          mSurfaceBuffers[i].mPrimitiveBuffer.unlock();
          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()
 void ConvexShape::_updateCollision()

+ 4 - 4
Engine/source/T3D/lighting/reflectionProbe.cpp

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

+ 12 - 1
Engine/source/T3D/lighting/reflectionProbe.h

@@ -112,7 +112,18 @@ public:
       bool mCanDamp;
       bool mCanDamp;
    public:
    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() {}
       ~ProbeInfo() {}
 
 
       // Copies data passed in from light
       // Copies data passed in from light

+ 1 - 1
Engine/source/core/util/tSignal.h

@@ -202,7 +202,7 @@ public:
 
 
    void remove( DelegateSig dlg )
    void remove( DelegateSig dlg )
    {
    {
-      for( DelegateLink* ptr = mList.next;ptr != &mList; ptr = ptr->next )
+      for( DelegateLink* ptr = mList.next;(ptr != &mList)&& (ptr!= NULL); ptr = ptr->next )
       {
       {
          if( DelegateLinkImpl* del = static_cast< DelegateLinkImpl* >( ptr ) )
          if( DelegateLinkImpl* del = static_cast< DelegateLinkImpl* >( ptr ) )
          {
          {

+ 5 - 1
Engine/source/core/util/uuid.h

@@ -70,7 +70,11 @@ namespace Torque
       
       
          UUID()
          UUID()
          {
          {
-            dMemset( this, 0, sizeof( UUID ) );
+            a = b = c = d = e = 0;
+            for (U32 i = 0; i < 6; i++)
+            {
+               f [i]=0;
+            }
          }
          }
          
          
          ///
          ///

+ 3 - 3
Engine/source/environment/meshRoad.cpp

@@ -2452,9 +2452,9 @@ void MeshRoad::_generateSlices()
       profileMat2.setRow(1, slicePtr->uvec);
       profileMat2.setRow(1, slicePtr->uvec);
       profileMat2.setRow(2, slicePtr->fvec);
       profileMat2.setRow(2, slicePtr->fvec);
 
 
-      for(U32 i = 0; i < 2; i++)
+      for(U32 profile = 0; profile < 2; profile++)
       {
       {
-         if(i)
+         if(profile)
             mSideProfile.setTransform(profileMat2, slicePtr->p0);
             mSideProfile.setTransform(profileMat2, slicePtr->p0);
          else
          else
             mSideProfile.setTransform(profileMat1, slicePtr->p2);
             mSideProfile.setTransform(profileMat1, slicePtr->p2);
@@ -2470,7 +2470,7 @@ void MeshRoad::_generateSlices()
             slicePtr->verts.push_back(pos);
             slicePtr->verts.push_back(pos);
             box.extend( pos );
             box.extend( pos );
 
 
-            if(i)
+            if(profile)
                slicePtr->pb0 = pos;
                slicePtr->pb0 = pos;
             else
             else
                slicePtr->pb2 = pos;
                slicePtr->pb2 = pos;

+ 1 - 1
Engine/source/environment/skySphere.cpp

@@ -319,7 +319,7 @@ void SkySphere::_initRender()
    U32 height = 16;
    U32 height = 16;
    U32 radius = 1;
    U32 radius = 1;
 
 
-   F32 x, y, z, xy;                              // vertex position
+   F32 x, y;                              // vertex position
    F32 nx, ny, nz, lengthInv = 1.0f / radius;       // normal
    F32 nx, ny, nz, lengthInv = 1.0f / radius;       // normal
    F32 s, t;                                     // texCoord
    F32 s, t;                                     // texCoord
 
 

+ 4 - 3
Engine/source/environment/skySphere.h

@@ -107,7 +107,8 @@ public:
    {
    {
       Point3F pos;
       Point3F pos;
       Point3F nor;
       Point3F nor;
-      F32 s, t;
+      F32 s = 0.0f;
+      F32 t = 0.0f;
    };
    };
 
 
    Vector<SphereVertex> tmpVertices;
    Vector<SphereVertex> tmpVertices;
@@ -119,8 +120,8 @@ public:
    {
    {
       Point3F pos;
       Point3F pos;
       Point3F nor;
       Point3F nor;
-      F32 s;
-      F32 t;
+      F32 s = 0.0f;
+      F32 t = 0.0f;
    };
    };
 
 
    Vector<FinalVertexData> finalVertData;
    Vector<FinalVertexData> finalVertData;

+ 1 - 1
Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp

@@ -150,7 +150,7 @@ static bool sReadJPG(Stream &stream, GBitmap *bitmap)
    U8* pBase = (U8*)bitmap->getBits();
    U8* pBase = (U8*)bitmap->getBits();
    for (U32 i = 0; i < bitmap->getHeight(); i++)
    for (U32 i = 0; i < bitmap->getHeight(); i++)
    {
    {
-      JSAMPROW rowPointer = pBase + (i * rowBytes);
+      JSAMPROW rowPointer = pBase + (U64)(i * rowBytes);
       jpeg_read_scanlines(&cinfo, &rowPointer, 1);
       jpeg_read_scanlines(&cinfo, &rowPointer, 1);
    }
    }
 
 

+ 0 - 3
Engine/source/gfx/gl/gfxGLCubemap.cpp

@@ -357,7 +357,6 @@ void GFXGLCubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCount)
             const U32 mipSize = getMax(U32(1), mSize >> currentMip);
             const U32 mipSize = getMax(U32(1), mSize >> currentMip);
             if (isCompressed)
             if (isCompressed)
             {
             {
-               const U32 mipDataSize = getCompressedSurfaceSize(mFormat, mSize, mSize, currentMip);
                glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, i * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
                glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, i * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
             }
             }
             else
             else
@@ -378,7 +377,6 @@ void GFXGLCubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSize,
    setCubeTexSize(cubemapFaceSize);
    setCubeTexSize(cubemapFaceSize);
    mFormat = format;
    mFormat = format;
    mNumCubemaps = cubemapCount;
    mNumCubemaps = cubemapCount;
-   const bool isCompressed = ImageUtil::isCompressedFormat(mFormat);
 
 
    glGenTextures(1, &mCubemap);
    glGenTextures(1, &mCubemap);
    PRESERVE_CUBEMAP_ARRAY_TEXTURE();
    PRESERVE_CUBEMAP_ARRAY_TEXTURE();
@@ -416,7 +414,6 @@ void GFXGLCubemapArray::updateTexture(const GFXCubemapHandle &cubemap, const U32
          const U32 mipSize = getMax(U32(1), mSize >> currentMip);
          const U32 mipSize = getMax(U32(1), mSize >> currentMip);
          if (isCompressed)
          if (isCompressed)
          {
          {
-            const U32 mipDataSize = getCompressedSurfaceSize(mFormat, mSize, mSize, currentMip);
             glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, slot * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
             glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, slot * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
          }
          }
          else
          else

+ 43 - 105
Engine/source/gui/controls/guiGameSettingsCtrl.cpp

@@ -118,7 +118,6 @@ void GuiGameSettingsCtrl::onRender(Point2I offset, const RectI &updateRect)
    Point2I iconExtent, iconOffset(0.0f, 0.0f);
    Point2I iconExtent, iconOffset(0.0f, 0.0f);
 
 
    bool highlight = mHighlighted;
    bool highlight = mHighlighted;
-   bool depressed = mDepressed;
 
 
    ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA;
    ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA;
    ColorI fillColor = mActive ? (highlight ? mProfile->mFillColorHL : mProfile->mFillColor) : mProfile->mFillColorNA;
    ColorI fillColor = mActive ? (highlight ? mProfile->mFillColorHL : mProfile->mFillColor) : mProfile->mFillColorNA;
@@ -182,52 +181,51 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset)
    bool hasOptions = (mOptions.size() > 0) && mSelectedOption > -1;
    bool hasOptions = (mOptions.size() > 0) && mSelectedOption > -1;
    if (hasOptions)
    if (hasOptions)
    {
    {
-      if (mPreviousBitmapAsset.notNull())
-      {
-         // render the left arrow
-         bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-         arrowOffset.x = currentOffset.x + mColumnSplit;
-         arrowOffset.y = currentOffset.y + arrowOffsetY;
-
-         drawer->clearBitmapModulation();
-         drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
-      }
-      else
-      {
-         // render the left arrow
-         bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-         arrowOffset.x = currentOffset.x + mColumnSplit;
-         arrowOffset.y = currentOffset.y + height/2;
-
-         drawer->clearBitmapModulation();
-
-         drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE);
-         drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
-      }
-
-      if (mNextBitmapAsset.notNull())
+      // do we render the left or right arrows?
+      bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
+      bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
+      if (arrowOnL)
       {
       {
-         // render the right arrow
-         bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
-         arrowOffset.x = currentOffset.x + getWidth() - mRightPad - mArrowSize;
-         arrowOffset.y = currentOffset.y + arrowOffsetY;
-
-         drawer->clearBitmapModulation();
-         drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
+         if (mPreviousBitmapAsset.notNull())
+         {
+            arrowOffset.x = currentOffset.x + mColumnSplit;
+            arrowOffset.y = currentOffset.y + arrowOffsetY;
+
+            drawer->clearBitmapModulation();
+            drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
+         }
+         else
+         {
+            arrowOffset.x = currentOffset.x + mColumnSplit;
+            arrowOffset.y = currentOffset.y + height / 2;
+
+            drawer->clearBitmapModulation();
+
+            drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE);
+            drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
+         }
       }
       }
-      else
+      if (arrowOnR)
       {
       {
-         // render the left arrow
-         bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-         arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
-         arrowOffset.y = currentOffset.y + height / 2;
-
-         drawer->clearBitmapModulation();
-
-         drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
-         drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
+         if (mNextBitmapAsset.notNull())
+         {
+            arrowOffset.x = currentOffset.x + getWidth() - mRightPad - mArrowSize;
+            arrowOffset.y = currentOffset.y + arrowOffsetY;
+
+            drawer->clearBitmapModulation();
+            drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
+         }
+         else
+         {
+            arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
+            arrowOffset.y = currentOffset.y + height / 2;
+
+            drawer->clearBitmapModulation();
+
+            drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
+            drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
+         }
       }
       }
-
       // get the appropriate font color
       // get the appropriate font color
       ColorI fontColor;
       ColorI fontColor;
       if (!mEnabled)
       if (!mEnabled)
@@ -265,65 +263,13 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset)
 
 
 void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
 void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
 {
 {
-   F32 xScale = (float)getWidth();
-
    S32 height = getHeight();
    S32 height = getHeight();
 
 
-   S32 arrowOffsetY = 0;
-
    GFXDrawUtil* drawer = GFX->getDrawUtil();
    GFXDrawUtil* drawer = GFX->getDrawUtil();
 
 
-   Point2I arrowOffset;
+   //Point2I arrowOffset;
    S32 columnSplit = mColumnSplit;
    S32 columnSplit = mColumnSplit;
 
 
-   
-
-   /*if (mPreviousBitmapAsset.notNull())
-   {
-      // render the left arrow
-      bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-      arrowOffset.x = currentOffset.x + columnSplit;
-      arrowOffset.y = currentOffset.y + arrowOffsetY;
-
-      drawer->clearBitmapModulation();
-      drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
-   }
-   else
-   {
-      // render the left arrow
-      bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-      arrowOffset.x = currentOffset.x + mColumnSplit;
-      arrowOffset.y = currentOffset.y + height / 2;
-
-      drawer->clearBitmapModulation();
-
-      drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE);
-      drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
-   }
-
-   if (mNextBitmapAsset.notNull())
-   {
-      // render the right arrow
-      bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
-      arrowOffset.x = currentOffset.x + mRightPad * xScale - mArrowSize;
-      arrowOffset.y = currentOffset.y + arrowOffsetY;
-
-      drawer->clearBitmapModulation();
-      drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
-   }
-   else
-   {
-      // render the left arrow
-      bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
-      arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
-      arrowOffset.y = currentOffset.y + height / 2;
-
-      drawer->clearBitmapModulation();
-
-      drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
-      drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
-   }*/
-
    //Draw the slider bar
    //Draw the slider bar
 
 
    RectI sliderRect;
    RectI sliderRect;
@@ -389,13 +335,10 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
       fontColor = mProfile->mFontColor;
       fontColor = mProfile->mFontColor;
    }
    }
 
 
-   // calculate text to be at the center between the arrows
-   GFont* font = mProfile->mFont;
-
    char stringVal[32];
    char stringVal[32];
    dSprintf(stringVal, 32, "%.1f", mValue);
    dSprintf(stringVal, 32, "%.1f", mValue);
 
 
-   S32 stringWidth = font->getStrWidth(stringVal);
+   //S32 stringWidth = font->getStrWidth(stringVal); //adaptive width
    Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0);
    Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0);
 
 
    // render the option text itself
    // render the option text itself
@@ -413,7 +356,6 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
 
 
 void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset)
 void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset)
 {
 {
-   F32 xScale = (float)getWidth();
    S32 columnSplit = mColumnSplit;
    S32 columnSplit = mColumnSplit;
 
 
    S32 height = getHeight();
    S32 height = getHeight();
@@ -696,8 +638,6 @@ void GuiGameSettingsCtrl::addOption(const char* displayText, const char* keyText
 
 
 void GuiGameSettingsCtrl::clickOption(S32 xPos)
 void GuiGameSettingsCtrl::clickOption(S32 xPos)
 {
 {
-   F32 xScale = (float)getWidth();
-
    S32 leftArrowX1 = mColumnSplit;
    S32 leftArrowX1 = mColumnSplit;
    S32 leftArrowX2 = leftArrowX1 + mArrowSize;
    S32 leftArrowX2 = leftArrowX1 + mArrowSize;
 
 
@@ -814,8 +754,6 @@ void GuiGameSettingsCtrl::clickSlider(S32 xPos)
 
 
 void GuiGameSettingsCtrl::clickKeybind(S32 xPos)
 void GuiGameSettingsCtrl::clickKeybind(S32 xPos)
 {
 {
-   S32 columnSplit = mColumnSplit;
-
    S32 height = getHeight();
    S32 height = getHeight();
    S32 width = getWidth();
    S32 width = getWidth();
 
 

+ 2 - 2
Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp

@@ -573,8 +573,8 @@ void DeferredSubSurfaceGLSL::processPix(  Vector<ShaderComponent*> &componentLis
    subSurfaceParams->uniform = true;
    subSurfaceParams->uniform = true;
    subSurfaceParams->constSortPos = cspPotentialPrimitive;
    subSurfaceParams->constSortPos = cspPotentialPrimitive;
 
 
-   Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
-   Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
+   //Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
+   //Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
 
 
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
    Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
    Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));

+ 2 - 2
Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp

@@ -613,8 +613,8 @@ void DeferredSubSurfaceHLSL::processPix(  Vector<ShaderComponent*> &componentLis
    subSurfaceParams->uniform = true;
    subSurfaceParams->uniform = true;
    subSurfaceParams->constSortPos = cspPotentialPrimitive;
    subSurfaceParams->constSortPos = cspPotentialPrimitive;
 
 
-   Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
-   Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
+   //Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
+   //Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
 
 
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
    Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
    Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));

+ 23 - 5
Engine/source/materials/sceneData.h

@@ -56,7 +56,10 @@ struct SceneData
       /// @afxRenderHighlightMgr  
       /// @afxRenderHighlightMgr  
       HighlightBin,
       HighlightBin,
    };
    };
-
+   enum
+   {
+      MAX_LIGHTS = 8
+   };
    /// This defines when we're rendering a special bin 
    /// This defines when we're rendering a special bin 
    /// type that the material or lighting system needs
    /// type that the material or lighting system needs
    /// to know about.
    /// to know about.
@@ -71,7 +74,7 @@ struct SceneData
    
    
    /// The current lights to use in rendering
    /// The current lights to use in rendering
    /// in order of the light importance.
    /// in order of the light importance.
-   LightInfo* lights[8];
+   LightInfo* lights[MAX_LIGHTS];
 
 
    ///
    ///
    LinearColorF ambientLightColor;
    LinearColorF ambientLightColor;
@@ -98,9 +101,24 @@ struct SceneData
    Vector<CustomShaderBindingData*> customShaderData;
    Vector<CustomShaderBindingData*> customShaderData;
 
 
    /// Constructor.
    /// Constructor.
-   SceneData() 
-   { 
-      dMemset( this, 0, sizeof( SceneData ) );
+   SceneData()
+   {
+      accuTex = NULL;
+      backBuffTex = NULL;
+      binType = RegularBin;
+      cubemap = NULL;
+      fogDensity = 0.0f;
+      fogDensityOffset = 0.0f;
+      fogHeightFalloff = 0.0f;
+      lightmap = NULL;
+      for (U32 i = 0; i < MAX_LIGHTS; i++)
+      {
+         lights[i] = NULL;
+      }
+      materialHint = NULL;
+      miscTex = NULL;
+      reflectTex = NULL;
+      wireframe = false;
       objTrans = &MatrixF::Identity;
       objTrans = &MatrixF::Identity;
       visibility = 1.0f;
       visibility = 1.0f;
    }
    }

+ 1 - 1
Engine/source/platform/threads/threadSafeRefCount.h

@@ -61,7 +61,7 @@ class ThreadSafeRefCount
 
 
       ThreadSafeRefCount()
       ThreadSafeRefCount()
          : mRefCount( 0 ) {}
          : mRefCount( 0 ) {}
-      ThreadSafeRefCount( bool noSet ) {}
+      ThreadSafeRefCount( bool noSet ) : mRefCount(0) {}
 
 
       bool           isShared() const;
       bool           isShared() const;
       U32            getRefCount() const;
       U32            getRefCount() const;

+ 1 - 1
Engine/source/platformWin32/winCPUInfo.cpp

@@ -78,7 +78,7 @@ static void detectCpuFeatures(Platform::SystemInfo_struct::Processor &processor)
 {
 {
    S32 cpuInfo[4];
    S32 cpuInfo[4];
    __cpuid(cpuInfo, 1);
    __cpuid(cpuInfo, 1);
-   U32 eax = cpuInfo[0];   // eax
+   //U32 eax = cpuInfo[0];   // eax
    U32 edx = cpuInfo[3];  // edx
    U32 edx = cpuInfo[3];  // edx
    U32 ecx = cpuInfo[2]; // ecx
    U32 ecx = cpuInfo[2]; // ecx
 
 

+ 2 - 2
Engine/source/sfx/openal/sfxALDevice.cpp

@@ -77,7 +77,7 @@ S32 SFXALDevice::getMaxSources()
 
 
 S32 SFXALDevice::getMaxSourcesOld()
 S32 SFXALDevice::getMaxSourcesOld()
 {
 {
-   ALuint uiSource[256];
+   ALuint uiSource[256] = {};
    S32 sourceCount = 0;
    S32 sourceCount = 0;
    
    
    // clear errors.
    // clear errors.
@@ -148,7 +148,7 @@ SFXALDevice::SFXALDevice(  SFXProvider *provider,
 #if defined(AL_ALEXT_PROTOTYPES)
 #if defined(AL_ALEXT_PROTOTYPES)
        mOpenAL.alcGetIntegerv(mDevice, ALC_MAX_AUXILIARY_SENDS, 1, &iSends);
        mOpenAL.alcGetIntegerv(mDevice, ALC_MAX_AUXILIARY_SENDS, 1, &iSends);
 #endif
 #endif
-       U32 err = mOpenAL.alcGetError( mDevice );
+       err = mOpenAL.alcGetError( mDevice );
       
       
       if( err != ALC_NO_ERROR )
       if( err != ALC_NO_ERROR )
          Con::errorf( "SFXALDevice - Context Initialization Error: %s", mOpenAL.alcGetString( mDevice, err ) );
          Con::errorf( "SFXALDevice - Context Initialization Error: %s", mOpenAL.alcGetString( mDevice, err ) );

+ 2 - 3
Engine/source/sfx/openal/sfxALProvider.cpp

@@ -60,7 +60,7 @@ MODULE_BEGIN( OpenAL )
    MODULE_INIT_BEFORE( SFX )
    MODULE_INIT_BEFORE( SFX )
    MODULE_SHUTDOWN_AFTER( SFX )
    MODULE_SHUTDOWN_AFTER( SFX )
    
    
-   SFXALProvider* mProvider;
+   SFXALProvider* mProvider = NULL;
    
    
    MODULE_INIT
    MODULE_INIT
    {
    {
@@ -91,9 +91,8 @@ void SFXALProvider::init()
    }
    }
 
 
    // Cool, loop through them, and caps em
    // Cool, loop through them, and caps em
-   const char *deviceFormat = "OpenAL v%d.%d %s";
+   //const char *deviceFormat = "OpenAL v%d.%d %s";
 
 
-   char temp[256];
    for( S32 i = 0; i < mALDL->GetNumDevices(); i++ )
    for( S32 i = 0; i < mALDL->GetNumDevices(); i++ )
    {
    {
       ALDeviceInfo* info = new ALDeviceInfo;
       ALDeviceInfo* info = new ALDeviceInfo;

+ 2 - 2
Engine/source/sfx/sfxProvider.h

@@ -37,8 +37,8 @@ struct SFXDeviceInfo
    String   driver;
    String   driver;
    String   internalName;
    String   internalName;
    String   name;
    String   name;
-   bool     hasHardware;
-   S32      maxBuffers;
+   bool     hasHardware = false;
+   S32      maxBuffers =0;
 
 
    virtual ~SFXDeviceInfo() {}
    virtual ~SFXDeviceInfo() {}
 };
 };

+ 0 - 1
Engine/source/sfx/sfxSystem.cpp

@@ -1620,7 +1620,6 @@ DefineEngineFunction( sfxPlayOnce, S32, (StringTableEntry assetId, const char* a
    "Create a new play-once source for the given profile or description+filename and start playback of the source.\n"
    "Create a new play-once source for the given profile or description+filename and start playback of the source.\n"
    "@hide" )
    "@hide" )
 {
 {
-   SFXDescription* description = NULL;
    if (assetId == StringTable->EmptyString())
    if (assetId == StringTable->EmptyString())
    {
    {
       Con::errorf( "sfxPlayOnce - Must Define a sound asset");
       Con::errorf( "sfxPlayOnce - Must Define a sound asset");

+ 1 - 1
Engine/source/shaderGen/GLSL/customFeatureGLSL.cpp

@@ -184,7 +184,7 @@ void CustomFeatureGLSL::addVariable(String name, String type, String defaultValu
 void CustomFeatureGLSL::addConnector(String name, String type, String elementName)
 void CustomFeatureGLSL::addConnector(String name, String type, String elementName)
 {
 {
    // grab connector texcoord register
    // grab connector texcoord register
-   ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
+   //ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
 
 
    //Get element
    //Get element
    S32 element = -1;
    S32 element = -1;

+ 2 - 21
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -2139,16 +2139,8 @@ void RTLightingFeatGLSL::processPix(   Vector<ShaderComponent*> &componentList,
    if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
    if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
       return;
       return;
   
   
-   ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
-
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
 
 
-	// Now the wsPosition and wsView.
-   Var *wsPosition = getInWsPosition( componentList );
-   Var* worldToTangent = getInWorldToTangent(componentList);
-   Var* wsNormal = getInWorldNormal(componentList);
-   Var *wsView = getWsView( wsPosition, meta );
-
    // Look for a light mask generated from a previous
    // Look for a light mask generated from a previous
    // feature (this is done for BL terrain lightmaps).
    // feature (this is done for BL terrain lightmaps).
    LangElement *lightMask = LangElement::find( "lightMask" );
    LangElement *lightMask = LangElement::find( "lightMask" );
@@ -2202,10 +2194,7 @@ void RTLightingFeatGLSL::processPix(   Vector<ShaderComponent*> &componentList,
    {
    {
       Con::errorf("ShaderGen::RTLightingFeatGLSL()  - failed to generate surface!");
       Con::errorf("ShaderGen::RTLightingFeatGLSL()  - failed to generate surface!");
       return;
       return;
-   }   
-   Var *roughness = (Var*)LangElement::find("roughness");
-
-   Var *metalness = (Var*)LangElement::find("metalness");
+   }
 
 
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
 
 
@@ -2957,16 +2946,8 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
    if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
       return;
       return;
 
 
-   ShaderConnector * connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
-
    MultiLine * meta = new MultiLine;
    MultiLine * meta = new MultiLine;
-
-   // Now the wsPosition and wsView.
-   Var *wsPosition = getInWsPosition(componentList);
-   Var *worldToTangent = getInWorldToTangent(componentList);
-   Var *wsNormal = getInWorldNormal(componentList);
-   Var *wsView = getWsView(wsPosition, meta);
-   
+      
    //Reflection Probe WIP
    //Reflection Probe WIP
    U32 MAX_FORWARD_PROBES = 4;
    U32 MAX_FORWARD_PROBES = 4;
 
 

+ 1 - 1
Engine/source/shaderGen/HLSL/customFeatureHLSL.cpp

@@ -201,7 +201,7 @@ void CustomFeatureHLSL::addVariable(String name, String type, String defaultValu
 void CustomFeatureHLSL::addConnector(String name, String type, String elementName)
 void CustomFeatureHLSL::addConnector(String name, String type, String elementName)
 {
 {
    // grab connector texcoord register
    // grab connector texcoord register
-   ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
+   //ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
 
 
    //Get element
    //Get element
    S32 element = -1;
    S32 element = -1;

+ 0 - 24
Engine/source/shaderGen/HLSL/debugVizFeatureHLSL.cpp

@@ -122,19 +122,6 @@ void DebugVizHLSL::processPix(Vector<ShaderComponent*>& componentList,
       if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
       if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
          return;
          return;
 
 
-      ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
-
-      MultiLine* meta = new MultiLine;
-
-      // Now the wsPosition and wsView.
-      Var* worldToTangent = getInWorldToTangent(componentList);
-      Var* wsNormal = getInWorldNormal(componentList);
-      Var* wsPosition = getInWsPosition(componentList);
-      Var* wsView = getWsView(wsPosition, meta);
-
-      //Reflection Probe WIP
-      U32 MAX_FORWARD_PROBES = 4;
-
       Var* numProbes = (Var*)LangElement::find("inNumProbes");
       Var* numProbes = (Var*)LangElement::find("inNumProbes");
       Var* cubeMips = (Var*)LangElement::find("cubeMips");
       Var* cubeMips = (Var*)LangElement::find("cubeMips");
       Var* skylightCubemapIdx = (Var*)LangElement::find("inSkylightCubemapIdx");
       Var* skylightCubemapIdx = (Var*)LangElement::find("inSkylightCubemapIdx");
@@ -146,21 +133,10 @@ void DebugVizHLSL::processPix(Vector<ShaderComponent*>& componentList,
       Var* worldToObjArray = (Var*)LangElement::find("inWorldToObjArray");
       Var* worldToObjArray = (Var*)LangElement::find("inWorldToObjArray");
 
 
       Var* BRDFTexture = (Var*)LangElement::find("BRDFTexture");
       Var* BRDFTexture = (Var*)LangElement::find("BRDFTexture");
-      Var* BRDFTextureTex = (Var*)LangElement::find("texture_BRDFTexture");
 
 
       Var* specularCubemapAR = (Var*)LangElement::find("SpecularCubemapAR");
       Var* specularCubemapAR = (Var*)LangElement::find("SpecularCubemapAR");
-      Var* specularCubemapARTex = (Var*)LangElement::find("texture_SpecularCubemapAR");
 
 
       Var* irradianceCubemapAR = (Var*)LangElement::find("IrradianceCubemapAR");
       Var* irradianceCubemapAR = (Var*)LangElement::find("IrradianceCubemapAR");
-      Var* irradianceCubemapARTex = (Var*)LangElement::find("texture_IrradianceCubemapAR");
-
-      Var* matinfo = (Var*)LangElement::find("ORMConfig");
-      Var* metalness = (Var*)LangElement::find("metalness");
-      Var* roughness = (Var*)LangElement::find("roughness");
-
-      Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
-
-      Var* ibl = (Var*)LangElement::find("ibl");
 
 
       //Reflection vec
       //Reflection vec
       Var* showAttenVar = new Var("showAttenVar", "int");
       Var* showAttenVar = new Var("showAttenVar", "int");

+ 5 - 20
Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp

@@ -2217,16 +2217,10 @@ void RTLightingFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList,
    if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
    if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
       return;
       return;
   
   
-   ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
+   //ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
 
 
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
-
-   // Now the wsPosition and wsView.
-   Var *wsPosition = getInWsPosition( componentList );
-   Var* worldToTangent = getInWorldToTangent(componentList);
-   Var* wsNormal = getInWorldNormal(componentList);   
-   Var *wsView = getWsView( wsPosition, meta );
-   
+      
    // Look for a light mask generated from a previous
    // Look for a light mask generated from a previous
    // feature (this is done for BL terrain lightmaps).
    // feature (this is done for BL terrain lightmaps).
    LangElement *lightMask = LangElement::find( "lightMask" );
    LangElement *lightMask = LangElement::find( "lightMask" );
@@ -2280,10 +2274,7 @@ void RTLightingFeatHLSL::processPix(   Vector<ShaderComponent*> &componentList,
    {
    {
       Con::errorf("ShaderGen::RTLightingFeatHLSL()  - failed to generate surface!");
       Con::errorf("ShaderGen::RTLightingFeatHLSL()  - failed to generate surface!");
       return;
       return;
-   }   
-   Var *roughness = (Var*)LangElement::find("roughness");
-
-   Var *metalness = (Var*)LangElement::find("metalness");
+   }
 
 
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
    Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
 
 
@@ -3035,16 +3026,10 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
    if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
    if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
       return;
       return;
 
 
-   ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>(componentList[C_CONNECTOR]);
+   //ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>(componentList[C_CONNECTOR]);
 
 
    MultiLine *meta = new MultiLine;
    MultiLine *meta = new MultiLine;
-   
-   // Now the wsPosition and wsView.
-   Var* wsPosition = getInWsPosition(componentList);
-   Var* worldToTangent = getInWorldToTangent(componentList);
-   Var *wsNormal = getInWorldNormal(componentList);
-   Var *wsView = getWsView(wsPosition, meta);
-   
+      
    //Reflection Probe WIP
    //Reflection Probe WIP
    U32 MAX_FORWARD_PROBES = 4;
    U32 MAX_FORWARD_PROBES = 4;
 
 

+ 2 - 2
Engine/source/shaderGen/shaderFeature.h

@@ -130,8 +130,8 @@ public:
    //**************************************************************************
    //**************************************************************************
    struct Resources
    struct Resources
    {
    {
-      U32 numTex;
-      U32 numTexReg;
+      U32 numTex = 0;
+      U32 numTexReg = 0;
 
 
       Resources()
       Resources()
       {
       {

+ 0 - 6
Engine/source/terrain/glsl/terrFeatureGLSL.cpp

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

+ 1 - 2
Engine/source/terrain/hlsl/terrFeatureHLSL.cpp

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

+ 23 - 15
Engine/source/terrain/terrData.cpp

@@ -1172,7 +1172,7 @@ void TerrainBlock::_updatePhysics()
 
 
    SAFE_DELETE( mPhysicsRep );
    SAFE_DELETE( mPhysicsRep );
 
 
-   PhysicsCollision *colShape;
+   PhysicsCollision *colShape = NULL;
 
 
    // If we can steal the collision shape from the local server
    // 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.
    // object then do so as it saves us alot of cpu time and memory.
@@ -1187,22 +1187,31 @@ void TerrainBlock::_updatePhysics()
    }
    }
    else
    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()
 void TerrainBlock::onRemove()
@@ -1470,7 +1479,6 @@ bool TerrainBlock::renameTerrainMaterial(StringTableEntry oldMatName, StringTabl
    {
    {
       if (mFile->mMaterials[i]->getInternalName() == oldMatName)
       if (mFile->mMaterials[i]->getInternalName() == oldMatName)
       {
       {
-         TerrainMaterial* oldMat = mFile->mMaterials[i];
          mFile->mMaterials[i] = newMat;
          mFile->mMaterials[i] = newMat;
       }
       }
    }
    }

+ 1 - 2
Engine/source/ts/tsLastDetail.cpp

@@ -224,8 +224,7 @@ void TSLastDetail::update( bool forceUpdate )
    // Do we need to update the imposter?
    // Do we need to update the imposter?
    const String diffuseMapPath = _getDiffuseMapPath();
    const String diffuseMapPath = _getDiffuseMapPath();
    bool isFile = Platform::isFile(diffuseMapPath.c_str());
    bool isFile = Platform::isFile(diffuseMapPath.c_str());
-   if (  forceUpdate || !Platform::isFile(diffuseMapPath.c_str()) ||
-         Platform::compareModifiedTimes( diffuseMapPath, shapeFile ) <= 0 )
+   if (  forceUpdate || !isFile || Platform::compareModifiedTimes( diffuseMapPath, shapeFile ) <= 0 )
       _update();
       _update();
 
 
    // If the time check fails now then the update must have not worked.
    // If the time check fails now then the update must have not worked.

+ 0 - 2
Engine/source/ts/tsShapeInstance.cpp

@@ -294,8 +294,6 @@ void TSShapeInstance::reSkin( String newBaseName, String oldBaseName )
    if ( newBaseName.equal( oldBaseName, String::NoCase ) )
    if ( newBaseName.equal( oldBaseName, String::NoCase ) )
       return;
       return;
 
 
-   const U32 oldBaseNameLength = oldBaseName.length();
-
    // Make our own copy of the materials list from the resource if necessary
    // Make our own copy of the materials list from the resource if necessary
    if (ownMaterialList() == false)
    if (ownMaterialList() == false)
       cloneMaterialList();
       cloneMaterialList();

+ 22 - 11
Engine/source/ts/tsShapeInstance.h

@@ -740,25 +740,25 @@ class TSThread
    /// if in transition...
    /// if in transition...
    struct TransitionData
    struct TransitionData
    {
    {
-      bool inTransition;
+      bool inTransition = false;
 
 
-      F32 duration;
-      F32 pos;
-      F32 direction;
-      F32 targetScale; ///< time scale for sequence we are transitioning to (during transition only)
+      F32 duration = 0.0f;
+      F32 pos = 0.0f;
+      F32 direction = 1.0f;
+      F32 targetScale = 1.0f; ///< time scale for sequence we are transitioning to (during transition only)
                        ///< this is either 1 or 0 (if 1 target sequence plays as we transition, if 0 it doesn't)
                        ///< this is either 1 or 0 (if 1 target sequence plays as we transition, if 0 it doesn't)
       TSIntegerSet oldRotationNodes;    ///< nodes controlled by this thread pre-transition
       TSIntegerSet oldRotationNodes;    ///< nodes controlled by this thread pre-transition
       TSIntegerSet oldTranslationNodes; ///< nodes controlled by this thread pre-transition
       TSIntegerSet oldTranslationNodes; ///< nodes controlled by this thread pre-transition
       TSIntegerSet oldScaleNodes;       ///< nodes controlled by this thread pre-transition
       TSIntegerSet oldScaleNodes;       ///< nodes controlled by this thread pre-transition
-      U32 oldSequence; ///< sequence that was set before transition began
-      F32 oldPos;      ///< position of sequence before transition began
+      U32 oldSequence = 0; ///< sequence that was set before transition began
+      F32 oldPos = 0.0f;      ///< position of sequence before transition began
    } transitionData;
    } transitionData;
 
 
    struct
    struct
    {
    {
-      F32 start;
-      F32 end;
-      S32 loop;
+      F32 start = 0.0f;
+      F32 end = 0.0f;
+      S32 loop = 0.0f;
    } path;
    } path;
    bool makePath;
    bool makePath;
 
 
@@ -781,7 +781,18 @@ class TSThread
    /// @}
    /// @}
 
 
    TSThread(TSShapeInstance*);
    TSThread(TSShapeInstance*);
-   TSThread() {}
+   TSThread() {
+      blendDisabled = true;
+      keyNum1 = 0;
+      keyNum2 = 0;
+      keyPos = 0;
+      mSeqPos = 0;
+      mShapeInstance = NULL;
+      makePath = NULL;
+      priority = 0;
+      sequence = 0;
+      timeScale = 1.0f;
+   }
 
 
    void setSequence(S32 seq, F32 pos);
    void setSequence(S32 seq, F32 pos);
    void transitionToSequence(S32 seq, F32 pos, F32 duration, bool continuePlay);
    void transitionToSequence(S32 seq, F32 pos, F32 duration, bool continuePlay);

+ 1 - 1
Engine/source/windowManager/platformWindow.h

@@ -109,7 +109,7 @@ protected:
       mSuppressReset = false;
       mSuppressReset = false;
       mOffscreenRender = false;
       mOffscreenRender = false;
       mDisplayWindow = false;
       mDisplayWindow = false;
-
+      mWindowId = 0;
       // This controller maps window input (Mouse/Keyboard) to a generic input consumer
       // This controller maps window input (Mouse/Keyboard) to a generic input consumer
       mWindowInputGenerator = new WindowInputGenerator( this );
       mWindowInputGenerator = new WindowInputGenerator( this );
    }
    }

+ 4 - 4
Engine/source/windowManager/windowInputGenerator.h

@@ -66,10 +66,10 @@ class WindowInputGenerator
       /// Accelerator key map
       /// Accelerator key map
        struct AccKeyMap
        struct AccKeyMap
        {
        {
-          void *hnd;
+          void *hnd = NULL;
           String cmd;
           String cmd;
-          U32 keyCode;
-          U32 modifier;
+          U32 keyCode = 0x000;
+          U32 modifier = 0x000;
        };
        };
        Vector <AccKeyMap> mAcceleratorMap;
        Vector <AccKeyMap> mAcceleratorMap;
       
       
@@ -128,4 +128,4 @@ class WindowInputGenerator
     }
     }
 };
 };
 
 
-#endif // _WINDOW_INPUTGENERATOR_H_
+#endif // _WINDOW_INPUTGENERATOR_H_