diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs index fd2136c..689abcf 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/RAW32.cs | |||
@@ -46,9 +46,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
46 | FileInfo file = new FileInfo(filename); | 46 | FileInfo file = new FileInfo(filename); |
47 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | 47 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); |
48 | BinaryReader bs = new BinaryReader(s); | 48 | BinaryReader bs = new BinaryReader(s); |
49 | int x, y; | 49 | int y; |
50 | for (y = 0; y < retval.Height; y++) | 50 | for (y = 0; y < retval.Height; y++) |
51 | { | 51 | { |
52 | int x; | ||
52 | for (x = 0; x < retval.Width; x++) | 53 | for (x = 0; x < retval.Width; x++) |
53 | { | 54 | { |
54 | retval[x, y] = bs.ReadSingle(); | 55 | retval[x, y] = bs.ReadSingle(); |
@@ -69,7 +70,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
69 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); | 70 | FileStream s = file.Open(FileMode.Open, FileAccess.Read); |
70 | BinaryReader bs = new BinaryReader(s); | 71 | BinaryReader bs = new BinaryReader(s); |
71 | 72 | ||
72 | int currFileXOffset = 0; | ||
73 | int currFileYOffset = 0; | 73 | int currFileYOffset = 0; |
74 | 74 | ||
75 | // if our region isn't on the first Y section of the areas to be landscaped, then | 75 | // if our region isn't on the first Y section of the areas to be landscaped, then |
@@ -84,11 +84,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
84 | 84 | ||
85 | // got to the Y start offset within the file of our region | 85 | // got to the Y start offset within the file of our region |
86 | // so read the file bits associated with our region | 86 | // so read the file bits associated with our region |
87 | int x, y; | 87 | int y; |
88 | // for each Y within our Y offset | 88 | // for each Y within our Y offset |
89 | for (y = 0; y < sectionHeight; y++) | 89 | for (y = 0; y < sectionHeight; y++) |
90 | { | 90 | { |
91 | currFileXOffset = 0; | 91 | int currFileXOffset = 0; |
92 | 92 | ||
93 | // if our region isn't the first X section of the areas to be landscaped, then | 93 | // if our region isn't the first X section of the areas to be landscaped, then |
94 | // advance the stream to the X start pos of our section in the file | 94 | // advance the stream to the X start pos of our section in the file |
@@ -100,6 +100,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
100 | } | 100 | } |
101 | 101 | ||
102 | // got to our X offset, so write our regions X line | 102 | // got to our X offset, so write our regions X line |
103 | int x; | ||
103 | for (x = 0; x < sectionWidth; x++) | 104 | for (x = 0; x < sectionWidth; x++) |
104 | { | 105 | { |
105 | // Read a strip and continue | 106 | // Read a strip and continue |
@@ -130,9 +131,10 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
130 | FileStream s = file.Open(FileMode.Create, FileAccess.Write); | 131 | FileStream s = file.Open(FileMode.Create, FileAccess.Write); |
131 | BinaryWriter bs = new BinaryWriter(s); | 132 | BinaryWriter bs = new BinaryWriter(s); |
132 | 133 | ||
133 | int x, y; | 134 | int y; |
134 | for (y = 0; y < map.Height; y++) | 135 | for (y = 0; y < map.Height; y++) |
135 | { | 136 | { |
137 | int x; | ||
136 | for (x = 0; x < map.Width; x++) | 138 | for (x = 0; x < map.Width; x++) |
137 | { | 139 | { |
138 | bs.Write((float) map[x, y]); | 140 | bs.Write((float) map[x, y]); |