Browse Source

unnecessarily duplicated var definitions

Azaezel 7 years ago
parent
commit
c3698c1db6

+ 17 - 17
Engine/source/T3D/decal/decalManager.cpp

@@ -1302,14 +1302,14 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
    // Loop through batches allocating buffers and submitting render instances.
    for ( U32 i = 0; i < batches.size(); i++ )
    {
-      DecalBatch &currentBatch = batches[i];      
+      currentBatch = &batches[i];      
 
       // Copy data into the system memory arrays, from all decals in this batch...
 
       DecalVertex *vpPtr = vertData;
       U16 *pbPtr = indexData;            
 
-      U32 lastDecal = currentBatch.startDecal + currentBatch.decalCount;
+      U32 lastDecal = currentBatch->startDecal + currentBatch->decalCount;
 
       U32 voffset = 0;
       U32 ioffset = 0;
@@ -1317,13 +1317,13 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
       // This is an ugly hack for ProjectedShadow!
       GFXTextureObject *customTex = NULL;
 
-      for ( U32 j = currentBatch.startDecal; j < lastDecal; j++ )
+      for ( U32 j = currentBatch->startDecal; j < lastDecal; j++ )
       {
-         DecalInstance *dinst = mDecalQueue[j];
+         dinst = mDecalQueue[j];
 
          const U32 indxCount =
-             (dinst->mIndxCount > currentBatch.iCount) ?
-             currentBatch.iCount : dinst->mIndxCount;
+             (dinst->mIndxCount > currentBatch->iCount) ?
+             currentBatch->iCount : dinst->mIndxCount;
          for ( U32 k = 0; k < indxCount; k++ )
          {
             *( pbPtr + ioffset + k ) = dinst->mIndices[k] + voffset;            
@@ -1332,8 +1332,8 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
          ioffset += indxCount;
 
          const U32 vertCount =
-             (dinst->mVertCount > currentBatch.vCount) ?
-             currentBatch.vCount : dinst->mVertCount;
+             (dinst->mVertCount > currentBatch->vCount) ?
+             currentBatch->vCount : dinst->mVertCount;
          dMemcpy( vpPtr + voffset, dinst->mVerts, sizeof( DecalVertex ) * vertCount );
          voffset += vertCount;
 
@@ -1342,8 +1342,8 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
             customTex = *dinst->mCustomTex;
       }
 
-      AssertFatal( ioffset == currentBatch.iCount, "bad" );
-      AssertFatal( voffset == currentBatch.vCount, "bad" );
+      AssertFatal( ioffset == currentBatch->iCount, "bad" );
+      AssertFatal( voffset == currentBatch->vCount, "bad" );
         
       // Get handles to video memory buffers we will be filling...
 
@@ -1385,9 +1385,9 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
       pb->lock( &pbPtr );
 
       // Memcpy from system to video memory.
-      const U32 vpCount = sizeof( DecalVertex ) * currentBatch.vCount;
+      const U32 vpCount = sizeof( DecalVertex ) * currentBatch->vCount;
       dMemcpy( vpPtr, vertData, vpCount );
-      const U32 pbCount = sizeof( U16 ) * currentBatch.iCount;
+      const U32 pbCount = sizeof( U16 ) * currentBatch->iCount;
       dMemcpy( pbPtr, indexData, pbCount );
 
       pb->unlock();
@@ -1400,7 +1400,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
 
       // Get the best lights for the current camera position
       // if the materail is forward lit and we haven't got them yet.
-      if ( currentBatch.matInst->isForwardLit() && !baseRenderInst.lights[0] )
+      if ( currentBatch->matInst->isForwardLit() && !baseRenderInst.lights[0] )
       {
          LightQuery query;
          query.init( rootFrustum.getPosition(),
@@ -1416,15 +1416,15 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
       ri->primBuff = pb;
       ri->vertBuff = vb;
 
-      ri->matInst = currentBatch.matInst;
+      ri->matInst = currentBatch->matInst;
 
       ri->prim = renderPass->allocPrim();
       ri->prim->type = GFXTriangleList;
       ri->prim->minIndex = 0;
       ri->prim->startIndex = 0;
-      ri->prim->numPrimitives = currentBatch.iCount / 3;
+      ri->prim->numPrimitives = currentBatch->iCount / 3;
       ri->prim->startVertex = 0;
-      ri->prim->numVertices = currentBatch.vCount;
+      ri->prim->numVertices = currentBatch->vCount;
 
       // Ugly hack for ProjectedShadow!
       if ( customTex )
@@ -1433,7 +1433,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state )
       // The decal bin will contain render instances for both decals and decalRoad's.
       // Dynamic decals render last, then editor decals and roads in priority order.
       // DefaultKey is sorted in descending order.
-      ri->defaultKey = currentBatch.dynamic ? 0xFFFFFFFF : (U32)currentBatch.priority;
+      ri->defaultKey = currentBatch->dynamic ? 0xFFFFFFFF : (U32)currentBatch->priority;
       ri->defaultKey2 = 1;//(U32)lastDecal->mDataBlock;
 
       renderPass->addInst( ri );

+ 1 - 1
Engine/source/collision/depthSortList.cpp

@@ -123,7 +123,7 @@ void DepthSortList::setExtents(Poly & poly, PolyExtents & polyExtents)
    polyExtents.zMin = polyExtents.zMax = p.z;
    for (S32 i=poly.vertexStart+1; i<poly.vertexStart+poly.vertexCount; i++)
    {
-      Point3F p = mVertexList[mIndexList[i]].point;
+      p = mVertexList[mIndexList[i]].point;
 
       // x
       if (p.x < polyExtents.xMin)

+ 1 - 1
Engine/source/collision/earlyOutPolyList.cpp

@@ -237,7 +237,7 @@ void EarlyOutPolyList::end()
                iv.mask = 0;
 
                // Test against the remaining planes
-               for (U32 i = p + 1; i < mPlaneList.size(); i++)
+               for (i = p + 1; i < mPlaneList.size(); i++)
                   if (mPlaneList[i].distToPlane(iv.point) > 0) {
                      iv.mask = 1 << i;
                      break;