diff --git a/Source/Editor/Content/Items/ContentItem.cs b/Source/Editor/Content/Items/ContentItem.cs index 6c4bd9ca6..6705b6c20 100644 --- a/Source/Editor/Content/Items/ContentItem.cs +++ b/Source/Editor/Content/Items/ContentItem.cs @@ -749,7 +749,7 @@ namespace FlaxEditor.Content } // Draw short name - Render2D.PushClip(ref textRect); + Render2D.PushClip(textRect); var scale = 0.95f * view.ViewScale; Render2D.DrawText(style.FontMedium, ShowFileExtension || view.ShowFileExtensions ? FileName : ShortName, textRect, style.Foreground, nameAlignment, TextAlignment.Center, TextWrapping.WrapWords, 1f, scale); Render2D.PopClip(); diff --git a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs index 098313610..47c6eee88 100644 --- a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs +++ b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs @@ -263,7 +263,7 @@ namespace FlaxEditor.Content.Thumbnails // Create render task but disabled for now _output = GPUDevice.Instance.CreateTexture("ThumbnailsOutput"); var desc = GPUTextureDescription.New2D(PreviewsCache.AssetIconSize, PreviewsCache.AssetIconSize, PreviewsCache.AssetIconsAtlasFormat); - _output.Init(ref desc); + _output.Init(desc); _task = Object.New(); _task.Order = 50; // Render this task later _task.Enabled = false; diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs index 81ca1af34..8f3fa292c 100644 --- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs @@ -60,14 +60,14 @@ namespace FlaxEditor.CustomEditors.Dedicated if (prefab && !prefab.WaitForLoaded()) { var prefabObjectId = actor.PrefabObjectID; - var prefabInstance = prefab.GetDefaultInstance(ref prefabObjectId); + var prefabInstance = prefab.GetDefaultInstance(prefabObjectId); if (prefabInstance != null) { // Use default prefab instance as a reference for the editor Values.SetReferenceValue(prefabInstance); // Display prefab UI (when displaying object inside Prefab Window then display only nested prefabs) - prefab.GetNestedObject(ref prefabObjectId, out var nestedPrefabId, out var nestedPrefabObjectId); + prefab.GetNestedObject(prefabObjectId, out var nestedPrefabId, out var nestedPrefabObjectId); var nestedPrefab = FlaxEngine.Content.Load(nestedPrefabId); var panel = layout.UniformGrid(); panel.CustomControl.Height = 20.0f; @@ -207,7 +207,7 @@ namespace FlaxEditor.CustomEditors.Dedicated { var actor = (Actor)Values[0]; var prefabObjectId = actor.PrefabObjectID; - var prefabInstance = prefab.GetDefaultInstance(ref prefabObjectId); + var prefabInstance = prefab.GetDefaultInstance(prefabObjectId); if (prefabInstance != null) { Values.SetReferenceValue(prefabInstance); diff --git a/Source/Editor/CustomEditors/Dedicated/ModelPrefabEditor.cs b/Source/Editor/CustomEditors/Dedicated/ModelPrefabEditor.cs index 22c5d7ece..805a4f361 100644 --- a/Source/Editor/CustomEditors/Dedicated/ModelPrefabEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/ModelPrefabEditor.cs @@ -40,7 +40,7 @@ public class ModelPrefabEditor : GenericEditor if (prefab) { var prefabObjectId = modelPrefab.PrefabObjectID; - var prefabObject = prefab.GetDefaultInstance(ref prefabObjectId); + var prefabObject = prefab.GetDefaultInstance(prefabObjectId); if (prefabObject.PrefabID == _prefabId) break; _prefabId = prefabObject.PrefabID; diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs index 706d07b32..4188295f0 100644 --- a/Source/Editor/GUI/CurveEditor.cs +++ b/Source/Editor/GUI/CurveEditor.cs @@ -941,7 +941,7 @@ namespace FlaxEditor.GUI { SetupGrid(out var min, out var max, out var pixelRange); - Render2D.PushClip(ref viewRect); + Render2D.PushClip(viewRect); if ((ShowAxes & UseMode.Vertical) == UseMode.Vertical) DrawAxis(Float2.UnitX, viewRect, min.X, max.X, pixelRange.X); @@ -954,7 +954,7 @@ namespace FlaxEditor.GUI // Draw curve if (!_showCollapsed) { - Render2D.PushClip(ref rect); + Render2D.PushClip(rect); DrawCurve(ref viewRect); Render2D.PopClip(); } diff --git a/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs b/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs index 31fcfcd22..1ea90da88 100644 --- a/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs +++ b/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs @@ -387,7 +387,7 @@ namespace FlaxEditor.GUI.Timeline.GUI { // Push clipping mask GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); var style = Style.Current; var bounds = new Rectangle(Float2.Zero, Size); diff --git a/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs b/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs index 4849c3e38..05ae245ee 100644 --- a/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs +++ b/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs @@ -51,13 +51,13 @@ namespace FlaxEditor.GUI.Timeline.GUI Matrix3x3.RotationZ(Mathf.PiOverTwo, out var m1); var m2 = Matrix3x3.Translation2D(0, timeAxisHeaderOffset); Matrix3x3.Multiply(ref m1, ref m2, out var m3); - Render2D.PushTransform(ref m3); + Render2D.PushTransform(m3); // TODO: Convert to its own sprite or 9 slice Render2D.DrawSprite(icon, new Rectangle(new Float2(10, -icon.Size.X * 0.5f - 1), Size + new Float2(0, 1)), color); Render2D.FillRectangle(new Rectangle(new Float2(-6, -icon.Size.Y * 0.5f + 7), new Float2(timeAxisOverlap, 5)), color); Render2D.PopTransform(); var textMatrix = Matrix3x3.Translation2D(12, timeAxisHeaderOffset); - Render2D.PushTransform(ref textMatrix); + Render2D.PushTransform(textMatrix); Render2D.DrawText(style.FontSmall, labelText, style.Foreground, new Float2(2, -6)); Render2D.PopTransform(); diff --git a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs index 5b59a8d7c..a1adcfcc2 100644 --- a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs @@ -527,7 +527,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks { _output = GPUDevice.Instance.CreateTexture("CameraCutMedia.Output"); var desc = GPUTextureDescription.New2D(Width, Height, PixelFormat.R8G8B8A8_UNorm); - _output.Init(ref desc); + _output.Init(desc); } if (_task == null) { diff --git a/Source/Editor/GUI/Tree/TreeNode.cs b/Source/Editor/GUI/Tree/TreeNode.cs index ed1257819..389e9df57 100644 --- a/Source/Editor/GUI/Tree/TreeNode.cs +++ b/Source/Editor/GUI/Tree/TreeNode.cs @@ -864,7 +864,7 @@ namespace FlaxEditor.GUI.Tree var child = children[i]; if (!child.Visible) continue; - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } @@ -882,7 +882,7 @@ namespace FlaxEditor.GUI.Tree var child = children[i]; if (child.Visible) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Editor/GUI/Tree/TreeNodeWithAddons.cs b/Source/Editor/GUI/Tree/TreeNodeWithAddons.cs index 5885ecc63..73d062a64 100644 --- a/Source/Editor/GUI/Tree/TreeNodeWithAddons.cs +++ b/Source/Editor/GUI/Tree/TreeNodeWithAddons.cs @@ -24,7 +24,7 @@ namespace FlaxEditor.GUI.Tree foreach (var child in Addons) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Editor/Gizmo/EditorPrimitives.cs b/Source/Editor/Gizmo/EditorPrimitives.cs index d5fb70906..c9eafcbd8 100644 --- a/Source/Editor/Gizmo/EditorPrimitives.cs +++ b/Source/Editor/Gizmo/EditorPrimitives.cs @@ -56,9 +56,9 @@ namespace FlaxEditor.Gizmo var width = output.Width; var height = output.Height; var desc = GPUTextureDescription.New2D(width, height, format, GPUTextureFlags.RenderTarget | GPUTextureFlags.ShaderResource, 1, 1, msaaLevel); - var target = RenderTargetPool.Get(ref desc); + var target = RenderTargetPool.Get(desc); desc = GPUTextureDescription.New2D(width, height, PixelFormat.D24_UNorm_S8_UInt, GPUTextureFlags.DepthStencil, 1, 1, msaaLevel); - var targetDepth = RenderTargetPool.Get(ref desc); + var targetDepth = RenderTargetPool.Get(desc); // Copy frame and clear depth context.Draw(target, input); @@ -81,16 +81,16 @@ namespace FlaxEditor.Gizmo } // Sort draw calls - renderList.SortDrawCalls(ref renderContext, false, DrawCallsListType.GBuffer); - renderList.SortDrawCalls(ref renderContext, false, DrawCallsListType.GBufferNoDecals); - renderList.SortDrawCalls(ref renderContext, true, DrawCallsListType.Forward); + renderList.SortDrawCalls(renderContext, false, DrawCallsListType.GBuffer); + renderList.SortDrawCalls(renderContext, false, DrawCallsListType.GBufferNoDecals); + renderList.SortDrawCalls(renderContext, true, DrawCallsListType.Forward); // Perform the rendering renderContext.View.Pass = DrawPass.GBuffer; - renderList.ExecuteDrawCalls(ref renderContext, DrawCallsListType.GBuffer); - renderList.ExecuteDrawCalls(ref renderContext, DrawCallsListType.GBufferNoDecals); + renderList.ExecuteDrawCalls(renderContext, DrawCallsListType.GBuffer); + renderList.ExecuteDrawCalls(renderContext, DrawCallsListType.GBufferNoDecals); renderContext.View.Pass = DrawPass.Forward; - renderList.ExecuteDrawCalls(ref renderContext, DrawCallsListType.Forward); + renderList.ExecuteDrawCalls(renderContext, DrawCallsListType.Forward); // Resolve MSAA texture if (enableMsaa) diff --git a/Source/Editor/Gizmo/GridGizmo.cs b/Source/Editor/Gizmo/GridGizmo.cs index 71f20f8c2..da6943c9f 100644 --- a/Source/Editor/Gizmo/GridGizmo.cs +++ b/Source/Editor/Gizmo/GridGizmo.cs @@ -70,7 +70,7 @@ namespace FlaxEditor.Gizmo _vertexBuffer = new GPUBuffer(); var layout = GPUVertexLayout.Get([new VertexElement(VertexElement.Types.Position, 0, 0, false, PixelFormat.R32G32B32_Float)]); var desc = GPUBufferDescription.Vertex(layout, sizeof(Float3), 4); - _vertexBuffer.Init(ref desc); + _vertexBuffer.Init(desc); } if (_indexBuffer == null) { @@ -78,7 +78,7 @@ namespace FlaxEditor.Gizmo fixed (uint* ptr = _triangles) { var desc = GPUBufferDescription.Index(sizeof(uint), _triangles.Length, new IntPtr(ptr)); - _indexBuffer.Init(ref desc); + _indexBuffer.Init(desc); } } if (_psGrid == null) @@ -90,7 +90,7 @@ namespace FlaxEditor.Gizmo desc.VS = _shader.GPU.GetVS("VS_Grid"); desc.PS = _shader.GPU.GetPS("PS_Grid"); desc.DepthWriteEnable = false; - _psGrid.Init(ref desc); + _psGrid.Init(desc); } // Update vertices of the plane diff --git a/Source/Editor/Gizmo/SelectionOutline.cs b/Source/Editor/Gizmo/SelectionOutline.cs index 410650e4f..a7fce0b2c 100644 --- a/Source/Editor/Gizmo/SelectionOutline.cs +++ b/Source/Editor/Gizmo/SelectionOutline.cs @@ -128,7 +128,7 @@ namespace FlaxEditor.Gizmo // Pick a temporary depth buffer var desc = GPUTextureDescription.New2D(input.Width, input.Height, PixelFormat.D32_Float, GPUTextureFlags.DepthStencil | GPUTextureFlags.ShaderResource); - var customDepth = RenderTargetPool.Get(ref desc); + var customDepth = RenderTargetPool.Get(desc); context.ClearDepth(customDepth.View()); // Draw objects to depth buffer @@ -148,7 +148,7 @@ namespace FlaxEditor.Gizmo _material.SetParameterValue("OutlineColor1", _color1); _material.SetParameterValue("CustomDepth", customDepth); _material.SetParameterValue("ViewInfo", new Float4(1.0f / projection.M11, 1.0f / projection.M22, far / (far - near), (-far * near) / (far - near) / far)); - Renderer.DrawPostFxMaterial(context, ref renderContext, _material, output, input.View()); + Renderer.DrawPostFxMaterial(context, renderContext, _material, output, input.View()); // Cleanup RenderTargetPool.Release(customDepth); diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs b/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs index 03c18268d..2fab098b3 100644 --- a/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs +++ b/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs @@ -151,42 +151,42 @@ namespace FlaxEditor.Gizmo Matrix.RotationY(-Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance xAxisMaterialTransform = (isXAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisX; - transAxisMesh.Draw(ref renderContext, xAxisMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + transAxisMesh.Draw(renderContext, xAxisMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Y axis Matrix.RotationX(Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance yAxisMaterialTransform = (isYAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisY; - transAxisMesh.Draw(ref renderContext, yAxisMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + transAxisMesh.Draw(renderContext, yAxisMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Z axis Matrix.RotationX(Mathf.Pi, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance zAxisMaterialTransform = (isZAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisZ; - transAxisMesh.Draw(ref renderContext, zAxisMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + transAxisMesh.Draw(renderContext, zAxisMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // XY plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.RotationX(Mathf.PiOverTwo), new Vector3(boxSize * boxScale, boxSize * boxScale, 0.0f)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance xyPlaneMaterialTransform = (_activeAxis == Axis.XY && !_isDisabled) ? _materialAxisFocus : _materialAxisX; - cubeMesh.Draw(ref renderContext, xyPlaneMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, xyPlaneMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // ZX plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.Identity, new Vector3(boxSize * boxScale, 0.0f, boxSize * boxScale)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance zxPlaneMaterialTransform = (_activeAxis == Axis.ZX && !_isDisabled) ? _materialAxisFocus : _materialAxisY; - cubeMesh.Draw(ref renderContext, zxPlaneMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, zxPlaneMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // YZ plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.RotationZ(Mathf.PiOverTwo), new Vector3(0.0f, boxSize * boxScale, boxSize * boxScale)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance yzPlaneMaterialTransform = (_activeAxis == Axis.YZ && !_isDisabled) ? _materialAxisFocus : _materialAxisZ; - cubeMesh.Draw(ref renderContext, yzPlaneMaterialTransform, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, yzPlaneMaterialTransform, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Center sphere Matrix.Scaling(gizmoModelsScale2RealGizmoSize, out m2); Matrix.Multiply(ref m2, ref m1, out m3); - sphereMesh.Draw(ref renderContext, isCenter ? _materialAxisFocus : _materialSphere, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + sphereMesh.Draw(renderContext, isCenter ? _materialAxisFocus : _materialSphere, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); break; } @@ -201,22 +201,22 @@ namespace FlaxEditor.Gizmo Matrix.RotationZ(Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance xAxisMaterialRotate = (isXAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisX; - rotationAxisMesh.Draw(ref renderContext, xAxisMaterialRotate, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + rotationAxisMesh.Draw(renderContext, xAxisMaterialRotate, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Y axis MaterialInstance yAxisMaterialRotate = (isYAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisY; - rotationAxisMesh.Draw(ref renderContext, yAxisMaterialRotate, ref m1, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + rotationAxisMesh.Draw(renderContext, yAxisMaterialRotate, m1, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Z axis Matrix.RotationX(-Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance zAxisMaterialRotate = (isZAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisZ; - rotationAxisMesh.Draw(ref renderContext, zAxisMaterialRotate, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + rotationAxisMesh.Draw(renderContext, zAxisMaterialRotate, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Center box Matrix.Scaling(gizmoModelsScale2RealGizmoSize, out m2); Matrix.Multiply(ref m2, ref m1, out m3); - sphereMesh.Draw(ref renderContext, isCenter ? _materialAxisFocus : _materialSphere, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + sphereMesh.Draw(renderContext, isCenter ? _materialAxisFocus : _materialSphere, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); break; } @@ -231,42 +231,42 @@ namespace FlaxEditor.Gizmo Matrix.RotationY(-Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref mx1, out m3); MaterialInstance xAxisMaterialRotate = (isXAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisX; - scaleAxisMesh.Draw(ref renderContext, xAxisMaterialRotate, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + scaleAxisMesh.Draw(renderContext, xAxisMaterialRotate, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Y axis Matrix.RotationX(Mathf.PiOverTwo, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance yAxisMaterialRotate = (isYAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisY; - scaleAxisMesh.Draw(ref renderContext, yAxisMaterialRotate, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + scaleAxisMesh.Draw(renderContext, yAxisMaterialRotate, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Z axis Matrix.RotationX(Mathf.Pi, out m2); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance zAxisMaterialRotate = (isZAxis && !_isDisabled) ? _materialAxisFocus : _materialAxisZ; - scaleAxisMesh.Draw(ref renderContext, zAxisMaterialRotate, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + scaleAxisMesh.Draw(renderContext, zAxisMaterialRotate, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // XY plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.RotationX(Mathf.PiOverTwo), new Vector3(boxSize * boxScale, boxSize * boxScale, 0.0f)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance xyPlaneMaterialScale = (_activeAxis == Axis.XY && !_isDisabled) ? _materialAxisFocus : _materialAxisX; - cubeMesh.Draw(ref renderContext, xyPlaneMaterialScale, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, xyPlaneMaterialScale, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // ZX plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.Identity, new Vector3(boxSize * boxScale, 0.0f, boxSize * boxScale)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance zxPlaneMaterialScale = (_activeAxis == Axis.ZX && !_isDisabled) ? _materialAxisFocus : _materialAxisZ; - cubeMesh.Draw(ref renderContext, zxPlaneMaterialScale, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, zxPlaneMaterialScale, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // YZ plane m2 = Matrix.Transformation(new Vector3(boxSize, boxSize * 0.1f, boxSize), Quaternion.RotationZ(Mathf.PiOverTwo), new Vector3(0.0f, boxSize * boxScale, boxSize * boxScale)); Matrix.Multiply(ref m2, ref m1, out m3); MaterialInstance yzPlaneMaterialScale = (_activeAxis == Axis.YZ && !_isDisabled) ? _materialAxisFocus : _materialAxisY; - cubeMesh.Draw(ref renderContext, yzPlaneMaterialScale, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, yzPlaneMaterialScale, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); // Center box Matrix.Scaling(gizmoModelsScale2RealGizmoSize, out m2); Matrix.Multiply(ref m2, ref m1, out m3); - sphereMesh.Draw(ref renderContext, isCenter ? _materialAxisFocus : _materialSphere, ref m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + sphereMesh.Draw(renderContext, isCenter ? _materialAxisFocus : _materialSphere, m3, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); break; } @@ -278,7 +278,7 @@ namespace FlaxEditor.Gizmo Transform t = _vertexSnapObject?.Transform ?? _vertexSnapObjectTo.Transform; Vector3 p = t.LocalToWorld(_vertexSnapObject != null ? _vertexSnapPoint : _vertexSnapPointTo); Matrix matrix = new Transform(p, t.Orientation, new Float3(gizmoModelsScale2RealGizmoSize)).GetWorld(); - cubeMesh.Draw(ref renderContext, _materialSphere, ref matrix, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); + cubeMesh.Draw(renderContext, _materialSphere, matrix, StaticFlags.None, true, DrawPass.Default, 0.0f, sortOrder); } } } diff --git a/Source/Editor/Gizmo/UIEditorGizmo.cs b/Source/Editor/Gizmo/UIEditorGizmo.cs index 765893bed..32e9a6639 100644 --- a/Source/Editor/Gizmo/UIEditorGizmo.cs +++ b/Source/Editor/Gizmo/UIEditorGizmo.cs @@ -499,7 +499,7 @@ namespace FlaxEditor var min = Float2.Min(upperLeft, bottomRight); var max = Float2.Max(upperLeft, bottomRight); var pixelRange = (max - min) * ViewScale; - Render2D.PushClip(ref viewRect); + Render2D.PushClip(viewRect); DrawAxis(Float2.UnitX, viewRect, min.X, max.X, pixelRange.X); DrawAxis(Float2.UnitY, viewRect, min.Y, max.Y, pixelRange.Y); Render2D.PopClip(); @@ -605,7 +605,7 @@ namespace FlaxEditor if (!drawAnySelectedControl) { drawAnySelectedControl = true; - Render2D.PushTransform(ref _cachedTransform); + Render2D.PushTransform(_cachedTransform); } var options = Editor.Instance.Options.Options.Visual; diff --git a/Source/Editor/SceneGraph/ActorNodeWithIcon.cs b/Source/Editor/SceneGraph/ActorNodeWithIcon.cs index f9820bb55..9b0bad8d9 100644 --- a/Source/Editor/SceneGraph/ActorNodeWithIcon.cs +++ b/Source/Editor/SceneGraph/ActorNodeWithIcon.cs @@ -36,7 +36,7 @@ namespace FlaxEditor.SceneGraph } var center = _actor.Transform.Translation; - ViewportIconsRenderer.GetBounds(ref center, ref ray.Ray.Position, out var sphere); + ViewportIconsRenderer.GetBounds(center, ray.Ray.Position, out var sphere); return CollisionsHelper.RayIntersectsSphere(ref ray.Ray, ref sphere, out distance); } } diff --git a/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs b/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs index 2e3d56c27..16053f0a8 100644 --- a/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs +++ b/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs @@ -184,7 +184,7 @@ namespace FlaxEditor.SceneGraph.Actors /// public override bool RayCastSelf(ref RayCastData ray, out Real distance, out Vector3 normal) { - return Brush.Intersects(Index, ref ray.Ray, out distance, out normal); + return Brush.Intersects(Index, ray.Ray, out distance, out normal); } /// diff --git a/Source/Editor/SceneGraph/Actors/FoliageNode.cs b/Source/Editor/SceneGraph/Actors/FoliageNode.cs index 8218dc10b..1332a95ec 100644 --- a/Source/Editor/SceneGraph/Actors/FoliageNode.cs +++ b/Source/Editor/SceneGraph/Actors/FoliageNode.cs @@ -58,7 +58,7 @@ namespace FlaxEditor.SceneGraph.Actors public override Transform Transform { get => Actor.GetInstance(Index).Transform; - set => Actor.SetInstanceTransform(Index, ref value); + set => Actor.SetInstanceTransform(Index, value); } /// diff --git a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs index 450960af7..02a59df20 100644 --- a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs +++ b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs @@ -1233,7 +1233,7 @@ namespace FlaxEditor.Surface.Archetypes if (point != null) { var highlightColor = point.IsMouseDown ? style.SelectionBorder : style.BackgroundSelected; - Render2D.PushTint(ref highlightColor); + Render2D.PushTint(highlightColor); Render2D.DrawTriangles(_selectedTriangles, _selectedColors); Render2D.PopTint(); } diff --git a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs index e66f38398..4b7554741 100644 --- a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs +++ b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs @@ -364,7 +364,7 @@ namespace FlaxEditor.Surface.Archetypes if (ClipChildren) { GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); } DrawChildren(); @@ -1095,7 +1095,7 @@ namespace FlaxEditor.Surface.Archetypes if (ClipChildren) { GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); } DrawChildren(); diff --git a/Source/Editor/Surface/Archetypes/Tools.cs b/Source/Editor/Surface/Archetypes/Tools.cs index aacebd189..8b815624a 100644 --- a/Source/Editor/Surface/Archetypes/Tools.cs +++ b/Source/Editor/Surface/Archetypes/Tools.cs @@ -113,7 +113,7 @@ namespace FlaxEditor.Surface.Archetypes var icons = Editor.Instance.Icons; var icon = isSelected ? icons.VisjectArrowClosed32 : icons.VisjectArrowOpen32; - Render2D.PushTransform(ref arrowTransform); + Render2D.PushTransform(arrowTransform); Render2D.DrawSprite(icon, arrowRect, color); Render2D.PopTransform(); } diff --git a/Source/Editor/Surface/SurfaceRootControl.cs b/Source/Editor/Surface/SurfaceRootControl.cs index 15d4c43cc..eb2b4575a 100644 --- a/Source/Editor/Surface/SurfaceRootControl.cs +++ b/Source/Editor/Surface/SurfaceRootControl.cs @@ -32,13 +32,13 @@ namespace FlaxEditor.Surface /// public virtual void DrawComments() { - Render2D.PushTransform(ref _cachedTransform); + Render2D.PushTransform(_cachedTransform); // Push clipping mask if (ClipChildren) { GetDesireClientArea(out Rectangle clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); } // Draw all visible child comments @@ -48,7 +48,7 @@ namespace FlaxEditor.Surface if (child is SurfaceComment && child.Visible) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } @@ -78,7 +78,7 @@ namespace FlaxEditor.Surface var childGlobalRect = new Rectangle(globalChildTransform.M31, globalChildTransform.M32, child.Width * globalChildTransform.M11, child.Height * globalChildTransform.M22); if (globalClipping.Intersects(ref childGlobalRect)) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Editor/Surface/SurfaceStyle.cs b/Source/Editor/Surface/SurfaceStyle.cs index be09f51be..01e61b7e3 100644 --- a/Source/Editor/Surface/SurfaceStyle.cs +++ b/Source/Editor/Surface/SurfaceStyle.cs @@ -320,7 +320,7 @@ namespace FlaxEditor.Surface Matrix3x3.RotationZ(rotation * Mathf.PiOverTwo) * Matrix3x3.Translation2D(endPos - dir * 8); - Render2D.PushTransform(ref arrowTransform); + Render2D.PushTransform(arrowTransform); Render2D.DrawSprite(sprite, arrowRect, color); Render2D.PopTransform(); diff --git a/Source/Editor/Surface/VisjectSurface.Draw.cs b/Source/Editor/Surface/VisjectSurface.Draw.cs index af5893907..d6a5aa053 100644 --- a/Source/Editor/Surface/VisjectSurface.Draw.cs +++ b/Source/Editor/Surface/VisjectSurface.Draw.cs @@ -241,7 +241,7 @@ namespace FlaxEditor.Surface } // Push surface view transform (scale and offset) - Render2D.PushTransform(ref _rootControl._cachedTransform); + Render2D.PushTransform(_rootControl._cachedTransform); var features = Render2D.Features; Render2D.Features = Render2D.RenderingFeatures.None; diff --git a/Source/Editor/Tools/ClothPainting.cs b/Source/Editor/Tools/ClothPainting.cs index e8ab67039..223c32750 100644 --- a/Source/Editor/Tools/ClothPainting.cs +++ b/Source/Editor/Tools/ClothPainting.cs @@ -304,7 +304,7 @@ namespace FlaxEngine.Tools _brushMaterial.SetParameterValue("DepthBuffer", Owner.RenderTask.Buffers.DepthBuffer); Quaternion rotation = RootNode.RaycastNormalRotation(ref _hitNormal); Matrix transform = Matrix.Scaling(_gizmoMode.BrushSize * 0.01f) * Matrix.RotationQuaternion(rotation) * Matrix.Translation(_hitLocation - viewOrigin); - _brushModel.Draw(ref renderContext, _brushMaterial, ref transform); + _brushModel.Draw(renderContext, _brushMaterial, transform); } } } diff --git a/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs b/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs index dd3b8635d..73a0b0530 100644 --- a/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs +++ b/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs @@ -172,7 +172,7 @@ namespace FlaxEditor.Tools.Foliage // Transform foliage instance instance.Transform = foliage.Transform.WorldToLocal(trans); - foliage.SetInstanceTransform(instanceIndex, ref instance.Transform); + foliage.SetInstanceTransform(instanceIndex, instance.Transform); foliage.RebuildClusters(); } @@ -204,7 +204,7 @@ namespace FlaxEditor.Tools.Foliage // Duplicate instance and select it var newIndex = foliage.InstancesCount; - foliage.AddInstance(ref instance); + foliage.AddInstance(instance); action.RecordEnd(); Owner.Undo?.AddAction(new MultiUndoAction(action, new EditSelectedInstanceIndexAction(GizmoMode.SelectedInstanceIndex, newIndex))); GizmoMode.SelectedInstanceIndex = newIndex; @@ -231,7 +231,7 @@ namespace FlaxEditor.Tools.Foliage { var transform = foliage.Transform.LocalToWorld(instance.Transform); renderContext.View.GetWorldMatrix(ref transform, out var world); - model.Draw(ref renderContext, _highlightMaterial, ref world, StaticFlags.None, false); + model.Draw(renderContext, _highlightMaterial, world, StaticFlags.None, false); } } @@ -247,7 +247,7 @@ namespace FlaxEditor.Tools.Foliage if (!foliage) return; var ray = Owner.MouseRay; - foliage.Intersects(ref ray, out _, out _, out var instanceIndex); + foliage.Intersects(ray, out _, out _, out var instanceIndex); // Change the selection (with undo) if (GizmoMode.SelectedInstanceIndex == instanceIndex) diff --git a/Source/Editor/Tools/Foliage/EditTab.cs b/Source/Editor/Tools/Foliage/EditTab.cs index 49e770503..9f37a61ff 100644 --- a/Source/Editor/Tools/Foliage/EditTab.cs +++ b/Source/Editor/Tools/Foliage/EditTab.cs @@ -66,7 +66,7 @@ namespace FlaxEditor.Tools.Foliage { if (Foliage != null && InstanceIndex > -1 && InstanceIndex < Foliage.InstancesCount) { - Foliage.SetInstanceTransform(InstanceIndex, ref _instance.Transform); + Foliage.SetInstanceTransform(InstanceIndex, _instance.Transform); Foliage.RebuildClusters(); } } diff --git a/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs b/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs index 2b9323466..c9f7b802b 100644 --- a/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs +++ b/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs @@ -94,7 +94,7 @@ namespace FlaxEditor.Tools.Foliage else rotation = Quaternion.LookRotation(Vector3.Cross(Vector3.Cross(brushNormal, Vector3.Forward), brushNormal), brushNormal); Matrix transform = Matrix.Scaling(Mode.CurrentBrush.Size * 0.01f) * Matrix.RotationQuaternion(rotation) * Matrix.Translation(brushPosition - renderContext.View.Origin); - _brushModel.Draw(ref renderContext, brushMaterial, ref transform); + _brushModel.Draw(renderContext, brushMaterial, transform); } } } diff --git a/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs b/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs index 29c1a782a..e72ad12ea 100644 --- a/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs +++ b/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs @@ -55,7 +55,7 @@ namespace FlaxEditor.Tools.Foliage.Undo var foliage = FlaxEngine.Object.Find(ref foliageId); _index = foliage.InstancesCount; - foliage.AddInstance(ref _instance); + foliage.AddInstance(_instance); foliage.RebuildClusters(); Editor.Instance.Scene.MarkSceneEdited(foliage.Scene); diff --git a/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs b/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs index 0a491ef05..10dd8f7a3 100644 --- a/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs +++ b/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs @@ -55,7 +55,7 @@ namespace FlaxEditor.Tools.Foliage.Undo { var foliageId = _foliageId; var foliage = FlaxEngine.Object.Find(ref foliageId); - foliage.SetInstanceTransform(_index, ref _after); + foliage.SetInstanceTransform(_index, _after); foliage.RebuildClusters(); Editor.Instance.Scene.MarkSceneEdited(foliage.Scene); } @@ -65,7 +65,7 @@ namespace FlaxEditor.Tools.Foliage.Undo { var foliageId = _foliageId; var foliage = FlaxEngine.Object.Find(ref foliageId); - foliage.SetInstanceTransform(_index, ref _before); + foliage.SetInstanceTransform(_index, _before); foliage.RebuildClusters(); Editor.Instance.Scene.MarkSceneEdited(foliage.Scene); } diff --git a/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs b/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs index f62df64be..b26baf1ea 100644 --- a/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs +++ b/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs @@ -187,7 +187,7 @@ namespace FlaxEditor.Tools.Terrain _isDone = false; // Call tool to generate the terrain patches from the input data - if (TerrainTools.GenerateTerrain(_terrain, ref _options.NumberOfPatches, _options.Heightmap, _options.HeightmapScale, _options.Splatmap1, _options.Splatmap2)) + if (TerrainTools.GenerateTerrain(_terrain, _options.NumberOfPatches, _options.Heightmap, _options.HeightmapScale, _options.Splatmap1, _options.Splatmap2)) { Editor.LogError("Failed to generate terrain. See log for more info."); } diff --git a/Source/Editor/Tools/Terrain/EditTab.cs b/Source/Editor/Tools/Terrain/EditTab.cs index 551a47974..732073db1 100644 --- a/Source/Editor/Tools/Terrain/EditTab.cs +++ b/Source/Editor/Tools/Terrain/EditTab.cs @@ -146,7 +146,7 @@ namespace FlaxEditor.Tools.Terrain _terrainId = terrain.ID; _patchCoord = patchCoord; - _data = TerrainTools.SerializePatch(terrain, ref patchCoord); + _data = TerrainTools.SerializePatch(terrain, patchCoord); } /// @@ -159,8 +159,8 @@ namespace FlaxEditor.Tools.Terrain return; } - terrain.GetPatchBounds(terrain.GetPatchIndex(ref _patchCoord), out var patchBounds); - terrain.RemovePatch(ref _patchCoord); + terrain.GetPatchBounds(terrain.GetPatchIndex(_patchCoord), out var patchBounds); + terrain.RemovePatch(_patchCoord); OnPatchEdit(terrain, ref patchBounds); } @@ -174,9 +174,9 @@ namespace FlaxEditor.Tools.Terrain return; } - terrain.AddPatch(ref _patchCoord); - TerrainTools.DeserializePatch(terrain, ref _patchCoord, _data); - terrain.GetPatchBounds(terrain.GetPatchIndex(ref _patchCoord), out var patchBounds); + terrain.AddPatch(_patchCoord); + TerrainTools.DeserializePatch(terrain, _patchCoord, _data); + terrain.GetPatchBounds(terrain.GetPatchIndex(_patchCoord), out var patchBounds); OnPatchEdit(terrain, ref patchBounds); } @@ -210,7 +210,7 @@ namespace FlaxEditor.Tools.Terrain return; var patchCoord = Gizmo.SelectedPatchCoord; - if (!CarveTab.SelectedTerrain.HasPatch(ref patchCoord)) + if (!CarveTab.SelectedTerrain.HasPatch(patchCoord)) return; var action = new DeletePatchAction(CarveTab.SelectedTerrain, ref patchCoord); @@ -247,7 +247,7 @@ namespace FlaxEditor.Tools.Terrain _terrainId = terrain.ID; _patchCoord = patchCoord; _chunkCoord = chunkCoord; - _beforeMaterial = terrain.GetChunkOverrideMaterial(ref patchCoord, ref chunkCoord)?.ID ?? Guid.Empty; + _beforeMaterial = terrain.GetChunkOverrideMaterial(patchCoord, chunkCoord)?.ID ?? Guid.Empty; _afterMaterial = toSet?.ID ?? Guid.Empty; } @@ -277,7 +277,7 @@ namespace FlaxEditor.Tools.Terrain return; } - terrain.SetChunkOverrideMaterial(ref _patchCoord, ref _chunkCoord, FlaxEngine.Content.LoadAsync(id)); + terrain.SetChunkOverrideMaterial(_patchCoord, _chunkCoord, FlaxEngine.Content.LoadAsync(id)); Editor.Instance.Scene.MarkSceneEdited(terrain.Scene); } @@ -334,9 +334,9 @@ namespace FlaxEditor.Tools.Terrain _exportTerrainButton.Visible = false; _isUpdatingUI = true; - if (terrain.HasPatch(ref patchCoord)) + if (terrain.HasPatch(patchCoord)) { - _chunkOverrideMaterial.Validator.SelectedAsset = terrain.GetChunkOverrideMaterial(ref patchCoord, ref chunkCoord); + _chunkOverrideMaterial.Validator.SelectedAsset = terrain.GetChunkOverrideMaterial(patchCoord, chunkCoord); _chunkOverrideMaterial.Enabled = true; } else @@ -349,7 +349,7 @@ namespace FlaxEditor.Tools.Terrain } case EditTerrainGizmoMode.Modes.Add: { - if (terrain.HasPatch(ref patchCoord)) + if (terrain.HasPatch(patchCoord)) { _selectionInfoLabel.Text = string.Format( "Selected terrain: {0}\nMove mouse cursor at location without a patch.", diff --git a/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs b/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs index 54a6d7fa4..c835be033 100644 --- a/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs +++ b/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs @@ -74,10 +74,10 @@ namespace FlaxEditor.Tools.Terrain { // Highlight selected chunk var patchCoord = Mode.SelectedPatchCoord; - if (terrain.HasPatch(ref patchCoord)) + if (terrain.HasPatch(patchCoord)) { var chunkCoord = Mode.SelectedChunkCoord; - terrain.DrawChunk(ref renderContext, ref patchCoord, ref chunkCoord, _highlightTerrainMaterial); + terrain.DrawChunk(renderContext, patchCoord, chunkCoord, _highlightTerrainMaterial); } break; @@ -86,7 +86,7 @@ namespace FlaxEditor.Tools.Terrain { // Highlight patch to add location var patchCoord = Mode.SelectedPatchCoord; - if (!terrain.HasPatch(ref patchCoord) && _planeModel) + if (!terrain.HasPatch(patchCoord) && _planeModel) { var planeSize = 100.0f; var patchSize = terrain.ChunkSize * FlaxEngine.Terrain.UnitsPerVertex * FlaxEngine.Terrain.PatchEdgeChunksCount; @@ -96,7 +96,7 @@ namespace FlaxEditor.Tools.Terrain Matrix.Scaling(terrain.Scale) * Matrix.RotationQuaternion(terrain.Orientation) * Matrix.Translation(terrain.Position - renderContext.View.Origin); - _planeModel.Draw(ref renderContext, _highlightMaterial, ref world); + _planeModel.Draw(renderContext, _highlightMaterial, world); } break; @@ -105,9 +105,9 @@ namespace FlaxEditor.Tools.Terrain { // Highlight selected patch var patchCoord = Mode.SelectedPatchCoord; - if (terrain.HasPatch(ref patchCoord)) + if (terrain.HasPatch(patchCoord)) { - terrain.DrawPatch(ref renderContext, ref patchCoord, _highlightTerrainMaterial); + terrain.DrawPatch(renderContext, patchCoord, _highlightTerrainMaterial); } break; } @@ -173,12 +173,12 @@ namespace FlaxEditor.Tools.Terrain return; } - terrain.AddPatch(ref _patchCoord); - if (TerrainTools.InitializePatch(terrain, ref _patchCoord)) + terrain.AddPatch(_patchCoord); + if (TerrainTools.InitializePatch(terrain, _patchCoord)) { Editor.LogError("Failed to initialize terrain patch."); } - terrain.GetPatchBounds(terrain.GetPatchIndex(ref _patchCoord), out var patchBounds); + terrain.GetPatchBounds(terrain.GetPatchIndex(_patchCoord), out var patchBounds); OnPatchEdit(terrain, ref patchBounds); } @@ -192,8 +192,8 @@ namespace FlaxEditor.Tools.Terrain return; } - terrain.GetPatchBounds(terrain.GetPatchIndex(ref _patchCoord), out var patchBounds); - terrain.RemovePatch(ref _patchCoord); + terrain.GetPatchBounds(terrain.GetPatchIndex(_patchCoord), out var patchBounds); + terrain.RemovePatch(_patchCoord); OnPatchEdit(terrain, ref patchBounds); } @@ -226,7 +226,7 @@ namespace FlaxEditor.Tools.Terrain if (terrain) { var patchCoord = Mode.SelectedPatchCoord; - if (!terrain.HasPatch(ref patchCoord)) + if (!terrain.HasPatch(patchCoord)) { // Add a new patch (with undo) var action = new AddPatchAction(terrain, ref patchCoord); diff --git a/Source/Editor/Tools/Terrain/Paint/Mode.cs b/Source/Editor/Tools/Terrain/Paint/Mode.cs index cee3157d3..82858467c 100644 --- a/Source/Editor/Tools/Terrain/Paint/Mode.cs +++ b/Source/Editor/Tools/Terrain/Paint/Mode.cs @@ -132,11 +132,11 @@ namespace FlaxEditor.Tools.Terrain.Paint continue; // Get the patch data (cached internally by the c++ core in editor) - var sourceData = TerrainTools.GetSplatMapData(terrain, ref patch.PatchCoord, splatmapIndex); + var sourceData = TerrainTools.GetSplatMapData(terrain, patch.PatchCoord, splatmapIndex); if (sourceData == null) throw new Exception("Cannot modify terrain. Loading splatmap failed. See log for more info."); - var sourceDataOther = TerrainTools.GetSplatMapData(terrain, ref patch.PatchCoord, splatmapIndexOther); + var sourceDataOther = TerrainTools.GetSplatMapData(terrain, patch.PatchCoord, splatmapIndexOther); if (sourceDataOther == null) throw new Exception("Cannot modify terrain. Loading splatmap failed. See log for more info."); diff --git a/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs b/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs index 0bac04371..075f5e2ee 100644 --- a/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs +++ b/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs @@ -115,9 +115,9 @@ namespace FlaxEditor.Tools.Terrain.Paint Profiler.EndEvent(); // Update terrain patch - TerrainTools.ModifySplatMap(p.Terrain, ref p.PatchCoord, p.SplatmapIndex, p.TempBuffer, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifySplatMap(p.Terrain, p.PatchCoord, p.SplatmapIndex, p.TempBuffer, p.ModifiedOffset, p.ModifiedSize); if (otherModified) - TerrainTools.ModifySplatMap(p.Terrain, ref p.PatchCoord, p.SplatmapIndexOther, p.TempBufferOther, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifySplatMap(p.Terrain, p.PatchCoord, p.SplatmapIndexOther, p.TempBufferOther, p.ModifiedOffset, p.ModifiedSize); } } } diff --git a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs index 22489ff2f..815eadd8d 100644 --- a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs +++ b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs @@ -81,7 +81,7 @@ namespace FlaxEditor.Tools.Terrain for (int i = 0; i < Mode.ChunksUnderCursor.Count; i++) { var chunk = Mode.ChunksUnderCursor[i]; - terrain.DrawChunk(ref renderContext, ref chunk.PatchCoord, ref chunk.ChunkCoord, brushMaterial, 0); + terrain.DrawChunk(renderContext, chunk.PatchCoord, chunk.ChunkCoord, brushMaterial, 0); } } } diff --git a/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs b/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs index 156fdb49b..c75b758fa 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs @@ -55,7 +55,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt Profiler.EndEvent(); // Update terrain patch - TerrainTools.ModifyHeightMap(p.Terrain, ref p.PatchCoord, p.TempBuffer, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifyHeightMap(p.Terrain, p.PatchCoord, p.TempBuffer, p.ModifiedOffset, p.ModifiedSize); } } } diff --git a/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs b/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs index 13bfc6491..0c356d84a 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs @@ -54,7 +54,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt Profiler.EndEvent(); // Update terrain patch - TerrainTools.ModifyHolesMask(p.Terrain, ref p.PatchCoord, tempBuffer, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifyHolesMask(p.Terrain, p.PatchCoord, tempBuffer, p.ModifiedOffset, p.ModifiedSize); } } } diff --git a/Source/Editor/Tools/Terrain/Sculpt/Mode.cs b/Source/Editor/Tools/Terrain/Sculpt/Mode.cs index f37902f39..dc98319a6 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/Mode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/Mode.cs @@ -119,8 +119,8 @@ namespace FlaxEditor.Tools.Terrain.Sculpt continue; // Get the patch data (cached internally by the c++ core in editor) - float* sourceHeights = EditHoles ? null : TerrainTools.GetHeightmapData(terrain, ref patch.PatchCoord); - byte* sourceHoles = EditHoles ? TerrainTools.GetHolesMaskData(terrain, ref patch.PatchCoord) : null; + float* sourceHeights = EditHoles ? null : TerrainTools.GetHeightmapData(terrain, patch.PatchCoord); + byte* sourceHoles = EditHoles ? TerrainTools.GetHolesMaskData(terrain, patch.PatchCoord) : null; if (sourceHeights == null && sourceHoles == null) throw new Exception("Cannot modify terrain. Loading heightmap failed. See log for more info."); diff --git a/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs b/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs index 4aa1f67d8..c45e283f6 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs @@ -60,7 +60,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt Profiler.EndEvent(); // Update terrain patch - TerrainTools.ModifyHeightMap(p.Terrain, ref p.PatchCoord, p.TempBuffer, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifyHeightMap(p.Terrain, p.PatchCoord, p.TempBuffer, p.ModifiedOffset, p.ModifiedSize); } } } diff --git a/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs b/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs index 6f4e449b2..640a7b45e 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs @@ -41,7 +41,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt Profiler.EndEvent(); // Update terrain patch - TerrainTools.ModifyHeightMap(p.Terrain, ref p.PatchCoord, p.TempBuffer, ref p.ModifiedOffset, ref p.ModifiedSize); + TerrainTools.ModifyHeightMap(p.Terrain, p.PatchCoord, p.TempBuffer, p.ModifiedOffset, p.ModifiedSize); } } } diff --git a/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs b/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs index 128b71ac2..670335c21 100644 --- a/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs +++ b/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs @@ -138,7 +138,7 @@ namespace FlaxEditor.Tools.Terrain.Sculpt } // Update terrain patch - TerrainTools.ModifyHeightMap(patch.Terrain, ref patch.PatchCoord, patch.TempBuffer, ref patch.ModifiedOffset, ref patch.ModifiedSize); + TerrainTools.ModifyHeightMap(patch.Terrain, patch.PatchCoord, patch.TempBuffer, patch.ModifiedOffset, patch.ModifiedSize); } // Auto NavMesh rebuild diff --git a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs index 2dd495072..5cbd8b11d 100644 --- a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs +++ b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs @@ -81,7 +81,7 @@ namespace FlaxEditor.Tools.Terrain for (int i = 0; i < Mode.ChunksUnderCursor.Count; i++) { var chunk = Mode.ChunksUnderCursor[i]; - terrain.DrawChunk(ref renderContext, ref chunk.PatchCoord, ref chunk.ChunkCoord, brushMaterial); + terrain.DrawChunk(renderContext, chunk.PatchCoord, chunk.ChunkCoord, brushMaterial); } } } diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs index 69e3b26fc..6c9a122b1 100644 --- a/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs +++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs @@ -28,7 +28,7 @@ namespace FlaxEditor.Tools.Terrain.Undo /// protected override IntPtr GetData(ref Int2 patchCoord, object tag) { - return new IntPtr(TerrainTools.GetHeightmapData(Terrain, ref patchCoord)); + return new IntPtr(TerrainTools.GetHeightmapData(Terrain, patchCoord)); } /// @@ -36,7 +36,7 @@ namespace FlaxEditor.Tools.Terrain.Undo { var offset = Int2.Zero; var size = new Int2((int)Mathf.Sqrt(_heightmapLength)); - if (TerrainTools.ModifyHeightMap(Terrain, ref patchCoord, (float*)data, ref offset, ref size)) + if (TerrainTools.ModifyHeightMap(Terrain, patchCoord, (float*)data, offset, size)) throw new Exception("Failed to modify the heightmap."); } } diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs index ac1fba519..379faecaa 100644 --- a/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs +++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs @@ -28,7 +28,7 @@ namespace FlaxEditor.Tools.Terrain.Undo /// protected override IntPtr GetData(ref Int2 patchCoord, object tag) { - return new IntPtr(TerrainTools.GetHolesMaskData(Terrain, ref patchCoord)); + return new IntPtr(TerrainTools.GetHolesMaskData(Terrain, patchCoord)); } /// @@ -36,7 +36,7 @@ namespace FlaxEditor.Tools.Terrain.Undo { var offset = Int2.Zero; var size = new Int2((int)Mathf.Sqrt(_heightmapLength)); - if (TerrainTools.ModifyHolesMask(Terrain, ref patchCoord, (byte*)data, ref offset, ref size)) + if (TerrainTools.ModifyHolesMask(Terrain, patchCoord, (byte*)data, offset, size)) throw new Exception("Failed to modify the terrain holes."); } } diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs index 3cd085aa7..81f804791 100644 --- a/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs +++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs @@ -28,7 +28,7 @@ namespace FlaxEditor.Tools.Terrain.Undo /// protected override IntPtr GetData(ref Int2 patchCoord, object tag) { - return new IntPtr(TerrainTools.GetSplatMapData(Terrain, ref patchCoord, (int)tag)); + return new IntPtr(TerrainTools.GetSplatMapData(Terrain, patchCoord, (int)tag)); } /// @@ -36,7 +36,7 @@ namespace FlaxEditor.Tools.Terrain.Undo { var offset = Int2.Zero; var size = new Int2((int)Mathf.Sqrt(_heightmapLength)); - if (TerrainTools.ModifySplatMap(Terrain, ref patchCoord, (int)tag, (Color32*)data, ref offset, ref size)) + if (TerrainTools.ModifySplatMap(Terrain, patchCoord, (int)tag, (Color32*)data, offset, size)) throw new Exception("Failed to modify the splatmap."); } } diff --git a/Source/Editor/Tools/VertexPainting.cs b/Source/Editor/Tools/VertexPainting.cs index 643441c46..59dbd83c2 100644 --- a/Source/Editor/Tools/VertexPainting.cs +++ b/Source/Editor/Tools/VertexPainting.cs @@ -574,7 +574,7 @@ namespace FlaxEditor.Tools _brushMaterial.SetParameterValue("DepthBuffer", Owner.RenderTask.Buffers.DepthBuffer); Quaternion rotation = RootNode.RaycastNormalRotation(ref _hitNormal); Matrix transform = Matrix.Scaling(_gizmoMode.BrushSize * 0.01f) * Matrix.RotationQuaternion(rotation) * Matrix.Translation(_hitLocation - viewOrigin); - _brushModel.Draw(ref renderContext, _brushMaterial, ref transform); + _brushModel.Draw(renderContext, _brushMaterial, transform); } // Draw intersecting vertices @@ -588,7 +588,7 @@ namespace FlaxEditor.Tools var instanceTransform = _selectedModel.Transform; var modelScaleMatrix = Matrix.Scaling(_gizmoMode.PreviewVertexSize * 0.01f); var brushSphere = new BoundingSphere(_hitLocation, _gizmoMode.BrushSize); - var lodIndex = _gizmoMode.ModelLOD == -1 ? RenderTools.ComputeModelLOD(_selectedModel.Model, ref renderContext.View.Position, (float)_selectedModel.Sphere.Radius, ref renderContext) : _gizmoMode.ModelLOD; + var lodIndex = _gizmoMode.ModelLOD == -1 ? RenderTools.ComputeModelLOD(_selectedModel.Model, renderContext.View.Position, (float)_selectedModel.Sphere.Radius, renderContext) : _gizmoMode.ModelLOD; lodIndex = Mathf.Clamp(lodIndex, 0, meshDatas.Length - 1); var lodData = meshDatas[lodIndex]; if (lodData != null) @@ -606,7 +606,7 @@ namespace FlaxEditor.Tools if (brushSphere.Contains(ref pos) == ContainmentType.Disjoint) continue; Matrix transform = modelScaleMatrix * Matrix.Translation(pos - viewOrigin); - _brushModel.Draw(ref renderContext, _verticesPreviewMaterial, ref transform); + _brushModel.Draw(renderContext, _verticesPreviewMaterial, transform); } } } diff --git a/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs b/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs index d3a493b70..943e611af 100644 --- a/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs +++ b/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs @@ -35,7 +35,7 @@ namespace FlaxEditor.Actions nested.ID = ID; var prefab = FlaxEngine.Content.Load(PrefabID); if (prefab != null && - prefab.GetNestedObject(ref PrefabObjectID, out nested.PrefabID, out nested.PrefabObjectID) && + prefab.GetNestedObject(PrefabObjectID, out nested.PrefabID, out nested.PrefabObjectID) && nested.PrefabID != Guid.Empty && nested.PrefabObjectID != Guid.Empty) { diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs index e9980db8b..491af6fdb 100644 --- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs +++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs @@ -77,10 +77,10 @@ namespace FlaxEditor.Viewport Draw(ref renderContext); // Sort draw calls - renderList.SortDrawCalls(ref renderContext, true, DrawCallsListType.Forward); + renderList.SortDrawCalls(renderContext, true, DrawCallsListType.Forward); // Perform the rendering - renderList.ExecuteDrawCalls(ref renderContext, DrawCallsListType.Forward); + renderList.ExecuteDrawCalls(renderContext, DrawCallsListType.Forward); // Cleanup RenderList.ReturnToPool(renderList); @@ -344,7 +344,7 @@ namespace FlaxEditor.Viewport { // Sync debug view to avoid lag on culling/LODing var view = sceneRenderTask.View; - DebugDraw.SetView(ref view); + DebugDraw.SetView(view); } // Collect selected objects debug shapes and visuals @@ -419,7 +419,7 @@ namespace FlaxEditor.Viewport { // Use temporary intermediate buffer var desc = task.Output.Description; - var temp = RenderTargetPool.Get(ref desc); + var temp = RenderTargetPool.Get(desc); selectionOutline.Render(context, ref renderContext, task.Output, temp); // Copy the results back to the output diff --git a/Source/Editor/Viewport/PrefabWindowViewport.cs b/Source/Editor/Viewport/PrefabWindowViewport.cs index a22b4042f..a4e743f8e 100644 --- a/Source/Editor/Viewport/PrefabWindowViewport.cs +++ b/Source/Editor/Viewport/PrefabWindowViewport.cs @@ -340,7 +340,7 @@ namespace FlaxEditor.Viewport { // Sync debug view to avoid lag on culling/LODing var view = sceneRenderTask.View; - DebugDraw.SetView(ref view); + DebugDraw.SetView(view); } for (int i = 0; i < selectedParents.Count; i++) { @@ -377,7 +377,7 @@ namespace FlaxEditor.Viewport { // Use temporary intermediate buffer var desc = task.Output.Description; - var temp = RenderTargetPool.Get(ref desc); + var temp = RenderTargetPool.Get(desc); SelectionOutline.Render(context, ref renderContext, task.Output, temp); // Copy the results back to the output diff --git a/Source/Editor/Viewport/Previews/AssetPreview.cs b/Source/Editor/Viewport/Previews/AssetPreview.cs index 3583a9ff0..a601d0333 100644 --- a/Source/Editor/Viewport/Previews/AssetPreview.cs +++ b/Source/Editor/Viewport/Previews/AssetPreview.cs @@ -264,7 +264,7 @@ namespace FlaxEditor.Viewport.Previews { DebugDraw.SetContext(_debugDrawContext); DebugDraw.UpdateContext(_debugDrawContext, 1.0f / Mathf.Max(Engine.FramesPerSecond, 1)); - DebugDraw.SetView(ref renderContext.View); + DebugDraw.SetView(renderContext.View); CustomDebugDraw?.Invoke(context, ref renderContext); OnDebugDraw(context, ref renderContext); DebugDraw.Draw(ref renderContext, target.View(), targetDepth.View(), true); diff --git a/Source/Editor/Viewport/Previews/MaterialPreview.cs b/Source/Editor/Viewport/Previews/MaterialPreview.cs index 8ba8a00ee..f921c06f7 100644 --- a/Source/Editor/Viewport/Previews/MaterialPreview.cs +++ b/Source/Editor/Viewport/Previews/MaterialPreview.cs @@ -308,7 +308,7 @@ namespace FlaxEditor.Viewport.Previews var heightMapLength = heightMapSize * heightMapSize; var heightmap = new float[heightMapLength]; var patchCoord = new Int2(0, 0); - _terrain.AddPatch(ref patchCoord); + _terrain.AddPatch(patchCoord); _terrain.SetupPatchHeightMap(ref patchCoord, heightmap, null, true); _terrain.LocalPosition = new Vector3(-1000, 0, -1000); Task.AddCustomActor(_terrain); diff --git a/Source/Editor/Viewport/ViewportDraggingHelper.cs b/Source/Editor/Viewport/ViewportDraggingHelper.cs index 21287fc94..ed1c3c6ea 100644 --- a/Source/Editor/Viewport/ViewportDraggingHelper.cs +++ b/Source/Editor/Viewport/ViewportDraggingHelper.cs @@ -129,7 +129,7 @@ namespace FlaxEditor.Viewport { _previewStaticModel = (StaticModel)staticModelNode.Actor; var ray = _viewport.ConvertMouseToRay(ref location); - _previewStaticModel.IntersectsEntry(ref ray, out _, out _, out _previewModelEntryIndex); + _previewStaticModel.IntersectsEntry(ray, out _, out _, out _previewModelEntryIndex); } else if (hit is BoxBrushNode.SideLinkNode brushSurfaceNode) { @@ -240,7 +240,7 @@ namespace FlaxEditor.Viewport { var staticModel = (StaticModel)staticModelNode.Actor; var ray = _viewport.ConvertMouseToRay(ref location); - if (staticModel.IntersectsEntry(ref ray, out _, out _, out var entryIndex)) + if (staticModel.IntersectsEntry(ray, out _, out _, out var entryIndex)) { using (new UndoBlock(_owner.Undo, staticModel, "Change material")) staticModel.SetMaterial(entryIndex, material); diff --git a/Source/Editor/ViewportDebugDrawData.cs b/Source/Editor/ViewportDebugDrawData.cs index 7b5bee95c..13f73c33e 100644 --- a/Source/Editor/ViewportDebugDrawData.cs +++ b/Source/Editor/ViewportDebugDrawData.cs @@ -127,7 +127,7 @@ namespace FlaxEditor // Pick a proper LOD Float3 center = bounds.Center - renderContext.View.Origin; - int lodIndex = RenderTools.ComputeModelLOD(model, ref center, (float)bounds.Radius, ref renderContext); + int lodIndex = RenderTools.ComputeModelLOD(model, center, (float)bounds.Radius, renderContext); var lods = model.LODs; if (lods == null || lods.Length < lodIndex || lodIndex < 0) continue; @@ -138,7 +138,7 @@ namespace FlaxEditor { if (lod.Meshes[meshIndex].MaterialSlotIndex == highlight.EntryIndex) { - lod.Meshes[meshIndex].Draw(ref renderContext, _highlightMaterial, ref world); + lod.Meshes[meshIndex].Draw(renderContext, _highlightMaterial, world); } } } @@ -157,7 +157,7 @@ namespace FlaxEditor } world = Matrix.Identity; - mesh.Draw(ref renderContext, _highlightMaterial, ref world); + mesh.Draw(renderContext, _highlightMaterial, world); } Profiler.EndEvent(); diff --git a/Source/Editor/Windows/Assets/SceneAnimationWindow.cs b/Source/Editor/Windows/Assets/SceneAnimationWindow.cs index de384c60a..37b7f0291 100644 --- a/Source/Editor/Windows/Assets/SceneAnimationWindow.cs +++ b/Source/Editor/Windows/Assets/SceneAnimationWindow.cs @@ -398,7 +398,7 @@ namespace FlaxEditor.Windows.Assets for (int i = 0; i < _stagingTextures.Length; i++) { _stagingTextures[i].Texture = new GPUTexture(); - _stagingTextures[i].Texture.Init(ref stagingTextureDesc); + _stagingTextures[i].Texture.Init(stagingTextureDesc); _stagingTextures[i].AnimationFrame = -1; _stagingTextures[i].TaskFrame = -1; } diff --git a/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs b/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs index 94deb18c0..10b73418b 100644 --- a/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs +++ b/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs @@ -195,7 +195,7 @@ namespace FlaxEditor.Windows.Assets var sprite = window.Asset.GetSprite(index); var pasted = FlaxEngine.Json.JsonSerializer.Deserialize(Clipboard.Text); sprite.Area = pasted.Area; - window.Asset.SetSprite(index, ref sprite); + window.Asset.SetSprite(index, sprite); } private void OnDeleteSpriteClicked(ContextMenuButton button) diff --git a/Source/Editor/Windows/Assets/VisualScriptWindow.cs b/Source/Editor/Windows/Assets/VisualScriptWindow.cs index 35b2d927d..851d1fcbc 100644 --- a/Source/Editor/Windows/Assets/VisualScriptWindow.cs +++ b/Source/Editor/Windows/Assets/VisualScriptWindow.cs @@ -1133,7 +1133,7 @@ namespace FlaxEditor.Windows.Assets meta.Flags |= VisualScript.Flags.Sealed; // Save data to the asset - if (_asset.SaveSurface(value, ref meta)) + if (_asset.SaveSurface(value, meta)) { _surface.MarkAsEdited(); Editor.LogError("Failed to save surface data"); diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs index 5b5abf1e2..f0effcfef 100644 --- a/Source/Editor/Windows/DebugLogWindow.cs +++ b/Source/Editor/Windows/DebugLogWindow.cs @@ -143,7 +143,7 @@ namespace FlaxEditor.Windows // Title var textRect = new Rectangle(43, 2, clientRect.Width - 40, clientRect.Height - 10); - Render2D.PushClip(ref clientRect); + Render2D.PushClip(clientRect); bool coloredText = _window._colorDebugLogText; if (LogCount == 1) { diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 5f9ad71fd..9f87bc90f 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -46,7 +46,7 @@ namespace FlaxEditor.Windows if (ClipChildren) { GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); DrawChildren(); Render2D.PopClip(); } diff --git a/Source/Editor/Windows/Profiler/SingleChart.cs b/Source/Editor/Windows/Profiler/SingleChart.cs index b95eff927..1b394de30 100644 --- a/Source/Editor/Windows/Profiler/SingleChart.cs +++ b/Source/Editor/Windows/Profiler/SingleChart.cs @@ -105,7 +105,7 @@ namespace FlaxEditor.Windows.Profiler if (_samples.Count > 0) { var chartRect = new Rectangle(0, 0, Width, chartHeight); - Render2D.PushClip(ref chartRect); + Render2D.PushClip(chartRect); if (_selectedSampleIndex != -1) { diff --git a/Source/Engine/Graphics/Models/MeshAccessor.cs b/Source/Engine/Graphics/Models/MeshAccessor.cs index 228e43a8c..29ff54cf1 100644 --- a/Source/Engine/Graphics/Models/MeshAccessor.cs +++ b/Source/Engine/Graphics/Models/MeshAccessor.cs @@ -499,7 +499,7 @@ namespace FlaxEngine } bounds = new BoundingBox(min, max); } - mesh.SetBounds(ref bounds); + mesh.SetBounds(bounds); } return false; diff --git a/Source/Engine/Graphics/RenderView.cs b/Source/Engine/Graphics/RenderView.cs index 2cd27ad83..ffd131e7a 100644 --- a/Source/Engine/Graphics/RenderView.cs +++ b/Source/Engine/Graphics/RenderView.cs @@ -99,7 +99,7 @@ namespace FlaxEngine Direction = camera.Direction; Near = camera.NearPlane; Far = camera.FarPlane; - camera.GetMatrices(out View, out Projection, ref viewport, ref Origin); + camera.GetMatrices(out View, out Projection, viewport, Origin); NonJitteredProjection = Projection; TemporalAAJitter = Float4.Zero; RenderLayersMask = camera.RenderLayersMask; diff --git a/Source/Engine/Platform/Window.cs b/Source/Engine/Platform/Window.cs index 06b02457a..c0aab4ff6 100644 --- a/Source/Engine/Platform/Window.cs +++ b/Source/Engine/Platform/Window.cs @@ -201,7 +201,7 @@ namespace FlaxEngine internal void Internal_OnDraw() { Matrix3x3.Scaling(DpiScale, out var scale); - Render2D.PushTransform(ref scale); + Render2D.PushTransform(scale); GUI.Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/Render2D/Render2D.cs b/Source/Engine/Render2D/Render2D.cs index 60230b95a..c07cec560 100644 --- a/Source/Engine/Render2D/Render2D.cs +++ b/Source/Engine/Render2D/Render2D.cs @@ -122,7 +122,7 @@ namespace FlaxEngine Scale = scale, BaseLinesGapScale = baseLinesGapScale, }; - DrawText(font, text, color, ref layout); + DrawText(font, text, color, layout); } /// @@ -149,7 +149,7 @@ namespace FlaxEngine Scale = scale, BaseLinesGapScale = baseLinesGapScale, }; - DrawText(font, text, color, ref layout, customMaterial); + DrawText(font, text, color, layout, customMaterial); } /// @@ -195,7 +195,7 @@ namespace FlaxEngine throw new InvalidOperationException("Output buffer and depth buffer dimensions must be equal."); } - Begin(context, output, depthBuffer, ref viewProjection); + Begin(context, output, depthBuffer, viewProjection); try { drawableElement.Draw(); diff --git a/Source/Engine/Render2D/SpriteAtlas.cs b/Source/Engine/Render2D/SpriteAtlas.cs index 313b390ff..cd28f3ec8 100644 --- a/Source/Engine/Render2D/SpriteAtlas.cs +++ b/Source/Engine/Render2D/SpriteAtlas.cs @@ -46,7 +46,7 @@ namespace FlaxEngine throw new InvalidOperationException("Cannot use invalid sprite."); var sprite = Atlas.GetSprite(Index); sprite.Name = value; - Atlas.SetSprite(Index, ref sprite); + Atlas.SetSprite(Index, sprite); } } @@ -105,7 +105,7 @@ namespace FlaxEngine throw new InvalidOperationException("Cannot use invalid sprite."); var sprite = Atlas.GetSprite(Index); sprite.Area = value; - Atlas.SetSprite(Index, ref sprite); + Atlas.SetSprite(Index, sprite); } } diff --git a/Source/Engine/Renderer/Renderer.cs b/Source/Engine/Renderer/Renderer.cs index 2960410eb..f9947f605 100644 --- a/Source/Engine/Renderer/Renderer.cs +++ b/Source/Engine/Renderer/Renderer.cs @@ -24,7 +24,7 @@ namespace FlaxEngine temp = CollectionsMarshal.AsSpan(customActors).ToArray(); // FIXME tempCount = temp.Length; } - Internal_DrawSceneDepth(FlaxEngine.Object.GetUnmanagedPtr(context), FlaxEngine.Object.GetUnmanagedPtr(task), FlaxEngine.Object.GetUnmanagedPtr(output), temp, ref tempCount); + Internal_DrawSceneDepth(FlaxEngine.Object.GetUnmanagedPtr(context), FlaxEngine.Object.GetUnmanagedPtr(task), FlaxEngine.Object.GetUnmanagedPtr(output), temp, tempCount); } /// @@ -42,7 +42,7 @@ namespace FlaxEngine temp = CollectionsMarshal.AsSpan(customActors).ToArray(); // FIXME tempCount = temp.Length; } - Internal_DrawActors(ref renderContext, temp, ref tempCount); + Internal_DrawActors(ref renderContext, temp, tempCount); } } } diff --git a/Source/Engine/Terrain/Terrain.cs b/Source/Engine/Terrain/Terrain.cs index b9aa00cae..032bb551e 100644 --- a/Source/Engine/Terrain/Terrain.cs +++ b/Source/Engine/Terrain/Terrain.cs @@ -48,7 +48,7 @@ namespace FlaxEngine { fixed (byte* holesMaskPtr = holesMask) { - return SetupPatchHeightMap(ref patchCoord, heightMap.Length, heightMapPtr, holesMaskPtr, forceUseVirtualStorage); + return SetupPatchHeightMap(patchCoord, heightMap.Length, heightMapPtr, holesMaskPtr, forceUseVirtualStorage); } } } @@ -68,7 +68,7 @@ namespace FlaxEngine fixed (Color32* splatMapPtr = splatMap) { - return SetupPatchSplatMap(ref patchCoord, index, splatMap.Length, splatMapPtr, forceUseVirtualStorage); + return SetupPatchSplatMap(patchCoord, index, splatMap.Length, splatMapPtr, forceUseVirtualStorage); } } } diff --git a/Source/Engine/UI/GUI/CanvasScaler.cs b/Source/Engine/UI/GUI/CanvasScaler.cs index 6bd18ea51..b7f2495c4 100644 --- a/Source/Engine/UI/GUI/CanvasScaler.cs +++ b/Source/Engine/UI/GUI/CanvasScaler.cs @@ -405,7 +405,7 @@ namespace FlaxEngine.GUI if (ClipChildren) { GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); DrawChildren(); Render2D.PopClip(); } diff --git a/Source/Engine/UI/GUI/Common/Label.cs b/Source/Engine/UI/GUI/Common/Label.cs index df77acc14..6aa077210 100644 --- a/Source/Engine/UI/GUI/Common/Label.cs +++ b/Source/Engine/UI/GUI/Common/Label.cs @@ -261,7 +261,7 @@ namespace FlaxEngine.GUI var rect = new Rectangle(margin.Location, Size - margin.Size); if (ClipText) - Render2D.PushClip(ref rect); + Render2D.PushClip(rect); var color = IsMouseOver || IsNavFocused ? TextColorHighlighted : TextColor; if (!EnabledInHierarchy) @@ -326,7 +326,7 @@ namespace FlaxEngine.GUI layout.Bounds.Size.X = Width - Margin.Width; else if (_autoWidth && !_autoHeight) layout.Bounds.Size.Y = Height - Margin.Height; - _textSize = font.MeasureText(text, ref layout); + _textSize = font.MeasureText(text, layout); _textSize.Y *= BaseLinesGapScale; // Check if size is controlled via text diff --git a/Source/Engine/UI/GUI/Common/ProgressBar.cs b/Source/Engine/UI/GUI/Common/ProgressBar.cs index d569c3f4c..a8ac8d236 100644 --- a/Source/Engine/UI/GUI/Common/ProgressBar.cs +++ b/Source/Engine/UI/GUI/Common/ProgressBar.cs @@ -257,7 +257,7 @@ namespace FlaxEngine.GUI case BarMethod.Clip: var rect = new Rectangle(0, 0, Width, Height); BarMargin.ShrinkRectangle(ref rect); - Render2D.PushClip(ref barRect); + Render2D.PushClip(barRect); if (BarBrush != null) BarBrush.Draw(rect, BarColor); else diff --git a/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs b/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs index 4f45c6951..20a4af53f 100644 --- a/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs +++ b/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs @@ -90,7 +90,7 @@ namespace FlaxEngine.GUI if (_texture.Size != _textureSize) { var desc = GPUTextureDescription.New2D((int)_textureSize.X, (int)_textureSize.Y, PixelFormat.R8G8B8A8_UNorm); - if (_texture.Init(ref desc)) + if (_texture.Init(desc)) { Debug.Logger.LogHandler.LogWrite(LogType.Error, "Failed to allocate texture for RenderToTextureControl"); return; @@ -108,7 +108,7 @@ namespace FlaxEngine.GUI { var scale = _textureSize / Size; Matrix3x3.Scaling(scale.X, scale.Y, 1.0f, out var scaleMatrix); - Render2D.PushTransform(ref scaleMatrix); + Render2D.PushTransform(scaleMatrix); Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/UI/GUI/Common/RichTextBox.Parsing.cs b/Source/Engine/UI/GUI/Common/RichTextBox.Parsing.cs index 20ef1c401..901bd2dd4 100644 --- a/Source/Engine/UI/GUI/Common/RichTextBox.Parsing.cs +++ b/Source/Engine/UI/GUI/Common/RichTextBox.Parsing.cs @@ -188,7 +188,7 @@ namespace FlaxEngine.GUI var font = textBlock.Style.Font.GetFont(); if (!font) return; - var lines = font.ProcessText(_text, ref textBlock.Range); + var lines = font.ProcessText(_text, textBlock.Range); if (lines == null || lines.Length == 0) return; for (int i = 0; i < lines.Length; i++) diff --git a/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs b/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs index 2fc2ef4b3..133279812 100644 --- a/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs +++ b/Source/Engine/UI/GUI/Common/RichTextBoxBase.cs @@ -205,7 +205,7 @@ namespace FlaxEngine.GUI if (!font) break; height = font.Height / DpiScale; - return textBlock.Bounds.Location + font.GetCharPosition(_text, ref textBlock.Range, index - textBlock.Range.StartIndex); + return textBlock.Bounds.Location + font.GetCharPosition(_text, textBlock.Range, index - textBlock.Range.StartIndex); } } @@ -247,7 +247,7 @@ namespace FlaxEngine.GUI var font = textBlock.Style.Font.GetFont(); if (!font && textBlock.Range.Length > 0) break; - return font.HitTestText(_text, ref textBlock.Range, location - textBlock.Bounds.Location) + textBlock.Range.StartIndex; + return font.HitTestText(_text, textBlock.Range, location - textBlock.Bounds.Location) + textBlock.Range.StartIndex; } } @@ -404,14 +404,14 @@ namespace FlaxEngine.GUI color = textBlock.Style.ShadowColor; if (!enabled) color *= 0.6f; - Render2D.DrawText(font, _text, ref textBlock.Range, color, textBlock.Bounds.Location + textBlock.Style.ShadowOffset, textBlock.Style.CustomMaterial); + Render2D.DrawText(font, _text, textBlock.Range, color, textBlock.Bounds.Location + textBlock.Style.ShadowOffset, textBlock.Style.CustomMaterial); } // Text color = textBlock.Style.Color; if (!enabled) color *= 0.6f; - Render2D.DrawText(font, _text, ref textBlock.Range, color, textBlock.Bounds.Location, textBlock.Style.CustomMaterial); + Render2D.DrawText(font, _text, textBlock.Range, color, textBlock.Bounds.Location, textBlock.Style.CustomMaterial); } // Draw underline diff --git a/Source/Engine/UI/GUI/Common/Slider.cs b/Source/Engine/UI/GUI/Common/Slider.cs index 8c7b022fe..fb40af296 100644 --- a/Source/Engine/UI/GUI/Common/Slider.cs +++ b/Source/Engine/UI/GUI/Common/Slider.cs @@ -381,7 +381,7 @@ public class Slider : ContainerControl // Draw track fill if (FillTrack) { - Render2D.PushClip(ref fillLineRect); + Render2D.PushClip(fillLineRect); if (FillTrackBrush != null) FillTrackBrush.Draw(lineRect, TrackFillLineColor); else diff --git a/Source/Engine/UI/GUI/Common/TextBox.cs b/Source/Engine/UI/GUI/Common/TextBox.cs index 1dfd9facc..5ba93696c 100644 --- a/Source/Engine/UI/GUI/Common/TextBox.cs +++ b/Source/Engine/UI/GUI/Common/TextBox.cs @@ -154,7 +154,7 @@ namespace FlaxEngine.GUI return Float2.Zero; } - return font.MeasureText(ConvertedText(), ref _layout); + return font.MeasureText(ConvertedText(), _layout); } private Font GetFont() @@ -198,7 +198,7 @@ namespace FlaxEngine.GUI } height = font.Height / DpiScale; - return font.GetCharPosition(ConvertedText(), index, ref _layout); + return font.GetCharPosition(ConvertedText(), index, _layout); } /// @@ -210,7 +210,7 @@ namespace FlaxEngine.GUI return 0; } - return font.HitTestText(ConvertedText(), location, ref _layout); + return font.HitTestText(ConvertedText(), location, _layout); } /// @@ -251,8 +251,8 @@ namespace FlaxEngine.GUI // Check if sth is selected to draw selection if (HasSelection && IsFocused) { - var leftEdge = font.GetCharPosition(text, SelectionLeft, ref _layout); - var rightEdge = font.GetCharPosition(text, SelectionRight, ref _layout); + var leftEdge = font.GetCharPosition(text, SelectionLeft, _layout); + var rightEdge = font.GetCharPosition(text, SelectionRight, _layout); var fontHeight = font.Height; var textHeight = fontHeight / DpiScale; @@ -296,14 +296,14 @@ namespace FlaxEngine.GUI color *= 0.6f; else if (_isReadOnly) color *= 0.85f; - Render2D.DrawText(font, text, color, ref _layout, TextMaterial); + Render2D.DrawText(font, text, color, _layout, TextMaterial); } else { text = _watermarkText; if (text?.Length > 0) { - Render2D.DrawText(font, _watermarkText, WatermarkTextColor, ref _layout, TextMaterial); + Render2D.DrawText(font, _watermarkText, WatermarkTextColor, _layout, TextMaterial); } } diff --git a/Source/Engine/UI/GUI/ContainerControl.cs b/Source/Engine/UI/GUI/ContainerControl.cs index ada93ff1e..32ddb8641 100644 --- a/Source/Engine/UI/GUI/ContainerControl.cs +++ b/Source/Engine/UI/GUI/ContainerControl.cs @@ -802,7 +802,7 @@ namespace FlaxEngine.GUI if (_clipChildren) { GetDesireClientArea(out var clientArea); - Render2D.PushClip(ref clientArea); + Render2D.PushClip(clientArea); DrawChildren(); Render2D.PopClip(); } @@ -840,7 +840,7 @@ namespace FlaxEngine.GUI var childGlobalRect = new Rectangle(globalChildTransform.M31, globalChildTransform.M32, child.Width * globalChildTransform.M11, child.Height * globalChildTransform.M22); if (globalClipping.Intersects(ref childGlobalRect)) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } @@ -854,7 +854,7 @@ namespace FlaxEngine.GUI var child = children[i]; if (child.Visible) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/UI/GUI/Panels/AlphaPanel.cs b/Source/Engine/UI/GUI/Panels/AlphaPanel.cs index 7071ef04f..1e46cf873 100644 --- a/Source/Engine/UI/GUI/Panels/AlphaPanel.cs +++ b/Source/Engine/UI/GUI/Panels/AlphaPanel.cs @@ -35,12 +35,12 @@ namespace FlaxEngine.GUI if (IgnoreStack) { Color newColor = new Color(oldColor.R, oldColor.G, oldColor.B, Alpha); - Render2D.PushTint(ref newColor, false); + Render2D.PushTint(newColor, false); } else { Color newColor = new Color(oldColor.R, oldColor.G, oldColor.B, oldColor.A * Alpha); - Render2D.PushTint(ref newColor, false); + Render2D.PushTint(newColor, false); } base.Draw(); diff --git a/Source/Engine/UI/GUI/Panels/DropPanel.cs b/Source/Engine/UI/GUI/Panels/DropPanel.cs index de80f9fc5..cb142f197 100644 --- a/Source/Engine/UI/GUI/Panels/DropPanel.cs +++ b/Source/Engine/UI/GUI/Panels/DropPanel.cs @@ -428,7 +428,7 @@ namespace FlaxEngine.GUI var child = _children[i]; if (!child.IsScrollable && child.Visible) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } @@ -439,7 +439,7 @@ namespace FlaxEngine.GUI { // Draw children with clipping mask (so none of the controls will override the header) Rectangle clipMask = new Rectangle(0, HeaderHeight, Width, Height - HeaderHeight); - Render2D.PushClip(ref clipMask); + Render2D.PushClip(clipMask); if (CullChildren) { Render2D.PeekClip(out var globalClipping); @@ -453,7 +453,7 @@ namespace FlaxEngine.GUI var childGlobalRect = new Rectangle(globalChildTransform.M31, globalChildTransform.M32, child.Width * globalChildTransform.M11, child.Height * globalChildTransform.M22); if (globalClipping.Intersects(ref childGlobalRect)) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } @@ -467,7 +467,7 @@ namespace FlaxEngine.GUI var child = _children[i]; if (child.IsScrollable && child.Visible) { - Render2D.PushTransform(ref child._cachedTransform); + Render2D.PushTransform(child._cachedTransform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/UI/GUI/Panels/Panel.cs b/Source/Engine/UI/GUI/Panels/Panel.cs index ff5483d0f..354613cdf 100644 --- a/Source/Engine/UI/GUI/Panels/Panel.cs +++ b/Source/Engine/UI/GUI/Panels/Panel.cs @@ -439,14 +439,14 @@ namespace FlaxEngine.GUI // Draw scrollbars manually (they are outside the clipping bounds) if (VScrollBar != null && VScrollBar.Visible) { - Render2D.PushTransform(ref VScrollBar._cachedTransform); + Render2D.PushTransform(VScrollBar._cachedTransform); VScrollBar.Draw(); Render2D.PopTransform(); } if (HScrollBar != null && HScrollBar.Visible) { - Render2D.PushTransform(ref HScrollBar._cachedTransform); + Render2D.PushTransform(HScrollBar._cachedTransform); HScrollBar.Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/UI/GUI/RenderOutputControl.cs b/Source/Engine/UI/GUI/RenderOutputControl.cs index 8dc6707bf..ffca4686a 100644 --- a/Source/Engine/UI/GUI/RenderOutputControl.cs +++ b/Source/Engine/UI/GUI/RenderOutputControl.cs @@ -241,7 +241,7 @@ namespace FlaxEngine.GUI // Resize backbuffer var desc = GPUTextureDescription.New2D(width, height, BackBufferFormat); - _backBuffer.Init(ref desc); + _backBuffer.Init(desc); _task.Output = _backBuffer; } diff --git a/Source/Engine/UI/GUI/ScrollableControl.cs b/Source/Engine/UI/GUI/ScrollableControl.cs index 4977ac89b..319190636 100644 --- a/Source/Engine/UI/GUI/ScrollableControl.cs +++ b/Source/Engine/UI/GUI/ScrollableControl.cs @@ -59,7 +59,7 @@ namespace FlaxEngine.GUI transform.M32 += _viewOffset.Y; } - Render2D.PushTransform(ref transform); + Render2D.PushTransform(transform); child.Draw(); Render2D.PopTransform(); } diff --git a/Source/Engine/UI/GUI/Tooltip.cs b/Source/Engine/UI/GUI/Tooltip.cs index bc1b968b2..35b06ebd3 100644 --- a/Source/Engine/UI/GUI/Tooltip.cs +++ b/Source/Engine/UI/GUI/Tooltip.cs @@ -296,7 +296,7 @@ namespace FlaxEngine.GUI layout.HorizontalAlignment = TextAlignment.Center; layout.VerticalAlignment = TextAlignment.Center; layout.TextWrapping = TextWrapping.WrapWords; - var items = style.FontMedium.ProcessText(_currentText, ref layout); + var items = style.FontMedium.ProcessText(_currentText, layout); for (int i = 0; i < items.Length; i++) { ref var item = ref items[i]; diff --git a/Source/Engine/UI/UICanvas.cs b/Source/Engine/UI/UICanvas.cs index 20c81ce1c..f385864f5 100644 --- a/Source/Engine/UI/UICanvas.cs +++ b/Source/Engine/UI/UICanvas.cs @@ -455,7 +455,7 @@ namespace FlaxEngine var viewport = camera.Viewport; if (camera.UsePerspective) { - camera.GetMatrices(out tmp1, out var tmp3, ref viewport); + camera.GetMatrices(out tmp1, out var tmp3, viewport); Matrix.Multiply(ref tmp1, ref tmp3, out tmp2); var frustum = new BoundingFrustum(ref tmp2); _guiRoot.Size = new Float2(frustum.GetWidthAtDepth(Distance), frustum.GetHeightAtDepth(Distance));