aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
diff options
context:
space:
mode:
authorSean McNamara2011-04-10 18:28:54 -0400
committerSean McNamara2011-04-10 18:28:54 -0400
commit9c0f3c73b1fd56ac145e866af0316a3285ddb689 (patch)
tree03541a853c2ecf5829ac296537b14d4553ad4b2e /OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
parentMerge git://opensimulator.org/git/opensim (diff)
parentminor: remove mono compiler warnings (diff)
downloadopensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.zip
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.gz
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.bz2
opensim-SC_OLD-9c0f3c73b1fd56ac145e866af0316a3285ddb689.tar.xz
Merge git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
index 6676ec8..d6fa093 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs
@@ -62,9 +62,20 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
62 return LoadBitmap(new Bitmap(filename)); 62 return LoadBitmap(new Bitmap(filename));
63 } 63 }
64 64
65 public ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h) 65 public virtual ITerrainChannel LoadFile(string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int w, int h)
66 { 66 {
67 throw new NotImplementedException(); 67 Bitmap bitmap = new Bitmap(filename);
68 ITerrainChannel retval = new TerrainChannel(true);
69
70 for (int x = 0; x < retval.Width; x++)
71 {
72 for (int y = 0; y < retval.Height; y++)
73 {
74 retval[x, y] = bitmap.GetPixel(offsetX * retval.Width + x, (bitmap.Height - (retval.Height * (offsetY + 1))) + retval.Height - y - 1).GetBrightness() * 128;
75 }
76 }
77
78 return retval;
68 } 79 }
69 80
70 public virtual ITerrainChannel LoadStream(Stream stream) 81 public virtual ITerrainChannel LoadStream(Stream stream)