Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UVtools.Core/FileFormats/PhotonSFile.cs')
-rw-r--r--UVtools.Core/FileFormats/PhotonSFile.cs12
1 files changed, 3 insertions, 9 deletions
diff --git a/UVtools.Core/FileFormats/PhotonSFile.cs b/UVtools.Core/FileFormats/PhotonSFile.cs
index 50e99c6..d881a4f 100644
--- a/UVtools.Core/FileFormats/PhotonSFile.cs
+++ b/UVtools.Core/FileFormats/PhotonSFile.cs
@@ -406,10 +406,7 @@ namespace UVtools.Core.FileFormats
layerData[layerIndex].Encode(mat);
}
- lock (progress.Mutex)
- {
- progress++;
- }
+ progress.LockAndIncrement();
});
progress.ItemName = "Saving layers";
@@ -491,7 +488,7 @@ namespace UVtools.Core.FileFormats
Debug.WriteLine($"Layer {layerIndex} -> {layerData[layerIndex]}");
}
- LayerManager = new LayerManager(LayerSettings.LayerCount, this);
+ LayerManager.Init(LayerSettings.LayerCount);
progress.Reset(OperationProgress.StatusDecodeLayers, LayerCount);
Parallel.For(0, LayerCount,
@@ -502,10 +499,7 @@ namespace UVtools.Core.FileFormats
using var image = layerData[layerIndex].Decode();
this[layerIndex] = new Layer((uint) layerIndex, image, LayerManager);
- lock (progress.Mutex)
- {
- progress++;
- }
+ progress.LockAndIncrement();
});
LayerManager.RebuildLayersProperties();