mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Merge branch 'diva-textures-osgrid'
This commit is contained in:
@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
stringResult.AppendFormat("{0}|{1}|{2}{3}", Layers[i].Start, Layers[i].End, Layers[i].End - Layers[i].Start, strEnd);
|
||||
}
|
||||
|
||||
layerDecodeAsset.Data = Encoding.UTF8.GetBytes(stringResult.ToString());
|
||||
layerDecodeAsset.Data = Util.UTF8.GetBytes(stringResult.ToString());
|
||||
|
||||
#endregion Serialize Layer Data
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
#region Deserialize Layer Data
|
||||
|
||||
string readResult = Encoding.UTF8.GetString(layerDecodeAsset.Data);
|
||||
string readResult = Util.UTF8.GetString(layerDecodeAsset.Data);
|
||||
string[] lines = readResult.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (lines.Length == 0)
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
// Encode outbound data
|
||||
if (OutboundBody.Length > 0)
|
||||
{
|
||||
byte[] data = Encoding.UTF8.GetBytes(OutboundBody);
|
||||
byte[] data = Util.UTF8.GetBytes(OutboundBody);
|
||||
|
||||
Request.ContentLength = data.Length;
|
||||
Stream bstream = Request.GetRequestStream();
|
||||
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
if (count != 0)
|
||||
{
|
||||
// translate from bytes to ASCII text
|
||||
tempString = Encoding.UTF8.GetString(buf, 0, count);
|
||||
tempString = Util.UTF8.GetString(buf, 0, count);
|
||||
|
||||
// continue building the string
|
||||
sb.Append(tempString);
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||
{
|
||||
public struct HeightmapLookupValue : IComparable<HeightmapLookupValue>
|
||||
{
|
||||
public int Index;
|
||||
public double Value;
|
||||
public ushort Index;
|
||||
public float Value;
|
||||
|
||||
public HeightmapLookupValue(int index, double value)
|
||||
public HeightmapLookupValue(ushort index, float value)
|
||||
{
|
||||
Index = index;
|
||||
Value = value;
|
||||
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||
{
|
||||
for (int j = 0; j < 256; j++)
|
||||
{
|
||||
LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue(i + (j * 256), ((double)i * ((double)j / 128.0d)));
|
||||
LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue((ushort)(i + (j * 256)), (float)((double)i * ((double)j / 128.0d)));
|
||||
}
|
||||
}
|
||||
Array.Sort<HeightmapLookupValue>(LookupHeightTable);
|
||||
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
|
||||
|
||||
// The lookup table is pre-sorted, so we either find an exact match or
|
||||
// the next closest (smaller) match with a binary search
|
||||
index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, t));
|
||||
index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, (float)t));
|
||||
if (index < 0)
|
||||
index = ~index - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user