summaryrefslogtreecommitdiff
path: root/LUT.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LUT.cs')
-rw-r--r--LUT.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/LUT.cs b/LUT.cs
index 06db8dd..a8db19d 100644
--- a/LUT.cs
+++ b/LUT.cs
@@ -102,16 +102,13 @@ namespace WorldTuningTool
for (i = 0; i < lutDataSize; i += 8)
{
Vector3 v = parsed[i / 8];
- ushort normX = (ushort)Math.Round(v.X * scale);
- ushort normY = (ushort)Math.Round(v.Y * scale);
- ushort normZ = (ushort)Math.Round(v.Z * scale);
- byte[] bytes = BitConverter.GetBytes(normX);
+ byte[] bytes = BitConverter.GetBytes((ushort)Math.Round(v.X * scale));
data[i] = bytes[0];
data[i + 1] = bytes[1];
- bytes = BitConverter.GetBytes(normY);
+ bytes = BitConverter.GetBytes((ushort)Math.Round(v.Y * scale));
data[i + 2] = bytes[0];
data[i + 3] = bytes[1];
- bytes = BitConverter.GetBytes(normZ);
+ bytes = BitConverter.GetBytes((ushort)Math.Round(v.Z * scale));
data[i + 4] = bytes[0];
data[i + 5] = bytes[1];
bytes = BitConverter.GetBytes(0x2B88); // Alpha constant.