Remove unneccesary casts on bounds
This commit is contained in:
		
							parent
							
								
									c0666a5404
								
							
						
					
					
						commit
						e7e9c300fd
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue