Skip to content

Commit 7180066

Browse files
committed
Prepping for world bounds fix push.
1 parent 83a7c05 commit 7180066

50 files changed

Lines changed: 1221 additions & 258 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/emotitron/Compression/Bitpackers/ArrayPackBitsExt.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
#define UNITY_ASSERTIONS
2727
#endif
2828

29-
using emotitron.Compression.Utilities;
30-
3129
namespace emotitron.Compression
3230
{
3331
/// <summary>

Assets/emotitron/Compression/Bitpackers/ArraySerializeExt.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public static void Write(this byte[] buffer, ulong value, ref int bitposition, i
389389
const int MODULUS = MAXBITS - 1;
390390
int offset = bitposition & MODULUS;
391391
int index = bitposition >> 3;
392-
392+
393393
ulong mask = ulong.MaxValue >> (64 - bits);
394394
ulong offsetmask = mask << offset;
395395
ulong offsetcomp = value << offset;
@@ -399,7 +399,7 @@ public static void Write(this byte[] buffer, ulong value, ref int bitposition, i
399399
offset = MAXBITS - offset;
400400

401401
// These are complete overwrites of the array element, so no masking is required
402-
while (offset < (bits - 8))
402+
while (offset < (bits-8))
403403
{
404404
index++;
405405
offsetcomp = value >> offset;
@@ -428,7 +428,7 @@ public static void Write(this uint[] buffer, ulong value, ref int bitposition, i
428428
const int MODULUS = MAXBITS - 1;
429429
int offset = bitposition & MODULUS;
430430
int index = bitposition >> 5;
431-
431+
432432

433433
ulong mask = ulong.MaxValue >> (64 - bits);
434434
ulong offsetmask = mask << offset;
@@ -600,7 +600,7 @@ public static ulong Read(this ulong[] buffer, ref int bitposition, int bits)
600600
#endregion
601601

602602
#region Secondary Readers
603-
603+
604604
// Ulong
605605
[System.Obsolete("Just use Read(), it return a ulong already.")]
606606
public static ulong ReadUInt64(this byte[] buffer, ref int bitposition, int bits = 64)

Assets/emotitron/Compression/Bitpackers/PrimitiveSerializeExt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public static byte WritetBool(this byte buffer, bool value, ref int bitposition)
317317

318318
public static void Inject(this bool value, ref ulong buffer, ref int bitposition)
319319
{
320-
Inject((ulong)(value ? 1 : 0), ref buffer, ref bitposition, 1);
320+
Inject((ulong)(value ? 1 : 0), ref buffer, ref bitposition, 1);
321321
}
322322
public static void Inject(this bool value, ref uint buffer, ref int bitposition)
323323
{

Assets/emotitron/Compression/TransformCrusher.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

Assets/emotitron/Compression/TransformCrusher/WorldBounds.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

Assets/emotitron/Compression/TransformCrusher/WorldBounds/Resources.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.
Binary file not shown.

Assets/emotitron/Compression/TransformCrusher/WorldBounds/Resources/WorldBoundsSO.asset.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

Assets/emotitron/Compression/Utilities/ByteConverter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
using System.Runtime.InteropServices;
2828
using System;
2929

30+
/// <summary>
31+
/// Temporariliy using the Utilities namespace to avoid collisions with the DLL still in use by NST
32+
/// </summary>
3033
namespace emotitron.Compression.Utilities
3134
{
3235

@@ -217,7 +220,7 @@ public void ExtractByteArray(byte[] targetArray)
217220
if (len > 2) targetArray[3] = byte3;
218221
if (len > 3) targetArray[4] = byte4;
219222
if (len > 4) targetArray[5] = byte5;
220-
if (len > 5) targetArray[3] = byte6;
223+
if (len > 5) targetArray[6] = byte6;
221224
if (len > 6) targetArray[7] = byte7;
222225
}
223226

Assets/emotitron/Compression/Utilities/ZigZagExt.cs

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,47 @@
22
using System.Collections.Generic;
33
using UnityEngine;
44

5-
public static class ZigZagExt
5+
6+
namespace emotitron.Compression
67
{
7-
public static ulong ZigZag(this long s)
8-
{
9-
return (ulong)((s << 1) ^ (s >> 63));
10-
}
11-
public static long UnZigZag(this ulong u)
12-
{
13-
return ((long)(u >> 1) ^ (-(long)(u & 1)));
14-
}
8+
public static class ZigZagExt
9+
{
10+
public static ulong ZigZag(this long s)
11+
{
12+
return (ulong)((s << 1) ^ (s >> 63));
13+
}
14+
public static long UnZigZag(this ulong u)
15+
{
16+
return ((long)(u >> 1) ^ (-(long)(u & 1)));
17+
}
1518

16-
public static uint ZigZag(this int s)
17-
{
18-
return (uint)((s << 1) ^ (s >> 31));
19-
}
20-
public static int UnZigZag(this uint u)
21-
{
22-
return (int)((u >> 1) ^ (-(int)(u & 1)));
23-
}
19+
public static uint ZigZag(this int s)
20+
{
21+
return (uint)((s << 1) ^ (s >> 31));
22+
}
23+
public static int UnZigZag(this uint u)
24+
{
25+
return (int)((u >> 1) ^ (-(int)(u & 1)));
26+
}
2427

25-
public static ushort ZigZag(this short s)
26-
{
27-
return (ushort)((s << 1) ^ (s >> 15));
28-
}
29-
public static short UnZigZag(this ushort u)
30-
{
31-
return (short)((u >> 1) ^ (-(short)(u & 1)));
32-
}
28+
public static ushort ZigZag(this short s)
29+
{
30+
return (ushort)((s << 1) ^ (s >> 15));
31+
}
32+
public static short UnZigZag(this ushort u)
33+
{
34+
return (short)((u >> 1) ^ (-(short)(u & 1)));
35+
}
3336

34-
public static byte ZigZag(this sbyte s)
35-
{
36-
return (byte)((s << 1) ^ (s >> 7));
37-
}
38-
public static sbyte UnZigZag(this byte u)
39-
{
40-
return (sbyte)((u >> 1) ^ (-(sbyte)(u & 1)));
37+
public static byte ZigZag(this sbyte s)
38+
{
39+
return (byte)((s << 1) ^ (s >> 7));
40+
}
41+
public static sbyte UnZigZag(this byte u)
42+
{
43+
return (sbyte)((u >> 1) ^ (-(sbyte)(u & 1)));
44+
}
4145
}
46+
4247
}
48+

0 commit comments

Comments
 (0)