Просмотр исходного кода

- Fixed memory leak when creating terrain with physx 3

- Fixed terrain tessellation with physx 3
rextimmy 10 лет назад
Родитель
Сommit
664595ef9e
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      Engine/source/T3D/physics/physx3/px3Collision.cpp

+ 4 - 2
Engine/source/T3D/physics/physx3/px3Collision.cpp

@@ -191,9 +191,9 @@ bool Px3Collision::addHeightfield(   const U16 *heights,
 
 		int flag = ( column + tess ) % 2;
 		if(flag)
-			currentSample->setTessFlag();
-		else
 			currentSample->clearTessFlag();
+		else
+			currentSample->setTessFlag();
 
          currentByte += heightFieldDesc.samples.stride;    
       }
@@ -211,5 +211,7 @@ bool Px3Collision::addHeightfield(   const U16 *heights,
 	desc->pose = pose2;
 
 	mColShapes.push_back(desc);
+
+   SAFE_DELETE(samples);
 	return true;
 }