diff --git a/Content/Editor/Camera/M_Camera.flax b/Content/Editor/Camera/M_Camera.flax index f43020380..7dc7ae92d 100644 --- a/Content/Editor/Camera/M_Camera.flax +++ b/Content/Editor/Camera/M_Camera.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e5eecda3ca7e8614b56a674acab1e68a319aeff6ad4efc23c6350b3ed5a7ce4 +oid sha256:e3719d6696fc99d392e692c5a33c3513194ea9b0dcbe4b912d1fd03ff6806de8 size 29740 diff --git a/Content/Editor/CubeTexturePreviewMaterial.flax b/Content/Editor/CubeTexturePreviewMaterial.flax index 1238c595e..c16e7b2c2 100644 --- a/Content/Editor/CubeTexturePreviewMaterial.flax +++ b/Content/Editor/CubeTexturePreviewMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ff38f4c346be7229cc8151fd49013c1f0f5845880e29933a410f9ff7e66e1be -size 31893 +oid sha256:251f631a68805a22eb485c75e23d292ca340e1c231e0b9cc2d2beb1996c39334 +size 31293 diff --git a/Content/Editor/DebugMaterials/DDGIDebugProbes.flax b/Content/Editor/DebugMaterials/DDGIDebugProbes.flax index 67269d782..fb9e3c5cb 100644 --- a/Content/Editor/DebugMaterials/DDGIDebugProbes.flax +++ b/Content/Editor/DebugMaterials/DDGIDebugProbes.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc3bbdd9c663f9ba6b21c9f49a645c59ba4ecd340b9d046fe60aff26bab26b3a -size 39880 +oid sha256:b9ba31cda46e670ae646719a813cab38dd1909003bada0bd391ed0b5a1c31f35 +size 39248 diff --git a/Content/Editor/DebugMaterials/SingleColor/Decal.flax b/Content/Editor/DebugMaterials/SingleColor/Decal.flax index 87f5f944a..611a08f7c 100644 --- a/Content/Editor/DebugMaterials/SingleColor/Decal.flax +++ b/Content/Editor/DebugMaterials/SingleColor/Decal.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d86213b34b35238366a621a56a95dfa5736509fd2ec93eac96eeb19d933497a +oid sha256:d4b6ca7db6f30f9e7d91aee77206bde30466fd833437dfc6eb325349038a2638 size 7822 diff --git a/Content/Editor/DebugMaterials/SingleColor/Particle.flax b/Content/Editor/DebugMaterials/SingleColor/Particle.flax index 0e3002020..2e64844ee 100644 --- a/Content/Editor/DebugMaterials/SingleColor/Particle.flax +++ b/Content/Editor/DebugMaterials/SingleColor/Particle.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97372e302cad8f94fe9d0edd256756c7b483c2d87f94c90b18bb83a5d1466085 -size 32561 +oid sha256:90a2465be9b88b4bdd1964c33583fce00583d393e9e13135fd44533072e6efe3 +size 31900 diff --git a/Content/Editor/DebugMaterials/SingleColor/Surface.flax b/Content/Editor/DebugMaterials/SingleColor/Surface.flax index eaebf22dd..857f328a7 100644 --- a/Content/Editor/DebugMaterials/SingleColor/Surface.flax +++ b/Content/Editor/DebugMaterials/SingleColor/Surface.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f10decca71d66140c7ed4ed8bdd197c0c99948a8f6dfb4bd96b6e592c2cd90a +oid sha256:a8e018c5451c59c0d51005afb368267f9a37f7af02f20e2da4043298ab694c02 size 29636 diff --git a/Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax b/Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax index 869953e5c..cc0df4ad4 100644 --- a/Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax +++ b/Content/Editor/DebugMaterials/SingleColor/SurfaceAdditive.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30655a6b7eb49e2dd9ee15bdc898905938172dc8eebeda6f1fe162557e74b875 -size 32032 +oid sha256:0f17088e79d90261b8f630807173c4544a35558956ad4cb6ef0854f8749b5504 +size 31432 diff --git a/Content/Editor/DebugMaterials/SingleColor/Terrain.flax b/Content/Editor/DebugMaterials/SingleColor/Terrain.flax index b5e7fe2c1..be610d322 100644 --- a/Content/Editor/DebugMaterials/SingleColor/Terrain.flax +++ b/Content/Editor/DebugMaterials/SingleColor/Terrain.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f36b4072904c5127daaeac2c0edde438122f5bec3ad51a1594ba1bb9d7031107 +oid sha256:0c39c88c264f5dec7818908b84900a661a6cc1e899869509cd75eb1c2a2420be size 21481 diff --git a/Content/Editor/DefaultFontMaterial.flax b/Content/Editor/DefaultFontMaterial.flax index 64d4b32ef..7305b03a3 100644 --- a/Content/Editor/DefaultFontMaterial.flax +++ b/Content/Editor/DefaultFontMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14c7aa6f518f8e19e1dff64fdd4580ff8fff6f38e29d97bed821f9fab0c5e051 +oid sha256:583f8fc1103a204c64742c370e65fe9b012f03379c36b0f8fb1ed56a89c7a9ba size 29815 diff --git a/Content/Editor/Gizmo/FoliageBrushMaterial.flax b/Content/Editor/Gizmo/FoliageBrushMaterial.flax index 15d63b305..7be601ae2 100644 --- a/Content/Editor/Gizmo/FoliageBrushMaterial.flax +++ b/Content/Editor/Gizmo/FoliageBrushMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b32dc99aad29946091ed9991fb0952d538eb7b8e2c648377d71fcc9270980e8 -size 36050 +oid sha256:eba32bfcb4daf4103f78ef0da45af03a39b7524609b77fc0abcf77da0a46b052 +size 35450 diff --git a/Content/Editor/Gizmo/Material.flax b/Content/Editor/Gizmo/Material.flax index be197ed36..de6af6bf6 100644 --- a/Content/Editor/Gizmo/Material.flax +++ b/Content/Editor/Gizmo/Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea2cb3b4c098aaa9918b60fb19ff609443829395d4fe3f382f0ea3120c06ae4d +oid sha256:5a38dff84bb7567a36681da8f49cdb42c2983716c9ce22066041e01981b6f38f size 31970 diff --git a/Content/Editor/Gizmo/MaterialWire.flax b/Content/Editor/Gizmo/MaterialWire.flax index 23f73cb6a..697c75f67 100644 --- a/Content/Editor/Gizmo/MaterialWire.flax +++ b/Content/Editor/Gizmo/MaterialWire.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbf3e89db589a1a8fa4310a3adc461a58efccc7c380980e03e557c0946967cd9 +oid sha256:089c20c734028de1d6e377c1128d37af340772daee835920e0b7f2a47277306a size 31183 diff --git a/Content/Editor/Gizmo/SelectionOutlineMaterial.flax b/Content/Editor/Gizmo/SelectionOutlineMaterial.flax index ac19a8f33..343b9d359 100644 --- a/Content/Editor/Gizmo/SelectionOutlineMaterial.flax +++ b/Content/Editor/Gizmo/SelectionOutlineMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29741ab6c49bcb4ced0139b863393f87887aaa5ae75c4c55fe3279ca71f7f99e -size 15899 +oid sha256:2e659db97079c9e4c12ed202f8f3121ed54bc72d666ee8e26012525bf6c47952 +size 15979 diff --git a/Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax b/Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax index 8f9c3dcbd..609b91ac6 100644 --- a/Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax +++ b/Content/Editor/Gizmo/VertexColorsPreviewMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:793d85a1da716994070241f65655a705e303998ff9795109e05b9a58d719b7e9 -size 31349 +oid sha256:08e51480d1e5a58d89537fecc9897a32c1f641081e0ca0e53991dc431fbafd18 +size 30749 diff --git a/Content/Editor/Highlight Material.flax b/Content/Editor/Highlight Material.flax index 4ae43e508..21da6298d 100644 --- a/Content/Editor/Highlight Material.flax +++ b/Content/Editor/Highlight Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53e555255e324465c6d92c33a5dfa0c5c6ed9ff21c0e179ca4eb006482926f65 +oid sha256:78c1b74d0c7ca3729e918ebd071b141f816792a539c1fe0a637163bba9f7de45 size 29782 diff --git a/Content/Editor/Icons/IconsMaterial.flax b/Content/Editor/Icons/IconsMaterial.flax index 1722eed94..fd49b5205 100644 --- a/Content/Editor/Icons/IconsMaterial.flax +++ b/Content/Editor/Icons/IconsMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6cfbdd620cbe28df8bb061b4bc168feabc0c76fe363e7e0736202ff81c7feb5 +oid sha256:b4ebf0e6605a5afb03cd3efbf1a35a8ee2d921d343a59c68c4e207ea1d37c974 size 29710 diff --git a/Content/Editor/IesProfilePreviewMaterial.flax b/Content/Editor/IesProfilePreviewMaterial.flax index 835eac7f0..3c2a05761 100644 --- a/Content/Editor/IesProfilePreviewMaterial.flax +++ b/Content/Editor/IesProfilePreviewMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:848245bbfbfd8cd7f38f6f84ff42f4310fd0aa6a47a66c6106de46a11635d7bc -size 18459 +oid sha256:7f011ee46428e752f6c719ab548971ae527c6536e1bf1e5de5b7cda7f901bea6 +size 18254 diff --git a/Content/Editor/MaterialTemplates/GUI.shader b/Content/Editor/MaterialTemplates/GUI.shader index 7eced6390..170d95f1a 100644 --- a/Content/Editor/MaterialTemplates/GUI.shader +++ b/Content/Editor/MaterialTemplates/GUI.shader @@ -19,6 +19,7 @@ float3 ViewDir; float TimeParam; float4 ViewInfo; float4 ScreenSize; +float4 ViewSize; @1META_CB_END // Shader resources diff --git a/Content/Editor/Particles/Particle Material Color.flax b/Content/Editor/Particles/Particle Material Color.flax index 9b9ad8b51..afb352921 100644 --- a/Content/Editor/Particles/Particle Material Color.flax +++ b/Content/Editor/Particles/Particle Material Color.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b78aec9297f8b27b3161f049f2ae54a98b826fec1c0eab7bbf4326e3966bda93 +oid sha256:240cf4a974876cf7d912fa13ccce11f8e2127690709cc8375dcb39019acf3d1d size 30092 diff --git a/Content/Editor/Particles/Smoke Material.flax b/Content/Editor/Particles/Smoke Material.flax index c53d86c0c..66dad0416 100644 --- a/Content/Editor/Particles/Smoke Material.flax +++ b/Content/Editor/Particles/Smoke Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a8de37701fbc4356db2a6abe246cdb2940cc2f60f4e8bdf72976ee557fe405b5 +oid sha256:404950e170fecb6bdd772ca06724f11e2ae3afc737c3ae6f6d72f3cae25615ce size 36203 diff --git a/Content/Editor/SpriteMaterial.flax b/Content/Editor/SpriteMaterial.flax index d6c0efb30..639e047a3 100644 --- a/Content/Editor/SpriteMaterial.flax +++ b/Content/Editor/SpriteMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e92f22c4f401af0d2f10e79f2cd1a10729ed927c63bd54c7c39cc2603ae4347e -size 31428 +oid sha256:903d85af5a3f78da2ced6896d274c954fa01361f3c3b612a23834c5a6f00d3b3 +size 30828 diff --git a/Content/Editor/Terrain/Circle Brush Material.flax b/Content/Editor/Terrain/Circle Brush Material.flax index 2cad2873c..5e4df88ce 100644 --- a/Content/Editor/Terrain/Circle Brush Material.flax +++ b/Content/Editor/Terrain/Circle Brush Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da332ee2be6aac66e6ef23702e446d937f781c95cc4c5221c95c643924c2560f +oid sha256:10305b21b274f778f317198e815e4a4fe5d12a919183415bb5c22eb5bf5c126b size 27862 diff --git a/Content/Editor/Terrain/Highlight Terrain Material.flax b/Content/Editor/Terrain/Highlight Terrain Material.flax index b95162dbe..2d1d84303 100644 --- a/Content/Editor/Terrain/Highlight Terrain Material.flax +++ b/Content/Editor/Terrain/Highlight Terrain Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:349a75d005145ad36c0acebdd04cb5da9a2cbe4ab913dcbc6756b7e1b4cf4a2d +oid sha256:465e40328422dedd792502bf61b523e75a21a6c8141d71509dc4e937bafff741 size 21534 diff --git a/Content/Editor/TexturePreviewMaterial.flax b/Content/Editor/TexturePreviewMaterial.flax index f62dbebcf..cf603fc6a 100644 --- a/Content/Editor/TexturePreviewMaterial.flax +++ b/Content/Editor/TexturePreviewMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:055baf0848477f0a12aca0686868cf998659c01db6ffba6707456895559c92d0 -size 10655 +oid sha256:50c530e40174d835aa0daa1d2a0a6cc06975c173e6aa2672238891c580a4ad52 +size 10413 diff --git a/Content/Editor/Wires Debug Material.flax b/Content/Editor/Wires Debug Material.flax index 9ddc1c50a..fb4722aa9 100644 --- a/Content/Editor/Wires Debug Material.flax +++ b/Content/Editor/Wires Debug Material.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81a6d6920c961255be654beb648f809e52e6acaa51ee95452ef31fb0c6da019d -size 30382 +oid sha256:c99e922203b5bad2e85747216ba53790bcd8ae97fe97a575aeacfe327001a815 +size 29782 diff --git a/Content/Engine/DefaultDeformableMaterial.flax b/Content/Engine/DefaultDeformableMaterial.flax index 8eddae5d3..7dad19bdc 100644 --- a/Content/Engine/DefaultDeformableMaterial.flax +++ b/Content/Engine/DefaultDeformableMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:240cfda8ceaab035eba4fa58511be7a20fdedc9264b54892748213351cd7f6a4 -size 19131 +oid sha256:16fdcea1d354ccd230bbc25ced1763e53e51c9cd24876d2a9dcf2e448fc7d800 +size 19140 diff --git a/Content/Engine/DefaultMaterial.flax b/Content/Engine/DefaultMaterial.flax index adbe36925..dcf11c4d9 100644 --- a/Content/Engine/DefaultMaterial.flax +++ b/Content/Engine/DefaultMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a5faa0d7d64f0a79ae1a663c624237ae1591333bf50526629e3e8b965f5a228 -size 31519 +oid sha256:54f3db43dd7c475d8f2ac439e4df0d119ebfe06f32430bb52515383b7defbc1b +size 31528 diff --git a/Content/Engine/DefaultTerrainMaterial.flax b/Content/Engine/DefaultTerrainMaterial.flax index e4c79a130..c4d0b0039 100644 --- a/Content/Engine/DefaultTerrainMaterial.flax +++ b/Content/Engine/DefaultTerrainMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c53325b5e71c0b022bfe762341e788d21a64791fb35001483ce85a89bb9ef25f -size 23624 +oid sha256:702f071488e43af1c317f7b7b0d192b8e97f45379c24d90e8ec6f7def7294891 +size 23633 diff --git a/Content/Engine/SingleColorMaterial.flax b/Content/Engine/SingleColorMaterial.flax index b6f051463..8dcda00ba 100644 --- a/Content/Engine/SingleColorMaterial.flax +++ b/Content/Engine/SingleColorMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afb3137a95177ce755beb4558268e9ead85a6e1f7ff80751be283f873d85e3ad +oid sha256:2cb8ff6c5c7376790725d9b9ffb698244f7977a4aa490546c2ee16e5cf6c1cfb size 29837 diff --git a/Content/Engine/SkyboxMaterial.flax b/Content/Engine/SkyboxMaterial.flax index 33f529e40..c191813df 100644 --- a/Content/Engine/SkyboxMaterial.flax +++ b/Content/Engine/SkyboxMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e4941ac11d3c828bfd919126961525baa62f11b3eb6acfc561281a1709118586 +oid sha256:2e030a81391a5b7e6d9e57d2fdb9a7402f76979df03b6e1207dbba7b316f80c7 size 31035 diff --git a/Content/Shaders/GI/DDGI.flax b/Content/Shaders/GI/DDGI.flax index 9a21ebf60..06036722b 100644 --- a/Content/Shaders/GI/DDGI.flax +++ b/Content/Shaders/GI/DDGI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0cf42c544950dd16b46719bafbcb24ce8fe3a82992aa77c57f8f13c1cb37e72f -size 19671 +oid sha256:48d4226baa1cf8751208681ad1c7d9855d5bbc5fc252acd381c24d293f8a789c +size 19190 diff --git a/Content/Shaders/GI/GlobalSurfaceAtlas.flax b/Content/Shaders/GI/GlobalSurfaceAtlas.flax index e3d29362c..ad3fe2b33 100644 --- a/Content/Shaders/GI/GlobalSurfaceAtlas.flax +++ b/Content/Shaders/GI/GlobalSurfaceAtlas.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4987c395ab87cedb82dedcab53de0166865a5a2a718aedef8b5bc45060466c9f -size 11862 +oid sha256:85611a5c4fefa268334bb564654c3631ac676354f2a61b388ca9fa09671d4686 +size 11551 diff --git a/Content/Shaders/GlobalSignDistanceField.flax b/Content/Shaders/GlobalSignDistanceField.flax index f30c01874..45eb8f6a1 100644 --- a/Content/Shaders/GlobalSignDistanceField.flax +++ b/Content/Shaders/GlobalSignDistanceField.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce0651af73a6bc605cb88d6a747f0d241d15062c19c8359c783138e476c9b0d3 -size 10943 +oid sha256:dc0f1e9b52d89f6bfa8c590deeffb464988d7d666c612592968401da52ad8d2a +size 10668 diff --git a/Content/Shaders/SSR.flax b/Content/Shaders/SSR.flax index e2c77a59c..aead60251 100644 --- a/Content/Shaders/SSR.flax +++ b/Content/Shaders/SSR.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:15dce5625a1a074796d700946e02d8cb16f3841eb55b0031ad60c77cac5ad783 -size 9342 +oid sha256:ba1748e45073edee132e1ebded3fbd963904ceeb56f3dde5e26584b5a9a6789b +size 9086 diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index 410a369b4..0b4476e0a 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -164,16 +164,16 @@ namespace FlaxEditor.Options var editorAnalyticsTrackingFile = Path.Combine(Editor.LocalCachePath, "noTracking"); if (Options.General.EnableEditorAnalytics) { - if (!File.Exists(editorAnalyticsTrackingFile)) + if (File.Exists(editorAnalyticsTrackingFile)) { - File.WriteAllText(editorAnalyticsTrackingFile, "Don't track me, please."); + File.Delete(editorAnalyticsTrackingFile); } } else { - if (File.Exists(editorAnalyticsTrackingFile)) + if (!File.Exists(editorAnalyticsTrackingFile)) { - File.Delete(editorAnalyticsTrackingFile); + File.WriteAllText(editorAnalyticsTrackingFile, "Don't track me, please."); } } } diff --git a/Source/Editor/Surface/Archetypes/Constants.cs b/Source/Editor/Surface/Archetypes/Constants.cs index 768467ebd..ff20695c0 100644 --- a/Source/Editor/Surface/Archetypes/Constants.cs +++ b/Source/Editor/Surface/Archetypes/Constants.cs @@ -1,3 +1,9 @@ +#if USE_LARGE_WORLDS +using Real = System.Double; +#else +using Real = System.Single; +#endif + // Copyright (c) 2012-2022 Wojciech Figat. All rights reserved. using System; @@ -683,6 +689,89 @@ namespace FlaxEditor.Surface.Archetypes DefaultValues = new object[] { typeof(int).FullName, typeof(string).FullName }, Elements = new[] { NodeElementArchetype.Factory.Output(0, string.Empty, null, 0) } }, + new NodeArchetype + { + TypeID = 15, + Title = "Double", + Description = "Constant floating point", + Flags = NodeFlags.AllGraphs, + Size = new Float2(110, 20), + DefaultValues = new object[] + { + 0.0d + }, + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, "Value", typeof(double), 0), + NodeElementArchetype.Factory.Float(0, 0, 0) + }, + }, + new NodeArchetype + { + TypeID = 16, + Title = "Vector2", + Description = "Constant Vector2", + Flags = NodeFlags.AllGraphs, + Size = new Float2(130, 60), + DefaultValues = new object[] + { + Vector2.Zero + }, + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, "Value", typeof(Vector2), 0), + NodeElementArchetype.Factory.Output(1, "X", typeof(Real), 1), + NodeElementArchetype.Factory.Output(2, "Y", typeof(Real), 2), + NodeElementArchetype.Factory.Vector_X(0, 1 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_Y(0, 2 * Surface.Constants.LayoutOffsetY, 0) + } + }, + new NodeArchetype + { + TypeID = 17, + Title = "Vector3", + Description = "Constant Vector3", + Flags = NodeFlags.AllGraphs, + Size = new Float2(130, 80), + DefaultValues = new object[] + { + Vector3.Zero + }, + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, "Value", typeof(Vector3), 0), + NodeElementArchetype.Factory.Output(1, "X", typeof(Real), 1), + NodeElementArchetype.Factory.Output(2, "Y", typeof(Real), 2), + NodeElementArchetype.Factory.Output(3, "Z", typeof(Real), 3), + NodeElementArchetype.Factory.Vector_X(0, 1 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_Y(0, 2 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_Z(0, 3 * Surface.Constants.LayoutOffsetY, 0) + } + }, + new NodeArchetype + { + TypeID = 18, + Title = "Vector4", + Description = "Constant Vector4", + Flags = NodeFlags.AllGraphs, + Size = new Float2(130, 100), + DefaultValues = new object[] + { + Vector4.Zero + }, + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, "Value", typeof(Vector4), 0), + NodeElementArchetype.Factory.Output(1, "X", typeof(Real), 1), + NodeElementArchetype.Factory.Output(2, "Y", typeof(Real), 2), + NodeElementArchetype.Factory.Output(3, "Z", typeof(Real), 3), + NodeElementArchetype.Factory.Output(4, "W", typeof(Real), 4), + NodeElementArchetype.Factory.Vector_X(0, 1 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_Y(0, 2 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_Z(0, 3 * Surface.Constants.LayoutOffsetY, 0), + NodeElementArchetype.Factory.Vector_W(0, 4 * Surface.Constants.LayoutOffsetY, 0) + } + }, }; /// diff --git a/Source/Editor/Surface/Archetypes/Material.cs b/Source/Editor/Surface/Archetypes/Material.cs index a010f56f9..0110c2c0e 100644 --- a/Source/Editor/Surface/Archetypes/Material.cs +++ b/Source/Editor/Surface/Archetypes/Material.cs @@ -863,6 +863,19 @@ namespace FlaxEditor.Surface.Archetypes NodeElementArchetype.Factory.TextBox(0, 40, 300, 200, 0), } }, + new NodeArchetype + { + TypeID = 39, + Title = "View Size", + Description = "The size of the view. The draw rectangle size in GUI materials.", + Flags = NodeFlags.MaterialGraph, + Size = new Float2(150, 40), + Elements = new[] + { + NodeElementArchetype.Factory.Output(0, "Size", typeof(Float2), 0), + NodeElementArchetype.Factory.Output(1, "Inv Size", typeof(Float2), 1), + } + }, }; } } diff --git a/Source/Engine/Animations/AlphaBlend.h b/Source/Engine/Animations/AlphaBlend.h index 93169e79b..6ca9384e5 100644 --- a/Source/Engine/Animations/AlphaBlend.h +++ b/Source/Engine/Animations/AlphaBlend.h @@ -86,7 +86,6 @@ API_ENUM() enum class AlphaBlendMode : byte class AlphaBlend { public: - /// /// Converts the input alpha value from a linear 0-1 value into the output alpha described by blend mode. /// diff --git a/Source/Engine/Animations/AnimationData.h b/Source/Engine/Animations/AnimationData.h index 4356d9941..28bd0229e 100644 --- a/Source/Engine/Animations/AnimationData.h +++ b/Source/Engine/Animations/AnimationData.h @@ -12,7 +12,6 @@ struct NodeAnimationData { public: - /// /// The target node name. /// @@ -34,7 +33,6 @@ public: LinearCurve Scale; public: - /// /// Initializes a new instance of the class. /// @@ -46,7 +44,6 @@ public: } public: - /// /// Evaluates the animation transformation at the specified time (only for the curves with non-empty data). /// @@ -98,7 +95,6 @@ public: struct AnimationData { public: - /// /// The duration of the animation (in frames). /// @@ -125,7 +121,6 @@ public: Array Channels; public: - /// /// Gets the length of the animation (in seconds). /// diff --git a/Source/Engine/Animations/Animations.cpp b/Source/Engine/Animations/Animations.cpp index 0f8bec912..f4e0e5952 100644 --- a/Source/Engine/Animations/Animations.cpp +++ b/Source/Engine/Animations/Animations.cpp @@ -11,7 +11,6 @@ class AnimationsService : public EngineService { public: - AnimationsService() : EngineService(TEXT("Animations"), -10) { diff --git a/Source/Engine/Animations/Animations.h b/Source/Engine/Animations/Animations.h index 9a04171d4..368c4187b 100644 --- a/Source/Engine/Animations/Animations.h +++ b/Source/Engine/Animations/Animations.h @@ -14,7 +14,7 @@ class Asset; /// API_CLASS(Static) class FLAXENGINE_API Animations { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Animations); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Animations); /// /// The system for Animations update. diff --git a/Source/Engine/Animations/Curve.h b/Source/Engine/Animations/Curve.h index 9461c8626..40080c8bf 100644 --- a/Source/Engine/Animations/Curve.h +++ b/Source/Engine/Animations/Curve.h @@ -286,15 +286,12 @@ template> class CurveBase { public: - typedef Span KeyFrameData; protected: - T _default; public: - /// /// Initializes a new instance of the class. /// @@ -320,7 +317,6 @@ public: } public: - /// /// Gets the default value for the keyframes. /// @@ -338,7 +334,6 @@ public: } public: - /// /// Evaluates the animation curve value at the specified time. /// @@ -466,7 +461,6 @@ public: } protected: - /// /// Returns a pair of keys that can be used for interpolating to field the value at the provided time. /// @@ -507,16 +501,13 @@ template> class Curve : public CurveBase { public: - typedef CurveBase Base; using KeyFrameCollection = Array; private: - KeyFrameCollection _keyframes; public: - /// /// Initializes a new instance of the class. /// @@ -552,7 +543,6 @@ public: } public: - /// /// Gets the length of the animation curve, from time zero to last keyframe. /// @@ -627,7 +617,6 @@ public: } public: - /// /// Evaluates the animation curve value at the specified time. /// @@ -745,7 +734,6 @@ public: } public: - FORCE_INLINE KeyFrame& operator[](int32 index) { return _keyframes[index]; diff --git a/Source/Engine/Animations/Graph/AnimGraph.Base.cpp b/Source/Engine/Animations/Graph/AnimGraph.Base.cpp index 35b9793d0..1ae5aee23 100644 --- a/Source/Engine/Animations/Graph/AnimGraph.Base.cpp +++ b/Source/Engine/Animations/Graph/AnimGraph.Base.cpp @@ -135,21 +135,21 @@ bool AnimGraphBase::onNodeLoaded(Node* n) // Check if this node needs a state container switch (n->GroupID) { - // Tools + // Tools case 7: switch (n->TypeID) { - // Time + // Time case 5: ADD_BUCKET(AnimationBucketInit); break; } break; - // Animation + // Animation case 9: switch (n->TypeID) { - // Output + // Output case 1: _rootNode = n; if (_rootNode->Values.Count() < 1) @@ -158,16 +158,16 @@ bool AnimGraphBase::onNodeLoaded(Node* n) _rootNode->Values[0] = (int32)RootMotionMode::NoExtraction; } break; - // Animation + // Animation case 2: ADD_BUCKET(AnimationBucketInit); n->Assets[0] = (Asset*)Content::LoadAsync((Guid)n->Values[0]); break; - // Blend with Mask + // Blend with Mask case 11: n->Assets[0] = (Asset*)Content::LoadAsync((Guid)n->Values[1]); break; - // Multi Blend 1D + // Multi Blend 1D case 12: { ADD_BUCKET(MultiBlendBucketInit); @@ -183,7 +183,7 @@ bool AnimGraphBase::onNodeLoaded(Node* n) Sorting::SortArray(n->Data.MultiBlend1D.IndicesSorted, ANIM_GRAPH_MULTI_BLEND_MAX_ANIMS, &SortMultiBlend1D, n); break; } - // Multi Blend 2D + // Multi Blend 2D case 13: { ADD_BUCKET(MultiBlendBucketInit); @@ -216,15 +216,17 @@ bool AnimGraphBase::onNodeLoaded(Node* n) Delaunay2D::Triangulate(vertices, triangles); if (triangles.Count() == 0) { - switch (vertices.Count()) + // Insert dummy triangles to have something working (eg. blend points are on the same axis) + int32 verticesLeft = vertices.Count(); + while (verticesLeft >= 3) { - case 1: - triangles.Add(Delaunay2D::Triangle(0, 0, 0)); - break; - case 2: - triangles.Add(Delaunay2D::Triangle(0, 1, 0)); - break; + verticesLeft -= 3; + triangles.Add(Delaunay2D::Triangle(verticesLeft, verticesLeft + 1, verticesLeft + 2)); } + if (verticesLeft == 1) + triangles.Add(Delaunay2D::Triangle(0, 0, 0)); + else if (verticesLeft == 2) + triangles.Add(Delaunay2D::Triangle(0, 1, 0)); } // Store triangles vertices indices (map the back to the anim node slots) @@ -239,13 +241,13 @@ bool AnimGraphBase::onNodeLoaded(Node* n) break; } - // Blend Pose + // Blend Pose case 14: { ADD_BUCKET(BlendPoseBucketInit); break; } - // State Machine + // State Machine case 18: { ADD_BUCKET(StateMachineBucketInit); @@ -261,7 +263,7 @@ bool AnimGraphBase::onNodeLoaded(Node* n) break; } - // Entry + // Entry case 19: { const auto entryTargetId = (int32)n->Values[0]; @@ -273,7 +275,7 @@ bool AnimGraphBase::onNodeLoaded(Node* n) _rootNode = entryTarget; break; } - // State + // State case 20: { // Load the graph @@ -370,19 +372,19 @@ bool AnimGraphBase::onNodeLoaded(Node* n) break; } - // State Output + // State Output case 21: { _rootNode = n; break; } - // Rule Output + // Rule Output case 22: { _rootNode = n; break; } - // Animation Graph Function + // Animation Graph Function case 24: { auto& data = n->Data.AnimationGraphFunction; @@ -401,9 +403,9 @@ bool AnimGraphBase::onNodeLoaded(Node* n) data.Graph = LoadSubGraph(graphData.Get(), graphData.Length(), TEXT("Animation Graph Function")); break; } - // Transform Node (local/model space) - // Get Node Transform (local/model space) - // IK Aim, Two Bone IK + // Transform Node (local/model space) + // Get Node Transform (local/model space) + // IK Aim, Two Bone IK case 25: case 26: case 28: @@ -418,7 +420,7 @@ bool AnimGraphBase::onNodeLoaded(Node* n) data.NodeIndex = -1; break; } - // Copy Node + // Copy Node case 27: { auto& data = n->Data.CopyNode; @@ -442,7 +444,7 @@ bool AnimGraphBase::onNodeLoaded(Node* n) } } break; - // Custom + // Custom case 13: { // Clear data diff --git a/Source/Engine/Animations/Graph/AnimGraph.h b/Source/Engine/Animations/Graph/AnimGraph.h index 70c3d9696..0b74b9d6c 100644 --- a/Source/Engine/Animations/Graph/AnimGraph.h +++ b/Source/Engine/Animations/Graph/AnimGraph.h @@ -167,7 +167,6 @@ enum class RootMotionMode class AnimGraphStateTransition { public: - /// /// The transition flag types. /// @@ -195,7 +194,6 @@ public: }; public: - /// /// The destination state node. /// @@ -230,9 +228,8 @@ DECLARE_ENUM_OPERATORS(AnimGraphStateTransition::FlagTypes); /// API_CLASS() class AnimGraphParameter : public VisjectGraphParameter { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(AnimGraphParameter, VisjectGraphParameter); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(AnimGraphParameter, VisjectGraphParameter); public: - AnimGraphParameter(const AnimGraphParameter& other) : AnimGraphParameter() { @@ -271,7 +268,6 @@ class FLAXENGINE_API AnimGraphInstanceData { friend AnimGraphExecutor; public: - // ---- Quick documentation ---- // AnimGraphInstanceData holds a single animation graph instance playback data. // It has parameters (the same layout as graph) that can be modified per instance (eg. by game scripts). @@ -335,7 +331,6 @@ public: }; public: - /// /// The instance data version number. Used to sync the Anim Graph data with the instance state. Handles Anim Graph reloads to ensure data is valid. /// @@ -392,7 +387,6 @@ public: Array> Slots; public: - /// /// Clears this container data. /// @@ -409,7 +403,6 @@ public: void Invalidate(); private: - struct Event { AnimEvent* Instance; @@ -433,7 +426,6 @@ struct AnimGraphTransitionData class AnimGraphBox : public VisjectGraphBox { public: - AnimGraphBox() { } @@ -452,7 +444,6 @@ public: class AnimGraphNode : public VisjectGraphNode { public: - struct MultiBlend1DData { /// @@ -575,7 +566,6 @@ public: }; public: - /// /// The animation graph. /// @@ -592,13 +582,11 @@ public: AdditionalData Data; public: - AnimGraphNode() { } public: - /// /// Gets the per-node node transformations cache (cached). /// @@ -614,7 +602,6 @@ public: class AnimGraphBase : public VisjectGraph { protected: - AnimGraph* _graph; Node* _rootNode = nullptr; @@ -624,7 +611,6 @@ protected: } public: - /// /// The sub graphs nested in this graph. /// @@ -651,7 +637,6 @@ public: int32 BucketsCountTotal; public: - /// /// Finalizes an instance of the class. /// @@ -661,7 +646,6 @@ public: } public: - /// /// Gets the root node of the graph (cache don load). /// @@ -680,7 +664,6 @@ public: AnimSubGraph* LoadSubGraph(const void* data, int32 dataLength, const Char* name); public: - // [Graph] bool Load(ReadStream* stream, bool loadMeta) override; void Clear() override; @@ -689,7 +672,6 @@ public: #endif protected: - // [Graph] bool onNodeLoaded(Node* n) override; }; @@ -707,7 +689,6 @@ class AnimSubGraph : public AnimGraphBase friend AnimGraphParameter; public: - /// /// Initializes a new instance of the class. /// @@ -730,7 +711,6 @@ class AnimGraph : public AnimGraphBase friend AnimGraphExecutor; private: - typedef void (*InitBucketHandler)(AnimGraphInstanceData::Bucket&); bool _isFunction, _isRegisteredForScriptingEvents; @@ -740,7 +720,6 @@ private: Asset* _owner; public: - /// /// Initializes a new instance of the class. /// @@ -758,7 +737,6 @@ public: ~AnimGraph(); public: - /// /// The Anim Graph data version number. Used to sync the Anim Graph data with the instances state. Handles Anim Graph reloads to ensure data is valid. /// @@ -773,7 +751,6 @@ public: AssetReference BaseModel; public: - /// /// Determines whether this graph is ready for the animation evaluation. /// @@ -787,7 +764,6 @@ public: bool CanUseWithSkeleton(SkinnedModel* other) const; private: - void ClearCustomNode(Node* node); bool InitCustomNode(Node* node); @@ -798,7 +774,6 @@ private: void OnScriptsLoaded(); public: - // [Graph] bool Load(ReadStream* stream, bool loadMeta) override; bool onParamCreated(Parameter* p) override; @@ -829,7 +804,6 @@ class AnimGraphExecutor : public VisjectExecutor { friend AnimGraphNode; private: - AnimGraph& _graph; RootMotionMode _rootMotionMode = RootMotionMode::NoExtraction; int32 _skeletonNodesCount = 0; @@ -838,7 +812,6 @@ private: static ThreadLocal Context; public: - /// /// Initializes the managed runtime calls. /// @@ -851,7 +824,6 @@ public: explicit AnimGraphExecutor(AnimGraph& graph); public: - /// /// Updates the graph animation. /// @@ -891,7 +863,6 @@ public: void ResetBuckets(AnimGraphContext& context, AnimGraphBase* graph); private: - Value eatBox(Node* caller, Box* box) override; Graph* GetCurrentGraph() const override; diff --git a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp index 1db945a7c..d137bd257 100644 --- a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp +++ b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp @@ -516,7 +516,7 @@ void AnimGraphExecutor::ProcessGroupParameters(Box* box, Node* node, Value& valu auto& context = Context.Get(); switch (node->TypeID) { - // Get + // Get case 1: { // Get parameter @@ -628,7 +628,7 @@ void AnimGraphExecutor::ProcessGroupTools(Box* box, Node* nodeBase, Value& value auto node = (AnimGraphNode*)nodeBase; switch (node->TypeID) { - // Time + // Time case 5: { auto& bucket = context.Data->State[node->BucketIndex].Animation; @@ -655,11 +655,11 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu auto node = (AnimGraphNode*)nodeBase; switch (node->TypeID) { - // Animation Output + // Animation Output case 1: value = tryGetValue(box, Value::Null); break; - // Animation + // Animation case 2: { const auto anim = node->Assets[0].As(); @@ -670,7 +670,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu switch (box->ID) { - // Animation + // Animation case 0: { const float length = anim ? anim->GetLength() : 0.0f; @@ -690,21 +690,21 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Normalized Time + // Normalized Time case 1: value = startTimePos + bucket.TimePosition; if (anim && anim->IsLoaded()) value.AsFloat /= anim->GetLength(); break; - // Time + // Time case 2: value = startTimePos + bucket.TimePosition; break; - // Length + // Length case 3: value = anim ? anim->GetLength() : 0.0f; break; - // Is Playing + // Is Playing case 4: // If anim was updated during this or a previous frame value = bucket.LastUpdateFrame >= context.CurrentFrameIndex - 1; @@ -712,7 +712,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu } break; } - // Transform Bone (local/model space) + // Transform Bone (local/model space) case 3: case 4: { @@ -762,7 +762,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Local To Model + // Local To Model case 5: { // [Deprecated on 15.05.2020, expires on 15.05.2021] @@ -794,7 +794,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = dst;*/ break; } - // Model To Local + // Model To Local case 6: { // [Deprecated on 15.05.2020, expires on 15.05.2021] @@ -833,7 +833,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = dst;*/ break; } - // Copy Bone + // Copy Bone case 7: { // [Deprecated on 13.05.2020, expires on 13.05.2021] @@ -885,7 +885,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Get Bone Transform + // Get Bone Transform case 8: { // [Deprecated on 13.05.2020, expires on 13.05.2021] @@ -899,7 +899,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = Variant(Transform::Identity); break; } - // Blend + // Blend case 9: { const float alpha = Math::Saturate((float)tryGetValue(node->GetBox(3), node->Values[0])); @@ -909,12 +909,12 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu { value = tryGetValue(node->GetBox(1), Value::Null); } - // Only B + // Only B else if (Math::NearEqual(alpha, 1.0f, ANIM_GRAPH_BLEND_THRESHOLD)) { value = tryGetValue(node->GetBox(2), Value::Null); } - // Blend A and B + // Blend A and B else { const auto valueA = tryGetValue(node->GetBox(1), Value::Null); @@ -938,7 +938,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Blend Additive + // Blend Additive case 10: { const float alpha = Math::Saturate((float)tryGetValue(node->GetBox(3), node->Values[0])); @@ -948,7 +948,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu { value = tryGetValue(node->GetBox(1), Value::Null); } - // Blend A and B + // Blend A and B else { const auto valueA = tryGetValue(node->GetBox(1), Value::Null); @@ -985,7 +985,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Blend with Mask + // Blend with Mask case 11: { const float alpha = Math::Saturate((float)tryGetValue(node->GetBox(3), node->Values[0])); @@ -996,7 +996,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu { value = tryGetValue(node->GetBox(1), Value::Null); } - // Blend A and B with mask + // Blend A and B with mask else { auto valueA = tryGetValue(node->GetBox(1), Value::Null); @@ -1033,7 +1033,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Multi Blend 1D + // Multi Blend 1D case 12: { ASSERT(box->ID == 0); @@ -1122,7 +1122,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Multi Blend 2D + // Multi Blend 2D case 13: { ASSERT(box->ID == 0); @@ -1225,9 +1225,9 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - const auto v0 = points[1] - points[0]; - const auto v1 = points[2] - points[0]; - const auto v2 = p - points[0]; + auto v0 = points[1] - points[0]; + auto v1 = points[2] - points[0]; + auto v2 = p - points[0]; const float d00 = Float2::Dot(v0, v0); const float d01 = Float2::Dot(v0, v1); @@ -1237,8 +1237,53 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu const float coeff = (d00 * d11 - d01 * d01); if (Math::IsZero(coeff)) { - // Use only vertex A for invalid triangle - value = SampleAnimation(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, aAnim, aData.W); + const bool xAxis = Math::IsZero(v0.X) && Math::IsZero(v1.X); + const bool yAxis = Math::IsZero(v0.Y) && Math::IsZero(v1.Y); + if (xAxis || yAxis) + { + if (yAxis) + { + // Use code for X-axis case so swap coordinates + Swap(v0.X, v0.Y); + Swap(v1.X, v1.Y); + Swap(v2.X, v2.Y); + Swap(p.X, p.Y); + } + + // Use 1D blend if points are on the same line (degenerated triangle) + // TODO: simplify this code + if (v1.Y >= v0.Y) + { + if (p.Y < v0.Y && v1.Y >= v0.Y) + { + const float alpha = p.Y / v0.Y; + value = SampleAnimationsWithBlend(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, aAnim, bAnim, aData.W, bData.W, alpha); + } + else + { + const float alpha = (p.Y - v0.Y) / (v1.Y - v0.Y); + value = SampleAnimationsWithBlend(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, bAnim, cAnim, bData.W, cData.W, alpha); + } + } + else + { + if (p.Y < v1.Y) + { + const float alpha = p.Y / v1.Y; + value = SampleAnimationsWithBlend(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, aAnim, cAnim, aData.W, cData.W, alpha); + } + else + { + const float alpha = (p.Y - v1.Y) / (v0.Y - v1.Y); + value = SampleAnimationsWithBlend(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, cAnim, bAnim, cData.W, bData.W, alpha); + } + } + } + else + { + // Use only vertex A for invalid triangle + value = SampleAnimation(node, loop, data.Length, startTimePos, bucket.TimePosition, newTimePos, aAnim, aData.W); + } break; } const float v = (d11 * d20 - d01 * d21) / coeff; @@ -1280,7 +1325,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu } } - // Check if use the closes sample + // Check if use the closest sample if ((void*)value == nullptr && hasBest) { const auto aAnim = node->Assets[bestAnims[0]].As(); @@ -1304,7 +1349,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Blend Pose + // Blend Pose case 14: { ASSERT(box->ID == 0); @@ -1353,7 +1398,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Get Root Motion + // Get Root Motion case 15: { auto pose = tryGetValue(node->GetBox(2), Value::Null); @@ -1384,7 +1429,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu } break; } - // Set Root Motion + // Set Root Motion case 16: { auto pose = tryGetValue(node->GetBox(1), Value::Null); @@ -1402,7 +1447,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Add Root Motion + // Add Root Motion case 17: { auto pose = tryGetValue(node->GetBox(1), Value::Null); @@ -1420,7 +1465,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // State Machine + // State Machine case 18: { const int32 maxTransitionsPerUpdate = node->Values[2].AsInt; @@ -1581,51 +1626,51 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu break; } - // Entry + // Entry case 19: { // Not used CRASH; break; } - // State + // State case 20: { // Not used CRASH; break; } - // State Output + // State Output case 21: value = box->HasConnection() ? eatBox(nodeBase, box->FirstConnection()) : Value::Null; break; - // Rule Output + // Rule Output case 22: value = box->HasConnection() ? eatBox(nodeBase, box->FirstConnection()) : Value::Null; break; - // Transition Source State Anim + // Transition Source State Anim case 23: { const AnimGraphTransitionData& transitionsData = context.TransitionData; switch (box->ID) { - // Length + // Length case 0: value = transitionsData.Length; break; - // Time + // Time case 1: value = transitionsData.Position; break; - // Normalized Time + // Normalized Time case 2: value = transitionsData.Position / transitionsData.Length; break; - // Remaining Time + // Remaining Time case 3: value = transitionsData.Length - transitionsData.Position; break; - // Remaining Normalized Time + // Remaining Normalized Time case 4: value = 1.0f - (transitionsData.Position / transitionsData.Length); break; @@ -1634,7 +1679,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu } break; } - // Animation Graph Function + // Animation Graph Function case 24: { // Load function graph @@ -1683,7 +1728,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu context.GraphStack.Pop(); break; } - // Transform Bone (local/model space) + // Transform Bone (local/model space) case 25: case 26: { @@ -1741,7 +1786,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Copy Node + // Copy Node case 27: { // Get input @@ -1790,7 +1835,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Get Node Transform (model space) + // Get Node Transform (model space) case 28: { // Get input @@ -1802,7 +1847,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = Variant(Transform::Identity); break; } - // Aim IK + // Aim IK case 29: { // Get input @@ -1847,7 +1892,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = nodes; break; } - // Get Node Transform (local space) + // Get Node Transform (local space) case 30: { // Get input @@ -1859,7 +1904,7 @@ void AnimGraphExecutor::ProcessGroupAnimation(Box* boxBase, Node* nodeBase, Valu value = Variant(Transform::Identity); break; } - // Two Bone IK + // Two Bone IK case 31: { // Get input @@ -2023,7 +2068,7 @@ void AnimGraphExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& va return; switch (node->TypeID) { - // Function Input + // Function Input case 1: { // Find the function call diff --git a/Source/Engine/Animations/InverseKinematics.h b/Source/Engine/Animations/InverseKinematics.h index f3db4cd9f..b0a4c7be3 100644 --- a/Source/Engine/Animations/InverseKinematics.h +++ b/Source/Engine/Animations/InverseKinematics.h @@ -12,7 +12,6 @@ class FLAXENGINE_API InverseKinematics { public: - /// /// Rotates a node so it aims at a target. Solves the transformation (rotation) that needs to be applied to the node such that a provided forward vector (in node local space) aims at the target position (in skeleton model space). /// diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimation.h b/Source/Engine/Animations/SceneAnimations/SceneAnimation.h index a4511804f..c27c2786b 100644 --- a/Source/Engine/Animations/SceneAnimations/SceneAnimation.h +++ b/Source/Engine/Animations/SceneAnimations/SceneAnimation.h @@ -13,9 +13,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API SceneAnimation final : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(SceneAnimation, 1); + DECLARE_BINARY_ASSET_HEADER(SceneAnimation, 1); public: - /// /// The animation timeline track data. /// @@ -412,12 +411,10 @@ public: }; private: - BytesContainer _data; MemoryWriteStream _runtimeData; public: - /// /// The frames amount per second of the timeline animation. /// @@ -439,14 +436,12 @@ public: int32 TrackStatesCount; public: - /// /// Gets the animation duration (in seconds). /// API_PROPERTY() float GetDuration() const; public: - /// /// Gets the serialized timeline data. /// @@ -466,14 +461,12 @@ public: #endif public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override; #endif protected: - // [SceneAnimationBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h index cab2c16ad..4e0fcaa40 100644 --- a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h +++ b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h @@ -13,7 +13,7 @@ /// API_CLASS() class FLAXENGINE_API SceneAnimationPlayer : public Actor, public IPostFxSettingsProvider { -DECLARE_SCENE_OBJECT(SceneAnimationPlayer); + DECLARE_SCENE_OBJECT(SceneAnimationPlayer); /// /// Describes the scene animation updates frequency. @@ -32,7 +32,6 @@ DECLARE_SCENE_OBJECT(SceneAnimationPlayer); }; private: - enum class PlayState { Stopped, @@ -74,7 +73,6 @@ private: } _postFxSettings; public: - /// /// The scene animation to play. /// @@ -136,7 +134,6 @@ public: bool UsePrefabObjects = false; public: - /// /// Gets the value that determines whether the scene animation is playing. /// @@ -209,7 +206,6 @@ public: API_FUNCTION() void MapTrack(const StringView& from, const Guid& to); private: - void Restore(SceneAnimation* anim, int32 stateIndexOffset); bool TickPropertyTrack(int32 trackIndex, int32 stateIndexOffset, SceneAnimation* anim, float time, const SceneAnimation::Track& track, TrackInstance& state, void* target); typedef Array> CallStack; @@ -219,7 +215,6 @@ private: void ResetState(); public: - // [Actor] bool HasContentLoaded() const override; void Serialize(SerializeStream& stream, const void* otherObj) override; @@ -237,7 +232,6 @@ public: void Blend(PostProcessSettings& other, float weight) override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Content/Asset.h b/Source/Engine/Content/Asset.h index 32a3dcf25..94fd1ed31 100644 --- a/Source/Engine/Content/Asset.h +++ b/Source/Engine/Content/Asset.h @@ -23,19 +23,17 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API Asset : public ManagedScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Asset); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Asset); friend Content; friend LoadAssetTask; friend class ContentService; public: - /// /// The asset loading result. /// DECLARE_ENUM_7(LoadResult, Ok, Failed, MissingDataChunk, CannotLoadData, CannotLoadStorage, CannotLoadInitData, InvalidData); protected: - volatile int64 _refCount; ContentLoadTask* _loadingTask; @@ -45,7 +43,6 @@ protected: int8 _isVirtual : 1; // Indicates that asset is pure virtual (generated or temporary, has no storage so won't be saved) public: - /// /// Initializes a new instance of the class. /// @@ -54,7 +51,6 @@ public: explicit Asset(const SpawnParams& params, const AssetInfo* info); public: - typedef Delegate EventType; /// @@ -78,7 +74,6 @@ public: CriticalSection Locker; public: - /// /// Gets asset's reference count. Asset will be automatically unloaded when this reaches zero. /// @@ -101,7 +96,6 @@ public: } public: - /// /// Gets the path to the asset storage file. In Editor it reflects the actual file, in cooked Game, it fakes the Editor path to be informative for developers. /// @@ -143,7 +137,6 @@ public: #endif public: - /// /// Reloads the asset. /// @@ -195,7 +188,6 @@ public: void DeleteManaged(); protected: - /// /// Creates the loading tasks sequence (allows to inject custom tasks to asset loading logic). /// @@ -225,7 +217,6 @@ protected: virtual void unload(bool isReloading) = 0; protected: - virtual bool IsInternalType() const; bool onLoad(LoadAssetTask* task); @@ -237,7 +228,6 @@ protected: #endif public: - // [ManagedScriptingObject] String ToString() const override; void OnDeleteObject() override; diff --git a/Source/Engine/Content/AssetInfo.h b/Source/Engine/Content/AssetInfo.h index e60a9b968..7cb44b0f8 100644 --- a/Source/Engine/Content/AssetInfo.h +++ b/Source/Engine/Content/AssetInfo.h @@ -10,7 +10,7 @@ /// API_STRUCT() struct AssetInfo { -DECLARE_SCRIPTING_TYPE_MINIMAL(AssetInfo); + DECLARE_SCRIPTING_TYPE_MINIMAL(AssetInfo); /// /// Unique ID. @@ -28,7 +28,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(AssetInfo); API_FIELD() String Path; public: - /// /// Initializes a new instance of the struct. /// @@ -51,7 +50,6 @@ public: } public: - /// /// Gets the string. /// diff --git a/Source/Engine/Content/AssetReference.h b/Source/Engine/Content/AssetReference.h index 1963b6b4f..82ef5adce 100644 --- a/Source/Engine/Content/AssetReference.h +++ b/Source/Engine/Content/AssetReference.h @@ -10,15 +10,12 @@ class FLAXENGINE_API AssetReferenceBase { public: - typedef Delegate<> EventType; protected: - Asset* _asset = nullptr; public: - /// /// The asset loaded event (fired when asset gets loaded or is already loaded after change). /// @@ -48,7 +45,6 @@ public: ~AssetReferenceBase(); public: - /// /// Gets the asset ID or Guid::Empty if not set. /// @@ -71,7 +67,6 @@ public: String ToString() const; protected: - void OnSet(Asset* asset); void OnLoaded(Asset* asset); void OnUnloaded(Asset* asset); @@ -84,12 +79,10 @@ template API_CLASS(InBuild) class AssetReference : public AssetReferenceBase { public: - typedef T AssetType; typedef AssetReference Type; public: - /// /// Initializes a new instance of the class. /// @@ -139,7 +132,6 @@ public: } public: - FORCE_INLINE AssetReference& operator=(const AssetReference& other) { OnSet(other.Get()); @@ -220,7 +212,6 @@ public: } public: - /// /// Sets the asset reference. /// diff --git a/Source/Engine/Content/Assets/Animation.h b/Source/Engine/Content/Assets/Animation.h index b5c815b04..3d30a7a7f 100644 --- a/Source/Engine/Content/Assets/Animation.h +++ b/Source/Engine/Content/Assets/Animation.h @@ -14,14 +14,14 @@ class AnimEvent; /// API_CLASS(NoSpawn) class FLAXENGINE_API Animation : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(Animation, 1); + DECLARE_BINARY_ASSET_HEADER(Animation, 1); /// /// Contains basic information about the animation asset contents. /// API_STRUCT() struct FLAXENGINE_API InfoData { - DECLARE_SCRIPTING_TYPE_NO_SPAWN(InfoData); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(InfoData); /// /// Length of the animation in seconds. @@ -62,14 +62,12 @@ DECLARE_BINARY_ASSET_HEADER(Animation, 1); }; private: - #if USE_EDITOR bool _registeredForScriptingReload = false; void OnScriptsReloadStart(); #endif public: - /// /// The animation data. /// @@ -92,7 +90,6 @@ public: Dictionary MappingCache; public: - /// /// Gets the length of the animation (in seconds). /// @@ -160,16 +157,13 @@ public: #endif private: - void OnSkinnedModelUnloaded(Asset* obj); public: - // [BinaryAsset] void OnScriptingDispose() override; protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/AnimationGraph.h b/Source/Engine/Content/Assets/AnimationGraph.h index 58f94a7c7..266cf4855 100644 --- a/Source/Engine/Content/Assets/AnimationGraph.h +++ b/Source/Engine/Content/Assets/AnimationGraph.h @@ -10,9 +10,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API AnimationGraph : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(AnimationGraph, 1); + DECLARE_BINARY_ASSET_HEADER(AnimationGraph, 1); public: - /// /// The animation graph. /// @@ -24,7 +23,6 @@ public: AnimGraphExecutor GraphExecutor; public: - /// /// Gets the base model asset used for the animation preview and the skeleton layout source. /// @@ -58,20 +56,17 @@ public: API_FUNCTION() bool SaveSurface(BytesContainer& data); private: - void FindDependencies(AnimGraphBase* graph); #endif public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override; #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/AnimationGraphFunction.cpp b/Source/Engine/Content/Assets/AnimationGraphFunction.cpp index 013ea693d..c0383a32a 100644 --- a/Source/Engine/Content/Assets/AnimationGraphFunction.cpp +++ b/Source/Engine/Content/Assets/AnimationGraphFunction.cpp @@ -147,7 +147,6 @@ void AnimationGraphFunction::ProcessGraphForSignature(AnimGraphBase* graph, bool p.Type = GetGraphFunctionTypeName_Deprecated(node.Values[0]); #endif p.Name = name; - } } else if (node.Type == GRAPH_NODE_MAKE_TYPE(16, 2)) // Function Output diff --git a/Source/Engine/Content/Assets/AnimationGraphFunction.h b/Source/Engine/Content/Assets/AnimationGraphFunction.h index 4b32a4af3..b9a73a8b6 100644 --- a/Source/Engine/Content/Assets/AnimationGraphFunction.h +++ b/Source/Engine/Content/Assets/AnimationGraphFunction.h @@ -10,9 +10,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API AnimationGraphFunction : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(AnimationGraphFunction, 1); + DECLARE_BINARY_ASSET_HEADER(AnimationGraphFunction, 1); public: - /// /// The loaded anim graph function graph data (serialized anim graph). /// @@ -59,11 +58,9 @@ public: #endif private: - void ProcessGraphForSignature(AnimGraphBase* graph, bool canUseOutputs); protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/CubeTexture.h b/Source/Engine/Content/Assets/CubeTexture.h index 92ed9b73c..18aa10470 100644 --- a/Source/Engine/Content/Assets/CubeTexture.h +++ b/Source/Engine/Content/Assets/CubeTexture.h @@ -9,5 +9,5 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API CubeTexture : public TextureBase { -DECLARE_BINARY_ASSET_HEADER(CubeTexture, TexturesSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(CubeTexture, TexturesSerializedVersion); }; diff --git a/Source/Engine/Content/Assets/IESProfile.h b/Source/Engine/Content/Assets/IESProfile.h index 8b6c4f9e1..f740966a8 100644 --- a/Source/Engine/Content/Assets/IESProfile.h +++ b/Source/Engine/Content/Assets/IESProfile.h @@ -9,10 +9,9 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API IESProfile : public TextureBase { -DECLARE_BINARY_ASSET_HEADER(IESProfile, TexturesSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(IESProfile, TexturesSerializedVersion); public: - struct CustomDataLayout { float Brightness; @@ -20,7 +19,6 @@ public: }; public: - /// /// The light brightness in Lumens, imported from IES profile. /// @@ -32,7 +30,6 @@ public: API_FIELD() float TextureMultiplier; protected: - // [BinaryAsset] bool init(AssetInitData& initData) override; }; diff --git a/Source/Engine/Content/Assets/Material.h b/Source/Engine/Content/Assets/Material.h index 676680968..54fa0251f 100644 --- a/Source/Engine/Content/Assets/Material.h +++ b/Source/Engine/Content/Assets/Material.h @@ -12,13 +12,11 @@ class MaterialShader; /// API_CLASS(NoSpawn) class FLAXENGINE_API Material : public ShaderAssetTypeBase { -DECLARE_BINARY_ASSET_HEADER(Material, ShadersSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(Material, ShadersSerializedVersion); private: - MaterialShader* _materialShader = nullptr; public: - /// /// Tries to load surface graph from the asset. /// @@ -39,7 +37,6 @@ public: #endif public: - // [MaterialBase] bool IsMaterialInstance() const override; @@ -58,7 +55,6 @@ public: #endif protected: - // [MaterialBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/MaterialBase.h b/Source/Engine/Content/Assets/MaterialBase.h index c93fe4337..26f691571 100644 --- a/Source/Engine/Content/Assets/MaterialBase.h +++ b/Source/Engine/Content/Assets/MaterialBase.h @@ -12,9 +12,8 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API MaterialBase : public BinaryAsset, public IMaterial { -DECLARE_ASSET_HEADER(MaterialBase); + DECLARE_ASSET_HEADER(MaterialBase); public: - /// /// The material parameters collection. /// @@ -32,7 +31,6 @@ public: virtual bool IsMaterialInstance() const = 0; public: - /// /// Gets the material parameters collection. /// @@ -78,7 +76,6 @@ public: API_FUNCTION() MaterialInstance* CreateVirtualInstance(); public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override diff --git a/Source/Engine/Content/Assets/MaterialFunction.h b/Source/Engine/Content/Assets/MaterialFunction.h index 2fce099b4..e53d2cd3d 100644 --- a/Source/Engine/Content/Assets/MaterialFunction.h +++ b/Source/Engine/Content/Assets/MaterialFunction.h @@ -10,9 +10,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API MaterialFunction : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(MaterialFunction, 1); + DECLARE_BINARY_ASSET_HEADER(MaterialFunction, 1); public: - #if COMPILE_WITH_MATERIAL_GRAPH /// @@ -60,7 +59,6 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/MaterialInstance.h b/Source/Engine/Content/Assets/MaterialInstance.h index d5df025be..3b06c6f75 100644 --- a/Source/Engine/Content/Assets/MaterialInstance.h +++ b/Source/Engine/Content/Assets/MaterialInstance.h @@ -9,13 +9,11 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API MaterialInstance : public MaterialBase { -DECLARE_BINARY_ASSET_HEADER(MaterialInstance, 4); + DECLARE_BINARY_ASSET_HEADER(MaterialInstance, 4); private: - MaterialBase* _baseMaterial = nullptr; public: - /// /// Gets the base material. If value gets changed parameters collection is restored to the default values of the new material. /// @@ -43,14 +41,12 @@ public: #endif private: - void OnBaseSet(); void OnBaseUnset(); void OnBaseUnloaded(Asset* p); void OnBaseParamsChanged(); public: - // [MaterialBase] bool IsMaterialInstance() const override; #if USE_EDITOR @@ -67,7 +63,6 @@ public: void Bind(BindParameters& params) override; protected: - // [MaterialBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/Model.h b/Source/Engine/Content/Assets/Model.h index cdb6d970d..9156582d2 100644 --- a/Source/Engine/Content/Assets/Model.h +++ b/Source/Engine/Content/Assets/Model.h @@ -13,16 +13,14 @@ class StreamModelLODTask; /// API_CLASS(NoSpawn) class FLAXENGINE_API Model : public ModelBase { -DECLARE_BINARY_ASSET_HEADER(Model, 25); + DECLARE_BINARY_ASSET_HEADER(Model, 25); friend Mesh; friend StreamModelLODTask; private: - int32 _loadedLODs = 0; StreamModelLODTask* _streamingTask = nullptr; public: - /// /// Model level of details. The first entry is the highest quality LOD0 followed by more optimized versions. /// @@ -34,14 +32,12 @@ public: API_FIELD(ReadOnly) SDFData SDF; public: - /// /// Finalizes an instance of the class. /// ~Model(); public: - /// /// Gets a value indicating whether this instance is initialized. /// @@ -103,7 +99,6 @@ public: } public: - /// /// Requests the LOD data asynchronously (creates task that will gather chunk data or null if already here). /// @@ -127,7 +122,6 @@ public: } public: - /// /// Determines if there is an intersection between the Model and a Ray in given world using given instance. /// @@ -156,7 +150,6 @@ public: API_FUNCTION() BoundingBox GetBox(int32 lodIndex = 0) const; public: - /// /// Draws the meshes. Binds vertex and index buffers and invokes the draw calls. /// @@ -185,7 +178,6 @@ public: void Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info); public: - /// /// Setups the model LODs collection including meshes creation. /// @@ -205,7 +197,7 @@ public: API_FUNCTION() bool Save(bool withMeshDataFromGpu = false, const StringView& path = StringView::Empty); #endif - + /// /// Generates the Sign Distant Field for this model. /// @@ -223,7 +215,6 @@ public: API_FUNCTION() void SetSDF(const SDFData& sdf); private: - /// /// Initializes this model to an empty collection of LODs with meshes. /// @@ -232,7 +223,6 @@ private: bool Init(const Span& meshesCountPerLod); public: - // [ModelBase] void SetupMaterialSlots(int32 slotsCount) override; int32 GetLODsCount() const override; @@ -251,7 +241,6 @@ public: Task* CreateStreamingTask(int32 residency) override; protected: - // [ModelBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/RawDataAsset.h b/Source/Engine/Content/Assets/RawDataAsset.h index e81ac6b21..2558426e9 100644 --- a/Source/Engine/Content/Assets/RawDataAsset.h +++ b/Source/Engine/Content/Assets/RawDataAsset.h @@ -9,16 +9,14 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API RawDataAsset : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(RawDataAsset, 1); + DECLARE_BINARY_ASSET_HEADER(RawDataAsset, 1); public: - /// /// The bytes array stored in the asset. /// API_FIELD() Array Data; public: - #if USE_EDITOR /// @@ -31,7 +29,6 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/Shader.h b/Source/Engine/Content/Assets/Shader.h index e2faeff3e..ce1a47076 100644 --- a/Source/Engine/Content/Assets/Shader.h +++ b/Source/Engine/Content/Assets/Shader.h @@ -12,20 +12,17 @@ class GPUShader; /// API_CLASS(NoSpawn) class FLAXENGINE_API Shader : public ShaderAssetTypeBase { -DECLARE_BINARY_ASSET_HEADER(Shader, ShadersSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(Shader, ShadersSerializedVersion); private: - GPUShader* _shader; public: - /// /// Finalizes an instance of the class. /// ~Shader(); public: - /// /// The GPU shader object (not null). /// @@ -40,7 +37,6 @@ public: } protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/SkeletonMask.h b/Source/Engine/Content/Assets/SkeletonMask.h index 99e6b48ee..c41b8eeda 100644 --- a/Source/Engine/Content/Assets/SkeletonMask.h +++ b/Source/Engine/Content/Assets/SkeletonMask.h @@ -14,14 +14,12 @@ class MemoryWriteStream; /// API_CLASS(NoSpawn) class FLAXENGINE_API SkeletonMask : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(SkeletonMask, 2); + DECLARE_BINARY_ASSET_HEADER(SkeletonMask, 2); private: - Array _maskedNodes; BitArray<> _mask; public: - /// /// The referenced skinned model skeleton that defines the masked nodes hierarchy. /// @@ -47,7 +45,6 @@ public: } public: - /// /// Gets the per-skeleton-node boolean mask (read-only). /// @@ -66,11 +63,9 @@ public: #endif private: - void OnSkeletonUnload(); public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override @@ -83,7 +78,6 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/SkinnedModel.h b/Source/Engine/Content/Assets/SkinnedModel.h index fb7b8a8fb..fd55ea4ed 100644 --- a/Source/Engine/Content/Assets/SkinnedModel.h +++ b/Source/Engine/Content/Assets/SkinnedModel.h @@ -14,16 +14,14 @@ class StreamSkinnedModelLODTask; /// API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModel : public ModelBase { -DECLARE_BINARY_ASSET_HEADER(SkinnedModel, 4); + DECLARE_BINARY_ASSET_HEADER(SkinnedModel, 4); friend SkinnedMesh; friend StreamSkinnedModelLODTask; private: - int32 _loadedLODs = 0; StreamSkinnedModelLODTask* _streamingTask = nullptr; public: - /// /// Model level of details. The first entry is the highest quality LOD0 followed by more optimized versions. /// @@ -35,14 +33,12 @@ public: SkeletonData Skeleton; public: - /// /// Finalizes an instance of the class. /// ~SkinnedModel(); public: - /// /// Gets a value indicating whether this instance is initialized. /// @@ -154,7 +150,6 @@ public: API_PROPERTY() Array GetBlendShapes(); public: - /// /// Requests the LOD data asynchronously (creates task that will gather chunk data or null if already here). /// @@ -170,7 +165,6 @@ public: void GetLODData(int32 lodIndex, BytesContainer& data) const; public: - /// /// Determines if there is an intersection between the SkinnedModel and a Ray in given world using given instance. /// @@ -199,7 +193,6 @@ public: API_FUNCTION() BoundingBox GetBox(int32 lodIndex = 0) const; public: - /// /// Draws the meshes. Binds vertex and index buffers and invokes the draw calls. /// @@ -218,7 +211,6 @@ public: void Draw(RenderContext& renderContext, const SkinnedMesh::DrawInfo& info); public: - /// /// Setups the model LODs collection including meshes creation. /// @@ -256,7 +248,6 @@ public: #endif private: - /// /// Initializes this skinned model to an empty collection of meshes. Ensure to init SkeletonData manually after the call. /// @@ -265,7 +256,6 @@ private: bool Init(const Span& meshesCountPerLod); public: - // [ModelBase] void SetupMaterialSlots(int32 slotsCount) override; int32 GetLODsCount() const override; @@ -284,7 +274,6 @@ public: Task* CreateStreamingTask(int32 residency) override; protected: - // [ModelBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Assets/Texture.h b/Source/Engine/Content/Assets/Texture.h index ccd5e98ab..78b6414e8 100644 --- a/Source/Engine/Content/Assets/Texture.h +++ b/Source/Engine/Content/Assets/Texture.h @@ -9,7 +9,7 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API Texture : public TextureBase { -DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion); /// /// Gets the texture format type. @@ -22,7 +22,6 @@ DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion); API_PROPERTY() bool IsNormalMap() const; public: - #if USE_EDITOR /// diff --git a/Source/Engine/Content/Assets/VisualScript.cpp b/Source/Engine/Content/Assets/VisualScript.cpp index d710e7b64..eba6878da 100644 --- a/Source/Engine/Content/Assets/VisualScript.cpp +++ b/Source/Engine/Content/Assets/VisualScript.cpp @@ -54,15 +54,15 @@ bool VisualScriptGraph::onNodeLoaded(Node* n) { switch (n->GroupID) { - // Function + // Function case 16: switch (n->TypeID) { - // Invoke Method + // Invoke Method case 4: n->Data.InvokeMethod.Method = nullptr; break; - // Get/Set Field + // Get/Set Field case 7: case 8: n->Data.GetSetField.Field = nullptr; @@ -176,7 +176,7 @@ void VisualScriptExecutor::ProcessGroupParameters(Box* box, Node* node, Value& v { switch (node->TypeID) { - // Get + // Get case 3: { int32 paramIndex; @@ -200,7 +200,7 @@ void VisualScriptExecutor::ProcessGroupParameters(Box* box, Node* node, Value& v } break; } - // Set + // Set case 4: { int32 paramIndex; @@ -235,11 +235,11 @@ void VisualScriptExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // This Instance + // This Instance case 19: value = ThreadStacks.Get().Stack->Instance; break; - // Cast + // Cast case 25: { if (box->ID == 0) @@ -297,7 +297,7 @@ void VisualScriptExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Cast Value + // Cast Value case 26: { if (box->ID == 0) @@ -375,7 +375,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& { switch (node->TypeID) { - // Method Override + // Method Override case 3: { if (boxBase->ID == 0) @@ -392,7 +392,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& } break; } - // Invoke Method + // Invoke Method case 4: { // Call Impulse or Pure Method @@ -604,14 +604,14 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& } break; } - // Return + // Return case 5: { auto& scope = ThreadStacks.Get().Stack->Scope; scope->FunctionReturn = tryGetValue(node->GetBox(1), Value::Zero); break; } - // Function + // Function case 6: { if (boxBase->ID == 0) @@ -630,7 +630,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& } break; } - // Get Field + // Get Field case 7: { auto& cache = node->Data.GetSetField; @@ -716,7 +716,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& } break; } - // Get Field + // Get Field case 8: { auto& cache = node->Data.GetSetField; @@ -809,7 +809,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value& eatBox(node, returnedImpulse->FirstConnection()); break; } - // Bind/Unbind + // Bind/Unbind case 9: case 10: { @@ -937,7 +937,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val { switch (node->TypeID) { - // If + // If case 1: { const bool condition = (bool)tryGetValue(node->GetBox(1), Value::Zero); @@ -946,7 +946,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val eatBox(node, boxBase->FirstConnection()); break; } - // For Loop + // For Loop case 2: { const auto scope = ThreadStacks.Get().Stack->Scope; @@ -959,7 +959,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } switch (boxBase->ID) { - // Loop + // Loop case 0: { if (iteratorIndex == scope->ReturnedValues.Count()) @@ -980,13 +980,13 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val eatBox(node, boxBase->FirstConnection()); break; } - // Break + // Break case 3: // Reset loop iterator if (iteratorIndex != scope->ReturnedValues.Count()) scope->ReturnedValues[iteratorIndex].Value.AsInt = MAX_int32 - 1; break; - // Index + // Index case 5: if (iteratorIndex != scope->ReturnedValues.Count()) value = scope->ReturnedValues[iteratorIndex].Value; @@ -994,7 +994,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } break; } - // While Loop + // While Loop case 3: { const auto scope = ThreadStacks.Get().Stack->Scope; @@ -1007,7 +1007,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } switch (boxBase->ID) { - // Loop + // Loop case 0: { if (iteratorIndex == scope->ReturnedValues.Count()) @@ -1027,13 +1027,13 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val eatBox(node, boxBase->FirstConnection()); break; } - // Break + // Break case 2: // Reset loop iterator if (iteratorIndex != scope->ReturnedValues.Count()) scope->ReturnedValues[iteratorIndex].Value.AsInt = -1; break; - // Index + // Index case 4: if (iteratorIndex != scope->ReturnedValues.Count()) value = scope->ReturnedValues[iteratorIndex].Value; @@ -1041,7 +1041,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } break; } - // Sequence + // Sequence case 4: { const int32 count = (int32)node->Values[0]; @@ -1053,7 +1053,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } break; } - // Branch On Enum + // Branch On Enum case 5: { const Value v = tryGetValue(node->GetBox(1), Value::Null); @@ -1075,7 +1075,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } break; } - // Delay + // Delay case 6: { boxBase = node->GetBox(2); @@ -1115,7 +1115,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } break; } - // Array For Each + // Array For Each case 7: { const auto scope = ThreadStacks.Get().Stack->Scope; @@ -1135,7 +1135,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val } switch (boxBase->ID) { - // Loop + // Loop case 0: { if (iteratorIndex == scope->ReturnedValues.Count()) @@ -1173,18 +1173,18 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val eatBox(node, boxBase->FirstConnection()); break; } - // Break + // Break case 2: // Reset loop iterator if (iteratorIndex != scope->ReturnedValues.Count()) scope->ReturnedValues[iteratorIndex].Value.AsInt = MAX_int32 - 1; break; - // Item + // Item case 4: if (iteratorIndex != scope->ReturnedValues.Count() && arrayIndex != scope->ReturnedValues.Count()) value = scope->ReturnedValues[arrayIndex].Value.AsArray()[(int32)scope->ReturnedValues[iteratorIndex].Value]; break; - // Index + // Index case 5: if (iteratorIndex != scope->ReturnedValues.Count()) value = (int32)scope->ReturnedValues[iteratorIndex].Value; @@ -1702,13 +1702,13 @@ void VisualScriptingBinaryModule::OnScriptsReloading() { switch (node.Type) { - // Invoke Method + // Invoke Method case GRAPH_NODE_MAKE_TYPE(16, 4): { node.Data.InvokeMethod.Method = nullptr; break; } - // Get/Set Field + // Get/Set Field case GRAPH_NODE_MAKE_TYPE(16, 7): case GRAPH_NODE_MAKE_TYPE(16, 8): { @@ -2224,7 +2224,7 @@ String VisualScripting::GetStackTrace() String node; switch (frame->Node->Type) { - // Get/Set Parameter + // Get/Set Parameter case GRAPH_NODE_MAKE_TYPE(6, 3): case GRAPH_NODE_MAKE_TYPE(6, 4): { @@ -2233,19 +2233,19 @@ String VisualScripting::GetStackTrace() node += param ? param->Name : ((Guid)frame->Node->Values[0]).ToString(); break; } - // Method Override + // Method Override case GRAPH_NODE_MAKE_TYPE(16, 3): node = (StringView)frame->Node->Values[0]; node += TEXT("()"); break; - // Invoke Method + // Invoke Method case GRAPH_NODE_MAKE_TYPE(16, 4): node = (StringView)frame->Node->Values[0]; node += TEXT("."); node += (StringView)frame->Node->Values[1]; node += TEXT("()"); break; - // Function + // Function case GRAPH_NODE_MAKE_TYPE(16, 6): node = String(frame->Script->GetScriptTypeName()); for (int32 i = 0; i < frame->Script->_methods.Count(); i++) diff --git a/Source/Engine/Content/Assets/VisualScript.h b/Source/Engine/Content/Assets/VisualScript.h index e2b06be8d..064a5b31c 100644 --- a/Source/Engine/Content/Assets/VisualScript.h +++ b/Source/Engine/Content/Assets/VisualScript.h @@ -33,7 +33,6 @@ class VisualScriptExecutor : public VisjectExecutor { friend VisualScripting; public: - /// /// Initializes a new instance of the class. /// @@ -58,12 +57,11 @@ private: /// API_CLASS(NoSpawn, Sealed) class FLAXENGINE_API VisualScript : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(VisualScript, 1); + DECLARE_BINARY_ASSET_HEADER(VisualScript, 1); friend VisualScripting; friend VisualScriptExecutor; friend VisualScriptingBinaryModule; public: - /// /// Visual Script flag types. /// @@ -90,7 +88,7 @@ public: /// API_STRUCT() struct Metadata { - DECLARE_SCRIPTING_TYPE_MINIMAL(Metadata); + DECLARE_SCRIPTING_TYPE_MINIMAL(Metadata); /// /// The base class typename. @@ -147,7 +145,6 @@ public: }; private: - Dictionary _instances; ScriptingTypeHandle _scriptingTypeHandle; ScriptingTypeHandle _scriptingTypeHandleCached; @@ -160,7 +157,6 @@ private: #endif public: - /// /// The Visual Script graph. /// @@ -172,7 +168,6 @@ public: API_FIELD(ReadOnly) Metadata Meta; public: - /// /// Gets the typename of the Visual Script. Identifies it's scripting type. /// @@ -280,7 +275,6 @@ public: #endif public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override @@ -293,14 +287,12 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; AssetChunksFlag getChunksToPreload() const override; private: - void CacheScriptingType(); }; @@ -312,25 +304,21 @@ class FLAXENGINE_API VisualScriptingBinaryModule : public BinaryModule { friend VisualScript; private: - StringAnsi _name; public: - /// /// Initializes a new instance of the class. /// VisualScriptingBinaryModule(); public: - /// /// The visual script assets loaded into the module with exposes scripting types. Order matches the Types array. /// Array> Scripts; private: - static ScriptingObject* VisualScriptObjectSpawn(const ScriptingObjectSpawnParams& params); #if USE_EDITOR void OnScriptsReloading(); @@ -338,7 +326,6 @@ private: static void OnEvent(ScriptingObject* object, Span parameters, ScriptingTypeHandle eventType, StringView eventName); public: - // [BinaryModule] const StringAnsi& GetName() const override; bool IsLoaded() const override; @@ -363,7 +350,6 @@ public: class FLAXENGINE_API VisualScripting { public: - struct NodeBoxValue { uint32 NodeId; diff --git a/Source/Engine/Content/AssetsContainer.h b/Source/Engine/Content/AssetsContainer.h index def55ccdc..f33ef637a 100644 --- a/Source/Engine/Content/AssetsContainer.h +++ b/Source/Engine/Content/AssetsContainer.h @@ -12,7 +12,6 @@ class AssetsContainer : public Array> { public: - /// /// Loads an asset. /// diff --git a/Source/Engine/Content/BinaryAsset.cpp b/Source/Engine/Content/BinaryAsset.cpp index 287f5ef83..3b268f72e 100644 --- a/Source/Engine/Content/BinaryAsset.cpp +++ b/Source/Engine/Content/BinaryAsset.cpp @@ -459,12 +459,10 @@ const String& BinaryAsset::GetPath() const class InitAssetTask : public ContentLoadTask { private: - WeakAssetReference _asset; FlaxStorage::LockData _dataLock; public: - /// /// Initializes a new instance of the class. /// @@ -477,7 +475,6 @@ public: } public: - // [ContentLoadTask] bool HasReference(Object* obj) const override { @@ -485,7 +482,6 @@ public: } protected: - // [ContentLoadTask] Result run() override { @@ -507,6 +503,7 @@ protected: return Result::Ok; } + void OnEnd() override { _dataLock.Release(); diff --git a/Source/Engine/Content/BinaryAsset.h b/Source/Engine/Content/BinaryAsset.h index edea2e3f9..e98c645fe 100644 --- a/Source/Engine/Content/BinaryAsset.h +++ b/Source/Engine/Content/BinaryAsset.h @@ -21,23 +21,20 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API BinaryAsset : public Asset { -DECLARE_ASSET_HEADER(BinaryAsset); + DECLARE_ASSET_HEADER(BinaryAsset); protected: - AssetHeader _header; FlaxStorageReference _storageRef; // Allow asset to have missing storage reference but only before asset is loaded or if it's virtual bool _isSaving; Array _dependantAssets; public: - /// /// Finalizes an instance of the class. /// ~BinaryAsset(); public: - /// /// The asset storage container. /// @@ -58,7 +55,6 @@ public: #endif public: - /// /// Gets the asset serialized version. /// @@ -87,7 +83,6 @@ public: bool InitVirtual(AssetInitData& initData); public: - #if USE_EDITOR #if COMPILE_WITH_ASSETS_IMPORTER @@ -128,7 +123,6 @@ public: bool HasDependenciesModified() const; protected: - /// /// Called when one of the asset dependencies gets modified (it was saved or reloaded or reimported). /// @@ -140,7 +134,6 @@ protected: #endif protected: - /// /// Initializes the specified asset. /// @@ -161,7 +154,6 @@ protected: } public: - /// /// Gets the asset chunk. /// @@ -293,7 +285,6 @@ public: #endif protected: - /// /// Load data from the chunks /// @@ -301,13 +292,11 @@ protected: virtual LoadResult load() = 0; private: - #if USE_EDITOR void OnStorageReloaded(FlaxStorage* storage, bool failed); #endif public: - // [Asset] #if USE_EDITOR void OnDeleteObject() override; @@ -315,7 +304,6 @@ public: const String& GetPath() const final override; protected: - // [Asset] ContentLoadTask* createLoadingTask() override; LoadResult loadAsset() override; diff --git a/Source/Engine/Content/Cache/AssetsCache.cpp b/Source/Engine/Content/Cache/AssetsCache.cpp index 0ce183466..609c7cedc 100644 --- a/Source/Engine/Content/Cache/AssetsCache.cpp +++ b/Source/Engine/Content/Cache/AssetsCache.cpp @@ -578,7 +578,7 @@ bool AssetsCache::IsEntryValid(Entry& e) return isValid; } } - // Check for json resource + // Check for json resource else if (JsonStorageProxy::IsValidExtension(extension)) { // Check Json storage layer diff --git a/Source/Engine/Content/Cache/AssetsCache.h b/Source/Engine/Content/Cache/AssetsCache.h index 26122f6d7..4f12c0d22 100644 --- a/Source/Engine/Content/Cache/AssetsCache.h +++ b/Source/Engine/Content/Cache/AssetsCache.h @@ -40,7 +40,6 @@ DECLARE_ENUM_OPERATORS(AssetsCacheFlags); class FLAXENGINE_API AssetsCache { public: - /// /// The registry entry structure. /// @@ -75,7 +74,6 @@ public: typedef Dictionary PathsMapping; private: - bool _isDirty; CriticalSection _locker; Registry _registry; @@ -83,14 +81,12 @@ private: String _path; public: - /// /// Initializes a new instance of the class. /// AssetsCache(); public: - /// /// Gets amount of registered assets /// @@ -104,7 +100,6 @@ public: } public: - /// /// Init registry /// @@ -127,7 +122,6 @@ public: static bool Save(const StringView& path, const Registry& entries, const PathsMapping& pathsMapping, const AssetsCacheFlags flags = AssetsCacheFlags::None); public: - /// /// Finds the asset path by id. In editor it returns the actual asset path, at runtime it returns the mapped asset path. /// diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index dcbdbfa1e..c44043f79 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -66,7 +66,6 @@ bool findAsset(const Guid& id, const String& directory, Array& tmpCache, class ContentService : public EngineService { public: - ContentService() : EngineService(TEXT("Content"), -600) { @@ -294,7 +293,7 @@ bool Content::GetAssetInfo(const StringView& path, AssetInfo& info) return Cache.FindAsset(path, info); } } - // Check for json resource + // Check for json resource else if (JsonStorageProxy::IsValidExtension(extension)) { // Check Json storage layer @@ -1081,7 +1080,7 @@ bool findAsset(const Guid& id, const String& directory, Array& tmpCache, LOG(Error, "Cannot open file '{0}' error code: {1}", path, 0); } } - // Check for json resource + // Check for json resource else if (JsonStorageProxy::IsValidExtension(extension)) { // Check Json storage layer diff --git a/Source/Engine/Content/Content.h b/Source/Engine/Content/Content.h index 6fe042e66..ba40f6e21 100644 --- a/Source/Engine/Content/Content.h +++ b/Source/Engine/Content/Content.h @@ -15,7 +15,7 @@ class AssetsCache; // Content and assets statistics container. API_STRUCT() struct FLAXENGINE_API ContentStats { -DECLARE_SCRIPTING_TYPE_MINIMAL(ContentStats); + DECLARE_SCRIPTING_TYPE_MINIMAL(ContentStats); // Amount of asset objects in memory. API_FIELD() int32 AssetsCount = 0; @@ -32,11 +32,10 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(ContentStats); /// API_CLASS(Static) class FLAXENGINE_API Content { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Content); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Content); friend Engine; friend Asset; public: - /// /// The time between content pool updates. /// @@ -48,7 +47,6 @@ public: static TimeSpan AssetsUnloadInterval; public: - /// /// Gets the assets registry. /// @@ -56,7 +54,6 @@ public: static AssetsCache* GetRegistry(); public: - /// /// Finds the asset info by id. /// @@ -87,7 +84,6 @@ public: API_FUNCTION() static Array GetAllAssetsByType(const MClass* type); public: - /// /// Gets the asset factory used by the given asset type id. /// @@ -103,7 +99,6 @@ public: static IAssetFactory* GetAssetFactory(const AssetInfo& assetInfo); public: - /// /// Generates temporary asset path. /// @@ -111,7 +106,6 @@ public: API_FUNCTION() static String CreateTemporaryAssetPath(); public: - /// /// Gets content statistics. /// @@ -263,7 +257,6 @@ public: static bool IsAssetTypeIdInvalid(const ScriptingTypeHandle& type, const ScriptingTypeHandle& assetType); public: - /// /// Finds the asset with at given path. Checks all loaded assets. /// @@ -279,7 +272,6 @@ public: API_FUNCTION() static Asset* GetAsset(const Guid& id); public: - /// /// Deletes the specified asset. /// @@ -293,7 +285,6 @@ public: API_FUNCTION(Attributes="HideInEditor") static void DeleteAsset(const StringView& path); public: - #if USE_EDITOR /// @@ -364,13 +355,11 @@ public: API_EVENT() static Delegate AssetReloading; private: - static void tryCallOnLoaded(Asset* asset); static void onAssetLoaded(Asset* asset); static void onAssetUnload(Asset* asset); static Asset* load(const Guid& id, const ScriptingTypeHandle& type, AssetInfo& assetInfo); private: - static void deleteFileSafety(const StringView& path, const Guid& id); }; diff --git a/Source/Engine/Content/Factories/BinaryAssetFactory.h b/Source/Engine/Content/Factories/BinaryAssetFactory.h index 1f1047cdf..af6fb0e2f 100644 --- a/Source/Engine/Content/Factories/BinaryAssetFactory.h +++ b/Source/Engine/Content/Factories/BinaryAssetFactory.h @@ -19,7 +19,6 @@ class FlaxStorage; class FLAXENGINE_API BinaryAssetFactoryBase : public IAssetFactory { public: - /// /// Initializes the specified asset. It's called in background before actual asset loading. /// @@ -28,7 +27,6 @@ public: bool Init(BinaryAsset* asset); protected: - virtual BinaryAsset* Create(const AssetInfo& info) = 0; virtual bool IsVersionSupported(uint32 serializedVersion) const = 0; #if USE_EDITOR @@ -36,7 +34,6 @@ protected: #endif public: - // [IAssetFactory] Asset* New(const AssetInfo& info) override; Asset* NewVirtual(const AssetInfo& info) override; @@ -50,7 +47,6 @@ template class BinaryAssetFactory : public BinaryAssetFactoryBase { public: - // [BinaryAssetFactoryBase] bool IsVersionSupported(uint32 serializedVersion) const override { @@ -58,7 +54,6 @@ public: } protected: - // [BinaryAssetFactoryBase] BinaryAsset* Create(const AssetInfo& info) override { diff --git a/Source/Engine/Content/Factories/IAssetFactory.h b/Source/Engine/Content/Factories/IAssetFactory.h index ba24fa56a..7f6564ba7 100644 --- a/Source/Engine/Content/Factories/IAssetFactory.h +++ b/Source/Engine/Content/Factories/IAssetFactory.h @@ -15,7 +15,6 @@ class IAssetUpgrader; class FLAXENGINE_API IAssetFactory { public: - typedef Dictionary Collection; /// @@ -28,7 +27,6 @@ public: } public: - /// /// Finalizes an instance of the class. /// @@ -37,7 +35,6 @@ public: } public: - /// /// Determines whenever the virtual assets are supported by this asset tpe factory. /// diff --git a/Source/Engine/Content/Factories/JsonAssetFactory.h b/Source/Engine/Content/Factories/JsonAssetFactory.h index d10387bb8..aeb3b5fa8 100644 --- a/Source/Engine/Content/Factories/JsonAssetFactory.h +++ b/Source/Engine/Content/Factories/JsonAssetFactory.h @@ -13,16 +13,15 @@ class FLAXENGINE_API JsonAssetFactoryBase : public IAssetFactory { protected: - virtual JsonAssetBase* Create(const AssetInfo& info) = 0; public: - // [IAssetFactory] Asset* New(const AssetInfo& info) override { return Create(info); } + Asset* NewVirtual(const AssetInfo& info) override { return Create(info); @@ -37,7 +36,6 @@ template class JsonAssetFactory : public JsonAssetFactoryBase { protected: - // [JsonAssetFactoryBase] JsonAssetBase* Create(const AssetInfo& info) override { diff --git a/Source/Engine/Content/JsonAsset.h b/Source/Engine/Content/JsonAsset.h index 566f90501..25d463b16 100644 --- a/Source/Engine/Content/JsonAsset.h +++ b/Source/Engine/Content/JsonAsset.h @@ -12,13 +12,11 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API JsonAssetBase : public Asset { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(JsonAssetBase); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(JsonAssetBase); protected: - String _path; protected: - /// /// Initializes a new instance of the class. /// @@ -27,7 +25,6 @@ protected: explicit JsonAssetBase(const SpawnParams& params, const AssetInfo* info); public: - /// /// The parsed json document. /// @@ -63,7 +60,6 @@ public: #endif public: - // [Asset] const String& GetPath() const override; #if USE_EDITOR @@ -71,7 +67,6 @@ public: #endif protected: - // [Asset] LoadResult loadAsset() override; void unload(bool isReloading) override; @@ -86,12 +81,11 @@ protected: /// API_CLASS(NoSpawn) class FLAXENGINE_API JsonAsset : public JsonAssetBase { -DECLARE_ASSET_HEADER(JsonAsset); + DECLARE_ASSET_HEADER(JsonAsset); private: ScriptingType::Dtor _dtor; public: - /// /// The scripting type of the deserialized unmanaged object instance (e.g. PhysicalMaterial). /// @@ -113,7 +107,6 @@ public: } protected: - // [JsonAssetBase] LoadResult loadAsset() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Content/Loading/ContentLoadTask.h b/Source/Engine/Content/Loading/ContentLoadTask.h index 2dfd03662..c36438ccc 100644 --- a/Source/Engine/Content/Loading/ContentLoadTask.h +++ b/Source/Engine/Content/Loading/ContentLoadTask.h @@ -16,7 +16,6 @@ class ContentLoadTask : public Task friend LoadingThread; public: - /// /// Describes work type /// @@ -28,14 +27,12 @@ public: DECLARE_ENUM_5(Result, Ok, AssetLoadError, MissingReferences, LoadDataError, TaskFailed); private: - /// /// Task type /// Type _type; protected: - /// /// Initializes a new instance of the class. /// @@ -46,7 +43,6 @@ protected: } public: - /// /// Gets a task type. /// @@ -57,7 +53,6 @@ public: } public: - /// /// Checks if async task is loading given asset resource /// @@ -69,11 +64,9 @@ public: } protected: - virtual Result run() = 0; public: - // [Task] String ToString() const override { @@ -84,7 +77,6 @@ public: } protected: - // [Task] void Enqueue() override; bool Run() override; diff --git a/Source/Engine/Content/Loading/ContentLoadingManager.cpp b/Source/Engine/Content/Loading/ContentLoadingManager.cpp index 64084b586..dedb2761f 100644 --- a/Source/Engine/Content/Loading/ContentLoadingManager.cpp +++ b/Source/Engine/Content/Loading/ContentLoadingManager.cpp @@ -31,7 +31,6 @@ using namespace ContentLoadingManagerImpl; class ContentLoadingManagerService : public EngineService { public: - ContentLoadingManagerService() : EngineService(TEXT("Content Loading Manager"), -500) { diff --git a/Source/Engine/Content/Loading/ContentLoadingManager.h b/Source/Engine/Content/Loading/ContentLoadingManager.h index 7db67a1b4..51ea7f6dd 100644 --- a/Source/Engine/Content/Loading/ContentLoadingManager.h +++ b/Source/Engine/Content/Loading/ContentLoadingManager.h @@ -14,13 +14,11 @@ class ContentLoadTask; class LoadingThread : public IRunnable { protected: - volatile int64 _exitFlag; Thread* _thread; int32 _totalTasksDoneCount; public: - /// /// Init /// @@ -32,7 +30,6 @@ public: ~LoadingThread(); public: - /// /// Gets the thread identifier. /// @@ -40,7 +37,6 @@ public: uint64 GetID() const; public: - /// /// Returns true if thread has empty exit flag, so it can continue it's work /// @@ -61,7 +57,6 @@ public: void Join(); public: - /// /// Starts thread execution. /// @@ -76,7 +71,6 @@ public: void Run(ContentLoadTask* task); public: - // [IRunnable] String ToString() const override; int32 Run() override; @@ -93,7 +87,6 @@ class ContentLoadingManager friend Asset; public: - /// /// Checks if current execution context is thread used to load assets. /// @@ -110,7 +103,6 @@ public: static LoadingThread* GetCurrentLoadThread(); public: - /// /// Gets amount of enqueued tasks to perform. /// diff --git a/Source/Engine/Content/SoftAssetReference.h b/Source/Engine/Content/SoftAssetReference.h index eb182220d..a65099870 100644 --- a/Source/Engine/Content/SoftAssetReference.h +++ b/Source/Engine/Content/SoftAssetReference.h @@ -170,7 +170,6 @@ public: } public: - /// /// Gets the asset (or null if unassigned). /// diff --git a/Source/Engine/Content/Storage/AssetHeader.h b/Source/Engine/Content/Storage/AssetHeader.h index ec7b164dc..1c7761e11 100644 --- a/Source/Engine/Content/Storage/AssetHeader.h +++ b/Source/Engine/Content/Storage/AssetHeader.h @@ -39,7 +39,6 @@ struct FLAXENGINE_API AssetHeader FlaxChunk* Chunks[ASSET_FILE_DATA_CHUNKS]; public: - /// /// Initializes a new instance of the struct. /// @@ -51,7 +50,6 @@ public: } public: - /// /// Gets the chunks. /// @@ -154,7 +152,6 @@ struct FLAXENGINE_API AssetInitData #endif public: - /// /// Gets the hash code. /// diff --git a/Source/Engine/Content/Storage/ContentStorageManager.h b/Source/Engine/Content/Storage/ContentStorageManager.h index 6f398e10a..5cc38e212 100644 --- a/Source/Engine/Content/Storage/ContentStorageManager.h +++ b/Source/Engine/Content/Storage/ContentStorageManager.h @@ -14,14 +14,12 @@ class FlaxPackage; class FLAXENGINE_API ContentStorageManager { public: - /// /// Auto-release timeout for unused asset chunks. /// static TimeSpan UnusedDataChunksLifetime; public: - /// /// Gets the assets data storage container. /// @@ -78,7 +76,6 @@ public: static void EnsureUnlocked(); public: - /// /// Determines whether the specified path can be a binary asset file (based on it's extension). /// @@ -94,7 +91,6 @@ public: static bool IsFlaxStorageExtension(const String& extension); public: - /// /// Gets the packages. /// diff --git a/Source/Engine/Content/Storage/FlaxChunk.h b/Source/Engine/Content/Storage/FlaxChunk.h index 66bfcd4e4..0aed68fc4 100644 --- a/Source/Engine/Content/Storage/FlaxChunk.h +++ b/Source/Engine/Content/Storage/FlaxChunk.h @@ -29,7 +29,6 @@ DECLARE_ENUM_OPERATORS(FlaxChunkFlags); class FLAXENGINE_API FlaxChunk { public: - /// /// Chunk of data location info /// @@ -68,7 +67,6 @@ public: }; public: - /// /// The chunk location in file. /// @@ -90,7 +88,6 @@ public: BytesContainer Data; public: - /// /// Initializes a new instance of the class. /// @@ -106,7 +103,6 @@ public: } public: - /// /// Gets this chunk data pointer. /// diff --git a/Source/Engine/Content/Storage/FlaxFile.h b/Source/Engine/Content/Storage/FlaxFile.h index 2a5ca96c0..9af86da0d 100644 --- a/Source/Engine/Content/Storage/FlaxFile.h +++ b/Source/Engine/Content/Storage/FlaxFile.h @@ -10,11 +10,9 @@ class FLAXENGINE_API FlaxFile : public FlaxStorage { protected: - Entry _asset; public: - /// /// Initializes a new instance of the class. /// @@ -22,7 +20,6 @@ public: FlaxFile(const StringView& path); public: - // [FlaxStorage] String ToString() const override; bool IsPackage() const override; @@ -35,7 +32,6 @@ public: void Dispose() override; protected: - // [FlaxStorage] bool GetEntry(const Guid& id, Entry& e) override; void AddEntry(Entry& e) override; diff --git a/Source/Engine/Content/Storage/FlaxPackage.h b/Source/Engine/Content/Storage/FlaxPackage.h index ee97fc483..4c468c925 100644 --- a/Source/Engine/Content/Storage/FlaxPackage.h +++ b/Source/Engine/Content/Storage/FlaxPackage.h @@ -11,11 +11,9 @@ class FLAXENGINE_API FlaxPackage : public FlaxStorage { protected: - Dictionary _entries; public: - /// /// Initializes a new instance of the class. /// @@ -23,7 +21,6 @@ public: FlaxPackage(const StringView& path); public: - // [FlaxStorage] String ToString() const override; bool IsPackage() const override; @@ -36,7 +33,6 @@ public: void Dispose() override; protected: - // [FlaxStorage] bool GetEntry(const Guid& id, Entry& e) override; void AddEntry(Entry& e) override; diff --git a/Source/Engine/Content/Storage/FlaxStorage.h b/Source/Engine/Content/Storage/FlaxStorage.h index d37cddcd1..62cb524bc 100644 --- a/Source/Engine/Content/Storage/FlaxStorage.h +++ b/Source/Engine/Content/Storage/FlaxStorage.h @@ -27,7 +27,6 @@ class FLAXENGINE_API FlaxStorage : public Object friend class BinaryAsset; public: - /// /// Magic code stored in file header to identify contents. /// @@ -88,7 +87,6 @@ public: }; protected: - // State uint32 _refCount; DateTime _lastRefLostTime; @@ -104,24 +102,20 @@ protected: String _path; protected: - explicit FlaxStorage(const StringView& path); private: - // Used by FlaxStorageReference: void AddRef(); void RemoveRef(); public: - /// /// Finalizes an instance of the class. /// virtual ~FlaxStorage(); public: - /// /// Locks the storage chunks data to prevent disposing them. Also ensures that file handles won't be closed while chunks are locked. /// @@ -147,7 +141,6 @@ public: static LockData Invalid; private: - FlaxStorage* _storage; LockData(FlaxStorage* storage) @@ -158,14 +151,13 @@ public: } public: - LockData(const LockData& other) : _storage(other._storage) { if (_storage) _storage->LockChunks(); } - + LockData(LockData&& other) noexcept : _storage(other._storage) { @@ -208,7 +200,6 @@ public: other._storage = nullptr; return *this; } - }; /// @@ -228,7 +219,6 @@ public: LockData LockSafe(); public: - /// /// Gets the references count. /// @@ -335,7 +325,6 @@ public: } public: - /// /// Loads package from the file. /// @@ -417,7 +406,6 @@ public: virtual void Dispose(); public: - /// /// Ticks this instance. /// @@ -428,7 +416,6 @@ public: #endif public: - #if USE_EDITOR /// @@ -489,7 +476,6 @@ public: #endif protected: - bool LoadAssetHeader(const Entry& e, AssetInitData& data); void AddChunk(FlaxChunk* chunk); virtual void AddEntry(Entry& e) = 0; diff --git a/Source/Engine/Content/Storage/FlaxStorageReference.h b/Source/Engine/Content/Storage/FlaxStorageReference.h index 8c15f457b..aa4d91202 100644 --- a/Source/Engine/Content/Storage/FlaxStorageReference.h +++ b/Source/Engine/Content/Storage/FlaxStorageReference.h @@ -10,11 +10,9 @@ struct FLAXENGINE_API FlaxStorageReference { private: - FlaxStorage* _storage; public: - FlaxStorageReference(FlaxStorage* storage) : _storage(storage) { @@ -36,14 +34,12 @@ public: } public: - FORCE_INLINE FlaxStorage* Get() const { return _storage; } public: - FlaxStorageReference& operator=(const FlaxStorageReference& other) { if (this != &other) diff --git a/Source/Engine/Content/Storage/JsonStorageProxy.h b/Source/Engine/Content/Storage/JsonStorageProxy.h index 198ebb8c3..1af6c197f 100644 --- a/Source/Engine/Content/Storage/JsonStorageProxy.h +++ b/Source/Engine/Content/Storage/JsonStorageProxy.h @@ -14,7 +14,6 @@ struct AssetInfo; class FLAXENGINE_API JsonStorageProxy { public: - /// /// Determines whether the specified extension can be a json resource file. /// diff --git a/Source/Engine/Content/Upgraders/AudioClipUpgrader.h b/Source/Engine/Content/Upgraders/AudioClipUpgrader.h index 426835f4a..730e93ef6 100644 --- a/Source/Engine/Content/Upgraders/AudioClipUpgrader.h +++ b/Source/Engine/Content/Upgraders/AudioClipUpgrader.h @@ -16,7 +16,6 @@ class AudioClipUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -30,7 +29,6 @@ public: } private: - // ============================================ // Version 1: // Designed: 26.02.2018 @@ -88,32 +86,32 @@ private: int32 numSamples; switch (oldHeader.Format) { - case AudioFormat::Raw: - { - numSamples = chunk->Size() / (oldHeader.Info.BitDepth / 8); - break; - } - case AudioFormat::Vorbis: - { + case AudioFormat::Raw: + { + numSamples = chunk->Size() / (oldHeader.Info.BitDepth / 8); + break; + } + case AudioFormat::Vorbis: + { #if COMPILE_WITH_OGG_VORBIS - OggVorbisDecoder decoder; - MemoryReadStream stream(chunk->Get(), chunk->Size()); - AudioDataInfo outInfo; - if (!decoder.Open(&stream, outInfo, 0)) - { - LOG(Warning, "Audio data open failed (OggVorbisDecoder)."); - return true; - } - numSamples = outInfo.NumSamples; + OggVorbisDecoder decoder; + MemoryReadStream stream(chunk->Get(), chunk->Size()); + AudioDataInfo outInfo; + if (!decoder.Open(&stream, outInfo, 0)) + { + LOG(Warning, "Audio data open failed (OggVorbisDecoder)."); + return true; + } + numSamples = outInfo.NumSamples; #else LOG(Warning, "OggVorbisDecoder is disabled."); return true; #endif - break; - } - default: - LOG(Warning, "Unknown audio data format."); - return true; + break; + } + default: + LOG(Warning, "Unknown audio data format."); + return true; } newHeader.SamplesPerChunk[chunkIndex] = numSamples; } diff --git a/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h b/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h index e1aa7e8f2..ba275337e 100644 --- a/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h @@ -24,7 +24,6 @@ struct FLAXENGINE_API AssetMigrationContext AssetInitData Output; public: - /// /// Allocates the chunk in the output data so upgrader can write to it. /// @@ -68,7 +67,6 @@ typedef bool (*UpgradeHandler)(AssetMigrationContext& context); class FLAXENGINE_API BinaryAssetUpgrader : public IAssetUpgrader { public: - struct Upgrader { uint32 CurrentVersion; @@ -77,12 +75,10 @@ public: }; private: - Upgrader const* _upgraders; int32 _upgradersCount; public: - /// /// Upgrades the specified asset data serialized version. /// @@ -114,7 +110,6 @@ public: } public: - /// /// Copies all the chunks from the input data to the output container. /// @@ -179,7 +174,6 @@ public: } protected: - BinaryAssetUpgrader() { _upgraders = nullptr; @@ -193,7 +187,6 @@ protected: } public: - // [IAssetUpgrader] bool ShouldUpgrade(uint32 serializedVersion) const override { diff --git a/Source/Engine/Content/Upgraders/FontAssetUpgrader.h b/Source/Engine/Content/Upgraders/FontAssetUpgrader.h index 1a42077a1..b607acade 100644 --- a/Source/Engine/Content/Upgraders/FontAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/FontAssetUpgrader.h @@ -14,7 +14,6 @@ class FontAssetUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -29,7 +28,6 @@ public: } private: - // ============================================ // Version 1: // Designed: long time ago in a galaxy far far away diff --git a/Source/Engine/Content/Upgraders/IAssetUpgrader.h b/Source/Engine/Content/Upgraders/IAssetUpgrader.h index 17ea8c260..97179d494 100644 --- a/Source/Engine/Content/Upgraders/IAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/IAssetUpgrader.h @@ -12,7 +12,6 @@ class FLAXENGINE_API IAssetUpgrader { public: - /// /// Finalizes an instance of the class. /// @@ -21,7 +20,6 @@ public: } public: - /// /// Checks if given asset version should be converted. /// diff --git a/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h b/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h index b96f23612..c8796cb04 100644 --- a/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h +++ b/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h @@ -17,7 +17,6 @@ class MaterialInstanceUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -32,7 +31,6 @@ public: } private: - // ============================================ // Version 4: // Designed: 5/18/2017 diff --git a/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h b/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h index 599758bbe..135696b9a 100644 --- a/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h @@ -19,7 +19,6 @@ class ModelAssetUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -36,7 +35,6 @@ public: } private: - // ============================================ // Version 25: // The same as version 24 except Vertex Buffer 1 has `Color32 Color` component per vertex added diff --git a/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h b/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h index 99fda669f..87cbc758d 100644 --- a/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h @@ -15,7 +15,6 @@ class ShaderAssetUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -29,7 +28,6 @@ public: } private: - // ============================================ // Version 18: // Designed: 7/24/2019 diff --git a/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h b/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h index 7a1d3842e..9cf2bf08e 100644 --- a/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h +++ b/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h @@ -17,7 +17,6 @@ class SkeletonMaskUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -31,7 +30,6 @@ public: } private: - static bool Upgrade_1_To_2(AssetMigrationContext& context) { ASSERT(context.Input.SerializedVersion == 1 && context.Output.SerializedVersion == 2); @@ -85,7 +83,7 @@ private: if (context.AllocateChunk(0)) return true; MemoryWriteStream stream(4096); - + const Guid skeletonId = skeleton.GetID(); stream.Write(&skeletonId); stream.WriteInt32(nodesMask.Count()); diff --git a/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h b/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h index b2dc06b78..4b1bfaf30 100644 --- a/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h @@ -21,7 +21,6 @@ class SkinnedModelAssetUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -37,7 +36,6 @@ public: } private: - static bool Upgrade_1_To_2(AssetMigrationContext& context) { ASSERT(context.Input.SerializedVersion == 1 && context.Output.SerializedVersion == 2); diff --git a/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h b/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h index 18d23e0ed..68e413159 100644 --- a/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h +++ b/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h @@ -26,7 +26,6 @@ class TextureAssetUpgrader : public BinaryAssetUpgrader { public: - /// /// Initializes a new instance of the class. /// @@ -40,7 +39,6 @@ public: } private: - // ============================================ // Versions 1, 2 and 3: // Designed: long time ago in a galaxy far far away @@ -178,10 +176,10 @@ private: case PixelFormat::R32G32B32A32_UInt: case PixelFormat::R32G32B32A32_SInt: return PixelFormatOld::PF_R32G32B32A32; - //case PixelFormat::R32G32B32_Typeless: - //case PixelFormat::R32G32B32_Float: - //case PixelFormat::R32G32B32_UInt: - //case PixelFormat::R32G32B32_SInt: + //case PixelFormat::R32G32B32_Typeless: + //case PixelFormat::R32G32B32_Float: + //case PixelFormat::R32G32B32_UInt: + //case PixelFormat::R32G32B32_SInt: case PixelFormat::R16G16B16A16_Typeless: case PixelFormat::R16G16B16A16_Float: case PixelFormat::R16G16B16A16_UNorm: @@ -231,7 +229,7 @@ private: case PixelFormat::D24_UNorm_S8_UInt: case PixelFormat::R24_UNorm_X8_Typeless: return PixelFormatOld::PF_DepthStencil; - //case PixelFormat::X24_Typeless_G8_UInt: + //case PixelFormat::X24_Typeless_G8_UInt: case PixelFormat::R8G8_Typeless: case PixelFormat::R8G8_UNorm: case PixelFormat::R8G8_UInt: @@ -256,9 +254,9 @@ private: case PixelFormat::A8_UNorm: return PixelFormatOld::PF_A8; case PixelFormat::R1_UNorm: - //case PixelFormat::R9G9B9E5_Sharedexp: - //case PixelFormat::R8G8_B8G8_UNorm: - //case PixelFormat::G8R8_G8B8_UNorm: + //case PixelFormat::R9G9B9E5_Sharedexp: + //case PixelFormat::R8G8_B8G8_UNorm: + //case PixelFormat::G8R8_G8B8_UNorm: case PixelFormat::BC1_Typeless: case PixelFormat::BC1_UNorm: case PixelFormat::BC1_UNorm_sRGB: @@ -281,20 +279,20 @@ private: return PixelFormatOld::PF_BC5; case PixelFormat::B5G6R5_UNorm: return PixelFormatOld::PF_B5G6R5; - //case PixelFormat::B5G5R5A1_UNorm: - //case PixelFormat::B8G8R8A8_UNorm: - //case PixelFormat::B8G8R8X8_UNorm: - //case PixelFormat::R10G10B10_Xr_Bias_A2_UNorm: - //case PixelFormat::B8G8R8A8_Typeless: - //case PixelFormat::B8G8R8A8_UNorm_sRGB: - //case PixelFormat::B8G8R8X8_Typeless: - //case PixelFormat::B8G8R8X8_UNorm_sRGB: - //case PixelFormat::BC6H_Typeless: - //case PixelFormat::BC6H_Uf16: - //case PixelFormat::BC6H_Sf16: - //case PixelFormat::BC7_Typeless: - //case PixelFormat::BC7_UNorm: - //case PixelFormat::BC7_UNorm_sRGB: + //case PixelFormat::B5G5R5A1_UNorm: + //case PixelFormat::B8G8R8A8_UNorm: + //case PixelFormat::B8G8R8X8_UNorm: + //case PixelFormat::R10G10B10_Xr_Bias_A2_UNorm: + //case PixelFormat::B8G8R8A8_Typeless: + //case PixelFormat::B8G8R8A8_UNorm_sRGB: + //case PixelFormat::B8G8R8X8_Typeless: + //case PixelFormat::B8G8R8X8_UNorm_sRGB: + //case PixelFormat::BC6H_Typeless: + //case PixelFormat::BC6H_Uf16: + //case PixelFormat::BC6H_Sf16: + //case PixelFormat::BC7_Typeless: + //case PixelFormat::BC7_UNorm: + //case PixelFormat::BC7_UNorm_sRGB: default: break; } diff --git a/Source/Engine/Content/WeakAssetReference.h b/Source/Engine/Content/WeakAssetReference.h index 4bca98ba0..1124e9656 100644 --- a/Source/Engine/Content/WeakAssetReference.h +++ b/Source/Engine/Content/WeakAssetReference.h @@ -10,15 +10,12 @@ API_CLASS(InBuild) class WeakAssetReferenceBase { public: - typedef Delegate<> EventType; protected: - Asset* _asset = nullptr; public: - /// /// The asset unloading event (should cleanup refs to it). /// @@ -38,7 +35,6 @@ public: ~WeakAssetReferenceBase(); public: - /// /// Gets the asset ID or Guid::Empty if not set. /// @@ -61,7 +57,6 @@ public: String ToString() const; protected: - void OnSet(Asset* asset); void OnUnloaded(Asset* asset); }; @@ -73,7 +68,6 @@ template API_CLASS(InBuild) class WeakAssetReference : public WeakAssetReferenceBase { public: - /// /// Initializes a new instance of the class. /// @@ -125,7 +119,6 @@ public: } public: - FORCE_INLINE WeakAssetReference& operator=(const WeakAssetReference& other) { OnSet(other.Get()); @@ -196,7 +189,6 @@ public: } public: - /// /// Sets the asset reference. /// diff --git a/Source/Engine/ContentExporters/AssetExporters.h b/Source/Engine/ContentExporters/AssetExporters.h index 4a7c8b5de..28e98cd1f 100644 --- a/Source/Engine/ContentExporters/AssetExporters.h +++ b/Source/Engine/ContentExporters/AssetExporters.h @@ -9,7 +9,6 @@ class AssetExporters { public: - static ExportAssetResult ExportTexture(ExportAssetContext& context); static ExportAssetResult ExportCubeTexture(ExportAssetContext& context); static ExportAssetResult ExportAudioClip(ExportAssetContext& context); diff --git a/Source/Engine/ContentExporters/AssetsExportingManager.cpp b/Source/Engine/ContentExporters/AssetsExportingManager.cpp index 6a8be66b2..fcb8a88d9 100644 --- a/Source/Engine/ContentExporters/AssetsExportingManager.cpp +++ b/Source/Engine/ContentExporters/AssetsExportingManager.cpp @@ -20,7 +20,6 @@ Dictionary AssetsExportingManager::Exporters; class AssetsExportingManagerService : public EngineService { public: - AssetsExportingManagerService() : EngineService(TEXT("AssetsExportingManager"), -300) { diff --git a/Source/Engine/ContentExporters/AssetsExportingManager.h b/Source/Engine/ContentExporters/AssetsExportingManager.h index 2ff11f2a2..bd87220cb 100644 --- a/Source/Engine/ContentExporters/AssetsExportingManager.h +++ b/Source/Engine/ContentExporters/AssetsExportingManager.h @@ -13,14 +13,12 @@ class AssetsExportingManager { public: - /// /// The asset exporting callbacks. Identified by the asset typename. /// static Dictionary Exporters; public: - /// /// Gets the asset export for thee given asset typename. /// @@ -36,7 +34,6 @@ public: static bool CanExport(const String& inputPath); public: - /// /// Exports the asset. /// diff --git a/Source/Engine/ContentExporters/Types.h b/Source/Engine/ContentExporters/Types.h index 06d2279ec..8d520aefb 100644 --- a/Source/Engine/ContentExporters/Types.h +++ b/Source/Engine/ContentExporters/Types.h @@ -29,7 +29,6 @@ typedef Function ExportAssetFunction; class ExportAssetContext : public NonCopyable { public: - /// /// The asset reference (prepared by the context to be used by callback). /// @@ -56,7 +55,6 @@ public: void* CustomArg; public: - /// /// Initializes a new instance of the class. /// @@ -73,7 +71,6 @@ public: } public: - /// /// Runs the specified callback. /// diff --git a/Source/Engine/ContentImporters/AssetsImportingManager.cpp b/Source/Engine/ContentImporters/AssetsImportingManager.cpp index 39c63a201..4d8d49c87 100644 --- a/Source/Engine/ContentImporters/AssetsImportingManager.cpp +++ b/Source/Engine/ContentImporters/AssetsImportingManager.cpp @@ -56,7 +56,6 @@ const String AssetsImportingManager::CreateVisualScriptTag(TEXT("VisualScript")) class AssetsImportingManagerService : public EngineService { public: - AssetsImportingManagerService() : EngineService(TEXT("AssetsImportingManager"), -400) { diff --git a/Source/Engine/ContentImporters/AssetsImportingManager.h b/Source/Engine/ContentImporters/AssetsImportingManager.h index 6d97bd39d..67cafec17 100644 --- a/Source/Engine/ContentImporters/AssetsImportingManager.h +++ b/Source/Engine/ContentImporters/AssetsImportingManager.h @@ -12,7 +12,6 @@ class AssetsImportingManager { public: - /// /// The asset importers. /// @@ -24,7 +23,6 @@ public: static Array Creators; public: - /// /// The create texture tag (using internal import pipeline to crate texture asset from custom image source). /// @@ -116,7 +114,6 @@ public: static const String CreateVisualScriptTag; public: - /// /// Gets the asset importer by file extension. /// @@ -132,7 +129,6 @@ public: static const AssetCreator* GetCreator(const String& tag); public: - /// /// Creates new asset. /// @@ -226,7 +222,6 @@ public: } private: - static bool Create(const CreateAssetFunction& callback, const StringView& inputPath, const StringView& outputPath, Guid& assetId, void* arg); }; diff --git a/Source/Engine/ContentImporters/CreateAnimationGraph.h b/Source/Engine/ContentImporters/CreateAnimationGraph.h index 8ada19b72..785839aa8 100644 --- a/Source/Engine/ContentImporters/CreateAnimationGraph.h +++ b/Source/Engine/ContentImporters/CreateAnimationGraph.h @@ -12,7 +12,6 @@ class CreateAnimationGraph { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h b/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h index 0cbac7deb..2dd47b62f 100644 --- a/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h +++ b/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h @@ -15,7 +15,6 @@ class CreateAnimationGraphFunction { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateCollisionData.h b/Source/Engine/ContentImporters/CreateCollisionData.h index 547a10485..b29a61198 100644 --- a/Source/Engine/ContentImporters/CreateCollisionData.h +++ b/Source/Engine/ContentImporters/CreateCollisionData.h @@ -16,7 +16,6 @@ class CreateCollisionData { public: - /// /// Creates the CollisionData. /// diff --git a/Source/Engine/ContentImporters/CreateJson.h b/Source/Engine/ContentImporters/CreateJson.h index 91595cae8..5622c5746 100644 --- a/Source/Engine/ContentImporters/CreateJson.h +++ b/Source/Engine/ContentImporters/CreateJson.h @@ -14,7 +14,6 @@ class CreateJson { public: - static bool Create(const StringView& path, rapidjson_flax::StringBuffer& data, const String& dataTypename); static bool Create(const StringView& path, rapidjson_flax::StringBuffer& data, const char* dataTypename); static bool Create(const StringView& path, StringAnsiView& data, StringAnsiView& dataTypename); diff --git a/Source/Engine/ContentImporters/CreateMaterial.h b/Source/Engine/ContentImporters/CreateMaterial.h index 70dc3b338..ee0e1095d 100644 --- a/Source/Engine/ContentImporters/CreateMaterial.h +++ b/Source/Engine/ContentImporters/CreateMaterial.h @@ -14,7 +14,6 @@ class CreateMaterial { public: - struct Options { MaterialInfo Info; diff --git a/Source/Engine/ContentImporters/CreateMaterialFunction.h b/Source/Engine/ContentImporters/CreateMaterialFunction.h index 83f1706a2..8e407deb8 100644 --- a/Source/Engine/ContentImporters/CreateMaterialFunction.h +++ b/Source/Engine/ContentImporters/CreateMaterialFunction.h @@ -16,7 +16,6 @@ class CreateMaterialFunction { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateMaterialInstance.h b/Source/Engine/ContentImporters/CreateMaterialInstance.h index 8c8ec5883..c2d5097e1 100644 --- a/Source/Engine/ContentImporters/CreateMaterialInstance.h +++ b/Source/Engine/ContentImporters/CreateMaterialInstance.h @@ -16,7 +16,6 @@ class CreateMaterialInstance { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateParticleEmitter.h b/Source/Engine/ContentImporters/CreateParticleEmitter.h index f3123c724..ff948950f 100644 --- a/Source/Engine/ContentImporters/CreateParticleEmitter.h +++ b/Source/Engine/ContentImporters/CreateParticleEmitter.h @@ -14,7 +14,6 @@ class CreateParticleEmitter { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h b/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h index 2d649652f..d66699ab8 100644 --- a/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h +++ b/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h @@ -15,7 +15,6 @@ class CreateParticleEmitterFunction { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateParticleSystem.h b/Source/Engine/ContentImporters/CreateParticleSystem.h index 75a760b86..deb04f593 100644 --- a/Source/Engine/ContentImporters/CreateParticleSystem.h +++ b/Source/Engine/ContentImporters/CreateParticleSystem.h @@ -14,7 +14,6 @@ class CreateParticleSystem { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateRawData.h b/Source/Engine/ContentImporters/CreateRawData.h index 05f55f5c6..1c845c778 100644 --- a/Source/Engine/ContentImporters/CreateRawData.h +++ b/Source/Engine/ContentImporters/CreateRawData.h @@ -13,7 +13,6 @@ class CreateRawData { public: - /// /// Creates the raw data asset. /// diff --git a/Source/Engine/ContentImporters/CreateSceneAnimation.h b/Source/Engine/ContentImporters/CreateSceneAnimation.h index 314d98367..6624c0ff6 100644 --- a/Source/Engine/ContentImporters/CreateSceneAnimation.h +++ b/Source/Engine/ContentImporters/CreateSceneAnimation.h @@ -14,7 +14,6 @@ class CreateSceneAnimation { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateSkeletonMask.h b/Source/Engine/ContentImporters/CreateSkeletonMask.h index 6fa4ef36a..4bfebadb2 100644 --- a/Source/Engine/ContentImporters/CreateSkeletonMask.h +++ b/Source/Engine/ContentImporters/CreateSkeletonMask.h @@ -14,7 +14,6 @@ class CreateSkeletonMask { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/CreateVisualScript.h b/Source/Engine/ContentImporters/CreateVisualScript.h index ab753af29..d40889908 100644 --- a/Source/Engine/ContentImporters/CreateVisualScript.h +++ b/Source/Engine/ContentImporters/CreateVisualScript.h @@ -13,7 +13,6 @@ class CreateVisualScript { public: - /// /// Creates the asset. /// diff --git a/Source/Engine/ContentImporters/ImportAudio.h b/Source/Engine/ContentImporters/ImportAudio.h index 0090bd2c3..d269e6851 100644 --- a/Source/Engine/ContentImporters/ImportAudio.h +++ b/Source/Engine/ContentImporters/ImportAudio.h @@ -20,7 +20,6 @@ class ImportAudio { public: - /// /// Importing audio options /// @@ -44,14 +43,12 @@ public: String ToString() const; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; }; public: - /// /// Tries the get audio import options from the target location asset. /// diff --git a/Source/Engine/ContentImporters/ImportFont.h b/Source/Engine/ContentImporters/ImportFont.h index 627cb6861..b067f4f6b 100644 --- a/Source/Engine/ContentImporters/ImportFont.h +++ b/Source/Engine/ContentImporters/ImportFont.h @@ -12,7 +12,6 @@ class ImportFont { public: - /// /// Imports the font file. /// diff --git a/Source/Engine/ContentImporters/ImportIES.h b/Source/Engine/ContentImporters/ImportIES.h index e44aa158e..5060626a7 100644 --- a/Source/Engine/ContentImporters/ImportIES.h +++ b/Source/Engine/ContentImporters/ImportIES.h @@ -13,14 +13,12 @@ class ImportIES { private: - float _brightness = 0; Array _hAngles; Array _vAngles; Array _candalaValues; public: - /// /// Loads the IES file. /// @@ -36,7 +34,6 @@ public: float ExtractInR16(Array& output); public: - uint32 GetWidth() const { return 256; @@ -53,7 +50,6 @@ public: } private: - float InterpolatePoint(int32 x, int32 y) const; float InterpolateBilinear(float x, float y) const; static float ComputeFilterPos(float value, const Array& sortedValues); diff --git a/Source/Engine/ContentImporters/ImportModel.h b/Source/Engine/ContentImporters/ImportModel.h index 6d49ca826..098805a20 100644 --- a/Source/Engine/ContentImporters/ImportModel.h +++ b/Source/Engine/ContentImporters/ImportModel.h @@ -19,11 +19,9 @@ class ImportModelFile { public: - typedef ModelTool::Options Options; public: - /// /// Tries the get model import options from the target location asset. /// @@ -47,7 +45,6 @@ public: static CreateAssetResult Create(CreateAssetContext& context); private: - static CreateAssetResult ImportModel(CreateAssetContext& context, ModelData& modelData, const Options* options = nullptr); static CreateAssetResult ImportSkinnedModel(CreateAssetContext& context, ModelData& modelData, const Options* options = nullptr); static CreateAssetResult ImportAnimation(CreateAssetContext& context, ModelData& modelData, const Options* options = nullptr); diff --git a/Source/Engine/ContentImporters/ImportModelFile.h b/Source/Engine/ContentImporters/ImportModelFile.h index a262e6394..c4e9102c8 100644 --- a/Source/Engine/ContentImporters/ImportModelFile.h +++ b/Source/Engine/ContentImporters/ImportModelFile.h @@ -20,11 +20,9 @@ class ImportModelFile { public: - typedef ModelTool::Options Options; public: - /// /// Tries the get model import options from the target location asset. /// @@ -48,7 +46,6 @@ public: static CreateAssetResult Create(CreateAssetContext& context); private: - static CreateAssetResult ImportModel(CreateAssetContext& context, ModelData& modelData); static CreateAssetResult ImportSkinnedModel(CreateAssetContext& context, ModelData& modelData); static CreateAssetResult ImportAnimation(CreateAssetContext& context, ModelData& modelData); diff --git a/Source/Engine/ContentImporters/ImportShader.h b/Source/Engine/ContentImporters/ImportShader.h index 30ec90d66..00b178b53 100644 --- a/Source/Engine/ContentImporters/ImportShader.h +++ b/Source/Engine/ContentImporters/ImportShader.h @@ -12,7 +12,6 @@ class ImportShader { public: - /// /// Imports the shader file. /// diff --git a/Source/Engine/ContentImporters/ImportTexture.h b/Source/Engine/ContentImporters/ImportTexture.h index 4c042aad7..2328979f9 100644 --- a/Source/Engine/ContentImporters/ImportTexture.h +++ b/Source/Engine/ContentImporters/ImportTexture.h @@ -20,11 +20,9 @@ class ImportTexture { public: - typedef TextureTool::Options Options; public: - /// /// Tries the get texture import options from the target location asset. /// @@ -93,7 +91,6 @@ public: static CreateAssetResult ImportIES(CreateAssetContext& context); private: - static void InitOptions(CreateAssetContext& context, Options& options); static CreateAssetResult Create(CreateAssetContext& context, const TextureData& textureData, Options& options); static CreateAssetResult Create(CreateAssetContext& context, const TextureBase::InitData& textureData, Options& options); diff --git a/Source/Engine/ContentImporters/Types.h b/Source/Engine/ContentImporters/Types.h index eba132d8e..9ae577400 100644 --- a/Source/Engine/ContentImporters/Types.h +++ b/Source/Engine/ContentImporters/Types.h @@ -31,11 +31,9 @@ typedef Function CreateAssetFunction; class CreateAssetContext : public NonCopyable { private: - CreateAssetResult _applyChangesResult; public: - /// /// Path of the input file (may be empty if creating new asset) /// @@ -70,7 +68,6 @@ public: // TODO: add cancellation feature - so progress can be aborted on demand public: - /// /// Initializes a new instance of the class. /// @@ -88,7 +85,6 @@ public: } public: - /// /// Runs the specified callback. /// @@ -97,7 +93,6 @@ public: CreateAssetResult Run(const CreateAssetFunction& callback); public: - /// /// Allocates the chunk in the output data so upgrader can write to it. /// @@ -112,7 +107,6 @@ public: void AddMeta(JsonWriter& writer) const; private: - void ApplyChanges(); }; @@ -122,7 +116,6 @@ private: struct AssetImporter { public: - /// /// Extension of the file to import with that importer (without leading dot). /// @@ -145,7 +138,6 @@ public: struct AssetCreator { public: - /// /// Asset creators are identifiable by tag /// diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h index 53a0ccea8..01fe21b38 100644 --- a/Source/Engine/Core/Collections/Array.h +++ b/Source/Engine/Core/Collections/Array.h @@ -17,18 +17,15 @@ API_CLASS(InBuild) class Array { friend Array; public: - typedef T ItemType; typedef typename AllocationType::template Data AllocationData; private: - int32 _count; int32 _capacity; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -208,7 +205,6 @@ public: } public: - /// /// Gets the amount of the items in the collection. /// @@ -334,7 +330,6 @@ public: } public: - FORCE_INLINE T* begin() { return &_allocation.Get()[0]; @@ -356,7 +351,6 @@ public: } public: - /// /// Clear the collection without changing its capacity. /// @@ -738,7 +732,6 @@ public: } public: - /// /// Performs push on stack operation (stack grows at the end of the collection). /// @@ -777,7 +770,6 @@ public: } public: - /// /// Performs enqueue to queue operation (queue head is in the beginning of queue). /// @@ -800,7 +792,6 @@ public: } public: - /// /// Searches for the given item within the entire collection. /// @@ -869,7 +860,6 @@ public: } public: - bool operator==(const Array& other) const { if (_count == other._count) @@ -891,7 +881,6 @@ public: } public: - /// /// The collection iterator. /// @@ -915,7 +904,6 @@ public: } public: - Iterator() : _array(nullptr) , _index(-1) @@ -935,7 +923,6 @@ public: } public: - FORCE_INLINE Array* GetArray() const { return _array; @@ -1008,7 +995,6 @@ public: }; public: - /// /// Gets iterator for beginning of the collection. /// diff --git a/Source/Engine/Core/Collections/ArrayExtensions.h b/Source/Engine/Core/Collections/ArrayExtensions.h index 176d05e4a..d83238f5e 100644 --- a/Source/Engine/Core/Collections/ArrayExtensions.h +++ b/Source/Engine/Core/Collections/ArrayExtensions.h @@ -17,11 +17,9 @@ class IGrouping : public Array friend ArrayExtensions; protected: - TKey _key; public: - /// /// Gets the common key. /// @@ -47,7 +45,6 @@ public: class ArrayExtensions { public: - /// /// Searches for the specified object using a custom query and returns the zero-based index of the first occurrence within the entire collection. /// diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h index 00cfc9717..7d6d50773 100644 --- a/Source/Engine/Core/Collections/BitArray.h +++ b/Source/Engine/Core/Collections/BitArray.h @@ -15,18 +15,15 @@ API_CLASS(InBuild) class BitArray friend BitArray; public: - typedef uint64 ItemType; typedef typename AllocationType::template Data AllocationData; private: - int32 _count; int32 _capacity; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -119,7 +116,6 @@ public: } public: - /// /// Gets the pointer to the bits storage data (linear allocation). /// @@ -216,7 +212,6 @@ public: } public: - /// /// Clear the collection without changing its capacity. /// diff --git a/Source/Engine/Core/Collections/ChunkedArray.h b/Source/Engine/Core/Collections/ChunkedArray.h index 98a56673d..89c2bfe64 100644 --- a/Source/Engine/Core/Collections/ChunkedArray.h +++ b/Source/Engine/Core/Collections/ChunkedArray.h @@ -17,7 +17,6 @@ class ChunkedArray friend ChunkedArray; private: - // TODO: don't use Array but small struct and don't InlinedArray or Chunk* but Chunk (less dynamic allocations) typedef Array Chunk; @@ -25,7 +24,6 @@ private: Array> _chunks; public: - ChunkedArray() { } @@ -36,7 +34,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -70,7 +67,6 @@ public: } public: - // Gets element by index FORCE_INLINE T& At(int32 index) const { @@ -93,7 +89,6 @@ public: } public: - /// /// Chunked array iterator. /// @@ -102,7 +97,6 @@ public: friend ChunkedArray; private: - ChunkedArray* _collection; int32 _chunkIndex; int32 _index; @@ -115,7 +109,6 @@ public: } public: - Iterator() : _collection(nullptr) , _chunkIndex(INVALID_INDEX) @@ -131,7 +124,6 @@ public: } public: - FORCE_INLINE ChunkedArray* GetChunkedArray() const { return _collection; @@ -143,7 +135,6 @@ public: } public: - bool IsEnd() const { ASSERT(_collection); @@ -157,7 +148,6 @@ public: } public: - FORCE_INLINE T& operator*() const { return _collection->_chunks[_chunkIndex]->At(_index); @@ -169,7 +159,6 @@ public: } public: - FORCE_INLINE bool operator==(const Iterator& v) const { return _collection == v._collection && _chunkIndex == v._chunkIndex && _index == v._index; @@ -181,7 +170,6 @@ public: } public: - Iterator& operator++() { ASSERT(_collection); @@ -280,7 +268,6 @@ public: }; public: - /// /// Adds the specified item to the collection. /// @@ -482,7 +469,6 @@ public: } public: - Iterator Begin() const { return Iterator(this, 0); diff --git a/Source/Engine/Core/Collections/CollectionPoolCache.h b/Source/Engine/Core/Collections/CollectionPoolCache.h index 1a19df34c..490794ec7 100644 --- a/Source/Engine/Core/Collections/CollectionPoolCache.h +++ b/Source/Engine/Core/Collections/CollectionPoolCache.h @@ -39,7 +39,6 @@ template ClearCallback = class CollectionPoolCache { public: - /// /// Helper object used to access the pooled collection and return it to the pool after usage (on code scope execution end). /// @@ -48,7 +47,6 @@ public: friend CollectionPoolCache; private: - CollectionPoolCache* _pool; ScopeCache(CollectionPoolCache* pool, T* value) @@ -58,7 +56,6 @@ public: } public: - T* Value; ScopeCache() = delete; @@ -99,7 +96,6 @@ public: }; private: - CriticalSection _locker; Array> _pool; @@ -111,7 +107,6 @@ private: } public: - /// /// Finalizes an instance of the class. /// @@ -121,7 +116,6 @@ public: } public: - /// /// Gets the collection instance from the pool. Can reuse the object from the pool or create a new one. Returns collection is always cleared and ready to use. /// diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h index 1979c4e74..0ee455195 100644 --- a/Source/Engine/Core/Collections/Dictionary.h +++ b/Source/Engine/Core/Collections/Dictionary.h @@ -18,7 +18,6 @@ API_CLASS(InBuild) class Dictionary { friend Dictionary; public: - /// /// Describes single portion of space for the key and value pair in a hash map. /// @@ -106,14 +105,12 @@ public: typedef typename AllocationType::template Data AllocationData; private: - int32 _elementsCount = 0; int32 _deletedCount = 0; int32 _size = 0; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -200,7 +197,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -234,7 +230,6 @@ public: } public: - /// /// The Dictionary collection iterator. /// @@ -359,7 +354,6 @@ public: }; public: - /// /// Gets element by the key (will add default ValueType element if key not found). /// @@ -460,7 +454,6 @@ public: } public: - /// /// Clears the collection but without changing its capacity (all inserted elements: keys and values will be removed). /// @@ -571,7 +564,6 @@ public: } public: - /// /// Add pair element to the collection. /// @@ -700,7 +692,6 @@ public: } public: - /// /// Finds the element with given key in the collection. /// @@ -775,7 +766,6 @@ public: } public: - /// /// Clones other collection into this. /// @@ -813,7 +803,6 @@ public: } public: - Iterator Begin() const { Iterator i(*this, -1); @@ -851,7 +840,6 @@ public: } protected: - /// /// The result container of the dictionary item lookup searching. /// @@ -898,7 +886,7 @@ protected: if (insertPos == -1) insertPos = bucketIndex; } - // Occupied bucket by target key + // Occupied bucket by target key else if (bucket.Key == key) { // Found key diff --git a/Source/Engine/Core/Collections/HashSet.h b/Source/Engine/Core/Collections/HashSet.h index 22bdfe65a..debd91cfd 100644 --- a/Source/Engine/Core/Collections/HashSet.h +++ b/Source/Engine/Core/Collections/HashSet.h @@ -17,7 +17,6 @@ API_CLASS(InBuild) class HashSet { friend HashSet; public: - /// /// Describes single portion of space for the item in a hash map. /// @@ -31,7 +30,7 @@ public: Deleted, Occupied, }; - + /// The item. T Item; @@ -78,18 +77,16 @@ public: return _state != Occupied; } }; - + typedef typename AllocationType::template Data AllocationData; private: - int32 _elementsCount = 0; int32 _deletedCount = 0; int32 _size = 0; AllocationData _allocation; public: - /// /// Initializes a new instance of the class. /// @@ -176,7 +173,6 @@ public: } public: - /// /// Gets the amount of the elements in the collection. /// @@ -210,7 +206,6 @@ public: } public: - /// /// The hash set collection iterator. /// @@ -234,7 +229,6 @@ public: } public: - Iterator(const Iterator& i) : _collection(i._collection) , _index(i._index) @@ -248,7 +242,6 @@ public: } public: - FORCE_INLINE bool IsEnd() const { return _index == _collection.Capacity(); @@ -332,7 +325,6 @@ public: }; public: - /// /// Removes all elements from the collection. /// @@ -431,7 +423,6 @@ public: } public: - /// /// Add element to the collection. /// @@ -513,7 +504,6 @@ public: } public: - /// /// Find element with given item in the collection /// @@ -545,7 +535,6 @@ public: } public: - /// /// Clones other collection into this /// @@ -561,7 +550,6 @@ public: } public: - Iterator Begin() const { Iterator i(*this, -1); @@ -599,7 +587,6 @@ public: } protected: - /// /// The result container of the set item lookup searching. /// @@ -646,7 +633,7 @@ protected: if (insertPos == -1) insertPos = bucketIndex; } - // Occupied bucket by target item + // Occupied bucket by target item else if (bucket.Item == item) { // Found item diff --git a/Source/Engine/Core/Collections/RingBuffer.h b/Source/Engine/Core/Collections/RingBuffer.h index b7eb17f94..27edc59cc 100644 --- a/Source/Engine/Core/Collections/RingBuffer.h +++ b/Source/Engine/Core/Collections/RingBuffer.h @@ -13,92 +13,89 @@ template class RingBuffer { public: - - typedef T ItemType; - typedef typename AllocationType::template Data AllocationData; + typedef T ItemType; + typedef typename AllocationType::template Data AllocationData; private: - - int32 _front = 0, _back = 0, _count = 0, _capacity = 0; - AllocationData _allocation; + int32 _front = 0, _back = 0, _count = 0, _capacity = 0; + AllocationData _allocation; public: + ~RingBuffer() + { + Memory::DestructItems(Get() + Math::Min(_front, _back), _count); + } - ~RingBuffer() - { - Memory::DestructItems(Get() + Math::Min(_front, _back), _count); - } + FORCE_INLINE T* Get() + { + return _allocation.Get(); + } - FORCE_INLINE T* Get() - { - return _allocation.Get(); - } + FORCE_INLINE int32 Count() const + { + return _count; + } - FORCE_INLINE int32 Count() const - { - return _count; - } + FORCE_INLINE int32 Capacity() const + { + return _capacity; + } - FORCE_INLINE int32 Capacity() const - { - return _capacity; - } + void PushBack(const T& data) + { + if (_capacity == 0 || _capacity == _count) + { + const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1); + AllocationData alloc; + alloc.Allocate(capacity); + const int32 frontCount = Math::Min(_capacity - _front, _count); + Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount); + Memory::DestructItems(_allocation.Get() + _front, frontCount); + const int32 backCount = _count - frontCount; + Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount); + Memory::DestructItems(_allocation.Get(), backCount); + _allocation.Swap(alloc); + _front = 0; + _back = _count; + _capacity = capacity; + } + Memory::ConstructItems(_allocation.Get() + _back, &data, 1); + _back = (_back + 1) % _capacity; + _count++; + } - void PushBack(const T& data) - { - if (_capacity == 0 || _capacity == _count) - { - const int32 capacity = _allocation.CalculateCapacityGrow(_capacity, _count + 1); - AllocationData alloc; - alloc.Allocate(capacity); - const int32 frontCount = Math::Min(_capacity - _front, _count); - Memory::MoveItems(alloc.Get(), _allocation.Get() + _front, frontCount); - Memory::DestructItems(_allocation.Get() + _front, frontCount); - const int32 backCount = _count - frontCount; - Memory::MoveItems(alloc.Get() + frontCount, _allocation.Get(), backCount); - Memory::DestructItems(_allocation.Get(), backCount); - _allocation.Swap(alloc); - _front = 0; - _back = _count; - _capacity = capacity; - } - Memory::ConstructItems(_allocation.Get() + _back, &data, 1); - _back = (_back + 1) % _capacity; - _count++; - } + FORCE_INLINE T& PeekFront() + { + return _allocation.Get()[_front]; + } - FORCE_INLINE T& PeekFront() - { - return _allocation.Get()[_front]; - } - - FORCE_INLINE const T& PeekFront() const - { - return _allocation.Get()[_front]; - } + FORCE_INLINE const T& PeekFront() const + { + return _allocation.Get()[_front]; + } FORCE_INLINE T& operator[](int32 index) { ASSERT(index >= 0 && index < _count); - return _allocation.Get()[(_front + index) % _capacity]; + return _allocation.Get()[(_front + index) % _capacity]; } FORCE_INLINE const T& operator[](int32 index) const { ASSERT(index >= 0 && index < _count); - return _allocation.Get()[(_front + index) % _capacity]; + return _allocation.Get()[(_front + index) % _capacity]; } - void PopFront() - { - Memory::DestructItems(_allocation.Get() + _front, 1); - _front = (_front + 1) % _capacity; - _count--; - } + void PopFront() + { + Memory::DestructItems(_allocation.Get() + _front, 1); + _front = (_front + 1) % _capacity; + _count--; + } - void Clear() - { - Memory::DestructItems(Get() + Math::Min(_front, _back), _count); - _front = _back = _count = 0; - } + void Clear() + { + Memory::DestructItems(Get() + Math::Min(_front, _back), _count); + _front = _back = _count = 0; + } }; diff --git a/Source/Engine/Core/Collections/SamplesBuffer.h b/Source/Engine/Core/Collections/SamplesBuffer.h index 650ae4478..2d6d1e27b 100644 --- a/Source/Engine/Core/Collections/SamplesBuffer.h +++ b/Source/Engine/Core/Collections/SamplesBuffer.h @@ -12,12 +12,10 @@ template class SamplesBuffer { protected: - int32 _count = 0; T _data[Size]; public: - /// /// Gets amount of elements in the collection. /// @@ -110,7 +108,6 @@ public: } public: - /// /// Adds the specified value to the buffer. /// @@ -146,7 +143,6 @@ public: } public: - /// /// Gets the minimum value in the buffer. /// diff --git a/Source/Engine/Core/Collections/Sorting.h b/Source/Engine/Core/Collections/Sorting.h index 5d2a01044..34c0e8240 100644 --- a/Source/Engine/Core/Collections/Sorting.h +++ b/Source/Engine/Core/Collections/Sorting.h @@ -11,14 +11,12 @@ class FLAXENGINE_API Sorting { public: - /// /// Helper collection used by the sorting algorithms. Implements stack using single linear allocation with variable capacity. /// class FLAXENGINE_API SortingStack { public: - static SortingStack& Get(); int32 Count = 0; @@ -47,7 +45,6 @@ public: }; public: - /// /// Sorts the linear data array using Quick Sort algorithm (non recursive version, uses temporary stack collection). /// diff --git a/Source/Engine/Core/Types/CommonValue.h b/Source/Engine/Core/Types/CommonValue.h index 1ceebce0b..9820c6e35 100644 --- a/Source/Engine/Core/Types/CommonValue.h +++ b/Source/Engine/Core/Types/CommonValue.h @@ -51,7 +51,6 @@ class ScriptingObject; struct FLAXENGINE_API CommonValue { public: - /// /// Type /// @@ -86,7 +85,6 @@ public: }; public: - // 0.0f (floating-point value type) static const CommonValue Zero; @@ -103,7 +101,6 @@ public: static const CommonValue True; public: - /// /// Default constructor (bool) /// @@ -365,7 +362,6 @@ public: } public: - /// /// Assignment operator /// @@ -426,7 +422,6 @@ public: } public: - /// /// Gets value as boolean (if can convert it) /// @@ -742,7 +737,6 @@ public: } public: - /// /// Set new value and change type to Bool /// @@ -944,7 +938,6 @@ public: } public: - /// /// Change common value type /// @@ -975,7 +968,6 @@ public: } public: - /// /// Casts value from its type to another /// @@ -1027,7 +1019,6 @@ public: } public: - friend bool operator==(const CommonValue& a, const CommonValue& b) { ASSERT(a.Type == b.Type); @@ -1097,20 +1088,20 @@ public: return a.AsVector3 > b.AsVector3; case CommonType::Vector4: return a.AsVector4 > b.AsVector4; - //case CommonType::Color: return a.AsColor > b.AsColor; - //case CommonType::Guid: return a.AsGuid > b.AsGuid; + //case CommonType::Color: return a.AsColor > b.AsColor; + //case CommonType::Guid: return a.AsGuid > b.AsGuid; case CommonType::String: return StringUtils::Compare(a.AsString, b.AsString) > 0; - //case CommonType::Box: return a.AsBox > b.AsBox; - //case CommonType::Rotation: return a.AsRotation > b.AsRotation; - //case CommonType::Transform: return a.AsTransform > b.AsTransform; - //case CommonType::Sphere: return a.AsSphere > b.AsSphere; - //case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle; - //case CommonType::Ray: return a.AsRay > b.AsRay; + //case CommonType::Box: return a.AsBox > b.AsBox; + //case CommonType::Rotation: return a.AsRotation > b.AsRotation; + //case CommonType::Transform: return a.AsTransform > b.AsTransform; + //case CommonType::Sphere: return a.AsSphere > b.AsSphere; + //case CommonType::Rectangle: return a.AsRectangle > b.AsRectangle; + //case CommonType::Ray: return a.AsRay > b.AsRay; case CommonType::Pointer: case CommonType::Object: return a.AsPointer > b.AsPointer; - //case CommonType::Matrix: return a.AsMatrix > b.AsMatrix; + //case CommonType::Matrix: return a.AsMatrix > b.AsMatrix; case CommonType::Blob: return a.AsBlob.Length > b.AsBlob.Length; default: CRASH; @@ -1134,7 +1125,6 @@ public: } public: - static bool NearEqual(const CommonValue& a, const CommonValue& b, float epsilon); static CommonValue Lerp(const CommonValue& a, const CommonValue& b, float alpha); @@ -1143,7 +1133,6 @@ public: Guid GetObjectId() const; private: - void OnObjectDeleted(ScriptingObject* obj) { AsObject = nullptr; diff --git a/Source/Engine/Core/Types/DataContainer.h b/Source/Engine/Core/Types/DataContainer.h index 76893b421..de6da6a34 100644 --- a/Source/Engine/Core/Types/DataContainer.h +++ b/Source/Engine/Core/Types/DataContainer.h @@ -15,15 +15,12 @@ template class DataContainer : public Span { public: - typedef Span Base; private: - bool _isAllocated; public: - /// /// Initializes a new instance of the class. /// @@ -129,7 +126,6 @@ public: } public: - /// /// Returns true if data is allocated by container itself, otherwise it's just linked. /// @@ -339,7 +335,6 @@ public: } public: - template void Read(ReadStream* stream, int32 length) { diff --git a/Source/Engine/Core/Types/DateTime.h b/Source/Engine/Core/Types/DateTime.h index 3ac7264ab..8b593a405 100644 --- a/Source/Engine/Core/Types/DateTime.h +++ b/Source/Engine/Core/Types/DateTime.h @@ -23,14 +23,12 @@ DECLARE_ENUM_EX_12(MonthOfYear, int32, 1, January, February, March, April, May, API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API DateTime { public: - /// /// Ticks in 100 nanoseconds resolution since January 1, 0001 A.D. /// int64 Ticks; public: - /// /// Empty constructor. /// @@ -60,7 +58,6 @@ public: DateTime(int32 year, int32 month, int32 day, int32 hour = 0, int32 minute = 0, int32 second = 0, int32 millisecond = 0); public: - /// /// Gets the string. /// @@ -72,7 +69,6 @@ public: String ToFileNameString() const; public: - DateTime operator+(const TimeSpan& other) const; DateTime& operator+=(const TimeSpan& other); TimeSpan operator-(const DateTime& other) const; @@ -110,7 +106,6 @@ public: } public: - /// /// Gets the date part of this date. The time part is truncated and becomes 00:00:00.000. /// @@ -210,7 +205,6 @@ public: int32 ToUnixTimestamp() const; public: - /// /// Gets the number of days in the year and month. /// diff --git a/Source/Engine/Core/Types/Guid.cpp b/Source/Engine/Core/Types/Guid.cpp index c910e89dd..b515839d9 100644 --- a/Source/Engine/Core/Types/Guid.cpp +++ b/Source/Engine/Core/Types/Guid.cpp @@ -63,7 +63,7 @@ FORCE_INLINE void GuidToString(const CharType* cachedGuidDigits, CharType* buffe break; } case Guid::FormatType::B: - // TODO: impl GuidToString for FormatType::B: + // TODO: impl GuidToString for FormatType::B: case Guid::FormatType::P: // TODO: impl GuidToString for FormatType::P: default: @@ -89,7 +89,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) { switch (text.Length()) { - // FormatType::N + // FormatType::N case 32: { return @@ -98,7 +98,7 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) StringUtils::ParseHex(*text + 16, 8, &value.C) || StringUtils::ParseHex(*text + 24, 8, &value.D); } - // FormatType::D + // FormatType::D case 36: { StringType b = StringType(text.Substring(9, 4)) + text.Substring(14, 4); @@ -109,8 +109,8 @@ FORCE_INLINE bool GuidParse(const StringViewType& text, Guid& value) StringUtils::ParseHex(*c, &value.C) || StringUtils::ParseHex(*text + 28, 8, &value.D); } - // FormatType::B - // FormatType::P + // FormatType::B + // FormatType::P case 38: { StringType b = StringType(text.Substring(10, 4)) + text.Substring(15, 4); diff --git a/Source/Engine/Core/Types/Guid.h b/Source/Engine/Core/Types/Guid.h index 76c4fc61f..721d75385 100644 --- a/Source/Engine/Core/Types/Guid.h +++ b/Source/Engine/Core/Types/Guid.h @@ -15,7 +15,6 @@ class String; API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API Guid { public: - /// /// Accepted format specifiers for the format parameter /// @@ -39,7 +38,6 @@ public: }; public: - union { struct @@ -65,12 +63,10 @@ public: }; public: - // Empty Guid (considered as invalid ID) static Guid Empty; public: - /// /// Empty constructor. /// @@ -92,7 +88,6 @@ public: } public: - // Compares two Guids for equality // @param left The first Guid to compare // @param right The second Guid to compare @@ -152,14 +147,12 @@ public: } public: - String ToString() const; String ToString(FormatType format) const; void ToString(char* buffer, FormatType format) const; void ToString(Char* buffer, FormatType format) const; public: - /// /// Try to parse Guid from string /// diff --git a/Source/Engine/Core/Types/LayersMask.h b/Source/Engine/Core/Types/LayersMask.h index 62dd5cbf2..f4cd5f116 100644 --- a/Source/Engine/Core/Types/LayersMask.h +++ b/Source/Engine/Core/Types/LayersMask.h @@ -10,7 +10,7 @@ /// API_STRUCT() struct FLAXENGINE_API LayersMask { -DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); + DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); /// /// The layers selection mask. @@ -18,7 +18,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LayersMask); API_FIELD() uint32 Mask = MAX_uint32; public: - FORCE_INLINE LayersMask() { } diff --git a/Source/Engine/Core/Types/Nullable.h b/Source/Engine/Core/Types/Nullable.h index aeb09182b..6ad8590be 100644 --- a/Source/Engine/Core/Types/Nullable.h +++ b/Source/Engine/Core/Types/Nullable.h @@ -11,12 +11,10 @@ template struct NullableBase { protected: - bool _hasValue; T _value; public: - /// /// Initializes a new instance of the struct. /// @@ -46,7 +44,6 @@ public: } public: - /// /// Gets a value indicating whether the current NullableBase{T} object has a valid value of its underlying type. /// @@ -95,7 +92,6 @@ public: } public: - /// /// Indicates whether the current NullableBase{T} object is equal to a specified object. /// @@ -129,7 +125,6 @@ template struct Nullable : NullableBase { public: - /// /// Initializes a new instance of the struct. /// @@ -164,7 +159,6 @@ template<> struct Nullable : NullableBase { public: - /// /// Initializes a new instance of the struct. /// @@ -192,7 +186,6 @@ public: } public: - /// /// Gets a value indicating whether the current Nullable{T} object has a valid value and it's set to true. /// diff --git a/Source/Engine/Core/Types/Pair.h b/Source/Engine/Core/Types/Pair.h index 0c5c41a14..339a8ddfe 100644 --- a/Source/Engine/Core/Types/Pair.h +++ b/Source/Engine/Core/Types/Pair.h @@ -12,7 +12,6 @@ template class Pair { public: - /// /// The first element. /// @@ -24,7 +23,6 @@ public: U Second; public: - /// /// Initializes a new instance of the class. /// @@ -64,7 +62,6 @@ public: } public: - Pair& operator=(const Pair& other) { if (this == &other) diff --git a/Source/Engine/Core/Types/Span.h b/Source/Engine/Core/Types/Span.h index a10811342..cf508a901 100644 --- a/Source/Engine/Core/Types/Span.h +++ b/Source/Engine/Core/Types/Span.h @@ -11,12 +11,10 @@ template class Span { protected: - T* _data; int32 _length; public: - /// /// Initializes a new instance of the class. /// @@ -38,7 +36,6 @@ public: } public: - /// /// Returns true if data is valid. /// @@ -95,7 +92,6 @@ public: } public: - /// /// Gets or sets the element by index /// diff --git a/Source/Engine/Core/Types/String.h b/Source/Engine/Core/Types/String.h index 7d5b382b7..464c7ff2e 100644 --- a/Source/Engine/Core/Types/String.h +++ b/Source/Engine/Core/Types/String.h @@ -13,12 +13,10 @@ template class StringBase { protected: - T* _data = nullptr; int32 _length = 0; public: - /// /// Finalizes an instance of the class. /// @@ -28,7 +26,6 @@ public: } public: - /// /// Clears this instance. Frees the memory and sets the string to empty. /// @@ -40,7 +37,6 @@ public: } public: - /// /// Gets the character at the specific index. /// @@ -64,7 +60,6 @@ public: } public: - /// /// Lexicographically tests how this string compares to the other given string. /// In case sensitive mode 'A' is less than 'a'. @@ -80,7 +75,6 @@ public: } public: - /// /// Returns true if string is empty. /// @@ -154,7 +148,6 @@ public: } public: - /// /// Checks whether this string contains the specified substring. /// @@ -353,7 +346,6 @@ public: } public: - bool StartsWith(T c, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const { const int32 length = Length(); @@ -551,14 +543,12 @@ public: API_CLASS(InBuild) class FLAXENGINE_API String : public StringBase { public: - /// /// Instance of the empty string. /// static String Empty; public: - /// /// Initializes a new instance of the class. /// @@ -646,7 +636,6 @@ public: explicit String(const StringAnsiView& str); public: - /// /// Sets an array of characters to the string. /// @@ -775,7 +764,6 @@ public: } public: - /// /// Sets the text value. /// @@ -848,7 +836,6 @@ public: } public: - // @formatter:off FORCE_INLINE friend String operator+(const String& a, const String& b) { @@ -941,7 +928,6 @@ public: // @formatter:on public: - /// /// Checks if string contains only ANSI characters. /// @@ -949,7 +935,6 @@ public: bool IsANSI() const; public: - using StringBase::StartsWith; bool StartsWith(const StringView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const; @@ -1060,7 +1045,6 @@ public: String TrimTrailing() const; public: - /// /// Formats the message and gets it as a string. /// @@ -1077,7 +1061,6 @@ public: } public: - /// /// Concatenates this path with given path ensuring the '/' character is used between them. /// @@ -1167,7 +1150,6 @@ public: } public: - String ToString() const { return *this; @@ -1176,7 +1158,6 @@ public: StringAnsi ToStringAnsi() const; private: - template static String ConcatStrings(T1 left, T2 right) { @@ -1267,14 +1248,12 @@ namespace fmt API_CLASS(InBuild) class FLAXENGINE_API StringAnsi : public StringBase { public: - /// /// Instance of the empty string. /// static StringAnsi Empty; public: - /// /// Initializes a new instance of the class. /// @@ -1361,7 +1340,6 @@ public: explicit StringAnsi(const StringAnsiView& str); public: - /// /// Sets an array of characters to the string. /// @@ -1483,7 +1461,6 @@ public: } public: - /// /// Sets the text value. /// @@ -1556,7 +1533,6 @@ public: } public: - // @formatter:off FORCE_INLINE friend StringAnsi operator+(const StringAnsi& a, const StringAnsi& b) { @@ -1641,7 +1617,6 @@ public: // @formatter:on public: - using StringBase::StartsWith; bool StartsWith(const StringAnsiView& prefix, StringSearchCase searchCase = StringSearchCase::CaseSensitive) const; @@ -1727,7 +1702,6 @@ public: void Split(char c, Array& results) const; public: - /// /// Formats the message and gets it as a string. /// @@ -1744,7 +1718,6 @@ public: } public: - String ToString() const { return String(Get(), Length()); @@ -1756,7 +1729,6 @@ public: } private: - template static StringAnsi ConcatStrings(T1 left, T2 right) { diff --git a/Source/Engine/Core/Types/StringBuilder.h b/Source/Engine/Core/Types/StringBuilder.h index b3feea939..eb29985ea 100644 --- a/Source/Engine/Core/Types/StringBuilder.h +++ b/Source/Engine/Core/Types/StringBuilder.h @@ -11,14 +11,12 @@ class FLAXENGINE_API StringBuilder { private: - /// /// Array with characters of the string (it's not null-terminated) /// Array _data; public: - /// /// Init /// @@ -36,7 +34,6 @@ public: } public: - /// /// Gets capacity /// @@ -82,7 +79,6 @@ public: } public: - // Append single character to the string // @param c Character to append // @return Current String Builder instance @@ -175,7 +171,6 @@ public: } public: - StringBuilder& AppendLine() { Append(TEXT(PLATFORM_LINE_TERMINATOR)); @@ -224,7 +219,6 @@ public: } public: - // Retrieves substring created from characters starting from startIndex // @param startIndex Index of the first character to subtract // @param count Amount of characters to retrieve @@ -236,7 +230,6 @@ public: } public: - // Get pointer to the string // @returns Pointer to Array of Chars if Num, otherwise the empty string FORCE_INLINE const Char* operator*() const @@ -264,7 +257,6 @@ public: } public: - String ToString() const { return String(_data.Get(), _data.Count()); diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h index 1fcd51a32..61ac3c6ec 100644 --- a/Source/Engine/Core/Types/StringView.h +++ b/Source/Engine/Core/Types/StringView.h @@ -13,7 +13,6 @@ template class StringViewBase { protected: - const T* _data; int32 _length; @@ -30,7 +29,6 @@ protected: } public: - /// /// Gets the specific const character from this string. /// @@ -41,7 +39,7 @@ public: ASSERT(index >= 0 && index <= _length); return _data[index]; } - + FORCE_INLINE StringViewBase& operator=(const StringViewBase& other) { if (this != &other) @@ -53,8 +51,7 @@ public: } /// - /// Lexicographically tests how this string compares to the other given string. - /// In case sensitive mode 'A' is less than 'a'. + /// Lexicographically tests how this string compares to the other given string. In case sensitive mode 'A' is less than 'a'. /// /// The another string test against. /// The case sensitivity mode. @@ -63,9 +60,7 @@ public: { const bool thisIsShorter = Length() < str.Length(); const int32 minLength = thisIsShorter ? Length() : str.Length(); - const int32 prefixCompare = (searchCase == StringSearchCase::CaseSensitive) - ? StringUtils::Compare(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength) - : StringUtils::CompareIgnoreCase(this->GetNonTerminatedText(), str.GetNonTerminatedText(), minLength); + const int32 prefixCompare = searchCase == StringSearchCase::CaseSensitive ? StringUtils::Compare(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength) : StringUtils::CompareIgnoreCase(GetNonTerminatedText(), str.GetNonTerminatedText(), minLength); if (prefixCompare != 0) return prefixCompare; if (Length() == str.Length()) @@ -74,7 +69,6 @@ public: } public: - /// /// Returns true if string is empty. /// @@ -124,7 +118,6 @@ public: } public: - /// /// Searches the string for the occurrence of a character. /// @@ -205,14 +198,12 @@ public: API_CLASS(InBuild) class FLAXENGINE_API StringView : public StringViewBase { public: - /// /// Instance of the empty string. /// static StringView Empty; public: - /// /// Initializes a new instance of the class. /// @@ -257,7 +248,6 @@ public: } public: - /// /// Assigns the static string. /// @@ -325,7 +315,6 @@ public: bool operator!=(const String& other) const; public: - /// /// Gets the left most given number of characters. /// @@ -356,7 +345,6 @@ public: StringView Substring(int32 startIndex, int32 count) const; public: - String ToString() const; StringAnsi ToStringAnsi() const; }; @@ -394,14 +382,12 @@ namespace fmt API_CLASS(InBuild) class FLAXENGINE_API StringAnsiView : public StringViewBase { public: - /// /// Instance of the empty string. /// static StringAnsiView Empty; public: - /// /// Initializes a new instance of the class. /// @@ -446,7 +432,6 @@ public: } public: - /// /// Assigns the static string. /// @@ -514,7 +499,6 @@ public: bool operator!=(const StringAnsi& other) const; public: - /// /// Retrieves substring created from characters starting from startIndex to the String end. /// @@ -531,7 +515,6 @@ public: StringAnsi Substring(int32 startIndex, int32 count) const; public: - String ToString() const; StringAnsi ToStringAnsi() const; }; diff --git a/Source/Engine/Core/Types/TimeSpan.h b/Source/Engine/Core/Types/TimeSpan.h index 398c06321..827a36a31 100644 --- a/Source/Engine/Core/Types/TimeSpan.h +++ b/Source/Engine/Core/Types/TimeSpan.h @@ -33,14 +33,12 @@ namespace Constants API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API TimeSpan { public: - /// /// Time span in 100 nanoseconds resolution. /// int64 Ticks; public: - /// /// Empty constructor. /// @@ -88,7 +86,6 @@ public: } public: - // Get string String ToString() const; @@ -99,7 +96,6 @@ public: String ToString(const char option) const; public: - FORCE_INLINE TimeSpan operator+(const TimeSpan& other) const { return TimeSpan(Ticks + other.Ticks); @@ -169,7 +165,6 @@ public: } public: - /// /// Gets the days component of this time span. /// @@ -259,7 +254,6 @@ public: } public: - /// /// Creates a time span that represents the specified number of days. /// @@ -296,7 +290,6 @@ public: static TimeSpan FromSeconds(double seconds); public: - /// /// Returns the maximum time span value. /// @@ -325,7 +318,6 @@ public: } private: - void Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds); }; diff --git a/Source/Engine/Core/Types/Variant.h b/Source/Engine/Core/Types/Variant.h index 94142b536..78a8ce47b 100644 --- a/Source/Engine/Core/Types/Variant.h +++ b/Source/Engine/Core/Types/Variant.h @@ -78,7 +78,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API VariantType }; public: - /// /// The type of the variant. /// @@ -90,7 +89,6 @@ public: char* TypeName; public: - FORCE_INLINE VariantType() { Type = Null; @@ -116,7 +114,6 @@ public: } public: - VariantType& operator=(const Types& type); VariantType& operator=(VariantType&& other); VariantType& operator=(const VariantType& other); @@ -129,7 +126,6 @@ public: } public: - void SetTypeName(const StringView& typeName); void SetTypeName(const StringAnsiView& typeName); const char* GetTypeName() const; @@ -179,7 +175,6 @@ API_STRUCT(InBuild) struct FLAXENGINE_API Variant }; public: - // 0.0f (floating-point value type) static const Variant Zero; @@ -196,7 +191,6 @@ public: static const Variant True; public: - FORCE_INLINE Variant() { } @@ -252,7 +246,6 @@ public: ~Variant(); public: - Variant& operator=(Variant&& other); Variant& operator=(const Variant& other); bool operator==(const Variant& other) const; @@ -279,7 +272,6 @@ public: } public: - explicit operator bool() const; explicit operator Char() const; explicit operator int8() const; @@ -293,8 +285,8 @@ public: explicit operator float() const; explicit operator double() const; explicit operator void*() const; - explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. - explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. + explicit operator StringView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. + explicit operator StringAnsiView() const; // Returned StringView, if not empty, is guaranteed to point to a null terminated buffer. explicit operator ScriptingObject*() const; explicit operator struct _MonoObject*() const; explicit operator Asset*() const; @@ -346,7 +338,6 @@ public: const Array& AsArray() const; public: - void SetType(const VariantType& type); void SetType(VariantType&& type); void SetString(const StringView& str); @@ -366,7 +357,6 @@ public: } public: - template static typename TEnableIf::Value, Variant>::Type Enum(VariantType&& type, const T value) { @@ -393,7 +383,6 @@ public: static Variant Lerp(const Variant& a, const Variant& b, float alpha); private: - void OnObjectDeleted(ScriptingObject* obj) { AsObject = nullptr; diff --git a/Source/Engine/Core/Types/Version.h b/Source/Engine/Core/Types/Version.h index 205adc1c3..189351865 100644 --- a/Source/Engine/Core/Types/Version.h +++ b/Source/Engine/Core/Types/Version.h @@ -12,14 +12,12 @@ struct FLAXENGINE_API Version { private: - int32 _major; int32 _minor; int32 _build; int32 _revision; public: - /// /// Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers. /// @@ -74,7 +72,6 @@ public: } public: - /// /// Gets the value of the build component of the version number for the current Version object. /// @@ -130,7 +127,6 @@ public: } public: - /// /// Compares the current Version object to a specified Version object and returns an indication of their relative values. /// @@ -209,7 +205,6 @@ public: } public: - /// /// Converts the value of the current Version object to its equivalent representation. /// A specified count indicates the number of components to return. @@ -221,7 +216,6 @@ public: String ToString() const; public: - /// /// Try to parse Version from string. /// diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 3a2e1f0ec..95e640d7b 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -21,7 +21,7 @@ struct Transform; /// API_CLASS(Static) class FLAXENGINE_API DebugDraw { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(DebugDraw); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(DebugDraw); #if USE_EDITOR diff --git a/Source/Engine/Debug/DebugLog.h b/Source/Engine/Debug/DebugLog.h index d0d4e0e6c..afc05fd32 100644 --- a/Source/Engine/Debug/DebugLog.h +++ b/Source/Engine/Debug/DebugLog.h @@ -11,7 +11,6 @@ class FLAXENGINE_API DebugLog { public: - /// /// Sends the log message to the Flax console and the log file. /// @@ -53,7 +52,6 @@ public: static void LogException(MObject* exceptionObject); public: - /// /// Gets the managed stack trace. /// diff --git a/Source/Engine/Debug/Exception.h b/Source/Engine/Debug/Exception.h index 7e563f5b1..a849210c6 100644 --- a/Source/Engine/Debug/Exception.h +++ b/Source/Engine/Debug/Exception.h @@ -16,13 +16,11 @@ namespace Log class FLAXENGINE_API Exception : public Object { protected: - String _message; String _additionalInfo; LogType _level; public: - /// /// Creates default exception without additional data /// @@ -53,14 +51,12 @@ namespace Log } public: - /// /// Virtual destructor /// virtual ~Exception(); public: - /// /// Gets a message that describes the current exception. /// @@ -128,7 +124,6 @@ namespace Log // TODO: implement StackTrace caching: https://www.codeproject.com/kb/threads/stackwalker.aspx public: - // [Object] String ToString() const final override { diff --git a/Source/Engine/Foliage/Foliage.cpp b/Source/Engine/Foliage/Foliage.cpp index feed93913..76056ac44 100644 --- a/Source/Engine/Foliage/Foliage.cpp +++ b/Source/Engine/Foliage/Foliage.cpp @@ -200,7 +200,7 @@ void Foliage::DrawCluster(RenderContext& renderContext, FoliageCluster* cluster, instance.DrawState.PrevLOD = lodIndex; } } - // Check if there was a gap between frames in drawing this model instance + // Check if there was a gap between frames in drawing this model instance else if (modelFrame < frame || instance.DrawState.PrevLOD == -1) { // Reset state @@ -846,7 +846,7 @@ bool Foliage::Intersects(const Ray& ray, Real& distance, Vector3& normal, int32& void Foliage::Draw(RenderContext& renderContext) { if (renderContext.View.Pass == DrawPass::GlobalSDF) - return; // TODO: Foliage rendering to Global SDF + return; // TODO: Foliage rendering to Global SDF if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas) return; // Not supported if (Instances.IsEmpty()) diff --git a/Source/Engine/Foliage/Foliage.h b/Source/Engine/Foliage/Foliage.h index 5bea2462d..100e25338 100644 --- a/Source/Engine/Foliage/Foliage.h +++ b/Source/Engine/Foliage/Foliage.h @@ -14,14 +14,12 @@ /// API_CLASS() class FLAXENGINE_API Foliage final : public Actor { -DECLARE_SCENE_OBJECT(Foliage); + DECLARE_SCENE_OBJECT(Foliage); private: - bool _disableFoliageTypeEvents; int32 _sceneRenderingKey = -1; public: - /// /// The allocated foliage instances. It's read-only. /// @@ -46,7 +44,6 @@ public: Array FoliageTypes; public: - /// /// Gets the total amount of the instanced of foliage. /// @@ -138,7 +135,6 @@ public: API_FUNCTION() void UpdateCullDistance(); public: - /// /// Gets the global density scale for all foliage instances. The default value is 1. Use values from range 0-1. Lower values decrease amount of foliage instances in-game. Use it to tweak game performance for slower devices. /// @@ -150,7 +146,6 @@ public: API_PROPERTY() static void SetGlobalDensityScale(float value); private: - void AddToCluster(ChunkedArray& clusters, FoliageCluster* cluster, FoliageInstance& instance); #if !FOLIAGE_USE_SINGLE_QUAD_TREE && FOLIAGE_USE_DRAW_CALLS_BATCHING struct DrawKey @@ -182,7 +177,6 @@ private: #endif public: - /// /// Determines if there is an intersection between the current object or any it's child and a ray. /// @@ -194,7 +188,6 @@ public: API_FUNCTION() bool Intersects(API_PARAM(Ref) const Ray& ray, API_PARAM(Out) Real& distance, API_PARAM(Out) Vector3& normal, API_PARAM(Out) int32& instanceIndex); public: - // [Actor] void Draw(RenderContext& renderContext) override; bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; @@ -203,7 +196,6 @@ public: void OnLayerChanged() override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Foliage/FoliageCluster.h b/Source/Engine/Foliage/FoliageCluster.h index a0e3c9bae..3f39ecc30 100644 --- a/Source/Engine/Foliage/FoliageCluster.h +++ b/Source/Engine/Foliage/FoliageCluster.h @@ -13,7 +13,6 @@ class FLAXENGINE_API FoliageCluster { public: - /// /// The cluster bounds (in world space). Made of subdivided parent node in quad-tree. /// @@ -45,7 +44,6 @@ public: Array> Instances; public: - /// /// Initializes this instance. /// diff --git a/Source/Engine/Foliage/FoliageInstance.h b/Source/Engine/Foliage/FoliageInstance.h index 145309894..de823358c 100644 --- a/Source/Engine/Foliage/FoliageInstance.h +++ b/Source/Engine/Foliage/FoliageInstance.h @@ -12,7 +12,7 @@ /// API_STRUCT(NoPod) struct FLAXENGINE_API FoliageInstance { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(FoliageInstance); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(FoliageInstance); /// /// The local-space transformation of the mesh relative to the foliage actor. @@ -55,7 +55,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(FoliageInstance); LightmapEntry Lightmap; public: - bool operator==(const FoliageInstance& v) const { return Type == v.Type && Math::NearEqual(Random, v.Random) && Transform == v.Transform; diff --git a/Source/Engine/Foliage/FoliageType.h b/Source/Engine/Foliage/FoliageType.h index ac4d1d4b4..937322846 100644 --- a/Source/Engine/Foliage/FoliageType.h +++ b/Source/Engine/Foliage/FoliageType.h @@ -43,16 +43,14 @@ API_ENUM() enum class FoliageScalingModes /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API FoliageType : public ScriptingObject, public ISerializable { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(FoliageType); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(FoliageType); friend Foliage; private: - int8 _isReady : 1; int8 _canDraw : 1; // Cached and used internally by foliage actor DrawPass _drawModes; // Cached mask during rendering public: - /// /// Initializes a new instance of the class. /// @@ -67,7 +65,6 @@ public: FoliageType& operator=(const FoliageType& other); public: - /// /// The parent foliage actor. /// @@ -87,7 +84,7 @@ public: /// The shared model instance entries. /// ModelInstanceEntries Entries; - + #if !FOLIAGE_USE_SINGLE_QUAD_TREE /// /// The root cluster. Contains all the instances and it's the starting point of the quad-tree hierarchy. Null if no foliage added. It's read-only. @@ -101,7 +98,6 @@ public: #endif public: - /// /// Gets the foliage instance type materials buffer (overrides). /// @@ -113,7 +109,6 @@ public: API_PROPERTY() void SetMaterials(const Array& value); public: - /// /// The per-instance cull distance. /// @@ -215,7 +210,6 @@ public: API_FIELD() int8 PlacementRandomYaw : 1; public: - /// /// Determines whether this instance is ready (model is loaded). /// @@ -230,12 +224,10 @@ public: Float3 GetRandomScale() const; private: - void OnModelChanged(); void OnModelLoaded(); public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h index 5ae993816..6c3fe9f63 100644 --- a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h +++ b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h @@ -10,18 +10,15 @@ class DefaultGPUTasksExecutor : public GPUTasksExecutor { protected: - GPUTasksContext* _context; public: - /// /// Init /// DefaultGPUTasksExecutor(); public: - // [GPUTasksExecutor] String ToString() const override; void FrameBegin() override; diff --git a/Source/Engine/Graphics/Async/GPUTask.h b/Source/Engine/Graphics/Async/GPUTask.h index 15cb73edc..e4fa29864 100644 --- a/Source/Engine/Graphics/Async/GPUTask.h +++ b/Source/Engine/Graphics/Async/GPUTask.h @@ -17,7 +17,6 @@ class GPUTask : public Task friend GPUTasksContext; public: - /// /// Describes GPU work type /// @@ -29,7 +28,6 @@ public: DECLARE_ENUM_4(Result, Ok, Failed, MissingResources, MissingData); private: - /// /// Task type /// @@ -46,7 +44,6 @@ private: GPUTasksContext* _context; protected: - /// /// Initializes a new instance of the class. /// @@ -59,7 +56,6 @@ protected: } public: - /// /// Gets a task type. /// @@ -79,7 +75,6 @@ public: } public: - /// /// Checks if operation is syncing /// @@ -90,7 +85,6 @@ public: } public: - /// /// Executes this task. /// @@ -152,7 +146,6 @@ public: } protected: - virtual Result run(GPUTasksContext* context) = 0; virtual void OnSync() @@ -160,7 +153,6 @@ protected: } public: - // [Task] String ToString() const override { @@ -168,7 +160,6 @@ public: } protected: - // [Task] void Enqueue() override; diff --git a/Source/Engine/Graphics/Async/GPUTasksContext.h b/Source/Engine/Graphics/Async/GPUTasksContext.h index 85c2b8ebf..5193f6711 100644 --- a/Source/Engine/Graphics/Async/GPUTasksContext.h +++ b/Source/Engine/Graphics/Async/GPUTasksContext.h @@ -15,14 +15,12 @@ class GPUTask; class GPUTasksContext { protected: - CriticalSection _locker; GPUSyncPoint _currentSyncPoint; Array _tasksDone; int32 _totalTasksDoneCount; public: - /// /// Initializes a new instance of the class. /// @@ -35,14 +33,12 @@ public: ~GPUTasksContext(); public: - /// /// The GPU commands context used for tasks execution (can be only copy/upload without graphics capabilities on some platforms). /// GPUContext* GPU; public: - /// /// Gets graphics device handle /// @@ -79,7 +75,6 @@ public: void OnCancelSync(GPUTask* task); public: - void OnFrameBegin(); void OnFrameEnd(); diff --git a/Source/Engine/Graphics/Async/GPUTasksExecutor.h b/Source/Engine/Graphics/Async/GPUTasksExecutor.h index ace5845ff..63c2e3af1 100644 --- a/Source/Engine/Graphics/Async/GPUTasksExecutor.h +++ b/Source/Engine/Graphics/Async/GPUTasksExecutor.h @@ -14,18 +14,15 @@ class GPUTask; class GPUTasksExecutor : public Object { protected: - Array _contextList; public: - /// /// Destructor /// virtual ~GPUTasksExecutor(); public: - /// /// Sync point event called on begin of the frame /// @@ -37,7 +34,6 @@ public: virtual void FrameEnd() = 0; public: - /// /// Gets the context list. /// @@ -48,6 +44,5 @@ public: } protected: - GPUTasksContext* createContext(); }; diff --git a/Source/Engine/Graphics/Async/GPUTasksManager.h b/Source/Engine/Graphics/Async/GPUTasksManager.h index 7da80b7ad..25639a6fb 100644 --- a/Source/Engine/Graphics/Async/GPUTasksManager.h +++ b/Source/Engine/Graphics/Async/GPUTasksManager.h @@ -22,7 +22,6 @@ class GPUTasksManager : public Object, public NonCopyable friend GPUTask; private: - GPUDevice* _device; GPUTasksExecutor* _executor; ConcurrentTaskQueue _tasks; @@ -30,12 +29,10 @@ private: int32 _bufferIndex; private: - GPUTasksManager(GPUDevice* device); ~GPUTasksManager(); public: - /// /// Gets the parent Graphics Device. /// @@ -70,14 +67,12 @@ public: } public: - /// /// Clears asynchronous resources loading queue and cancels all tasks. /// void Dispose(); public: - /// /// On begin rendering frame. /// @@ -89,7 +84,6 @@ public: void FrameEnd(); public: - /// /// Requests work to do. Should be used only by GPUTasksExecutor. /// @@ -99,7 +93,6 @@ public: int32 RequestWork(GPUTask** buffer, int32 maxCount); public: - // [Object] String ToString() const override { diff --git a/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h b/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h index 8002cf14d..75f019718 100644 --- a/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h +++ b/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h @@ -12,12 +12,10 @@ class GPUCopyResourceTask : public GPUTask { private: - GPUResourceReference _srcResource; GPUResourceReference _dstResource; public: - /// /// Initializes a new instance of the class. /// @@ -33,14 +31,12 @@ public: } private: - void OnResourceUnload(GPUResourceReference* ref) { Cancel(); } public: - // [GPUTask] bool HasReference(Object* resource) const override { @@ -48,7 +44,6 @@ public: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { diff --git a/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h b/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h index 30b2804af..d5998cc9a 100644 --- a/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h +++ b/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h @@ -12,13 +12,11 @@ class GPUCopySubresourceTask : public GPUTask { private: - GPUResourceReference _srcResource; GPUResourceReference _dstResource; uint32 _srcSubresource, _dstSubresource; public: - /// /// Init /// @@ -38,14 +36,12 @@ public: } private: - void OnResourceUnload(GPUResourceReference* ref) { Cancel(); } public: - // [GPUTask] bool HasReference(Object* resource) const override { @@ -53,7 +49,6 @@ public: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { diff --git a/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h b/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h index 190c3c335..5d9bcb997 100644 --- a/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h +++ b/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h @@ -14,13 +14,11 @@ class GPUUploadBufferTask : public GPUTask { protected: - BufferReference _buffer; int32 _offset; BytesContainer _data; public: - /// /// Initializes a new instance of the class. /// @@ -42,14 +40,12 @@ public: } private: - void OnResourceUnload(BufferReference* ref) { Cancel(); } public: - // [GPUTask] bool HasReference(Object* resource) const override { @@ -57,7 +53,6 @@ public: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { diff --git a/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h b/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h index 2573505ba..11461b0f3 100644 --- a/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h +++ b/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h @@ -14,13 +14,11 @@ class GPUUploadTextureMipTask : public GPUTask { protected: - GPUTextureReference _texture; int32 _mipIndex, _rowPitch, _slicePitch; BytesContainer _data; public: - /// /// Initializes a new instance of the class. /// @@ -46,14 +44,12 @@ public: } private: - void OnResourceUnload(GPUTextureReference* ref) { Cancel(); } public: - // [GPUTask] bool HasReference(Object* resource) const override { @@ -61,7 +57,6 @@ public: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { diff --git a/Source/Engine/Graphics/DynamicBuffer.h b/Source/Engine/Graphics/DynamicBuffer.h index 9f251ff14..4efade7e0 100644 --- a/Source/Engine/Graphics/DynamicBuffer.h +++ b/Source/Engine/Graphics/DynamicBuffer.h @@ -11,7 +11,6 @@ class FLAXENGINE_API DynamicBuffer { protected: - GPUBuffer* _buffer; String _name; uint32 _stride; @@ -33,7 +32,6 @@ public: virtual ~DynamicBuffer(); public: - /// /// The data container (raw bytes storage). /// @@ -85,7 +83,7 @@ public: Data.AddUninitialized(size); return Data.Get() + start; } - + /// /// Allocates bytes in the buffer by resizing the buffer for new memory and returns the pointer to the start of the allocated space. /// @@ -113,7 +111,6 @@ public: void Dispose(); protected: - virtual void InitDesc(GPUBufferDescription& desc, int32 numElements) = 0; }; @@ -123,7 +120,6 @@ protected: class FLAXENGINE_API DynamicVertexBuffer : public DynamicBuffer { public: - /// /// Init /// @@ -136,7 +132,6 @@ public: } protected: - // [DynamicBuffer] void InitDesc(GPUBufferDescription& desc, int32 numElements) override { @@ -150,7 +145,6 @@ protected: class FLAXENGINE_API DynamicIndexBuffer : public DynamicBuffer { public: - /// /// Init /// @@ -163,7 +157,6 @@ public: } protected: - // [DynamicBuffer] void InitDesc(GPUBufferDescription& desc, int32 numElements) override { @@ -180,7 +173,6 @@ private: bool _isUnorderedAccess; public: - /// /// Init /// @@ -195,7 +187,6 @@ public: } protected: - // [DynamicBuffer] void InitDesc(GPUBufferDescription& desc, int32 numElements) override; }; @@ -210,7 +201,6 @@ private: bool _isUnorderedAccess; public: - /// /// Init /// @@ -221,7 +211,6 @@ public: DynamicTypedBuffer(uint32 initialCapacity, PixelFormat format, bool isUnorderedAccess = false, const String& name = String::Empty); protected: - // [DynamicBuffer] void InitDesc(GPUBufferDescription& desc, int32 numElements) override; }; diff --git a/Source/Engine/Graphics/Enums.h b/Source/Engine/Graphics/Enums.h index edfc19867..56b1ca7bd 100644 --- a/Source/Engine/Graphics/Enums.h +++ b/Source/Engine/Graphics/Enums.h @@ -362,7 +362,7 @@ API_ENUM() enum class CullMode : byte /// API_STRUCT() struct BlendingMode { -DECLARE_SCRIPTING_TYPE_MINIMAL(BlendingMode); + DECLARE_SCRIPTING_TYPE_MINIMAL(BlendingMode); /// /// Blending mode. @@ -454,7 +454,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(BlendingMode); }; public: - /// /// Render target blending mode descriptor. /// @@ -501,11 +500,9 @@ public: API_FIELD() ColorWrite RenderTargetWriteMask; public: - bool operator==(const BlendingMode& other) const; public: - /// /// Gets the opaque rendering (default). No blending is being performed. /// diff --git a/Source/Engine/Graphics/GPUAdapter.h b/Source/Engine/Graphics/GPUAdapter.h index 256ebde5a..e385c5836 100644 --- a/Source/Engine/Graphics/GPUAdapter.h +++ b/Source/Engine/Graphics/GPUAdapter.h @@ -16,9 +16,8 @@ /// API_CLASS(NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUAdapter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice); public: - GPUAdapter() : ScriptingObject(SpawnParams(Guid::New(), TypeInitializer)) { @@ -36,7 +35,6 @@ public: } public: - /// /// Checks if adapter is valid and returns true if it is. /// @@ -54,7 +52,6 @@ public: API_PROPERTY() virtual String GetDescription() const = 0; public: - // Returns true if adapter's vendor is AMD. API_PROPERTY() FORCE_INLINE bool IsAMD() const { diff --git a/Source/Engine/Graphics/GPUBuffer.cpp b/Source/Engine/Graphics/GPUBuffer.cpp index bf52943db..3aae13789 100644 --- a/Source/Engine/Graphics/GPUBuffer.cpp +++ b/Source/Engine/Graphics/GPUBuffer.cpp @@ -271,13 +271,11 @@ bool GPUBuffer::DownloadData(BytesContainer& result) class BufferDownloadDataTask : public ThreadPoolTask { private: - BufferReference _buffer; GPUBuffer* _staging; BytesContainer& _data; public: - BufferDownloadDataTask(GPUBuffer* buffer, GPUBuffer* staging, BytesContainer& data) : _buffer(buffer) , _staging(staging) @@ -291,7 +289,6 @@ public: } public: - // [ThreadPoolTask] bool HasReference(Object* resource) const override { @@ -299,7 +296,6 @@ public: } protected: - // [ThreadPoolTask] bool Run() override { diff --git a/Source/Engine/Graphics/GPUBuffer.h b/Source/Engine/Graphics/GPUBuffer.h index 349b3cc3b..785be2cc3 100644 --- a/Source/Engine/Graphics/GPUBuffer.h +++ b/Source/Engine/Graphics/GPUBuffer.h @@ -15,9 +15,8 @@ typedef DataContainer BytesContainer; /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUBufferView : public GPUResourceView { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUBufferView); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUBufferView); protected: - GPUBufferView(); }; @@ -27,19 +26,17 @@ protected: /// API_CLASS(Sealed) class FLAXENGINE_API GPUBuffer : public GPUResource { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUBuffer); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUBuffer); static GPUBuffer* Spawn(const SpawnParams& params); static GPUBuffer* New(); protected: - GPUBufferDescription _desc; bool _isLocked = false; GPUBuffer(); public: - /// /// Gets a value indicating whether this buffer has been allocated. /// @@ -135,7 +132,6 @@ public: API_FUNCTION() virtual GPUBufferView* View() const = 0; public: - /// /// Creates new buffer. /// @@ -163,7 +159,6 @@ public: API_FUNCTION() bool Resize(uint32 newSize); public: - /// /// Stops current thread execution to gather buffer data from the GPU. Cannot be called from main thread if the buffer is not a dynamic nor staging readback. /// @@ -205,18 +200,15 @@ public: API_FUNCTION() virtual void Unmap() = 0; protected: - virtual bool OnInit() = 0; public: - // [GPUResource] String ToString() const override; ResourceType GetResourceType() const final override; ObjectType GetObjectType() const final override; protected: - // [GPUResource] void OnReleaseGPU() override; }; diff --git a/Source/Engine/Graphics/GPUBufferDescription.h b/Source/Engine/Graphics/GPUBufferDescription.h index fd99f62e6..c19ee614b 100644 --- a/Source/Engine/Graphics/GPUBufferDescription.h +++ b/Source/Engine/Graphics/GPUBufferDescription.h @@ -78,7 +78,7 @@ DECLARE_ENUM_OPERATORS(GPUBufferFlags); /// API_STRUCT() struct FLAXENGINE_API GPUBufferDescription { -DECLARE_SCRIPTING_TYPE_MINIMAL(GPUBufferDescription); + DECLARE_SCRIPTING_TYPE_MINIMAL(GPUBufferDescription); /// /// The buffer total size. @@ -111,7 +111,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(GPUBufferDescription); API_FIELD() GPUResourceUsage Usage; public: - /// /// Gets the number elements in the buffer. /// @@ -137,7 +136,6 @@ public: } public: - /// /// Creates the buffer description. /// @@ -334,7 +332,6 @@ public: } public: - void Clear(); GPUBufferDescription ToStagingUpload() const; GPUBufferDescription ToStagingReadback() const; @@ -342,7 +339,6 @@ public: String ToString() const; public: - FORCE_INLINE bool operator==(const GPUBufferDescription& other) const { return Equals(other); diff --git a/Source/Engine/Graphics/GPUContext.h b/Source/Engine/Graphics/GPUContext.h index 8639d3924..7c8b90a71 100644 --- a/Source/Engine/Graphics/GPUContext.h +++ b/Source/Engine/Graphics/GPUContext.h @@ -29,7 +29,7 @@ class GPUBufferView; /// API_STRUCT() struct GPUDispatchIndirectArgs { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDispatchIndirectArgs); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDispatchIndirectArgs); /// /// The X dimension of dispatch size. @@ -52,7 +52,7 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDispatchIndirectArgs); /// API_STRUCT() struct GPUDrawIndirectArgs { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndirectArgs); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndirectArgs); /// /// The number of vertices to draw for each instance. @@ -80,7 +80,7 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndirectArgs); /// API_STRUCT() struct GPUDrawIndexedIndirectArgs { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndexedIndirectArgs); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndexedIndirectArgs); /// /// The number of indices to draw for each instance. @@ -113,18 +113,15 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndexedIndirectArgs); /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUContext : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUContext); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUContext); private: - GPUDevice* _device; protected: - double _lastRenderTime = -1; GPUContext(GPUDevice* device); public: - /// /// Gets the graphics device. /// @@ -134,7 +131,6 @@ public: } public: - /// /// Begins new frame and enters commands collecting mode. /// @@ -146,7 +142,6 @@ public: virtual void FrameEnd(); public: - #if GPU_ALLOW_PROFILE_EVENTS /// @@ -167,7 +162,6 @@ public: #endif public: - /// /// Gets the native pointer to the underlying graphics device context. It's a low-level platform-specific handle. /// @@ -180,7 +174,6 @@ public: virtual bool IsDepthBufferBinded() = 0; public: - /// /// Clears texture surface with a color. Supports volumetric textures and texture arrays (including cube textures). /// @@ -224,7 +217,6 @@ public: virtual void ClearUA(GPUTexture* texture, const Float4& value) = 0; public: - /// /// Updates the buffer data. /// @@ -298,7 +290,6 @@ public: API_FUNCTION() virtual void CopySubresource(GPUResource* dstResource, uint32 dstSubresource, GPUResource* srcResource, uint32 srcSubresource) = 0; public: - /// /// Unbinds all the render targets and flushes the change with the driver (used to prevent driver detection of resource hazards, eg. when down-scaling the texture). /// @@ -325,7 +316,6 @@ public: API_FUNCTION() virtual void SetRenderTarget(GPUTextureView* depthBuffer, const Span& rts) = 0; public: - /// /// Unbinds all shader resource slots and flushes the change with the driver (used to prevent driver detection of resource hazards, eg. when down-scaling the texture). /// @@ -417,7 +407,6 @@ public: API_FUNCTION() virtual void BindSampler(int32 slot, GPUSampler* sampler) = 0; public: - /// /// Updates the constant buffer data. /// @@ -426,7 +415,6 @@ public: API_FUNCTION() virtual void UpdateCB(GPUConstantBuffer* cb, const void* data) = 0; public: - /// /// Executes a command list from a thread group. /// @@ -534,7 +522,6 @@ public: API_FUNCTION() virtual void DrawIndexedInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs) = 0; public: - /// /// Sets the rendering viewport and scissor rectangle. /// @@ -583,7 +570,6 @@ public: API_FUNCTION() virtual void SetScissor(API_PARAM(Ref) const Rectangle& scissorRect) = 0; public: - /// /// Sets the graphics pipeline state. /// diff --git a/Source/Engine/Graphics/GPUDevice.h b/Source/Engine/Graphics/GPUDevice.h index 9752c9755..f4b8e88ae 100644 --- a/Source/Engine/Graphics/GPUDevice.h +++ b/Source/Engine/Graphics/GPUDevice.h @@ -31,9 +31,8 @@ class MaterialBase; /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUDevice : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice); public: - /// /// Graphics Device states that describe its lifetime. /// @@ -44,7 +43,7 @@ public: /// API_STRUCT() struct VideoOutputMode { - DECLARE_SCRIPTING_TYPE_NO_SPAWN(VideoOutputMode); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(VideoOutputMode); /// /// The resolution width (in pixel). @@ -68,7 +67,6 @@ public: API_FIELD(ReadOnly) static GPUDevice* Instance; protected: - // State DeviceState _state; bool _isRendering; @@ -83,7 +81,6 @@ protected: PrivateData* _res; protected: - /// /// Initializes a new instance of the class. /// @@ -92,14 +89,12 @@ protected: GPUDevice(RendererType type, ShaderProfile profile); public: - /// /// Finalizes an instance of the class. /// virtual ~GPUDevice(); public: - /// /// The graphics device locking mutex. /// @@ -116,7 +111,6 @@ public: GPUTasksManager TasksManager; public: - /// /// The total amount of graphics memory in bytes. /// @@ -158,7 +152,6 @@ public: } public: - /// /// Gets current device state. /// @@ -268,7 +261,6 @@ public: GPUBuffer* GetFullscreenTriangleVB() const; public: - /// /// Init device resources /// @@ -303,7 +295,6 @@ public: virtual void WaitForGPU() = 0; protected: - virtual void preDispose(); /// @@ -327,7 +318,6 @@ protected: virtual void RenderEnd(); public: - /// /// Creates the texture. /// diff --git a/Source/Engine/Graphics/GPULimits.h b/Source/Engine/Graphics/GPULimits.h index a45415077..c3c278422 100644 --- a/Source/Engine/Graphics/GPULimits.h +++ b/Source/Engine/Graphics/GPULimits.h @@ -184,7 +184,7 @@ DECLARE_ENUM_OPERATORS(FormatSupport); /// API_STRUCT() struct FormatFeatures { -DECLARE_SCRIPTING_TYPE_MINIMAL(FormatFeatures); + DECLARE_SCRIPTING_TYPE_MINIMAL(FormatFeatures); /// /// Gets the maximum MSAA sample count for a particular . @@ -218,7 +218,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(FormatFeatures); /// API_STRUCT() struct GPULimits { -DECLARE_SCRIPTING_TYPE_MINIMAL(GPULimits); + DECLARE_SCRIPTING_TYPE_MINIMAL(GPULimits); /// /// True if device supports Compute shaders. diff --git a/Source/Engine/Graphics/GPUPipelineState.h b/Source/Engine/Graphics/GPUPipelineState.h index c4d337161..497548e00 100644 --- a/Source/Engine/Graphics/GPUPipelineState.h +++ b/Source/Engine/Graphics/GPUPipelineState.h @@ -12,18 +12,17 @@ /// API_CLASS(Sealed) class FLAXENGINE_API GPUPipelineState : public GPUResource { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUPipelineState); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUPipelineState); static GPUPipelineState* Spawn(const SpawnParams& params); static GPUPipelineState* New(); public: - /// /// Pipeline state description /// API_STRUCT() struct Description { - DECLARE_SCRIPTING_TYPE_NO_SPAWN(Description); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Description); /// /// Enable/disable depth write @@ -91,7 +90,6 @@ public: API_FIELD() BlendingMode BlendMode; public: - /// /// Default description /// @@ -109,11 +107,9 @@ public: }; protected: - ShaderBindings _meta; public: - #if BUILD_DEBUG /// /// The description of the pipeline state cached on creation in debug builds. Can be used to help with rendering crashes or issues and validation. @@ -125,7 +121,6 @@ public: #endif public: - /// /// Gets constant buffers usage mask (each set bit marks usage of the constant buffer at the bit index slot). Combined from all the used shader stages. /// @@ -151,7 +146,6 @@ public: } public: - /// /// Returns true if pipeline state is valid and ready to use /// diff --git a/Source/Engine/Graphics/GPUPipelineStatePermutations.h b/Source/Engine/Graphics/GPUPipelineStatePermutations.h index a0bee7534..ecccd8baf 100644 --- a/Source/Engine/Graphics/GPUPipelineStatePermutations.h +++ b/Source/Engine/Graphics/GPUPipelineStatePermutations.h @@ -10,11 +10,9 @@ template class GPUPipelineStatePermutations { public: - GPUPipelineState* States[Size]; public: - GPUPipelineStatePermutations() { Platform::MemoryClear(States, sizeof(States)); @@ -26,7 +24,6 @@ public: } public: - bool IsValid() const { for (int i = 0; i < Size; i++) @@ -51,7 +48,6 @@ public: } public: - void CreatePipelineStates() { for (int i = 0; i < Size; i++) @@ -87,11 +83,9 @@ template class GPUPipelineStatePermutationsPs : public GPUPipelineStatePermutations { public: - typedef GPUPipelineStatePermutations Base; public: - GPUPipelineStatePermutationsPs() { } @@ -101,7 +95,6 @@ public: } public: - bool Create(GPUPipelineState::Description& desc, GPUShader* shader, const StringAnsiView& psName) { for (int i = 0; i < Size; i++) @@ -121,11 +114,9 @@ template class ComputeShaderPermutation { public: - GPUShaderProgramCS* Shaders[Size]; public: - ComputeShaderPermutation() { Platform::MemoryClear(Shaders, sizeof(Shaders)); @@ -136,14 +127,12 @@ public: } public: - FORCE_INLINE GPUShaderProgramCS* Get(const int index) const { return Shaders[index]; } public: - void Clear() { Platform::MemoryClear(Shaders, sizeof(Shaders)); diff --git a/Source/Engine/Graphics/GPUResource.h b/Source/Engine/Graphics/GPUResource.h index 1d57a0766..19388999d 100644 --- a/Source/Engine/Graphics/GPUResource.h +++ b/Source/Engine/Graphics/GPUResource.h @@ -17,9 +17,8 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API GPUResource : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResource); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResource); public: - /// /// GPU Resources types. /// @@ -31,7 +30,6 @@ public: DECLARE_ENUM_3(ObjectType, Texture, Buffer, Other); protected: - uint64 _memoryUsage = 0; public: @@ -54,7 +52,6 @@ public: virtual ~GPUResource(); public: - // Points to the cache used by the resource for the resource visibility/usage detection. Written during rendering when resource is used. double LastRenderTime = -1; @@ -64,7 +61,6 @@ public: Action Releasing; public: - /// /// Gets the resource type. /// @@ -100,14 +96,12 @@ public: virtual void OnDeviceDispose(); protected: - /// /// Releases GPU resource data (implementation). /// virtual void OnReleaseGPU(); public: - // [ScriptingObject] String ToString() const override; void OnDeleteObject() override; @@ -123,17 +117,14 @@ template class GPUResourceBase : public BaseType { protected: - DeviceType* _device; private: - #if GPU_ENABLE_RESOURCE_NAMING String _name; #endif public: - /// /// Initializes a new instance of the class. /// @@ -158,7 +149,6 @@ public: } public: - /// /// Gets the graphics device. /// @@ -168,7 +158,6 @@ public: } public: - // [GPUResource] #if GPU_ENABLE_RESOURCE_NAMING String GetName() const override @@ -188,7 +177,7 @@ public: /// API_CLASS(Abstract, NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUResourceView : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResourceView); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResourceView); protected: static double DummyLastRenderTime; @@ -199,7 +188,6 @@ protected: } public: - // Points to the cache used by the resource for the resource visibility/usage detection. Written during rendering when resource view is used. double* LastRenderTime; diff --git a/Source/Engine/Graphics/GPUResourceProperty.h b/Source/Engine/Graphics/GPUResourceProperty.h index b0506ab7e..c0376819e 100644 --- a/Source/Engine/Graphics/GPUResourceProperty.h +++ b/Source/Engine/Graphics/GPUResourceProperty.h @@ -12,23 +12,19 @@ template class GPUResourceProperty { private: - T* _resource; private: - // Disable copy actions GPUResourceProperty(const GPUResourceProperty& other) = delete; public: - /// /// Action fired when resource gets unloaded (reference gets cleared bu async tasks should stop execution). /// Delegate OnUnload; public: - /// /// Initializes a new instance of the class. /// @@ -62,7 +58,6 @@ public: } public: - FORCE_INLINE bool operator==(T* other) const { return Get() == other; @@ -147,7 +142,6 @@ public: } public: - /// /// Set resource /// @@ -183,7 +177,6 @@ public: } private: - void onResourceUnload() { if (_resource) diff --git a/Source/Engine/Graphics/GPUResourceState.h b/Source/Engine/Graphics/GPUResourceState.h index dd9951378..f4c07897d 100644 --- a/Source/Engine/Graphics/GPUResourceState.h +++ b/Source/Engine/Graphics/GPUResourceState.h @@ -12,7 +12,6 @@ template class GPUResourceState { private: - /// /// The whole resource state (used only if _allSubresourcesSame is 1). /// @@ -30,7 +29,6 @@ private: Array _subresourceState; public: - /// /// Initializes a new instance of the class. /// @@ -41,7 +39,6 @@ public: } public: - void Initialize(uint32 subresourceCount, StateType initialState, bool usePerSubresourceTracking) { ASSERT(_subresourceState.IsEmpty() && subresourceCount > 0); diff --git a/Source/Engine/Graphics/GPUResourcesCollection.h b/Source/Engine/Graphics/GPUResourcesCollection.h index c37a645d7..e285cbea3 100644 --- a/Source/Engine/Graphics/GPUResourcesCollection.h +++ b/Source/Engine/Graphics/GPUResourcesCollection.h @@ -15,12 +15,10 @@ class StringBuilder; class GPUResourcesCollection { private: - CriticalSection _locker; Array _collection; public: - /// /// Initializes a new instance of the class. /// @@ -37,7 +35,6 @@ public: } public: - /// /// Gets the total memory usage (in bytes). /// @@ -60,7 +57,6 @@ public: void DumpToLog(StringBuilder& output) const; public: - /// /// Adds the specified resource to the collection. /// diff --git a/Source/Engine/Graphics/GPUSwapChain.cpp b/Source/Engine/Graphics/GPUSwapChain.cpp index 1b0d29dfc..1409590e3 100644 --- a/Source/Engine/Graphics/GPUSwapChain.cpp +++ b/Source/Engine/Graphics/GPUSwapChain.cpp @@ -10,7 +10,6 @@ class GPUSwapChainDownloadTask : public Task friend GPUSwapChain; public: - GPUSwapChain* SwapChain; GPUTexture* Texture; diff --git a/Source/Engine/Graphics/GPUSwapChain.h b/Source/Engine/Graphics/GPUSwapChain.h index 803603150..59dc760eb 100644 --- a/Source/Engine/Graphics/GPUSwapChain.h +++ b/Source/Engine/Graphics/GPUSwapChain.h @@ -17,7 +17,6 @@ class Task; class FLAXENGINE_API GPUSwapChain : public GPUResource { protected: - int32 _width = 0; int32 _height = 0; uint64 _presentCount = 0; @@ -30,7 +29,6 @@ protected: } public: - /// /// Gets the linked window. /// @@ -123,7 +121,6 @@ public: } public: - /// /// Creates GPU async task that will gather render target data from the GPU. /// @@ -132,7 +129,6 @@ public: virtual Task* DownloadDataAsync(TextureData& result); public: - /// /// Begin task rendering. /// @@ -162,7 +158,6 @@ public: virtual bool Resize(int32 width, int32 height) = 0; public: - // [GPUResource] ResourceType GetResourceType() const final override { diff --git a/Source/Engine/Graphics/GPUTimerQuery.h b/Source/Engine/Graphics/GPUTimerQuery.h index 04466d09c..e4763ac4f 100644 --- a/Source/Engine/Graphics/GPUTimerQuery.h +++ b/Source/Engine/Graphics/GPUTimerQuery.h @@ -12,7 +12,6 @@ class FLAXENGINE_API GPUTimerQuery : public GPUResource { public: - /// /// Finalizes an instance of the class. /// @@ -21,7 +20,6 @@ public: } public: - /// /// Starts the counter. /// @@ -45,7 +43,6 @@ public: virtual float GetResult() = 0; public: - // [GPUResource] String ToString() const override { diff --git a/Source/Engine/Graphics/Graphics.cpp b/Source/Engine/Graphics/Graphics.cpp index 316ed8c36..0f0a60c2f 100644 --- a/Source/Engine/Graphics/Graphics.cpp +++ b/Source/Engine/Graphics/Graphics.cpp @@ -41,7 +41,6 @@ extern GPUDevice* CreateGPUDevicePS5(); class GraphicsService : public EngineService { public: - GraphicsService() : EngineService(TEXT("Graphics"), -40) { diff --git a/Source/Engine/Graphics/Graphics.h b/Source/Engine/Graphics/Graphics.h index 0575213fa..a1aed898c 100644 --- a/Source/Engine/Graphics/Graphics.h +++ b/Source/Engine/Graphics/Graphics.h @@ -11,9 +11,8 @@ /// API_CLASS(Static) class FLAXENGINE_API Graphics { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Graphics); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Graphics); public: - /// /// Enables rendering synchronization with the refresh rate of the display device to avoid "tearing" artifacts. /// @@ -75,7 +74,6 @@ public: API_FIELD() static PostProcessSettings PostProcessSettings; public: - /// /// Disposes the device. /// diff --git a/Source/Engine/Graphics/Materials/DecalMaterialShader.h b/Source/Engine/Graphics/Materials/DecalMaterialShader.h index d5d51998d..373baa089 100644 --- a/Source/Engine/Graphics/Materials/DecalMaterialShader.h +++ b/Source/Engine/Graphics/Materials/DecalMaterialShader.h @@ -10,7 +10,6 @@ class DecalMaterialShader : public MaterialShader { private: - struct Cache { GPUPipelineState* Inside = nullptr; @@ -24,11 +23,9 @@ private: }; private: - Cache _cache; public: - /// /// Init /// @@ -39,14 +36,12 @@ public: } public: - // [MaterialShader] DrawPass GetDrawModes() const override; void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/DeferredMaterialShader.h b/Source/Engine/Graphics/Materials/DeferredMaterialShader.h index f6853c8d8..3e379ea01 100644 --- a/Source/Engine/Graphics/Materials/DeferredMaterialShader.h +++ b/Source/Engine/Graphics/Materials/DeferredMaterialShader.h @@ -10,7 +10,6 @@ class DeferredMaterialShader : public MaterialShader { private: - struct Cache { PipelineStateCache Default; @@ -62,19 +61,16 @@ private: }; private: - Cache _cache; Cache _cacheInstanced; public: - DeferredMaterialShader(const StringView& name) : MaterialShader(name) { } public: - // [MaterialShader] DrawPass GetDrawModes() const override; bool CanUseLightmap() const override; @@ -83,7 +79,6 @@ public: void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/DeformableMaterialShader.h b/Source/Engine/Graphics/Materials/DeformableMaterialShader.h index 5a845d4dc..26031f2ea 100644 --- a/Source/Engine/Graphics/Materials/DeformableMaterialShader.h +++ b/Source/Engine/Graphics/Materials/DeformableMaterialShader.h @@ -10,7 +10,6 @@ class DeformableMaterialShader : public MaterialShader { private: - struct Cache { PipelineStateCache Default; @@ -48,26 +47,22 @@ private: }; private: - Cache _cache; DrawPass _drawModes = DrawPass::None; public: - DeformableMaterialShader(const StringView& name) : MaterialShader(name) { } public: - // [MaterialShader] DrawPass GetDrawModes() const override; void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/ForwardMaterialShader.h b/Source/Engine/Graphics/Materials/ForwardMaterialShader.h index 6e823baf3..25479b872 100644 --- a/Source/Engine/Graphics/Materials/ForwardMaterialShader.h +++ b/Source/Engine/Graphics/Materials/ForwardMaterialShader.h @@ -10,7 +10,6 @@ class ForwardMaterialShader : public MaterialShader { private: - struct Cache { PipelineStateCache Default; @@ -55,13 +54,11 @@ private: }; private: - Cache _cache; Cache _cacheInstanced; DrawPass _drawModes = DrawPass::None; public: - /// /// Init /// @@ -72,7 +69,6 @@ public: } public: - // [MaterialShader] DrawPass GetDrawModes() const override; bool CanUseInstancing(InstancingHandler& handler) const override; @@ -80,7 +76,6 @@ public: void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp index 4e2609928..cc2d61775 100644 --- a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp +++ b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp @@ -20,6 +20,7 @@ PACK_STRUCT(struct GUIMaterialShaderData { float TimeParam; Float4 ViewInfo; Float4 ScreenSize; + Float4 ViewSize; }); void GUIMaterialShader::Bind(BindParameters& params) @@ -32,6 +33,7 @@ void GUIMaterialShader::Bind(BindParameters& params) cb = Span(cb.Get() + sizeof(GUIMaterialShaderData), cb.Length() - sizeof(GUIMaterialShaderData)); int32 srv = 0; const auto ps = context->IsDepthBufferBinded() ? _cache.Depth : _cache.NoDepth; + auto customData = (Render2D::CustomData*)params.CustomData; // Setup parameters MaterialParameter::BindMeta bindMeta; @@ -45,8 +47,7 @@ void GUIMaterialShader::Bind(BindParameters& params) // Setup material constants { - const auto viewProjectionMatrix = (Matrix*)params.CustomData; - Matrix::Transpose(*viewProjectionMatrix, materialData->ViewProjectionMatrix); + Matrix::Transpose(customData->ViewProjection, materialData->ViewProjectionMatrix); Matrix::Transpose(Matrix::Identity, materialData->WorldMatrix); Matrix::Transpose(Matrix::Identity, materialData->ViewMatrix); materialData->ViewPos = Float3::Zero; @@ -56,6 +57,7 @@ void GUIMaterialShader::Bind(BindParameters& params) materialData->ViewInfo = Float4::Zero; auto& viewport = Render2D::GetViewport(); materialData->ScreenSize = Float4(viewport.Width, viewport.Height, 1.0f / viewport.Width, 1.0f / viewport.Height); + materialData->ViewSize = Float4(customData->ViewSize.X, customData->ViewSize.Y, 1.0f / customData->ViewSize.X, 1.0f / customData->ViewSize.Y); } // Bind constants diff --git a/Source/Engine/Graphics/Materials/GUIMaterialShader.h b/Source/Engine/Graphics/Materials/GUIMaterialShader.h index 38126fa30..29ebe1eaf 100644 --- a/Source/Engine/Graphics/Materials/GUIMaterialShader.h +++ b/Source/Engine/Graphics/Materials/GUIMaterialShader.h @@ -10,7 +10,6 @@ class GUIMaterialShader : public MaterialShader { private: - struct Cache { GPUPipelineState* Depth = nullptr; @@ -24,11 +23,9 @@ private: }; private: - Cache _cache; public: - /// /// Init /// @@ -39,13 +36,11 @@ public: } public: - // [MaterialShader] void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/IMaterial.h b/Source/Engine/Graphics/Materials/IMaterial.h index c59aebb58..bd3337876 100644 --- a/Source/Engine/Graphics/Materials/IMaterial.h +++ b/Source/Engine/Graphics/Materials/IMaterial.h @@ -20,7 +20,6 @@ struct DrawCall; class FLAXENGINE_API IMaterial { public: - /// /// Gets the material info, structure which describes material surface. /// @@ -134,7 +133,6 @@ public: } public: - /// /// Settings for the material binding to the graphics pipeline. /// diff --git a/Source/Engine/Graphics/Materials/MaterialInfo.h b/Source/Engine/Graphics/Materials/MaterialInfo.h index 98f9bad74..a3de6be0b 100644 --- a/Source/Engine/Graphics/Materials/MaterialInfo.h +++ b/Source/Engine/Graphics/Materials/MaterialInfo.h @@ -446,7 +446,7 @@ struct MaterialInfo8 /// API_STRUCT() struct FLAXENGINE_API MaterialInfo { -DECLARE_SCRIPTING_TYPE_MINIMAL(MaterialInfo); + DECLARE_SCRIPTING_TYPE_MINIMAL(MaterialInfo); /// /// The material shader domain. diff --git a/Source/Engine/Graphics/Materials/MaterialParams.cpp b/Source/Engine/Graphics/Materials/MaterialParams.cpp index ce695c26e..762ed1bb9 100644 --- a/Source/Engine/Graphics/Materials/MaterialParams.cpp +++ b/Source/Engine/Graphics/Materials/MaterialParams.cpp @@ -406,7 +406,9 @@ void MaterialParameter::Bind(BindMeta& meta) const { case MaterialSceneTextures::SceneDepth: view = meta.CanSampleDepth - ? meta.Buffers->DepthBuffer->GetDescription().Flags & GPUTextureFlags::ReadOnlyDepthView ? meta.Buffers->DepthBuffer->ViewReadOnlyDepth() : meta.Buffers->DepthBuffer->View() + ? meta.Buffers->DepthBuffer->GetDescription().Flags & GPUTextureFlags::ReadOnlyDepthView + ? meta.Buffers->DepthBuffer->ViewReadOnlyDepth() + : meta.Buffers->DepthBuffer->View() : GPUDevice::Instance->GetDefaultWhiteTexture()->View(); break; case MaterialSceneTextures::AmbientOcclusion: diff --git a/Source/Engine/Graphics/Materials/MaterialParams.h b/Source/Engine/Graphics/Materials/MaterialParams.h index 7759cf0ea..1b68694d2 100644 --- a/Source/Engine/Graphics/Materials/MaterialParams.h +++ b/Source/Engine/Graphics/Materials/MaterialParams.h @@ -174,11 +174,10 @@ struct SerializedMaterialParam /// API_CLASS(NoSpawn) class FLAXENGINE_API MaterialParameter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialParameter, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialParameter, ScriptingObject); friend MaterialParams; friend MaterialInstance; private: - Guid _paramId; MaterialParameterType _type = MaterialParameterType::Invalid; bool _isPublic; @@ -202,7 +201,6 @@ private: String _name; public: - MaterialParameter(const MaterialParameter& other) : MaterialParameter() { @@ -220,7 +218,6 @@ public: } public: - /// /// Gets the parameter ID (not the parameter instance Id but the original parameter ID). /// @@ -286,7 +283,6 @@ public: } public: - /// /// Gets the value of the parameter. /// @@ -300,7 +296,6 @@ public: API_PROPERTY() void SetValue(const Variant& value); public: - /// /// The material parameter binding metadata. /// @@ -346,11 +341,9 @@ public: bool HasContentLoaded() const; private: - void clone(const MaterialParameter* param); public: - bool operator==(const MaterialParameter& other) const; // [Object] @@ -364,25 +357,21 @@ class FLAXENGINE_API MaterialParams : public Array { friend MaterialInstance; private: - int32 _versionHash = 0; public: - MaterialParameter* Get(const Guid& id); MaterialParameter* Get(const StringView& name); int32 Find(const Guid& id); int32 Find(const StringView& name); public: - /// /// Gets the parameters version hash. Every time the parameters are modified (loaded, edited, etc.) the hash changes. Can be used to sync instanced parameters collection. /// int32 GetVersionHash() const; public: - /// /// Binds the parameters to the pipeline. /// @@ -429,7 +418,6 @@ public: static void Save(BytesContainer& data, const Array* params); public: - #if USE_EDITOR /// @@ -443,6 +431,5 @@ public: bool HasContentLoaded() const; private: - void UpdateHash(); }; diff --git a/Source/Engine/Graphics/Materials/MaterialShader.cpp b/Source/Engine/Graphics/Materials/MaterialShader.cpp index d1267c27d..a81293430 100644 --- a/Source/Engine/Graphics/Materials/MaterialShader.cpp +++ b/Source/Engine/Graphics/Materials/MaterialShader.cpp @@ -112,21 +112,18 @@ MaterialShader* MaterialShader::Create(const StringView& name, MemoryReadStream& class DummyMaterial : public MaterialShader { public: - DummyMaterial() : MaterialShader(String::Empty) { } public: - // [Material] void Bind(BindParameters& params) override { } protected: - // [Material] bool Load() override { diff --git a/Source/Engine/Graphics/Materials/MaterialShader.h b/Source/Engine/Graphics/Materials/MaterialShader.h index 5f735795d..dac5c9ecd 100644 --- a/Source/Engine/Graphics/Materials/MaterialShader.h +++ b/Source/Engine/Graphics/Materials/MaterialShader.h @@ -10,7 +10,7 @@ /// /// Current materials shader version. /// -#define MATERIAL_GRAPH_VERSION 152 +#define MATERIAL_GRAPH_VERSION 153 class Material; class GPUShader; @@ -23,7 +23,6 @@ class MemoryReadStream; class MaterialShader : public IMaterial { protected: - struct PipelineStateCache { GPUPipelineState* PS[6]; @@ -57,7 +56,6 @@ protected: }; protected: - bool _isLoaded; GPUShader* _shader; GPUConstantBuffer* _cb; @@ -65,7 +63,6 @@ protected: MaterialInfo _info; protected: - /// /// Init /// @@ -73,14 +70,12 @@ protected: MaterialShader(const StringView& name); public: - /// /// Finalizes an instance of the class. /// virtual ~MaterialShader(); public: - /// /// Creates and loads the material from the data. /// @@ -104,12 +99,10 @@ public: virtual void Unload(); protected: - bool Load(MemoryReadStream& shaderCacheStream, const MaterialInfo& info); virtual bool Load() = 0; public: - // [IMaterial] const MaterialInfo& GetInfo() const override; GPUShader* GetShader() const override; diff --git a/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp b/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp index f802ef523..43c8c2f19 100644 --- a/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp +++ b/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp @@ -136,19 +136,19 @@ void ParticleMaterialShader::Bind(BindParameters& params) PipelineStateCache* psCache = nullptr; switch (drawCall.Particle.Module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { psCache = _cacheSprite.GetPS(view.Pass); break; } - // Model Rendering + // Model Rendering case 403: { psCache = _cacheModel.GetPS(view.Pass); break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { psCache = _cacheRibbon.GetPS(view.Pass); diff --git a/Source/Engine/Graphics/Materials/ParticleMaterialShader.h b/Source/Engine/Graphics/Materials/ParticleMaterialShader.h index 762ca0b7e..b3b04d541 100644 --- a/Source/Engine/Graphics/Materials/ParticleMaterialShader.h +++ b/Source/Engine/Graphics/Materials/ParticleMaterialShader.h @@ -10,7 +10,6 @@ class ParticleMaterialShader : public MaterialShader { private: - struct Cache { PipelineStateCache Default; @@ -51,7 +50,6 @@ private: }; private: - Cache _cacheSprite; Cache _cacheModel; Cache _cacheRibbon; @@ -59,7 +57,6 @@ private: DrawPass _drawModes = DrawPass::None; public: - /// /// Init /// @@ -70,14 +67,12 @@ public: } public: - // [MaterialShader] DrawPass GetDrawModes() const override; void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/PostFxMaterialShader.h b/Source/Engine/Graphics/Materials/PostFxMaterialShader.h index def6fe82b..7e5c53878 100644 --- a/Source/Engine/Graphics/Materials/PostFxMaterialShader.h +++ b/Source/Engine/Graphics/Materials/PostFxMaterialShader.h @@ -10,7 +10,6 @@ class PostFxMaterialShader : public MaterialShader { private: - struct Cache { GPUPipelineState* Default = nullptr; @@ -22,11 +21,9 @@ private: }; private: - Cache _cache; public: - /// /// Init /// @@ -37,13 +34,11 @@ public: } public: - // [MaterialShader] void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/TerrainMaterialShader.h b/Source/Engine/Graphics/Materials/TerrainMaterialShader.h index a4523f170..1faedc72d 100644 --- a/Source/Engine/Graphics/Materials/TerrainMaterialShader.h +++ b/Source/Engine/Graphics/Materials/TerrainMaterialShader.h @@ -10,7 +10,6 @@ class TerrainMaterialShader : public MaterialShader { private: - struct Cache { PipelineStateCache Default; @@ -49,11 +48,9 @@ private: }; private: - Cache _cache; public: - /// /// Init /// @@ -64,7 +61,6 @@ public: } public: - // [MaterialShader] DrawPass GetDrawModes() const override; bool CanUseLightmap() const override; @@ -72,7 +68,6 @@ public: void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Materials/VolumeParticleMaterialShader.h b/Source/Engine/Graphics/Materials/VolumeParticleMaterialShader.h index c94a5934a..7a4a3fa91 100644 --- a/Source/Engine/Graphics/Materials/VolumeParticleMaterialShader.h +++ b/Source/Engine/Graphics/Materials/VolumeParticleMaterialShader.h @@ -10,11 +10,9 @@ class VolumeParticleMaterialShader : public MaterialShader { private: - GPUPipelineState* _psVolumetricFog = nullptr; public: - /// /// Init /// @@ -25,14 +23,12 @@ public: } public: - // [MaterialShader] DrawPass GetDrawModes() const override; void Bind(BindParameters& params) override; void Unload() override; protected: - // [MaterialShader] bool Load() override; }; diff --git a/Source/Engine/Graphics/Models/BlendShape.h b/Source/Engine/Graphics/Models/BlendShape.h index 69ab572e9..b63b0081f 100644 --- a/Source/Engine/Graphics/Models/BlendShape.h +++ b/Source/Engine/Graphics/Models/BlendShape.h @@ -46,7 +46,6 @@ struct TIsPODType class BlendShape { public: - /// /// The name of the blend shape. /// @@ -84,14 +83,12 @@ public: class BlendShapesInstance { public: - /// /// The runtime data for blend shapes used for on a mesh. /// class MeshInstance { public: - bool IsUsed; bool IsDirty; uint32 DirtyMinVertexIndex; @@ -103,7 +100,6 @@ public: }; public: - /// /// The blend shapes weights (pair of blend shape name and the weight). /// @@ -120,7 +116,6 @@ public: Dictionary Meshes; public: - /// /// Finalizes an instance of the class. /// diff --git a/Source/Engine/Graphics/Models/CollisionProxy.h b/Source/Engine/Graphics/Models/CollisionProxy.h index 6ed98a644..346eb8e25 100644 --- a/Source/Engine/Graphics/Models/CollisionProxy.h +++ b/Source/Engine/Graphics/Models/CollisionProxy.h @@ -13,7 +13,6 @@ class FLAXENGINE_API CollisionProxy { public: - struct CollisionTriangle { Float3 V0, V1, V2; @@ -25,7 +24,6 @@ public: Array Triangles; public: - FORCE_INLINE bool HasData() const { return Triangles.HasItems(); diff --git a/Source/Engine/Graphics/Models/MaterialSlot.h b/Source/Engine/Graphics/Models/MaterialSlot.h index 422c72cb6..9e60efaae 100644 --- a/Source/Engine/Graphics/Models/MaterialSlot.h +++ b/Source/Engine/Graphics/Models/MaterialSlot.h @@ -12,7 +12,7 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API MaterialSlot : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialSlot, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialSlot, ScriptingObject); /// /// The material to use for rendering. @@ -30,7 +30,6 @@ DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialSlot, ScriptingObject); API_FIELD() String Name; public: - MaterialSlot(const MaterialSlot& other) : MaterialSlot() { diff --git a/Source/Engine/Graphics/Models/Mesh.h b/Source/Engine/Graphics/Models/Mesh.h index 151620d96..9d1dd01e0 100644 --- a/Source/Engine/Graphics/Models/Mesh.h +++ b/Source/Engine/Graphics/Models/Mesh.h @@ -20,9 +20,8 @@ class GPUBuffer; /// API_CLASS(NoSpawn) class FLAXENGINE_API Mesh : public MeshBase { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(Mesh, MeshBase); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(Mesh, MeshBase); protected: - bool _hasLightmapUVs; GPUBuffer* _vertexBuffers[3] = {}; GPUBuffer* _indexBuffer = nullptr; @@ -34,7 +33,6 @@ protected: mutable int32 _cachedIndexBufferCount; public: - Mesh(const Mesh& other) : Mesh() { @@ -49,7 +47,6 @@ public: ~Mesh(); public: - /// /// Gets the model owning this mesh. /// @@ -110,7 +107,6 @@ public: #endif public: - /// /// Updates the model mesh (used by the virtual models created with Init rather than Load). /// @@ -189,7 +185,6 @@ public: bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, Float3* vertices, uint32* triangles, Float3* normals = nullptr, Float3* tangents = nullptr, Float2* uvs = nullptr, Color32* colors = nullptr); public: - /// /// Updates the model mesh index buffer (used by the virtual models created with Init rather than Load). /// @@ -222,7 +217,6 @@ public: bool UpdateTriangles(uint32 triangleCount, void* ib, bool use16BitIndices); public: - /// /// Initializes instance of the class. /// @@ -254,7 +248,6 @@ public: void Unload(); public: - /// /// Determines if there is an intersection between the mesh and a ray in given world /// @@ -275,7 +268,6 @@ public: } public: - /// /// Gets the draw call geometry for this mesh. Sets the index and vertex buffers. /// @@ -375,14 +367,12 @@ public: void Draw(const RenderContext& renderContext, const DrawInfo& info, float lodDitherFactor) const; public: - // [MeshBase] bool DownloadDataGPU(MeshBufferType type, BytesContainer& result) const override; Task* DownloadDataGPUAsync(MeshBufferType type, BytesContainer& result) const override; bool DownloadDataCPU(MeshBufferType type, BytesContainer& result, int32& count) const override; private: - // Internal bindings API_FUNCTION(NoProxy) ScriptingObject* GetParentModel(); #if !COMPILE_WITHOUT_CSHARP diff --git a/Source/Engine/Graphics/Models/MeshBase.h b/Source/Engine/Graphics/Models/MeshBase.h index 5a76e4f46..1816118d3 100644 --- a/Source/Engine/Graphics/Models/MeshBase.h +++ b/Source/Engine/Graphics/Models/MeshBase.h @@ -16,9 +16,8 @@ class ModelBase; /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API MeshBase : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_MINIMAL(MeshBase); + DECLARE_SCRIPTING_TYPE_MINIMAL(MeshBase); protected: - ModelBase* _model; BoundingBox _box; BoundingSphere _sphere; @@ -35,7 +34,6 @@ protected: } public: - /// /// Gets the model owning this mesh. /// @@ -120,7 +118,6 @@ public: void SetBounds(const BoundingBox& box); public: - /// /// Extract mesh buffer data from GPU. Cannot be called from the main thread. /// diff --git a/Source/Engine/Graphics/Models/ModelData.h b/Source/Engine/Graphics/Models/ModelData.h index d1288bded..a3630e0aa 100644 --- a/Source/Engine/Graphics/Models/ModelData.h +++ b/Source/Engine/Graphics/Models/ModelData.h @@ -18,7 +18,6 @@ class FLAXENGINE_API MeshData { public: - /// /// The slot index in the model materials to use during rendering. /// @@ -92,7 +91,6 @@ public: Array BlendShapes; public: - /// /// Determines whether this instance has any mesh data. /// @@ -102,7 +100,6 @@ public: } public: - /// /// Clear arrays /// @@ -130,7 +127,6 @@ public: void Release(); public: - /// /// Init from model vertices array /// @@ -185,7 +181,6 @@ public: void SetIndexBuffer(void* data, uint32 indicesCount); public: - /// /// Pack mesh data to the stream /// @@ -213,7 +208,6 @@ public: void CalculateSphere(BoundingSphere& result) const; public: - #if COMPILE_WITH_MODEL_TOOL /// @@ -363,7 +357,6 @@ struct FLAXENGINE_API MaterialSlotEntry class FLAXENGINE_API ModelLodData { public: - /// /// The screen size to switch LODs. Bottom limit of the model screen size to render this LOD. /// @@ -375,7 +368,6 @@ public: Array Meshes; public: - /// /// Initializes a new instance of the class. /// @@ -403,7 +395,6 @@ public: class FLAXENGINE_API ModelData { public: - /// /// The minimum screen size to draw model (the bottom limit). /// @@ -435,7 +426,6 @@ public: AnimationData Animation; public: - /// /// Initializes a new instance of the class. /// @@ -444,7 +434,6 @@ public: } public: - /// /// Gets the valid level of details count. /// @@ -464,7 +453,6 @@ public: } public: - /// /// Automatically calculates the screen size for every model LOD for a proper transitions. /// @@ -477,7 +465,6 @@ public: void TransformBuffer(const Matrix& matrix); public: - /// /// Pack mesh data to the header stream /// diff --git a/Source/Engine/Graphics/Models/ModelInstanceEntry.h b/Source/Engine/Graphics/Models/ModelInstanceEntry.h index 57bdce8cd..6e28c2a7e 100644 --- a/Source/Engine/Graphics/Models/ModelInstanceEntry.h +++ b/Source/Engine/Graphics/Models/ModelInstanceEntry.h @@ -12,8 +12,8 @@ /// API_STRUCT() struct FLAXENGINE_API ModelInstanceEntry : ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(ModelInstanceEntry); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(ModelInstanceEntry); /// /// The mesh surface material used for the rendering. If not assigned the default value will be used from the model asset. @@ -36,7 +36,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(ModelInstanceEntry); API_FIELD() bool ReceiveDecals = true; public: - bool operator==(const ModelInstanceEntry& other) const; FORCE_INLINE bool operator!=(const ModelInstanceEntry& other) const { @@ -50,7 +49,6 @@ public: class FLAXENGINE_API ModelInstanceEntries : public Array, public ISerializable { public: - /// /// Determines whether buffer is valid for the given model. /// @@ -66,7 +64,6 @@ public: bool IsValidFor(const SkinnedModel* model) const; public: - /// /// Setup buffer for given model /// @@ -117,7 +114,6 @@ public: bool HasContentLoaded() const; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Graphics/Models/ModelLOD.h b/Source/Engine/Graphics/Models/ModelLOD.h index efd5bc6e9..745f3ac16 100644 --- a/Source/Engine/Graphics/Models/ModelLOD.h +++ b/Source/Engine/Graphics/Models/ModelLOD.h @@ -12,16 +12,14 @@ class MemoryReadStream; /// API_CLASS(NoSpawn) class FLAXENGINE_API ModelLOD : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(ModelLOD, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(ModelLOD, ScriptingObject); friend Model; friend Mesh; private: - Model* _model = nullptr; uint32 _verticesCount; public: - /// /// The screen size to switch LODs. Bottom limit of the model screen size to render this LOD. /// @@ -51,7 +49,6 @@ public: } public: - /// /// Initializes the LOD from the data stream. /// @@ -70,7 +67,6 @@ public: void Dispose(); public: - /// /// Determines if there is an intersection between the Model and a Ray in given world using given instance /// diff --git a/Source/Engine/Graphics/Models/SkeletonData.h b/Source/Engine/Graphics/Models/SkeletonData.h index 2b91bdbe8..6e6203e88 100644 --- a/Source/Engine/Graphics/Models/SkeletonData.h +++ b/Source/Engine/Graphics/Models/SkeletonData.h @@ -13,7 +13,7 @@ /// API_STRUCT() struct SkeletonNode { -DECLARE_SCRIPTING_TYPE_MINIMAL(SkeletonNode); + DECLARE_SCRIPTING_TYPE_MINIMAL(SkeletonNode); /// /// The parent node index. The root node uses value -1. @@ -36,7 +36,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(SkeletonNode); /// API_STRUCT() struct SkeletonBone { -DECLARE_SCRIPTING_TYPE_MINIMAL(SkeletonBone); + DECLARE_SCRIPTING_TYPE_MINIMAL(SkeletonBone); /// /// The parent bone index. The root bone uses value -1. @@ -74,7 +74,6 @@ struct TIsPODType class SkeletonData { public: - /// /// The nodes in this hierarchy. The root node is always at the index 0. /// @@ -86,7 +85,6 @@ public: Array Bones; public: - /// /// Gets the root node reference. /// diff --git a/Source/Engine/Graphics/Models/SkeletonMapping.h b/Source/Engine/Graphics/Models/SkeletonMapping.h index 74f734d22..e9ec9f75e 100644 --- a/Source/Engine/Graphics/Models/SkeletonMapping.h +++ b/Source/Engine/Graphics/Models/SkeletonMapping.h @@ -12,11 +12,9 @@ template class SkeletonMapping { public: - typedef Array Items; public: - /// /// The amount of the nodes (from the source skeleton). /// @@ -33,7 +31,6 @@ public: Array SourceToSource; public: - /// /// Initializes a new instance of the class. /// diff --git a/Source/Engine/Graphics/Models/SkeletonUpdater.h b/Source/Engine/Graphics/Models/SkeletonUpdater.h index 6ca4fefd2..1c17884d4 100644 --- a/Source/Engine/Graphics/Models/SkeletonUpdater.h +++ b/Source/Engine/Graphics/Models/SkeletonUpdater.h @@ -12,7 +12,6 @@ template class SkeletonUpdater { public: - typedef Array Items; /// @@ -43,14 +42,12 @@ public: }; public: - /// /// The cached node transformations. /// Array NodeTransformations; public: - /// /// Initializes a new instance of the class. /// @@ -133,7 +130,6 @@ public: } public: - /// /// Gets the default root node. /// @@ -149,7 +145,6 @@ public: } private: - void UpdateNode(Node& node) { // Compute local matrix diff --git a/Source/Engine/Graphics/Models/SkinnedMesh.h b/Source/Engine/Graphics/Models/SkinnedMesh.h index 2ee9bda76..08a9f8dbb 100644 --- a/Source/Engine/Graphics/Models/SkinnedMesh.h +++ b/Source/Engine/Graphics/Models/SkinnedMesh.h @@ -16,9 +16,8 @@ class SkinnedMeshDrawData; /// API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedMesh : public MeshBase { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedMesh, MeshBase); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedMesh, MeshBase); protected: - GPUBuffer* _vertexBuffer = nullptr; GPUBuffer* _indexBuffer = nullptr; mutable Array _cachedIndexBuffer; @@ -26,7 +25,6 @@ protected: mutable int32 _cachedIndexBufferCount; public: - SkinnedMesh(const SkinnedMesh& other) : SkinnedMesh() { @@ -41,7 +39,6 @@ public: ~SkinnedMesh(); public: - /// /// Gets the skinned model owning this mesh. /// @@ -64,7 +61,6 @@ public: Array BlendShapes; public: - /// /// Initializes a new instance of the class. /// @@ -93,7 +89,6 @@ public: void Unload(); public: - /// /// Updates the model mesh (used by the virtual models created with Init rather than Load). /// @@ -145,7 +140,6 @@ public: bool UpdateMesh(uint32 vertexCount, uint32 triangleCount, VB0SkinnedElementType* vb, void* ib, bool use16BitIndices); public: - /// /// Determines if there is an intersection between the mesh and a ray in given world /// @@ -166,7 +160,6 @@ public: } public: - /// /// Model instance drawing packed data. /// @@ -238,14 +231,12 @@ public: void Draw(const RenderContext& renderContext, const DrawInfo& info, float lodDitherFactor) const; public: - // [MeshBase] bool DownloadDataGPU(MeshBufferType type, BytesContainer& result) const override; Task* DownloadDataGPUAsync(MeshBufferType type, BytesContainer& result) const override; bool DownloadDataCPU(MeshBufferType type, BytesContainer& result, int32& count) const override; private: - // Internal bindings API_FUNCTION(NoProxy) ScriptingObject* GetParentModel(); #if !COMPILE_WITHOUT_CSHARP diff --git a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h index e9f3e8eb2..2176fc7f1 100644 --- a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h +++ b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h @@ -11,12 +11,10 @@ class FLAXENGINE_API SkinnedMeshDrawData { private: - bool _hasValidData = false; bool _isDirty = false; public: - /// /// The bones count. /// @@ -38,7 +36,6 @@ public: Array Data; public: - /// /// Initializes a new instance of the class. /// @@ -50,7 +47,6 @@ public: ~SkinnedMeshDrawData(); public: - /// /// Determines whether this instance is ready for rendering. /// diff --git a/Source/Engine/Graphics/Models/SkinnedModelLOD.h b/Source/Engine/Graphics/Models/SkinnedModelLOD.h index d41857af7..fbddf0041 100644 --- a/Source/Engine/Graphics/Models/SkinnedModelLOD.h +++ b/Source/Engine/Graphics/Models/SkinnedModelLOD.h @@ -12,14 +12,12 @@ class MemoryReadStream; /// API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModelLOD : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedModelLOD, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedModelLOD, ScriptingObject); friend SkinnedModel; private: - SkinnedModel* _model = nullptr; public: - /// /// The screen size to switch LODs. Bottom limit of the model screen size to render this LOD. /// @@ -36,7 +34,6 @@ public: bool HasAnyMeshInitialized() const; public: - /// /// Initializes the LOD from the data stream. /// @@ -55,7 +52,6 @@ public: void Dispose(); public: - /// /// Determines if there is an intersection between the Model and a Ray in given world using given instance /// diff --git a/Source/Engine/Graphics/Models/Types.h b/Source/Engine/Graphics/Models/Types.h index 357152430..2272a3a08 100644 --- a/Source/Engine/Graphics/Models/Types.h +++ b/Source/Engine/Graphics/Models/Types.h @@ -54,29 +54,29 @@ enum class MeshBufferType // Vertex structure for all models (versioned) PACK_STRUCT(struct ModelVertex15 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; }); PACK_STRUCT(struct ModelVertex18 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Half2 LightmapUVs; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Half2 LightmapUVs; }); PACK_STRUCT(struct ModelVertex19 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Half2 LightmapUVs; - Color32 Color; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Half2 LightmapUVs; + Color32 Color; }); typedef ModelVertex19 ModelVertex; @@ -96,32 +96,32 @@ struct RawModelVertex // For vertex data we use three buffers: one with positions, one with other attributes, and one with colors PACK_STRUCT(struct VB0ElementType15 { - Float3 Position; + Float3 Position; }); PACK_STRUCT(struct VB1ElementType15 { - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; }); PACK_STRUCT(struct VB0ElementType18 { - Float3 Position; + Float3 Position; }); PACK_STRUCT(struct VB1ElementType18 { - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Half2 LightmapUVs; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Half2 LightmapUVs; }); PACK_STRUCT(struct VB2ElementType18 { - Color32 Color; + Color32 Color; }); typedef VB0ElementType18 VB0ElementType; @@ -132,12 +132,12 @@ typedef VB2ElementType18 VB2ElementType; // Vertex structure for all skinned models (versioned) PACK_STRUCT(struct SkinnedModelVertex1 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Color32 BlendIndices; - Color32 BlendWeights; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Color32 BlendIndices; + Color32 BlendWeights; }); typedef SkinnedModelVertex1 SkinnedModelVertex; @@ -156,22 +156,22 @@ struct RawSkinnedModelVertex PACK_STRUCT(struct VB0SkinnedElementType1 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Color32 BlendIndices; - Color32 BlendWeights; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Color32 BlendIndices; + Color32 BlendWeights; }); PACK_STRUCT(struct VB0SkinnedElementType2 { - Float3 Position; - Half2 TexCoord; - Float1010102 Normal; - Float1010102 Tangent; - Color32 BlendIndices; - Half4 BlendWeights; + Float3 Position; + Half2 TexCoord; + Float1010102 Normal; + Float1010102 Tangent; + Color32 BlendIndices; + Half4 BlendWeights; }); typedef VB0SkinnedElementType2 VB0SkinnedElementType; diff --git a/Source/Engine/Graphics/PixelFormatExtensions.h b/Source/Engine/Graphics/PixelFormatExtensions.h index e0024f7b1..1d8ca8c25 100644 --- a/Source/Engine/Graphics/PixelFormatExtensions.h +++ b/Source/Engine/Graphics/PixelFormatExtensions.h @@ -10,16 +10,14 @@ /// API_CLASS(Static) class FLAXENGINE_API PixelFormatExtensions { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(PixelFormatExtensions); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(PixelFormatExtensions); public: - /// /// Initializes cache. /// static void Init(); public: - /// /// Calculates the size of a in bytes. /// @@ -211,7 +209,6 @@ public: API_FUNCTION() static PixelFormat MakeTypelessUNorm(PixelFormat format); public: - static PixelFormat FindShaderResourceFormat(PixelFormat format, bool bSRGB); static PixelFormat FindUnorderedAccessFormat(PixelFormat format); static PixelFormat FindDepthStencilFormat(PixelFormat format); diff --git a/Source/Engine/Graphics/PostProcessBase.h b/Source/Engine/Graphics/PostProcessBase.h index 3ca6c206c..d903b1278 100644 --- a/Source/Engine/Graphics/PostProcessBase.h +++ b/Source/Engine/Graphics/PostProcessBase.h @@ -15,7 +15,6 @@ struct RenderContext; class PostProcessBase { protected: - bool _isEnabled; bool _useSingleTarget; PostProcessEffectLocation _location; @@ -28,7 +27,6 @@ protected: } public: - /// /// Destructor /// @@ -37,7 +35,6 @@ public: } public: - /// /// Returns true if effect is enabled /// @@ -101,7 +98,6 @@ public: } public: - /// /// Perform rendering /// @@ -111,7 +107,6 @@ public: virtual void Render(RenderContext& renderContext, GPUTexture* input, GPUTexture* output) = 0; protected: - virtual void onEnable() { } diff --git a/Source/Engine/Graphics/PostProcessSettings.cpp b/Source/Engine/Graphics/PostProcessSettings.cpp index 5b9c7d4f8..0496a2a82 100644 --- a/Source/Engine/Graphics/PostProcessSettings.cpp +++ b/Source/Engine/Graphics/PostProcessSettings.cpp @@ -263,7 +263,7 @@ void PostProcessSettings::Serialize(SerializeStream& stream, const void* otherOb stream.JKEY("AO"); stream.Object(&AmbientOcclusion, other ? &other->AmbientOcclusion : nullptr); - + stream.JKEY("GI"); stream.Object(&GlobalIllumination, other ? &other->GlobalIllumination : nullptr); diff --git a/Source/Engine/Graphics/PostProcessSettings.h b/Source/Engine/Graphics/PostProcessSettings.h index e5742cbe4..3f7a53d48 100644 --- a/Source/Engine/Graphics/PostProcessSettings.h +++ b/Source/Engine/Graphics/PostProcessSettings.h @@ -322,13 +322,13 @@ API_STRUCT() struct FLAXENGINE_API GlobalIlluminationSettings : ISerializable /// API_FIELD(Attributes="EditorOrder(0), PostProcessSetting((int)GlobalIlluminationSettingsOverride.Mode)") GlobalIlluminationMode Mode = GlobalIlluminationMode::None; - + /// /// Global Illumination indirect lighting intensity scale. Can be used to boost or reduce GI effect. /// API_FIELD(Attributes="EditorOrder(10), Limit(0, 10, 0.01f), PostProcessSetting((int)GlobalIlluminationSettingsOverride.Intensity)") float Intensity = 1.0f; - + /// /// Defines how quickly GI blends between the the current frame and the history buffer. Lower values update GI faster, but with more jittering and noise. If the camera in your game doesn't move much, we recommend values closer to 1. /// diff --git a/Source/Engine/Graphics/RenderTargetPool.h b/Source/Engine/Graphics/RenderTargetPool.h index fbc0fd3d1..cba7a325d 100644 --- a/Source/Engine/Graphics/RenderTargetPool.h +++ b/Source/Engine/Graphics/RenderTargetPool.h @@ -9,9 +9,8 @@ /// API_CLASS(Static) class FLAXENGINE_API RenderTargetPool { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(RenderTargetPool); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(RenderTargetPool); public: - /// /// Flushes the temporary render targets. /// diff --git a/Source/Engine/Graphics/RenderTask.h b/Source/Engine/Graphics/RenderTask.h index 0604ccdfc..43ae15f71 100644 --- a/Source/Engine/Graphics/RenderTask.h +++ b/Source/Engine/Graphics/RenderTask.h @@ -26,7 +26,7 @@ class Actor; /// API_CLASS() class FLAXENGINE_API RenderTask : public ScriptingObject { -DECLARE_SCRIPTING_TYPE(RenderTask); + DECLARE_SCRIPTING_TYPE(RenderTask); /// /// List with all registered tasks @@ -49,18 +49,15 @@ DECLARE_SCRIPTING_TYPE(RenderTask); static void DrawAll(); private: - RenderTask* _prevTask = nullptr; public: - /// /// Finalizes an instance of the class. /// virtual ~RenderTask(); public: - /// /// Gets or sets a value indicating whether task is enabled. /// @@ -150,7 +147,6 @@ public: API_FUNCTION() virtual bool Resize(int32 width, int32 height); public: - bool operator<(const RenderTask& other) const { return Order < other.Order; @@ -193,21 +189,18 @@ DECLARE_ENUM_OPERATORS(ActorsSources); class ManagedPostProcessEffect : public PostProcessBase { public: - /// /// The script to use. Inherits from C# class 'PostProcessEffect'. /// Script* Target = nullptr; public: - /// /// Fetches the information about the PostFx location from the managed object. /// void FetchInfo(); public: - // [PostProcessBase] bool IsLoaded() const override; void Render(RenderContext& renderContext, GPUTexture* input, GPUTexture* output) override; @@ -219,19 +212,17 @@ public: /// API_CLASS() class FLAXENGINE_API SceneRenderTask : public RenderTask { -DECLARE_SCRIPTING_TYPE(SceneRenderTask); + DECLARE_SCRIPTING_TYPE(SceneRenderTask); protected: class SceneRendering* _customActorsScene = nullptr; public: - /// /// Finalizes an instance of the class. /// ~SceneRenderTask(); public: - /// /// True if the current frame is after the camera cut. Used to clear the temporal effects history and prevent visual artifacts blended from the previous frames. /// @@ -300,7 +291,6 @@ public: Array CustomPostFx; public: - /// /// The action called on view rendering to collect draw calls. It allows to extend rendering pipeline and draw custom geometry non-existing in the scene or custom actors set. /// @@ -343,7 +333,6 @@ public: virtual void OnPostRender(GPUContext* context, RenderContext& renderContext); public: - /// /// Gets the rendering render task viewport (before upsampling). /// @@ -360,7 +349,6 @@ public: API_PROPERTY() GPUTextureView* GetOutputView() const; public: - // [RenderTask] bool Resize(int32 width, int32 height) override; bool CanDraw() const override; @@ -380,7 +368,7 @@ public: /// API_CLASS() class FLAXENGINE_API MainRenderTask : public SceneRenderTask { -DECLARE_SCRIPTING_TYPE(MainRenderTask); + DECLARE_SCRIPTING_TYPE(MainRenderTask); /// /// Finalizes an instance of the class. @@ -388,14 +376,12 @@ DECLARE_SCRIPTING_TYPE(MainRenderTask); ~MainRenderTask(); public: - /// /// Gets the main game rendering task. Use it to plug custom rendering logic for your game. /// API_FIELD(ReadOnly) static MainRenderTask* Instance; public: - // [SceneRenderTask] void OnBegin(GPUContext* context) override; }; @@ -405,7 +391,7 @@ public: /// API_STRUCT() struct RenderContext { -DECLARE_SCRIPTING_TYPE_MINIMAL(RenderContext); + DECLARE_SCRIPTING_TYPE_MINIMAL(RenderContext); /// /// The render buffers. diff --git a/Source/Engine/Graphics/RenderTools.h b/Source/Engine/Graphics/RenderTools.h index 2a3541c3e..c3088a96d 100644 --- a/Source/Engine/Graphics/RenderTools.h +++ b/Source/Engine/Graphics/RenderTools.h @@ -20,9 +20,8 @@ PACK_STRUCT(struct QuadShaderData /// API_CLASS(Static) class FLAXENGINE_API RenderTools { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(RenderTools); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(RenderTools); public: - // Calculate a subresource index for a texture FORCE_INLINE static int32 CalcSubresourceIndex(uint32 mipSlice, int32 arraySlice, int32 mipLevels) { @@ -54,7 +53,6 @@ public: static void ComputePitch(PixelFormat format, int32 width, int32 height, uint32& rowPitch, uint32& slicePitch); public: - static void UpdateModelLODTransition(byte& lodTransition); static uint64 CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 mipLevels); static uint64 CalculateTextureMemoryUsage(PixelFormat format, int32 width, int32 height, int32 depth, int32 mipLevels); diff --git a/Source/Engine/Graphics/RenderView.h b/Source/Engine/Graphics/RenderView.h index 905106f5c..b06befda3 100644 --- a/Source/Engine/Graphics/RenderView.h +++ b/Source/Engine/Graphics/RenderView.h @@ -21,7 +21,7 @@ class SceneRenderTask; /// API_STRUCT() struct FLAXENGINE_API RenderView { -DECLARE_SCRIPTING_TYPE_MINIMAL(RenderView); + DECLARE_SCRIPTING_TYPE_MINIMAL(RenderView); /// /// The position of the view. @@ -86,7 +86,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(RenderView); API_FIELD() BoundingFrustum CullingFrustum; public: - /// /// The draw passes mask for the current view rendering. /// @@ -158,7 +157,6 @@ public: API_FIELD() LayersMask RenderLayersMask; public: - /// /// The view information vector with packed components to reconstruct linear depth and view position from the hardware depth buffer. Cached before rendering. /// @@ -226,7 +224,6 @@ public: } public: - // Set up view with custom params // @param viewProjection View * Projection matrix void SetUp(const Matrix& viewProjection) @@ -277,11 +274,9 @@ public: void CopyFrom(Camera* camera, Viewport* viewport); public: - DrawPass GetShadowsDrawPassMask(ShadowsCastingMode shadowsMode) const; public: - // Camera's View * Projection matrix FORCE_INLINE const Matrix& ViewProjection() const { diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h index ffe7b9d12..d0ebc0c8d 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h @@ -12,11 +12,9 @@ class FLAXENGINE_API ShaderAssetBase { protected: - ShaderStorage::Header _shaderHeader; public: - static bool IsNullRenderer(); /// @@ -44,7 +42,6 @@ public: #endif protected: - bool initBase(AssetInitData& initData); /// @@ -114,23 +111,21 @@ template class ShaderAssetTypeBase : public BaseType, public ShaderAssetBase { public: - static const uint32 ShadersSerializedVersion = ShaderStorage::Header::Version; protected: - explicit ShaderAssetTypeBase(const ScriptingObjectSpawnParams& params, const AssetInfo* info) : BaseType(params, info) { } protected: - // [BaseType] bool init(AssetInitData& initData) override { return initBase(initData); } + AssetChunksFlag getChunksToPreload() const override { AssetChunksFlag result = 0; diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp index d0f0dc179..0e6ad8f3a 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp @@ -31,12 +31,10 @@ static_assert(ARRAY_COUNT(ShaderProfileCacheDirNames) == (int32)ShaderProfile::M class ShaderProfileDatabase { public: - ShaderProfile Profile; String Folder; public: - void Init(ShaderProfile profile, const String& cacheRoot) { Profile = profile; @@ -84,7 +82,6 @@ public: class ShaderCacheManagerService : public EngineService { public: - ShaderCacheManagerService() : EngineService(TEXT("Shader Cache Manager"), -200) { diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h index 9973a449f..25419e210 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h @@ -18,7 +18,6 @@ class ShaderCacheManager { public: - struct CachedEntryHandle { Guid ID = Guid::Empty; @@ -30,7 +29,6 @@ public: }; public: - /// /// Tries to get cached shader entry for a given shader /// diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h b/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h index 1cfc3f0a4..8d504d3c3 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h @@ -28,7 +28,6 @@ class MemoryReadStream; class ShaderStorage { public: - /// /// Different shader cache storage modes (disabled, inside asset and in project cache) /// @@ -46,14 +45,12 @@ public: static CachingMode GetCachingMode(); public: - /// /// Packed version of the Magic Code for shader files /// static const int32 MagicCode; public: - /// /// File header, version 18 /// [Deprecated on 24.07.2019, expires on 10.05.2021] diff --git a/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h b/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h index aa795cd70..0d6eb41f6 100644 --- a/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h +++ b/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h @@ -10,11 +10,9 @@ class FLAXENGINE_API GPUConstantBuffer : public GPUResource { protected: - uint32 _size = 0; public: - /// /// Gets the buffer size (in bytes). /// @@ -25,7 +23,6 @@ public: } public: - // [GPUResource] ResourceType GetResourceType() const override { diff --git a/Source/Engine/Graphics/Shaders/GPUShader.h b/Source/Engine/Graphics/Shaders/GPUShader.h index 28ef2ee62..f10da5532 100644 --- a/Source/Engine/Graphics/Shaders/GPUShader.h +++ b/Source/Engine/Graphics/Shaders/GPUShader.h @@ -20,11 +20,9 @@ class GPUShaderProgram; class GPUShaderProgramsContainer { private: - Dictionary _shaders; public: - /// /// Initializes a new instance of the class. /// @@ -36,7 +34,6 @@ public: ~GPUShaderProgramsContainer(); public: - /// /// Adds a new shader program to the collection. /// @@ -58,7 +55,6 @@ public: void Clear(); public: - /// /// Calculates unique hash for given shader program name and its permutation index. /// @@ -73,9 +69,8 @@ public: /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUShader : public GPUResource { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUShader); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUShader); protected: - GPUShaderProgramsContainer _shaders; GPUConstantBuffer* _constantBuffers[MAX_CONSTANT_BUFFER_SLOTS]; @@ -85,7 +80,6 @@ protected: GPUShader(); public: - /// /// Creates the shader resource and loads its data from the bytes. /// The stream with compiled shader data. @@ -93,7 +87,6 @@ public: virtual bool Create(class MemoryReadStream& stream); public: - /// /// Gets the vertex shader. /// @@ -172,7 +165,6 @@ public: } public: - /// /// Determines whether the specified shader program is in the shader. /// @@ -185,18 +177,15 @@ public: } protected: - GPUShaderProgram* GetShader(ShaderStage stage, const StringAnsiView& name, int32 permutationIndex) const; virtual GPUShaderProgram* CreateGPUShaderProgram(ShaderStage type, const GPUShaderProgramInitializer& initializer, byte* cacheBytes, uint32 cacheSize, MemoryReadStream& stream) = 0; virtual GPUConstantBuffer* CreateCB(const String& name, uint32 size, MemoryReadStream& stream) = 0; public: - // [GPUResource] ResourceType GetResourceType() const final override; protected: - // [GPUResource] void OnReleaseGPU() override; }; diff --git a/Source/Engine/Graphics/Shaders/GPUShaderProgram.h b/Source/Engine/Graphics/Shaders/GPUShaderProgram.h index ab373a1cd..826be670b 100644 --- a/Source/Engine/Graphics/Shaders/GPUShaderProgram.h +++ b/Source/Engine/Graphics/Shaders/GPUShaderProgram.h @@ -50,7 +50,6 @@ struct GPUShaderProgramInitializer class FLAXENGINE_API GPUShaderProgram { protected: - StringAnsi _name; ShaderBindings _bindings; ShaderFlags _flags; @@ -69,7 +68,6 @@ protected: } public: - /// /// Finalizes an instance of the class. /// @@ -78,7 +76,6 @@ public: } public: - /// /// Gets name of the shader program. /// @@ -104,7 +101,6 @@ public: } public: - /// /// Gets shader program stage type. /// @@ -127,7 +123,6 @@ public: class GPUShaderProgramVS : public GPUShaderProgram { public: - /// /// Gets input layout description handle (platform dependent). /// @@ -139,7 +134,6 @@ public: virtual byte GetInputLayoutSize() const = 0; public: - // [GPUShaderProgram] ShaderStage GetStage() const override { @@ -153,7 +147,6 @@ public: class GPUShaderProgramGS : public GPUShaderProgram { public: - // [GPUShaderProgram] ShaderStage GetStage() const override { @@ -167,11 +160,9 @@ public: class GPUShaderProgramHS : public GPUShaderProgram { protected: - int32 _controlPointsCount; public: - /// /// Gets the input control points count (valid range: 1-32). /// @@ -181,7 +172,6 @@ public: } public: - // [GPUShaderProgram] ShaderStage GetStage() const override { @@ -195,7 +185,6 @@ public: class GPUShaderProgramDS : public GPUShaderProgram { public: - // [GPUShaderProgram] ShaderStage GetStage() const override { @@ -209,7 +198,6 @@ public: class GPUShaderProgramPS : public GPUShaderProgram { public: - // [GPUShaderProgram] ShaderStage GetStage() const override { @@ -223,7 +211,6 @@ public: class GPUShaderProgramCS : public GPUShaderProgram { public: - // [GPUShaderProgram] ShaderStage GetStage() const override { diff --git a/Source/Engine/Graphics/Textures/GPUSampler.h b/Source/Engine/Graphics/Textures/GPUSampler.h index 8b51cdb14..6f5760320 100644 --- a/Source/Engine/Graphics/Textures/GPUSampler.h +++ b/Source/Engine/Graphics/Textures/GPUSampler.h @@ -11,18 +11,16 @@ /// API_CLASS(Sealed) class FLAXENGINE_API GPUSampler : public GPUResource { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUSampler); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUSampler); static GPUSampler* Spawn(const SpawnParams& params); static GPUSampler* New(); protected: - GPUSamplerDescription _desc; GPUSampler(); public: - /// /// Gets sampler description structure. /// @@ -32,7 +30,6 @@ public: } public: - /// /// Creates new sampler. /// @@ -41,18 +38,15 @@ public: API_FUNCTION() bool Init(API_PARAM(Ref) const GPUSamplerDescription& desc); protected: - virtual bool OnInit() = 0; public: - // [GPUResource] String ToString() const override; ResourceType GetResourceType() const final override; ObjectType GetObjectType() const final override; protected: - // [GPUResource] void OnReleaseGPU() override; }; diff --git a/Source/Engine/Graphics/Textures/GPUSamplerDescription.h b/Source/Engine/Graphics/Textures/GPUSamplerDescription.h index fd033864e..aec6f848d 100644 --- a/Source/Engine/Graphics/Textures/GPUSamplerDescription.h +++ b/Source/Engine/Graphics/Textures/GPUSamplerDescription.h @@ -79,7 +79,7 @@ API_ENUM() enum class GPUSamplerBorderColor /// API_STRUCT() struct FLAXENGINE_API GPUSamplerDescription { -DECLARE_SCRIPTING_TYPE_MINIMAL(GPUSamplerDescription); + DECLARE_SCRIPTING_TYPE_MINIMAL(GPUSamplerDescription); /// /// The filtering method to use when sampling a texture. @@ -132,7 +132,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(GPUSamplerDescription); API_FIELD() GPUSamplerCompareFunction ComparisonFunction; public: - /// /// Creates a new with default settings. /// @@ -142,13 +141,11 @@ public: static GPUSamplerDescription New(GPUSamplerFilter filter = GPUSamplerFilter::Point, GPUSamplerAddressMode addressMode = GPUSamplerAddressMode::Wrap); public: - void Clear(); bool Equals(const GPUSamplerDescription& other) const; String ToString() const; public: - FORCE_INLINE bool operator==(const GPUSamplerDescription& other) const { return Equals(other); diff --git a/Source/Engine/Graphics/Textures/GPUTexture.cpp b/Source/Engine/Graphics/Textures/GPUTexture.cpp index a2af29547..c8c4d3a34 100644 --- a/Source/Engine/Graphics/Textures/GPUTexture.cpp +++ b/Source/Engine/Graphics/Textures/GPUTexture.cpp @@ -629,14 +629,12 @@ GPUTask* GPUTexture::UploadMipMapAsync(const BytesContainer& data, int32 mipInde class TextureDownloadDataTask : public ThreadPoolTask { private: - GPUTextureReference _texture; GPUTexture* _staging; TextureData* _data; bool _deleteStaging; public: - TextureDownloadDataTask(GPUTexture* texture, GPUTexture* staging, TextureData& data) : _texture(texture) , _staging(staging) @@ -652,7 +650,6 @@ public: } public: - // [ThreadPoolTask] bool HasReference(Object* resource) const override { @@ -660,7 +657,6 @@ public: } protected: - // [ThreadPoolTask] bool Run() override { diff --git a/Source/Engine/Graphics/Textures/GPUTexture.h b/Source/Engine/Graphics/Textures/GPUTexture.h index a0b4fc751..35fad9238 100644 --- a/Source/Engine/Graphics/Textures/GPUTexture.h +++ b/Source/Engine/Graphics/Textures/GPUTexture.h @@ -19,9 +19,8 @@ class Task; /// API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUTextureView : public GPUResourceView { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUTextureView); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUTextureView); protected: - GPUResource* _parent = nullptr; PixelFormat _format = PixelFormat::Unknown; MSAALevel _msaa = MSAALevel::None; @@ -41,7 +40,6 @@ protected: } public: - /// /// Gets parent GPU resource owning that view. /// @@ -72,12 +70,11 @@ public: /// API_CLASS(Sealed) class FLAXENGINE_API GPUTexture : public GPUResource { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUTexture); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUTexture); static GPUTexture* Spawn(const SpawnParams& params); static GPUTexture* New(); protected: - int32 _residentMipLevels; bool _sRGB, _isBlockCompressed; GPUTextureDescription _desc; @@ -88,7 +85,6 @@ protected: GPUTexture(); public: - /// /// Gets a value indicating whether this texture has any resided mip (data already uploaded to the GPU). /// @@ -202,7 +198,6 @@ public: } public: - /// /// Gets a value indicating whether this texture is a render target. /// @@ -316,7 +311,6 @@ public: } public: - /// /// Gets the texture total size in pixels. /// @@ -366,7 +360,6 @@ public: void GetResidentSize(int32& width, int32& height, int32& depth) const; public: - /// /// Calculates mip map row pitch (in bytes). /// @@ -398,7 +391,6 @@ public: int32 CalculateMipSize(int32 size, int32 mipLevel) const; public: - int32 ComputeSubresourceSize(int32 subresource, int32 rowAlign, int32 sliceAlign) const; int32 ComputeBufferOffset(int32 subresource, int32 rowAlign, int32 sliceAlign) const; int32 ComputeBufferTotalSize(int32 rowAlign, int32 sliceAlign) const; @@ -406,7 +398,6 @@ public: int32 ComputeRowPitch(int32 mipLevel, int32 rowAlign) const; public: - /// /// Gets the view to the first surface (only for 2D textures). /// @@ -471,7 +462,6 @@ public: } public: - /// /// Initializes a texture resource (allocates the GPU memory and performs the resource setup). /// @@ -513,7 +503,6 @@ public: API_FUNCTION() bool Resize(int32 width, int32 height, int32 depth); public: - /// /// Gets the native pointer to the underlying resource. It's a low-level platform-specific handle. /// @@ -568,27 +557,24 @@ public: /// Sets the number of resident mipmap levels in the texture (already uploaded to the GPU). /// API_PROPERTY() void SetResidentMipLevels(int32 count); - + /// /// Event called when texture residency gets changed. Texture Mip gets loaded into GPU memory and is ready to use. /// Delegate ResidentMipsChanged; protected: - virtual bool OnInit() = 0; uint64 calculateMemoryUsage() const; virtual void OnResidentMipsChanged() = 0; public: - // [GPUResource] String ToString() const override; ResourceType GetResourceType() const final override; ObjectType GetObjectType() const final override; protected: - // [GPUResource] void OnReleaseGPU() override; }; diff --git a/Source/Engine/Graphics/Textures/GPUTextureDescription.h b/Source/Engine/Graphics/Textures/GPUTextureDescription.h index e8940dad6..0194c9746 100644 --- a/Source/Engine/Graphics/Textures/GPUTextureDescription.h +++ b/Source/Engine/Graphics/Textures/GPUTextureDescription.h @@ -85,7 +85,7 @@ API_ENUM() enum class TextureDimensions /// API_STRUCT() struct FLAXENGINE_API GPUTextureDescription { -DECLARE_SCRIPTING_TYPE_MINIMAL(GPUTextureDescription); + DECLARE_SCRIPTING_TYPE_MINIMAL(GPUTextureDescription); /// /// The dimensions of the texture. @@ -143,7 +143,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(GPUTextureDescription); API_FIELD() Color DefaultClearColor; public: - /// /// Gets a value indicating whether this instance is a render target. /// @@ -225,7 +224,6 @@ public: } public: - /// /// Creates a new 1D with a single mipmap. /// @@ -265,7 +263,6 @@ public: static GPUTextureDescription New1D(int32 width, PixelFormat format, GPUTextureFlags textureFlags, int32 mipCount, int32 arraySize); public: - /// /// Creates a new with a single mipmap. /// @@ -310,7 +307,6 @@ public: static GPUTextureDescription New2D(int32 width, int32 height, PixelFormat format, GPUTextureFlags textureFlags, int32 mipCount, int32 arraySize, MSAALevel msaaLevel = MSAALevel::None); public: - /// /// Creates a new with a single mipmap. /// @@ -362,7 +358,6 @@ public: static GPUTextureDescription New3D(int32 width, int32 height, int32 depth, PixelFormat format, GPUTextureFlags textureFlags, int32 mipCount); public: - /// /// Creates a new Cube . /// @@ -399,7 +394,6 @@ public: static GPUTextureDescription NewCube(int32 size, PixelFormat format, GPUTextureFlags textureFlags, int32 mipCount); public: - void Clear(); GPUTextureDescription ToStagingUpload() const; GPUTextureDescription ToStagingReadback() const; @@ -407,7 +401,6 @@ public: String ToString() const; public: - FORCE_INLINE bool operator==(const GPUTextureDescription& other) const { return Equals(other); diff --git a/Source/Engine/Graphics/Textures/ITextureOwner.h b/Source/Engine/Graphics/Textures/ITextureOwner.h index d0a7fc9b7..ff2522672 100644 --- a/Source/Engine/Graphics/Textures/ITextureOwner.h +++ b/Source/Engine/Graphics/Textures/ITextureOwner.h @@ -14,7 +14,6 @@ class Task; class FLAXENGINE_API ITextureOwner { public: - /// /// Gets the texture owner mutex used to synchronize texture logic. /// diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.cpp b/Source/Engine/Graphics/Textures/StreamingTexture.cpp index f6dfe0743..8d78be57b 100644 --- a/Source/Engine/Graphics/Textures/StreamingTexture.cpp +++ b/Source/Engine/Graphics/Textures/StreamingTexture.cpp @@ -179,13 +179,11 @@ bool StreamingTexture::CanBeUpdated() const class StreamTextureResizeTask : public GPUTask { private: - StreamingTexture* _streamingTexture; GPUTexture* _newTexture; int32 _uploadedMipCount; public: - StreamTextureResizeTask(StreamingTexture* texture, GPUTexture* newTexture) : GPUTask(Type::CopyResource) , _streamingTexture(texture) @@ -200,7 +198,6 @@ public: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { @@ -222,6 +219,7 @@ protected: return Result::Ok; } + void OnEnd() override { Platform::InterlockedDecrement(&_streamingTexture->_streamingTasksCount); @@ -229,6 +227,7 @@ protected: // Base GPUTask::OnEnd(); } + void OnSync() override { Swap(_streamingTexture->_texture, _newTexture); @@ -310,12 +309,10 @@ Task* StreamingTexture::UpdateAllocation(int32 residency) class StreamTextureMipTask : public GPUUploadTextureMipTask { private: - StreamingTexture* _streamingTexture; FlaxStorage::LockData _dataLock; public: - StreamTextureMipTask(StreamingTexture* texture, int32 mipIndex) : GPUUploadTextureMipTask(texture->GetTexture(), mipIndex, Span(nullptr, 0), 0, 0, false) , _streamingTexture(texture) @@ -326,7 +323,6 @@ public: } private: - void onResourceUnload2(GPUTextureReference* ref) { // Unlink texture @@ -338,7 +334,6 @@ private: } protected: - // [GPUTask] Result run(GPUTasksContext* context) override { @@ -378,6 +373,7 @@ protected: return Result::Ok; } + void OnEnd() override { _dataLock.Release(); @@ -390,6 +386,7 @@ protected: // Base GPUUploadTextureMipTask::OnEnd(); } + void OnFail() override { if (_streamingTexture) diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.h b/Source/Engine/Graphics/Textures/StreamingTexture.h index 6e93a95e7..24570c5fb 100644 --- a/Source/Engine/Graphics/Textures/StreamingTexture.h +++ b/Source/Engine/Graphics/Textures/StreamingTexture.h @@ -16,7 +16,6 @@ class FLAXENGINE_API StreamingTexture : public Object, public StreamableResource friend class StreamTextureMipTask; friend class StreamTextureResizeTask; protected: - ITextureOwner* _owner; GPUTexture* _texture; TextureHeader _header; @@ -25,12 +24,10 @@ protected: bool _isBlockCompressed; public: - StreamingTexture(ITextureOwner* owner, const String& name); ~StreamingTexture(); public: - /// /// Gets the owner. /// @@ -125,7 +122,6 @@ public: } public: - /// /// Converts allocated texture mip index to the absolute mip map index. /// @@ -141,7 +137,6 @@ public: int32 TotalIndexToTextureMipIndex(int32 mipIndex) const; public: - /// /// Creates new texture /// @@ -162,14 +157,12 @@ public: uint64 GetTotalMemoryUsage() const; public: - FORCE_INLINE GPUTexture* operator->() const { return _texture; } public: - // [Object] String ToString() const override; diff --git a/Source/Engine/Graphics/Textures/TextureBase.cpp b/Source/Engine/Graphics/Textures/TextureBase.cpp index 9c8c5af57..73667bb83 100644 --- a/Source/Engine/Graphics/Textures/TextureBase.cpp +++ b/Source/Engine/Graphics/Textures/TextureBase.cpp @@ -784,7 +784,7 @@ bool TextureBase::InitData::GenerateMip(int32 mipIndex, bool linear) { switch (Format) { - // 4 component, 32 bit with 8 bits per component - use Color32 type + // 4 component, 32 bit with 8 bits per component - use Color32 type case PixelFormat::R8G8B8A8_SInt: case PixelFormat::R8G8B8A8_Typeless: case PixelFormat::R8G8B8A8_SNorm: diff --git a/Source/Engine/Graphics/Textures/TextureBase.h b/Source/Engine/Graphics/Textures/TextureBase.h index be892a557..694bf3372 100644 --- a/Source/Engine/Graphics/Textures/TextureBase.h +++ b/Source/Engine/Graphics/Textures/TextureBase.h @@ -14,7 +14,7 @@ class TextureMipData; /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API TextureBase : public BinaryAsset, public ITextureOwner { -DECLARE_ASSET_HEADER(TextureBase); + DECLARE_ASSET_HEADER(TextureBase); static const uint32 TexturesSerializedVersion = 4; /// @@ -48,13 +48,11 @@ DECLARE_ASSET_HEADER(TextureBase); }; protected: - StreamingTexture _texture; InitData* _customData; BinaryAsset* _parent; public: - /// /// Gets the streaming texture object handle. /// @@ -124,7 +122,7 @@ public: /// Gets the total memory usage that texture may have in use (if loaded to the maximum quality). Exact value may differ due to memory alignment and resource allocation policy. /// API_PROPERTY() uint64 GetTotalMemoryUsage() const; - + /// /// Gets the index of the texture group used by this texture. /// @@ -136,7 +134,6 @@ public: API_PROPERTY() void SetTextureGroup(int32 textureGroup); public: - /// /// Gets the mip data. /// @@ -214,16 +211,13 @@ public: bool Init(InitData* initData); protected: - virtual int32 CalculateChunkIndex(int32 mipIndex) const; private: - // Internal bindings API_FUNCTION(NoProxy) bool Init(void* ptr); public: - // [ITextureOwner] CriticalSection& GetOwnerLocker() const override; Task* RequestMipDataAsync(int32 mipIndex) override; @@ -233,7 +227,6 @@ public: bool GetMipDataCustomPitch(int32 mipIndex, uint32& rowPitch, uint32& slicePitch) const override; protected: - // [BinaryAsset] bool init(AssetInitData& initData) override; LoadResult load() override; diff --git a/Source/Engine/Graphics/Textures/TextureData.h b/Source/Engine/Graphics/Textures/TextureData.h index 141f455db..33f6d8df1 100644 --- a/Source/Engine/Graphics/Textures/TextureData.h +++ b/Source/Engine/Graphics/Textures/TextureData.h @@ -13,7 +13,6 @@ class FLAXENGINE_API TextureMipData { public: - uint32 RowPitch; uint32 DepthPitch; uint32 Lines; @@ -47,7 +46,6 @@ public: class FLAXENGINE_API TextureData { public: - /// /// Single entry of the texture array. Contains collection of mip maps. /// @@ -60,7 +58,6 @@ public: }; public: - /// /// Init /// @@ -76,7 +73,6 @@ public: } public: - /// /// Top level texture width (in pixels). /// @@ -103,7 +99,6 @@ public: Array> Items; public: - /// /// Gather texture data /// diff --git a/Source/Engine/Graphics/Textures/TextureUtils.h b/Source/Engine/Graphics/Textures/TextureUtils.h index e5264c39b..5ab496fe6 100644 --- a/Source/Engine/Graphics/Textures/TextureUtils.h +++ b/Source/Engine/Graphics/Textures/TextureUtils.h @@ -11,7 +11,6 @@ class TextureUtils { public: - static PixelFormat ToPixelFormat(const TextureFormatType format, int32 width, int32 height, bool canCompress) { const bool canUseBlockCompression = width % 4 == 0 && height % 4 == 0; diff --git a/Source/Engine/Input/Gamepad.h b/Source/Engine/Input/Gamepad.h index ee8d7d4a1..bd4e70c99 100644 --- a/Source/Engine/Input/Gamepad.h +++ b/Source/Engine/Input/Gamepad.h @@ -11,7 +11,7 @@ /// API_STRUCT() struct FLAXENGINE_API GamepadVibrationState { -DECLARE_SCRIPTING_TYPE_MINIMAL(GamepadVibrationState); + DECLARE_SCRIPTING_TYPE_MINIMAL(GamepadVibrationState); /// /// The left large motor vibration. @@ -74,9 +74,8 @@ struct FLAXENGINE_API GamepadLayout /// API_CLASS(NoSpawn, Sealed) class FLAXENGINE_API Gamepad : public InputDevice { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Gamepad); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Gamepad); public: - /// /// The universal gamepad state description. All hardware gamepad device handlers should map input to match this structure. /// Later on, each gamepad may use individual layout for a game. @@ -103,7 +102,6 @@ public: }; protected: - Guid _productId; State _state; State _mappedState; @@ -112,14 +110,12 @@ protected: explicit Gamepad(const Guid& productId, const String& name); public: - /// /// The gamepad layout. /// GamepadLayout Layout; public: - /// /// Gets the gamepad device type identifier. /// @@ -179,7 +175,6 @@ public: } public: - /// /// Sets the state of the gamepad vibration. Ignored if controller does not support this. /// @@ -204,7 +199,6 @@ public: } public: - // [InputDevice] void ResetState() override; bool Update(EventQueue& queue) final override; diff --git a/Source/Engine/Input/Input.cpp b/Source/Engine/Input/Input.cpp index 04901cecc..aba26b6a0 100644 --- a/Source/Engine/Input/Input.cpp +++ b/Source/Engine/Input/Input.cpp @@ -67,7 +67,6 @@ using namespace InputImpl; class InputService : public EngineService { public: - InputService() : EngineService(TEXT("Input"), -60) { @@ -692,7 +691,7 @@ void InputService::Update() continue; switch (e.Type) { - // Keyboard events + // Keyboard events case InputDevice::EventType::Char: window->OnCharInput(e.CharData.Char); break; @@ -702,7 +701,7 @@ void InputService::Update() case InputDevice::EventType::KeyUp: window->OnKeyUp(e.KeyData.Key); break; - // Mouse events + // Mouse events case InputDevice::EventType::MouseDown: window->OnMouseDown(window->ScreenToClient(e.MouseData.Position), e.MouseData.Button); break; @@ -721,7 +720,7 @@ void InputService::Update() case InputDevice::EventType::MouseLeave: window->OnMouseLeave(); break; - // Touch events + // Touch events case InputDevice::EventType::TouchDown: window->OnTouchDown(window->ScreenToClient(e.TouchData.Position), e.TouchData.PointerId); break; @@ -748,7 +747,7 @@ void InputService::Update() { switch (e.Type) { - // Keyboard events + // Keyboard events case InputDevice::EventType::Char: Input::CharInput(e.CharData.Char); break; @@ -758,7 +757,7 @@ void InputService::Update() case InputDevice::EventType::KeyUp: Input::KeyUp(e.KeyData.Key); break; - // Mouse events + // Mouse events case InputDevice::EventType::MouseDown: Input::MouseDown(e.MouseData.Position, e.MouseData.Button); break; @@ -777,7 +776,7 @@ void InputService::Update() case InputDevice::EventType::MouseLeave: Input::MouseLeave(); break; - // Touch events + // Touch events case InputDevice::EventType::TouchDown: Input::TouchDown(e.TouchData.Position, e.TouchData.PointerId); break; diff --git a/Source/Engine/Input/Input.h b/Source/Engine/Input/Input.h index 191366d1d..a09b3358c 100644 --- a/Source/Engine/Input/Input.h +++ b/Source/Engine/Input/Input.h @@ -20,7 +20,7 @@ class InputDevice; /// API_CLASS(Static) class FLAXENGINE_API Input { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Input); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Input); /// /// Gets the mouse (null if platform does not support mouse or it is not connected). @@ -66,7 +66,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Input); static Array> CustomDevices; public: - typedef Delegate CharDelegate; typedef Delegate KeyboardDelegate; typedef Delegate MouseDelegate; @@ -135,7 +134,6 @@ public: static TouchDelegate TouchUp; public: - /// /// Gets the text entered during the current frame (Unicode). /// @@ -164,7 +162,6 @@ public: API_FUNCTION() static bool GetKeyUp(KeyboardKeys key); public: - /// /// Gets the mouse position in game window coordinates. /// @@ -223,7 +220,6 @@ public: API_FUNCTION() static bool GetMouseButtonUp(MouseButton button); public: - /// /// Gets the gamepad axis value. /// @@ -289,7 +285,6 @@ public: API_FUNCTION() static bool GetGamepadButtonUp(InputGamepadIndex gamepad, GamepadButton button); public: - /// /// Maps a discrete button or key press events to a "friendly name" that will later be bound to event-driven behavior. The end effect is that pressing (and/or releasing) a key, mouse button, or keypad button. /// diff --git a/Source/Engine/Input/InputDevice.h b/Source/Engine/Input/InputDevice.h index 80766f18c..99db3c2d0 100644 --- a/Source/Engine/Input/InputDevice.h +++ b/Source/Engine/Input/InputDevice.h @@ -13,9 +13,8 @@ /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API InputDevice : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(InputDevice); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(InputDevice); public: - enum class EventType { Char, @@ -81,7 +80,6 @@ public: typedef Array> EventQueue; protected: - String _name; EventQueue _queue; @@ -92,7 +90,6 @@ protected: } public: - /// /// Gets the name. /// diff --git a/Source/Engine/Input/InputSettings.h b/Source/Engine/Input/InputSettings.h index a34732b2b..e4b217007 100644 --- a/Source/Engine/Input/InputSettings.h +++ b/Source/Engine/Input/InputSettings.h @@ -11,9 +11,8 @@ /// API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings") class FLAXENGINE_API InputSettings : public SettingsBase { -DECLARE_SCRIPTING_TYPE_MINIMAL(InputSettings); + DECLARE_SCRIPTING_TYPE_MINIMAL(InputSettings); public: - /// /// Maps a discrete button or key press events to a "friendly name" that will later be bound to event-driven behavior. The end effect is that pressing (and/or releasing) a key, mouse button, or keypad button. /// @@ -25,7 +24,6 @@ public: Array AxisMappings; public: - /// /// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use. /// diff --git a/Source/Engine/Input/Keyboard.h b/Source/Engine/Input/Keyboard.h index 16b4e8a97..3b673b486 100644 --- a/Source/Engine/Input/Keyboard.h +++ b/Source/Engine/Input/Keyboard.h @@ -9,9 +9,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API Keyboard : public InputDevice { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Keyboard); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Keyboard); protected: - struct State { uint16 InputTextLength; @@ -26,7 +25,6 @@ protected: explicit Keyboard(); public: - /// /// Gets the text entered during the current frame. /// @@ -72,7 +70,6 @@ public: API_PROPERTY() bool IsAnyKeyDown() const; public: - /// /// Called when keyboard enters input character. /// @@ -95,7 +92,6 @@ public: void OnKeyDown(KeyboardKeys key, Window* target = nullptr); public: - // [InputDevice] void ResetState() override;; bool Update(EventQueue& queue) final override; diff --git a/Source/Engine/Input/Mouse.h b/Source/Engine/Input/Mouse.h index 9dba1392a..78da85bd9 100644 --- a/Source/Engine/Input/Mouse.h +++ b/Source/Engine/Input/Mouse.h @@ -12,9 +12,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API Mouse : public InputDevice { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Mouse); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Mouse); public: - /// /// The mouse state. /// @@ -45,7 +44,6 @@ public: }; protected: - State _state; State _prevState; @@ -57,7 +55,6 @@ protected: } public: - /// /// Gets the position of the mouse in the screen-space coordinates. /// @@ -116,7 +113,6 @@ public: } public: - /// /// Sets the mouse position. /// @@ -175,7 +171,6 @@ public: void OnMouseWheel(const Float2& position, float delta, Window* target = nullptr); public: - // [InputDevice] void ResetState() override; bool Update(EventQueue& queue) final override; diff --git a/Source/Engine/Input/VirtualInput.h b/Source/Engine/Input/VirtualInput.h index ef33c55a8..8036c3d48 100644 --- a/Source/Engine/Input/VirtualInput.h +++ b/Source/Engine/Input/VirtualInput.h @@ -11,7 +11,7 @@ /// API_STRUCT() struct ActionConfig { -DECLARE_SCRIPTING_TYPE_MINIMAL(ActionConfig); + DECLARE_SCRIPTING_TYPE_MINIMAL(ActionConfig); /// /// The action "friendly name" used to access it from code. @@ -55,7 +55,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(ActionConfig); /// API_STRUCT() struct AxisConfig { -DECLARE_SCRIPTING_TYPE_MINIMAL(AxisConfig); + DECLARE_SCRIPTING_TYPE_MINIMAL(AxisConfig); /// /// The axis "friendly name" used to access it from code. diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index 5ba661a9e..70485a8ca 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -26,7 +26,7 @@ class SceneRenderTask; /// API_CLASS(Abstract) class FLAXENGINE_API Actor : public SceneObject { -DECLARE_SCENE_OBJECT(Actor); + DECLARE_SCENE_OBJECT(Actor); friend Level; friend PrefabManager; friend Scene; @@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Actor); friend PrefabInstanceData; protected: - int8 _isActive : 1; int8 _isActiveInHierarchy : 1; int8 _isPrefabRoot : 1; @@ -53,13 +52,11 @@ protected: PhysicsScene* _physicsScene; private: - // Disable copying Actor(Actor const&) = delete; Actor& operator=(Actor const&) = delete; public: - /// /// List with all child actors attached to the actor (readonly). All items are valid (not null). /// @@ -79,7 +76,6 @@ public: HideFlags HideFlags; public: - /// /// Gets the object layer (index). Can be used for selective rendering or ignoring raycasts. /// @@ -164,7 +160,6 @@ public: API_PROPERTY() void SetName(const StringView& value); public: - /// /// Gets the scene object which contains this actor. /// @@ -267,7 +262,6 @@ public: API_FUNCTION(Attributes="NoAnimate") void DestroyChildren(float timeLeft = 0.0f); public: - /// /// Gets amount of scripts. /// @@ -324,7 +318,6 @@ public: } public: - /// /// Gets value indicating if actor is active in the scene. /// @@ -417,7 +410,6 @@ public: } public: - /// /// Gets the actor's world transformation. /// @@ -491,7 +483,6 @@ public: API_PROPERTY() void SetRotation(const Matrix& value); public: - /// /// Gets the random per-instance value (normalized to range 0-1). /// @@ -517,7 +508,6 @@ public: API_PROPERTY() void SetDirection(const Float3& value); public: - /// /// Resets the actor local transform. /// @@ -615,7 +605,6 @@ public: } public: - /// /// Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor). /// @@ -662,7 +651,6 @@ public: void UnregisterObjectHierarchy(); public: - /// /// Draws this actor. Called by Scene Rendering service. This call is more optimized than generic Draw (eg. geometry is rendered during all pass types but other actors are drawn only during GBufferFill pass). /// @@ -684,7 +672,6 @@ public: #endif public: - /// /// Changes the script order. /// @@ -705,7 +692,6 @@ public: API_PROPERTY() bool IsPrefabRoot() const; public: - /// /// Tries to find the actor with the given name in this actor hierarchy (checks this actor and all children hierarchy). /// @@ -806,7 +792,6 @@ public: API_FUNCTION() Quaternion LookingAt(const Vector3& worldPos, const Vector3& worldUp) const; public: - /// /// Execute custom action on actors tree. /// Action should returns false to stop calling deeper. @@ -843,7 +828,6 @@ public: } public: - /// /// Performs actors serialization to the raw bytes. /// @@ -903,7 +887,6 @@ public: API_FUNCTION() void FromJson(const StringAnsiView& json); public: - /// /// Called when actor gets added to game systems. Occurs on BeginPlay event or when actor gets activated in hierarchy. Use this event to register object to other game system (eg. audio). /// @@ -985,10 +968,11 @@ public: API_PROPERTY(Attributes="HideInEditor") PhysicsScene* GetPhysicsScene() const; protected: - virtual void OnPhysicsSceneChanged(PhysicsScene* previous) {} + virtual void OnPhysicsSceneChanged(PhysicsScene* previous) + { + } private: - void SetSceneInHierarchy(Scene* scene); void OnEnableInHierarchy(); void OnDisableInHierarchy(); @@ -998,7 +982,6 @@ private: static bool IsSubClassOf(const Script* object, const MClass* klass); public: - // [ScriptingObject] String ToString() const override; void OnDeleteObject() override; diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp index 94b8002ee..3a0ab2641 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.cpp +++ b/Source/Engine/Level/Actors/AnimatedModel.cpp @@ -693,9 +693,9 @@ void AnimatedModel::Update() void AnimatedModel::Draw(RenderContext& renderContext) { if (renderContext.View.Pass == DrawPass::GlobalSDF) - return; // TODO: Animated Model rendering to Global SDF + return; // TODO: Animated Model rendering to Global SDF if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas) - return; // No supported + return; // No supported GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, _world); const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (int32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode)); diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h index 90f96ed69..63efa487a 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.h +++ b/Source/Engine/Level/Actors/AnimatedModel.h @@ -14,10 +14,9 @@ /// API_CLASS() class FLAXENGINE_API AnimatedModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(AnimatedModel); + DECLARE_SCENE_OBJECT(AnimatedModel); friend class AnimationsSystem; public: - /// /// Describes the animation graph updates frequency for the animated model. /// @@ -55,7 +54,6 @@ public: }; private: - BoundingBox _boxLocal; Matrix _world; GeometryDrawStateData _drawState; @@ -68,7 +66,6 @@ private: ScriptingObjectReference _masterPose; public: - /// /// The skinned model asset used for rendering. /// @@ -154,7 +151,6 @@ public: ScriptingObjectReference RootMotionTarget; public: - /// /// The graph instance data container. For dynamic usage only at runtime, not serialized. /// @@ -238,7 +234,6 @@ public: API_FUNCTION() void SetMasterPoseModel(AnimatedModel* masterPose); public: - /// /// Gets the anim graph instance parameters collection. /// @@ -283,7 +278,6 @@ public: API_FUNCTION() void SetParameterValue(const Guid& id, const Variant& value); public: - /// /// Gets the weight of the blend shape. /// @@ -304,7 +298,6 @@ public: API_FUNCTION() void ClearBlendShapeWeights(); public: - /// /// Plays the animation on the slot in Anim Graph. /// @@ -353,7 +346,6 @@ public: API_FUNCTION() bool IsPlayingSlotAnimation(const StringView& slotName, Animation* anim); private: - void ApplyRootMotion(const RootMotionData& rootMotionDelta); void SyncParameters(); @@ -372,7 +364,6 @@ private: void OnGraphLoaded(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -387,7 +378,6 @@ public: bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override; protected: - // [ModelInstanceActor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Level/Actors/BoneSocket.cpp b/Source/Engine/Level/Actors/BoneSocket.cpp index 924dc768a..d287fedcb 100644 --- a/Source/Engine/Level/Actors/BoneSocket.cpp +++ b/Source/Engine/Level/Actors/BoneSocket.cpp @@ -104,7 +104,7 @@ void BoneSocket::OnParentChanged() { // Base Actor::OnParentChanged(); - + if (!IsDuringPlay()) return; diff --git a/Source/Engine/Level/Actors/BoneSocket.h b/Source/Engine/Level/Actors/BoneSocket.h index e1f158a47..e3ed1e5f4 100644 --- a/Source/Engine/Level/Actors/BoneSocket.h +++ b/Source/Engine/Level/Actors/BoneSocket.h @@ -9,16 +9,14 @@ /// API_CLASS() class FLAXENGINE_API BoneSocket : public Actor { -DECLARE_SCENE_OBJECT(BoneSocket); + DECLARE_SCENE_OBJECT(BoneSocket); private: - String _node; int32 _index; bool _useScale; public: - /// /// Gets the target node name to link to it. /// @@ -54,7 +52,6 @@ public: void SetUseScale(bool value); public: - /// /// Updates the actor transformation based on a skeleton node. /// @@ -62,7 +59,6 @@ public: void UpdateTransformation(); public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -71,7 +67,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnTransformChanged() override; void OnParentChanged() override; diff --git a/Source/Engine/Level/Actors/BoxBrush.h b/Source/Engine/Level/Actors/BoxBrush.h index 6a7d24330..718fd5d55 100644 --- a/Source/Engine/Level/Actors/BoxBrush.h +++ b/Source/Engine/Level/Actors/BoxBrush.h @@ -12,7 +12,7 @@ /// API_STRUCT() struct BrushSurface : ISerializable { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); /// /// The parent brush. @@ -57,7 +57,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(BrushSurface); float ScaleInLightmap = 1.0f; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -68,16 +67,14 @@ public: /// API_CLASS() class FLAXENGINE_API BoxBrush : public Actor, public CSG::Brush { -DECLARE_SCENE_OBJECT(BoxBrush); + DECLARE_SCENE_OBJECT(BoxBrush); private: - Vector3 _center; Vector3 _size; OrientedBoundingBox _bounds; BrushMode _mode; public: - /// /// Brush surfaces scale in lightmap /// @@ -161,7 +158,6 @@ public: API_FUNCTION() void SetMaterial(int32 surfaceIndex, MaterialBase* material); public: - /// /// Gets the volume bounding box (oriented). /// @@ -191,7 +187,6 @@ public: API_FUNCTION() void GetVertices(int32 surfaceIndex, API_PARAM(Out) Array& outputData) const; private: - FORCE_INLINE void UpdateBounds() { OrientedBoundingBox::CreateCentered(_center, _size, _bounds); @@ -201,7 +196,6 @@ private: } public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -219,7 +213,6 @@ public: int32 GetSurfacesCount() override; protected: - // [Actor] void OnTransformChanged() override; void OnActiveInTreeChanged() override; diff --git a/Source/Engine/Level/Actors/BoxVolume.h b/Source/Engine/Level/Actors/BoxVolume.h index cb957f572..e6a9d41b1 100644 --- a/Source/Engine/Level/Actors/BoxVolume.h +++ b/Source/Engine/Level/Actors/BoxVolume.h @@ -10,14 +10,12 @@ /// API_CLASS(Abstract) class FLAXENGINE_API BoxVolume : public Actor { -DECLARE_SCENE_OBJECT(BoxVolume); + DECLARE_SCENE_OBJECT(BoxVolume); protected: - Vector3 _size; OrientedBoundingBox _bounds; public: - /// /// Gets the size of the volume (in local space). /// @@ -41,7 +39,6 @@ public: } protected: - virtual void OnBoundsChanged(const BoundingBox& prevBounds) { } @@ -51,7 +48,6 @@ protected: #endif public: - // [Actor] #if USE_EDITOR void OnDebugDraw() override; @@ -61,7 +57,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnTransformChanged() override; }; diff --git a/Source/Engine/Level/Actors/Camera.h b/Source/Engine/Level/Actors/Camera.h index e029ad972..9c380dcfc 100644 --- a/Source/Engine/Level/Actors/Camera.h +++ b/Source/Engine/Level/Actors/Camera.h @@ -20,7 +20,7 @@ /// API_CLASS(Sealed) class FLAXENGINE_API Camera : public Actor { -DECLARE_SCENE_OBJECT(Camera); + DECLARE_SCENE_OBJECT(Camera); // List with all created cameras actors on the scene static Array Cameras; @@ -35,7 +35,6 @@ DECLARE_SCENE_OBJECT(Camera); API_PROPERTY() static Camera* GetMainCamera(); private: - Matrix _view, _projection; BoundingFrustum _frustum; @@ -56,7 +55,6 @@ private: #endif public: - /// /// Gets the view matrix. /// @@ -82,7 +80,6 @@ public: } public: - /// /// Gets the value indicating if camera should use perspective rendering mode, otherwise it will use orthographic projection. /// @@ -174,7 +171,6 @@ public: LayersMask RenderLayersMask; public: - /// /// Projects the point from 3D world-space to game window coordinates (in screen pixels for default viewport calculated from ). /// @@ -231,14 +227,12 @@ public: #endif private: - #if USE_EDITOR void OnPreviewModelLoaded(); #endif void UpdateCache(); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; @@ -250,7 +244,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Decal.h b/Source/Engine/Level/Actors/Decal.h index 10eccb635..3e2d6a18c 100644 --- a/Source/Engine/Level/Actors/Decal.h +++ b/Source/Engine/Level/Actors/Decal.h @@ -12,16 +12,14 @@ /// API_CLASS() class FLAXENGINE_API Decal : public Actor { -DECLARE_SCENE_OBJECT(Decal); + DECLARE_SCENE_OBJECT(Decal); private: - Vector3 _size; OrientedBoundingBox _bounds; Matrix _world; int32 _sceneRenderingKey = -1; public: - /// /// The decal material. Must have domain mode to Decal type. /// @@ -56,7 +54,6 @@ public: API_PROPERTY() void SetSize(const Vector3& value); public: - /// /// Utility to crate a new virtual Material Instance asset, set its parent to the currently applied material, and assign it to the decal. Can be used to modify the decal material parameters from code. /// @@ -73,7 +70,6 @@ public: } public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -86,7 +82,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/EmptyActor.h b/Source/Engine/Level/Actors/EmptyActor.h index ec85afd19..00d1cf0a8 100644 --- a/Source/Engine/Level/Actors/EmptyActor.h +++ b/Source/Engine/Level/Actors/EmptyActor.h @@ -9,16 +9,14 @@ /// API_CLASS() class FLAXENGINE_API EmptyActor : public Actor { -DECLARE_SCENE_OBJECT(EmptyActor); + DECLARE_SCENE_OBJECT(EmptyActor); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; #endif protected: - // [Actor] void OnTransformChanged() override; }; diff --git a/Source/Engine/Level/Actors/EnvironmentProbe.h b/Source/Engine/Level/Actors/EnvironmentProbe.h index 52ccda3fb..cc84d2f1b 100644 --- a/Source/Engine/Level/Actors/EnvironmentProbe.h +++ b/Source/Engine/Level/Actors/EnvironmentProbe.h @@ -11,16 +11,14 @@ /// API_CLASS() class FLAXENGINE_API EnvironmentProbe : public Actor { -DECLARE_SCENE_OBJECT(EnvironmentProbe); + DECLARE_SCENE_OBJECT(EnvironmentProbe); private: - float _radius; bool _isUsingCustomProbe; int32 _sceneRenderingKey = -1; AssetReference _probe; public: - /// /// The reflections brightness. /// @@ -40,7 +38,6 @@ public: float CaptureNearPlane = 10.0f; public: - /// /// Gets the probe radius. /// @@ -108,7 +105,6 @@ public: API_PROPERTY() void SetCustomProbe(CubeTexture* probe); public: - /// /// Bakes that probe. It won't be performed now but on async graphics rendering task. /// @@ -122,11 +118,9 @@ public: void SetProbeData(TextureData& data); private: - void UpdateBounds(); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override @@ -146,7 +140,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp index 5481cb080..d2b2b6952 100644 --- a/Source/Engine/Level/Actors/ExponentialHeightFog.cpp +++ b/Source/Engine/Level/Actors/ExponentialHeightFog.cpp @@ -33,10 +33,10 @@ void ExponentialHeightFog::Draw(RenderContext& renderContext) { // Render only when shader is valid and fog can be rendered // Do not render exponential fog in orthographic views - if ((renderContext.View.Flags & ViewFlags::Fog) != 0 + if ((renderContext.View.Flags & ViewFlags::Fog) != 0 && renderContext.View.Pass & DrawPass::GBuffer - && _shader - && _shader->IsLoaded() + && _shader + && _shader->IsLoaded() && renderContext.View.IsPerspectiveProjection()) { // Prepare diff --git a/Source/Engine/Level/Actors/Light.h b/Source/Engine/Level/Actors/Light.h index 688081f6f..5c2491773 100644 --- a/Source/Engine/Level/Actors/Light.h +++ b/Source/Engine/Level/Actors/Light.h @@ -11,9 +11,8 @@ /// API_CLASS(Abstract) class FLAXENGINE_API Light : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(Light); + DECLARE_SCENE_OBJECT_ABSTRACT(Light); public: - /// /// Color of the light /// @@ -51,12 +50,10 @@ public: bool CastVolumetricShadow = true; protected: - // Adjust the light brightness used during rendering (called by light types inside SetupLightData callback) void AdjustBrightness(const RenderView& view, float& brightness) const; public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override @@ -74,9 +71,8 @@ public: /// API_CLASS(Abstract) class FLAXENGINE_API LightWithShadow : public Light { -DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow); + DECLARE_SCENE_OBJECT_ABSTRACT(LightWithShadow); public: - /// /// The minimum roughness value used to clamp material surface roughness during shading pixel. /// @@ -132,7 +128,6 @@ public: ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All; public: - // [Light] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/Actors/ModelInstanceActor.h b/Source/Engine/Level/Actors/ModelInstanceActor.h index 37f0ff636..f218fc005 100644 --- a/Source/Engine/Level/Actors/ModelInstanceActor.h +++ b/Source/Engine/Level/Actors/ModelInstanceActor.h @@ -11,13 +11,11 @@ /// API_CLASS(Abstract) class FLAXENGINE_API ModelInstanceActor : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor); + DECLARE_SCENE_OBJECT_ABSTRACT(ModelInstanceActor); protected: - int32 _sceneRenderingKey = -1; public: - /// /// The model instance buffer. /// @@ -84,12 +82,10 @@ public: } public: - // [Actor] void OnLayerChanged() override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/PostFxVolume.h b/Source/Engine/Level/Actors/PostFxVolume.h index b7764ce3b..bc269eb22 100644 --- a/Source/Engine/Level/Actors/PostFxVolume.h +++ b/Source/Engine/Level/Actors/PostFxVolume.h @@ -11,16 +11,14 @@ /// API_CLASS() class FLAXENGINE_API PostFxVolume : public BoxVolume, public IPostFxSettingsProvider { -DECLARE_SCENE_OBJECT(PostFxVolume); + DECLARE_SCENE_OBJECT(PostFxVolume); private: - int32 _priority; float _blendRadius; float _blendWeight; bool _isBounded; public: - /// /// The ambient occlusion effect settings. /// @@ -100,7 +98,6 @@ public: PostFxMaterialsSettings PostFxMaterials; public: - /// /// Gets the order in which multiple volumes are blended together. /// The volume with the highest priority takes precedence over all other overlapping volumes. @@ -184,7 +181,6 @@ public: } public: - /// /// Adds the post fx material to the settings. /// @@ -198,7 +194,6 @@ public: API_FUNCTION() void RemovePostFxMaterial(MaterialBase* material); public: - // [BoxVolume] bool HasContentLoaded() const override; void Serialize(SerializeStream& stream, const void* otherObj) override; @@ -209,7 +204,6 @@ public: void Blend(PostProcessSettings& other, float weight) override; protected: - // [BoxVolume] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Ragdoll.h b/Source/Engine/Level/Actors/Ragdoll.h index 39a2b790d..e0e8be411 100644 --- a/Source/Engine/Level/Actors/Ragdoll.h +++ b/Source/Engine/Level/Actors/Ragdoll.h @@ -10,15 +10,13 @@ /// API_CLASS() class FLAXENGINE_API Ragdoll : public Actor { -DECLARE_SCENE_OBJECT(Ragdoll); -API_AUTO_SERIALIZATION(); + DECLARE_SCENE_OBJECT(Ragdoll); + API_AUTO_SERIALIZATION(); private: - AnimatedModel* _animatedModel = nullptr; Dictionary _bonesOffsets; public: - /// /// The default bones weight where 0 means fully animated bone and 1 means fully simulate bones. Can be used to control all bones simulation mode but is overriden by per-bone BonesWeights. /// @@ -53,7 +51,6 @@ public: float MaxDepenetrationVelocity = MAX_float; public: - /// /// Calculates the total mass of all ragdoll bodies. /// @@ -70,13 +67,11 @@ public: API_FUNCTION() void SetAngularVelocity(const Vector3& value) const; private: - float InitBone(RigidBody* rigidBody, int32& nodeIndex, Transform& localPose); void OnFixedUpdate(); void OnAnimationUpdating(struct AnimGraphImpulse* localPose); public: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/Spline.cpp b/Source/Engine/Level/Actors/Spline.cpp index f9d0a81c0..0e1502ecf 100644 --- a/Source/Engine/Level/Actors/Spline.cpp +++ b/Source/Engine/Level/Actors/Spline.cpp @@ -156,7 +156,7 @@ float Spline::GetSplineLength() const Vector3 prevPoint = Vector3::Zero; for (int32 i = 1; i < Curve.GetKeyframes().Count(); i++) { - const auto& a = Curve[i = 1]; + const auto& a = Curve[i - 1]; const auto& b = Curve[i]; const float length = Math::Abs(b.Time - a.Time); diff --git a/Source/Engine/Level/Actors/Spline.h b/Source/Engine/Level/Actors/Spline.h index 4a1b04f05..eb72c3efe 100644 --- a/Source/Engine/Level/Actors/Spline.h +++ b/Source/Engine/Level/Actors/Spline.h @@ -10,15 +10,13 @@ /// API_CLASS() class FLAXENGINE_API Spline : public Actor { -DECLARE_SCENE_OBJECT(Spline); + DECLARE_SCENE_OBJECT(Spline); typedef BezierCurveKeyframe Keyframe; private: - bool _loop = false; BoundingBox _localBounds; public: - /// /// The spline bezier curve points represented as series of transformations in 3D space (with tangents). Points are stored in local-space of the actor. /// @@ -37,7 +35,6 @@ public: API_PROPERTY() void SetIsLoop(bool value); public: - /// /// Evaluates the spline curve at the given time and calculates the point location in 3D (world-space). /// @@ -215,7 +212,6 @@ public: API_FUNCTION() void GetSplineLocalPoints(API_PARAM(Out) Array& points) const; public: - /// /// Clears the spline to be empty. /// @@ -345,7 +341,6 @@ public: API_FUNCTION() void SetTangentsSmooth(); public: - /// /// Called when spline gets updated (eg. after curve modification). /// @@ -357,7 +352,6 @@ public: API_FUNCTION() virtual void UpdateSpline(); protected: - #if USE_EDITOR virtual Color GetSplineColor() { @@ -366,7 +360,6 @@ protected: #endif private: - // Internal bindings #if !COMPILE_WITHOUT_CSHARP API_FUNCTION(NoProxy) void GetKeyframes(MonoArray* data); @@ -374,7 +367,6 @@ private: #endif public: - // [Actor] #if USE_EDITOR void OnDebugDraw() override; diff --git a/Source/Engine/Level/Actors/SplineModel.cpp b/Source/Engine/Level/Actors/SplineModel.cpp index 925fb3995..6fc12edd6 100644 --- a/Source/Engine/Level/Actors/SplineModel.cpp +++ b/Source/Engine/Level/Actors/SplineModel.cpp @@ -351,9 +351,9 @@ void SplineModel::Draw(RenderContext& renderContext) return; auto model = Model.Get(); if (renderContext.View.Pass == DrawPass::GlobalSDF) - return; // TODO: Spline Model rendering to Global SDF + return; // TODO: Spline Model rendering to Global SDF if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas) - return; // TODO: Spline Model rendering to Global Surface Atlas + return; // TODO: Spline Model rendering to Global Surface Atlas if (!Entries.IsValidFor(model)) Entries.Setup(model); diff --git a/Source/Engine/Level/Actors/SplineModel.h b/Source/Engine/Level/Actors/SplineModel.h index 4446e47f8..1d8d49fc8 100644 --- a/Source/Engine/Level/Actors/SplineModel.h +++ b/Source/Engine/Level/Actors/SplineModel.h @@ -12,9 +12,8 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(SplineModel); + DECLARE_SCENE_OBJECT(SplineModel); private: - struct Instance { BoundingSphere Sphere; @@ -33,7 +32,6 @@ private: float _chunksPerSegment, _meshMinZ, _meshMaxZ; public: - ~SplineModel(); /// @@ -104,14 +102,12 @@ public: API_PROPERTY() void SetForcedLOD(int32 value); private: - void OnModelChanged(); void OnModelLoaded(); void OnSplineUpdated(); void UpdateDeformationBuffer(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -121,7 +117,6 @@ public: void OnParentChanged() override; protected: - // [ModelInstanceActor] void OnTransformChanged() override; void OnActiveInTreeChanged() override; diff --git a/Source/Engine/Level/Actors/SpotLight.h b/Source/Engine/Level/Actors/SpotLight.h index 103264618..294b5fdc5 100644 --- a/Source/Engine/Level/Actors/SpotLight.h +++ b/Source/Engine/Level/Actors/SpotLight.h @@ -11,9 +11,8 @@ /// API_CLASS() class FLAXENGINE_API SpotLight : public LightWithShadow { -DECLARE_SCENE_OBJECT(SpotLight); + DECLARE_SCENE_OBJECT(SpotLight); private: - Vector3 _direction; float _radius; float _outerConeAngle; @@ -24,7 +23,6 @@ private: int32 _sceneRenderingKey = -1; public: - /// /// Light source bulb radius /// @@ -62,7 +60,6 @@ public: float IESBrightnessScale = 1.0f; public: - /// /// Computes light brightness value /// @@ -122,11 +119,9 @@ public: API_PROPERTY() void SetInnerConeAngle(float value); private: - void UpdateBounds(); public: - // [LightWithShadow] void Draw(RenderContext& renderContext) override; #if USE_EDITOR @@ -138,7 +133,6 @@ public: bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override; protected: - // [LightWithShadow] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Level/Actors/StaticModel.h b/Source/Engine/Level/Actors/StaticModel.h index 09836e5aa..2068c2384 100644 --- a/Source/Engine/Level/Actors/StaticModel.h +++ b/Source/Engine/Level/Actors/StaticModel.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API StaticModel : public ModelInstanceActor { -DECLARE_SCENE_OBJECT(StaticModel); + DECLARE_SCENE_OBJECT(StaticModel); private: - Matrix _world; GeometryDrawStateData _drawState; float _scaleInLightmap; @@ -28,7 +27,6 @@ private: Model* _residencyChangedModel = nullptr; public: - /// /// Finalizes an instance of the class. /// @@ -52,7 +50,6 @@ public: LightmapEntry Lightmap; public: - /// /// Gets the model world matrix transform. /// @@ -180,14 +177,12 @@ public: API_FUNCTION() void RemoveVertexColors(); private: - void OnModelChanged(); void OnModelLoaded(); void OnModelResidencyChanged(); void UpdateBounds(); public: - // [ModelInstanceActor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -198,7 +193,6 @@ public: bool IntersectsEntry(const Ray& ray, Real& distance, Vector3& normal, int32& entryIndex) override; protected: - // [ModelInstanceActor] void OnTransformChanged() override; void OnEnable() override; diff --git a/Source/Engine/Level/ActorsCache.h b/Source/Engine/Level/ActorsCache.h index 57364278f..3c2566a09 100644 --- a/Source/Engine/Level/ActorsCache.h +++ b/Source/Engine/Level/ActorsCache.h @@ -12,13 +12,11 @@ class ActorsCache { public: - typedef ActorsLookup ActorsLookupType; typedef Array ActorsListType; typedef Array SceneObjectsListType; public: - /// /// Gets the actors lookup cached. Safe allocation, per thread, uses caching. /// diff --git a/Source/Engine/Level/Level.cpp b/Source/Engine/Level/Level.cpp index 5ff5d8c89..ddcc7797a 100644 --- a/Source/Engine/Level/Level.cpp +++ b/Source/Engine/Level/Level.cpp @@ -59,7 +59,6 @@ enum class SceneEventType class SceneAction { public: - virtual ~SceneAction() { } @@ -113,7 +112,6 @@ using namespace LevelImpl; class LevelService : public EngineService { public: - LevelService() : EngineService(TEXT("Scene Manager"), 30) { @@ -401,7 +399,6 @@ void Level::CollectPostFxVolumes(RenderContext& renderContext) class LoadSceneAction : public SceneAction { public: - Guid SceneId; AssetReference SceneAsset; @@ -444,7 +441,6 @@ public: class UnloadSceneAction : public SceneAction { public: - Guid TargetScene; UnloadSceneAction(Scene* scene) @@ -464,7 +460,6 @@ public: class UnloadScenesAction : public SceneAction { public: - UnloadScenesAction() { } @@ -478,7 +473,6 @@ public: class SaveSceneAction : public SceneAction { public: - Scene* TargetScene; bool PrettyJson; @@ -504,7 +498,6 @@ public: class ReloadScriptsAction : public SceneAction { public: - ReloadScriptsAction() { } @@ -655,7 +648,6 @@ void Level::ScriptsReloadRegisterObject(ScriptingObject*& obj) class SpawnActorAction : public SceneAction { public: - ScriptingObjectReference TargetActor; ScriptingObjectReference ParentActor; @@ -674,7 +666,6 @@ public: class DeleteActorAction : public SceneAction { public: - ScriptingObjectReference TargetActor; DeleteActorAction(Actor* actor) diff --git a/Source/Engine/Level/Level.h b/Source/Engine/Level/Level.h index 8a6e53aae..ae01cd572 100644 --- a/Source/Engine/Level/Level.h +++ b/Source/Engine/Level/Level.h @@ -21,7 +21,7 @@ struct RenderContext; /// API_CLASS(Static) class FLAXENGINE_API Level { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); friend Engine; friend Actor; friend PrefabManager; @@ -33,7 +33,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Level); #endif public: - /// /// The scenes collection lock. /// @@ -45,7 +44,6 @@ public: API_FIELD(ReadOnly) static Array Scenes; public: - /// /// Occurs when new actor gets spawned to the game. /// @@ -77,7 +75,6 @@ public: API_EVENT() static Delegate ActorActiveChanged; public: - /// /// Checks if any scene has been loaded. Loaded scene means deserialized and added to the scenes collection. /// @@ -124,7 +121,6 @@ public: } public: - /// /// Spawn actor on the scene /// @@ -160,7 +156,6 @@ public: static void CallBeginPlay(Actor* obj); public: - /// /// Draws all the actors. /// @@ -174,7 +169,6 @@ public: static void CollectPostFxVolumes(RenderContext& renderContext); public: - /// /// Fired when scene starts saving. /// @@ -246,7 +240,6 @@ public: #endif public: - /// /// Saves scene to the asset. /// @@ -342,7 +335,6 @@ public: #endif public: - /// /// Tries to find actor with the given ID. It's very fast O(1) lookup. /// @@ -413,7 +405,6 @@ public: API_FUNCTION() static Scene* FindScene(const Guid& id); public: - /// /// Gets the scenes. /// @@ -433,7 +424,6 @@ public: static void GetScenes(Array& scenes); public: - /// /// Construct valid and solid list with actors from input list with whole tree for them (valid for fast serialization) /// @@ -449,7 +439,6 @@ public: static void ConstructParentActorsTreeList(const Array& input, Array& output); public: - /// /// The tags names. /// @@ -479,7 +468,6 @@ public: API_FUNCTION() static int32 GetLayerIndex(const StringView& layer); private: - // Actor API enum class ActorEventType { diff --git a/Source/Engine/Level/Scene/Lightmap.h b/Source/Engine/Level/Scene/Lightmap.h index f07f89472..86d8ae59c 100644 --- a/Source/Engine/Level/Scene/Lightmap.h +++ b/Source/Engine/Level/Scene/Lightmap.h @@ -14,7 +14,6 @@ class SceneLightmapsData; class Lightmap { private: - SceneLightmapsData* _manager; int32 _index; #if USE_EDITOR @@ -23,7 +22,6 @@ private: AssetReference _textures[3]; public: - /// /// Initializes a new instance of the class. /// @@ -33,7 +31,6 @@ public: Lightmap(SceneLightmapsData* manager, int32 index, const SavedLightmapInfo& info); public: - /// /// Gets attached texture objects /// @@ -99,7 +96,6 @@ public: bool IsReady() const; private: - #if USE_EDITOR bool OnInitLightmap(class TextureData& image); #endif diff --git a/Source/Engine/Level/Scene/Scene.h b/Source/Engine/Level/Scene/Scene.h index 927a5a58e..27b09a8f9 100644 --- a/Source/Engine/Level/Scene/Scene.h +++ b/Source/Engine/Level/Scene/Scene.h @@ -19,7 +19,7 @@ API_CLASS() class FLAXENGINE_API Scene : public Actor { friend class Level; friend class ReloadScriptsAction; -DECLARE_SCENE_OBJECT(Scene); + DECLARE_SCENE_OBJECT(Scene); /// /// Finalizes an instance of the class. @@ -27,7 +27,6 @@ DECLARE_SCENE_OBJECT(Scene); ~Scene(); public: - /// /// The scene metadata. /// @@ -80,7 +79,6 @@ public: API_PROPERTY() void SetLightmapSettings(const LightmapSettings& value); public: - /// /// Removes all baked lightmap textures from the scene. /// @@ -120,7 +118,6 @@ public: #endif private: - MeshCollider* TryGetCsgCollider(); StaticModel* TryGetCsgModel(); void CreateCsgCollider(); @@ -132,7 +129,6 @@ private: #endif public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -140,7 +136,6 @@ public: void EndPlay() override; protected: - // [Actor] void PostLoad() override; void PostSpawn() override; diff --git a/Source/Engine/Level/Scene/SceneAsset.h b/Source/Engine/Level/Scene/SceneAsset.h index 541c45782..47466eaec 100644 --- a/Source/Engine/Level/Scene/SceneAsset.h +++ b/Source/Engine/Level/Scene/SceneAsset.h @@ -9,7 +9,7 @@ /// API_CLASS(NoSpawn) class SceneAsset : public JsonAsset { -DECLARE_ASSET_HEADER(SceneAsset); + DECLARE_ASSET_HEADER(SceneAsset); protected: bool IsInternalType() const override; }; diff --git a/Source/Engine/Level/Scene/SceneCSGData.h b/Source/Engine/Level/Scene/SceneCSGData.h index d1d13e6f4..457f4a840 100644 --- a/Source/Engine/Level/Scene/SceneCSGData.h +++ b/Source/Engine/Level/Scene/SceneCSGData.h @@ -20,11 +20,9 @@ namespace CSG class SceneCSGData : public ISerializable { private: - Scene* _scene; public: - /// /// Initializes a new instance of the class. /// @@ -32,7 +30,6 @@ namespace CSG SceneCSGData(Scene* scene); public: - /// /// CSG mesh building action time (registered by CSG::Builder, in UTC format). Invalid if not build by active engine instance. /// @@ -64,7 +61,6 @@ namespace CSG Action PostCSGBuild; public: - /// /// Build CSG geometry for the given scene. /// @@ -77,7 +73,6 @@ namespace CSG bool HasData() const; public: - struct SurfaceData { Array Triangles; @@ -95,11 +90,9 @@ namespace CSG bool TryGetSurfaceData(const Guid& brushId, int32 brushSurfaceIndex, SurfaceData& outData); private: - void OnDataChanged(); public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/Scene/SceneLightmapsData.h b/Source/Engine/Level/Scene/SceneLightmapsData.h index b6d15c9e4..7c1ffe045 100644 --- a/Source/Engine/Level/Scene/SceneLightmapsData.h +++ b/Source/Engine/Level/Scene/SceneLightmapsData.h @@ -13,12 +13,10 @@ class Lightmap; class SceneLightmapsData { private: - Array _lightmaps; Scene* _scene; public: - /// /// Initializes a new instance of the class. /// @@ -31,7 +29,6 @@ public: ~SceneLightmapsData(); public: - FORCE_INLINE Scene* GetScene() const { return _scene; @@ -64,7 +61,6 @@ public: } public: - #if USE_EDITOR /// @@ -84,7 +80,6 @@ public: #endif public: - /// /// Clear baked lightmaps data /// diff --git a/Source/Engine/Level/Scene/SceneNavigation.h b/Source/Engine/Level/Scene/SceneNavigation.h index daf966d54..7b42487d0 100644 --- a/Source/Engine/Level/Scene/SceneNavigation.h +++ b/Source/Engine/Level/Scene/SceneNavigation.h @@ -13,7 +13,6 @@ class NavMeshBoundsVolume; class FLAXENGINE_API SceneNavigation { public: - /// /// The list of registered navigation bounds volumes (on the scene). /// diff --git a/Source/Engine/Level/Scene/SceneTicking.h b/Source/Engine/Level/Scene/SceneTicking.h index 5ad183cec..6d590fba9 100644 --- a/Source/Engine/Level/Scene/SceneTicking.h +++ b/Source/Engine/Level/Scene/SceneTicking.h @@ -11,7 +11,6 @@ class FLAXENGINE_API SceneTicking { public: - /// /// Tick function type. /// @@ -48,7 +47,6 @@ public: class FLAXENGINE_API TickData { public: - Array Scripts; Array Ticks; #if USE_EDITOR @@ -93,7 +91,6 @@ public: class FLAXENGINE_API FixedUpdateTickData : public TickData { public: - FixedUpdateTickData(); void TickScripts(const Array& scripts) override; }; @@ -101,7 +98,6 @@ public: class FLAXENGINE_API UpdateTickData : public TickData { public: - UpdateTickData(); void TickScripts(const Array& scripts) override; }; @@ -109,13 +105,11 @@ public: class FLAXENGINE_API LateUpdateTickData : public TickData { public: - LateUpdateTickData(); void TickScripts(const Array& scripts) override; }; public: - /// /// Adds the script to scene ticking system. /// @@ -134,7 +128,6 @@ public: void Clear(); public: - /// /// The fixed update tick function. /// diff --git a/Source/Engine/Level/SceneInfo.h b/Source/Engine/Level/SceneInfo.h index f475349ec..a0c802e02 100644 --- a/Source/Engine/Level/SceneInfo.h +++ b/Source/Engine/Level/SceneInfo.h @@ -14,7 +14,6 @@ class SceneInfo : public Object, public ISerializable { public: - /// /// Scene title /// @@ -31,7 +30,6 @@ public: String Copyright; public: - /// /// Array with cached lightmaps ID for the scene /// @@ -43,7 +41,6 @@ public: LightmapSettings LightmapSettings; public: - // [Object] String ToString() const override; diff --git a/Source/Engine/Level/SceneObject.h b/Source/Engine/Level/SceneObject.h index 94d13d2c7..a69eaada2 100644 --- a/Source/Engine/Level/SceneObject.h +++ b/Source/Engine/Level/SceneObject.h @@ -24,7 +24,6 @@ class Level; class SceneBeginData { public: - /// /// The joints to create after setup. /// @@ -57,7 +56,7 @@ typedef Dictionary ActorsLookup; /// API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API SceneObject : public ScriptingObject, public ISerializable { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(SceneObject); friend PrefabInstanceData; friend Actor; friend Level; @@ -78,7 +77,6 @@ public: // - Destroy protected: - Actor* _parent; Guid _prefabID; Guid _prefabObjectID; @@ -90,14 +88,12 @@ protected: SceneObject(const SpawnParams& params); public: - /// /// Finalizes an instance of the class. /// ~SceneObject(); public: - /// /// Determines whether object is during play (spawned/loaded and fully initialized). /// @@ -162,7 +158,6 @@ public: API_PROPERTY() virtual void SetOrderInParent(int32 index) = 0; public: - /// /// Gets a value indicating whether this object has a valid linkage to the prefab asset. /// @@ -211,7 +206,6 @@ public: API_FUNCTION() String GetNamePath(Char separatorChar = '/') const; public: - /// /// Called after whole scene or local group of scene objects deserialization. /// @@ -234,7 +228,6 @@ public: virtual void EndPlay() = 0; public: - // [ISerializable] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; diff --git a/Source/Engine/Level/SceneObjectsFactory.h b/Source/Engine/Level/SceneObjectsFactory.h index 832e0a954..9ba75fc75 100644 --- a/Source/Engine/Level/SceneObjectsFactory.h +++ b/Source/Engine/Level/SceneObjectsFactory.h @@ -11,7 +11,6 @@ class FLAXENGINE_API SceneObjectsFactory { public: - struct PrefabInstance { Guid RootId; @@ -60,7 +59,6 @@ public: static Actor* CreateActor(int32 typeId, const Guid& id); public: - struct PrefabSyncData { friend SceneObjectsFactory; @@ -117,6 +115,5 @@ public: static void SynchronizePrefabInstances(Context& context, PrefabSyncData& data); private: - static void SynchronizeNewPrefabInstance(Context& context, PrefabSyncData& data, Prefab* prefab, Actor* actor, const Guid& prefabObjectId); }; diff --git a/Source/Engine/Level/SceneQuery.cpp b/Source/Engine/Level/SceneQuery.cpp index 5ceef6d72..e2037d718 100644 --- a/Source/Engine/Level/SceneQuery.cpp +++ b/Source/Engine/Level/SceneQuery.cpp @@ -9,7 +9,7 @@ Actor* SceneQuery::RaycastScene(const Ray& ray) PROFILE_CPU(); #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif Actor* target; @@ -94,7 +94,7 @@ void SceneQuery::GetAllActors(Array& actors) PROFILE_CPU(); #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif for (int32 i = 0; i < Level::Scenes.Count(); i++) diff --git a/Source/Engine/Level/SceneQuery.h b/Source/Engine/Level/SceneQuery.h index 5374363a1..b04ee8fc9 100644 --- a/Source/Engine/Level/SceneQuery.h +++ b/Source/Engine/Level/SceneQuery.h @@ -17,7 +17,6 @@ class FLAXENGINE_API SceneQuery { public: - /// /// Try to find actor hit by the given ray /// @@ -26,7 +25,6 @@ public: static Actor* RaycastScene(const Ray& ray); public: - /// /// Gets all scene objects from the actor into linear list. Appends them (without the given actor). /// @@ -55,7 +53,6 @@ public: static void GetAllActors(Array& actors); public: - /// /// Execute custom action on actors tree. /// Action should returns false to stop calling deeper. @@ -67,7 +64,7 @@ public: static void TreeExecute(Function& action, Params ... args) { #if SCENE_QUERIES_WITH_LOCK - ScopeLock lock(Level::ScenesLock); + ScopeLock lock(Level::ScenesLock); #endif for (int32 i = 0; i < Level::Scenes.Count(); i++) diff --git a/Source/Engine/Localization/CultureInfo.h b/Source/Engine/Localization/CultureInfo.h index 6151b406c..1ead5d876 100644 --- a/Source/Engine/Localization/CultureInfo.h +++ b/Source/Engine/Localization/CultureInfo.h @@ -10,7 +10,7 @@ /// API_CLASS(InBuild, Namespace="System.Globalization") class FLAXENGINE_API CultureInfo { -DECLARE_SCRIPTING_TYPE_MINIMAL(CultureInfo); + DECLARE_SCRIPTING_TYPE_MINIMAL(CultureInfo); private: void* _data; int32 _lcid; diff --git a/Source/Engine/Localization/LocalizedString.h b/Source/Engine/Localization/LocalizedString.h index 89e32c443..1af61283a 100644 --- a/Source/Engine/Localization/LocalizedString.h +++ b/Source/Engine/Localization/LocalizedString.h @@ -10,7 +10,7 @@ /// API_CLASS(Sealed) class FLAXENGINE_API LocalizedString { -DECLARE_SCRIPTING_TYPE_MINIMAL(LocalizedString); + DECLARE_SCRIPTING_TYPE_MINIMAL(LocalizedString); public: /// /// The localized string identifier. Used to lookup text value for a current language (via ). diff --git a/Source/Engine/Navigation/NavLink.h b/Source/Engine/Navigation/NavLink.h index 1b450342e..50a6cc39e 100644 --- a/Source/Engine/Navigation/NavLink.h +++ b/Source/Engine/Navigation/NavLink.h @@ -10,9 +10,8 @@ /// API_CLASS() class FLAXENGINE_API NavLink : public Actor { -DECLARE_SCENE_OBJECT(NavLink); + DECLARE_SCENE_OBJECT(NavLink); public: - /// /// The start location which transform is representing link start position. It is defined in local-space of the actor. /// @@ -38,11 +37,9 @@ public: bool BiDirectional; private: - void UpdateBounds(); public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -51,7 +48,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnTransformChanged() override; }; diff --git a/Source/Engine/Navigation/NavMesh.h b/Source/Engine/Navigation/NavMesh.h index 6f5052b89..85e6dd087 100644 --- a/Source/Engine/Navigation/NavMesh.h +++ b/Source/Engine/Navigation/NavMesh.h @@ -16,9 +16,8 @@ class NavMeshRuntime; /// API_CLASS() class FLAXENGINE_API NavMesh : public Actor { -DECLARE_SCENE_OBJECT(NavMesh); + DECLARE_SCENE_OBJECT(NavMesh); public: - /// /// The flag used to mark that navigation data has been modified since load. Used to save runtime data to the file on scene serialization. /// @@ -49,7 +48,6 @@ public: API_FIELD(Attributes="EditorOrder(10), EditorDisplay(\"Nav Mesh\")") NavMeshProperties Properties; public: - /// /// Saves the nav mesh tiles data to the asset. Supported only in builds with assets saving enabled (eg. editor) and not during gameplay (eg. design time). /// @@ -66,19 +64,16 @@ public: NavMeshRuntime* GetRuntime(bool createIfMissing = true) const; private: - void AddTiles(); void RemoveTiles(); void OnDataAssetLoaded(); public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Navigation/NavMeshBoundsVolume.h b/Source/Engine/Navigation/NavMeshBoundsVolume.h index 4ce58b959..51f2e80eb 100644 --- a/Source/Engine/Navigation/NavMeshBoundsVolume.h +++ b/Source/Engine/Navigation/NavMeshBoundsVolume.h @@ -10,9 +10,8 @@ /// API_CLASS() class FLAXENGINE_API NavMeshBoundsVolume : public BoxVolume { -DECLARE_SCENE_OBJECT(NavMeshBoundsVolume); + DECLARE_SCENE_OBJECT(NavMeshBoundsVolume); public: - /// /// The agent types used by this navmesh bounds volume (from navigation settings). Can be used to generate navmesh for a certain set of agents. /// @@ -20,13 +19,11 @@ public: NavAgentMask AgentsMask; public: - // [BoxVolume] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [BoxVolume] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Navigation/NavMeshBuilder.h b/Source/Engine/Navigation/NavMeshBuilder.h index 12b3ec098..42c9efc36 100644 --- a/Source/Engine/Navigation/NavMeshBuilder.h +++ b/Source/Engine/Navigation/NavMeshBuilder.h @@ -14,7 +14,6 @@ class Scene; class FLAXENGINE_API NavMeshBuilder { public: - static void Init(); static bool IsBuildingNavMesh(); static float GetNavMeshBuildingProgress(); diff --git a/Source/Engine/Navigation/NavMeshData.h b/Source/Engine/Navigation/NavMeshData.h index fb6b88849..a56e3a569 100644 --- a/Source/Engine/Navigation/NavMeshData.h +++ b/Source/Engine/Navigation/NavMeshData.h @@ -33,7 +33,6 @@ struct NavMeshDataHeader class NavMeshData { public: - /// /// The size of the navmesh tile (in world units). /// @@ -45,7 +44,6 @@ public: Array Tiles; public: - /// /// Saves the navmesh tiles to the specified stream. /// diff --git a/Source/Engine/Navigation/NavMeshRuntime.h b/Source/Engine/Navigation/NavMeshRuntime.h index b9e08f63e..98fc2e326 100644 --- a/Source/Engine/Navigation/NavMeshRuntime.h +++ b/Source/Engine/Navigation/NavMeshRuntime.h @@ -17,7 +17,6 @@ class NavMesh; class FLAXENGINE_API NavMeshTile { public: - int32 X; int32 Y; int32 Layer; @@ -31,7 +30,6 @@ public: class FLAXENGINE_API NavMeshRuntime { public: - // Gets the navigation mesh runtime for a given navmesh name. Return null if missing. static NavMeshRuntime* Get(const StringView& navMeshName); @@ -48,19 +46,16 @@ public: #endif private: - dtNavMesh* _navMesh; dtNavMeshQuery* _navMeshQuery; float _tileSize; Array _tiles; public: - NavMeshRuntime(const NavMeshProperties& properties); ~NavMeshRuntime(); public: - /// /// The object locker. /// @@ -92,7 +87,6 @@ public: int32 GetTilesCapacity() const; public: - /// /// Finds the distance from the specified start position to the nearest polygon wall. /// @@ -153,7 +147,6 @@ public: bool RayCast(const Vector3& startPosition, const Vector3& endPosition, NavMeshHit& hitInfo) const; public: - /// /// Sets the size of the tile (if not assigned). Disposes the mesh if added tiles have different size. /// @@ -210,6 +203,5 @@ public: void Dispose(); private: - void AddTileInternal(NavMesh* navMesh, NavMeshTileData& tileData); }; diff --git a/Source/Engine/Navigation/NavModifierVolume.h b/Source/Engine/Navigation/NavModifierVolume.h index dbd8818fc..f06149872 100644 --- a/Source/Engine/Navigation/NavModifierVolume.h +++ b/Source/Engine/Navigation/NavModifierVolume.h @@ -10,9 +10,8 @@ /// API_CLASS() class FLAXENGINE_API NavModifierVolume : public BoxVolume { -DECLARE_SCENE_OBJECT(NavModifierVolume); + DECLARE_SCENE_OBJECT(NavModifierVolume); public: - /// /// The agent types used by this navmesh modifier volume (from navigation settings). Can be used to adjust navmesh for a certain set of agents. /// @@ -26,20 +25,17 @@ public: String AreaName; public: - /// /// Gets the properties of the nav area used by this volume. Null if missing or invalid area name. /// NavAreaProperties* GetNavArea() const; public: - // [BoxVolume] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [BoxVolume] void OnBoundsChanged(const BoundingBox& prevBounds) override; #if USE_EDITOR diff --git a/Source/Engine/Navigation/Navigation.cpp b/Source/Engine/Navigation/Navigation.cpp index c77617670..1c3863374 100644 --- a/Source/Engine/Navigation/Navigation.cpp +++ b/Source/Engine/Navigation/Navigation.cpp @@ -152,7 +152,6 @@ bool NavMeshProperties::operator==(const NavMeshProperties& other) const class NavigationService : public EngineService { public: - NavigationService() : EngineService(TEXT("Navigation"), 60) { diff --git a/Source/Engine/Navigation/Navigation.h b/Source/Engine/Navigation/Navigation.h index 20f40e785..f68614aae 100644 --- a/Source/Engine/Navigation/Navigation.h +++ b/Source/Engine/Navigation/Navigation.h @@ -11,9 +11,8 @@ class Scene; /// API_CLASS(Static) class FLAXENGINE_API Navigation { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Navigation); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Navigation); public: - /// /// Finds the distance from the specified start position to the nearest polygon wall. /// @@ -74,7 +73,6 @@ public: API_FUNCTION() static bool RayCast(const Vector3& startPosition, const Vector3& endPosition, API_PARAM(Out) NavMeshHit& hitInfo); public: - #if COMPILE_WITH_NAV_MESH_BUILDER /// diff --git a/Source/Engine/Navigation/NavigationSettings.h b/Source/Engine/Navigation/NavigationSettings.h index de0d6ba66..bd884318e 100644 --- a/Source/Engine/Navigation/NavigationSettings.h +++ b/Source/Engine/Navigation/NavigationSettings.h @@ -11,9 +11,8 @@ /// API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings", NoConstructor) class FLAXENGINE_API NavigationSettings : public SettingsBase { -DECLARE_SCRIPTING_TYPE_MINIMAL(NavigationSettings); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavigationSettings); public: - /// /// If checked, enables automatic navmesh actors spawning on a scenes that are using it during navigation building. /// @@ -27,7 +26,6 @@ public: bool AutoRemoveMissingNavMeshes = true; public: - /// /// The height of a grid cell in the navigation mesh building steps using heightfields. A lower number means higher precision on the vertical axis but longer build times. /// @@ -83,7 +81,6 @@ public: float MaxDetailSamplingError = 1.0f; public: - /// /// The configuration for navmeshes. /// @@ -97,7 +94,6 @@ public: Array NavAreas; public: - NavigationSettings(); /// diff --git a/Source/Engine/Navigation/NavigationTypes.h b/Source/Engine/Navigation/NavigationTypes.h index 4997064dc..5cf8689ec 100644 --- a/Source/Engine/Navigation/NavigationTypes.h +++ b/Source/Engine/Navigation/NavigationTypes.h @@ -16,8 +16,8 @@ /// API_STRUCT() struct FLAXENGINE_API NavAgentProperties : ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentProperties); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentProperties); /// /// The radius of the agent used for navigation. Agents can't pass through gaps of less than twice the radius. @@ -56,8 +56,8 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentProperties); /// API_STRUCT() struct FLAXENGINE_API NavMeshProperties : ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshProperties); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshProperties); /// /// The navmesh type name. Identifies different types of the navmeshes, used to sync navmesh properties with settings asset. @@ -102,7 +102,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshProperties); /// API_STRUCT() struct FLAXENGINE_API NavAgentMask { -DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentMask); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentMask); /// /// The agents selection mask. @@ -126,7 +126,7 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(NavAgentMask); /// API_STRUCT() struct FLAXENGINE_API NavMeshHit { -DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshHit); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshHit); /// /// The hit point position. @@ -149,8 +149,8 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(NavMeshHit); /// API_STRUCT() struct FLAXENGINE_API NavAreaProperties : ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(NavAreaProperties); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(NavAreaProperties); /// /// The area type name. Identifies different types of the areas. diff --git a/Source/Engine/Networking/Drivers/ENetDriver.cpp b/Source/Engine/Networking/Drivers/ENetDriver.cpp index 0126dfd2a..517584eed 100644 --- a/Source/Engine/Networking/Drivers/ENetDriver.cpp +++ b/Source/Engine/Networking/Drivers/ENetDriver.cpp @@ -205,7 +205,7 @@ bool ENetDriver::PopEvent(NetworkEvent* eventPtr) case ENET_EVENT_TYPE_RECEIVE: eventPtr->EventType = NetworkEventType::Message; - // Acquire message and copy message data + // Acquire message and copy message data eventPtr->Message = _networkHost->CreateMessage(); eventPtr->Message.Length = event.packet->dataLength; Memory::CopyItems(eventPtr->Message.Buffer, event.packet->data, event.packet->dataLength); diff --git a/Source/Engine/Networking/Drivers/ENetDriver.h b/Source/Engine/Networking/Drivers/ENetDriver.h index 37d848ac5..a58b49bca 100644 --- a/Source/Engine/Networking/Drivers/ENetDriver.h +++ b/Source/Engine/Networking/Drivers/ENetDriver.h @@ -15,11 +15,14 @@ /// API_CLASS(Namespace="FlaxEngine.Networking", Sealed) class FLAXENGINE_API ENetDriver : public ScriptingObject, public INetworkDriver { -DECLARE_SCRIPTING_TYPE(ENetDriver); + DECLARE_SCRIPTING_TYPE(ENetDriver); public: - // [INetworkDriver] - String DriverName() override { return String("ENetDriver"); } + String DriverName() override + { + return String("ENetDriver"); + } + bool Initialize(NetworkPeer* host, const NetworkConfig& config) override; void Dispose() override; bool Listen() override; @@ -32,14 +35,12 @@ public: void SendMessage(NetworkChannelType channelType, const NetworkMessage& message, const Array& targets) override; private: - bool IsServer() const { return _host != nullptr && _peer == nullptr; } private: - NetworkConfig _config; NetworkPeer* _networkHost; void* _host = nullptr; diff --git a/Source/Engine/Networking/INetworkDriver.h b/Source/Engine/Networking/INetworkDriver.h index 7aaecf50a..71d7aee0e 100644 --- a/Source/Engine/Networking/INetworkDriver.h +++ b/Source/Engine/Networking/INetworkDriver.h @@ -11,9 +11,8 @@ /// API_INTERFACE(Namespace="FlaxEngine.Networking") class FLAXENGINE_API INetworkDriver { -DECLARE_SCRIPTING_TYPE_MINIMAL(INetworkDriver); + DECLARE_SCRIPTING_TYPE_MINIMAL(INetworkDriver); public: - /// /// Finalizes an instance of the class. /// @@ -26,7 +25,7 @@ public: { return String("Unknown"); } - + /// /// Initializes the instance of this network driver using given configuration. /// @@ -84,7 +83,7 @@ public: /// Do not recycle the message after calling this. /// This function automatically recycles the message. /// - API_FUNCTION() virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message) = 0; + API_FUNCTION() virtual void SendMessage(NetworkChannelType channelType, const NetworkMessage& message) = 0; /// /// Sends given message over specified channel to the given client connection (target). diff --git a/Source/Engine/Networking/NetworkConfig.h b/Source/Engine/Networking/NetworkConfig.h index be65b1add..84a688229 100644 --- a/Source/Engine/Networking/NetworkConfig.h +++ b/Source/Engine/Networking/NetworkConfig.h @@ -28,7 +28,7 @@ API_ENUM(Namespace="FlaxEngine.Networking") enum class DEPRECATED NetworkDriverT /// API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkConfig { -DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkConfig); + DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkConfig); /// /// The network driver that will be used to create the peer. diff --git a/Source/Engine/Networking/NetworkConnection.h b/Source/Engine/Networking/NetworkConnection.h index 169d88135..1eb2b634d 100644 --- a/Source/Engine/Networking/NetworkConnection.h +++ b/Source/Engine/Networking/NetworkConnection.h @@ -9,7 +9,7 @@ /// API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkConnection { -DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkConnection); + DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkConnection); public: /// /// The identifier of the connection. diff --git a/Source/Engine/Networking/NetworkEvent.h b/Source/Engine/Networking/NetworkEvent.h index cba98ec42..63f637ad7 100644 --- a/Source/Engine/Networking/NetworkEvent.h +++ b/Source/Engine/Networking/NetworkEvent.h @@ -42,7 +42,7 @@ API_ENUM(Namespace="FlaxEngine.Networking") enum class NetworkEventType /// API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkEvent { -DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkEvent); + DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkEvent); public: /// /// The type of the received event. diff --git a/Source/Engine/Networking/NetworkMessage.h b/Source/Engine/Networking/NetworkMessage.h index 6f9202a69..f83f9b828 100644 --- a/Source/Engine/Networking/NetworkMessage.h +++ b/Source/Engine/Networking/NetworkMessage.h @@ -14,9 +14,8 @@ /// API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkMessage { -DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkMessage); + DECLARE_SCRIPTING_TYPE_MINIMAL(NetworkMessage); public: - /// /// The raw message buffer. /// @@ -43,7 +42,6 @@ public: API_FIELD() uint32 Position = 0; public: - /// /// Initializes default values of the structure. /// @@ -53,13 +51,17 @@ public: /// Initializes values of the structure. /// NetworkMessage(uint8* buffer, uint32 messageId, uint32 bufferSize, uint32 length, uint32 position) - : Buffer(buffer), MessageId(messageId), BufferSize(bufferSize), Length(length), Position(position) - { } + : Buffer(buffer) + , MessageId(messageId) + , BufferSize(bufferSize) + , Length(length) + , Position(position) + { + } ~NetworkMessage() = default; - -public: +public: /// /// Writes raw bytes into the message. /// @@ -119,7 +121,7 @@ public: { return Vector2(ReadSingle(), ReadSingle()); } - + /// /// Writes data of type Vector3 into the message. /// @@ -156,7 +158,7 @@ public: { return Vector4(ReadSingle(), ReadSingle(), ReadSingle(), ReadSingle()); } - + /// /// Writes data of type Quaternion into the message. /// @@ -196,7 +198,7 @@ public: ReadBytes((uint8*)value.Get(), length * sizeof(Char)); return value; } - + /// /// Writes data of type Guid into the message. /// @@ -216,7 +218,6 @@ public: } public: - /// /// Returns true if the message is valid for reading or writing. /// diff --git a/Source/Engine/Networking/NetworkPeer.h b/Source/Engine/Networking/NetworkPeer.h index b42e42b5a..3cc6f6d8b 100644 --- a/Source/Engine/Networking/NetworkPeer.h +++ b/Source/Engine/Networking/NetworkPeer.h @@ -13,10 +13,9 @@ /// API_CLASS(sealed, NoSpawn, Namespace = "FlaxEngine.Networking") class FLAXENGINE_API NetworkPeer final : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(NetworkPeer); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(NetworkPeer); friend class NetworkManager; public: - int HostId = -1; NetworkConfig Config; INetworkDriver* NetworkDriver = nullptr; @@ -25,7 +24,6 @@ public: Array MessagePool; public: - /// /// Initializes a new instance of the class. /// @@ -35,7 +33,6 @@ public: } public: - /// /// Starts listening for incoming connections. /// Once this is called, this peer becomes a server. @@ -163,7 +160,6 @@ public: static void ShutdownPeer(NetworkPeer* peer); public: - bool IsValid() const { return NetworkDriver != nullptr && HostId >= 0; @@ -176,7 +172,6 @@ public: } public: - FORCE_INLINE bool operator==(const NetworkPeer& other) const { return HostId == other.HostId; @@ -188,7 +183,6 @@ public: } private: - bool Initialize(const NetworkConfig& config); void Shutdown(); void CreateMessageBuffers(); diff --git a/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.h b/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.h index 5ffb4ea07..b1738ea49 100644 --- a/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.h +++ b/Source/Engine/Particles/Graph/CPU/ParticleEmitterGraph.CPU.h @@ -37,7 +37,6 @@ class ParticleEmitterGraphCPUBox : public VisjectGraphBox class ParticleEmitterGraphCPUNode : public ParticleEmitterGraphNode> { public: - /// /// The sorted indices buffer offset used by the rendering modules to point the sorted indices buffer start to use for rendering. /// @@ -66,7 +65,6 @@ class ParticleEmitterGraphCPU : public ParticleEmitterGraph, ParticleEmitterGraphCPUNode, Variant> Base; private: - struct NodeState { union @@ -74,10 +72,10 @@ private: int32 SpiralProgress; }; }; + Array _defaultParticleData; public: - // Size of the custom pre-node data buffer used for state tracking (eg. position on spiral arc progression). int32 CustomDataSize = 0; @@ -103,7 +101,6 @@ public: } public: - // [ParticleEmitterGraph] bool Load(ReadStream* stream, bool loadMeta) override; void InitializeNode(Node* node) override; @@ -138,7 +135,6 @@ private: static ThreadLocal Context; public: - /// /// Initializes a new instance of the class. /// @@ -186,7 +182,6 @@ public: int32 UpdateSpawn(ParticleEmitter* emitter, ParticleEffect* effect, ParticleEmitterInstance& data, float dt); private: - void Init(ParticleEmitter* emitter, ParticleEffect* effect, ParticleEmitterInstance& data, float dt = 0.0f); Value eatBox(Node* caller, Box* box) override; Graph* GetCurrentGraph() const override; diff --git a/Source/Engine/Particles/Graph/GPU/GPUParticles.h b/Source/Engine/Particles/Graph/GPU/GPUParticles.h index 8ff6ec56d..6d81d6d88 100644 --- a/Source/Engine/Particles/Graph/GPU/GPUParticles.h +++ b/Source/Engine/Particles/Graph/GPU/GPUParticles.h @@ -23,14 +23,12 @@ class GPUShaderProgramCS; class GPUParticles { private: - GPUShader* _shader = nullptr; GPUShaderProgramCS* _mainCS = nullptr; Array _cbData; MaterialParams _params; public: - /// /// The custom data size (in bytes) required by the nodes to store the additional global state for the simulation in the particles buffer on a GPU. /// diff --git a/Source/Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h b/Source/Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h index 988883965..5f220915e 100644 --- a/Source/Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h +++ b/Source/Engine/Particles/Graph/GPU/ParticleEmitterGraph.GPU.h @@ -18,7 +18,6 @@ typedef ShaderGraphBox ParticleEmitterGraphGPUBox; class ParticleEmitterGraphGPUNode : public ParticleEmitterGraphNode> { public: - ParticleEmitterGraphGPUNode() : ParticleEmitterGraphNode>() { @@ -37,7 +36,6 @@ public: class ParticleEmitterGraphGPU : public ParticleEmitterGraph, ParticleEmitterGraphGPUNode, ShaderGraphValue> { public: - /// /// Clears all the cached values. /// @@ -56,7 +54,6 @@ public: class ParticleEmitterGPUGenerator : public ShaderGenerator { private: - enum class ParticleContextType { Initialize, @@ -84,7 +81,6 @@ private: Array> _graphs; public: - /// /// Initializes a new instance of the class. /// @@ -120,7 +116,6 @@ public: bool Generate(WriteStream& source, BytesContainer& parametersData, int32& customDataSize); private: - void clearCache(); void ProcessModule(Node* node); diff --git a/Source/Engine/Particles/Graph/ParticleEmitterGraph.h b/Source/Engine/Particles/Graph/ParticleEmitterGraph.h index a1cc06cb9..1cbd226b8 100644 --- a/Source/Engine/Particles/Graph/ParticleEmitterGraph.h +++ b/Source/Engine/Particles/Graph/ParticleEmitterGraph.h @@ -27,7 +27,6 @@ template class ParticleEmitterGraphNode : public Base { public: - /// /// True if node is used by the particles graph (is connected to the any module input or its a enabled module). /// @@ -56,7 +55,6 @@ template class ParticleEmitterGraph : public BaseType { public: - typedef ValueType Value; enum class ModuleType @@ -68,7 +66,6 @@ public: }; protected: - // Attributes cache int32 _attrPosition; int32 _attrVelocity; @@ -84,7 +81,6 @@ protected: int32 _attrRadius; public: - /// /// The Particle Emitter Graph data version number. Used to sync the Particle Emitter Graph data with the instances state. Handles graph reloads to ensure data is valid. /// @@ -116,7 +112,6 @@ public: Array> AttributesDefaults; public: - /// /// The particles modules for Spawn context. /// @@ -175,18 +170,18 @@ public: switch (node->Type) { - // == Tools == + // == Tools == - // Get Gameplay Global + // Get Gameplay Global case GRAPH_NODE_MAKE_TYPE(7, 16): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[0]); break; } - // === Particles === + // === Particles === - // Particle Attribute + // Particle Attribute case GRAPH_NODE_MAKE_TYPE(14, 100): case GRAPH_NODE_MAKE_TYPE(14, 303): { @@ -201,7 +196,7 @@ public: static_assert(PARTICLE_EMITTER_MAX_ATTRIBUTES_REFS_PER_NODE >= 2, "Invalid node attributes count. Need more space for some data here."); break; } - // Particle Position + // Particle Position case GRAPH_NODE_MAKE_TYPE(14, 101): case GRAPH_NODE_MAKE_TYPE(14, 212): { @@ -209,62 +204,62 @@ public: USE_ATTRIBUTE(Position, Float3, 0); break; } - // Particle Lifetime + // Particle Lifetime case GRAPH_NODE_MAKE_TYPE(14, 102): { node->UsesParticleData = true; USE_ATTRIBUTE(Lifetime, Float, 0); break; } - // Particle Age + // Particle Age case GRAPH_NODE_MAKE_TYPE(14, 103): { node->UsesParticleData = true; USE_ATTRIBUTE(Age, Float, 0); break; } - // Particle Color + // Particle Color case GRAPH_NODE_MAKE_TYPE(14, 104): { node->UsesParticleData = true; USE_ATTRIBUTE(Color, Float4, 0); break; } - // Particle Velocity + // Particle Velocity case GRAPH_NODE_MAKE_TYPE(14, 105): { node->UsesParticleData = true; USE_ATTRIBUTE(Velocity, Float3, 0); break; } - // Particle Sprite Size + // Particle Sprite Size case GRAPH_NODE_MAKE_TYPE(14, 106): { node->UsesParticleData = true; USE_ATTRIBUTE(SpriteSize, Float2, 0); break; } - // Particle Mass + // Particle Mass case GRAPH_NODE_MAKE_TYPE(14, 107): { node->UsesParticleData = true; USE_ATTRIBUTE(Mass, Float, 0); break; } - // Particle Rotation + // Particle Rotation case GRAPH_NODE_MAKE_TYPE(14, 108): { node->UsesParticleData = true; USE_ATTRIBUTE(Rotation, Float3, 0); break; } - // Particle Angular Velocity + // Particle Angular Velocity case GRAPH_NODE_MAKE_TYPE(14, 109): { USE_ATTRIBUTE(AngularVelocity, Float3, 0); break; } - // Particle Normalized Age + // Particle Normalized Age case GRAPH_NODE_MAKE_TYPE(14, 110): { node->UsesParticleData = true; @@ -272,14 +267,14 @@ public: USE_ATTRIBUTE(Lifetime, Float, 1); break; } - // Particle Mass + // Particle Mass case GRAPH_NODE_MAKE_TYPE(14, 111): { node->UsesParticleData = true; USE_ATTRIBUTE(Radius, Float, 0); break; } - // Random + // Random case GRAPH_NODE_MAKE_TYPE(14, 208): case GRAPH_NODE_MAKE_TYPE(14, 209): case GRAPH_NODE_MAKE_TYPE(14, 210): @@ -292,19 +287,19 @@ public: node->IsConstant = false; break; } - // Particle Emitter Function + // Particle Emitter Function case GRAPH_NODE_MAKE_TYPE(14, 300): node->Assets[0] = Content::LoadAsync((Guid)node->Values[0]); node->UsesParticleData = true; // TODO: analyze emitter function graph to detect if it's actually using any particle data at all (even from inputs after inline) break; - // Particle Index + // Particle Index case GRAPH_NODE_MAKE_TYPE(14, 301): node->UsesParticleData = true; break; - // === Particle Modules === + // === Particle Modules === - // Orient Sprite + // Orient Sprite case GRAPH_NODE_MAKE_TYPE(15, 201): case GRAPH_NODE_MAKE_TYPE(15, 303): { @@ -316,27 +311,27 @@ public: } break; } - // Orient Model + // Orient Model case GRAPH_NODE_MAKE_TYPE(15, 213): case GRAPH_NODE_MAKE_TYPE(15, 309): { USE_ATTRIBUTE(ModelFacingMode, Int, 0); break; } - // Update Age + // Update Age case GRAPH_NODE_MAKE_TYPE(15, 300): { USE_ATTRIBUTE(Age, Float, 0); break; } - // Gravity/Force + // Gravity/Force case GRAPH_NODE_MAKE_TYPE(15, 301): case GRAPH_NODE_MAKE_TYPE(15, 304): { USE_ATTRIBUTE(Velocity, Float3, 0); break; } - // Linear Drag + // Linear Drag case GRAPH_NODE_MAKE_TYPE(15, 310): { USE_ATTRIBUTE(Velocity, Float3, 0); @@ -347,7 +342,7 @@ public: } break; } - // Turbulence + // Turbulence case GRAPH_NODE_MAKE_TYPE(15, 311): { USE_ATTRIBUTE(Position, Float3, 0); @@ -355,7 +350,7 @@ public: USE_ATTRIBUTE(Mass, Float, 2); break; } - // Position (plane/box surface/box volume/cylinder/line/sphere/circle/disc/torus/Global SDF) + // Position (plane/box surface/box volume/cylinder/line/sphere/circle/disc/torus/Global SDF) case GRAPH_NODE_MAKE_TYPE(15, 202): case GRAPH_NODE_MAKE_TYPE(15, 203): case GRAPH_NODE_MAKE_TYPE(15, 204): @@ -371,21 +366,21 @@ public: USE_ATTRIBUTE(Position, Float3, 0); break; } - // Position (depth) + // Position (depth) case GRAPH_NODE_MAKE_TYPE(15, 212): { USE_ATTRIBUTE(Position, Float3, 0); USE_ATTRIBUTE(Lifetime, Float, 1); break; } - // Position (spiral) + // Position (spiral) case GRAPH_NODE_MAKE_TYPE(15, 214): { USE_ATTRIBUTE(Position, Float3, 0); USE_ATTRIBUTE(Velocity, Float3, 1); break; } - // Set Attribute + // Set Attribute case GRAPH_NODE_MAKE_TYPE(15, 200): case GRAPH_NODE_MAKE_TYPE(15, 302): { @@ -397,7 +392,7 @@ public: node->Attributes[0] = idx; break; } - // Set Position/Lifetime/Age/.. + // Set Position/Lifetime/Age/.. #define CASE_SET_PARTICLE_ATTRIBUTE(id0, id1, name, type) case GRAPH_NODE_MAKE_TYPE(15, id0): case GRAPH_NODE_MAKE_TYPE(15, id1): USE_ATTRIBUTE(name, type, 0); break CASE_SET_PARTICLE_ATTRIBUTE(250, 350, Position, Float3); CASE_SET_PARTICLE_ATTRIBUTE(251, 351, Lifetime, Float); @@ -414,7 +409,7 @@ public: CASE_SET_PARTICLE_ATTRIBUTE(262, 362, RibbonFacingVector, Float3); CASE_SET_PARTICLE_ATTRIBUTE(263, 363, Radius, Float); #undef CASE_SET_PARTICLE_ATTRIBUTE - // Conform to Sphere + // Conform to Sphere case GRAPH_NODE_MAKE_TYPE(15, 305): case GRAPH_NODE_MAKE_TYPE(15, 335): // Conform to Global SDF { @@ -423,14 +418,14 @@ public: USE_ATTRIBUTE(Mass, Float, 2); break; } - // Kill (sphere/box) + // Kill (sphere/box) case GRAPH_NODE_MAKE_TYPE(15, 306): case GRAPH_NODE_MAKE_TYPE(15, 307): { USE_ATTRIBUTE(Position, Float3, 0); break; } - // Collision (plane/sphere/box/cylinder/depth/Global SDF) + // Collision (plane/sphere/box/cylinder/depth/Global SDF) case GRAPH_NODE_MAKE_TYPE(15, 330): case GRAPH_NODE_MAKE_TYPE(15, 331): case GRAPH_NODE_MAKE_TYPE(15, 332): @@ -443,7 +438,7 @@ public: USE_ATTRIBUTE(Age, Float, 2); break; } - // Sprite Rendering + // Sprite Rendering case GRAPH_NODE_MAKE_TYPE(15, 400): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -452,7 +447,7 @@ public: USE_ATTRIBUTE(SpriteSize, Float2, 2); break; } - // Sort + // Sort case GRAPH_NODE_MAKE_TYPE(15, 402): { const auto sortMode = static_cast(node->Values[2].AsInt); @@ -480,7 +475,7 @@ public: } break; } - // Model Rendering + // Model Rendering case GRAPH_NODE_MAKE_TYPE(15, 403): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -490,7 +485,7 @@ public: USE_ATTRIBUTE(Scale, Float3, 2); break; } - // Ribbon Rendering + // Ribbon Rendering case GRAPH_NODE_MAKE_TYPE(15, 404): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -499,7 +494,7 @@ public: USE_ATTRIBUTE(Age, Float, 1); break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case GRAPH_NODE_MAKE_TYPE(15, 405): { node->Assets[0] = Content::LoadAsync((Guid)node->Values[2]); @@ -531,7 +526,6 @@ public: } public: - // [Graph] void Clear() override { @@ -623,7 +617,7 @@ public: ASSERT(!Root); Root = n; } - // Particle Modules (only if module is enabled) + // Particle Modules (only if module is enabled) else if (n->GroupID == 15 && n->Values[0].AsBool) { const auto moduleType = static_cast(n->Values[1].AsInt); diff --git a/Source/Engine/Particles/ParticleEffect.h b/Source/Engine/Particles/ParticleEffect.h index c91c22e16..aea57360c 100644 --- a/Source/Engine/Particles/ParticleEffect.h +++ b/Source/Engine/Particles/ParticleEffect.h @@ -14,10 +14,9 @@ /// API_CLASS(NoSpawn) class ParticleEffectParameter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParticleEffectParameter); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParticleEffectParameter); friend ParticleEffect; private: - ParticleEffect* _effect = nullptr; int32 _emitterIndex; int32 _paramIndex; @@ -25,7 +24,6 @@ private: void Init(ParticleEffect* effect, int32 emitterIndex, int32 paramIndex); public: - /// /// Initializes a new instance of the class. /// @@ -137,9 +135,8 @@ public: /// API_CLASS() class FLAXENGINE_API ParticleEffect : public Actor { -DECLARE_SCENE_OBJECT(ParticleEffect); + DECLARE_SCENE_OBJECT(ParticleEffect); public: - /// /// The particles simulation update modes. /// @@ -161,7 +158,7 @@ public: /// API_STRUCT() struct ParameterOverride { - DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParameterOverride); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ParameterOverride); /// /// The name of the track that has overriden parameter. @@ -180,7 +177,6 @@ public: }; private: - uint64 _lastUpdateFrame; Real _lastMinDstSqr; Matrix _world; @@ -190,7 +186,6 @@ private: Array _parametersOverrides; // Cached parameter modifications to be applied to the parameters public: - /// /// The particle system to play. /// @@ -209,7 +204,6 @@ public: ScriptingObjectReference CustomViewRenderTask; public: - /// /// The particles simulation update mode. Defines how to update particles emitter. /// @@ -262,7 +256,6 @@ public: } public: - /// /// Gets the effect parameters collection. Those parameters are instanced from the that contains a linear list of emitters and every emitter has a list of own parameters. /// @@ -311,7 +304,6 @@ public: API_FUNCTION() void ResetParameters(); public: - /// /// Gets the current time position of the particle system timeline animation playback (in seconds). /// @@ -370,7 +362,6 @@ protected: #endif private: - void Update(); #if USE_EDITOR void UpdateExecuteInEditor(); @@ -381,7 +372,6 @@ private: void OnParticleSystemLoaded(); public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -400,7 +390,6 @@ public: #endif protected: - // [Actor] void EndPlay() override; void OnEnable() override; diff --git a/Source/Engine/Particles/ParticleEmitter.h b/Source/Engine/Particles/ParticleEmitter.h index fb59a39dc..57d58f2ae 100644 --- a/Source/Engine/Particles/ParticleEmitter.h +++ b/Source/Engine/Particles/ParticleEmitter.h @@ -18,9 +18,8 @@ class ParticleEmitterInstance; /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleEmitter : public ShaderAssetTypeBase { -DECLARE_BINARY_ASSET_HEADER(ParticleEmitter, ShadersSerializedVersion); + DECLARE_BINARY_ASSET_HEADER(ParticleEmitter, ShadersSerializedVersion); public: - /// /// The loaded particle graph. /// @@ -76,7 +75,6 @@ public: #endif public: - /// /// Tries to load surface graph from the asset. /// @@ -96,7 +94,6 @@ public: #endif public: - /// /// Spawns the particles at the given location. /// @@ -172,7 +169,6 @@ public: API_FUNCTION() ParticleEffect* Spawn(Actor* parent, const Transform& transform, float duration = MAX_float, bool autoDestroy = false); public: - // [BinaryAsset] #if USE_EDITOR void GetReferences(Array& output) const override @@ -185,7 +181,6 @@ public: #endif protected: - // [ParticleEmitterBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/ParticleEmitterFunction.h b/Source/Engine/Particles/ParticleEmitterFunction.h index 6b468b9f3..41df28fdf 100644 --- a/Source/Engine/Particles/ParticleEmitterFunction.h +++ b/Source/Engine/Particles/ParticleEmitterFunction.h @@ -13,9 +13,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleEmitterFunction : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(ParticleEmitterFunction, 1); + DECLARE_BINARY_ASSET_HEADER(ParticleEmitterFunction, 1); public: - /// /// The loaded CPU particle function graph. /// @@ -79,7 +78,6 @@ public: #endif protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/ParticleSystem.h b/Source/Engine/Particles/ParticleSystem.h index e69929059..68d3cfacb 100644 --- a/Source/Engine/Particles/ParticleSystem.h +++ b/Source/Engine/Particles/ParticleSystem.h @@ -12,9 +12,8 @@ /// API_CLASS(NoSpawn) class FLAXENGINE_API ParticleSystem : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(ParticleSystem, 1); + DECLARE_BINARY_ASSET_HEADER(ParticleSystem, 1); public: - /// /// The particle system timeline track data. /// @@ -100,7 +99,6 @@ public: typedef Pair EmitterParameterOverrideKey; public: - /// /// The asset data version number. Used to sync the data with the instances state. Incremented each time asset gets loaded. /// @@ -140,7 +138,6 @@ public: Array Tracks; public: - /// /// Initializes the particle system that plays a single particles emitter. This can be used only for virtual assets. /// @@ -167,7 +164,6 @@ public: #endif public: - /// /// Spawns the particles at the given location. /// @@ -237,7 +233,6 @@ public: API_FUNCTION() ParticleEffect* Spawn(Actor* parent, const Transform& transform, bool autoDestroy = false); public: - // [BinaryAsset] void InitAsVirtual() override; #if USE_EDITOR @@ -245,7 +240,6 @@ public: #endif protected: - // [ParticleSystemBase] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Particles/Particles.cpp b/Source/Engine/Particles/Particles.cpp index ed5b044e2..306adee02 100644 --- a/Source/Engine/Particles/Particles.cpp +++ b/Source/Engine/Particles/Particles.cpp @@ -38,14 +38,12 @@ struct SpriteParticleVertex class SpriteParticleRenderer { public: - GPUBuffer* VB = nullptr; GPUBuffer* IB = nullptr; const static int32 VertexCount = 4; const static int32 IndexCount = 6; public: - bool Init() { if (VB) @@ -120,7 +118,6 @@ namespace ParticlesDrawCPU class ParticleManagerService : public EngineService { public: - ParticleManagerService() : EngineService(TEXT("Particle Manager"), 65) { @@ -251,7 +248,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa } #if !BUILD_RELEASE default: - CRASH; + CRASH; #endif } @@ -406,7 +403,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -420,7 +417,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -446,7 +443,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { if (ribbonModulesDrawIndicesCount[ribbonModuleIndex] == 0) @@ -504,7 +501,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -666,7 +663,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa } #if !BUILD_RELEASE default: - CRASH; + CRASH; return; #endif } @@ -691,13 +688,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa auto module = emitter->Graph.RenderModules[moduleIndex]; switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { drawCalls++; break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -717,13 +714,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -749,7 +746,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa auto module = emitter->Graph.RenderModules[moduleIndex]; switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { GPUDrawIndexedIndirectArgs indirectArgsBufferInitData{ SpriteParticleRenderer::IndexCount, 1, 0, 0, 0 }; @@ -760,7 +757,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa indirectDrawCallIndex++; break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -784,13 +781,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -809,7 +806,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -826,7 +823,7 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -855,13 +852,13 @@ void DrawEmitterGPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { // Not supported break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { // Not supported @@ -921,7 +918,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe switch (module->TypeID) { - // Sprite Rendering + // Sprite Rendering case 400: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -935,7 +932,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Model Rendering + // Model Rendering case 403: { const auto model = (Model*)module->Assets[0].Get(); @@ -954,7 +951,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Ribbon Rendering + // Ribbon Rendering case 404: { const auto material = (MaterialBase*)module->Assets[0].Get(); @@ -968,7 +965,7 @@ void Particles::DrawParticles(RenderContext& renderContext, ParticleEffect* effe renderModulesIndices.Add(moduleIndex); break; } - // Volumetric Fog Rendering + // Volumetric Fog Rendering case 405: { const auto material = (MaterialBase*)module->Assets[0].Get(); diff --git a/Source/Engine/Particles/Particles.h b/Source/Engine/Particles/Particles.h index a0290a1ae..80dc82823 100644 --- a/Source/Engine/Particles/Particles.h +++ b/Source/Engine/Particles/Particles.h @@ -20,7 +20,7 @@ class Actor; /// API_CLASS(Static) class FLAXENGINE_API Particles { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); /// /// The system for Particles update. @@ -28,7 +28,6 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Particles); API_FIELD(ReadOnly) static TaskGraphSystem* System; public: - /// /// Updates the effect during next particles simulation tick. /// @@ -42,7 +41,6 @@ public: static void OnEffectDestroy(ParticleEffect* effect); public: - /// /// Draws the particles. /// @@ -51,7 +49,6 @@ public: static void DrawParticles(RenderContext& renderContext, ParticleEffect* effect); public: - /// /// Enables or disables particle buffer pooling. /// diff --git a/Source/Engine/Particles/ParticlesData.cpp b/Source/Engine/Particles/ParticlesData.cpp index e2a81bedf..bd836638e 100644 --- a/Source/Engine/Particles/ParticlesData.cpp +++ b/Source/Engine/Particles/ParticlesData.cpp @@ -71,7 +71,7 @@ bool ParticleBuffer::Init(ParticleEmitter* emitter) } #endif default: - CRASH; + CRASH; } return false; @@ -107,7 +107,7 @@ bool ParticleBuffer::AllocateSortBuffer() } #endif default: - CRASH; + CRASH; return true; } @@ -133,6 +133,6 @@ void ParticleBuffer::Clear() } #endif default: - CRASH; + CRASH; } } diff --git a/Source/Engine/Particles/ParticlesData.h b/Source/Engine/Particles/ParticlesData.h index df9b8bf21..328caa03c 100644 --- a/Source/Engine/Particles/ParticlesData.h +++ b/Source/Engine/Particles/ParticlesData.h @@ -78,7 +78,6 @@ struct ParticleAttribute class ParticleLayout { public: - /// /// The total particle data stride size (in bytes). Defines the required memory amount for a single particle. /// @@ -90,7 +89,6 @@ public: Array> Attributes; public: - /// /// Clears the layout data. /// @@ -217,7 +215,6 @@ public: class FLAXENGINE_API ParticleBuffer { public: - /// /// The emitter graph version (cached on Init). Used to discard pooled buffers that has been created for older emitter graph. /// @@ -331,7 +328,6 @@ public: } GPU; public: - /// /// Initializes a new instance of the class. /// @@ -384,12 +380,10 @@ public: struct ParticleBufferCPUDataAccessorBase { protected: - ParticleBuffer* _buffer; int32 _offset; public: - ParticleBufferCPUDataAccessorBase() : _buffer(nullptr) , _offset(-1) @@ -403,7 +397,6 @@ public: } public: - FORCE_INLINE bool IsValid() const { return _buffer != nullptr && _offset != -1; @@ -414,7 +407,6 @@ template struct ParticleBufferCPUDataAccessor : ParticleBufferCPUDataAccessorBase { public: - ParticleBufferCPUDataAccessor() { } @@ -425,7 +417,6 @@ public: } public: - FORCE_INLINE T operator[](int32 index) const { return Get(index); diff --git a/Source/Engine/Particles/ParticlesSimulation.h b/Source/Engine/Particles/ParticlesSimulation.h index 631a32367..d2181d5e5 100644 --- a/Source/Engine/Particles/ParticlesSimulation.h +++ b/Source/Engine/Particles/ParticlesSimulation.h @@ -18,7 +18,6 @@ class GPUBuffer; class FLAXENGINE_API ParticleSystemParameter : public GraphParameter { public: - ParticleSystemParameter() : GraphParameter(SpawnParams(Guid::New(), TypeInitializer)) { @@ -47,7 +46,6 @@ public: class FLAXENGINE_API ParticleEmitterInstance { public: - struct SpawnerData { /// @@ -62,7 +60,6 @@ public: }; public: - /// /// The instance data version number. Used to sync the Particle Emitter Graph data with the instance state. Handles Particle Emitter reloads to enure data is valid. /// @@ -107,7 +104,6 @@ public: ParticleBuffer* Buffer = nullptr; public: - /// /// Initializes a new instance of the class. /// @@ -138,7 +134,6 @@ public: class FLAXENGINE_API ParticleSystemInstance { public: - /// /// The instance data version number. Used to sync the Particle System data with the instance state. Handles Particle System reloads to enure data is valid. /// @@ -170,7 +165,6 @@ public: mutable GPUBuffer* GPUParticlesCountReadback = nullptr; public: - /// /// Finalizes an instance of the class. /// diff --git a/Source/Engine/Physics/Actors/PhysicsColliderActor.h b/Source/Engine/Physics/Actors/PhysicsColliderActor.h index 0e254907a..5f0fbb4b9 100644 --- a/Source/Engine/Physics/Actors/PhysicsColliderActor.h +++ b/Source/Engine/Physics/Actors/PhysicsColliderActor.h @@ -13,9 +13,8 @@ struct Collision; /// API_CLASS(Abstract) class FLAXENGINE_API PhysicsColliderActor : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(PhysicsColliderActor); + DECLARE_SCENE_OBJECT_ABSTRACT(PhysicsColliderActor); public: - /// /// Occurs when a collision start gets registered for this collider (it collides with something). /// @@ -37,7 +36,6 @@ public: API_EVENT() Delegate TriggerExit; public: - /// /// Gets the attached rigid body. /// @@ -45,7 +43,6 @@ public: API_PROPERTY() virtual RigidBody* GetAttachedRigidBody() const = 0; public: - /// /// Called when a collision start gets registered for this collider (it collides with something). /// diff --git a/Source/Engine/Physics/Actors/RigidBody.h b/Source/Engine/Physics/Actors/RigidBody.h index 1837186b1..3b99d8899 100644 --- a/Source/Engine/Physics/Actors/RigidBody.h +++ b/Source/Engine/Physics/Actors/RigidBody.h @@ -16,9 +16,8 @@ class Collider; /// API_CLASS() class FLAXENGINE_API RigidBody : public Actor, public IPhysicsActor { -DECLARE_SCENE_OBJECT(RigidBody); + DECLARE_SCENE_OBJECT(RigidBody); protected: - void* _actor; Float3 _cachedScale; @@ -40,7 +39,6 @@ protected: int32 _isUpdatingTransform : 1; public: - /// /// Enables kinematic mode for the rigidbody. /// @@ -286,7 +284,6 @@ public: API_PROPERTY() void SetConstraints(const RigidbodyConstraints value); public: - /// /// Gets the linear velocity of the rigidbody. /// @@ -374,7 +371,6 @@ public: API_PROPERTY() bool IsSleeping() const; public: - /// /// Forces a rigidbody to sleep (for at least one frame). /// @@ -508,7 +504,6 @@ public: API_FUNCTION() void ClosestPoint(const Vector3& position, API_PARAM(Out) Vector3& result) const; public: - /// /// Occurs when a collision start gets registered for this rigidbody (it collides with something). /// @@ -530,7 +525,6 @@ public: API_EVENT() Delegate TriggerExit; public: - void OnCollisionEnter(const Collision& c); void OnCollisionExit(const Collision& c); @@ -551,7 +545,6 @@ public: void UpdateScale(); public: - // [Actor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; @@ -561,7 +554,6 @@ public: void OnActiveTransformChanged() override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Physics/Actors/SplineRopeBody.h b/Source/Engine/Physics/Actors/SplineRopeBody.h index 31d03ec2d..c19785edc 100644 --- a/Source/Engine/Physics/Actors/SplineRopeBody.h +++ b/Source/Engine/Physics/Actors/SplineRopeBody.h @@ -13,10 +13,9 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineRopeBody : public Actor { -API_AUTO_SERIALIZATION(); -DECLARE_SCENE_OBJECT(SplineRopeBody); + API_AUTO_SERIALIZATION(); + DECLARE_SCENE_OBJECT(SplineRopeBody); private: - struct Mass { Vector3 Position; @@ -30,7 +29,6 @@ private: Array _masses; public: - /// /// The target actor too attach the rope end to. If unset the rope end will run freely. /// @@ -62,11 +60,9 @@ public: float SubstepTime = 0.02f; private: - void Tick(); public: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/Physics/Actors/WheeledVehicle.h b/Source/Engine/Physics/Actors/WheeledVehicle.h index b1e858eaf..ac7f34973 100644 --- a/Source/Engine/Physics/Actors/WheeledVehicle.h +++ b/Source/Engine/Physics/Actors/WheeledVehicle.h @@ -13,7 +13,7 @@ API_CLASS() class FLAXENGINE_API WheeledVehicle : public RigidBody { friend class PhysicsBackend; -DECLARE_SCENE_OBJECT(WheeledVehicle); + DECLARE_SCENE_OBJECT(WheeledVehicle); /// /// Vehicle driving mode types. @@ -33,8 +33,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct EngineSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(EngineSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(EngineSettings); + API_AUTO_SERIALIZATION(); /// /// Moment of inertia of the engine around the axis of rotation. Specified in kilograms metres-squared (kg m^2). @@ -76,8 +76,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct DifferentialSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(DifferentialSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(DifferentialSettings); + API_AUTO_SERIALIZATION(); /// /// Type of differential. @@ -120,8 +120,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct GearboxSettings : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(GearboxSettings); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(GearboxSettings); + API_AUTO_SERIALIZATION(); /// /// If enabled the vehicle gears will be changes automatically, otherwise it's fully manual. @@ -163,8 +163,8 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct Wheel : ISerializable { - DECLARE_SCRIPTING_TYPE_MINIMAL(Wheel); - API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(Wheel); + API_AUTO_SERIALIZATION(); /// /// Wheel placement type. @@ -257,7 +257,7 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); /// API_STRUCT() struct WheelState { - DECLARE_SCRIPTING_TYPE_MINIMAL(WheelState); + DECLARE_SCRIPTING_TYPE_MINIMAL(WheelState); /// /// True if suspension travel limits forbid the wheel from touching the drivable surface. @@ -313,7 +313,6 @@ DECLARE_SCENE_OBJECT(WheeledVehicle); }; private: - struct WheelData { Collider* Collider; @@ -331,7 +330,6 @@ private: GearboxSettings _gearbox; public: - /// /// If checked, the negative throttle value will be used as brake and reverse to behave in a more arcade style where holding reverse also functions as brake. Disable it for more realistic driving controls. /// @@ -395,7 +393,6 @@ public: API_PROPERTY() void SetGearbox(const GearboxSettings& value); public: - /// /// Sets the input for vehicle throttle. It is the analog accelerator pedal value in range (0,1) where 1 represents the pedal fully pressed and 0 represents the pedal in its rest state. /// @@ -426,7 +423,6 @@ public: API_FUNCTION() void ClearInput(); public: - /// /// Gets the current forward vehicle movement speed (along forward vector of the actor transform). /// @@ -475,13 +471,11 @@ public: API_FUNCTION() void Setup(); private: - #if USE_EDITOR void DrawPhysicsDebug(RenderView& view); #endif public: - // [Vehicle] #if USE_EDITOR void OnDebugDrawSelected() override; diff --git a/Source/Engine/Physics/Colliders/BoxCollider.h b/Source/Engine/Physics/Colliders/BoxCollider.h index 965033661..d49ae33bd 100644 --- a/Source/Engine/Physics/Colliders/BoxCollider.h +++ b/Source/Engine/Physics/Colliders/BoxCollider.h @@ -11,14 +11,12 @@ /// API_CLASS() class FLAXENGINE_API BoxCollider : public Collider { -DECLARE_SCENE_OBJECT(BoxCollider); + DECLARE_SCENE_OBJECT(BoxCollider); private: - Float3 _size; OrientedBoundingBox _bounds; public: - /// /// Gets the size of the box, measured in the object's local space. /// @@ -48,7 +46,6 @@ public: } public: - // [Collider] #if USE_EDITOR void OnDebugDraw() override; @@ -59,7 +56,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] void UpdateBounds() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/CapsuleCollider.h b/Source/Engine/Physics/Colliders/CapsuleCollider.h index 116cc645a..f62bd4154 100644 --- a/Source/Engine/Physics/Colliders/CapsuleCollider.h +++ b/Source/Engine/Physics/Colliders/CapsuleCollider.h @@ -14,15 +14,13 @@ /// API_CLASS() class FLAXENGINE_API CapsuleCollider : public Collider { -DECLARE_SCENE_OBJECT(CapsuleCollider); + DECLARE_SCENE_OBJECT(CapsuleCollider); private: - float _radius; float _height; OrientedBoundingBox _orientedBox; public: - /// /// Gets the radius of the sphere, measured in the object's local space. /// @@ -64,7 +62,6 @@ public: API_PROPERTY() void SetHeight(float value); public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -74,7 +71,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] void UpdateBounds() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/CharacterController.h b/Source/Engine/Physics/Colliders/CharacterController.h index 2961fcd05..8087d61e8 100644 --- a/Source/Engine/Physics/Colliders/CharacterController.h +++ b/Source/Engine/Physics/Colliders/CharacterController.h @@ -11,9 +11,8 @@ /// API_CLASS() class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor { -DECLARE_SCENE_OBJECT(CharacterController); + DECLARE_SCENE_OBJECT(CharacterController); public: - /// /// Specifies which sides a character is colliding with. /// @@ -57,7 +56,6 @@ public: }; private: - void* _controller; float _stepOffset; float _slopeLimit; @@ -148,7 +146,6 @@ public: API_PROPERTY() void SetMinMoveDistance(float value); public: - /// /// Gets the linear velocity of the Character Controller. This allows tracking how fast the character is actually moving, for instance when it is stuck at a wall this value will be the near zero vector. /// @@ -165,7 +162,6 @@ public: API_PROPERTY() CollisionFlags GetFlags() const; public: - /// /// Moves the character with the given speed. Gravity is automatically applied. It will slide along colliders. Result collision flags is the summary of collisions that occurred during the Move. /// @@ -181,7 +177,6 @@ public: API_FUNCTION() CollisionFlags Move(const Vector3& displacement); protected: - /// /// Creates the physics actor. /// @@ -198,7 +193,6 @@ protected: void UpdateSize() const; public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -216,7 +210,6 @@ public: void* GetPhysicsActor() const override; protected: - // [PhysicsActor] void UpdateGeometry() override; void GetGeometry(CollisionShape& collision) override; diff --git a/Source/Engine/Physics/Colliders/Collider.h b/Source/Engine/Physics/Colliders/Collider.h index ecbb7746c..8bc3301e4 100644 --- a/Source/Engine/Physics/Colliders/Collider.h +++ b/Source/Engine/Physics/Colliders/Collider.h @@ -17,9 +17,8 @@ class RigidBody; /// API_CLASS(Abstract) class FLAXENGINE_API Collider : public PhysicsColliderActor { -DECLARE_SCENE_OBJECT_ABSTRACT(Collider); + DECLARE_SCENE_OBJECT_ABSTRACT(Collider); protected: - Vector3 _center; bool _isTrigger; void* _shape; @@ -30,7 +29,6 @@ protected: Quaternion _cachedLocalPoseRot; public: - /// /// Gets the native physics backend object. /// @@ -97,7 +95,6 @@ public: AssetReference Material; public: - /// /// Performs a raycast against this collider shape. /// @@ -146,7 +143,6 @@ public: API_FUNCTION() static bool ComputePenetration(const Collider* colliderA, const Collider* colliderB, API_PARAM(Out) Vector3& direction, API_PARAM(Out) float& distance); public: - /// /// Determines whether this collider can be attached the specified rigid body. /// @@ -167,7 +163,6 @@ public: void Attach(RigidBody* rigidBody); protected: - /// /// Updates the shape actor collisions/queries layer mask bits. /// @@ -209,18 +204,15 @@ protected: #endif private: - void OnMaterialChanged(); public: - // [PhysicsColliderActor] void Serialize(SerializeStream& stream, const void* otherObj) override; void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; RigidBody* GetAttachedRigidBody() const override; protected: - // [PhysicsColliderActor] #if USE_EDITOR void OnEnable() override; diff --git a/Source/Engine/Physics/Colliders/MeshCollider.h b/Source/Engine/Physics/Colliders/MeshCollider.h index 6faddf41d..a12746623 100644 --- a/Source/Engine/Physics/Colliders/MeshCollider.h +++ b/Source/Engine/Physics/Colliders/MeshCollider.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API MeshCollider : public Collider { -DECLARE_SCENE_OBJECT(MeshCollider); + DECLARE_SCENE_OBJECT(MeshCollider); public: - /// /// Linked collision data asset that contains convex mesh or triangle mesh used to represent a mesh collider shape. /// @@ -22,12 +21,10 @@ public: AssetReference CollisionData; private: - void OnCollisionDataChanged(); void OnCollisionDataLoaded(); public: - // [Collider] bool CanAttach(RigidBody* rigidBody) const override; bool CanBeTrigger() const override; @@ -39,7 +36,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/Colliders/SphereCollider.h b/Source/Engine/Physics/Colliders/SphereCollider.h index fa37195b9..1638300ff 100644 --- a/Source/Engine/Physics/Colliders/SphereCollider.h +++ b/Source/Engine/Physics/Colliders/SphereCollider.h @@ -10,13 +10,11 @@ /// API_CLASS() class FLAXENGINE_API SphereCollider : public Collider { -DECLARE_SCENE_OBJECT(SphereCollider); + DECLARE_SCENE_OBJECT(SphereCollider); private: - float _radius; public: - /// /// Gets the radius of the sphere, measured in the object's local space. /// @@ -38,7 +36,6 @@ public: API_PROPERTY() void SetRadius(float value); public: - // [Collider] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -48,7 +45,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/Colliders/SplineCollider.h b/Source/Engine/Physics/Colliders/SplineCollider.h index d254a7667..526040471 100644 --- a/Source/Engine/Physics/Colliders/SplineCollider.h +++ b/Source/Engine/Physics/Colliders/SplineCollider.h @@ -15,7 +15,7 @@ class Spline; /// API_CLASS() class FLAXENGINE_API SplineCollider : public Collider { -DECLARE_SCENE_OBJECT(SplineCollider); + DECLARE_SCENE_OBJECT(SplineCollider); private: Spline* _spline = nullptr; void* _triangleMesh = nullptr; @@ -24,7 +24,6 @@ private: Transform _preTransform = Transform::Identity; public: - /// /// Linked collision data asset that contains convex mesh or triangle mesh used to represent a spline collider shape. /// @@ -50,13 +49,11 @@ public: void ExtractGeometry(Array& vertexBuffer, Array& indexBuffer) const; private: - void OnCollisionDataChanged(); void OnCollisionDataLoaded(); void OnSplineUpdated(); public: - // [Collider] bool CanAttach(RigidBody* rigidBody) const override; bool CanBeTrigger() const override; @@ -70,7 +67,6 @@ public: void EndPlay() override; protected: - // [Collider] #if USE_EDITOR void DrawPhysicsDebug(RenderView& view) override; diff --git a/Source/Engine/Physics/CollisionData.h b/Source/Engine/Physics/CollisionData.h index 02b95e762..458c6577d 100644 --- a/Source/Engine/Physics/CollisionData.h +++ b/Source/Engine/Physics/CollisionData.h @@ -94,7 +94,7 @@ DECLARE_ENUM_OPERATORS(ConvexMeshGenerationFlags); /// API_STRUCT() struct CollisionDataOptions { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); /// /// The data type. @@ -137,9 +137,8 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(CollisionDataOptions); /// API_CLASS(NoSpawn) class FLAXENGINE_API CollisionData : public BinaryAsset { -DECLARE_BINARY_ASSET_HEADER(CollisionData, 1); + DECLARE_BINARY_ASSET_HEADER(CollisionData, 1); public: - /// /// A raw structure stored in the binary asset. It has fixed size so it's easier to add new parameters to it. It's loaded and changed into Options structure used at runtime. /// @@ -157,13 +156,11 @@ public: static_assert(sizeof(SerializedOptions) == 128, "Invalid collision data options size. Change the padding."); private: - CollisionDataOptions _options; void* _convexMesh; void* _triangleMesh; public: - /// /// Gets the options. /// @@ -189,7 +186,6 @@ public: } public: - #if COMPILE_WITH_PHYSICS_COOKING /// @@ -268,7 +264,6 @@ public: API_FUNCTION() void ExtractGeometry(API_PARAM(Out) Array& vertexBuffer, API_PARAM(Out) Array& indexBuffer) const; public: - // MeshCollider is drawing debug view of the collision data, allow to share it across instances #if USE_EDITOR private: @@ -282,11 +277,9 @@ public: #endif private: - LoadResult load(const SerializedOptions* options, byte* dataPtr, int32 dataSize); protected: - // [BinaryAsset] LoadResult load() override; void unload(bool isReloading) override; diff --git a/Source/Engine/Physics/Collisions.h b/Source/Engine/Physics/Collisions.h index 53531b975..3e6ffc5af 100644 --- a/Source/Engine/Physics/Collisions.h +++ b/Source/Engine/Physics/Collisions.h @@ -11,7 +11,7 @@ class PhysicsColliderActor; /// API_STRUCT() struct FLAXENGINE_API ContactPoint { -DECLARE_SCRIPTING_TYPE_MINIMAL(ContactPoint); + DECLARE_SCRIPTING_TYPE_MINIMAL(ContactPoint); /// /// The contact point location in the world space. @@ -43,7 +43,7 @@ struct TIsPODType /// API_STRUCT() struct FLAXENGINE_API Collision { -DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); + DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); /// /// The first collider (this instance). @@ -84,7 +84,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(Collision); API_FIELD(Private, NoArray) ContactPoint Contacts[COLLISION_NAX_CONTACT_POINTS]; public: - /// /// Gets the relative linear velocity of the two colliding objects. /// diff --git a/Source/Engine/Physics/Joints/D6Joint.h b/Source/Engine/Physics/Joints/D6Joint.h index a348a9cd6..66819bb0b 100644 --- a/Source/Engine/Physics/Joints/D6Joint.h +++ b/Source/Engine/Physics/Joints/D6Joint.h @@ -124,7 +124,7 @@ API_ENUM() enum class D6JointDriveType /// API_STRUCT() struct D6JointDrive { -DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); + DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); /// /// The spring strength. Force proportional to the position error. @@ -147,7 +147,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(D6JointDrive); API_FIELD() bool Acceleration = false; public: - bool operator==(const D6JointDrive& other) const { return Stiffness == other.Stiffness && Damping == other.Damping && ForceLimit == other.ForceLimit && Acceleration == other.Acceleration; @@ -163,9 +162,8 @@ public: /// API_CLASS() class FLAXENGINE_API D6Joint : public Joint { -DECLARE_SCENE_OBJECT(D6Joint); + DECLARE_SCENE_OBJECT(D6Joint); private: - D6JointMotion _motion[static_cast(D6JointAxis::MAX)]; D6JointDrive _drive[static_cast(D6JointDriveType::MAX)]; LimitLinear _limitLinear; @@ -173,7 +171,6 @@ private: LimitConeRange _limitSwing; public: - /// /// Gets the motion type around the specified axis. /// @@ -215,7 +212,6 @@ public: API_FUNCTION() void SetDrive(const D6JointDriveType index, const D6JointDrive& value); public: - /// /// Determines the linear limit used for constraining translation degrees of freedom. /// @@ -259,7 +255,6 @@ public: API_PROPERTY() void SetLimitSwing(const LimitConeRange& value); public: - /// /// Gets the drive's target position relative to the joint's first body. /// @@ -301,7 +296,6 @@ public: API_PROPERTY() void SetDriveAngularVelocity(const Vector3& value); public: - /// /// Gets the twist angle of the joint (in the range (-2*Pi, 2*Pi]). /// @@ -318,7 +312,6 @@ public: API_PROPERTY() float GetCurrentSwingZ() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -327,7 +320,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/DistanceJoint.h b/Source/Engine/Physics/Joints/DistanceJoint.h index de7071a62..cb31b8215 100644 --- a/Source/Engine/Physics/Joints/DistanceJoint.h +++ b/Source/Engine/Physics/Joints/DistanceJoint.h @@ -39,9 +39,8 @@ DECLARE_ENUM_OPERATORS(DistanceJointFlag); /// API_CLASS() class FLAXENGINE_API DistanceJoint : public Joint { -DECLARE_SCENE_OBJECT(DistanceJoint); + DECLARE_SCENE_OBJECT(DistanceJoint); private: - DistanceJointFlag _flags; float _minDistance; float _maxDistance; @@ -49,7 +48,6 @@ private: SpringParameters _spring; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -139,14 +137,12 @@ public: API_PROPERTY() void SetSpringParameters(const SpringParameters& value); public: - /// /// Gets the current distance of the joint. /// API_PROPERTY() float GetCurrentDistance() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -155,7 +151,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/FixedJoint.h b/Source/Engine/Physics/Joints/FixedJoint.h index d689fa195..9e6280023 100644 --- a/Source/Engine/Physics/Joints/FixedJoint.h +++ b/Source/Engine/Physics/Joints/FixedJoint.h @@ -10,16 +10,14 @@ /// API_CLASS() class FLAXENGINE_API FixedJoint : public Joint { -DECLARE_SCENE_OBJECT(FixedJoint); + DECLARE_SCENE_OBJECT(FixedJoint); public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; #endif protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/HingeJoint.h b/Source/Engine/Physics/Joints/HingeJoint.h index dcf2d2991..14e3198e5 100644 --- a/Source/Engine/Physics/Joints/HingeJoint.h +++ b/Source/Engine/Physics/Joints/HingeJoint.h @@ -33,7 +33,7 @@ DECLARE_ENUM_OPERATORS(HingeJointFlag); /// API_STRUCT() struct HingeJointDrive { -DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); + DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); /// /// Target velocity of the joint. @@ -57,7 +57,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(HingeJointDrive); API_FIELD() bool FreeSpin = false; public: - /// /// Compares two objects. /// @@ -78,15 +77,13 @@ public: /// API_CLASS() class FLAXENGINE_API HingeJoint : public Joint { -DECLARE_SCENE_OBJECT(HingeJoint); + DECLARE_SCENE_OBJECT(HingeJoint); private: - HingeJointFlag _flags; LimitAngularRange _limit; HingeJointDrive _drive; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -142,7 +139,6 @@ public: API_PROPERTY() void SetDrive(const HingeJointDrive& value); public: - /// /// Gets the current angle of the joint (in radians, in the range (-Pi, Pi]). /// @@ -154,7 +150,6 @@ public: API_PROPERTY() float GetCurrentVelocity() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -163,7 +158,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/Joint.h b/Source/Engine/Physics/Joints/Joint.h index 7d2ef20c4..6e2d7ac4c 100644 --- a/Source/Engine/Physics/Joints/Joint.h +++ b/Source/Engine/Physics/Joints/Joint.h @@ -18,9 +18,8 @@ class IPhysicsActor; /// API_CLASS(Abstract) class FLAXENGINE_API Joint : public Actor { -DECLARE_SCENE_OBJECT_ABSTRACT(Joint); + DECLARE_SCENE_OBJECT_ABSTRACT(Joint); protected: - void* _joint; float _breakForce; float _breakTorque; @@ -30,7 +29,6 @@ protected: bool _enableAutoAnchor = false; public: - /// /// The target actor for the joint. It has to be IPhysicsActor type (eg. RigidBody or CharacterController). /// @@ -131,7 +129,6 @@ public: API_PROPERTY() void SetTargetAnchorRotation(const Quaternion& value); public: - /// /// Gets the native physics backend object. /// @@ -174,7 +171,6 @@ public: virtual void OnJointBreak(); protected: - Vector3 GetTargetPosition() const; Quaternion GetTargetOrientation() const; virtual void* CreateJoint(const struct PhysicsJointDesc& desc) = 0; @@ -183,13 +179,11 @@ protected: #endif private: - void Delete(); void SetActors(); void OnTargetChanged(); public: - // [Actor] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -198,7 +192,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) override; void EndPlay() override; diff --git a/Source/Engine/Physics/Joints/Limits.h b/Source/Engine/Physics/Joints/Limits.h index cda2ceb48..65247567e 100644 --- a/Source/Engine/Physics/Joints/Limits.h +++ b/Source/Engine/Physics/Joints/Limits.h @@ -10,7 +10,7 @@ /// API_STRUCT() struct SpringParameters { -DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); + DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); /// /// The spring strength. Force proportional to the position error. @@ -23,7 +23,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(SpringParameters); API_FIELD() float Damping; public: - /// /// Constructs a spring with no force. /// @@ -45,7 +44,6 @@ public: } public: - bool operator==(const SpringParameters& other) const { return Stiffness == other.Stiffness && Damping == other.Damping; @@ -57,7 +55,7 @@ public: /// API_STRUCT() struct LimitLinearRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -85,7 +83,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinearRange); API_FIELD() float Upper = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -122,7 +119,6 @@ public: } public: - bool operator==(const LimitLinearRange& other) const { return Lower == other.Lower && Upper == other.Upper && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -134,7 +130,7 @@ public: /// API_STRUCT() struct LimitLinear { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -157,7 +153,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitLinear); API_FIELD() float Extent = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -190,7 +185,6 @@ public: } public: - bool operator==(const LimitLinear& other) const { return Extent == other.Extent && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -202,7 +196,7 @@ public: /// API_STRUCT() struct LimitAngularRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -230,7 +224,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitAngularRange); API_FIELD() float Upper = 0.0f; public: - /// /// Constructs an empty limit. /// @@ -267,7 +260,6 @@ public: } public: - bool operator==(const LimitAngularRange& other) const { return Lower == other.Lower && Upper == other.Upper && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; @@ -279,7 +271,7 @@ public: /// API_STRUCT() struct LimitConeRange { -DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); + DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); /// /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached to avoid breaking the limit. @@ -307,7 +299,6 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange); API_FIELD(Attributes="Limit(0.0f, 180.0f)") float ZLimitAngle = 90.0f; public: - /// /// Constructs a limit with a 45 degree cone. /// @@ -344,7 +335,6 @@ public: } public: - bool operator==(const LimitConeRange& other) const { return YLimitAngle == other.YLimitAngle && ZLimitAngle == other.ZLimitAngle && ContactDist == other.ContactDist && Restitution == other.Restitution && Spring == other.Spring; diff --git a/Source/Engine/Physics/Joints/SliderJoint.h b/Source/Engine/Physics/Joints/SliderJoint.h index ea39a17cb..b909ee925 100644 --- a/Source/Engine/Physics/Joints/SliderJoint.h +++ b/Source/Engine/Physics/Joints/SliderJoint.h @@ -29,14 +29,12 @@ DECLARE_ENUM_OPERATORS(SliderJointFlag); /// API_CLASS() class FLAXENGINE_API SliderJoint : public Joint { -DECLARE_SCENE_OBJECT(SliderJoint); + DECLARE_SCENE_OBJECT(SliderJoint); private: - SliderJointFlag _flags; LimitLinearRange _limit; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -72,7 +70,6 @@ public: API_PROPERTY() void SetLimit(const LimitLinearRange& value); public: - /// /// Gets the current displacement of the joint along its axis. /// @@ -84,7 +81,6 @@ public: API_PROPERTY() float GetCurrentVelocity() const; public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -93,7 +89,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/Joints/SphericalJoint.h b/Source/Engine/Physics/Joints/SphericalJoint.h index 39ec10445..328575fa2 100644 --- a/Source/Engine/Physics/Joints/SphericalJoint.h +++ b/Source/Engine/Physics/Joints/SphericalJoint.h @@ -31,14 +31,12 @@ DECLARE_ENUM_OPERATORS(SphericalJointFlag); /// API_CLASS() class FLAXENGINE_API SphericalJoint : public Joint { -DECLARE_SCENE_OBJECT(SphericalJoint); + DECLARE_SCENE_OBJECT(SphericalJoint); private: - SphericalJointFlag _flags; LimitConeRange _limit; public: - /// /// Gets the joint mode flags. Controls joint behaviour. /// @@ -74,7 +72,6 @@ public: API_PROPERTY() void SetLimit(const LimitConeRange& value); public: - // [Joint] #if USE_EDITOR void OnDebugDrawSelected() override; @@ -83,7 +80,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Joint] void* CreateJoint(const PhysicsJointDesc& desc) override; }; diff --git a/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h b/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h index d871591b4..964c1c97e 100644 --- a/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h +++ b/Source/Engine/Physics/PhysX/PhysicsStepperPhysX.h @@ -14,7 +14,6 @@ class MultiThreadStepper; class PhysicsStepper { public: - PhysicsStepper() { } @@ -24,7 +23,6 @@ public: } public: - virtual bool advance(PxScene* scene, PxReal dt, void* scratchBlock, PxU32 scratchBlockSize) = 0; virtual void wait(PxScene* scene) = 0; virtual void substepStrategy(const PxReal stepSize, PxU32& substepCount, PxReal& substepSize) = 0; @@ -41,7 +39,6 @@ public: class StepperTask : public PxLightCpuTask { public: - void setStepper(MultiThreadStepper* stepper) { mStepper = stepper; @@ -58,7 +55,6 @@ public: } public: - // [PxLightCpuTask] const char* getName() const override { @@ -68,7 +64,6 @@ public: void run() override; protected: - MultiThreadStepper* mStepper = nullptr; }; @@ -79,7 +74,6 @@ protected: class StepperTaskSimulate : public StepperTask { public: - /// /// Initializes a new instance of the class. /// @@ -88,7 +82,6 @@ public: } public: - // [StepperTask] void run() override; }; @@ -96,7 +89,6 @@ public: class MultiThreadStepper : public PhysicsStepper { public: - MultiThreadStepper() : mFirstCompletionPending(false) , mScene(nullptr) @@ -135,7 +127,6 @@ public: } protected: - void substep(StepperTask& completionTask); // we need two completion tasks because when multistepping we can't submit completion0 from the @@ -170,13 +161,11 @@ protected: class FixedStepper : public MultiThreadStepper { protected: - PxReal mAccumulator; PxReal mFixedSubStepSize; PxU32 mMaxSubSteps; public: - /// /// Initializes a new instance of the class. /// @@ -189,7 +178,6 @@ public: } public: - /// /// Setups the specified step size and the maximum amount of them. /// @@ -202,7 +190,6 @@ public: } public: - // [MultiThreadStepper] void substepStrategy(const PxReal stepSize, PxU32& substepCount, PxReal& substepSize) override; diff --git a/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h b/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h index c6f3019c5..e0f16d140 100644 --- a/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h +++ b/Source/Engine/Physics/PhysX/SimulationEventCallbackPhysX.h @@ -17,7 +17,6 @@ class SimulationEventCallback : public PxSimulationEventCallback { public: - typedef Pair CollidersPair; typedef Dictionary CollisionsPool; @@ -57,7 +56,6 @@ public: Array BrokenJoints; public: - /// /// Clears the data. /// @@ -98,7 +96,6 @@ public: void OnJointRemoved(Joint* joint); public: - // [PxSimulationEventCallback] void onConstraintBreak(PxConstraintInfo* constraints, PxU32 count) override; void onWake(PxActor** actors, PxU32 count) override; diff --git a/Source/Engine/Physics/PhysicalMaterial.h b/Source/Engine/Physics/PhysicalMaterial.h index ed7b0829a..0d8356546 100644 --- a/Source/Engine/Physics/PhysicalMaterial.h +++ b/Source/Engine/Physics/PhysicalMaterial.h @@ -10,14 +10,12 @@ /// API_CLASS() class FLAXENGINE_API PhysicalMaterial final : public ISerializable { -API_AUTO_SERIALIZATION(); -DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicalMaterial); + API_AUTO_SERIALIZATION(); + DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicalMaterial); private: - void* _material; public: - /// /// Initializes a new instance of the class. /// @@ -29,7 +27,6 @@ public: ~PhysicalMaterial(); public: - /// /// The friction value of surface, controls how easily things can slide on this surface. /// @@ -73,7 +70,6 @@ public: float Density = 1000.0f; public: - /// /// Gets the PhysX material. /// diff --git a/Source/Engine/Physics/PhysicsSettings.h b/Source/Engine/Physics/PhysicsSettings.h index 799b6ffde..63649cc8b 100644 --- a/Source/Engine/Physics/PhysicsSettings.h +++ b/Source/Engine/Physics/PhysicsSettings.h @@ -11,9 +11,8 @@ /// API_CLASS(sealed, Namespace="FlaxEditor.Content.Settings", NoConstructor) class FLAXENGINE_API PhysicsSettings : public SettingsBase { -DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsSettings); + DECLARE_SCRIPTING_TYPE_MINIMAL(PhysicsSettings); public: - /// /// The default gravity force value (in cm^2/s). /// @@ -93,14 +92,12 @@ public: bool SupportCookingAtRuntime = false; public: - /// /// The collision layers masks. Used to define layer-based collision detection. /// uint32 LayerMasks[32]; public: - /// /// Initializes a new instance of the class. /// diff --git a/Source/Engine/Profiler/ProfilerCPU.cpp b/Source/Engine/Profiler/ProfilerCPU.cpp index 0e1a06c79..acc662917 100644 --- a/Source/Engine/Profiler/ProfilerCPU.cpp +++ b/Source/Engine/Profiler/ProfilerCPU.cpp @@ -126,7 +126,7 @@ void ProfilerCPU::Thread::EndEvent() { const double time = Platform::GetTimeSeconds() * 1000.0; _depth--; - Event& e = Buffer.Get(Buffer.GetCount() - 1); + Event& e = (Buffer.Last()--).Event(); e.End = time; } diff --git a/Source/Engine/Profiler/ProfilerCPU.h b/Source/Engine/Profiler/ProfilerCPU.h index e4d40a444..b4a4bfdc4 100644 --- a/Source/Engine/Profiler/ProfilerCPU.h +++ b/Source/Engine/Profiler/ProfilerCPU.h @@ -17,15 +17,14 @@ /// API_CLASS(Static) class FLAXENGINE_API ProfilerCPU { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilerCPU); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilerCPU); public: - /// /// Represents single CPU profiling event data. /// API_STRUCT() struct Event { - DECLARE_SCRIPTING_TYPE_MINIMAL(Event); + DECLARE_SCRIPTING_TYPE_MINIMAL(Event); /// /// The start time (in milliseconds). @@ -61,7 +60,6 @@ public: class EventBuffer : public NonCopyable { private: - Event* _data; int32 _capacity; int32 _capacityMask; @@ -69,12 +67,10 @@ public: int32 _count; public: - EventBuffer(); ~EventBuffer(); public: - /// /// Gets the amount of the events in the buffer. /// @@ -90,7 +86,7 @@ public: /// The event Event& Get(int32 index) const { - ASSERT(index >= 0 && index < _capacity); + ASSERT_LOW_LAYER(index >= 0 && index < _capacity); return _data[index]; } @@ -114,7 +110,6 @@ public: void Extract(Array& data, bool withRemove); public: - /// /// Ring buffer iterator /// @@ -123,7 +118,6 @@ public: friend EventBuffer; private: - EventBuffer* _buffer; int32 _index; @@ -136,7 +130,6 @@ public: Iterator(const Iterator& i) = default; public: - FORCE_INLINE int32 Index() const { return _index; @@ -144,32 +137,22 @@ public: FORCE_INLINE Event& Event() const { - ASSERT(_buffer && _index >= 0 && _index < _buffer->_capacity); + ASSERT_LOW_LAYER(_buffer && _index >= 0 && _index < _buffer->_capacity); return _buffer->Get(_index); } - public: - - /// - /// Checks if iterator is in the end of the collection. - /// bool IsEnd() const { - ASSERT(_buffer); + ASSERT_LOW_LAYER(_buffer); return _index == _buffer->_head; } - /// - /// Checks if iterator is not in the end of the collection. - /// bool IsNotEnd() const { - ASSERT(_buffer); + ASSERT_LOW_LAYER(_buffer); return _index != _buffer->_head; } - public: - FORCE_INLINE bool operator==(const Iterator& v) const { return _buffer == v._buffer && _index == v._index; @@ -181,7 +164,6 @@ public: } public: - Iterator& operator++() { ASSERT(_buffer); @@ -214,7 +196,6 @@ public: }; public: - FORCE_INLINE Iterator Begin() { return Iterator(this, (_head - _count) & _capacityMask); @@ -238,12 +219,10 @@ public: class Thread { private: - String _name; int32 _depth = 0; public: - Thread(const Char* name) { _name = name; @@ -255,14 +234,12 @@ public: } public: - /// /// The current thread. /// static THREADLOCAL Thread* Current; public: - /// /// Gets the name. /// @@ -277,7 +254,6 @@ public: EventBuffer Buffer; public: - /// /// Begins the event running on a this thread. Call EndEvent with index parameter equal to the returned value by BeginEvent function. /// @@ -297,7 +273,6 @@ public: }; public: - /// /// The registered threads. /// @@ -309,7 +284,6 @@ public: static bool Enabled; public: - /// /// Determines whether the current (calling) thread is being profiled by the service (it may has no active profile block but is registered). /// diff --git a/Source/Engine/Profiler/ProfilerGPU.h b/Source/Engine/Profiler/ProfilerGPU.h index 556068590..caba96b6e 100644 --- a/Source/Engine/Profiler/ProfilerGPU.h +++ b/Source/Engine/Profiler/ProfilerGPU.h @@ -19,15 +19,14 @@ class GPUTimerQuery; /// API_CLASS(Static) class FLAXENGINE_API ProfilerGPU { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilerGPU); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilerGPU); public: - /// /// Represents single CPU profiling event data. /// API_STRUCT() struct Event { - DECLARE_SCRIPTING_TYPE_MINIMAL(Event); + DECLARE_SCRIPTING_TYPE_MINIMAL(Event); /// /// The name of the event. @@ -61,12 +60,10 @@ public: class EventBuffer : public NonCopyable { private: - bool _isResolved = true; Array _data; public: - /// /// The index of the frame buffer was used for recording events (for the last time). /// @@ -117,7 +114,6 @@ public: }; private: - static int32 _depth; static Array _timerQueriesPool; @@ -126,7 +122,6 @@ private: static GPUTimerQuery* GetTimerQuery(); public: - /// /// True if GPU profiling is enabled, otherwise false to disable events collecting and GPU timer queries usage. Can be changed during rendering. /// @@ -143,7 +138,6 @@ public: static EventBuffer Buffers[PROFILER_GPU_EVENTS_FRAMES]; public: - /// /// Begins the event. Call EndEvent with index parameter equal to the returned value by BeginEvent function. /// @@ -197,7 +191,7 @@ struct ScopeProfileBlockGPU { Index = ProfilerGPU::BeginEvent(name); } - + FORCE_INLINE ~ScopeProfileBlockGPU() { ProfilerGPU::EndEvent(Index); diff --git a/Source/Engine/Profiler/ProfilingTools.cpp b/Source/Engine/Profiler/ProfilingTools.cpp index 628e2affe..ee412c6a9 100644 --- a/Source/Engine/Profiler/ProfilingTools.cpp +++ b/Source/Engine/Profiler/ProfilingTools.cpp @@ -15,7 +15,6 @@ Array ProfilingTools::EventsGPU; class ProfilingToolsService : public EngineService { public: - ProfilingToolsService() : EngineService(TEXT("Profiling Tools")) { diff --git a/Source/Engine/Profiler/ProfilingTools.h b/Source/Engine/Profiler/ProfilingTools.h index 8ba2f1c89..28115fcda 100644 --- a/Source/Engine/Profiler/ProfilingTools.h +++ b/Source/Engine/Profiler/ProfilingTools.h @@ -14,15 +14,14 @@ /// API_CLASS(Static) class ProfilingTools { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilingTools); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(ProfilingTools); public: - /// /// The GPU memory stats. /// API_STRUCT() struct MemoryStatsGPU { - DECLARE_SCRIPTING_TYPE_MINIMAL(MemoryStatsGPU); + DECLARE_SCRIPTING_TYPE_MINIMAL(MemoryStatsGPU); /// /// The total amount of memory in bytes (as reported by the driver). @@ -40,7 +39,7 @@ public: /// API_STRUCT() struct MainStats { - DECLARE_SCRIPTING_TYPE_MINIMAL(MainStats); + DECLARE_SCRIPTING_TYPE_MINIMAL(MainStats); /// /// The process memory stats. @@ -93,7 +92,7 @@ public: /// API_STRUCT() struct ThreadStats { - DECLARE_SCRIPTING_TYPE_MINIMAL(ThreadStats); + DECLARE_SCRIPTING_TYPE_MINIMAL(ThreadStats); /// /// The thread name. @@ -107,7 +106,6 @@ public: }; public: - /// /// The current collected main stats by the profiler from the local session. Updated every frame. /// diff --git a/Source/Engine/Profiler/RenderStats.h b/Source/Engine/Profiler/RenderStats.h index 708b6f3fb..a3dd6e7f7 100644 --- a/Source/Engine/Profiler/RenderStats.h +++ b/Source/Engine/Profiler/RenderStats.h @@ -11,7 +11,7 @@ /// API_STRUCT() struct RenderStatsData { -DECLARE_SCRIPTING_TYPE_MINIMAL(RenderStatsData); + DECLARE_SCRIPTING_TYPE_MINIMAL(RenderStatsData); /// /// The draw calls count. diff --git a/Source/Engine/Render2D/Render2D.cpp b/Source/Engine/Render2D/Render2D.cpp index 404689ca4..8c4dee971 100644 --- a/Source/Engine/Render2D/Render2D.cpp +++ b/Source/Engine/Render2D/Render2D.cpp @@ -114,6 +114,8 @@ struct Render2DDrawCall struct { MaterialBase* Mat; + float Width; + float Height; } AsMaterial; struct @@ -560,7 +562,6 @@ void CachedPSO::Dispose() class Render2DService : public EngineService { public: - Render2DService() : EngineService(TEXT("Render2D"), 10) { @@ -984,7 +985,10 @@ void DrawBatch(int32 startIndex, int32 count) // Apply and bind material auto material = d.AsChar.Mat; MaterialBase::BindParameters bindParams(Context, *(RenderContext*)nullptr); - bindParams.CustomData = &ViewProjection; + Render2D::CustomData customData; + customData.ViewProjection = ViewProjection; + customData.ViewSize = Float2(d.AsMaterial.Width, d.AsMaterial.Height); + bindParams.CustomData = &customData; material->Bind(bindParams); // Bind font atlas as a material parameter @@ -1017,7 +1021,10 @@ void DrawBatch(int32 startIndex, int32 count) // Bind material auto material = (MaterialBase*)d.AsMaterial.Mat; MaterialBase::BindParameters bindParams(Context, *(RenderContext*)nullptr); - bindParams.CustomData = &ViewProjection; + Render2D::CustomData customData; + customData.ViewProjection = ViewProjection; + customData.ViewSize = Float2(d.AsMaterial.Width, d.AsMaterial.Height); + bindParams.CustomData = &customData; material->Bind(bindParams); // Bind index and vertex buffers @@ -1122,7 +1129,7 @@ void DrawBatch(int32 startIndex, int32 count) break; #if !BUILD_RELEASE default: - CRASH; + CRASH; #endif } @@ -1892,6 +1899,8 @@ void Render2D::DrawMaterial(MaterialBase* material, const Rectangle& rect, const drawCall.StartIB = IBIndex; drawCall.CountIB = 6; drawCall.AsMaterial.Mat = material; + drawCall.AsMaterial.Width = rect.GetWidth(); + drawCall.AsMaterial.Height = rect.GetHeight(); WriteRect(rect, color); } diff --git a/Source/Engine/Render2D/Render2D.h b/Source/Engine/Render2D/Render2D.h index 6ee08e688..55f450e87 100644 --- a/Source/Engine/Render2D/Render2D.h +++ b/Source/Engine/Render2D/Render2D.h @@ -5,6 +5,8 @@ #include "Engine/Core/Math/Color.h" #include "Engine/Scripting/ScriptingType.h" #include "Engine/Core/Types/Span.h" +#include "Engine/Core/Math/Vector2.h" +#include "Engine/Core/Math/Matrix.h" struct SpriteHandle; struct TextLayoutOptions; @@ -26,7 +28,7 @@ class TextureBase; /// API_CLASS(Static) class FLAXENGINE_API Render2D { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); /// /// The rendering features and options flags. @@ -44,8 +46,13 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(Render2D); VertexSnapping = 1, }; -public: + struct CustomData + { + Matrix ViewProjection; + Float2 ViewSize; + }; +public: /// /// Checks if interface is during rendering phrase (Draw calls may be performed without failing). /// @@ -113,7 +120,6 @@ public: static void EndFrame(); public: - /// /// Pushes transformation layer. /// @@ -167,7 +173,6 @@ public: API_FUNCTION() static void PopTint(); public: - /// /// Draws a text. /// diff --git a/Source/Engine/Renderer/GI/DynamicDiffuseGlobalIllumination.cpp b/Source/Engine/Renderer/GI/DynamicDiffuseGlobalIllumination.cpp index a6b7d0b29..76fed479b 100644 --- a/Source/Engine/Renderer/GI/DynamicDiffuseGlobalIllumination.cpp +++ b/Source/Engine/Renderer/GI/DynamicDiffuseGlobalIllumination.cpp @@ -376,7 +376,7 @@ bool DynamicDiffuseGlobalIlluminationPass::Render(RenderContext& renderContext, LOG(Info, "Dynamic Diffuse Global Illumination memory usage: {0} MB, probes: {1}", memUsage / 1024 / 1024, probesCountTotal); clear = true; } -#if USE_EDITOR +#if COMPILE_WITH_DEV_ENV clear |= ddgiData.LastFrameUsed <= LastFrameShaderReload; #endif if (clear) diff --git a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp index 09c2da80d..7923a24d7 100644 --- a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp +++ b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp @@ -480,6 +480,21 @@ void MaterialGenerator::ProcessGroupMaterial(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Float3, String::Format(TEXT("float3({0}.x * 360.0f, {0}.y / ({0}.z + {1}), {0}.z)"), hcv.Value, epsilon.Value), node); break; } + // View Size + case 39: + { + const auto layer = GetRootLayer(); + if (layer && layer->Domain == MaterialDomain::GUI) + { + value = Value(VariantType::Float2, box->ID == 0 ? TEXT("ViewSize.xy") : TEXT("ViewSize.zw")); + } + else + { + // Fallback to Screen Size + value = Value(VariantType::Float2, box->ID == 0 ? TEXT("ScreenSize.xy") : TEXT("ScreenSize.zw")); + } + break; + } default: break; } diff --git a/Source/Engine/UI/SpriteRender.h b/Source/Engine/UI/SpriteRender.h index 49f034d00..bb976da5e 100644 --- a/Source/Engine/UI/SpriteRender.h +++ b/Source/Engine/UI/SpriteRender.h @@ -12,9 +12,8 @@ /// API_CLASS() class FLAXENGINE_API SpriteRender : public Actor { -DECLARE_SCENE_OBJECT(SpriteRender); + DECLARE_SCENE_OBJECT(SpriteRender); private: - Color _color; Float2 _size; SpriteHandle _sprite; @@ -26,7 +25,6 @@ private: int32 _sceneRenderingKey = -1; public: - /// /// Gets the size of the sprite. /// @@ -86,12 +84,10 @@ public: DrawPass DrawModes = DrawPass::Default; private: - void OnMaterialLoaded(); void SetImage(); public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -101,7 +97,6 @@ public: void OnEndPlay() override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/UI/TextRender.h b/Source/Engine/UI/TextRender.h index 9048fa307..cf4030903 100644 --- a/Source/Engine/UI/TextRender.h +++ b/Source/Engine/UI/TextRender.h @@ -21,9 +21,8 @@ /// API_CLASS() class FLAXENGINE_API TextRender : public Actor { -DECLARE_SCENE_OBJECT(TextRender); + DECLARE_SCENE_OBJECT(TextRender); private: - struct DrawChunk { TextRender* Actor; @@ -55,7 +54,6 @@ private: Array> _drawChunks; public: - /// /// Gets the text. /// @@ -154,7 +152,6 @@ public: #endif private: - void Invalidate() { // Invalidate data @@ -162,7 +159,6 @@ private: } public: - // [Actor] bool HasContentLoaded() const override; void Draw(RenderContext& renderContext) override; @@ -175,7 +171,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void OnEnable() override; void OnDisable() override; diff --git a/Source/Engine/UI/UICanvas.h b/Source/Engine/UI/UICanvas.h index 013f2ae95..4eff6cebc 100644 --- a/Source/Engine/UI/UICanvas.h +++ b/Source/Engine/UI/UICanvas.h @@ -9,9 +9,8 @@ /// API_CLASS(Sealed, NoConstructor) class FLAXENGINE_API UICanvas : public Actor { -DECLARE_SCENE_OBJECT(UICanvas); + DECLARE_SCENE_OBJECT(UICanvas); public: - // [Actor] #if USE_EDITOR BoundingBox GetEditorBox() const override; @@ -20,7 +19,6 @@ public: void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override; protected: - // [Actor] void BeginPlay(SceneBeginData* data) final override; void EndPlay() final override; diff --git a/Source/Engine/Utilities/Crc.h b/Source/Engine/Utilities/Crc.h index 7b13bd06e..ce32ce56b 100644 --- a/Source/Engine/Utilities/Crc.h +++ b/Source/Engine/Utilities/Crc.h @@ -9,7 +9,6 @@ class Crc { public: - // Helper lookup table with cached CRC values. static uint32 CachedCRCTablesSB8[8][256]; diff --git a/Source/Engine/Utilities/Delaunay2D.h b/Source/Engine/Utilities/Delaunay2D.h index 8ae8ab425..e0b564e09 100644 --- a/Source/Engine/Utilities/Delaunay2D.h +++ b/Source/Engine/Utilities/Delaunay2D.h @@ -12,7 +12,6 @@ class Delaunay2D { public: - struct Triangle { int32 Indices[3]; @@ -125,7 +124,6 @@ public: } private: - struct Edge { int32 Indices[2]; diff --git a/Source/Engine/Utilities/Encryption.h b/Source/Engine/Utilities/Encryption.h index 90dcf6e4e..dc7d3d06e 100644 --- a/Source/Engine/Utilities/Encryption.h +++ b/Source/Engine/Utilities/Encryption.h @@ -10,7 +10,6 @@ class FLAXENGINE_API Encryption { public: - /// /// Encrypt bytes with custom data /// @@ -26,7 +25,6 @@ public: static void DecryptBytes(byte* data, uint64 size); public: - static int32 Base64EncodeLength(int32 size); static int32 Base64DecodeLength(const char* encoded, int32 length); static void Base64Encode(const byte* bytes, int32 size, Array& encoded); diff --git a/Source/Engine/Utilities/Screenshot.cpp b/Source/Engine/Utilities/Screenshot.cpp index 3867be8dd..e7e9c12ad 100644 --- a/Source/Engine/Utilities/Screenshot.cpp +++ b/Source/Engine/Utilities/Screenshot.cpp @@ -24,7 +24,6 @@ class CaptureScreenshot : public ThreadPoolTask { friend Screenshot; private: - TextureData _data; GPUTextureReference _texture; ScriptingObjectReference _renderTask; @@ -32,7 +31,6 @@ private: DateTime _startTime; public: - /// /// Initializes a new instance of the class. /// @@ -60,7 +58,6 @@ public: } public: - /// /// Gets the texture data container. /// @@ -71,7 +68,6 @@ public: } protected: - // [ThreadPoolTask] bool Run() override; void OnFail() override; diff --git a/Source/Engine/Utilities/Screenshot.h b/Source/Engine/Utilities/Screenshot.h index 4519e3de4..914d1820e 100644 --- a/Source/Engine/Utilities/Screenshot.h +++ b/Source/Engine/Utilities/Screenshot.h @@ -14,7 +14,7 @@ class GPUTexture; /// API_CLASS(Static) class FLAXENGINE_API Screenshot { -DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot); + DECLARE_SCRIPTING_TYPE_NO_SPAWN(Screenshot); /// /// Captures the specified render target contents and saves it to the file. diff --git a/Source/Engine/Utilities/StateMachine.h b/Source/Engine/Utilities/StateMachine.h index 7feeeccb7..280ab4b93 100644 --- a/Source/Engine/Utilities/StateMachine.h +++ b/Source/Engine/Utilities/StateMachine.h @@ -14,11 +14,9 @@ class FLAXENGINE_API State friend StateMachine; protected: - StateMachine* _parent; protected: - /// /// Init /// @@ -31,7 +29,6 @@ protected: ~State(); public: - /// /// State's activity /// @@ -58,7 +55,6 @@ public: } protected: - virtual void enterState() { } @@ -76,12 +72,10 @@ class FLAXENGINE_API StateMachine friend State; protected: - State* _currentState; Array _states; public: - /// /// Init /// @@ -93,7 +87,6 @@ public: virtual ~StateMachine(); public: - /// /// Gets current state /// @@ -113,7 +106,6 @@ public: } public: - /// /// Go to state /// @@ -130,6 +122,5 @@ public: virtual void GoToState(State* state); protected: - virtual void switchState(State* nextState); }; diff --git a/Source/Engine/Utilities/StringConverter.h b/Source/Engine/Utilities/StringConverter.h index df1345791..180b64e55 100644 --- a/Source/Engine/Utilities/StringConverter.h +++ b/Source/Engine/Utilities/StringConverter.h @@ -9,20 +9,17 @@ template class StringAsBase { protected: - const CharType* _static = nullptr; CharType* _dynamic = nullptr; CharType _inlined[InlinedSize]; public: - ~StringAsBase() { Allocator::Free(_dynamic); } public: - const CharType* Get() const { return _static ? _static : (_dynamic ? _dynamic : _inlined); @@ -38,12 +35,10 @@ template class StringAsANSI : public StringAsBase { public: - typedef char CharType; typedef StringAsBase Base; public: - StringAsANSI(const char* text) { this->_static = text; @@ -74,12 +69,10 @@ template class StringAsUTF8 : public StringAsBase { public: - typedef char CharType; typedef StringAsBase Base; public: - StringAsUTF8(const char* text) { this->_static = text; @@ -110,12 +103,10 @@ template class StringAsUTF16 : public StringAsBase { public: - typedef Char CharType; typedef StringAsBase Base; public: - StringAsUTF16(const char* text) : StringAsUTF16(text, StringUtils::Length(text)) { diff --git a/Source/Engine/Utilities/TextProcessing.h b/Source/Engine/Utilities/TextProcessing.h index f903da382..cdd65d7fa 100644 --- a/Source/Engine/Utilities/TextProcessing.h +++ b/Source/Engine/Utilities/TextProcessing.h @@ -14,19 +14,16 @@ class FLAXENGINE_API TextProcessing : public NonCopyable { public: - /// /// Separator structure /// struct SeparatorData { public: - char C0; char C1; public: - SeparatorData() : C0(0) , C1(0) @@ -52,7 +49,6 @@ public: } public: - bool IsWhiteSpace() const { return *this == SeparatorData('\r', '\n') @@ -62,7 +58,6 @@ public: } public: - bool operator==(const SeparatorData& other) const { return C0 == other.C0 && C1 == other.C1; @@ -80,13 +75,11 @@ public: struct Token { public: - const char* Start; int32 Length; SeparatorData Separator; public: - Token() : Start(nullptr) , Length(0) @@ -135,14 +128,12 @@ public: }*/ public: - StringAnsi ToString() const { return StringAnsi(Start, Length); } public: - FORCE_INLINE bool Equals(const Token& other) const { return Equals(other.Start, other.Length); @@ -159,7 +150,6 @@ public: } public: - FORCE_INLINE bool EqualsIgnoreCase(const Token& other) const { return EqualsIgnoreCase(other.Start, other.Length); @@ -176,7 +166,6 @@ public: } public: - FORCE_INLINE bool operator==(const char* text) const { auto token = Token(text); @@ -195,7 +184,6 @@ public: }; private: - const char* _buffer; int32 _length; char* _cursor; @@ -203,7 +191,6 @@ private: int32 _line; public: - /// /// Init /// @@ -212,7 +199,6 @@ public: TextProcessing(const char* input, int32 length); public: - /// /// Array with all token separators /// @@ -224,14 +210,12 @@ public: Array Whitespaces; public: - /// /// Set separators and white chars for HLSL language /// void Setup_HLSL(); public: - /// /// Returns true if there are still characters in the buffer and can read data from it /// @@ -260,7 +244,6 @@ public: } public: - /// /// Read single character from the buffer /// @@ -290,7 +273,6 @@ public: void ReadLine(); private: - char moveForward(); char moveBack(); }; diff --git a/Source/Engine/Utilities/TextWriter.h b/Source/Engine/Utilities/TextWriter.h index 5d2eb231e..c213d6ba2 100644 --- a/Source/Engine/Utilities/TextWriter.h +++ b/Source/Engine/Utilities/TextWriter.h @@ -15,11 +15,9 @@ template class TextWriter : public Object, public NonCopyable { private: - MemoryWriteStream _buffer; public: - /// /// Init with default capacity /// @@ -37,7 +35,6 @@ public: } public: - /// /// Gets writer private buffer /// @@ -57,7 +54,6 @@ public: } public: - /// /// Write line terminator sign /// @@ -139,7 +135,6 @@ public: } public: - /// /// Clear whole data /// @@ -149,7 +144,6 @@ public: } public: - // [Object] String ToString() const override { diff --git a/Source/Engine/Visject/Graph.h b/Source/Engine/Visject/Graph.h index 00110070f..cf342f158 100644 --- a/Source/Engine/Visject/Graph.h +++ b/Source/Engine/Visject/Graph.h @@ -23,14 +23,12 @@ template class Graph { public: - typedef Graph GraphType; typedef NodeType Node; typedef BoxType Box; typedef ParameterType Parameter; private: - struct TmpConnectionHint { Node* Node; @@ -56,7 +54,6 @@ public: VisjectMeta Meta; public: - /// /// Initializes a new instance of the class. /// @@ -72,7 +69,6 @@ public: } public: - /// /// Save graph to the stream /// @@ -456,7 +452,6 @@ public: } public: - /// /// Find node by ID /// @@ -528,7 +523,6 @@ public: } public: - #if USE_EDITOR /// @@ -561,7 +555,6 @@ public: #endif protected: - virtual bool onNodeCreated(Node* n) { return false; diff --git a/Source/Engine/Visject/GraphNode.h b/Source/Engine/Visject/GraphNode.h index cbd94e40e..ec6f48d5c 100644 --- a/Source/Engine/Visject/GraphNode.h +++ b/Source/Engine/Visject/GraphNode.h @@ -19,7 +19,6 @@ class GraphNode; class GraphBox { public: - /// /// The parent node /// @@ -41,7 +40,6 @@ public: Array> Connections; public: - GraphBox() : Parent(nullptr) , ID(0) @@ -75,7 +73,6 @@ public: } public: - /// /// Gets the parent node. /// @@ -101,12 +98,10 @@ template class GraphNode { public: - typedef BoxType Box; typedef GraphNode Node; public: - /// /// Unique node ID (within a graph). /// @@ -139,7 +134,6 @@ public: VisjectMeta Meta; public: - GraphNode() : ID(0) , Type(0) @@ -154,7 +148,6 @@ public: } public: - /// /// Gets all the valid boxes. /// diff --git a/Source/Engine/Visject/GraphParameter.h b/Source/Engine/Visject/GraphParameter.h index e82ad1899..93eba061a 100644 --- a/Source/Engine/Visject/GraphParameter.h +++ b/Source/Engine/Visject/GraphParameter.h @@ -41,9 +41,8 @@ API_ENUM() enum class ChannelMask /// API_CLASS() class FLAXENGINE_API GraphParameter : public ScriptingObject { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(GraphParameter, ScriptingObject); public: - /// /// Parameter type /// @@ -75,7 +74,6 @@ public: VisjectMeta Meta; public: - /// /// Gets the typename of the parameter type (excluding in-build types). /// diff --git a/Source/Engine/Visject/ShaderGraph.cpp b/Source/Engine/Visject/ShaderGraph.cpp index cfe55d992..5b3b6550b 100644 --- a/Source/Engine/Visject/ShaderGraph.cpp +++ b/Source/Engine/Visject/ShaderGraph.cpp @@ -64,65 +64,31 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Constant value + // Constant value case 1: case 2: case 3: case 12: + case 15: value = Value(node->Values[0]); break; + // Float2/3/4, Color case 4: - { - const Variant& cv = node->Values[0]; - if (box->ID == 0) - value = Value(cv); - else if (box->ID == 1) - value = Value(cv.AsFloat2().X); - else if (box->ID == 2) - value = Value(cv.AsFloat2().Y); - break; - } case 5: - { - const Variant& cv = node->Values[0]; - if (box->ID == 0) - value = Value(cv); - else if (box->ID == 1) - value = Value(cv.AsFloat3().X); - else if (box->ID == 2) - value = Value(cv.AsFloat3().Y); - else if (box->ID == 3) - value = Value(cv.AsFloat3().Z); - break; - } case 6: - { - const Variant& cv = node->Values[0]; - if (box->ID == 0) - value = Value(cv); - else if (box->ID == 1) - value = Value(cv.AsFloat4().X); - else if (box->ID == 2) - value = Value(cv.AsFloat4().Y); - else if (box->ID == 3) - value = Value(cv.AsFloat4().Z); - else if (box->ID == 4) - value = Value(cv.AsFloat4().W); - break; - } case 7: { - const Variant& cv = node->Values[0]; + const Float4 cv = (Float4)node->Values[0]; if (box->ID == 0) value = Value(cv); else if (box->ID == 1) - value = Value(cv.AsColor().R); + value = Value(cv.X); else if (box->ID == 2) - value = Value(cv.AsColor().G); + value = Value(cv.Y); else if (box->ID == 3) - value = Value(cv.AsColor().B); + value = Value(cv.Z); else if (box->ID == 4) - value = Value(cv.AsColor().A); + value = Value(cv.W); break; } case 8: @@ -130,12 +96,30 @@ void ShaderGenerator::ProcessGroupConstants(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // PI + // PI case 10: { value = Value(PI); break; } + // Vector2/3/4 + case 16: + case 17: + case 18: + { + const Vector4 cv = (Vector4)node->Values[0]; + if (box->ID == 0) + value = Value(cv); + else if (box->ID == 1) + value = Value(cv.X); + else if (box->ID == 2) + value = Value(cv.Y); + else if (box->ID == 3) + value = Value(cv.Z); + else if (box->ID == 4) + value = Value(cv.W); + break; + } default: break; } @@ -145,7 +129,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Add, Subtract, Multiply, Divide, Modulo + // Add, Subtract, Multiply, Divide, Modulo case 1: case 2: case 3: @@ -191,7 +175,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeOperation2(node, v1, v2, op); break; } - // Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent + // Absolute Value, Ceil, Cosine, Floor, Normalize, Round, Saturate, Sine, Sqrt, Tangent case 7: case 8: case 9: @@ -209,14 +193,14 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction1(node, v1, function); break; } - // Length + // Length case 11: { String text = String::Format(TEXT("length({0})"), tryGetValue(node->GetBox(0), Value::Zero).Value); value = writeLocal(ValueType::Float, text, node); break; } - // Cross, Max, Min, Pow + // Cross, Max, Min, Pow case 18: case 21: case 22: @@ -230,7 +214,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function); break; } - // Distance, Dot + // Distance, Dot case 19: case 20: { @@ -242,7 +226,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function, ValueType::Float); break; } - // Clamp + // Clamp case 24: { Box* b1 = node->GetBox(0); @@ -254,7 +238,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction3(node, v1, v2, v3, TEXT("clamp"), v1.Type); break; } - // Lerp + // Lerp case 25: { Value a = tryGetValue(node->GetBox(0), 0, Value::Zero); @@ -264,7 +248,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(a.Type, text, node); break; } - // Reflect + // Reflect case 26: { Box* b1 = node->GetBox(0); @@ -275,7 +259,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, function); break; } - // Negate + // Negate case 27: { Box* b1 = node->GetBox(0); @@ -283,21 +267,21 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(v1.Type, String(TEXT("-")) + v1.Value, node); break; } - // 1 - Value + // 1 - Value case 28: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); value = writeOperation2(node, Value::InitForOne(v1.Type), v1, '-'); break; } - // Derive Normal Z + // Derive Normal Z case 29: { Value inXY = tryGetValue(node->GetBox(0), Value::Zero).AsFloat2(); value = writeLocal(ValueType::Float3, String::Format(TEXT("float3({0}, sqrt(saturate(1.0 - dot({0}.xy, {0}.xy))))"), inXY.Value), node); break; } - // Mad + // Mad case 31: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -307,7 +291,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(v1.Type, text, node); break; } - // Extract Largest Component + // Extract Largest Component case 32: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -316,25 +300,25 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) _includes.Add(TEXT("./Flax/Math.hlsl")); break; } - // Asine + // Asine case 33: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("asin")); break; } - // Acosine + // Acosine case 34: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("acos")); break; } - // Atan + // Atan case 35: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("atan")); break; } - // Bias and Scale + // Bias and Scale case 36: { ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float); @@ -345,7 +329,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(input.Type, text, node); break; } - // Rotate About Axis + // Rotate About Axis case 37: { const auto normalizedRotationAxis = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3(); @@ -357,19 +341,19 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Float3, text, node); break; } - // Trunc + // Trunc case 38: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("trunc")); break; } - // Frac + // Frac case 39: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("frac")); break; } - // Fmod + // Fmod case 40: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -377,7 +361,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, TEXT("fmod")); break; } - // Atan2 + // Atan2 case 41: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -385,7 +369,7 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeFunction2(node, v1, v2, TEXT("atan2")); break; } - // Near Equal + // Near Equal case 42: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -394,30 +378,30 @@ void ShaderGenerator::ProcessGroupMath(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Bool, String::Format(TEXT("distance({0},{1}) < {2}"), v1.Value, v2.Value, epsilon.Value), node); break; } - // Degrees + // Degrees case 43: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("degrees")); break; } - // Radians + // Radians case 44: { value = writeFunction1(node, tryGetValue(node->GetBox(0), Value::Zero), TEXT("radians")); break; } - // Remap + // Remap case 48: { - const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat); + const auto inVal = tryGetValue(node->GetBox(0), node->Values[0].AsFloat); const auto rangeA = tryGetValue(node->GetBox(1), node->Values[1].AsFloat2()); const auto rangeB = tryGetValue(node->GetBox(2), node->Values[2].AsFloat2()); - const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool(); + const auto clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool(); const auto mapFunc = String::Format(TEXT("{2}.x + ({0} - {1}.x) * ({2}.y - {2}.x) / ({1}.y - {1}.x)"), inVal.Value, rangeA.Value, rangeB.Value); value = writeLocal(ValueType::Float, String::Format(TEXT("{2} ? clamp({0}, {1}.x, {1}.y) : {0}"), mapFunc, rangeB.Value, clamp.Value), node); break; } - // Rotate Vector + // Rotate Vector case 49: { const Value quaternion = tryGetValue(node->GetBox(0), Value::InitForZero(VariantType::Quaternion)).Cast(VariantType::Quaternion); @@ -434,7 +418,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Pack + // Pack case 20: { Box* bX = node->GetBox(1); @@ -476,7 +460,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // Unpack + // Unpack case 30: { Box* b = node->GetBox(0); @@ -518,7 +502,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value::Zero; break; } - // Mask X, Y, Z, W + // Mask X, Y, Z, W case 40: case 41: case 42: @@ -528,7 +512,7 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value(ValueType::Float, v.Value + _subs[node->TypeID - 40]); break; } - // Mask XY, YZ, XZ,... + // Mask XY, YZ, XZ,... case 44: { value = tryGetValue(node->GetBox(0), Float2::Zero).AsFloat2(); @@ -552,13 +536,13 @@ void ShaderGenerator::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Value(ValueType::Float2, v.Value + TEXT(".zw")); break; } - // Mask XYZ + // Mask XYZ case 70: { value = tryGetValue(node->GetBox(0), Float4::Zero).AsFloat3(); break; } - // Append + // Append case 100: { auto in0 = node->GetBox(0); @@ -602,7 +586,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Desaturation + // Desaturation case 2: { Value input = tryGetValue(node->GetBox(0), Value::Zero).AsFloat3(); @@ -612,7 +596,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) value = writeFunction3(node, input, dot, scale, TEXT("lerp"), ValueType::Float3); break; } - // Color Gradient + // Color Gradient case 10: { Value time, prevTime, curTime; @@ -677,7 +661,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Curve + // Curve #define SAMPLE_CURVE(id, curves, type, graphType) \ case id: \ { \ @@ -691,7 +675,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) SAMPLE_CURVE(14, Float3Curves, AsFloat3, Float3) SAMPLE_CURVE(15, Float4Curves, AsFloat4, Float4) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: { // Get the variable type @@ -739,7 +723,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) value.Value = param->ShaderName; break; } - // Platform Switch + // Platform Switch case 17: { bool usesAnyPlatformSpecificInput = false; @@ -784,7 +768,7 @@ void ShaderGenerator::ProcessGroupTools(Box* box, Node* node, Value& value) #undef PLATFORM_CASE break; } - // Reroute + // Reroute case 29: value = tryGetValue(node->GetBox(0), Value::Zero); break; @@ -797,7 +781,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { // Get A value @@ -807,7 +791,7 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Bool, String::Format(TEXT("!{0}"), a.Value), node); break; } - // AND, OR, XOR, NOR, NAND + // AND, OR, XOR, NOR, NAND case 2: case 3: case 4: @@ -822,28 +806,28 @@ void ShaderGenerator::ProcessGroupBoolean(Box* box, Node* node, Value& value) const Char* op; switch (node->TypeID) { - // AND + // AND case 2: op = TEXT("{0} && {1}"); break; - // OR + // OR case 3: op = TEXT("{0} || {1}"); break; - // XOR + // XOR case 4: op = TEXT("!{0} != !{1}"); break; - // NOR + // NOR case 5: op = TEXT("!({0} || {1})"); break; - // NAND + // NAND case 6: op = TEXT("!({0} && {1})"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node); @@ -858,7 +842,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { // Get A value @@ -868,7 +852,7 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) value = writeLocal(ValueType::Int, String::Format(TEXT("!{0}"), a.Value), node); break; } - // AND, OR, XOR + // AND, OR, XOR case 2: case 3: case 4: @@ -881,20 +865,20 @@ void ShaderGenerator::ProcessGroupBitwise(Box* box, Node* node, Value& value) const Char* op; switch (node->TypeID) { - // AND + // AND case 2: op = TEXT("{0} & {1}"); break; - // OR + // OR case 3: op = TEXT("{0} | {1}"); break; - // XOR + // XOR case 4: op = TEXT("{0} ^ {1}"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Int, String::Format(op, a.Value, b.Value), node); @@ -909,7 +893,7 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value { switch (node->TypeID) { - // ==, !=, >, <=, >= + // ==, !=, >, <=, >= case 1: case 2: case 3: @@ -944,13 +928,13 @@ void ShaderGenerator::ProcessGroupComparisons(Box* box, Node* node, Value& value op = TEXT("{0} >= {1}"); break; default: - CRASH; + CRASH; return; } value = writeLocal(ValueType::Bool, String::Format(op, a.Value, b.Value), node); break; } - // Switch On Bool + // Switch On Bool case 7: { const Value condition = tryGetValue(node->GetBox(0), Value::False).AsBool(); @@ -1130,7 +1114,7 @@ ShaderGenerator::Value ShaderGenerator::writeLocal(ValueType type, const String& ShaderGenerator::Value ShaderGenerator::writeOperation2(Node* caller, const Value& valueA, const Value& valueB, Char op1) { - const Char op1Str[2] = { op1, 0}; + const Char op1Str[2] = { op1, 0 }; const String value = String::Format(TEXT("{0} {1} {2}"), valueA.Value, op1Str, Value::Cast(valueB, valueA.Type).Value); return writeLocal(valueA.Type, value, caller); } diff --git a/Source/Engine/Visject/ShaderGraph.h b/Source/Engine/Visject/ShaderGraph.h index c4ce62a05..9708fdead 100644 --- a/Source/Engine/Visject/ShaderGraph.h +++ b/Source/Engine/Visject/ShaderGraph.h @@ -23,14 +23,12 @@ class ShaderGraphNode; class ShaderGraphBox : public GraphBox { public: - /// /// The cached value. /// ShaderGraphValue Cache; public: - ShaderGraphBox() : GraphBox() { @@ -47,7 +45,6 @@ public: } public: - FORCE_INLINE ShaderGraphBox* FirstConnection() const { return (ShaderGraphBox*)Connections[0]; @@ -58,7 +55,6 @@ template class ShaderGraphNode : public GraphNode { public: - struct CurveData { /// @@ -79,14 +75,12 @@ public: }; public: - ShaderGraphNode() : GraphNode() { } public: - /// /// The custom data (depends on node type). Used to cache data for faster usage at runtime. /// @@ -96,7 +90,6 @@ public: class ShaderGraphParameter : public GraphParameter { public: - ShaderGraphParameter() : GraphParameter(SpawnParams(Guid::New(), TypeInitializer)) { @@ -123,12 +116,10 @@ template, class BoxType = ShaderGraphBox, cla class ShaderGraph : public Graph { public: - typedef ShaderGraphValue Value; typedef Graph Base; public: - /// /// The float curves used by the graph. /// @@ -150,18 +141,17 @@ public: Array> Float4Curves; public: - // [Graph] bool onNodeLoaded(NodeType* n) override { // Check if this node needs a state or data cache switch (n->GroupID) { - // Tools + // Tools case 7: switch (n->TypeID) { - // Curves + // Curves #define SETUP_CURVE(id, curves, access) \ case id: \ { \ @@ -201,7 +191,6 @@ public: class ShaderGenerator { public: - typedef ShaderGraph<> Graph; typedef ShaderGraph<>::Node Node; typedef ShaderGraph<>::Box Box; @@ -212,7 +201,6 @@ public: typedef Function ProcessBoxHandler; protected: - int32 _localIndex; Dictionary _functions; Array _parameters; @@ -223,7 +211,6 @@ protected: Array> _graphStack; public: - /// /// Initializes a new instance of the class. /// @@ -235,7 +222,6 @@ public: ~ShaderGenerator(); public: - ErrorHandler Error; /// @@ -244,7 +230,6 @@ public: AssetsContainer Assets; public: - void OnError(Node* node, Box* box, const StringView& message); void ProcessGroupConstants(Box* box, Node* node, Value& value); @@ -256,12 +241,10 @@ public: void ProcessGroupComparisons(Box* box, Node* node, Value& value); protected: - static const Char* _mathFunctions[]; static const Char* _subs[]; protected: - Value eatBox(Node* caller, Box* box); Value tryGetValue(Box* box, int32 defaultValueBoxIndex, const Value& defaultValue); Value tryGetValue(Box* box, const Value& defaultValue); diff --git a/Source/Engine/Visject/ShaderGraphValue.h b/Source/Engine/Visject/ShaderGraphValue.h index 79f53ab8c..e0fdb9d95 100644 --- a/Source/Engine/Visject/ShaderGraphValue.h +++ b/Source/Engine/Visject/ShaderGraphValue.h @@ -12,11 +12,9 @@ struct ShaderGraphValue : Object { private: - static const Char* _subs[]; public: - /// /// The value type. /// @@ -28,7 +26,6 @@ public: String Value; public: - /// /// Zero value (as float). /// @@ -55,7 +52,6 @@ public: static const ShaderGraphValue False; public: - /// /// Initializes a new instance of the struct. /// @@ -117,6 +113,16 @@ public: { } + /// + /// Initializes a new instance of the struct. + /// + /// The value. + explicit ShaderGraphValue(const double value) + : Type(VariantType::Types::Float) + , Value(StringUtils::ToString(value)) + { + } + /// /// Initializes a new instance of the struct. /// @@ -134,7 +140,6 @@ public: explicit ShaderGraphValue(const Variant& v); public: - /// /// Returns true if value is valid. /// @@ -175,7 +180,6 @@ public: } public: - /// /// Formats thw value. /// @@ -227,7 +231,6 @@ public: } public: - /// /// Initializes the shader variable for given connection type Zero. /// @@ -301,7 +304,6 @@ public: } public: - /// /// Gets the X component of the value. Valid only for single or vector types. /// @@ -339,7 +341,6 @@ public: } public: - /// /// Casts the value to the bool type. /// @@ -422,7 +423,6 @@ public: static ShaderGraphValue Cast(const ShaderGraphValue& v, VariantType::Types to); public: - // [Object] String ToString() const override { diff --git a/Source/Engine/Visject/VisjectGraph.cpp b/Source/Engine/Visject/VisjectGraph.cpp index 446da61f0..5f14d99de 100644 --- a/Source/Engine/Visject/VisjectGraph.cpp +++ b/Source/Engine/Visject/VisjectGraph.cpp @@ -51,51 +51,31 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Constant value + // Constant value case 1: case 2: case 3: case 12: + case 15: value = node->Values[0]; break; + // Float2/3/4, Color case 4: - { - const Value& cv = node->Values[0]; - if (box->ID == 0) - value = cv; - else if (box->ID == 1) - value = cv.AsFloat2().X; - else if (box->ID == 2) - value = cv.AsFloat2().Y; - break; - } case 5: - { - const Value& cv = node->Values[0]; - if (box->ID == 0) - value = cv; - else if (box->ID == 1) - value = cv.AsFloat3().X; - else if (box->ID == 2) - value = cv.AsFloat3().Y; - else if (box->ID == 3) - value = cv.AsFloat3().Z; - break; - } case 6: case 7: { - const Value& cv = node->Values[0]; + const Float4 cv = (Float4)node->Values[0]; if (box->ID == 0) value = cv; else if (box->ID == 1) - value = cv.AsFloat4().X; + value = cv.X; else if (box->ID == 2) - value = cv.AsFloat4().Y; + value = cv.Y; else if (box->ID == 3) - value = cv.AsFloat4().Z; + value = cv.Z; else if (box->ID == 4) - value = cv.AsFloat4().W; + value = cv.W; break; } case 8: @@ -109,15 +89,15 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value) case 9: value = node->Values[0]; break; - // PI + // PI case 10: value = PI; break; - // Enum + // Enum case 11: value = node->Values[0]; break; - // Array + // Array case 13: value = node->Values[0]; if (value.Type.Type == VariantType::Array) @@ -145,6 +125,24 @@ void VisjectExecutor::ProcessGroupConstants(Box* box, Node* node, Value& value) value.Type.SetTypeName(typeName); break; } + // Vector2/3/4 + case 16: + case 17: + case 18: + { + const Vector4 cv = (Vector4)node->Values[0]; + if (box->ID == 0) + value = cv; + else if (box->ID == 1) + value = cv.X; + else if (box->ID == 2) + value = cv.Y; + else if (box->ID == 3) + value = cv.Z; + else if (box->ID == 4) + value = cv.W; + break; + } default: break; } @@ -154,7 +152,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2 + // Add, Subtract, Multiply, Divide, Modulo, Max, Min, Pow, Fmod, Atan2 case 1: case 2: case 3: @@ -176,7 +174,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1, v2); break; } - // Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians + // Absolute Value, Ceil, Cosine, Floor, Round, Saturate, Sine, Sqrt, Tangent, Negate, 1 - Value, Asine, Acosine, Atan, Trunc, Frac, Degrees, Radians case 7: case 8: case 9: @@ -200,7 +198,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) GraphUtilities::ApplySomeMathHere(node->TypeID, value, v1); break; } - // Length, Normalize + // Length, Normalize case 11: case 12: { @@ -271,7 +269,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Cross, Distance, Dot + // Cross, Distance, Dot case 18: case 19: case 20: @@ -348,7 +346,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Clamp + // Clamp case 24: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -360,7 +358,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) }); break; } - // Lerp + // Lerp case 25: { Value a = tryGetValue(node->GetBox(0), 0, Value::Zero); @@ -369,7 +367,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Value::Lerp(a, b, alpha.AsFloat); break; } - // Reflect + // Reflect case 26: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -390,7 +388,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) } break; } - // Mad + // Mad case 31: { Value v1 = tryGetValue(node->GetBox(0), Value::Zero); @@ -402,14 +400,14 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) }); break; } - // Extract Largest Component + // Extract Largest Component case 32: { const auto v1 = (Float3)tryGetValue(node->GetBox(0), Value::Zero); value = Math::ExtractLargestComponent(v1); break; } - // Bias and Scale + // Bias and Scale case 36: { ASSERT(node->Values.Count() == 2 && node->Values[0].Type == VariantType::Float && node->Values[1].Type == VariantType::Float); @@ -419,7 +417,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = (input + bias) * scale; break; } - // Rotate About Axis + // Rotate About Axis case 37: { const auto normalizedRotationAxis = (Float3)tryGetValue(node->GetBox(0), Value::Zero); @@ -429,7 +427,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Math::RotateAboutAxis(normalizedRotationAxis, rotationAngle, pivotPoint, position); break; } - // Near Equal + // Near Equal case 42: { const Value a = tryGetValue(node->GetBox(0), node->Values[0]); @@ -438,23 +436,23 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = Value::NearEqual(a, b, epsilon); break; } - // Enum Value + // Enum Value case 45: value = (uint64)tryGetValue(node->GetBox(0), Value::Zero); break; - // Enum AND + // Enum AND case 46: value = tryGetValue(node->GetBox(0), Value::Zero); if (value.Type.Type == VariantType::Enum) value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero); break; - // Enum OR + // Enum OR case 47: value = tryGetValue(node->GetBox(0), Value::Zero); if (value.Type.Type == VariantType::Enum) value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero); break; - // Remap + // Remap case 48: { const float inVal = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat; @@ -465,7 +463,7 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value) value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc; break; } - // Rotate Vector + // Rotate Vector case 49: { const Quaternion quaternion = (Quaternion)tryGetValue(node->GetBox(0), Quaternion::Identity); @@ -482,7 +480,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Pack + // Pack case 20: { float vX = (float)tryGetValue(node->GetBox(1), node->Values[0]); @@ -530,7 +528,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Variant(BoundingBox(vX, vY)); break; } - // Unpack + // Unpack case 30: { Float2 v = (Float2)tryGetValue(node->GetBox(0), Float2::Zero); @@ -594,7 +592,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Pack Structure + // Pack Structure case 26: { // Find type @@ -677,7 +675,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Unpack Structure + // Unpack Structure case 36: { // Get value with structure data @@ -767,7 +765,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) } break; } - // Mask X, Y, Z, W + // Mask X, Y, Z, W case 40: case 41: case 42: @@ -777,7 +775,7 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = v.Raw[node->TypeID - 40]; break; } - // Mask XY, YZ, XZ,... + // Mask XY, YZ, XZ,... case 44: { value = (Float2)tryGetValue(node->GetBox(0), Float2::Zero); @@ -801,13 +799,13 @@ void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value) value = Float2(v.Z, v.W); break; } - // Mask XYZ + // Mask XYZ case 70: { value = (Float3)tryGetValue(node->GetBox(0), Float3::Zero); break; } - // Append + // Append case 100: { auto in0 = node->GetBox(0); @@ -862,7 +860,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Color Gradient + // Color Gradient case 10: { float time, prevTime, curTime; @@ -918,7 +916,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Curve + // Curve #define SAMPLE_CURVE(id, curves, type, graphType) \ case id: \ { \ @@ -933,7 +931,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) SAMPLE_CURVE(14, Float3Curves, Float3, Float3) SAMPLE_CURVE(15, Float4Curves, Float4, Float4) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: if (const auto asset = node->Assets[0].As()) { @@ -946,7 +944,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = Value::Zero; } break; - // Platform Switch + // Platform Switch case 17: { int32 boxId = 1; @@ -987,19 +985,19 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = tryGetValue(node->GetBox(node->GetBox(boxId)->HasConnection() ? boxId : 1), Value::Zero); break; } - // Asset Reference + // Asset Reference case 18: value = ::LoadAsset((Guid)node->Values[0], Asset::TypeInitializer); break; - // To String + // To String case 20: value.SetString(tryGetValue(node->GetBox(1), Value(StringView::Empty)).ToString()); break; - // Actor Reference + // Actor Reference case 21: value = Scripting::FindObject((Guid)node->Values[0]); break; - // As + // As case 22: { value = Value::Null; @@ -1015,7 +1013,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Type Reference node + // Type Reference node case 23: { const StringView typeName(node->Values[0]); @@ -1025,7 +1023,7 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) value = typeName; break; } - // Is + // Is case 24: { value = Value::False; @@ -1040,15 +1038,15 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value) } break; } - // Is Null + // Is Null case 27: value = (void*)tryGetValue(node->GetBox(1), Value::Null) == nullptr; break; - // Is Valid + // Is Valid case 28: value = (void*)tryGetValue(node->GetBox(1), Value::Null) != nullptr; break; - // Reroute + // Reroute case 29: value = tryGetValue(node->GetBox(0), Value::Zero); break; @@ -1061,14 +1059,14 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { const bool a = (bool)tryGetValue(node->GetBox(0), Value::False); value = !a; break; } - // AND, OR, XOR, NOR, NAND + // AND, OR, XOR, NOR, NAND case 2: case 3: case 4: @@ -1080,23 +1078,23 @@ void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value) bool result = false; switch (node->TypeID) { - // AND + // AND case 2: result = a && b; break; - // OR + // OR case 3: result = a || b; break; - // XOR + // XOR case 4: result = !a != !b; break; - // NOR + // NOR case 5: result = !(a || b); break; - // NAND + // NAND case 6: result = !(a && b); break; @@ -1113,14 +1111,14 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // NOT + // NOT case 1: { const int32 a = (int32)tryGetValue(node->GetBox(0), Value(0)); value = !a; break; } - // AND, OR, XOR + // AND, OR, XOR case 2: case 3: case 4: @@ -1130,15 +1128,15 @@ void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value) int32 result = 0; switch (node->TypeID) { - // AND + // AND case 2: result = a & b; break; - // OR + // OR case 3: result = a | b; break; - // XOR + // XOR case 4: result = a ^ b; break; @@ -1155,7 +1153,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value { switch (node->TypeID) { - // ==, !=, >, <=, >= + // ==, !=, >, <=, >= case 1: case 2: case 3: @@ -1190,7 +1188,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value value = result; break; } - // Switch On Bool + // Switch On Bool case 7: { const Value condition = tryGetValue(node->GetBox(0), Value::False); @@ -1200,7 +1198,7 @@ void VisjectExecutor::ProcessGroupComparisons(Box* box, Node* node, Value& value value = tryGetValue(node->GetBox(1), 0, Value::Zero); break; } - // Switch On Enum + // Switch On Enum case 8: { const Value v = tryGetValue(node->GetBox(0), Value::Null); @@ -1229,31 +1227,31 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) { switch (node->TypeID) { - // Random Float + // Random Float case 208: { value = RAND; break; } - // Random Vector2 + // Random Vector2 case 209: { value = Float2(RAND, RAND); break; } - // Random Vector3 + // Random Vector3 case 210: { value = Float3(RAND, RAND, RAND); break; } - // Random Vector4 + // Random Vector4 case 211: { value = Float4(RAND, RAND, RAND, RAND); break; } - // Random Float Range + // Random Float Range case 213: { auto& a = node->Values[0].AsFloat; @@ -1261,7 +1259,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) value = Math::Lerp(a, b, RAND); break; } - // Random Vector2 Range + // Random Vector2 Range case 214: { auto a = (Float2)node->Values[0]; @@ -1272,7 +1270,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) ); break; } - // Random Vector3 Range + // Random Vector3 Range case 215: { auto a = (Float3)node->Values[0]; @@ -1284,7 +1282,7 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) ); break; } - // Random Vector4 Range + // Random Vector4 Range case 216: { auto a = (Float4)node->Values[0]; @@ -1315,39 +1313,39 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value Box* b; switch (node->TypeID) { - // Count + // Count case 1: value = array.Count(); break; - // Contains + // Contains case 2: value = array.Contains(tryGetValue(node->GetBox(1), Value::Null)); break; - // Find + // Find case 3: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to find.")); value = array.Find(eatBox(b->GetParent(), b->FirstConnection())); break; - // Find Last + // Find Last case 4: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to find.")); value = array.FindLast(eatBox(b->GetParent(), b->FirstConnection())); break; - // Clear + // Clear case 5: array.Clear(); value = MoveTemp(v); break; - // Remove + // Remove case 6: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to remove.")); array.Remove(eatBox(b->GetParent(), b->FirstConnection())); value = MoveTemp(v); break; - // Remove At + // Remove At case 7: { const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null); @@ -1356,14 +1354,14 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Add + // Add case 8: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to add.")); array.Add(eatBox(b->GetParent(), b->FirstConnection())); value = MoveTemp(v); break; - // Insert + // Insert case 9: { b = node->GetBox(1); @@ -1374,7 +1372,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Get + // Get case 10: { const int32 index = (int32)tryGetValue(node->GetBox(1), 0, Value::Null); @@ -1382,7 +1380,7 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(array[index]); break; } - // Set + // Set case 11: { b = node->GetBox(2); @@ -1393,17 +1391,17 @@ void VisjectExecutor::ProcessGroupCollections(Box* box, Node* node, Value& value value = MoveTemp(v); break; } - // Sort + // Sort case 12: Sorting::QuickSort(array.Get(), array.Count()); value = MoveTemp(v); break; - // Reverse + // Reverse case 13: array.Reverse(); value = MoveTemp(v); break; - // Add Unique + // Add Unique case 14: b = node->GetBox(1); ENSURE(b->HasConnection(), TEXT("Missing value to add.")); diff --git a/Source/Engine/Visject/VisjectGraph.h b/Source/Engine/Visject/VisjectGraph.h index 845ee9106..6e2c338b1 100644 --- a/Source/Engine/Visject/VisjectGraph.h +++ b/Source/Engine/Visject/VisjectGraph.h @@ -19,7 +19,6 @@ class VisjectGraphNode; class VisjectGraphBox : public GraphBox { public: - VisjectGraphBox() : GraphBox() { @@ -45,7 +44,6 @@ template class VisjectGraphNode : public GraphNode { public: - struct CurveData { /// @@ -82,14 +80,12 @@ public: }; public: - VisjectGraphNode() : GraphNode() { } public: - /// /// The custom data (depends on node type). Used to cache data for faster usage at runtime. /// @@ -107,9 +103,8 @@ public: /// API_CLASS() class VisjectGraphParameter : public GraphParameter { -DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter); + DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(VisjectGraphParameter, GraphParameter); public: - VisjectGraphParameter(const VisjectGraphParameter& other) : VisjectGraphParameter() { @@ -136,7 +131,6 @@ public: typedef Graph Base; public: - /// /// The float curves used by the graph. /// @@ -158,17 +152,16 @@ public: Array> Float4Curves; public: - // [Graph] bool onNodeLoaded(NodeType* n) override { switch (n->GroupID) { - // Tools + // Tools case 7: switch (n->TypeID) { - // Curves + // Curves #define SETUP_CURVE(id, curves, access) \ case id: \ { \ @@ -193,7 +186,7 @@ public: SETUP_CURVE(14, Float3Curves, AsFloat3()) SETUP_CURVE(15, Float4Curves, AsFloat4()) #undef SETUP_CURVE - // Get Gameplay Global + // Get Gameplay Global case 16: { n->Assets[0] = ::LoadAsset((Guid)n->Values[0], Asset::TypeInitializer); @@ -223,11 +216,9 @@ public: typedef void (VisjectExecutor::*ProcessBoxHandler)(Box*, Node*, Value&); protected: - ProcessBoxHandler _perGroupProcessCall[19]; public: - /// /// Initializes a new instance of the class. /// @@ -239,11 +230,9 @@ public: ~VisjectExecutor(); public: - ErrorHandler Error; public: - virtual void OnError(Node* node, Box* box, const StringView& message); void ProcessGroupConstants(Box* box, Node* node, Value& value); @@ -257,7 +246,6 @@ public: void ProcessGroupCollections(Box* box, Node* node, Value& value); protected: - virtual Value eatBox(Node* caller, Box* box) = 0; virtual Graph* GetCurrentGraph() const = 0; diff --git a/Source/Engine/Visject/VisjectMeta.h b/Source/Engine/Visject/VisjectMeta.h index 17e6fc497..08a40b299 100644 --- a/Source/Engine/Visject/VisjectMeta.h +++ b/Source/Engine/Visject/VisjectMeta.h @@ -11,7 +11,6 @@ class VisjectMeta { public: - /// /// Metadata entry /// @@ -23,14 +22,12 @@ public: }; public: - /// /// All meta entries /// Array> Entries; public: - /// /// Initializes a new instance of the class. /// @@ -44,7 +41,6 @@ public: } public: - /// /// Load from the stream /// diff --git a/Source/Platforms/PS4 b/Source/Platforms/PS4 deleted file mode 160000 index e32393633..000000000 --- a/Source/Platforms/PS4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e32393633bb204803f177a197e3d5751919ce010 diff --git a/Source/Platforms/PS5 b/Source/Platforms/PS5 deleted file mode 160000 index 3cd9b6ec9..000000000 --- a/Source/Platforms/PS5 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3cd9b6ec922a3fcc6b1e109a7c3c6369cdf301b7 diff --git a/Source/Platforms/Switch b/Source/Platforms/Switch deleted file mode 160000 index 48a35afd9..000000000 --- a/Source/Platforms/Switch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 48a35afd945f38e19bc7aa18412ad113f92dfdd3