From: Eunki, Hong Date: Thu, 9 Feb 2023 11:41:33 +0000 (+0900) Subject: [NUI.Scene3D] Remove warning messages X-Git-Tag: accepted/tizen/unified/20231205.024657~459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d4764262dbd1d78ed0f8b8cc2a388884b499522;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI.Scene3D] Remove warning messages Tested by `dotnet build /p:BuildWithAnalyzer=True` and checked there is no warning. Signed-off-by: Eunki, Hong --- diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Camera.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Camera.cs index e7e19f8..fa2a2ef 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/Camera.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Camera.cs @@ -662,13 +662,13 @@ namespace Tizen.NUI.Scene3D /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] - public static Radian ConvertFovFromVerticalToHorizontal(float aspect, Radian verticalFov) + public static void ConvertFovFromVerticalToHorizontal(float aspect, ref Radian fov) { - if(verticalFov == null) + if(fov == null) { - return null; + return; } - return new Radian(2.0f * (float)Math.Atan(Math.Tan(verticalFov.ConvertToFloat() * 0.5f) * aspect)); + fov.Value = 2.0f * (float)Math.Atan(Math.Tan(fov.ConvertToFloat() * 0.5f) * aspect); } /// @@ -676,13 +676,13 @@ namespace Tizen.NUI.Scene3D /// // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) [EditorBrowsable(EditorBrowsableState.Never)] - public static Radian ConvertFovFromHorizontalToVertical(float aspect, Radian horizontalFov) + public static void ConvertFovFromHorizontalToVertical(float aspect, ref Radian fov) { - if(horizontalFov == null) + if(fov == null) { - return null; + return; } - return new Radian(2.0f * (float)Math.Atan(Math.Tan(horizontalFov.ConvertToFloat() * 0.5f) / aspect)); + fov.Value = 2.0f * (float)Math.Atan(Math.Tan(fov.ConvertToFloat() * 0.5f) / aspect); } /// diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs index e3aa23a..2edd4f8 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs @@ -18,6 +18,7 @@ using System; using System.Runtime.InteropServices; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using Tizen.NUI; using Tizen.NUI.Binding; using Tizen.NUI.BaseComponents; @@ -385,6 +386,7 @@ namespace Tizen.NUI.Scene3D /// The duration in milliseconds. /// The alpha function to apply. /// 10 + [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "The ownership of camera object is not owned by this class.")] public void CameraTransition(uint index, int durationMilliSeconds, AlphaFunction alphaFunction = null) { if(inCameraTransition || GetSelectedCamera() == GetCamera(index)) @@ -410,6 +412,7 @@ namespace Tizen.NUI.Scene3D /// The duration in milliseconds. /// The alpha function to apply. /// 10 + [SuppressMessage("Microsoft.Design", "CA2000: Dispose objects before losing scope", Justification = "The ownership of camera object is not owned by this class.")] public void CameraTransition(string name, int durationMilliSeconds, AlphaFunction alphaFunction = null) { if(inCameraTransition || GetSelectedCamera() == GetCamera(name)) @@ -603,11 +606,11 @@ namespace Tizen.NUI.Scene3D float aspect = destinationCamera.AspectRatio; if (destinationCamera.ProjectionDirection == Camera.ProjectionDirectionType.Vertical) { - sourceFieldOfView = Camera.ConvertFovFromHorizontalToVertical(aspect, sourceFieldOfView); + Camera.ConvertFovFromHorizontalToVertical(aspect, ref sourceFieldOfView); } else { - sourceFieldOfView = Camera.ConvertFovFromVerticalToHorizontal(aspect, sourceFieldOfView); + Camera.ConvertFovFromVerticalToHorizontal(aspect, ref sourceFieldOfView); } }