diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 21a9999..58925fd 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs | |||
@@ -132,13 +132,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
132 | { | 132 | { |
133 | // We need to do this because: | 133 | // We need to do this because: |
134 | // "Saving the image to the same file it was constructed from is not allowed and throws an exception." | 134 | // "Saving the image to the same file it was constructed from is not allowed and throws an exception." |
135 | string tempName = offsetX + "_ " + offsetY + "_" + filename; | 135 | string tempName = Path.GetTempFileName(); |
136 | 136 | ||
137 | Bitmap entireBitmap = null; | 137 | Bitmap entireBitmap = null; |
138 | Bitmap thisBitmap = null; | 138 | Bitmap thisBitmap = null; |
139 | if (File.Exists(filename)) | 139 | if (File.Exists(filename)) |
140 | { | 140 | { |
141 | File.Copy(filename, tempName); | 141 | File.Copy(filename, tempName, true); |
142 | entireBitmap = new Bitmap(tempName); | 142 | entireBitmap = new Bitmap(tempName); |
143 | if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY) | 143 | if (entireBitmap.Width != fileWidth * regionSizeX || entireBitmap.Height != fileHeight * regionSizeY) |
144 | { | 144 | { |
@@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders | |||
152 | } | 152 | } |
153 | 153 | ||
154 | thisBitmap = CreateGrayscaleBitmapFromMap(m_channel); | 154 | thisBitmap = CreateGrayscaleBitmapFromMap(m_channel); |
155 | Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY); | 155 | // Console.WriteLine("offsetX=" + offsetX + " offsetY=" + offsetY); |
156 | for (int x = 0; x < regionSizeX; x++) | 156 | for (int x = 0; x < regionSizeX; x++) |
157 | for (int y = 0; y < regionSizeY; y++) | 157 | for (int y = 0; y < regionSizeY; y++) |
158 | entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y)); | 158 | entireBitmap.SetPixel(x + offsetX * regionSizeX, y + (fileHeight - 1 - offsetY) * regionSizeY, thisBitmap.GetPixel(x, y)); |