a few more changes to terraincompressor and libomv
parent
2ccaf54a1f
commit
ff8f70418b
|
@ -52,11 +52,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
private static string LogHeader = "[TERRAIN COMPRESSOR]";
|
private static string LogHeader = "[TERRAIN COMPRESSOR]";
|
||||||
#pragma warning restore 414
|
#pragma warning restore 414
|
||||||
|
|
||||||
public const int END_OF_PATCHES = 97;
|
|
||||||
|
|
||||||
private const float OO_SQRT2 = 0.7071068f;
|
private const float OO_SQRT2 = 0.7071068f;
|
||||||
|
private const int END_OF_PATCHES = 97;
|
||||||
private const int STRIDE = 264;
|
private const int STRIDE = 264;
|
||||||
|
|
||||||
private const int ZERO_CODE = 0x0;
|
private const int ZERO_CODE = 0x0;
|
||||||
private const int ZERO_EOB = 0x2;
|
private const int ZERO_EOB = 0x2;
|
||||||
private const int POSITIVE_VALUE = 0x6;
|
private const int POSITIVE_VALUE = 0x6;
|
||||||
|
@ -236,13 +234,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
if (Math.Round((double)frange, 2) == 1.0)
|
if (Math.Round((double)frange, 2) == 1.0)
|
||||||
{
|
{
|
||||||
// flat terrain speed up things
|
// flat terrain speed up things
|
||||||
|
output.PackBitsFromByte(0); //QuantWBits
|
||||||
header.DCOffset -= 0.5f;
|
output.PackFloat(header.DCOffset - 0.5f);
|
||||||
|
output.PackBitsFromByte(1); //range low
|
||||||
header.QuantWBits = 0x00;
|
output.PackBitsFromByte(0); //range high
|
||||||
output.PackBits(header.QuantWBits, 8);
|
|
||||||
output.PackFloat(header.DCOffset);
|
|
||||||
output.PackBits(1, 16);
|
|
||||||
if (largeRegion)
|
if (largeRegion)
|
||||||
output.PackBits(header.PatchIDs, 32);
|
output.PackBits(header.PatchIDs, 32);
|
||||||
else
|
else
|
||||||
|
@ -296,7 +291,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
header.QuantWBits &= 0xf0;
|
header.QuantWBits &= 0xf0;
|
||||||
header.QuantWBits |= (wbits - 2);
|
header.QuantWBits |= (wbits - 2);
|
||||||
|
|
||||||
output.PackBits(header.QuantWBits, 8);
|
output.PackBitsFromByte((byte)header.QuantWBits);
|
||||||
output.PackFloat(header.DCOffset);
|
output.PackFloat(header.DCOffset);
|
||||||
output.PackBits(header.Range, 16);
|
output.PackBits(header.Range, 16);
|
||||||
if (largeRegion)
|
if (largeRegion)
|
||||||
|
@ -341,11 +336,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(i < j)
|
i = j - i;
|
||||||
|
while(i > 8)
|
||||||
{
|
{
|
||||||
output.PackBits(ZERO_CODE, 1);
|
output.PackBitsFromByte(ZERO_CODE);
|
||||||
++i;
|
i -= 8;
|
||||||
}
|
}
|
||||||
|
if( i > 0)
|
||||||
|
output.PackBitsFromByte(ZERO_CODE, i);
|
||||||
|
i = j;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue