diff options
Diffstat (limited to 'UVtools.Core/FileFormats/LGSFile.cs')
-rw-r--r-- | UVtools.Core/FileFormats/LGSFile.cs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/UVtools.Core/FileFormats/LGSFile.cs b/UVtools.Core/FileFormats/LGSFile.cs index da5a3e4..03143e3 100644 --- a/UVtools.Core/FileFormats/LGSFile.cs +++ b/UVtools.Core/FileFormats/LGSFile.cs @@ -457,10 +457,7 @@ namespace UVtools.Core.FileFormats layerData[layerIndex].Encode(mat); } - lock (progress.Mutex) - { - progress++; - } + progress.LockAndIncrement(); }); progress.ItemName = "Saving layers"; @@ -536,7 +533,7 @@ namespace UVtools.Core.FileFormats layerData[layerIndex].Parent = this; } - LayerManager = new LayerManager(HeaderSettings.LayerCount, this); + LayerManager.Init(HeaderSettings.LayerCount); progress.Reset(OperationProgress.StatusDecodeLayers, LayerCount); Parallel.For(0, LayerCount, @@ -548,10 +545,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(); |