Remove unneccesary casts on bounds

This commit is contained in:
Jarrod Doyle 2024-08-29 16:59:41 +01:00
parent c0666a5404
commit e7e9c300fd
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 4 additions and 4 deletions

View File

@ -375,7 +375,7 @@ public partial class Mission : Node3D
lmImages.Resize(lmLayerCount);
for (var i = 0; i < lmLayerCount; i++)
{
lmImages[i] = Image.CreateEmpty((int)bounds.Width, (int)bounds.Height, false, lightmapFormat);
lmImages[i] = Image.CreateEmpty(bounds.Width, bounds.Height, false, lightmapFormat);
}
foreach (var rect in packingRects)
@ -391,7 +391,7 @@ public partial class Mission : Node3D
var height = lightmap.Height;
var layerCount = lightmap.Layers;
var srcRect = new Rect2I(0, 0, width, height);
var dst = new Vector2I((int)rect.X, (int)rect.Y);
var dst = new Vector2I(rect.X, rect.Y);
for (var i = 0; i < layerCount; i++)
{
var cellLm = Image.CreateFromData(width, height, false, lightmapFormat, lightmap.AsBytesRgba(i));
@ -411,8 +411,8 @@ public partial class Mission : Node3D
if (v < 0) v = Math.Abs(v);
// Transform!
u = (rect.X + rect.Width * u) / (int)bounds.Width;
v = (rect.Y + rect.Height * v) / (int)bounds.Height;
u = (rect.X + rect.Width * u) / bounds.Width;
v = (rect.Y + rect.Height * v) / bounds.Height;
return new Vector2(u, v);
});
}