diff options
author | UbitUmarov | 2016-11-19 15:45:41 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-19 15:45:41 +0000 |
commit | 7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4 (patch) | |
tree | a2ab69bce5eda122b119da082625449f92b4c3d3 /OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | |
parent | Merge branch 'master' into httptests (diff) | |
parent | REST console v2. This is an incompatible protocol change. It degrades gracefu... (diff) | |
download | opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.zip opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.gz opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.bz2 opensim-SC-7cb3d583a97ac36f0c2ef5d6eadae28f26378fc4.tar.xz |
merge conflits
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index ca94034..2ae0881 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | |||
@@ -182,7 +182,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
182 | /// <returns></returns> | 182 | /// <returns></returns> |
183 | private static Mesh CreateSimpleBoxMesh(float minX, float maxX, float minY, float maxY, float minZ, float maxZ) | 183 | private static Mesh CreateSimpleBoxMesh(float minX, float maxX, float minY, float maxY, float minZ, float maxZ) |
184 | { | 184 | { |
185 | Mesh box = new Mesh(); | 185 | Mesh box = new Mesh(true); |
186 | List<Vertex> vertices = new List<Vertex>(); | 186 | List<Vertex> vertices = new List<Vertex>(); |
187 | // bottom | 187 | // bottom |
188 | 188 | ||
@@ -357,7 +357,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
357 | int numCoords = coords.Count; | 357 | int numCoords = coords.Count; |
358 | int numFaces = faces.Count; | 358 | int numFaces = faces.Count; |
359 | 359 | ||
360 | Mesh mesh = new Mesh(); | 360 | Mesh mesh = new Mesh(true); |
361 | // Add the corresponding triangles to the mesh | 361 | // Add the corresponding triangles to the mesh |
362 | for (int i = 0; i < numFaces; i++) | 362 | for (int i = 0; i < numFaces; i++) |
363 | { | 363 | { |
@@ -1483,6 +1483,7 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
1483 | 1483 | ||
1484 | lock (diskLock) | 1484 | lock (diskLock) |
1485 | { | 1485 | { |
1486 | Stream stream = null; | ||
1486 | try | 1487 | try |
1487 | { | 1488 | { |
1488 | if (!Directory.Exists(dir)) | 1489 | if (!Directory.Exists(dir)) |
@@ -1490,8 +1491,8 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
1490 | Directory.CreateDirectory(dir); | 1491 | Directory.CreateDirectory(dir); |
1491 | } | 1492 | } |
1492 | 1493 | ||
1493 | using(Stream stream = File.Open(filename, FileMode.Create)) | 1494 | stream = File.Open(filename, FileMode.Create); |
1494 | ok = mesh.ToStream(stream); | 1495 | ok = mesh.ToStream(stream); |
1495 | } | 1496 | } |
1496 | catch (IOException e) | 1497 | catch (IOException e) |
1497 | { | 1498 | { |
@@ -1500,6 +1501,11 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing | |||
1500 | filename, e.Message, e.StackTrace); | 1501 | filename, e.Message, e.StackTrace); |
1501 | ok = false; | 1502 | ok = false; |
1502 | } | 1503 | } |
1504 | finally | ||
1505 | { | ||
1506 | if(stream != null) | ||
1507 | stream.Dispose(); | ||
1508 | } | ||
1503 | 1509 | ||
1504 | if (!ok && File.Exists(filename)) | 1510 | if (!ok && File.Exists(filename)) |
1505 | { | 1511 | { |