aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
diff options
context:
space:
mode:
authorlbsa712007-07-03 14:37:29 +0000
committerlbsa712007-07-03 14:37:29 +0000
commit9b6b6d05d45cf0f754a0b26bf6240ef50be66563 (patch)
tree8d72120aac2184c5ed4c5ab5f6b673ef496a0803 /OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
parent* Completed conceptual LlsdMethod - everything resides in SimpleApp pending g... (diff)
downloadopensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.zip
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.gz
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.bz2
opensim-SC_OLD-9b6b6d05d45cf0f754a0b26bf6240ef50be66563.tar.xz
* Optimized usings (the 'LL ate my scripts' commit)
* added some licensing info
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs49
1 files changed, 25 insertions, 24 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index 0f450c3..6c9ec26 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -27,8 +27,9 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
31using System.Drawing; 30using System.Drawing;
31using System.Drawing.Imaging;
32using System.IO;
32using libTerrain; 33using libTerrain;
33using OpenJPEGNet; 34using OpenJPEGNet;
34 35
@@ -421,9 +422,9 @@ namespace OpenSim.Region.Terrain
421 /// <param name="filename">The filename of the double array to import</param> 422 /// <param name="filename">The filename of the double array to import</param>
422 public void loadFromFileF64(string filename) 423 public void loadFromFileF64(string filename)
423 { 424 {
424 System.IO.FileInfo file = new System.IO.FileInfo(filename); 425 FileInfo file = new FileInfo(filename);
425 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); 426 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
426 System.IO.BinaryReader bs = new System.IO.BinaryReader(s); 427 BinaryReader bs = new BinaryReader(s);
427 int x, y; 428 int x, y;
428 for (x = 0; x < w; x++) 429 for (x = 0; x < w; x++)
429 { 430 {
@@ -446,9 +447,9 @@ namespace OpenSim.Region.Terrain
446 /// <param name="filename">The filename of the float array to import</param> 447 /// <param name="filename">The filename of the float array to import</param>
447 public void loadFromFileF32(string filename) 448 public void loadFromFileF32(string filename)
448 { 449 {
449 System.IO.FileInfo file = new System.IO.FileInfo(filename); 450 FileInfo file = new FileInfo(filename);
450 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); 451 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
451 System.IO.BinaryReader bs = new System.IO.BinaryReader(s); 452 BinaryReader bs = new BinaryReader(s);
452 int x, y; 453 int x, y;
453 for (x = 0; x < w; x++) 454 for (x = 0; x < w; x++)
454 { 455 {
@@ -471,9 +472,9 @@ namespace OpenSim.Region.Terrain
471 /// <param name="filename">A path to the .RAW format</param> 472 /// <param name="filename">A path to the .RAW format</param>
472 public void loadFromFileSLRAW(string filename) 473 public void loadFromFileSLRAW(string filename)
473 { 474 {
474 System.IO.FileInfo file = new System.IO.FileInfo(filename); 475 FileInfo file = new FileInfo(filename);
475 System.IO.FileStream s = file.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read); 476 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
476 System.IO.BinaryReader bs = new System.IO.BinaryReader(s); 477 BinaryReader bs = new BinaryReader(s);
477 int x, y; 478 int x, y;
478 for (x = 0; x < w; x++) 479 for (x = 0; x < w; x++)
479 { 480 {
@@ -496,9 +497,9 @@ namespace OpenSim.Region.Terrain
496 /// <param name="filename">The desired output filename</param> 497 /// <param name="filename">The desired output filename</param>
497 public void writeToFileF64(string filename) 498 public void writeToFileF64(string filename)
498 { 499 {
499 System.IO.FileInfo file = new System.IO.FileInfo(filename); 500 FileInfo file = new FileInfo(filename);
500 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); 501 FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write);
501 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); 502 BinaryWriter bs = new BinaryWriter(s);
502 503
503 int x, y; 504 int x, y;
504 for (x = 0; x < w; x++) 505 for (x = 0; x < w; x++)
@@ -519,9 +520,9 @@ namespace OpenSim.Region.Terrain
519 /// <param name="filename">The desired output filename</param> 520 /// <param name="filename">The desired output filename</param>
520 public void writeToFileF32(string filename) 521 public void writeToFileF32(string filename)
521 { 522 {
522 System.IO.FileInfo file = new System.IO.FileInfo(filename); 523 FileInfo file = new FileInfo(filename);
523 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); 524 FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write);
524 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); 525 BinaryWriter bs = new BinaryWriter(s);
525 526
526 int x, y; 527 int x, y;
527 for (x = 0; x < w; x++) 528 for (x = 0; x < w; x++)
@@ -543,9 +544,9 @@ namespace OpenSim.Region.Terrain
543 /// <param name="filename">Filename to write to</param> 544 /// <param name="filename">Filename to write to</param>
544 public void writeToFileRAW(string filename) 545 public void writeToFileRAW(string filename)
545 { 546 {
546 System.IO.FileInfo file = new System.IO.FileInfo(filename); 547 FileInfo file = new FileInfo(filename);
547 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); 548 FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write);
548 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); 549 BinaryWriter bs = new BinaryWriter(s);
549 550
550 int x, y; 551 int x, y;
551 552
@@ -608,9 +609,9 @@ namespace OpenSim.Region.Terrain
608 /// <param name="filename">The filename to output to</param> 609 /// <param name="filename">The filename to output to</param>
609 public void writeToFileHiRAW(string filename) 610 public void writeToFileHiRAW(string filename)
610 { 611 {
611 System.IO.FileInfo file = new System.IO.FileInfo(filename); 612 FileInfo file = new FileInfo(filename);
612 System.IO.FileStream s = file.Open(System.IO.FileMode.CreateNew, System.IO.FileAccess.Write); 613 FileStream s = file.Open(FileMode.CreateNew, FileAccess.Write);
613 System.IO.BinaryWriter bs = new System.IO.BinaryWriter(s); 614 BinaryWriter bs = new BinaryWriter(s);
614 615
615 // Generate a smegging big lookup table to speed the operation up (it needs it) 616 // Generate a smegging big lookup table to speed the operation up (it needs it)
616 double[] lookupTable = new double[65536]; 617 double[] lookupTable = new double[65536];
@@ -872,7 +873,7 @@ namespace OpenSim.Region.Terrain
872 } 873 }
873 } 874 }
874 875
875 bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png); 876 bmp.Save(filename, ImageFormat.Png);
876 } 877 }
877 catch (Exception e) 878 catch (Exception e)
878 { 879 {
@@ -913,7 +914,7 @@ namespace OpenSim.Region.Terrain
913 } 914 }
914 915
915 //bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png); 916 //bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
916 imageData = OpenJPEGNet.OpenJPEG.EncodeFromImage(bmp, "map"); 917 imageData = OpenJPEG.EncodeFromImage(bmp, "map");
917 918
918 } 919 }
919 catch (Exception e) 920 catch (Exception e)