0.1-prestable
Adam Frisby 2007-04-21 05:57:53 +00:00
parent 2844c56ef4
commit 148ed4063c
1 changed files with 19 additions and 2 deletions

View File

@ -11,6 +11,7 @@ namespace OpenSim.Terrain
/// A [normally] 256x256 heightmap /// A [normally] 256x256 heightmap
/// </summary> /// </summary>
public Channel heightmap; public Channel heightmap;
public int tainted;
int w, h; int w, h;
@ -23,6 +24,7 @@ namespace OpenSim.Terrain
h = 256; h = 256;
heightmap = new Channel(w, h); heightmap = new Channel(w, h);
tainted++;
} }
/// <summary> /// <summary>
@ -67,9 +69,11 @@ namespace OpenSim.Terrain
{ {
heightmap.map[i / w, i % w] = heights[i]; heightmap.map[i / w, i % w] = heights[i];
} }
tainted++;
} }
public float[,] setHeights2D(float[,] heights) public void setHeights2D(float[,] heights)
{ {
int x, y; int x, y;
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
@ -79,12 +83,13 @@ namespace OpenSim.Terrain
heightmap.set(x,y,(double)heights[x,y]); heightmap.set(x,y,(double)heights[x,y]);
} }
} }
return heights; tainted++;
} }
public void setRange(float min, float max) public void setRange(float min, float max)
{ {
heightmap.normalise((double)min, (double)max); heightmap.normalise((double)min, (double)max);
tainted++;
} }
/// <summary> /// <summary>
@ -108,6 +113,8 @@ namespace OpenSim.Terrain
bs.Close(); bs.Close();
s.Close(); s.Close();
tainted++;
} }
/// <summary> /// <summary>
@ -131,6 +138,8 @@ namespace OpenSim.Terrain
bs.Close(); bs.Close();
s.Close(); s.Close();
tainted++;
} }
public void writeToFileF64(string filename) public void writeToFileF64(string filename)
@ -189,6 +198,8 @@ namespace OpenSim.Terrain
{ {
heightmap.raise(rx, ry, size, amount); heightmap.raise(rx, ry, size, amount);
} }
tainted++;
} }
/// <summary> /// <summary>
@ -204,6 +215,8 @@ namespace OpenSim.Terrain
{ {
heightmap.lower(rx, ry, size, amount); heightmap.lower(rx, ry, size, amount);
} }
tainted++;
} }
/// <summary> /// <summary>
@ -217,10 +230,13 @@ namespace OpenSim.Terrain
heightmap.normalise(); heightmap.normalise();
heightmap *= 60.0; // Raise to 60m heightmap *= 60.0; // Raise to 60m
} }
tainted++;
} }
public static TerrainEngine operator *(TerrainEngine meep, Double val) { public static TerrainEngine operator *(TerrainEngine meep, Double val) {
meep.heightmap *= val; meep.heightmap *= val;
meep.tainted++;
return meep; return meep;
} }
@ -232,6 +248,7 @@ namespace OpenSim.Terrain
} }
set set
{ {
tainted++;
heightmap.set(x,y,(double)value); heightmap.set(x,y,(double)value);
} }
} }