From d7d320e2ac0a936b05eb7890016a00f822ba0596 Mon Sep 17 00:00:00 2001 From: Sylvain Doremus Date: Mon, 10 Apr 2023 00:30:57 +0200 Subject: [PATCH] Castor3D: Replaced remaining XxxSPtrs with their UPtr counterpart. --- data/vcpkg/ports/ashes/vcpkg.json | 2 +- .../Castor3D/Animation/AnimationModule.hpp | 11 +- include/Core/Castor3D/Buffer/BufferModule.hpp | 15 +- .../Core/Castor3D/Buffer/UniformBuffer.hpp | 2 +- include/Core/Castor3D/Cache/CacheModule.hpp | 6 +- .../Core/Castor3D/Cache/ElementProducer.hpp | 35 -- include/Core/Castor3D/Cache/ShaderCache.hpp | 2 +- include/Core/Castor3D/Castor3DModule.hpp | 8 +- include/Core/Castor3D/Castor3DPch.hpp | 1 - .../Core/Castor3D/Castor3DPrerequisites.hpp | 1 - .../Castor3D/Event/Frame/FrameEventModule.hpp | 12 +- .../Event/UserInput/UserInputEventModule.hpp | 16 +- .../Core/Castor3D/Gui/Controls/CtrlButton.hpp | 2 +- .../Castor3D/Gui/Controls/CtrlComboBox.hpp | 2 +- .../Castor3D/Gui/Controls/CtrlControl.hpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlEdit.hpp | 2 +- .../Gui/Controls/CtrlExpandablePanel.hpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlFrame.hpp | 2 +- .../Castor3D/Gui/Controls/CtrlListBox.hpp | 2 +- .../Castor3D/Gui/Controls/CtrlProgress.hpp | 2 +- .../Castor3D/Gui/Controls/CtrlScrollBar.hpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlSlider.hpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlStatic.hpp | 2 +- include/Core/Castor3D/Gui/GuiModule.hpp | 64 +-- .../Core/Castor3D/Material/MaterialModule.hpp | 9 +- .../Pass/Component/ComponentModule.hpp | 439 ++++++++++++++++-- include/Core/Castor3D/Material/Pass/Pass.hpp | 4 +- .../Castor3D/Material/Pass/PassModule.hpp | 11 +- .../Animation/TextureAnimationModule.hpp | 4 +- .../Material/Texture/TextureModule.hpp | 14 +- .../Castor3D/Material/Texture/TextureUnit.hpp | 17 +- .../Miscellaneous/MiscellaneousModule.hpp | 6 +- .../Mesh/Animation/MeshAnimationModule.hpp | 6 +- .../Castor3D/Model/Mesh/Generator/Cone.hpp | 1 + .../Castor3D/Model/Mesh/Generator/Cube.hpp | 1 + .../Model/Mesh/Generator/Cylinder.hpp | 1 + .../Model/Mesh/Generator/Icosahedron.hpp | 1 + .../Mesh/Generator/MeshGeneratorModule.hpp | 34 +- .../Castor3D/Model/Mesh/Generator/Plane.hpp | 1 + .../Model/Mesh/Generator/Projection.hpp | 1 + .../Castor3D/Model/Mesh/Generator/Sphere.hpp | 1 + .../Model/Mesh/Generator/SphereSection.hpp | 1 + .../Castor3D/Model/Mesh/Generator/Torus.hpp | 1 + .../Core/Castor3D/Model/Mesh/MeshFactory.hpp | 2 +- .../Core/Castor3D/Model/Mesh/MeshModule.hpp | 12 +- .../Submesh/Component/ComponentModule.hpp | 21 +- .../Model/Mesh/Submesh/SubmeshModule.hpp | 2 +- .../Animation/SkeletonAnimationModule.hpp | 10 +- .../Model/Skeleton/SkeletonModule.hpp | 13 +- .../Core/Castor3D/Overlay/OverlayModule.hpp | 18 +- include/Core/Castor3D/Plugin/PluginModule.hpp | 18 +- .../Castor3D/Render/Culling/CullingModule.hpp | 2 +- .../Render/EnvironmentMap/EnvironmentMap.hpp | 2 +- .../EnvironmentMap/EnvironmentMapModule.hpp | 4 +- .../LightPropagationVolumesModule.hpp | 16 +- .../VoxelConeTracing/VoxelizeModule.hpp | 8 +- .../Castor3D/Render/Node/RenderNodeModule.hpp | 8 +- .../Render/Opaque/Lighting/LightingModule.hpp | 2 +- .../Castor3D/Render/Opaque/OpaqueModule.hpp | 14 +- .../Render/Overlays/OverlaysModule.hpp | 4 +- .../Render/PBR/EnvironmentPrefilter.hpp | 1 - .../Core/Castor3D/Render/PBR/PbrModule.hpp | 2 +- .../Castor3D/Render/Passes/PassesModule.hpp | 18 +- .../Render/PostEffect/PostEffectModule.hpp | 2 +- .../Castor3D/Render/Prepass/PrepassModule.hpp | 8 +- include/Core/Castor3D/Render/RenderModule.hpp | 41 +- .../Core/Castor3D/Render/RenderNodesPass.hpp | 1 + include/Core/Castor3D/Render/RenderSystem.hpp | 2 +- include/Core/Castor3D/Render/RenderWindow.hpp | 2 +- .../Render/ShadowMap/ShadowMapModule.hpp | 4 +- .../Core/Castor3D/Render/Ssao/SsaoModule.hpp | 6 +- .../ToTexture/RenderToTextureModule.hpp | 7 +- .../Render/ToneMapping/ToneMappingModule.hpp | 2 +- .../Render/Transform/TransformModule.hpp | 6 +- .../Render/Transparent/TransparentModule.hpp | 6 +- .../Scene/Animation/AnimationModule.hpp | 27 +- .../Animation/Mesh/MeshAnimationModule.hpp | 2 +- .../SceneNode/SceneNodeAnimationModule.hpp | 2 +- .../Skeleton/SkeletonAnimationModule.hpp | 8 +- .../Texture/TextureAnimationModule.hpp | 2 +- .../Scene/Background/BackgroundModule.hpp | 5 +- include/Core/Castor3D/Scene/Light/Light.hpp | 6 +- .../Core/Castor3D/Scene/Light/LightModule.hpp | 19 +- .../Scene/ParticleSystem/ParticleModule.hpp | 18 +- include/Core/Castor3D/Scene/Scene.hpp | 12 +- .../Core/Castor3D/Scene/SceneFileParser.hpp | 16 +- include/Core/Castor3D/Scene/SceneModule.hpp | 38 +- .../ShaderBuffers/ShaderBuffersModule.hpp | 12 +- include/Core/Castor3D/Shader/ShaderModule.hpp | 6 +- .../Castor3D/Shader/Shaders/GlslLight.hpp | 6 +- .../Castor3D/Shader/Shaders/SdwModule.hpp | 8 +- .../Core/Castor3D/Shader/Ubos/UbosModule.hpp | 8 +- .../Core/CastorUtils/Config/ConfigModule.hpp | 1 - include/Core/CastorUtils/Config/Macros.hpp | 31 +- include/Core/CastorUtils/Config/SmartPtr.hpp | 69 +-- .../Core/CastorUtils/Design/Collection.hpp | 241 ---------- .../Core/CastorUtils/Design/Collection.inl | 184 -------- .../Core/CastorUtils/Design/DesignModule.hpp | 16 +- .../Core/CastorUtils/Exception/Exception.hpp | 2 - .../FileParser/FileParserModule.hpp | 6 +- include/Core/CastorUtils/Graphics/Font.hpp | 1 - .../CastorUtils/Graphics/GraphicsModule.hpp | 12 +- include/Core/CastorUtils/Math/MathModule.hpp | 3 - .../Miscellaneous/MiscellaneousModule.hpp | 2 +- .../Castor3D/Animation/AnimationImporter.cpp | 2 +- .../Castor3D/Animation/AnimationModule.cpp | 2 +- source/Core/Castor3D/Binary/CmshImporter.cpp | 8 +- source/Core/Castor3D/Buffer/GpuBufferPool.cpp | 2 +- .../Core/Castor3D/Buffer/ObjectBufferPool.cpp | 4 +- .../Castor3D/Buffer/PoolUniformBuffer.cpp | 2 +- .../Castor3D/Buffer/UniformBufferBase.cpp | 2 +- .../Castor3D/Buffer/UniformBufferPool.cpp | 2 +- source/Core/Castor3D/CMakeLists.txt | 1 - .../Cache/AnimatedObjectGroupCache.cpp | 2 +- source/Core/Castor3D/Cache/BillboardCache.cpp | 2 +- source/Core/Castor3D/Cache/CacheModule.cpp | 4 +- source/Core/Castor3D/Cache/GeometryCache.cpp | 4 +- source/Core/Castor3D/Cache/LightCache.cpp | 2 +- source/Core/Castor3D/Cache/MaterialCache.cpp | 2 +- source/Core/Castor3D/Cache/OverlayCache.cpp | 2 +- source/Core/Castor3D/Cache/PluginCache.cpp | 2 +- source/Core/Castor3D/Cache/SceneNodeCache.cpp | 2 +- source/Core/Castor3D/Cache/ShaderCache.cpp | 2 +- source/Core/Castor3D/Cache/TextureCache.cpp | 5 +- source/Core/Castor3D/Castor3DModule.cpp | 2 +- source/Core/Castor3D/Engine.cpp | 2 + .../Castor3D/Event/Frame/FrameEventModule.cpp | 12 +- .../Event/UserInput/UserInputEventModule.cpp | 6 +- .../Event/UserInput/UserInputListener.cpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlButton.cpp | 4 +- .../Castor3D/Gui/Controls/CtrlComboBox.cpp | 4 +- .../Castor3D/Gui/Controls/CtrlControl.cpp | 4 +- .../Core/Castor3D/Gui/Controls/CtrlEdit.cpp | 2 +- .../Gui/Controls/CtrlExpandablePanel.cpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlFrame.cpp | 2 +- .../Gui/Controls/CtrlLayoutControl.cpp | 2 +- .../Castor3D/Gui/Controls/CtrlListBox.cpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlPanel.cpp | 2 +- .../Castor3D/Gui/Controls/CtrlProgress.cpp | 6 +- .../Castor3D/Gui/Controls/CtrlScrollBar.cpp | 2 +- .../Castor3D/Gui/Controls/CtrlScrollable.cpp | 4 +- .../Core/Castor3D/Gui/Controls/CtrlSlider.cpp | 2 +- .../Core/Castor3D/Gui/Controls/CtrlStatic.cpp | 4 +- source/Core/Castor3D/Gui/ControlsManager.cpp | 2 +- source/Core/Castor3D/Gui/GuiModule.cpp | 30 +- source/Core/Castor3D/Gui/Gui_Parsers.cpp | 2 +- source/Core/Castor3D/Gui/Layout/Layout.cpp | 4 +- source/Core/Castor3D/ImporterFile.cpp | 3 +- source/Core/Castor3D/Material/Material.cpp | 2 +- .../Castor3D/Material/MaterialImporter.cpp | 2 + .../Pass/Component/Base/BlendComponent.cpp | 6 +- .../Base/FractalMappingComponent.cpp | 6 +- .../Pass/Component/Base/NormalComponent.cpp | 5 +- .../Component/Base/PassHeaderComponent.cpp | 6 +- .../Pass/Component/Base/PickableComponent.cpp | 6 +- .../Component/Base/TextureCountComponent.cpp | 4 +- .../Pass/Component/Base/TexturesComponent.cpp | 4 +- .../Pass/Component/Base/TwoSidedComponent.cpp | 6 +- .../Component/Base/UntileMappingComponent.cpp | 6 +- .../Component/Lighting/AmbientComponent.cpp | 6 +- .../Lighting/AttenuationComponent.cpp | 6 +- .../Component/Lighting/ClearcoatComponent.cpp | 6 +- .../Component/Lighting/EmissiveComponent.cpp | 6 +- .../Lighting/IridescenceComponent.cpp | 6 +- .../Lighting/LightingModelComponent.cpp | 6 +- .../Component/Lighting/MetalnessComponent.cpp | 8 +- .../Component/Lighting/RoughnessComponent.cpp | 6 +- .../Component/Lighting/SheenComponent.cpp | 6 +- .../Component/Lighting/SpecularComponent.cpp | 8 +- .../SubsurfaceScatteringComponent.cpp | 11 +- .../Component/Lighting/ThicknessComponent.cpp | 6 +- .../Lighting/TransmissionComponent.cpp | 6 +- .../Component/Map/AttenuationMapComponent.cpp | 6 +- .../Component/Map/ClearcoatMapComponent.cpp | 6 +- .../Map/ClearcoatNormalMapComponent.cpp | 6 +- .../Map/ClearcoatRoughnessMapComponent.cpp | 6 +- .../Pass/Component/Map/ColourMapComponent.cpp | 6 +- .../Component/Map/EmissiveMapComponent.cpp | 6 +- .../Component/Map/GlossinessMapComponent.cpp | 6 +- .../Pass/Component/Map/HeightMapComponent.cpp | 6 +- .../Component/Map/IridescenceMapComponent.cpp | 6 +- .../Map/IridescenceThicknessMapComponent.cpp | 6 +- .../Component/Map/MetalnessMapComponent.cpp | 6 +- .../Pass/Component/Map/NormalMapComponent.cpp | 6 +- .../Component/Map/OcclusionMapComponent.cpp | 6 +- .../Component/Map/OpacityMapComponent.cpp | 6 +- .../Component/Map/RoughnessMapComponent.cpp | 6 +- .../Pass/Component/Map/SheenMapComponent.cpp | 6 +- .../Map/SheenRoughnessMapComponent.cpp | 6 +- .../Component/Map/SpecularMapComponent.cpp | 6 +- .../Map/TransmissionMapComponent.cpp | 6 +- .../Map/TransmittanceMapComponent.cpp | 6 +- .../Component/Other/AlphaTestComponent.cpp | 6 +- .../Pass/Component/Other/ColourComponent.cpp | 6 +- .../Pass/Component/Other/HeightComponent.cpp | 6 +- .../Pass/Component/Other/OpacityComponent.cpp | 6 +- .../Component/Other/ReflectionComponent.cpp | 6 +- .../Component/Other/RefractionComponent.cpp | 6 +- .../Material/Pass/Component/PassComponent.cpp | 3 +- .../Pass/Component/PassComponentRegister.cpp | 2 +- source/Core/Castor3D/Material/Pass/Pass.cpp | 2 +- .../Castor3D/Material/Pass/PassFactory.cpp | 2 +- .../Castor3D/Material/Pass/PassModule.cpp | 2 +- .../Material/Pass/SubsurfaceScattering.cpp | 2 + .../Texture/Animation/TextureAnimation.cpp | 2 +- .../Animation/TextureAnimationKeyFrame.cpp | 2 +- .../Castor3D/Material/Texture/Sampler.cpp | 2 +- .../Material/Texture/TextureLayout.cpp | 4 +- .../Material/Texture/TextureModule.cpp | 2 +- .../Castor3D/Material/Texture/TextureUnit.cpp | 4 +- .../Castor3D/Material/Texture/TextureView.cpp | 2 +- .../Castor3D/Miscellaneous/LoadingScreen.cpp | 2 +- .../Castor3D/Miscellaneous/ProgressBar.cpp | 2 +- .../Castor3D/Miscellaneous/StagingData.cpp | 2 +- .../Model/Mesh/Animation/MeshAnimation.cpp | 2 +- .../Mesh/Animation/MeshAnimationSubmesh.cpp | 2 +- .../Model/Mesh/Animation/MeshMorphTarget.cpp | 2 +- .../Castor3D/Model/Mesh/Generator/Cone.cpp | 4 +- .../Castor3D/Model/Mesh/Generator/Cube.cpp | 4 +- .../Model/Mesh/Generator/Cylinder.cpp | 4 +- .../Model/Mesh/Generator/Icosahedron.cpp | 4 +- .../Castor3D/Model/Mesh/Generator/Plane.cpp | 4 +- .../Model/Mesh/Generator/Projection.cpp | 4 +- .../Castor3D/Model/Mesh/Generator/Sphere.cpp | 4 +- .../Model/Mesh/Generator/SphereSection.cpp | 4 +- .../Castor3D/Model/Mesh/Generator/Torus.cpp | 4 +- source/Core/Castor3D/Model/Mesh/Mesh.cpp | 3 +- .../Core/Castor3D/Model/Mesh/MeshFactory.cpp | 4 +- .../Castor3D/Model/Mesh/MeshGenerator.cpp | 4 +- .../Core/Castor3D/Model/Mesh/MeshImporter.cpp | 2 + .../Mesh/Submesh/Component/IndexMapping.cpp | 2 +- .../Component/InstantiationComponent.cpp | 2 +- .../Mesh/Submesh/Component/LinesMapping.cpp | 2 +- .../Submesh/Component/MeshletComponent.cpp | 2 +- .../Mesh/Submesh/Component/MorphComponent.cpp | 2 +- .../Submesh/Component/PassMasksComponent.cpp | 2 +- .../Mesh/Submesh/Component/SkinComponent.cpp | 2 +- .../Submesh/Component/SubmeshComponent.cpp | 2 +- .../Mesh/Submesh/Component/TriFaceMapping.cpp | 2 +- .../Castor3D/Model/Mesh/Submesh/Submesh.cpp | 2 +- .../Skeleton/Animation/SkeletonAnimation.cpp | 2 +- .../Animation/SkeletonAnimationBone.cpp | 2 +- .../Animation/SkeletonAnimationKeyFrame.cpp | 2 +- .../Animation/SkeletonAnimationNode.cpp | 2 +- .../Animation/SkeletonAnimationObject.cpp | 2 +- .../Core/Castor3D/Model/Skeleton/BoneNode.cpp | 2 +- .../Core/Castor3D/Model/Skeleton/Skeleton.cpp | 4 +- .../Model/Skeleton/SkeletonImporter.cpp | 2 + .../Castor3D/Model/Skeleton/SkeletonNode.cpp | 2 +- .../Castor3D/Overlay/BorderPanelOverlay.cpp | 2 +- .../Core/Castor3D/Overlay/DebugOverlays.cpp | 2 +- source/Core/Castor3D/Overlay/FontTexture.cpp | 2 +- source/Core/Castor3D/Overlay/Overlay.cpp | 2 +- .../Core/Castor3D/Overlay/OverlayCategory.cpp | 2 +- .../Core/Castor3D/Overlay/OverlayFactory.cpp | 2 +- source/Core/Castor3D/Overlay/PanelOverlay.cpp | 2 +- source/Core/Castor3D/Overlay/TextOverlay.cpp | 2 +- source/Core/Castor3D/Plugin/DividerPlugin.cpp | 2 +- .../Core/Castor3D/Plugin/GeneratorPlugin.cpp | 2 +- source/Core/Castor3D/Plugin/GenericPlugin.cpp | 2 +- .../Core/Castor3D/Plugin/ImporterPlugin.cpp | 2 +- .../Core/Castor3D/Plugin/ParticlePlugin.cpp | 2 +- source/Core/Castor3D/Plugin/Plugin.cpp | 2 +- source/Core/Castor3D/Plugin/PostFxPlugin.cpp | 2 +- .../Castor3D/Plugin/ToneMappingPlugin.cpp | 2 +- .../Castor3D/Render/Culling/SceneCuller.cpp | 2 +- .../Render/EnvironmentMap/EnvironmentMap.cpp | 16 +- .../EnvironmentMap/EnvironmentMapPass.cpp | 4 +- source/Core/Castor3D/Render/Frustum.cpp | 2 +- .../GeometryInjectionPass.cpp | 2 +- .../LightInjectionPass.cpp | 2 +- .../LightPropagationPass.cpp | 2 +- .../LightPropagationVolumesModule.cpp | 8 +- .../LightVolumePassResult.cpp | 2 +- .../VoxelConeTracing/VoxelBufferToTexture.cpp | 2 +- .../VoxelConeTracing/VoxelSecondaryBounce.cpp | 2 +- .../VoxelConeTracing/VoxelizePass.cpp | 2 +- .../VoxelConeTracing/Voxelizer.cpp | 2 +- .../Render/Node/BillboardRenderNode.cpp | 2 +- .../Castor3D/Render/Node/QueueRenderNodes.cpp | 2 +- .../Castor3D/Render/Node/SceneRenderNodes.cpp | 2 +- .../Render/Node/SubmeshRenderNode.cpp | 2 +- .../Render/Opaque/DeferredRendering.cpp | 2 +- .../Render/Opaque/IndirectLightingPass.cpp | 2 +- .../Lighting/SubsurfaceScatteringPass.cpp | 2 +- .../Castor3D/Render/Opaque/LightingPass.cpp | 2 +- .../Render/Opaque/OpaquePassResult.cpp | 2 +- .../Render/Opaque/OpaqueRendering.cpp | 2 +- .../Render/Opaque/OpaqueResolvePass.cpp | 2 +- .../Render/Opaque/VisibilityReorderPass.cpp | 2 +- .../Render/Overlays/OverlayRenderer.cpp | 4 +- .../Render/Overlays/OverlayTextBufferPool.cpp | 2 + .../Core/Castor3D/Render/PBR/IblTextures.cpp | 2 + .../Render/Passes/BackgroundRenderer.cpp | 2 +- .../Castor3D/Render/Passes/DownscalePass.cpp | 2 +- .../Castor3D/Render/Passes/GaussianBlur.cpp | 2 +- .../Render/Passes/LineariseDepthPass.cpp | 2 +- .../Castor3D/Render/Passes/PickingPass.cpp | 2 +- .../Castor3D/Render/Passes/RenderQuad.cpp | 2 +- source/Core/Castor3D/Render/Picking.cpp | 2 +- .../Castor3D/Render/PostEffect/PostEffect.cpp | 2 +- .../Castor3D/Render/Prepass/DepthPass.cpp | 2 +- .../Render/Prepass/PrepassRendering.cpp | 2 +- .../Castor3D/Render/Prepass/PrepassResult.cpp | 2 +- .../Render/Prepass/VisibilityPass.cpp | 2 +- source/Core/Castor3D/Render/RenderDevice.cpp | 2 +- source/Core/Castor3D/Render/RenderLoop.cpp | 2 +- .../Core/Castor3D/Render/RenderNodesPass.cpp | 3 + .../Core/Castor3D/Render/RenderPipeline.cpp | 2 +- source/Core/Castor3D/Render/RenderQueue.cpp | 2 +- source/Core/Castor3D/Render/RenderSystem.cpp | 4 +- source/Core/Castor3D/Render/RenderTarget.cpp | 2 +- .../Core/Castor3D/Render/RenderTechnique.cpp | 2 +- .../Castor3D/Render/RenderTechniquePass.cpp | 2 +- source/Core/Castor3D/Render/RenderWindow.cpp | 4 +- .../Castor3D/Render/ShadowMap/ShadowMap.cpp | 2 +- .../Render/ShadowMap/ShadowMapPass.cpp | 2 +- .../Castor3D/Render/Ssao/SsaoBlurPass.cpp | 2 +- source/Core/Castor3D/Render/Ssao/SsaoPass.cpp | 2 +- .../Castor3D/Render/Ssao/SsaoRawAOPass.cpp | 2 +- .../ToTexture/EquirectangularToCube.cpp | 2 + .../Castor3D/Render/ToTexture/RenderCube.cpp | 2 + .../Render/ToTexture/Texture3DTo2D.cpp | 2 +- .../Render/ToneMapping/ToneMapping.cpp | 2 +- .../Transform/MeshletBoundsTransformPass.cpp | 2 +- .../Render/Transform/VertexTransformPass.cpp | 2 +- .../Render/Transform/VertexTransforming.cpp | 2 +- .../Transparent/TransparentPassResult.cpp | 2 +- .../Transparent/TransparentRendering.cpp | 2 +- .../Transparent/WeightedBlendRendering.cpp | 2 +- source/Core/Castor3D/Render/Viewport.cpp | 2 +- .../Castor3D/Scene/Animation/AnimatedMesh.cpp | 2 +- .../Scene/Animation/AnimatedObject.cpp | 2 +- .../Scene/Animation/AnimatedObjectGroup.cpp | 4 +- .../Scene/Animation/AnimatedSceneNode.cpp | 2 +- .../Scene/Animation/AnimatedSkeleton.cpp | 2 +- .../Scene/Animation/AnimatedTexture.cpp | 2 +- .../Scene/Animation/AnimationInstance.cpp | 6 +- .../Animation/Mesh/MeshAnimationInstance.cpp | 2 + .../SceneNode/SceneNodeAnimationInstance.cpp | 2 + .../Scene/Animation/SceneNodeAnimation.cpp | 2 +- .../Animation/SceneNodeAnimationKeyFrame.cpp | 2 +- .../Skeleton/SkeletonAnimationInstance.cpp | 2 +- .../SkeletonAnimationInstanceBone.cpp | 2 +- .../SkeletonAnimationInstanceNode.cpp | 2 +- .../SkeletonAnimationInstanceObject.cpp | 2 +- .../Texture/TextureAnimationInstance.cpp | 2 + .../Castor3D/Scene/Background/Background.cpp | 2 + .../Core/Castor3D/Scene/Background/Colour.cpp | 2 + .../Core/Castor3D/Scene/Background/Image.cpp | 2 + .../Core/Castor3D/Scene/Background/Skybox.cpp | 2 + source/Core/Castor3D/Scene/BillboardList.cpp | 4 +- source/Core/Castor3D/Scene/Camera.cpp | 2 +- source/Core/Castor3D/Scene/Geometry.cpp | 13 +- .../Castor3D/Scene/Light/DirectionalLight.cpp | 2 +- source/Core/Castor3D/Scene/Light/Light.cpp | 2 +- .../Castor3D/Scene/Light/LightCategory.cpp | 2 + .../Castor3D/Scene/Light/LightFactory.cpp | 2 + .../Castor3D/Scene/Light/LightImporter.cpp | 2 + .../Core/Castor3D/Scene/Light/PointLight.cpp | 2 +- .../Core/Castor3D/Scene/Light/SpotLight.cpp | 2 +- source/Core/Castor3D/Scene/MovableObject.cpp | 2 +- .../ParticleSystem/ComputeParticleSystem.cpp | 2 +- .../ParticleSystem/CpuParticleSystem.cpp | 2 +- .../Scene/ParticleSystem/ParticleEmitter.cpp | 2 +- .../Scene/ParticleSystem/ParticleModule.cpp | 4 +- .../Scene/ParticleSystem/ParticleSystem.cpp | 2 +- .../Scene/ParticleSystem/ParticleUpdater.cpp | 2 +- source/Core/Castor3D/Scene/Scene.cpp | 11 +- .../Core/Castor3D/Scene/SceneFileParser.cpp | 4 +- .../Scene/SceneFileParser_Parsers.cpp | 253 +++++----- source/Core/Castor3D/Scene/SceneImporter.cpp | 2 + source/Core/Castor3D/Scene/SceneModule.cpp | 10 +- source/Core/Castor3D/Scene/SceneNode.cpp | 2 +- .../Core/Castor3D/Scene/SceneNodeImporter.cpp | 2 + .../Castor3D/Shader/LightingModelFactory.cpp | 2 +- source/Core/Castor3D/Shader/Program.cpp | 2 +- source/Core/Castor3D/Shader/ShaderBuffer.cpp | 2 +- .../Shader/ShaderBuffers/FontGlyphBuffer.cpp | 2 +- .../Shader/ShaderBuffers/LightBuffer.cpp | 2 +- .../Shader/ShaderBuffers/PassBuffer.cpp | 2 +- .../Shader/ShaderBuffers/SssProfileBuffer.cpp | 2 +- .../ShaderBuffers/TextureAnimationBuffer.cpp | 2 +- .../TextureConfigurationBuffer.cpp | 2 +- source/Core/Castor3D/Shader/ShaderModule.cpp | 2 +- .../Castor3D/Shader/Shaders/GlslLight.cpp | 10 +- .../Castor3D/Shader/Shaders/GlslLighting.cpp | 2 +- .../Castor3D/Shader/Shaders/GlslMaterial.cpp | 2 + .../Castor3D/Shader/Shaders/GlslShadow.cpp | 2 + .../Shader/Shaders/GlslSssTransmittance.cpp | 2 + .../Shader/Ubos/LayeredLpvGridConfigUbo.cpp | 2 +- .../Castor3D/Shader/Ubos/LpvGridConfigUbo.cpp | 2 +- .../Shader/Ubos/LpvLightConfigUbo.cpp | 2 +- source/Core/Castor3D/Shader/Ubos/SceneUbo.cpp | 2 +- source/Core/CastorUtils/CMakeLists.txt | 2 - .../CastorUtils/CastorUtilsPrerequisites.cpp | 2 - .../FileParser/FileParserContext.cpp | 2 +- .../Core/CastorUtils/Graphics/BoundingBox.cpp | 2 +- .../CastorUtils/Graphics/BoundingSphere.cpp | 2 +- source/Core/CastorUtils/Graphics/Font.cpp | 2 +- .../Core/CastorUtils/Graphics/FontCache.cpp | 2 +- source/Core/CastorUtils/Graphics/Image.cpp | 4 +- .../CastorUtils/Graphics/PixelBufferBase.cpp | 2 +- .../Miscellaneous/DynamicLibrary.cpp | 2 +- .../DiamondSquareTerrain.cpp | 2 +- .../AtmosphereBackground.cpp | 2 + .../AtmosphereScatteringPrerequisites.hpp | 2 + .../AtmosphereScattering_Parsers.cpp | 4 +- .../AtmosphereScattering_Parsers.hpp | 2 +- .../BakeHeightGradientPass.cpp | 2 +- .../BakeHeightGradientPass.hpp | 2 +- .../DownsampleDistributionPass.cpp | 2 +- .../DownsampleDistributionPass.hpp | 2 +- .../GenerateDistributionPass.cpp | 2 +- .../GenerateDistributionPass.hpp | 2 +- .../Generic/FFTOceanRendering/OceanFFT.cpp | 8 +- .../Generic/FFTOceanRendering/OceanFFT.hpp | 6 +- .../FFTOceanRendering/OceanFFTRenderPass.cpp | 42 +- .../FFTOceanRendering/OceanFFTRenderPass.hpp | 12 +- .../FFTOceanRendering/ProcessFFTPass.cpp | 2 +- .../FFTOceanRendering/ProcessFFTPass.hpp | 2 +- .../OceanRendering/OceanRenderPass.cpp | 10 +- .../OceanRendering/OceanRenderPass.hpp | 4 +- .../Generic/ToonMaterial/EdgesComponent.cpp | 6 +- .../Generic/ToonMaterial/EdgesComponent.hpp | 2 + .../WaterRendering/WaterRenderPass.cpp | 6 +- .../WaterRendering/WaterRenderPass.hpp | 4 +- .../AssimpImporter/AssimpImporterFile.cpp | 12 +- test/Castor3D/BinaryExportTest.cpp | 7 +- test/CastorTest/BenchManager.cpp | 12 +- test/CastorTest/BenchManager.hpp | 12 +- test/CastorTest/CastorTestPrerequisites.hpp | 8 +- test/CastorTest/UnitTest.hpp | 13 + .../CastorTestLauncher/CastorTestLauncher.cpp | 4 +- .../CastorTestLauncher/CastorTestLauncher.hpp | 2 +- tools/CastorViewer/MainFrame.cpp | 2 +- tools/CastorViewer/RenderPanel.cpp | 4 +- tools/CastorViewer/RenderPanel.hpp | 4 +- tools/GuiCommon/GuiCommonPrerequisites.hpp | 10 +- .../TreeItems/LightTreeItemProperty.cpp | 20 +- .../Properties/TreeItems/TreeItemProperty.cpp | 2 + .../GuiCommon/Shader/LanguageFileContext.hpp | 6 +- tools/GuiCommon/Shader/LanguageFileParser.cpp | 2 +- tools/GuiCommon/Shader/LanguageInfo.cpp | 2 + tools/GuiCommon/Shader/StcContext.cpp | 2 +- tools/GuiCommon/Shader/StcContext.hpp | 14 +- tools/GuiCommon/Shader/StcTextEditor.cpp | 6 +- tools/GuiCommon/Shader/StcTextEditor.hpp | 4 +- tools/GuiCommon/System/CastorApplication.cpp | 2 +- tools/GuiCommon/System/CastorApplication.hpp | 2 +- 450 files changed, 1687 insertions(+), 1599 deletions(-) delete mode 100644 include/Core/Castor3D/Cache/ElementProducer.hpp delete mode 100644 include/Core/CastorUtils/Design/Collection.hpp delete mode 100644 include/Core/CastorUtils/Design/Collection.inl diff --git a/data/vcpkg/ports/ashes/vcpkg.json b/data/vcpkg/ports/ashes/vcpkg.json index b32f882227..767303a1ec 100644 --- a/data/vcpkg/ports/ashes/vcpkg.json +++ b/data/vcpkg/ports/ashes/vcpkg.json @@ -4,7 +4,7 @@ "description": "Drop-in replacement to Vulkan's shared library, allowing the use of OpenGL or Direct3D11 in addition to Vulkan.", "homepage": "https://github.com/DragonJoker/Ashes", "license": "MIT", - "supports": "!ios & !android & !x86 & !uwp & !arm32 & !static", + "supports": "!ios & !android & !x86 & !uwp & !arm32", "dependencies": [ "opengl", "spirv-cross", diff --git a/include/Core/Castor3D/Animation/AnimationModule.hpp b/include/Core/Castor3D/Animation/AnimationModule.hpp index 3b7e03317e..a0b3bf8846 100644 --- a/include/Core/Castor3D/Animation/AnimationModule.hpp +++ b/include/Core/Castor3D/Animation/AnimationModule.hpp @@ -170,11 +170,12 @@ namespace castor3d template< typename DataT > using InterpolatorPtr = std::unique_ptr< Interpolator< DataT > >; - CU_DeclareCUSmartPtr( castor3d, AnimationKeyFrame, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimationImporter, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimationImporterFactory, C3D_API ); - CU_DeclareCUTemplateSmartPtr( castor3d, AnimationT ); - CU_DeclareCUTemplateSmartPtr( castor3d, AnimationInstanceT ); + CU_DeclareSmartPtr( castor3d, AnimationKeyFrame, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimationImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimationImporterFactory, C3D_API ); + + CU_DeclareTemplateSmartPtr( castor3d, Animation ); + CU_DeclareTemplateSmartPtr( castor3d, AnimationInstance ); using AnimationKeyFrameArray = std::vector< AnimationKeyFrameUPtr >; //@} diff --git a/include/Core/Castor3D/Buffer/BufferModule.hpp b/include/Core/Castor3D/Buffer/BufferModule.hpp index 948179b9a1..53ba79715a 100644 --- a/include/Core/Castor3D/Buffer/BufferModule.hpp +++ b/include/Core/Castor3D/Buffer/BufferModule.hpp @@ -179,13 +179,14 @@ namespace castor3d template< typename DataT > class GpuLinearAllocatorT; - CU_DeclareCUSmartPtr( castor3d, GpuBufferPool, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ObjectBufferPool, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PoolUniformBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, UniformBufferBase, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, UniformBufferPool, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VertexBufferPool, C3D_API ); - CU_DeclareTemplateSmartPtr( UniformBuffer ); + CU_DeclareSmartPtr( castor3d, GpuBufferPool, C3D_API ); + CU_DeclareSmartPtr( castor3d, ObjectBufferPool, C3D_API ); + CU_DeclareSmartPtr( castor3d, PoolUniformBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, UniformBufferBase, C3D_API ); + CU_DeclareSmartPtr( castor3d, UniformBufferPool, C3D_API ); + CU_DeclareSmartPtr( castor3d, VertexBufferPool, C3D_API ); + + CU_DeclareTemplateSmartPtr( castor3d, UniformBuffer ); using GpuBufferBuddyAllocator = castor::BuddyAllocatorT< GpuBufferBuddyAllocatorTraits >; using GpuBufferBuddyAllocatorUPtr = std::unique_ptr< GpuBufferBuddyAllocator >; diff --git a/include/Core/Castor3D/Buffer/UniformBuffer.hpp b/include/Core/Castor3D/Buffer/UniformBuffer.hpp index 952a90958d..5392f4c601 100644 --- a/include/Core/Castor3D/Buffer/UniformBuffer.hpp +++ b/include/Core/Castor3D/Buffer/UniformBuffer.hpp @@ -253,7 +253,7 @@ namespace castor3d , std::string name , ashes::QueueShare sharingMode = {} ) { - return std::make_unique< UniformBufferT< DataT > >( renderSystem + return castor::makeUnique< UniformBufferT< DataT > >( renderSystem , uint32_t( count ) , usage , flags diff --git a/include/Core/Castor3D/Cache/CacheModule.hpp b/include/Core/Castor3D/Cache/CacheModule.hpp index 78dbd07d58..2466405f08 100644 --- a/include/Core/Castor3D/Cache/CacheModule.hpp +++ b/include/Core/Castor3D/Cache/CacheModule.hpp @@ -179,9 +179,9 @@ namespace castor3d class ShaderProgramCache; class TextureUnitCache; - CU_DeclareCUSmartPtr( castor3d, RenderTargetCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ShaderProgramCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureUnitCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderTargetCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, ShaderProgramCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureUnitCache, C3D_API ); //@} } diff --git a/include/Core/Castor3D/Cache/ElementProducer.hpp b/include/Core/Castor3D/Cache/ElementProducer.hpp deleted file mode 100644 index f153c3eae8..0000000000 --- a/include/Core/Castor3D/Cache/ElementProducer.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* -See LICENSE file in root folder -*/ -#ifndef ___C3D_CacheElementProducer_H___ -#define ___C3D_CacheElementProducer_H___ - -#include "CacheModule.hpp" - -#include "Castor3D/Render/RenderModule.hpp" -#include "Castor3D/Shader/ShaderModule.hpp" - -namespace castor3d -{ - /**@name Cache */ - //@{ - - template< typename ElementType, typename KeyType > - struct ElementProducer; - - template< typename KeyType > - struct ElementProducer< RenderTarget, KeyType > - { - using Type = std::function< std::shared_ptr< RenderTarget >( KeyType const &, TargetType ) >; - }; - - template< typename KeyType > - struct ElementProducer< ShaderProgram, KeyType > - { - using Type = std::function< std::shared_ptr< ShaderProgram >( KeyType const & ) >; - }; - - //@} -} - -#endif diff --git a/include/Core/Castor3D/Cache/ShaderCache.hpp b/include/Core/Castor3D/Cache/ShaderCache.hpp index 299389e59b..aa780b98a3 100644 --- a/include/Core/Castor3D/Cache/ShaderCache.hpp +++ b/include/Core/Castor3D/Cache/ShaderCache.hpp @@ -149,7 +149,7 @@ namespace castor3d struct AutoGeneratedProgram { PipelineFlags flags; - ShaderProgramRPtr program{}; + ShaderProgramRPtr program; }; using ShaderProgramCont = std::vector< AutoGeneratedProgram >; diff --git a/include/Core/Castor3D/Castor3DModule.hpp b/include/Core/Castor3D/Castor3DModule.hpp index 2874dc9e0b..5fcc825f2a 100644 --- a/include/Core/Castor3D/Castor3DModule.hpp +++ b/include/Core/Castor3D/Castor3DModule.hpp @@ -97,10 +97,10 @@ namespace castor3d template< typename ResT, typename KeyT > struct ResourceCacheTraitsT; - CU_DeclareSmartPtr( Engine ); - CU_DeclareSmartPtr( ImporterFile ); - CU_DeclareCUSmartPtr( castor3d, FramePassTimer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ImporterFileFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, Engine, C3D_API ); + CU_DeclareSmartPtr( castor3d, ImporterFile, C3D_API ); + CU_DeclareSmartPtr( castor3d, FramePassTimer, C3D_API ); + CU_DeclareSmartPtr( castor3d, ImporterFileFactory, C3D_API ); C3D_API castor::LoggerInstance & getLogger( Engine & engine ); diff --git a/include/Core/Castor3D/Castor3DPch.hpp b/include/Core/Castor3D/Castor3DPch.hpp index 4b8ef42f14..6275094fb9 100644 --- a/include/Core/Castor3D/Castor3DPch.hpp +++ b/include/Core/Castor3D/Castor3DPch.hpp @@ -19,7 +19,6 @@ See LICENSE file in root folder #include #include #include -#include #include #include #include diff --git a/include/Core/Castor3D/Castor3DPrerequisites.hpp b/include/Core/Castor3D/Castor3DPrerequisites.hpp index b1559e64dc..bbc626a09d 100644 --- a/include/Core/Castor3D/Castor3DPrerequisites.hpp +++ b/include/Core/Castor3D/Castor3DPrerequisites.hpp @@ -61,7 +61,6 @@ See LICENSE file in root folder #include "Castor3D/Miscellaneous/Logger.hpp" -#include #include #include #include diff --git a/include/Core/Castor3D/Event/Frame/FrameEventModule.hpp b/include/Core/Castor3D/Event/Frame/FrameEventModule.hpp index 39cf963018..235905e950 100644 --- a/include/Core/Castor3D/Event/Frame/FrameEventModule.hpp +++ b/include/Core/Castor3D/Event/Frame/FrameEventModule.hpp @@ -106,11 +106,11 @@ namespace castor3d */ class GpuFunctorEvent; - CU_DeclareCUSmartPtr( castor3d, CpuFrameEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, FrameListener, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GpuFrameEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, CpuFunctorEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GpuFunctorEvent, C3D_API ); + CU_DeclareSmartPtr( castor3d, CpuFrameEvent, C3D_API ); + CU_DeclareSmartPtr( castor3d, FrameListener, C3D_API ); + CU_DeclareSmartPtr( castor3d, GpuFrameEvent, C3D_API ); + CU_DeclareSmartPtr( castor3d, CpuFunctorEvent, C3D_API ); + CU_DeclareSmartPtr( castor3d, GpuFunctorEvent, C3D_API ); CU_DeclareVector( CpuFrameEventUPtr, CpuFrameEventPtr ); CU_DeclareVector( GpuFrameEventUPtr, GpuFrameEventPtr ); @@ -145,7 +145,7 @@ namespace castor3d using FrameListenerRes = FrameListenerCacheTraits::ElementPtrT; using FrameListenerResPtr = FrameListenerCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, FrameListenerCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, FrameListenerCache, C3D_API ); /** *\~english * Cached resource initialiser, through a CPU frame event. diff --git a/include/Core/Castor3D/Event/UserInput/UserInputEventModule.hpp b/include/Core/Castor3D/Event/UserInput/UserInputEventModule.hpp index 7f2d6d50a2..2d64d44781 100644 --- a/include/Core/Castor3D/Event/UserInput/UserInputEventModule.hpp +++ b/include/Core/Castor3D/Event/UserInput/UserInputEventModule.hpp @@ -411,14 +411,16 @@ namespace castor3d */ class UserInputListener; - CU_DeclareCUSmartPtr( castor3d, EventHandler, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, UserInputEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, KeyboardEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MouseEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, HandlerEvent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, UserInputListener, C3D_API ); + CU_DeclareSmartPtr( castor3d, EventHandler, C3D_API ); + CU_DeclareSmartPtr( castor3d, UserInputListener, C3D_API ); - template< class Derived > class NonClientEventHandler; + using UserInputEventSPtr = std::shared_ptr< UserInputEvent >; + using KeyboardEventSPtr = std::shared_ptr< KeyboardEvent >; + using MouseEventSPtr = std::shared_ptr< MouseEvent >; + using HandlerEventSPtr = std::shared_ptr< HandlerEvent >; + + template< class Derived > + class NonClientEventHandler; //@} //@} diff --git a/include/Core/Castor3D/Gui/Controls/CtrlButton.hpp b/include/Core/Castor3D/Gui/Controls/CtrlButton.hpp index 8a29cd685d..b4bc4a27d7 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlButton.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlButton.hpp @@ -44,7 +44,7 @@ namespace castor3d , castor::Size const & size , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~ButtonCtrl()noexcept; + C3D_API ~ButtonCtrl()noexcept override; /** Sets the horizontal alignment for the text. *\param[in] align The new value. diff --git a/include/Core/Castor3D/Gui/Controls/CtrlComboBox.hpp b/include/Core/Castor3D/Gui/Controls/CtrlComboBox.hpp index 2366680697..67d8774d61 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlComboBox.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlComboBox.hpp @@ -83,7 +83,7 @@ namespace castor3d { } - C3D_API ~ComboBoxCtrl()noexcept; + C3D_API ~ComboBoxCtrl()noexcept override; /** Appends a new item *\param[in] value The item diff --git a/include/Core/Castor3D/Gui/Controls/CtrlControl.hpp b/include/Core/Castor3D/Gui/Controls/CtrlControl.hpp index 01f1d49a68..244ca69a36 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlControl.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlControl.hpp @@ -45,7 +45,7 @@ namespace castor3d , castor::Size const & size , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~Control()noexcept; + C3D_API ~Control()noexcept override; /** Sets the style *\param[in] value The new value diff --git a/include/Core/Castor3D/Gui/Controls/CtrlEdit.hpp b/include/Core/Castor3D/Gui/Controls/CtrlEdit.hpp index d7dc80a6a8..11fe5b6b41 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlEdit.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlEdit.hpp @@ -46,7 +46,7 @@ namespace castor3d , castor::Size const & size , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~EditCtrl()noexcept; + C3D_API ~EditCtrl()noexcept override; /** Updates the caption *\param[in] value The new value diff --git a/include/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.hpp b/include/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.hpp index 8f8036378b..02f748b237 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.hpp @@ -48,7 +48,7 @@ namespace castor3d , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~ExpandablePanelCtrl()noexcept; + C3D_API ~ExpandablePanelCtrl()noexcept override; C3D_API void setExpandCaption( castor::U32String v ); C3D_API void setRetractCaption( castor::U32String v ); diff --git a/include/Core/Castor3D/Gui/Controls/CtrlFrame.hpp b/include/Core/Castor3D/Gui/Controls/CtrlFrame.hpp index c943a6862e..0d3b45ea7d 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlFrame.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlFrame.hpp @@ -48,7 +48,7 @@ namespace castor3d , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~FrameCtrl()noexcept; + C3D_API ~FrameCtrl()noexcept override; /** \return The frame style. */ diff --git a/include/Core/Castor3D/Gui/Controls/CtrlListBox.hpp b/include/Core/Castor3D/Gui/Controls/CtrlListBox.hpp index dbeb287757..098c99bc19 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlListBox.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlListBox.hpp @@ -84,7 +84,7 @@ namespace castor3d { } - C3D_API ~ListBoxCtrl()noexcept; + C3D_API ~ListBoxCtrl()noexcept override; /** Appends a new item *\param[in] value The item diff --git a/include/Core/Castor3D/Gui/Controls/CtrlProgress.hpp b/include/Core/Castor3D/Gui/Controls/CtrlProgress.hpp index fd58091f3b..cb37d1a02d 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlProgress.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlProgress.hpp @@ -23,7 +23,7 @@ namespace castor3d , castor::String const & name , ProgressStyle * style , ControlRPtr parent ); - C3D_API ~ProgressCtrl()noexcept; + C3D_API ~ProgressCtrl()noexcept override; C3D_API void setTitle( castor::U32String value ); C3D_API void setRange( castor::Range< int32_t > const & value ); diff --git a/include/Core/Castor3D/Gui/Controls/CtrlScrollBar.hpp b/include/Core/Castor3D/Gui/Controls/CtrlScrollBar.hpp index 85b5c5050b..66fbd64723 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlScrollBar.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlScrollBar.hpp @@ -50,7 +50,7 @@ namespace castor3d , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~ScrollBarCtrl()noexcept; + C3D_API ~ScrollBarCtrl()noexcept override; /** Sets the range *\param[in] value The new value diff --git a/include/Core/Castor3D/Gui/Controls/CtrlSlider.hpp b/include/Core/Castor3D/Gui/Controls/CtrlSlider.hpp index 32d841b19a..9adbfcfade 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlSlider.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlSlider.hpp @@ -47,7 +47,7 @@ namespace castor3d , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~SliderCtrl()noexcept; + C3D_API ~SliderCtrl()noexcept override; /** sets the range *\param[in] value The new value diff --git a/include/Core/Castor3D/Gui/Controls/CtrlStatic.hpp b/include/Core/Castor3D/Gui/Controls/CtrlStatic.hpp index 9ff370fa7e..3f2cc3043e 100644 --- a/include/Core/Castor3D/Gui/Controls/CtrlStatic.hpp +++ b/include/Core/Castor3D/Gui/Controls/CtrlStatic.hpp @@ -43,7 +43,7 @@ namespace castor3d , castor::Size const & size , ControlFlagType flags = 0 , bool visible = true ); - C3D_API ~StaticCtrl()noexcept; + C3D_API ~StaticCtrl()noexcept override; /** Sets the horizontal alignment for the text. *\param[in] value The new value. diff --git a/include/Core/Castor3D/Gui/GuiModule.hpp b/include/Core/Castor3D/Gui/GuiModule.hpp index 9def38ff85..880e406a4e 100644 --- a/include/Core/Castor3D/Gui/GuiModule.hpp +++ b/include/Core/Castor3D/Gui/GuiModule.hpp @@ -429,39 +429,39 @@ namespace castor3d using OnControlChanged = castor::SignalT< OnControlChangedFunction >; using OnControlChangedConnection = OnControlChanged::connection; - CU_DeclareCUSmartPtr( castor3d, Layout, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Spacer, C3D_API ); + CU_DeclareSmartPtr( castor3d, Layout, C3D_API ); + CU_DeclareSmartPtr( castor3d, Spacer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ControlsManager, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Control, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LayoutControl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ButtonCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ComboBoxCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, EditCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ExpandablePanelCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, FrameCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ListBoxCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PanelCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ProgressCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ScrollableCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ScrollBarCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SliderCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, StaticCtrl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, StylesHolder, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Theme, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ControlStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ButtonStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ComboBoxStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, EditStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ExpandablePanelStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, FrameStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ListBoxStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PanelStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ProgressStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ScrollableStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ScrollBarStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SliderStyle, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, StaticStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ControlsManager, C3D_API ); + CU_DeclareSmartPtr( castor3d, Control, C3D_API ); + CU_DeclareSmartPtr( castor3d, LayoutControl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ButtonCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ComboBoxCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, EditCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ExpandablePanelCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, FrameCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ListBoxCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, PanelCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ProgressCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ScrollableCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ScrollBarCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, SliderCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, StaticCtrl, C3D_API ); + CU_DeclareSmartPtr( castor3d, StylesHolder, C3D_API ); + CU_DeclareSmartPtr( castor3d, Theme, C3D_API ); + CU_DeclareSmartPtr( castor3d, ControlStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ButtonStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ComboBoxStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, EditStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ExpandablePanelStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, FrameStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ListBoxStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, PanelStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ProgressStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ScrollableStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, ScrollBarStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, SliderStyle, C3D_API ); + CU_DeclareSmartPtr( castor3d, StaticStyle, C3D_API ); using ControlArray = std::vector< ControlRPtr >; diff --git a/include/Core/Castor3D/Material/MaterialModule.hpp b/include/Core/Castor3D/Material/MaterialModule.hpp index c3cabbbca7..02ffd44faf 100644 --- a/include/Core/Castor3D/Material/MaterialModule.hpp +++ b/include/Core/Castor3D/Material/MaterialModule.hpp @@ -121,10 +121,9 @@ namespace castor3d */ class MaterialImporterFactory; - CU_DeclareSmartPtr( MaterialImporter ); - - CU_DeclareCUSmartPtr( castor3d, Material, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MaterialImporterFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, Material, C3D_API ); + CU_DeclareSmartPtr( castor3d, MaterialImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, MaterialImporterFactory, C3D_API ); using PassTypeID = uint16_t; @@ -165,7 +164,7 @@ namespace castor3d using MaterialPtr = MaterialCacheTraits::ElementPtrT; using MaterialObs = MaterialCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, MaterialCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, MaterialCache, C3D_API ); //! Material pointer array CU_DeclareVector( MaterialObs, MaterialPtr ); diff --git a/include/Core/Castor3D/Material/Pass/Component/ComponentModule.hpp b/include/Core/Castor3D/Material/Pass/Component/ComponentModule.hpp index fce0253d00..263c115efc 100644 --- a/include/Core/Castor3D/Material/Pass/Component/ComponentModule.hpp +++ b/include/Core/Castor3D/Material/Pass/Component/ComponentModule.hpp @@ -9,7 +9,6 @@ See LICENSE file in root folder #include "Castor3D/Material/MaterialModule.hpp" #include -#include #include #include @@ -39,22 +38,6 @@ See LICENSE file in root folder namespace castor3d { class SceneFileContext; - /**@name Shader */ - //@{ - /**@name Shaders */ - //@{ - namespace shader - { - struct BlendComponents; - struct SurfaceBase; - class Utils; - } - //@} - /**@name Buffers */ - //@{ - class PassBuffer; - //@} - //@} /**@name Material */ //@{ /**@name Texture */ @@ -64,6 +47,7 @@ namespace castor3d /**@name Pass */ //@{ class Pass; + /**@name Component */ //@{ enum class ComponentMode: uint16_t @@ -121,22 +105,423 @@ namespace castor3d class PassComponentPlugin; /** \~english - \brief Pass texture component base class. + \brief Pass components registrar. \~french - \brief Classe de base d'un composant de texture de passe. + \brief Registre des composants de passe. */ - struct PassMaskComponent; + class PassComponentRegister; + + /**@name Base Components */ + //@{ /** \~english - \brief Pass components registrar. + \brief Component holding colour and alpha blend modes. \~french - \brief Registre des composants de passe. + \brief Composant détenant les modes de mélange couleur et alpha. */ - class PassComponentRegister; + struct BlendComponent; + /** + \~english + \brief Component to enable fractal mapping. + \~french + \brief Composant pour activer le fractal mapping. + */ + struct FractalMappingComponent; + /** + \~english + \brief Component holding the normal. + \~french + \brief Composant détenant la normale. + */ + struct NormalComponent; + /** + \~english + \brief Component holding base pass data. + \~french + \brief Composant détenant les données de base d'une passe. + */ + struct PassHeaderComponent; + /** + \~english + \brief Component to enable picking. + \~french + \brief Composant pour activer le picking. + */ + struct PickableComponent; + /** + \~english + \brief Component holding textures count. + \~french + \brief Composant détenant le nombre de textures. + */ + struct TextureCountComponent; + /** + \~english + \brief Component holding textures. + \~french + \brief Composant détenant les textures. + */ + struct TexturesComponent; + /** + \~english + \brief Component to enable two-sided pass. + \~french + \brief Composant pour activer le fait que la passe est two-sided. + */ + struct TwoSidedComponent; + /** + \~english + \brief Component to enable untiled mapping. + \~french + \brief Composant pour activer l'untiled mapping. + */ + struct UntileMappingComponent; + + CU_DeclareSmartPtr( castor3d, BlendComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, FractalMappingComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, NormalComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassHeaderComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, PickableComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureCountComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TexturesComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TwoSidedComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, UntileMappingComponent, C3D_API ); + //@} + /**@name Lighting Components */ + //@{ + /** + \~english + \brief Component holding ambient lighting data. + \~french + \brief Composant détenant les données d'éclairage ambiant. + */ + struct AmbientComponent; + /** + \~english + \brief Component holding attenuation data. + \~french + \brief Composant détenant les données d'atténuation. + */ + struct AttenuationComponent; + /** + \~english + \brief Component holding clearcoat data. + \~french + \brief Composant détenant les données de clearcoat. + */ + struct ClearcoatComponent; + /** + \~english + \brief Component holding emissive data. + \~french + \brief Composant détenant les données d'émission. + */ + struct EmissiveComponent; + /** + \~english + \brief Component holding iridescence data. + \~french + \brief Composant détenant les données d'iridescence. + */ + struct IridescenceComponent; + /** + \~english + \brief Component holding lighting model data. + \~french + \brief Composant détenant les données de modèle d'éclairage. + */ + struct LightingModelComponent; + /** + \~english + \brief Component holding metalness data. + \~french + \brief Composant détenant les données de metalness. + */ + struct MetalnessComponent; + /** + \~english + \brief Component holding roughness data. + \~french + \brief Composant détenant les données de roughness. + */ + struct RoughnessComponent; + /** + \~english + \brief Component holding sheen data. + \~french + \brief Composant détenant les données de sheen. + */ + struct SheenComponent; + /** + \~english + \brief Component holding specular data. + \~french + \brief Composant détenant les données de spéculaire. + */ + struct SpecularComponent; + /** + \~english + \brief Component holding subsurface scattering data. + \~french + \brief Composant détenant les données de subsurface scattering. + */ + struct SubsurfaceScatteringComponent; + /** + \~english + \brief Component holding thickness data. + \~french + \brief Composant détenant les données d'épaisseur. + */ + struct ThicknessComponent; + /** + \~english + \brief Component holding transmission data. + \~french + \brief Composant détenant les données de transmission. + */ + struct TransmissionComponent; + + CU_DeclareSmartPtr( castor3d, AmbientComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, AttenuationComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ClearcoatComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, EmissiveComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, IridescenceComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightingModelComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, MetalnessComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, RoughnessComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SheenComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SpecularComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SubsurfaceScatteringComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ThicknessComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TransmissionComponent, C3D_API ); + //@} + /**@name Texture Components */ + //@{ + /** + \~english + \brief Component holding attenuation map. + \~french + \brief Composant détenant la texture d'atténuation. + */ + struct AttenuationMapComponent; + /** + \~english + \brief Component holding clearcoat map. + \~french + \brief Composant détenant la texture de clearcoat. + */ + struct ClearcoatMapComponent; + /** + \~english + \brief Component holding clearcoat's normal map. + \~french + \brief Composant détenant la texture de normales pour le clearcoat. + */ + struct ClearcoatNormalMapComponent; + /** + \~english + \brief Component holding clearcoat's roughness map. + \~french + \brief Composant détenant la texture de roughness pour le clearcoat. + */ + struct ClearcoatRoughnessMapComponent; + /** + \~english + \brief Component holding the colour map. + \~french + \brief Composant détenant la texture de couleurs. + */ + struct ColourMapComponent; + /** + \~english + \brief Component holding the emissive map. + \~french + \brief Composant détenant la texture d'e couleurs'émissive. + */ + struct EmissiveMapComponent; + /** + \~english + \brief Component holding the glossiness map. + \~french + \brief Composant détenant la texture de glossiness. + */ + struct GlossinessMapComponent; + /** + \~english + \brief Component holding the height map. + \~french + \brief Composant détenant la texture de hauteurs. + */ + struct HeightMapComponent; + /** + \~english + \brief Component holding the iridescence map. + \~french + \brief Composant détenant la texture d'iridescence. + */ + struct IridescenceMapComponent; + /** + \~english + \brief Component holding the iridescent layer thickness map. + \~french + \brief Composant détenant la texture d'épaisseur de la couche iridescente. + */ + struct IridescenceThicknessMapComponent; + /** + \~english + \brief Component holding the metalness map. + \~french + \brief Composant détenant la texture de metalness. + */ + struct MetalnessMapComponent; + /** + \~english + \brief Component holding the normal map. + \~french + \brief Composant détenant la texture de normales. + */ + struct NormalMapComponent; + /** + \~english + \brief Component holding the occlusion map. + \~french + \brief Composant détenant la texture d'occlusion. + */ + struct OcclusionMapComponent; + /** + \~english + \brief Component holding the opacity map. + \~french + \brief Composant détenant la texture d'opacité. + */ + struct OpacityMapComponent; + /** + \~english + \brief Component holding the roughness map. + \~french + \brief Composant détenant la texture de roughness. + */ + struct RoughnessMapComponent; + /** + \~english + \brief Component holding the sheen map. + \~french + \brief Composant détenant la texture de sheen. + */ + struct SheenMapComponent; + /** + \~english + \brief Component holding the sheen's roughness map. + \~french + \brief Composant détenant la texture de roughness pour le sheen. + */ + struct SheenRoughnessMapComponent; + /** + \~english + \brief Component holding the specular map. + \~french + \brief Composant détenant la texture de spéculaire. + */ + struct SpecularMapComponent; + /** + \~english + \brief Component holding the transmission map. + \~french + \brief Composant détenant la texture de transmission. + */ + struct TransmissionMapComponent; + /** + \~english + \brief Component holding the transmittance map (for subsurface scattering). + \~french + \brief Composant détenant la texture de transmittance (pour le subsurface scattering). + */ + struct TransmittanceMapComponent; + + CU_DeclareSmartPtr( castor3d, AttenuationMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ClearcoatMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ClearcoatNormalMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ClearcoatRoughnessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ColourMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, EmissiveMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, GlossinessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, HeightMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, IridescenceMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, IridescenceThicknessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, MetalnessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, NormalMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, OcclusionMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, OpacityMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, RoughnessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SheenMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SheenRoughnessMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SpecularMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TransmissionMapComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TransmittanceMapComponent, C3D_API ); + //@} + /**@name Other components */ + //@{ + /** + \~english + \brief Component holding alpha test data. + \~french + \brief Composant détenant les données d'alpha test. + */ + struct AlphaTestComponent; + /** + \~english + \brief Component holding colour data. + \~french + \brief Composant détenant les données de couleur. + */ + struct ColourComponent; + /** + \~english + \brief Component holding height data. + \~french + \brief Composant détenant les données de hauteur. + */ + struct HeightComponent; + /** + \~english + \brief Component holding opacity data. + \~french + \brief Composant détenant les données d'opacité. + */ + struct OpacityComponent; + /** + \~english + \brief Component to enable reflections. + \~french + \brief Composant pour activer les réflexions. + */ + struct ReflectionComponent; + /** + \~english + \brief Component holding refraction data. + \~french + \brief Composant détenant les données de réfraction. + */ + struct RefractionComponent; + + CU_DeclareSmartPtr( castor3d, AlphaTestComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ColourComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, HeightComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, OpacityComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, ReflectionComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, RefractionComponent, C3D_API ); + //@} /**@name Shader */ //@{ + /**@name Buffers */ + //@{ + class PassBuffer; + //@} namespace shader { + struct BlendComponents; + struct SurfaceBase; + class Utils; /** \~english \brief Base class for all component shaders. @@ -175,8 +560,6 @@ namespace castor3d } //@} - struct SubsurfaceScatteringComponent; - struct PassComponentCombine { PassComponentCombineID baseId{}; @@ -206,9 +589,9 @@ namespace castor3d C3D_API bool contains( PassComponentCombine const & cont , PassComponentCombine const & test ); - CU_DeclareSmartPtr( PassComponent ); - CU_DeclareCUSmartPtr( castor3d, PassComponentRegister, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PassComponentPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassComponentRegister, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassComponentPlugin, C3D_API ); CU_DeclareMap( PassComponentID, PassComponentUPtr, PassComponent ); diff --git a/include/Core/Castor3D/Material/Pass/Pass.hpp b/include/Core/Castor3D/Material/Pass/Pass.hpp index 0839925dff..74725c2714 100644 --- a/include/Core/Castor3D/Material/Pass/Pass.hpp +++ b/include/Core/Castor3D/Material/Pass/Pass.hpp @@ -135,10 +135,10 @@ namespace castor3d if ( !result ) { - auto component = std::make_unique< ComponentT >( *this + auto component = castor::makeUnique< ComponentT >( *this , std::forward< ParamsT >( params )... ); result = component.get(); - this->addComponent( std::move( component ) ); + this->addComponent( castor::ptrRefCast< PassComponent >( component ) ); } return result; diff --git a/include/Core/Castor3D/Material/Pass/PassModule.hpp b/include/Core/Castor3D/Material/Pass/PassModule.hpp index e2216344d3..f899663bb7 100644 --- a/include/Core/Castor3D/Material/Pass/PassModule.hpp +++ b/include/Core/Castor3D/Material/Pass/PassModule.hpp @@ -19,7 +19,7 @@ namespace sdw namespace castor3d::shader { class BufferBase; - CU_DeclareCUSmartPtr( castor3d::shader, BufferBase, C3D_API ); + CU_DeclareSmartPtr( castor3d::shader, BufferBase, C3D_API ); } namespace castor3d @@ -116,10 +116,9 @@ namespace castor3d */ class SubsurfaceScattering; - CU_DeclareCUSmartPtr( castor3d, Pass, C3D_API ); - CU_DeclareSmartPtr( SubsurfaceScattering ); - - CU_DeclareCUSmartPtr( castor3d, PassFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, Pass, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, SubsurfaceScattering, C3D_API ); //! Pass array CU_DeclareVector( Pass, Pass ); @@ -166,7 +165,7 @@ namespace castor3d , PassFactoryEntry >; using SpecificsBuffers = std::map< std::string, std::pair< SpecificsBuffer, ShaderBufferUPtr > >; - CU_DeclareCUSmartPtr( castor3d, RenderPassRegisterInfo, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderPassRegisterInfo, C3D_API ); //@} //@} } diff --git a/include/Core/Castor3D/Material/Texture/Animation/TextureAnimationModule.hpp b/include/Core/Castor3D/Material/Texture/Animation/TextureAnimationModule.hpp index 48762ede63..35e4c144d0 100644 --- a/include/Core/Castor3D/Material/Texture/Animation/TextureAnimationModule.hpp +++ b/include/Core/Castor3D/Material/Texture/Animation/TextureAnimationModule.hpp @@ -29,8 +29,8 @@ namespace castor3d class TextureAnimation; class TextureAnimationKeyFrame; - CU_DeclareCUSmartPtr( castor3d, TextureAnimation, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureAnimationKeyFrame, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureAnimation, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureAnimationKeyFrame, C3D_API ); using TextureRotateSpeed = castor::SpeedT< castor::Angle, castor::Seconds >; using TextureTranslateSpeed = castor::SpeedT< castor::Point2f, castor::Seconds >; diff --git a/include/Core/Castor3D/Material/Texture/TextureModule.hpp b/include/Core/Castor3D/Material/Texture/TextureModule.hpp index 50cf043890..b45612c1db 100644 --- a/include/Core/Castor3D/Material/Texture/TextureModule.hpp +++ b/include/Core/Castor3D/Material/Texture/TextureModule.hpp @@ -213,12 +213,12 @@ namespace castor3d */ class TextureView; - CU_DeclareCUSmartPtr( castor3d, Sampler, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureLayout, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureSource, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureUnit, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureView, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureUnitData, C3D_API ); + CU_DeclareSmartPtr( castor3d, Sampler, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureLayout, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureSource, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureUnit, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureView, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureUnitData, C3D_API ); //! TextureUnit array CU_DeclareVector( TextureUnit, TextureUnit ); @@ -265,7 +265,7 @@ namespace castor3d using SamplerPtr = SamplerCacheTraits::ElementPtrT; using SamplerObs = SamplerCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, SamplerCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, SamplerCache, C3D_API ); struct TextureSourceInfoHasher { diff --git a/include/Core/Castor3D/Material/Texture/TextureUnit.hpp b/include/Core/Castor3D/Material/Texture/TextureUnit.hpp index 2326f5b9b2..7d61d68d4e 100644 --- a/include/Core/Castor3D/Material/Texture/TextureUnit.hpp +++ b/include/Core/Castor3D/Material/Texture/TextureUnit.hpp @@ -21,10 +21,21 @@ namespace castor3d { struct TextureUnitData { + explicit TextureUnitData( TextureSourceInfo psourceInfo + , PassTextureConfig ppassConfig = {} + , TextureAnimationUPtr panimation = {} + , castor::PxBufferBaseUPtr pbuffer = {} ) + : sourceInfo{ std::move( psourceInfo ) } + , passConfig{ std::move( ppassConfig ) } + , animation{ std::move( panimation ) } + , buffer{ std::move( pbuffer ) } + { + } + TextureSourceInfo sourceInfo; - PassTextureConfig passConfig{}; - TextureAnimationUPtr animation{}; - castor::PxBufferBaseUPtr buffer{}; + PassTextureConfig passConfig; + TextureAnimationUPtr animation; + castor::PxBufferBaseUPtr buffer; }; class TextureUnit diff --git a/include/Core/Castor3D/Miscellaneous/MiscellaneousModule.hpp b/include/Core/Castor3D/Miscellaneous/MiscellaneousModule.hpp index 3265ddf8f5..bf2190f1b2 100644 --- a/include/Core/Castor3D/Miscellaneous/MiscellaneousModule.hpp +++ b/include/Core/Castor3D/Miscellaneous/MiscellaneousModule.hpp @@ -281,9 +281,9 @@ namespace castor3d using Parameters = ParametersT< castor::String >; - CU_DeclareCUSmartPtr( castor3d, LoadingScreen, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ProgressBar, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, StagingData, C3D_API ); + CU_DeclareSmartPtr( castor3d, LoadingScreen, C3D_API ); + CU_DeclareSmartPtr( castor3d, ProgressBar, C3D_API ); + CU_DeclareSmartPtr( castor3d, StagingData, C3D_API ); struct RenderDevice; C3D_API ashes::DeviceMemoryPtr setupMemory( ashes::Device const & device diff --git a/include/Core/Castor3D/Model/Mesh/Animation/MeshAnimationModule.hpp b/include/Core/Castor3D/Model/Mesh/Animation/MeshAnimationModule.hpp index 5033ffc250..448682f7e4 100644 --- a/include/Core/Castor3D/Model/Mesh/Animation/MeshAnimationModule.hpp +++ b/include/Core/Castor3D/Model/Mesh/Animation/MeshAnimationModule.hpp @@ -19,9 +19,9 @@ namespace castor3d class MeshAnimationSubmesh; class MeshMorphTarget; - CU_DeclareCUSmartPtr( castor3d, MeshAnimation, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshAnimationSubmesh, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshMorphTarget, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshAnimation, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshAnimationSubmesh, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshMorphTarget, C3D_API ); CU_DeclareVector( MeshAnimationSubmesh, MeshAnimationSubmesh ); diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Cone.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Cone.hpp index 66029446a6..e2b1e3a2c5 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Cone.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Cone.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Cone_H___ #define ___C3D_Cone_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Cube.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Cube.hpp index 0da49bf0e2..9f79ef51b0 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Cube.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Cube.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Cube_H___ #define ___C3D_Cube_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Cylinder.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Cylinder.hpp index 6a256ba71a..51d448347c 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Cylinder.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Cylinder.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Cylinder_H___ #define ___C3D_Cylinder_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Icosahedron.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Icosahedron.hpp index 3508e9dcb0..f9c7459788 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Icosahedron.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Icosahedron.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Icosahedron_H___ #define ___C3D_Icosahedron_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp b/include/Core/Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp index d8ebb9c85d..ff4737dfb8 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp @@ -72,14 +72,27 @@ namespace castor3d /** \~english \brief The sphere primitive - \remark This sphere has squared faces. It is built from a radius and a number of subsections + \remark This sphere has squared faces. +
It is built from a radius and a number of subsections. \~french \brief La primitive de sphère - \remark Cette sphère a des faces rectangulaires. Elle est construite à partir d'un rayon et d'un nombre de subdivisions + \remark Cette sphère a des faces rectangulaires. +
Elle est construite à partir d'un rayon et d'un nombre de subdivisions. */ class Sphere; /** \~english + \brief Conic section of a sphere + \remark The sphere side used square faces. +
It is built from a radius and a number of subsections. + \~french + \brief La primitive de sphère + \remark La portion sphérique a des faces rectangulaires. +
Elle est construite à partir d'un rayon et d'un nombre de subdivisions. + */ + class SphereSection; + /** + \~english \brief The torus representation \remark A torus is an ellipse performing an horizontal ellipse.
The original ellipse will be called internal and has its own radius and number of subsections @@ -90,14 +103,15 @@ namespace castor3d */ class Torus; - CU_DeclareSmartPtr( Cone ); - CU_DeclareSmartPtr( Cylinder ); - CU_DeclareSmartPtr( Icosahedron ); - CU_DeclareSmartPtr( Cube ); - CU_DeclareSmartPtr( Plane ); - CU_DeclareSmartPtr( Projection ); - CU_DeclareSmartPtr( Sphere ); - CU_DeclareSmartPtr( Torus ); + CU_DeclareSmartPtr( castor3d, Cone, C3D_API ); + CU_DeclareSmartPtr( castor3d, Cube, C3D_API ); + CU_DeclareSmartPtr( castor3d, Cylinder, C3D_API ); + CU_DeclareSmartPtr( castor3d, Icosahedron, C3D_API ); + CU_DeclareSmartPtr( castor3d, Plane, C3D_API ); + CU_DeclareSmartPtr( castor3d, Projection, C3D_API ); + CU_DeclareSmartPtr( castor3d, Sphere, C3D_API ); + CU_DeclareSmartPtr( castor3d, SphereSection, C3D_API ); + CU_DeclareSmartPtr( castor3d, Torus, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Plane.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Plane.hpp index d60b0878e4..05a794095d 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Plane.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Plane.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Plane_H___ #define ___C3D_Plane_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Projection.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Projection.hpp index d99a37bac6..1a90280b64 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Projection.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Projection.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Projection_H___ #define ___C3D_Projection_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" #include "Castor3D/Miscellaneous/Pattern.hpp" diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Sphere.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Sphere.hpp index ec017c582e..58472faf2e 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Sphere.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Sphere.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Sphere_H___ #define ___C3D_Sphere_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/Generator/SphereSection.hpp b/include/Core/Castor3D/Model/Mesh/Generator/SphereSection.hpp index d4433d60d9..c62a88cc91 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/SphereSection.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/SphereSection.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_SphereSection_H___ #define ___C3D_SphereSection_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" #include diff --git a/include/Core/Castor3D/Model/Mesh/Generator/Torus.hpp b/include/Core/Castor3D/Model/Mesh/Generator/Torus.hpp index 7412449a51..d12ad5039c 100644 --- a/include/Core/Castor3D/Model/Mesh/Generator/Torus.hpp +++ b/include/Core/Castor3D/Model/Mesh/Generator/Torus.hpp @@ -4,6 +4,7 @@ See LICENSE file in root folder #ifndef ___C3D_Torus_H___ #define ___C3D_Torus_H___ +#include "Castor3D/Model/Mesh/Generator/MeshGeneratorModule.hpp" #include "Castor3D/Model/Mesh/MeshGenerator.hpp" namespace castor3d diff --git a/include/Core/Castor3D/Model/Mesh/MeshFactory.hpp b/include/Core/Castor3D/Model/Mesh/MeshFactory.hpp index f94e6fbf14..ce10b9a9da 100644 --- a/include/Core/Castor3D/Model/Mesh/MeshFactory.hpp +++ b/include/Core/Castor3D/Model/Mesh/MeshFactory.hpp @@ -11,7 +11,7 @@ See LICENSE file in root folder namespace castor3d { class MeshFactory - : public castor::Factory< MeshGenerator, castor::String, std::unique_ptr< MeshGenerator > > + : public castor::Factory< MeshGenerator, castor::String, castor::UniquePtr< MeshGenerator > > { public: /** diff --git a/include/Core/Castor3D/Model/Mesh/MeshModule.hpp b/include/Core/Castor3D/Model/Mesh/MeshModule.hpp index 531295f540..ce807d4ac7 100644 --- a/include/Core/Castor3D/Model/Mesh/MeshModule.hpp +++ b/include/Core/Castor3D/Model/Mesh/MeshModule.hpp @@ -126,12 +126,12 @@ namespace castor3d uint32_t instanceCount; }; - CU_DeclareSmartPtr( Mesh ); - CU_DeclareSmartPtr( MeshGenerator ); - CU_DeclareSmartPtr( MeshImporter ); + CU_DeclareSmartPtr( castor3d, Mesh, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshGenerator, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshImporterFactory, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshFactory, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshImporterFactory, C3D_API ); /** *\~english * Helper structure to specialise a cache behaviour. @@ -164,7 +164,7 @@ namespace castor3d using MeshRes = MeshCacheTraits::ElementPtrT; using MeshResPtr = MeshCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, MeshCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshCache, C3D_API ); //! Mesh pointer array CU_DeclareMap( castor::String, MeshResPtr, MeshPtrStr ); diff --git a/include/Core/Castor3D/Model/Mesh/Submesh/Component/ComponentModule.hpp b/include/Core/Castor3D/Model/Mesh/Submesh/Component/ComponentModule.hpp index fefe5c6448..18a630d9d5 100644 --- a/include/Core/Castor3D/Model/Mesh/Submesh/Component/ComponentModule.hpp +++ b/include/Core/Castor3D/Model/Mesh/Submesh/Component/ComponentModule.hpp @@ -189,16 +189,17 @@ namespace castor3d */ using ColoursComponent = BaseDataComponentT< SubmeshFlag::eColours >; - CU_DeclareCUSmartPtr( castor3d, IndexMapping, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, InstantiationComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LinesMapping, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshletComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MorphComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PassMasksComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkinComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SubmeshComponent, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TriFaceMapping, C3D_API ); - CU_DeclareCUEnumTemplateSmartPtr( castor3d, BaseDataComponentT, castor3d::SubmeshFlag ); + CU_DeclareSmartPtr( castor3d, IndexMapping, C3D_API ); + CU_DeclareSmartPtr( castor3d, InstantiationComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, LinesMapping, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshletComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, MorphComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassMasksComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkinComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, SubmeshComponent, C3D_API ); + CU_DeclareSmartPtr( castor3d, TriFaceMapping, C3D_API ); + + CU_DeclareEnumTemplateSmartPtr( castor3d, BaseDataComponent, castor3d::SubmeshFlag ); //! Face array CU_DeclareVector( Face, Face ); diff --git a/include/Core/Castor3D/Model/Mesh/Submesh/SubmeshModule.hpp b/include/Core/Castor3D/Model/Mesh/Submesh/SubmeshModule.hpp index 36cebc7c80..9077907bd2 100644 --- a/include/Core/Castor3D/Model/Mesh/Submesh/SubmeshModule.hpp +++ b/include/Core/Castor3D/Model/Mesh/Submesh/SubmeshModule.hpp @@ -352,7 +352,7 @@ namespace castor3d castor::BoundingBox boundingBox{}; }; - CU_DeclareCUSmartPtr( castor3d, Submesh, C3D_API ); + CU_DeclareSmartPtr( castor3d, Submesh, C3D_API ); //! Submesh pointer array CU_DeclareVector( SubmeshUPtr, SubmeshPtr ); diff --git a/include/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationModule.hpp b/include/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationModule.hpp index d42dbc9f8b..b83074e228 100644 --- a/include/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationModule.hpp +++ b/include/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationModule.hpp @@ -77,11 +77,11 @@ namespace castor3d }; using TransformArray = std::vector< ObjectTransform >; - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimation, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationKeyFrame, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationObject, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationBone, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimation, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationKeyFrame, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationObject, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationBone, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationNode, C3D_API ); using SkeletonAnimationObjectArray = std::vector< SkeletonAnimationObjectRPtr >; diff --git a/include/Core/Castor3D/Model/Skeleton/SkeletonModule.hpp b/include/Core/Castor3D/Model/Skeleton/SkeletonModule.hpp index 5b4877ec0d..a50e89a27f 100644 --- a/include/Core/Castor3D/Model/Skeleton/SkeletonModule.hpp +++ b/include/Core/Castor3D/Model/Skeleton/SkeletonModule.hpp @@ -118,13 +118,12 @@ namespace castor3d using SkeletonRes = SkeletonCacheTraits::ElementPtrT; using SkeletonResPtr = SkeletonCacheTraits::ElementObsT; - CU_DeclareSmartPtr( SkeletonImporter ); - - CU_DeclareCUSmartPtr( castor3d, BoneNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Skeleton, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonImporterFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, BoneNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, Skeleton, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonImporterFactory, C3D_API ); //! Skinned vertex data array CU_DeclareVector( VertexBoneData, VertexBoneData ); diff --git a/include/Core/Castor3D/Overlay/OverlayModule.hpp b/include/Core/Castor3D/Overlay/OverlayModule.hpp index 0deef58ba3..05a4482b6b 100644 --- a/include/Core/Castor3D/Overlay/OverlayModule.hpp +++ b/include/Core/Castor3D/Overlay/OverlayModule.hpp @@ -421,14 +421,14 @@ namespace castor3d } }; - CU_DeclareCUSmartPtr( castor3d, BorderPanelOverlay, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, DebugOverlays, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, FontTexture, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Overlay, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, OverlayCategory, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, OverlayFactory, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PanelOverlay, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextOverlay, C3D_API ); + CU_DeclareSmartPtr( castor3d, BorderPanelOverlay, C3D_API ); + CU_DeclareSmartPtr( castor3d, DebugOverlays, C3D_API ); + CU_DeclareSmartPtr( castor3d, FontTexture, C3D_API ); + CU_DeclareSmartPtr( castor3d, Overlay, C3D_API ); + CU_DeclareSmartPtr( castor3d, OverlayCategory, C3D_API ); + CU_DeclareSmartPtr( castor3d, OverlayFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, PanelOverlay, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextOverlay, C3D_API ); /** *\~english * Helper structure to specialise a cache behaviour. @@ -461,7 +461,7 @@ namespace castor3d using OverlayRes = OverlayCacheTraits::ElementPtrT; using OverlayResPtr = OverlayCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, OverlayCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, OverlayCache, C3D_API ); CU_DeclareVector( OverlayRPtr, OverlayPtr ); CU_DeclareMap( castor::String, OverlayResPtr, OverlayPtrStr ); diff --git a/include/Core/Castor3D/Plugin/PluginModule.hpp b/include/Core/Castor3D/Plugin/PluginModule.hpp index 77bb204c1d..e1526eb017 100644 --- a/include/Core/Castor3D/Plugin/PluginModule.hpp +++ b/include/Core/Castor3D/Plugin/PluginModule.hpp @@ -138,14 +138,14 @@ namespace castor3d */ class ToneMappingPlugin; - CU_DeclareCUSmartPtr( castor3d, Plugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ImporterPlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, DividerPlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GeneratorPlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GenericPlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PostFxPlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticlePlugin, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ToneMappingPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, Plugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, ImporterPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, DividerPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, GeneratorPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, GenericPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, PostFxPlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticlePlugin, C3D_API ); + CU_DeclareSmartPtr( castor3d, ToneMappingPlugin, C3D_API ); CU_DeclareMap( castor::String, PluginUPtr, PluginStr ); CU_DeclareArray( PluginStrMap, PluginType::eCount, PluginStrMap ); @@ -181,7 +181,7 @@ namespace castor3d using PluginRes = PluginCacheTraits::ElementPtrT; using PluginResPtr = PluginCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, PluginCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, PluginCache, C3D_API ); //@} } diff --git a/include/Core/Castor3D/Render/Culling/CullingModule.hpp b/include/Core/Castor3D/Render/Culling/CullingModule.hpp index 6439c12b40..d7d144d376 100644 --- a/include/Core/Castor3D/Render/Culling/CullingModule.hpp +++ b/include/Core/Castor3D/Render/Culling/CullingModule.hpp @@ -44,7 +44,7 @@ namespace castor3d */ class SceneCuller; - CU_DeclareCUSmartPtr( castor3d, SceneCuller, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneCuller, C3D_API ); using SceneCullerSignalFunction = std::function< void( SceneCuller const & ) >; using SceneCullerSignal = castor::SignalT< SceneCullerSignalFunction >; diff --git a/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.hpp b/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.hpp index 3db30b57d5..757a482606 100644 --- a/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.hpp +++ b/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.hpp @@ -29,7 +29,7 @@ namespace castor3d : public castor::OwnedBy< Engine > { public: - using EnvironmentMapPasses = std::array< std::unique_ptr< EnvironmentMapPass >, size_t( CubeMapFace::eCount ) >; + using EnvironmentMapPasses = std::array< EnvironmentMapPassUPtr, size_t( CubeMapFace::eCount ) >; public: /** diff --git a/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapModule.hpp b/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapModule.hpp index 6be9a1f1c4..a4fa2f9251 100644 --- a/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapModule.hpp +++ b/include/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapModule.hpp @@ -32,8 +32,8 @@ namespace castor3d */ class EnvironmentMapPass; - CU_DeclareSmartPtr( EnvironmentMap ); - CU_DeclareSmartPtr( EnvironmentMapPass ); + CU_DeclareSmartPtr( castor3d, EnvironmentMap, C3D_API ); + CU_DeclareSmartPtr( castor3d, EnvironmentMapPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.hpp b/include/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.hpp index f0045ac653..903ce56a13 100644 --- a/include/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.hpp +++ b/include/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.hpp @@ -133,14 +133,14 @@ namespace castor3d using LightPropagationVolumes = LightPropagationVolumesT< false >; using LightPropagationVolumesG = LightPropagationVolumesT< true >; - CU_DeclareCUSmartPtr( castor3d, GeometryInjectionPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LayeredLightPropagationVolumes, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LayeredLightPropagationVolumesG, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightInjectionPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightPropagationPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightPropagationVolumes, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightPropagationVolumesG, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightVolumePassResult, C3D_API ); + CU_DeclareSmartPtr( castor3d, GeometryInjectionPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, LayeredLightPropagationVolumes, C3D_API ); + CU_DeclareSmartPtr( castor3d, LayeredLightPropagationVolumesG, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightInjectionPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightPropagationPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightPropagationVolumes, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightPropagationVolumesG, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightVolumePassResult, C3D_API ); using LightPropagationVolumesLightType = std::array< LightPropagationVolumesUPtr, size_t( LightType::eCount ) >; using LayeredLightPropagationVolumesLightType = std::array< LayeredLightPropagationVolumesUPtr, size_t( LightType::eCount ) >; diff --git a/include/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizeModule.hpp b/include/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizeModule.hpp index 194e475da5..337c91c0cf 100644 --- a/include/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizeModule.hpp +++ b/include/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizeModule.hpp @@ -62,10 +62,10 @@ namespace castor3d */ class VoxelSceneData; - CU_DeclareCUSmartPtr( castor3d, VoxelBufferToTexture, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VoxelizePass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VoxelSecondaryBounce, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Voxelizer, C3D_API ); + CU_DeclareSmartPtr( castor3d, VoxelBufferToTexture, C3D_API ); + CU_DeclareSmartPtr( castor3d, VoxelizePass, C3D_API ); + CU_DeclareSmartPtr( castor3d, VoxelSecondaryBounce, C3D_API ); + CU_DeclareSmartPtr( castor3d, Voxelizer, C3D_API ); struct Voxel { diff --git a/include/Core/Castor3D/Render/Node/RenderNodeModule.hpp b/include/Core/Castor3D/Render/Node/RenderNodeModule.hpp index 10957935e8..811a7b6850 100644 --- a/include/Core/Castor3D/Render/Node/RenderNodeModule.hpp +++ b/include/Core/Castor3D/Render/Node/RenderNodeModule.hpp @@ -69,10 +69,10 @@ namespace castor3d */ struct SceneRenderNodes; - CU_DeclareCUSmartPtr( castor3d, BillboardRenderNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SubmeshRenderNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, QueueRenderNodes, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneRenderNodes, C3D_API ); + CU_DeclareSmartPtr( castor3d, BillboardRenderNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, SubmeshRenderNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, QueueRenderNodes, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneRenderNodes, C3D_API ); using PipelineBuffer = std::pair< PipelineBaseHash, ashes::BufferBase const * >; diff --git a/include/Core/Castor3D/Render/Opaque/Lighting/LightingModule.hpp b/include/Core/Castor3D/Render/Opaque/Lighting/LightingModule.hpp index b917250a34..c70aa8de71 100644 --- a/include/Core/Castor3D/Render/Opaque/Lighting/LightingModule.hpp +++ b/include/Core/Castor3D/Render/Opaque/Lighting/LightingModule.hpp @@ -228,7 +228,7 @@ namespace castor3d , castor::Point3f const & attenuation , float max ); - CU_DeclareCUSmartPtr( castor3d, SubsurfaceScatteringPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, SubsurfaceScatteringPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/Opaque/OpaqueModule.hpp b/include/Core/Castor3D/Render/Opaque/OpaqueModule.hpp index 4012363c1b..1a4da4837b 100644 --- a/include/Core/Castor3D/Render/Opaque/OpaqueModule.hpp +++ b/include/Core/Castor3D/Render/Opaque/OpaqueModule.hpp @@ -136,13 +136,13 @@ namespace castor3d */ class VisibilityResolvePass; - CU_DeclareCUSmartPtr( castor3d, DeferredRendering, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, IndirectLightingPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightingPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, OpaquePassResult, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, OpaqueRendering, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, OpaqueResolvePass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VisibilityReorderPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, DeferredRendering, C3D_API ); + CU_DeclareSmartPtr( castor3d, IndirectLightingPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightingPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, OpaquePassResult, C3D_API ); + CU_DeclareSmartPtr( castor3d, OpaqueRendering, C3D_API ); + CU_DeclareSmartPtr( castor3d, OpaqueResolvePass, C3D_API ); + CU_DeclareSmartPtr( castor3d, VisibilityReorderPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/Overlays/OverlaysModule.hpp b/include/Core/Castor3D/Render/Overlays/OverlaysModule.hpp index 6ed0004dba..148b9fb02c 100644 --- a/include/Core/Castor3D/Render/Overlays/OverlaysModule.hpp +++ b/include/Core/Castor3D/Render/Overlays/OverlaysModule.hpp @@ -165,8 +165,8 @@ namespace castor3d bool secondary{}; }; - CU_DeclareCUSmartPtr( castor3d, OverlayRenderer, C3D_API ); - CU_DeclareSmartPtr( OverlayTextBufferPool ); + CU_DeclareSmartPtr( castor3d, OverlayRenderer, C3D_API ); + CU_DeclareSmartPtr( castor3d, OverlayTextBufferPool, C3D_API ); struct OverlaysCounts { diff --git a/include/Core/Castor3D/Render/PBR/EnvironmentPrefilter.hpp b/include/Core/Castor3D/Render/PBR/EnvironmentPrefilter.hpp index ca4578d651..7e7bfbed03 100644 --- a/include/Core/Castor3D/Render/PBR/EnvironmentPrefilter.hpp +++ b/include/Core/Castor3D/Render/PBR/EnvironmentPrefilter.hpp @@ -50,7 +50,6 @@ namespace castor3d }; ashes::RenderPass const & m_renderPass; std::string m_prefix; - SamplerObs m_sampler{}; std::array< FrameBuffer, 6u > m_frameBuffers; CommandsSemaphore m_commands; }; diff --git a/include/Core/Castor3D/Render/PBR/PbrModule.hpp b/include/Core/Castor3D/Render/PBR/PbrModule.hpp index e752ae365c..dd558578bd 100644 --- a/include/Core/Castor3D/Render/PBR/PbrModule.hpp +++ b/include/Core/Castor3D/Render/PBR/PbrModule.hpp @@ -50,7 +50,7 @@ namespace castor3d */ class RadianceComputer; - CU_DeclareSmartPtr( IblTextures ); + CU_DeclareSmartPtr( castor3d, IblTextures, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/Passes/PassesModule.hpp b/include/Core/Castor3D/Render/Passes/PassesModule.hpp index 8c569bda91..42b4f663a4 100644 --- a/include/Core/Castor3D/Render/Passes/PassesModule.hpp +++ b/include/Core/Castor3D/Render/Passes/PassesModule.hpp @@ -188,15 +188,15 @@ namespace castor3d */ class StencilPass; - CU_DeclareCUSmartPtr( castor3d, BackgroundRenderer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, CombinePass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, DownscalePass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GaussianBlur, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LineariseDepthPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PickingPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderQuad, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderGrid, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, StencilPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, BackgroundRenderer, C3D_API ); + CU_DeclareSmartPtr( castor3d, CombinePass, C3D_API ); + CU_DeclareSmartPtr( castor3d, DownscalePass, C3D_API ); + CU_DeclareSmartPtr( castor3d, GaussianBlur, C3D_API ); + CU_DeclareSmartPtr( castor3d, LineariseDepthPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, PickingPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderQuad, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderGrid, C3D_API ); + CU_DeclareSmartPtr( castor3d, StencilPass, C3D_API ); CU_DeclareVector( CommandsSemaphore, CommandsSemaphore ); diff --git a/include/Core/Castor3D/Render/PostEffect/PostEffectModule.hpp b/include/Core/Castor3D/Render/PostEffect/PostEffectModule.hpp index d5eb18d783..fed30901ae 100644 --- a/include/Core/Castor3D/Render/PostEffect/PostEffectModule.hpp +++ b/include/Core/Castor3D/Render/PostEffect/PostEffectModule.hpp @@ -45,7 +45,7 @@ namespace castor3d */ struct PostEffectSurface; - CU_DeclareCUSmartPtr( castor3d, PostEffect, C3D_API ); + CU_DeclareSmartPtr( castor3d, PostEffect, C3D_API ); /** *\~english *\brief diff --git a/include/Core/Castor3D/Render/Prepass/PrepassModule.hpp b/include/Core/Castor3D/Render/Prepass/PrepassModule.hpp index a38be89234..50979e57ea 100644 --- a/include/Core/Castor3D/Render/Prepass/PrepassModule.hpp +++ b/include/Core/Castor3D/Render/Prepass/PrepassModule.hpp @@ -81,10 +81,10 @@ namespace castor3d */ class VisibilityPass; - CU_DeclareCUSmartPtr( castor3d, DepthPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PrepassRendering, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PrepassResult, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VisibilityPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, DepthPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, PrepassRendering, C3D_API ); + CU_DeclareSmartPtr( castor3d, PrepassResult, C3D_API ); + CU_DeclareSmartPtr( castor3d, VisibilityPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/RenderModule.hpp b/include/Core/Castor3D/Render/RenderModule.hpp index 2f6221c146..1b0a0457e0 100644 --- a/include/Core/Castor3D/Render/RenderModule.hpp +++ b/include/Core/Castor3D/Render/RenderModule.hpp @@ -675,20 +675,19 @@ namespace castor3d */ class Viewport; - CU_DeclareCUSmartPtr( castor3d, Frustum, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Picking, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderDevice, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderLoop, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderPipeline, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderQueue, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderSystem, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderTarget, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderTechnique, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderTechniquePass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, RenderWindow, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Viewport, C3D_API ); - - CU_DeclareSmartPtr( RenderNodesPass ); + CU_DeclareSmartPtr( castor3d, Frustum, C3D_API ); + CU_DeclareSmartPtr( castor3d, Picking, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderDevice, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderLoop, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderNodesPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderPipeline, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderQueue, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderSystem, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderTarget, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderTechnique, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderTechniquePass, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderWindow, C3D_API ); + CU_DeclareSmartPtr( castor3d, Viewport, C3D_API ); using RenderWindowPtr = std::unique_ptr< RenderWindow >; @@ -738,10 +737,22 @@ namespace castor3d , RenderTechnique & , TechniquePasses & , crg::FramePassArray ) >; + + RenderPassRegisterInfo( castor::String pname + , Creator pcreate + , TechniquePassEvent pevent + , RenderPassTypeID pid = {} ) + : name{ std::move( pname ) } + , create{ std::move( pcreate ) } + , event{ std::move( pevent ) } + , id{ std::move( pid ) } + { + } + castor::String name; Creator create; TechniquePassEvent event; - RenderPassTypeID id{}; + RenderPassTypeID id; }; struct CpuUpdater diff --git a/include/Core/Castor3D/Render/RenderNodesPass.hpp b/include/Core/Castor3D/Render/RenderNodesPass.hpp index 49f408ce91..97a56567b2 100644 --- a/include/Core/Castor3D/Render/RenderNodesPass.hpp +++ b/include/Core/Castor3D/Render/RenderNodesPass.hpp @@ -920,6 +920,7 @@ namespace castor3d RenderNodesPass const * m_pass; }; + CU_DeclareSmartPtr( castor3d, IsRenderPassEnabled, C3D_API ); } #endif diff --git a/include/Core/Castor3D/Render/RenderSystem.hpp b/include/Core/Castor3D/Render/RenderSystem.hpp index 19653bb7be..6a70b5979b 100644 --- a/include/Core/Castor3D/Render/RenderSystem.hpp +++ b/include/Core/Castor3D/Render/RenderSystem.hpp @@ -412,7 +412,7 @@ namespace castor3d VkPhysicalDeviceMemoryProperties m_memoryProperties; VkPhysicalDeviceProperties m_properties; VkPhysicalDeviceFeatures m_features; - RenderDeviceSPtr m_device; + RenderDeviceUPtr m_device; std::stack< SceneRPtr > m_stackScenes; castor::Nanoseconds m_gpuTime; ashes::BufferPtr< castor::Point4f > m_randomStorage; diff --git a/include/Core/Castor3D/Render/RenderWindow.hpp b/include/Core/Castor3D/Render/RenderWindow.hpp index 096a48ebc8..ad2581fd8d 100644 --- a/include/Core/Castor3D/Render/RenderWindow.hpp +++ b/include/Core/Castor3D/Render/RenderWindow.hpp @@ -567,7 +567,7 @@ namespace castor3d mutable std::atomic_bool m_skip{ false }; std::atomic_bool m_loading; castor::PxBufferBaseUPtr m_saveBuffer; - PickingSPtr m_picking; + PickingUPtr m_picking; castor::Position m_mousePosition; Texture3DTo2DUPtr m_texture3Dto2D; IntermediateView m_tex3DTo2DIntermediate; diff --git a/include/Core/Castor3D/Render/ShadowMap/ShadowMapModule.hpp b/include/Core/Castor3D/Render/ShadowMap/ShadowMapModule.hpp index 89cd3654bd..478a1a336a 100644 --- a/include/Core/Castor3D/Render/ShadowMap/ShadowMapModule.hpp +++ b/include/Core/Castor3D/Render/ShadowMap/ShadowMapModule.hpp @@ -128,8 +128,8 @@ namespace castor3d */ class ShadowMapPassSpot; - CU_DeclareCUSmartPtr( castor3d, ShadowMap, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ShadowMapPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, ShadowMap, C3D_API ); + CU_DeclareSmartPtr( castor3d, ShadowMapPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/Ssao/SsaoModule.hpp b/include/Core/Castor3D/Render/Ssao/SsaoModule.hpp index 80597bc0c4..7cbbd97098 100644 --- a/include/Core/Castor3D/Render/Ssao/SsaoModule.hpp +++ b/include/Core/Castor3D/Render/Ssao/SsaoModule.hpp @@ -62,9 +62,9 @@ namespace castor3d */ class SsaoRawAOPass; - CU_DeclareCUSmartPtr( castor3d, SsaoBlurPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SsaoPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SsaoRawAOPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, SsaoBlurPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, SsaoPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, SsaoRawAOPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/ToTexture/RenderToTextureModule.hpp b/include/Core/Castor3D/Render/ToTexture/RenderToTextureModule.hpp index 9248c91193..54e1eb275e 100644 --- a/include/Core/Castor3D/Render/ToTexture/RenderToTextureModule.hpp +++ b/include/Core/Castor3D/Render/ToTexture/RenderToTextureModule.hpp @@ -41,10 +41,9 @@ namespace castor3d */ class Texture3DTo2D; - CU_DeclareSmartPtr( EquirectangularToCube ); - CU_DeclareSmartPtr( RenderCube ); - - CU_DeclareCUSmartPtr( castor3d, Texture3DTo2D, C3D_API ); + CU_DeclareSmartPtr( castor3d, EquirectangularToCube, C3D_API ); + CU_DeclareSmartPtr( castor3d, RenderCube, C3D_API ); + CU_DeclareSmartPtr( castor3d, Texture3DTo2D, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/ToneMapping/ToneMappingModule.hpp b/include/Core/Castor3D/Render/ToneMapping/ToneMappingModule.hpp index 026f82ef07..4f6a9665b7 100644 --- a/include/Core/Castor3D/Render/ToneMapping/ToneMappingModule.hpp +++ b/include/Core/Castor3D/Render/ToneMapping/ToneMappingModule.hpp @@ -53,7 +53,7 @@ namespace castor3d */ class ToneMappingVisitor; - CU_DeclareCUSmartPtr( castor3d, ToneMapping, C3D_API ); + CU_DeclareSmartPtr( castor3d, ToneMapping, C3D_API ); /** *\~english *\brief diff --git a/include/Core/Castor3D/Render/Transform/TransformModule.hpp b/include/Core/Castor3D/Render/Transform/TransformModule.hpp index cfbdb0c20f..051a3f0f74 100644 --- a/include/Core/Castor3D/Render/Transform/TransformModule.hpp +++ b/include/Core/Castor3D/Render/Transform/TransformModule.hpp @@ -77,9 +77,9 @@ namespace castor3d */ class MeshletBoundsTransformPass; - CU_DeclareCUSmartPtr( castor3d, VertexTransforming, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, VertexTransformPass, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MeshletBoundsTransformPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, VertexTransforming, C3D_API ); + CU_DeclareSmartPtr( castor3d, VertexTransformPass, C3D_API ); + CU_DeclareSmartPtr( castor3d, MeshletBoundsTransformPass, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Render/Transparent/TransparentModule.hpp b/include/Core/Castor3D/Render/Transparent/TransparentModule.hpp index 77832d3e50..7d6147a19f 100644 --- a/include/Core/Castor3D/Render/Transparent/TransparentModule.hpp +++ b/include/Core/Castor3D/Render/Transparent/TransparentModule.hpp @@ -92,9 +92,9 @@ namespace castor3d */ class WeightedBlendRendering; - CU_DeclareCUSmartPtr( castor3d, WeightedBlendRendering, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TransparentPassResult, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TransparentRendering, C3D_API ); + CU_DeclareSmartPtr( castor3d, WeightedBlendRendering, C3D_API ); + CU_DeclareSmartPtr( castor3d, TransparentPassResult, C3D_API ); + CU_DeclareSmartPtr( castor3d, TransparentRendering, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/Animation/AnimationModule.hpp b/include/Core/Castor3D/Scene/Animation/AnimationModule.hpp index 0e30ad4e35..1057e8e5b6 100644 --- a/include/Core/Castor3D/Scene/Animation/AnimationModule.hpp +++ b/include/Core/Castor3D/Scene/Animation/AnimationModule.hpp @@ -92,8 +92,8 @@ namespace castor3d class SceneNodeAnimation; class SceneNodeAnimationKeyFrame; - CU_DeclareCUSmartPtr( castor3d, SceneNodeAnimation, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneNodeAnimationKeyFrame, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneNodeAnimation, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneNodeAnimationKeyFrame, C3D_API ); //@} struct GroupAnimation @@ -111,16 +111,17 @@ namespace castor3d using Animable = AnimableT< Engine >; using Animation = AnimationT< Engine >; - CU_DeclareCUSmartPtr( castor3d, Animable, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedObjectGroup, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedMesh, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedObject, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedSceneNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedSkeleton, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimatedTexture, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Animation, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, AnimationInstance, C3D_API ); - CU_DeclareCUTemplateSmartPtr( castor3d, AnimableT ); + CU_DeclareSmartPtr( castor3d, Animable, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedObjectGroup, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedMesh, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedObject, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedSceneNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedSkeleton, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedTexture, C3D_API ); + CU_DeclareSmartPtr( castor3d, Animation, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimationInstance, C3D_API ); + + CU_DeclareTemplateSmartPtr( castor3d, Animable ); using OnAnimatedSkeletonChangeFunction = std::function< void( AnimatedObjectGroup const &, AnimatedSkeleton & ) >; using OnAnimatedSkeletonChange = castor::SignalT< OnAnimatedSkeletonChangeFunction >; @@ -168,7 +169,7 @@ namespace castor3d using AnimatedObjectGroupRes = AnimatedObjectGroupCacheTraits::ElementPtrT; using AnimatedObjectGroupResPtr = AnimatedObjectGroupCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, AnimatedObjectGroupCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, AnimatedObjectGroupCache, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationModule.hpp b/include/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationModule.hpp index 40e00c618f..2120ff5495 100644 --- a/include/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationModule.hpp +++ b/include/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationModule.hpp @@ -38,7 +38,7 @@ namespace castor3d */ class MeshAnimationInstanceSubmesh; - CU_DeclareSmartPtr( MeshAnimationInstance ); + CU_DeclareSmartPtr( castor3d, MeshAnimationInstance, C3D_API ); //! MeshAnimationInstanceSubmesh map, sorted by submesh ID. CU_DeclareMap( uint32_t, MeshAnimationInstanceSubmesh, MeshAnimationInstanceSubmesh ); diff --git a/include/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationModule.hpp b/include/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationModule.hpp index 8f366148bf..a7ce21c0c9 100644 --- a/include/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationModule.hpp +++ b/include/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationModule.hpp @@ -25,7 +25,7 @@ namespace castor3d */ class SceneNodeAnimationInstance; - CU_DeclareSmartPtr( SceneNodeAnimationInstance ); + CU_DeclareSmartPtr( castor3d, SceneNodeAnimationInstance, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationModule.hpp b/include/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationModule.hpp index 25a23598cb..ba96a9c2f3 100644 --- a/include/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationModule.hpp +++ b/include/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationModule.hpp @@ -73,10 +73,10 @@ namespace castor3d */ class SkeletonAnimationInstanceObject; - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationInstance, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationInstanceBone, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationInstanceNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SkeletonAnimationInstanceObject, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationInstance, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationInstanceBone, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationInstanceNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkeletonAnimationInstanceObject, C3D_API ); //! SkeletonAnimationInstanceObject pointer array. CU_DeclareVector( SkeletonAnimationInstanceObjectUPtr, SkeletonAnimationInstanceObjectPtr ); diff --git a/include/Core/Castor3D/Scene/Animation/Texture/TextureAnimationModule.hpp b/include/Core/Castor3D/Scene/Animation/Texture/TextureAnimationModule.hpp index 905e1d0694..e2d3734228 100644 --- a/include/Core/Castor3D/Scene/Animation/Texture/TextureAnimationModule.hpp +++ b/include/Core/Castor3D/Scene/Animation/Texture/TextureAnimationModule.hpp @@ -25,7 +25,7 @@ namespace castor3d */ class TextureAnimationInstance; - CU_DeclareSmartPtr( TextureAnimationInstance ); + CU_DeclareSmartPtr( castor3d, TextureAnimationInstance, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/Background/BackgroundModule.hpp b/include/Core/Castor3D/Scene/Background/BackgroundModule.hpp index ab4295e4eb..0baf90e51b 100644 --- a/include/Core/Castor3D/Scene/Background/BackgroundModule.hpp +++ b/include/Core/Castor3D/Scene/Background/BackgroundModule.hpp @@ -80,7 +80,10 @@ namespace castor3d */ class SkyboxBackground; - CU_DeclareSmartPtr( SceneBackground ); + CU_DeclareSmartPtr( castor3d, SceneBackground, C3D_API ); + CU_DeclareSmartPtr( castor3d, ColourBackground, C3D_API ); + CU_DeclareSmartPtr( castor3d, ImageBackground, C3D_API ); + CU_DeclareSmartPtr( castor3d, SkyboxBackground, C3D_API ); using BackgroundChangedFunc = std::function< void( SceneBackground const & ) >; using OnBackgroundChanged = castor::SignalT< BackgroundChangedFunc >; diff --git a/include/Core/Castor3D/Scene/Light/Light.hpp b/include/Core/Castor3D/Scene/Light/Light.hpp index 87325a8f0b..6020f871b6 100644 --- a/include/Core/Castor3D/Scene/Light/Light.hpp +++ b/include/Core/Castor3D/Scene/Light/Light.hpp @@ -121,9 +121,9 @@ namespace castor3d return m_category->getBoundingBox(); } - LightCategorySPtr getCategory()const + LightCategoryRPtr getCategory()const { - return m_category; + return m_category.get(); } bool isShadowProducer()const @@ -408,7 +408,7 @@ namespace castor3d std::atomic_bool m_currentShadowCaster{ false }; bool m_dirty{ true }; ShadowConfig m_shadows; - LightCategorySPtr m_category; + LightCategoryUPtr m_category; ShadowMapRPtr m_shadowMap{ nullptr }; uint32_t m_shadowMapIndex{ 0u }; std::atomic< GlobalIlluminationType > m_currentGlobalIllumination{ GlobalIlluminationType::eNone }; diff --git a/include/Core/Castor3D/Scene/Light/LightModule.hpp b/include/Core/Castor3D/Scene/Light/LightModule.hpp index f704f288b9..da41bc8b9a 100644 --- a/include/Core/Castor3D/Scene/Light/LightModule.hpp +++ b/include/Core/Castor3D/Scene/Light/LightModule.hpp @@ -121,16 +121,13 @@ namespace castor3d */ class SpotLight; - CU_DeclareCUSmartPtr( castor3d, Light, C3D_API ); - CU_DeclareSmartPtr( LightFactory ); - CU_DeclareSmartPtr( LightCategory ); - CU_DeclareSmartPtr( LightImporter ); - CU_DeclareSmartPtr( DirectionalLight ); - CU_DeclareSmartPtr( PointLight ); - CU_DeclareSmartPtr( SpotLight ); - - class LightFactory; - CU_DeclareSmartPtr( LightFactory ); + CU_DeclareSmartPtr( castor3d, Light, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightCategory, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, DirectionalLight, C3D_API ); + CU_DeclareSmartPtr( castor3d, PointLight, C3D_API ); + CU_DeclareSmartPtr( castor3d, SpotLight, C3D_API ); //! Array of lights CU_DeclareVector( LightRPtr, Lights ); @@ -184,7 +181,7 @@ namespace castor3d using LightRes = CameraCacheTraits::ElementPtrT; using LightResPtr = CameraCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, LightCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightCache, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/ParticleSystem/ParticleModule.hpp b/include/Core/Castor3D/Scene/ParticleSystem/ParticleModule.hpp index 6175e688ff..da9b508e23 100644 --- a/include/Core/Castor3D/Scene/ParticleSystem/ParticleModule.hpp +++ b/include/Core/Castor3D/Scene/ParticleSystem/ParticleModule.hpp @@ -170,7 +170,7 @@ namespace castor3d */ class ParticleUpdater; - CU_DeclareCUSmartPtr( castor3d, CpuParticleSystem, C3D_API ); + CU_DeclareSmartPtr( castor3d, CpuParticleSystem, C3D_API ); /** *\~english *\brief @@ -187,13 +187,13 @@ namespace castor3d template< ParticleFormat Type > struct ElementTyper; - CU_DeclareCUSmartPtr( castor3d, ComputeParticleSystem, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleElementDeclaration, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleEmitter, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleSystem, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleSystemImpl, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleUpdater, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ParticleFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, ComputeParticleSystem, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleElementDeclaration, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleEmitter, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleSystem, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleSystemImpl, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleUpdater, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleFactory, C3D_API ); CU_DeclareVector( Particle, Particle ); CU_DeclareVector( ParticleEmitterUPtr, ParticleEmitter ); @@ -229,7 +229,7 @@ namespace castor3d using ParticleSystemRes = CameraCacheTraits::ElementPtrT; using ParticleSystemResPtr = CameraCacheTraits::ElementObsT; - CU_DeclareCUSmartPtr( castor3d, ParticleSystemCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, ParticleSystemCache, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Scene/Scene.hpp b/include/Core/Castor3D/Scene/Scene.hpp index dc46842d5a..aca5b1e2b9 100644 --- a/include/Core/Castor3D/Scene/Scene.hpp +++ b/include/Core/Castor3D/Scene/Scene.hpp @@ -121,7 +121,7 @@ namespace castor3d *\brief Définit le fond de la scène. *\param[in] value La nouvelle valeur. */ - C3D_API void setBackground( SceneBackgroundSPtr value ); + C3D_API void setBackground( SceneBackgroundUPtr value ); /** *\~english *\brief Merges the content of the given scene to this scene @@ -308,9 +308,9 @@ namespace castor3d return m_boundingBox; } - SceneBackgroundSPtr getBackground()const + SceneBackgroundRPtr getBackground()const { - return m_background; + return m_background.get(); } castor::RgbColour const & getBackgroundColour()const @@ -497,11 +497,11 @@ namespace castor3d bool m_changed{ false }; castor::RgbColour m_ambientLight{ 0.0f, 0.0f, 0.0f }; castor::RgbColour m_backgroundColour{ 0.0f, 0.0f, 0.0f }; - SceneBackgroundSPtr m_background; - LightFactorySPtr m_lightFactory; + SceneBackgroundUPtr m_background; + LightFactoryUPtr m_lightFactory; Fog m_fog; FrameListenerRPtr m_listener{}; - std::unique_ptr< EnvironmentMap > m_reflectionMap; + EnvironmentMapUPtr m_reflectionMap; bool m_needsSubsurfaceScattering{ false }; bool m_hasOpaqueObjects{ false }; bool m_hasTransparentObjects{ false }; diff --git a/include/Core/Castor3D/Scene/SceneFileParser.hpp b/include/Core/Castor3D/Scene/SceneFileParser.hpp index c48c501a02..f1f24c47f9 100644 --- a/include/Core/Castor3D/Scene/SceneFileParser.hpp +++ b/include/Core/Castor3D/Scene/SceneFileParser.hpp @@ -194,16 +194,20 @@ namespace castor3d castor::ImageRPtr image{}; VkShaderStageFlagBits shaderStage{}; UniformBufferBaseUPtr uniformBuffer{}; - OverlayRPtr overlay{}; - OverlayUPtr ownOverlay{}; - std::vector< OverlayResPtr > parentOverlays{}; + struct OverlayPtr + { + OverlayUPtr uptr{}; + OverlayRPtr rptr{}; + }; + OverlayPtr overlay; + std::vector< OverlayPtr > parentOverlays{}; BillboardListUPtr ownBillboards{}; BillboardListRPtr billboards{}; int face1{ -1 }; int face2{ -1 }; LightType lightType{ LightType::eCount }; VkPrimitiveTopology primitiveType{ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST }; - ViewportSPtr viewport{}; + ViewportUPtr viewport{}; castor::String strName{}; castor::String strName2{}; castor::Path path{}; @@ -225,12 +229,12 @@ namespace castor3d AnimatedObjectRPtr animTexture{}; TextureAnimationUPtr textureAnimation{}; MeshAnimationUPtr morphAnimation{}; - SceneBackgroundSPtr background{}; + SceneBackgroundUPtr background{}; ParticleSystemUPtr ownParticleSystem{}; ParticleSystemRPtr particleSystem{}; SsaoConfig ssaoConfig{}; SubsurfaceScatteringUPtr subsurfaceScattering{}; - std::shared_ptr< SkyboxBackground > skybox{}; + SkyboxBackgroundUPtr skybox{}; TextureConfiguration textureConfiguration{}; TextureTransform textureTransform{}; uint32_t texcoordSet{}; diff --git a/include/Core/Castor3D/Scene/SceneModule.hpp b/include/Core/Castor3D/Scene/SceneModule.hpp index efc7aa77dc..343318c426 100644 --- a/include/Core/Castor3D/Scene/SceneModule.hpp +++ b/include/Core/Castor3D/Scene/SceneModule.hpp @@ -350,17 +350,17 @@ namespace castor3d */ struct ShadowConfig; - CU_DeclareCUSmartPtr( castor3d, BillboardBase, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, BillboardList, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Camera, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Geometry, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MovableObject, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneFileContext, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneFileParser, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneNode, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, Scene, C3D_API ); - CU_DeclareSmartPtr( SceneImporter ); - CU_DeclareSmartPtr( SceneNodeImporter ); + CU_DeclareSmartPtr( castor3d, BillboardBase, C3D_API ); + CU_DeclareSmartPtr( castor3d, BillboardList, C3D_API ); + CU_DeclareSmartPtr( castor3d, Camera, C3D_API ); + CU_DeclareSmartPtr( castor3d, Geometry, C3D_API ); + CU_DeclareSmartPtr( castor3d, MovableObject, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneFileContext, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneFileParser, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneNode, C3D_API ); + CU_DeclareSmartPtr( castor3d, Scene, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneImporter, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneNodeImporter, C3D_API ); //! SceneNode pointer array. CU_DeclareVector( SceneNodeRPtr, SceneNodePtr ); @@ -650,14 +650,14 @@ namespace castor3d using SamplerCacheView = CacheViewT< SamplerCache, EventType::ePreRender >; using FontCacheView = CacheViewT< castor::FontCache, EventType::ePreRender >; - CU_DeclareCUSmartPtr( castor3d, SceneCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, BillboardListCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, CameraCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, GeometryCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneNodeCache, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, MaterialCacheView, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SamplerCacheView, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, FontCacheView, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, BillboardListCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, CameraCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, GeometryCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneNodeCache, C3D_API ); + CU_DeclareSmartPtr( castor3d, MaterialCacheView, C3D_API ); + CU_DeclareSmartPtr( castor3d, SamplerCacheView, C3D_API ); + CU_DeclareSmartPtr( castor3d, FontCacheView, C3D_API ); //@} } diff --git a/include/Core/Castor3D/Shader/ShaderBuffers/ShaderBuffersModule.hpp b/include/Core/Castor3D/Shader/ShaderBuffers/ShaderBuffersModule.hpp index 651d1fe845..a7b2493d00 100644 --- a/include/Core/Castor3D/Shader/ShaderBuffers/ShaderBuffersModule.hpp +++ b/include/Core/Castor3D/Shader/ShaderBuffers/ShaderBuffersModule.hpp @@ -78,12 +78,12 @@ namespace castor3d using GpuDataBufferOffsetModifySignal = castor::SignalT< GpuDataBufferOffsetModifyFunc >; using GpuDataBufferOffsetModifyConnection = castor::ConnectionT< GpuDataBufferOffsetModifySignal >; - CU_DeclareCUSmartPtr( castor3d, FontGlyphBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, PassBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SssProfileBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureConfigurationBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, TextureAnimationBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, FontGlyphBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, PassBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, SssProfileBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureConfigurationBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, TextureAnimationBuffer, C3D_API ); struct ShaderBufferTypes { diff --git a/include/Core/Castor3D/Shader/ShaderModule.hpp b/include/Core/Castor3D/Shader/ShaderModule.hpp index efebc0d836..acefe561bd 100644 --- a/include/Core/Castor3D/Shader/ShaderModule.hpp +++ b/include/Core/Castor3D/Shader/ShaderModule.hpp @@ -148,9 +148,9 @@ namespace castor3d template< typename ElementTypeTraits > class StructuredShaderBuffer; - CU_DeclareCUSmartPtr( castor3d, ShaderBuffer, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, ShaderProgram, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LightingModelFactory, C3D_API ); + CU_DeclareSmartPtr( castor3d, ShaderBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d, ShaderProgram, C3D_API ); + CU_DeclareSmartPtr( castor3d, LightingModelFactory, C3D_API ); //@} } diff --git a/include/Core/Castor3D/Shader/Shaders/GlslLight.hpp b/include/Core/Castor3D/Shader/Shaders/GlslLight.hpp index 50ca1e014b..11ec36b3ae 100644 --- a/include/Core/Castor3D/Shader/Shaders/GlslLight.hpp +++ b/include/Core/Castor3D/Shader/Shaders/GlslLight.hpp @@ -580,9 +580,9 @@ namespace castor3d::shader Utils & m_utils; bool m_enableVolumetric; LightingModelUPtr m_lightingModel; - std::shared_ptr< Shadow > m_shadowModel; - std::shared_ptr< SssTransmittance > m_sssTransmittance; - std::unique_ptr< LightsBuffer > m_lightsBuffer; + ShadowUPtr m_shadowModel; + SssTransmittanceUPtr m_sssTransmittance; + LightsBufferUPtr m_lightsBuffer; sdw::Function< sdw::Float , InBlendComponents , sdw::InVec3 > m_getFinalTransmission; diff --git a/include/Core/Castor3D/Shader/Shaders/SdwModule.hpp b/include/Core/Castor3D/Shader/Shaders/SdwModule.hpp index 80a9730051..bef777551d 100644 --- a/include/Core/Castor3D/Shader/Shaders/SdwModule.hpp +++ b/include/Core/Castor3D/Shader/Shaders/SdwModule.hpp @@ -131,6 +131,7 @@ namespace castor3d::shader class BRDFHelpers; class Fog; class Lights; + class LightsBuffer; class LightingModel; class Materials; class PassShaders; @@ -151,7 +152,10 @@ namespace castor3d::shader template< typename DataT > class BufferT; - CU_DeclareCUSmartPtr( castor3d::shader, LightingModel, C3D_API ); + CU_DeclareSmartPtr( castor3d::shader, LightsBuffer, C3D_API ); + CU_DeclareSmartPtr( castor3d::shader, LightingModel, C3D_API ); + CU_DeclareSmartPtr( castor3d::shader, Shadow, C3D_API ); + CU_DeclareSmartPtr( castor3d::shader, SssTransmittance, C3D_API ); using ReflectionModelPtr = std::unique_ptr< ReflectionModel >; using LightingModelCreator = std::function< LightingModelUPtr( LightingModelID lightingModelId @@ -247,7 +251,7 @@ namespace castor3d::shader Writer_Parameter( DerivTex ); - CU_DeclareSmartPtr( Material ); + CU_DeclareSmartPtr( castor3d::shader, Material, C3D_API ); //@} //@} diff --git a/include/Core/Castor3D/Shader/Ubos/UbosModule.hpp b/include/Core/Castor3D/Shader/Ubos/UbosModule.hpp index da33207ad3..0a7fc448c3 100644 --- a/include/Core/Castor3D/Shader/Ubos/UbosModule.hpp +++ b/include/Core/Castor3D/Shader/Ubos/UbosModule.hpp @@ -459,10 +459,10 @@ namespace castor3d */ struct VoxelizerUboConfiguration; - CU_DeclareCUSmartPtr( castor3d, LpvGridConfigUbo, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LpvLightConfigUbo, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, LayeredLpvGridConfigUbo, C3D_API ); - CU_DeclareCUSmartPtr( castor3d, SceneUbo, C3D_API ); + CU_DeclareSmartPtr( castor3d, LpvGridConfigUbo, C3D_API ); + CU_DeclareSmartPtr( castor3d, LpvLightConfigUbo, C3D_API ); + CU_DeclareSmartPtr( castor3d, LayeredLpvGridConfigUbo, C3D_API ); + CU_DeclareSmartPtr( castor3d, SceneUbo, C3D_API ); CU_DeclareVector( LpvLightConfigUbo, LpvLightConfigUbo ); CU_DeclareVector( LpvGridConfigUbo, LpvGridConfigUbo ); diff --git a/include/Core/CastorUtils/Config/ConfigModule.hpp b/include/Core/CastorUtils/Config/ConfigModule.hpp index e280c0451b..f5891beafd 100644 --- a/include/Core/CastorUtils/Config/ConfigModule.hpp +++ b/include/Core/CastorUtils/Config/ConfigModule.hpp @@ -10,7 +10,6 @@ See LICENSE file in root folder #include "CastorUtils/Config/Macros.hpp" #include "CastorUtils/Config/MultiThreadConfig.hpp" #include "CastorUtils/Config/PlatformConfig.hpp" -#include "CastorUtils/Config/SmartPtr.hpp" #include #include diff --git a/include/Core/CastorUtils/Config/Macros.hpp b/include/Core/CastorUtils/Config/Macros.hpp index a0e5133ce0..1c62a915aa 100644 --- a/include/Core/CastorUtils/Config/Macros.hpp +++ b/include/Core/CastorUtils/Config/Macros.hpp @@ -1,13 +1,14 @@ /* See LICENSE file in root folder */ -#ifndef ___Castor_Macros___ -#define ___Castor_Macros___ +#ifndef ___CU_Macros_HPP___ +#define ___CU_Macros_HPP___ #include "CastorUtils/Config/BeginExternHeaderGuard.hpp" #include "CastorUtils/config.hpp" #include "CastorUtils/Config/PlatformConfig.hpp" #include "CastorUtils/Config/CompilerConfig.hpp" +#include "CastorUtils/Config/SmartPtr.hpp" #include "CastorUtils/Config/EndExternHeaderGuard.hpp" #if !defined( __FUNCTION__ ) @@ -50,22 +51,6 @@ See LICENSE file in root folder # endif #endif -#include "CastorUtils/Config/BeginExternHeaderGuard.hpp" -#include -#include "CastorUtils/Config/EndExternHeaderGuard.hpp" - -#define CU_DeclareSmartPtr( class_name )\ - using class_name##SPtr = std::shared_ptr< class_name >;\ - using class_name##WPtr = std::weak_ptr< class_name >;\ - using class_name##UPtr = std::unique_ptr< class_name >;\ - using class_name##RPtr = class_name * - -#define CU_DeclareTemplateSmartPtr( class_name )\ - template< typename T > using class_name##SPtrT = std::shared_ptr< class_name##T< T > >;\ - template< typename T > using class_name##WPtrT = std::weak_ptr< class_name##T< T > >;\ - template< typename T > using class_name##UPtrT = std::unique_ptr< class_name##T< T > >;\ - template< typename T > using class_name##RPtrT = class_name##T< T > * - #include #define CU_DeclareMap( key, value, name )\ @@ -163,38 +148,28 @@ See LICENSE file in root folder using name##ListConstIt = typename name##List::const_iterator;\ using name##ListConstRIt = typename name##List::const_reverse_iterator -#define CU_DeclareCollection( elem, key, name )\ - using name##Collection = castor::Collection< elem, key >;\ - using name##CollectionIt = name##Collection::TObjPtrMapIt;\ - using name##CollectionConstIt = name##Collection::TObjPtrMapConstIt - #define CU_DeclarePoint( type, count, name )\ using Point##count##name = Point< type, count >;\ - CU_DeclareSmartPtr( Point##count##name );\ CU_DeclareVector( Point##count##name, Point##count##name );\ CU_DeclareList( Point##count##name, Point##count##name ) #define CU_DeclareCoord( type, count, name )\ using Coords##count##name = Coords< type, count >;\ - CU_DeclareSmartPtr( Coords##count##name );\ CU_DeclareVector( Coords##count##name, Coords##count##name );\ CU_DeclareList( Coords##count##name, Coords##count##name ) #define CU_DeclareConstCoord( type, count, name )\ using ConstCoords##count##name = Coords< type const, count >;\ - CU_DeclareSmartPtr( ConstCoords##count##name );\ CU_DeclareVector( ConstCoords##count##name, ConstCoords##count##name );\ CU_DeclareList( ConstCoords##count##name, ConstCoords##count##name ) #define CU_DeclareMtx( type, rows, cols, name )\ using Matrix##rows##x##cols##name = Matrix< type, rows, cols >;\ - CU_DeclareSmartPtr( Matrix##rows##x##cols##name );\ CU_DeclareVector( Matrix##rows##x##cols##name, Matrix##rows##x##cols##name );\ CU_DeclareList( Matrix##rows##x##cols##name, Matrix##rows##x##cols##name ) #define CU_DeclareSqMtx( type, count, name )\ using Matrix##count##x##count##name = SquareMatrix< type, count >;\ - CU_DeclareSmartPtr( Matrix##count##x##count##name );\ CU_DeclareVector( Matrix##count##x##count##name, Matrix##count##x##count##name );\ CU_DeclareList( Matrix##count##x##count##name, Matrix##count##x##count##name ) diff --git a/include/Core/CastorUtils/Config/SmartPtr.hpp b/include/Core/CastorUtils/Config/SmartPtr.hpp index bb555ec2d4..2778a411bf 100644 --- a/include/Core/CastorUtils/Config/SmartPtr.hpp +++ b/include/Core/CastorUtils/Config/SmartPtr.hpp @@ -1,38 +1,17 @@ /* See LICENSE file in root folder */ -#ifndef ___Castor_shared_ptr___ -#define ___Castor_shared_ptr___ - -#include "CastorUtils/Config/Macros.hpp" +#ifndef ___CU_SmartPtr_HPP___ +#define ___CU_SmartPtr_HPP___ #include "CastorUtils/Config/BeginExternHeaderGuard.hpp" +#include "CastorUtils/Config/PlatformConfig.hpp" + #include #include "CastorUtils/Config/EndExternHeaderGuard.hpp" namespace castor { - /** - \author Sylvain DOREMUS - \version 0.6.1.0 - \date 08/12/2011 - \~english - \brief Dummy destructor - \remark Used as a parameter to shared_ptr, to make deallocation dummy (only sets pointer to nullptr) - \~french - \brief Destructeur zombie - \remark Utilisé en tant que paramètre à shared_ptr, afin d'avoir une désallocation zombie (ne fait que mettre le pointeur à nullptr, sans le désallouer) - */ - struct DummyDtor - { - template< typename T > - inline void operator()( T *& pointer )noexcept - { - pointer = nullptr; - } - }; - CU_API extern DummyDtor g_dummyDtor; - template< typename TypeT > struct Deleter { @@ -67,7 +46,7 @@ namespace castor } } -#define CU_DeclareCUSmartPtr( nmspc, class_name, expdecl )\ +#define CU_DeclareSmartPtr( nmspc, class_name, expdecl )\ }\ namespace castor\ {\ @@ -79,12 +58,10 @@ namespace castor\ }\ namespace nmspc\ {\ - using class_name##SPtr = std::shared_ptr< class_name >;\ - using class_name##WPtr = std::weak_ptr< class_name >;\ using class_name##UPtr = castor::UniquePtr< class_name >;\ using class_name##RPtr = class_name * -#define CU_ImplementCUSmartPtr( nmspc, class_name )\ +#define CU_ImplementSmartPtr( nmspc, class_name )\ namespace castor\ {\ void Deleter< nmspc::class_name >::operator()( nmspc::class_name * pointer )noexcept\ @@ -93,14 +70,14 @@ namespace castor\ }\ } -#define CU_DeclareCUTemplateSmartPtr( nmspc, class_name_t )\ +#define CU_DeclareTemplateSmartPtr( nmspc, class_name )\ }\ namespace castor\ {\ template< typename InstT >\ - struct Deleter< nmspc::class_name_t< InstT > >\ + struct Deleter< nmspc::class_name##T< InstT > >\ {\ - void operator()( nmspc::class_name_t< InstT > * pointer )noexcept\ + void operator()( nmspc::class_name##T< InstT > * pointer )noexcept\ {\ delete pointer;\ }\ @@ -109,22 +86,18 @@ namespace castor\ namespace nmspc\ {\ template< typename InstT >\ - using class_name_t##SPtrT = std::shared_ptr< class_name_t< InstT > >;\ - template< typename InstT >\ - using class_name_t##WPtrT = std::weak_ptr< class_name_t< InstT > >;\ - template< typename InstT >\ - using class_name_t##UPtrT = castor::UniquePtr< class_name_t< InstT > >;\ + using class_name##UPtrT = castor::UniquePtr< class_name##T< InstT > >;\ template< typename InstT >\ - using class_name_t##RPtrT = class_name_t< InstT > * + using class_name##RPtrT = class_name##T< InstT > * -#define CU_DeclareCUEnumTemplateSmartPtr( nmspc, class_name_t, enum_name_t )\ +#define CU_DeclareEnumTemplateSmartPtr( nmspc, class_name, enum_name )\ }\ namespace castor\ {\ - template< enum_name_t EnumT >\ - struct Deleter< nmspc::class_name_t< EnumT > >\ + template< enum_name EnumT >\ + struct Deleter< nmspc::class_name##T< EnumT > >\ {\ - void operator()( nmspc::class_name_t< EnumT > * pointer )noexcept\ + void operator()( nmspc::class_name##T< EnumT > * pointer )noexcept\ {\ delete pointer;\ }\ @@ -132,13 +105,9 @@ namespace castor\ }\ namespace nmspc\ {\ - template< enum_name_t EnumT >\ - using class_name_t##SPtrT = std::shared_ptr< class_name_t< EnumT > >;\ - template< enum_name_t EnumT >\ - using class_name_t##WPtrT = std::weak_ptr< class_name_t< EnumT > >;\ - template< enum_name_t EnumT >\ - using class_name_t##UPtrT = castor::UniquePtr< class_name_t< EnumT > >;\ - template< enum_name_t EnumT >\ - using class_name_t##RPtrT = class_name_t< EnumT > * + template< enum_name EnumT >\ + using class_name##UPtrT = castor::UniquePtr< class_name##T< EnumT > >;\ + template< enum_name EnumT >\ + using class_name##RPtrT = class_name##T< EnumT > * #endif diff --git a/include/Core/CastorUtils/Design/Collection.hpp b/include/Core/CastorUtils/Design/Collection.hpp deleted file mode 100644 index 2955eae5c2..0000000000 --- a/include/Core/CastorUtils/Design/Collection.hpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -See LICENSE file in root folder -*/ -#ifndef ___CASTOR_COLLECTION_H___ -#define ___CASTOR_COLLECTION_H___ - -#include "CastorUtils/Design/DesignModule.hpp" - -#include "CastorUtils/Design/Templates.hpp" -#include "CastorUtils/Design/NonCopyable.hpp" -#include "CastorUtils/Exception/Assertion.hpp" -#include "CastorUtils/Log/LoggerInstance.hpp" - -namespace castor -{ - template< typename ObjectT, typename KeyT > - class Collection - : public castor::NonCopyable - { - public: - using ObjectPtr = std::shared_ptr< ObjectT >; - using ObjectPtrMap = std::map< KeyT, ObjectPtr >; - using ObjectPtrMapIt = typename ObjectPtrMap::iterator; - using ObjectPtrMapConstIt = typename ObjectPtrMap::const_iterator; - using ValueType = typename ObjectPtrMap::value_type; - using KeyParamType= typename CallTraits< KeyT >::ConstParamType; - - private: - struct Search - { - KeyT key; - ObjectPtrMapConstIt result; - }; - - public: - /** - *\~english - *\brief Constructor - *\~french - *\brief Constructeur - */ - explicit Collection( LoggerInstance & logger ); - /** - *\~english - *\brief Destructor - *\~french - *\brief Destructeur - */ - ~Collection(); - /** - *\~english - *\return The logger instance. - *\~french - *\return L'instance de logger. - */ - inline LoggerInstance & getLogger()const; - /** - *\~english - *\brief Locks the collection mutex - *\~french - *\brief Locke le mutex de la collection - */ - inline void lock()const; - /** - *\~english - *\brief Unlocks the collection mutex - *\~french - *\brief Délocke le mutex de la collection - */ - inline void unlock()const; - /** - *\~english - *\brief Returns an iterator to the first element of the collection - *\return The iterator - *\~french - *\brief Renvoie un itérateur sur le premier élément de la collection - *\return L'itérateur - */ - inline ObjectPtrMapIt begin(); - /** - *\~english - *\brief Returns an constant iterator to the first element of the collection - *\return The iterator - *\~french - *\brief Renvoie un itérateur constant sur le premier élément de la collection - *\return L'itérateur - */ - inline ObjectPtrMapConstIt begin()const; - /** - *\~english - *\brief Returns an iterator to the after last element of the collection - *\return The iterator - *\~french - *\brief Renvoie un itérateur sur l'après dernier élément de la collection - *\return L'itérateur - */ - inline ObjectPtrMapIt end(); - /** - *\~english - *\brief Returns an constant iterator to the after last element of the collection - *\return The iterator - *\~french - *\brief Renvoie un itérateur constant sur l'après dernier élément de la collection - *\return L'itérateur - */ - inline ObjectPtrMapConstIt end()const; - /** - *\~english - *\return \p true if the collection is empty. - *\~french - *\return \p true si la collection est vide. - */ - inline bool empty()const; - /** - *\~english - *\brief Clears the collection - *\~french - *\brief Vide la collection - */ - inline void clear()noexcept; - /** - *\~english - *\brief Looks for a collected object at the given key - *\param[in] key The key - *\return The found object if any, \p null_ptr if none - *\~french - *\brief Recherche dans la collection un objet situé à la clef donnée - *\param[in] key La clef - *\return L'objet trouvé s'il existe, \p null_ptr sinon - */ - inline ObjectPtr tryFind( KeyParamType key )const; - /** - *\~english - *\brief Looks for a collected object at the given key - *\param[in] key The key - *\return The found object if any, \p null_ptr if none - *\~french - *\brief Recherche dans la collection un objet situé à la clef donnée - *\param[in] key La clef - *\return L'objet trouvé s'il existe, \p null_ptr sinon - */ - inline ObjectPtr find( KeyParamType key )const; - /** - *\~english - *\brief Gives the collected objects count - *\return The count - *\~french - *\brief donne le nombre d'objets de la collection - *\return Le compte - */ - inline std::size_t size()const; - /** - *\~english - *\brief Inserts an element at the given key into the collection - *\param[in] key The key at which element is inserted - *\param[in] element The element to insert - *\return The element at the given key. - *\~french - *\brief Insère un élément à la clef donnée - *\param[in] key La clef à laquelle l'élément sera associé - *\param[in] element L'élément à insérer - *\return L'élément associé à la clef. - */ - inline ObjectPtr tryInsert( KeyParamType key, ObjectPtr element ); - /** - *\~english - *\brief Inserts an element at the given key into the collection - *\param[in] key The key at which element is inserted - *\param[in] element The element to insert - *\return \p false if there is already one object at the given key - *\~french - *\brief Insère un élément à la clef donnée - *\param[in] key La clef à laquelle l'élément sera associé - *\param[in] element L'élément à insérer - *\return \p false si un élément est déjà associé à la clef - */ - inline bool insert( KeyParamType key, ObjectPtr element ); - /** - *\~english - *\brief Tests if there is an element associated to the key - *\param[in] key The key to test - *\return The test result - *\~french - *\brief Teste si un élément est associé à la clef donnée - *\param[in] key La clef à tester - *\return Le résultat du test - */ - inline bool has( KeyParamType key )const; - /** - *\~english - *\brief Removes the element associated to the given key from the collection - *\param[in] key The key - *\return The associated element, nullptr if none - *\~french - *\brief Enlève de la collection l'élément associé à la clef donnée - *\param[in] key La clef - *\return L'élément associé, null_ptr sinon - */ - inline ObjectPtr erase( KeyParamType key ); - /** - *\~english - *\brief Removes the element at given iterator. - *\param[in] it The iterator - *\return The iterator after erased element. - *\~french - *\brief Enlève de la collection l'élément à l'itérateur donné. - *\param[in] it L'itérateur - *\return L'itérateur après l'élément enlevé. - */ - inline ObjectPtrMapIt erase( ObjectPtrMapIt it ); - - protected: - /** - *\~english - *\brief Initialises last search (empty key, invalid result). - *\~french - *\brief Initialise la dernière rechercher (clef vide, résultat invalide). - */ - void doInitLast()const; - /** - *\~english - *\brief Updates the last search, performing the lookup in the map. - *\param[in] key The key to test. - *\~french - *\brief Met à jour la dernière recherche, en effectuant la recherche dans la map. - *\param[in] key La clef à tester. - */ - inline void doUpdateLast( KeyParamType key )const; - - private: - LoggerInstance & m_logger; - ObjectPtrMap m_objects; - mutable std::recursive_mutex m_mutex; - mutable bool m_locked; - mutable Search m_last; - }; -} - -#include "Collection.inl" - -#endif diff --git a/include/Core/CastorUtils/Design/Collection.inl b/include/Core/CastorUtils/Design/Collection.inl deleted file mode 100644 index fd0055b600..0000000000 --- a/include/Core/CastorUtils/Design/Collection.inl +++ /dev/null @@ -1,184 +0,0 @@ -#include "CastorUtils/Log/Logger.hpp" - -namespace castor -{ - namespace details - { - static const xchar * WARNING_COLLECTION_UNKNOWN_OBJECT = cuT( "Collection::find - Object not found: " ); - static const xchar * WARNING_COLLECTION_DUPLICATE_OBJECT = cuT( "Collection::create - Duplicate object: " ); - } - - template< typename ObjectT, typename KeyT > - Collection< ObjectT, KeyT >::Collection( LoggerInstance & logger ) - : m_logger( logger ) - , m_locked( false ) - { - } - - template< typename ObjectT, typename KeyT > - Collection< ObjectT, KeyT >::~Collection() - { - } - - template< typename ObjectT, typename KeyT > - inline LoggerInstance & Collection< ObjectT, KeyT >::getLogger()const - { - return m_logger; - } - - template< typename ObjectT, typename KeyT > - inline void Collection< ObjectT, KeyT >::lock()const - { - m_mutex.lock(); - m_locked = true; - } - - template< typename ObjectT, typename KeyT > - inline void Collection< ObjectT, KeyT >::unlock()const - { - m_locked = false; - m_mutex.unlock(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtrMapIt Collection< ObjectT, KeyT >::begin() - { - CU_Require( m_locked ); - return m_objects.begin(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtrMapConstIt Collection< ObjectT, KeyT >::begin()const - { - CU_Require( m_locked ); - return m_objects.begin(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtrMapIt Collection< ObjectT, KeyT >::end() - { - return m_objects.end(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtrMapConstIt Collection< ObjectT, KeyT >::end()const - { - return m_objects.end(); - } - - template< typename ObjectT, typename KeyT > - inline bool Collection< ObjectT, KeyT >::empty()const - { - return m_objects.empty(); - } - - template< typename ObjectT, typename KeyT > - inline void Collection< ObjectT, KeyT >::clear()noexcept - { - auto lock( makeUniqueLock( m_mutex ) ); - m_objects.clear(); - doInitLast(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtr Collection< ObjectT, KeyT >::tryFind( KeyParamType key )const - { - auto lock( makeUniqueLock( m_mutex ) ); - doUpdateLast( key ); - return m_last.result != m_objects.end() - ? m_last.result->second - : nullptr; - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtr Collection< ObjectT, KeyT >::find( KeyParamType key )const - { - auto result = tryFind( key ); - - if ( !result ) - { - m_logger.logWarning( details::WARNING_COLLECTION_UNKNOWN_OBJECT + string::toString( key ) ); - } - - return result; - } - - template< typename ObjectT, typename KeyT > - inline std::size_t Collection< ObjectT, KeyT >::size()const - { - auto lock( makeUniqueLock( m_mutex ) ); - return m_objects.size(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtr Collection< ObjectT, KeyT >::tryInsert( KeyParamType key, ObjectPtr element ) - { - auto lock( makeUniqueLock( m_mutex ) ); - doUpdateLast( key ); - auto ires = m_objects.emplace( key, element ); - m_last.result = ires.first; - return m_last.result->second; - } - - template< typename ObjectT, typename KeyT > - inline bool Collection< ObjectT, KeyT >::insert( KeyParamType key, ObjectPtr element ) - { - auto result = ( element == tryInsert( key, element ) ); - - if ( !result ) - { - m_logger.logWarning( details::WARNING_COLLECTION_DUPLICATE_OBJECT + string::toString( key ) ); - } - - return result; - } - - template< typename ObjectT, typename KeyT > - inline bool Collection< ObjectT, KeyT >::has( KeyParamType key )const - { - auto lock( makeUniqueLock( m_mutex ) ); - doUpdateLast( key ); - return m_last.result != m_objects.end(); - } - - template< typename ObjectT, typename KeyT > - inline typename Collection< ObjectT, KeyT >::ObjectPtr Collection< ObjectT, KeyT >::erase( KeyParamType key ) - { - auto lock( makeUniqueLock( m_mutex ) ); - doUpdateLast( key ); - ObjectPtr ret; - - if ( m_last.result != m_objects.end() ) - { - ret = m_last.result->second; - m_objects.erase( m_last.result ); - doInitLast(); - } - - return ret; - } - - template< typename ObjectT, typename KeyT > - typename Collection< ObjectT, KeyT >::ObjectPtrMapIt Collection< ObjectT, KeyT >::erase( typename Collection< ObjectT, KeyT >::ObjectPtrMapIt it ) - { - CU_Require( m_locked ); - return m_objects.erase( it ); - } - - template< typename ObjectT, typename KeyT > - void Collection< ObjectT, KeyT >::doInitLast()const - { - m_last.key = std::move( KeyT() ); - m_last.result = m_objects.end(); - } - - template< typename ObjectT, typename KeyT > - void Collection< ObjectT, KeyT >::doUpdateLast( KeyParamType key )const - { - if ( m_last.key != key ) - { - m_last.key = key; - m_last.result = m_objects.find( key ); - } - } -} diff --git a/include/Core/CastorUtils/Design/DesignModule.hpp b/include/Core/CastorUtils/Design/DesignModule.hpp index 8e500cda3b..eb969e5de3 100644 --- a/include/Core/CastorUtils/Design/DesignModule.hpp +++ b/include/Core/CastorUtils/Design/DesignModule.hpp @@ -104,16 +104,6 @@ namespace castor class ChangeTrackedT; /** \~english - \brief Element collection class - \remark A collection class, allowing you to store named objects, removing, finding or adding them as you wish. - \~french - \brief Classe de collection d'éléments - \remark Une classe de collection, permettant de stocker des éléments nommés, les enlever, les rechercher. - */ - template< typename TObj, typename TKey > - class Collection; - /** - \~english *\brief Connection to a signal. \~french *\brief Représente une connexion à un signal. @@ -155,16 +145,12 @@ namespace castor /** \~english \brief Factory concept implementation - \remark The classes that can be registered must implement a function of the following form : -
static std::shared_ptr< Obj > create(); \~french \brief Implémentation du concept de fabrique - \remark Les classes pouvant être enregistrées doivent implémenter une fonction de la forme suivante : -
static std::shared_ptr< Obj > create(); */ template< class ObjT , class KeyT - , class PtrTypeT = std::shared_ptr< ObjT > + , class PtrTypeT = std::unique_ptr< ObjT > , typename CreatorT = std::function< PtrTypeT() > , class IdT = size_t , class EntryT = FactoryEntryT< KeyT, CreatorT, IdT > > diff --git a/include/Core/CastorUtils/Exception/Exception.hpp b/include/Core/CastorUtils/Exception/Exception.hpp index e39ad34061..fa48c021eb 100644 --- a/include/Core/CastorUtils/Exception/Exception.hpp +++ b/include/Core/CastorUtils/Exception/Exception.hpp @@ -192,7 +192,6 @@ namespace castor *\brief Macro définie pour faciliter l'utilisation de castor::Exception */ #define CU_Exception( text )\ - CU_Failure( text );\ throw castor::Exception{ text, __FILE__, __FUNCTION__, uint32_t( __LINE__ ) } /** *\~english @@ -201,7 +200,6 @@ namespace castor *\brief Macro définie pour faciliter l'utilisation de castor::Exception */ #define CU_SrcException( source, text )\ - CU_Failure( text );\ throw castor::Exception{ source ": " text, __FILE__, __FUNCTION__, uint32_t( __LINE__ ) } #endif diff --git a/include/Core/CastorUtils/FileParser/FileParserModule.hpp b/include/Core/CastorUtils/FileParser/FileParserModule.hpp index 2f187644a3..02c80701bd 100644 --- a/include/Core/CastorUtils/FileParser/FileParserModule.hpp +++ b/include/Core/CastorUtils/FileParser/FileParserModule.hpp @@ -171,8 +171,10 @@ namespace castor */ class PreprocessedFile; - CU_DeclareCUSmartPtr( castor, FileParserContext, CU_API ); - CU_DeclareCUSmartPtr( castor, ParserParameterBase, CU_API ); + CU_DeclareSmartPtr( castor, FileParserContext, CU_API ); + + using ParserParameterBaseSPtr = std::shared_ptr< ParserParameterBase >; + CU_DeclareVector( ParserParameterBaseSPtr, ParserParameter ); /** *\~english diff --git a/include/Core/CastorUtils/Graphics/Font.hpp b/include/Core/CastorUtils/Graphics/Font.hpp index 0a78c67b73..39777df0b6 100644 --- a/include/Core/CastorUtils/Graphics/Font.hpp +++ b/include/Core/CastorUtils/Graphics/Font.hpp @@ -6,7 +6,6 @@ See LICENSE file in root folder #include "CastorUtils/Data/BinaryLoader.hpp" #include "CastorUtils/Data/TextWriter.hpp" -#include "CastorUtils/Design/Collection.hpp" #include "CastorUtils/Design/Named.hpp" #include "CastorUtils/Graphics/Glyph.hpp" #include "CastorUtils/Math/Point.hpp" diff --git a/include/Core/CastorUtils/Graphics/GraphicsModule.hpp b/include/Core/CastorUtils/Graphics/GraphicsModule.hpp index 25be201dba..cb5c00362c 100644 --- a/include/Core/CastorUtils/Graphics/GraphicsModule.hpp +++ b/include/Core/CastorUtils/Graphics/GraphicsModule.hpp @@ -848,12 +848,12 @@ namespace castor using PixelBuffer = PxBuffer< PixelFormat::eR8G8B8A8_UNORM >; using FontCache = ResourceCacheT< Font, String, FontCacheTraits >; - CU_DeclareCUSmartPtr( castor, BoundingBox, CU_API ); - CU_DeclareCUSmartPtr( castor, BoundingSphere, CU_API ); - CU_DeclareCUSmartPtr( castor, Image, CU_API ); - CU_DeclareCUSmartPtr( castor, Font, CU_API ); - CU_DeclareCUSmartPtr( castor, PxBufferBase, CU_API ); - CU_DeclareCUSmartPtr( castor, FontCache, CU_API ); + CU_DeclareSmartPtr( castor, BoundingBox, CU_API ); + CU_DeclareSmartPtr( castor, BoundingSphere, CU_API ); + CU_DeclareSmartPtr( castor, Image, CU_API ); + CU_DeclareSmartPtr( castor, Font, CU_API ); + CU_DeclareSmartPtr( castor, PxBufferBase, CU_API ); + CU_DeclareSmartPtr( castor, FontCache, CU_API ); using RgbColour = RgbColourT< ColourComponent >; using RgbaColour = RgbaColourT< ColourComponent >; diff --git a/include/Core/CastorUtils/Math/MathModule.hpp b/include/Core/CastorUtils/Math/MathModule.hpp index 0609e24dc1..f440bbf9ad 100644 --- a/include/Core/CastorUtils/Math/MathModule.hpp +++ b/include/Core/CastorUtils/Math/MathModule.hpp @@ -383,9 +383,6 @@ namespace castor CU_DeclareMtx( double, 4, 2, d ); CU_DeclareMtx( double, 4, 3, d ); - CU_DeclareSmartPtr( Quaternion ); - CU_DeclareSmartPtr( SphericalVertex ); - CU_API Point3f operator*( Matrix4x4f const & lhs, Point3f const & rhs ); CU_API Point3f operator*( Point3f const & lhs, Matrix4x4f const & rhs ); CU_API Point4f operator*( Matrix4x4f const & lhs, Point4f const & rhs ); diff --git a/include/Core/CastorUtils/Miscellaneous/MiscellaneousModule.hpp b/include/Core/CastorUtils/Miscellaneous/MiscellaneousModule.hpp index f1db621f6d..bc64566629 100644 --- a/include/Core/CastorUtils/Miscellaneous/MiscellaneousModule.hpp +++ b/include/Core/CastorUtils/Miscellaneous/MiscellaneousModule.hpp @@ -87,7 +87,7 @@ namespace castor static const String cuEmptyString; - CU_DeclareCUSmartPtr( castor, DynamicLibrary, CU_API ); + CU_DeclareSmartPtr( castor, DynamicLibrary, CU_API ); //@} } diff --git a/source/Core/Castor3D/Animation/AnimationImporter.cpp b/source/Core/Castor3D/Animation/AnimationImporter.cpp index 9bdd4bedf0..9f9e026f1e 100644 --- a/source/Core/Castor3D/Animation/AnimationImporter.cpp +++ b/source/Core/Castor3D/Animation/AnimationImporter.cpp @@ -15,7 +15,7 @@ #include "Castor3D/Scene/SceneImporter.hpp" #include "Castor3D/Scene/Animation/SceneNodeAnimation.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimationImporter ) +CU_ImplementSmartPtr( castor3d, AnimationImporter ) namespace castor3d { diff --git a/source/Core/Castor3D/Animation/AnimationModule.cpp b/source/Core/Castor3D/Animation/AnimationModule.cpp index f7838145b6..e54b804f39 100644 --- a/source/Core/Castor3D/Animation/AnimationModule.cpp +++ b/source/Core/Castor3D/Animation/AnimationModule.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Animation/AnimationKeyFrame.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimationKeyFrame ) +CU_ImplementSmartPtr( castor3d, AnimationKeyFrame ) namespace castor3d { diff --git a/source/Core/Castor3D/Binary/CmshImporter.cpp b/source/Core/Castor3D/Binary/CmshImporter.cpp index 1048680bf9..4f23c467d5 100644 --- a/source/Core/Castor3D/Binary/CmshImporter.cpp +++ b/source/Core/Castor3D/Binary/CmshImporter.cpp @@ -164,12 +164,12 @@ namespace castor3d SkeletonImporterUPtr CmshImporterFile::createSkeletonImporter() { - return std::make_unique< CmshSkeletonImporter >( *getOwner() ); + return castor::makeUniqueDerived< SkeletonImporter, CmshSkeletonImporter >( *getOwner() ); } MeshImporterUPtr CmshImporterFile::createMeshImporter() { - return std::make_unique< CmshMeshImporter >( *getOwner() ); + return castor::makeUniqueDerived< MeshImporter, CmshMeshImporter >( *getOwner() ); } SceneNodeImporterUPtr CmshImporterFile::createSceneNodeImporter() @@ -201,7 +201,7 @@ namespace castor3d MeshImporterUPtr CmshMeshImporter::create( Engine & engine ) { - return std::make_unique< CmshMeshImporter >( engine ); + return castor::makeUniqueDerived< MeshImporter, CmshMeshImporter >( engine ); } bool CmshMeshImporter::doImportMesh( Mesh & mesh ) @@ -221,7 +221,7 @@ namespace castor3d SkeletonImporterUPtr CmshSkeletonImporter::create( Engine & engine ) { - return std::make_unique< CmshSkeletonImporter >( engine ); + return castor::makeUniqueDerived< SkeletonImporter, CmshSkeletonImporter >( engine ); } bool CmshSkeletonImporter::doImportSkeleton( Skeleton & skeleton ) diff --git a/source/Core/Castor3D/Buffer/GpuBufferPool.cpp b/source/Core/Castor3D/Buffer/GpuBufferPool.cpp index 60a8eaaf71..750a29c26e 100644 --- a/source/Core/Castor3D/Buffer/GpuBufferPool.cpp +++ b/source/Core/Castor3D/Buffer/GpuBufferPool.cpp @@ -9,7 +9,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, GpuBufferPool ) +CU_ImplementSmartPtr( castor3d, GpuBufferPool ) namespace castor3d { diff --git a/source/Core/Castor3D/Buffer/ObjectBufferPool.cpp b/source/Core/Castor3D/Buffer/ObjectBufferPool.cpp index c6803ef921..b0d41bb80c 100644 --- a/source/Core/Castor3D/Buffer/ObjectBufferPool.cpp +++ b/source/Core/Castor3D/Buffer/ObjectBufferPool.cpp @@ -10,8 +10,8 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, VertexBufferPool ) -CU_ImplementCUSmartPtr( castor3d, ObjectBufferPool ) +CU_ImplementSmartPtr( castor3d, VertexBufferPool ) +CU_ImplementSmartPtr( castor3d, ObjectBufferPool ) namespace castor3d { diff --git a/source/Core/Castor3D/Buffer/PoolUniformBuffer.cpp b/source/Core/Castor3D/Buffer/PoolUniformBuffer.cpp index c28de6e204..a63146e819 100644 --- a/source/Core/Castor3D/Buffer/PoolUniformBuffer.cpp +++ b/source/Core/Castor3D/Buffer/PoolUniformBuffer.cpp @@ -6,7 +6,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PoolUniformBuffer ) +CU_ImplementSmartPtr( castor3d, PoolUniformBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Buffer/UniformBufferBase.cpp b/source/Core/Castor3D/Buffer/UniformBufferBase.cpp index b203324bc6..2043e4dadc 100644 --- a/source/Core/Castor3D/Buffer/UniformBufferBase.cpp +++ b/source/Core/Castor3D/Buffer/UniformBufferBase.cpp @@ -11,7 +11,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, UniformBufferBase ) +CU_ImplementSmartPtr( castor3d, UniformBufferBase ) namespace castor3d { diff --git a/source/Core/Castor3D/Buffer/UniformBufferPool.cpp b/source/Core/Castor3D/Buffer/UniformBufferPool.cpp index 79522e6e75..ca9ec75276 100644 --- a/source/Core/Castor3D/Buffer/UniformBufferPool.cpp +++ b/source/Core/Castor3D/Buffer/UniformBufferPool.cpp @@ -7,7 +7,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, UniformBufferPool ) +CU_ImplementSmartPtr( castor3d, UniformBufferPool ) namespace castor3d { diff --git a/source/Core/Castor3D/CMakeLists.txt b/source/Core/Castor3D/CMakeLists.txt index 77c5d77fcb..36a36cbf42 100644 --- a/source/Core/Castor3D/CMakeLists.txt +++ b/source/Core/Castor3D/CMakeLists.txt @@ -245,7 +245,6 @@ set( ${PROJECT_NAME}_FOLDER_HDR_FILES ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/CacheModule.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/CacheView.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/CacheView.inl - ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/ElementProducer.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/GeometryCache.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/LightCache.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Cache/MaterialCache.hpp diff --git a/source/Core/Castor3D/Cache/AnimatedObjectGroupCache.cpp b/source/Core/Castor3D/Cache/AnimatedObjectGroupCache.cpp index cd85c235f3..8f6d4f8748 100644 --- a/source/Core/Castor3D/Cache/AnimatedObjectGroupCache.cpp +++ b/source/Core/Castor3D/Cache/AnimatedObjectGroupCache.cpp @@ -18,7 +18,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, AnimatedObjectGroupCache ) +CU_ImplementSmartPtr( castor3d, AnimatedObjectGroupCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/BillboardCache.cpp b/source/Core/Castor3D/Cache/BillboardCache.cpp index 6a3195941f..a7aba3c944 100644 --- a/source/Core/Castor3D/Cache/BillboardCache.cpp +++ b/source/Core/Castor3D/Cache/BillboardCache.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, BillboardListCache ) +CU_ImplementSmartPtr( castor3d, BillboardListCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/CacheModule.cpp b/source/Core/Castor3D/Cache/CacheModule.cpp index 74416a13d4..0a9ebea675 100644 --- a/source/Core/Castor3D/Cache/CacheModule.cpp +++ b/source/Core/Castor3D/Cache/CacheModule.cpp @@ -3,5 +3,5 @@ #include "Castor3D/Cache/ShaderCache.hpp" #include "Castor3D/Cache/TargetCache.hpp" -CU_ImplementCUSmartPtr( castor3d, RenderTargetCache ) -CU_ImplementCUSmartPtr( castor3d, ShaderProgramCache ) +CU_ImplementSmartPtr( castor3d, RenderTargetCache ) +CU_ImplementSmartPtr( castor3d, ShaderProgramCache ) diff --git a/source/Core/Castor3D/Cache/GeometryCache.cpp b/source/Core/Castor3D/Cache/GeometryCache.cpp index 6dde8a8496..f028def69a 100644 --- a/source/Core/Castor3D/Cache/GeometryCache.cpp +++ b/source/Core/Castor3D/Cache/GeometryCache.cpp @@ -22,7 +22,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, GeometryCache ) +CU_ImplementSmartPtr( castor3d, GeometryCache ) namespace castor3d { @@ -70,7 +70,7 @@ namespace castor3d ? static_cast< AnimatedSkeleton * >( findAnimatedObject( scene, element.getName() + cuT( "_Skeleton" ) ) ) : nullptr; - if ( auto comp = submesh->getComponent< PassMasksComponent >() ) + if ( submesh->hasComponent( PassMasksComponent::Name ) ) { if ( auto pass = material->getPass( 0u ) ) { diff --git a/source/Core/Castor3D/Cache/LightCache.cpp b/source/Core/Castor3D/Cache/LightCache.cpp index 0bb6ac4ec3..1e1c7c0232 100644 --- a/source/Core/Castor3D/Cache/LightCache.cpp +++ b/source/Core/Castor3D/Cache/LightCache.cpp @@ -20,7 +20,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, LightCache ) +CU_ImplementSmartPtr( castor3d, LightCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/MaterialCache.cpp b/source/Core/Castor3D/Cache/MaterialCache.cpp index bf943a8e54..3d71c6f017 100644 --- a/source/Core/Castor3D/Cache/MaterialCache.cpp +++ b/source/Core/Castor3D/Cache/MaterialCache.cpp @@ -19,7 +19,7 @@ #include "Castor3D/Shader/Shaders/GlslMaterial.hpp" #include "Castor3D/Shader/Shaders/GlslTextureConfiguration.hpp" -CU_ImplementCUSmartPtr( castor3d, MaterialCache ) +CU_ImplementSmartPtr( castor3d, MaterialCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/OverlayCache.cpp b/source/Core/Castor3D/Cache/OverlayCache.cpp index d28fbd7dee..0d834d9dfe 100644 --- a/source/Core/Castor3D/Cache/OverlayCache.cpp +++ b/source/Core/Castor3D/Cache/OverlayCache.cpp @@ -9,7 +9,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, OverlayCache ) +CU_ImplementSmartPtr( castor3d, OverlayCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/PluginCache.cpp b/source/Core/Castor3D/Cache/PluginCache.cpp index 9713ba1433..6a72730737 100644 --- a/source/Core/Castor3D/Cache/PluginCache.cpp +++ b/source/Core/Castor3D/Cache/PluginCache.cpp @@ -14,7 +14,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PluginCache ) +CU_ImplementSmartPtr( castor3d, PluginCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/SceneNodeCache.cpp b/source/Core/Castor3D/Cache/SceneNodeCache.cpp index a54ab0706f..fe5c6e848a 100644 --- a/source/Core/Castor3D/Cache/SceneNodeCache.cpp +++ b/source/Core/Castor3D/Cache/SceneNodeCache.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Scene/SceneNode.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, SceneNodeCache ) +CU_ImplementSmartPtr( castor3d, SceneNodeCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Cache/ShaderCache.cpp b/source/Core/Castor3D/Cache/ShaderCache.cpp index 63794a71be..187c099d5f 100644 --- a/source/Core/Castor3D/Cache/ShaderCache.cpp +++ b/source/Core/Castor3D/Cache/ShaderCache.cpp @@ -131,7 +131,7 @@ namespace castor3d void ShaderProgramCache::doAddAutomaticProgram( ShaderProgramUPtr program , PipelineFlags const & flags ) { - m_autoGenerated.emplace_back( flags, program.get() ); + m_autoGenerated.push_back( { flags, program.get() } ); doAddProgram( std::move( program ) ); } diff --git a/source/Core/Castor3D/Cache/TextureCache.cpp b/source/Core/Castor3D/Cache/TextureCache.cpp index 8c9d42744b..87f0874f5f 100644 --- a/source/Core/Castor3D/Cache/TextureCache.cpp +++ b/source/Core/Castor3D/Cache/TextureCache.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, TextureUnitCache ) +CU_ImplementSmartPtr( castor3d, TextureUnitCache ) namespace castor3d { @@ -705,8 +705,7 @@ namespace castor3d if ( ires.second ) { it->second = castor::makeUnique< TextureUnitData >( resultSourceInfo - , resultPassConfig - , nullptr ); + , resultPassConfig ); auto result = it->second.get(); bool lhsAllowSRGB = checkFlag( lhsPassConfig.config.textureSpace, TextureSpace::eAllowSRGB ); bool rhsAllowSRGB = checkFlag( rhsPassConfig.config.textureSpace, TextureSpace::eAllowSRGB ); diff --git a/source/Core/Castor3D/Castor3DModule.cpp b/source/Core/Castor3D/Castor3DModule.cpp index 8ed04223d6..d459144627 100644 --- a/source/Core/Castor3D/Castor3DModule.cpp +++ b/source/Core/Castor3D/Castor3DModule.cpp @@ -8,7 +8,7 @@ #include CU_ImplementExportedOwnedBy( castor3d::Engine, Engine ) -CU_ImplementCUSmartPtr( castor3d, FramePassTimer ) +CU_ImplementSmartPtr( castor3d, FramePassTimer ) namespace castor3d { diff --git a/source/Core/Castor3D/Engine.cpp b/source/Core/Castor3D/Engine.cpp index e1440f43fb..be35724870 100644 --- a/source/Core/Castor3D/Engine.cpp +++ b/source/Core/Castor3D/Engine.cpp @@ -55,6 +55,8 @@ #include +CU_ImplementSmartPtr( castor3d, Engine ) + namespace castor3d { //********************************************************************************************* diff --git a/source/Core/Castor3D/Event/Frame/FrameEventModule.cpp b/source/Core/Castor3D/Event/Frame/FrameEventModule.cpp index 13ca454853..7d31dc934f 100644 --- a/source/Core/Castor3D/Event/Frame/FrameEventModule.cpp +++ b/source/Core/Castor3D/Event/Frame/FrameEventModule.cpp @@ -6,12 +6,12 @@ #include "Castor3D/Event/Frame/GpuFrameEvent.hpp" #include "Castor3D/Event/Frame/GpuFunctorEvent.hpp" -CU_ImplementCUSmartPtr( castor3d, CpuFrameEvent ) -CU_ImplementCUSmartPtr( castor3d, FrameListener ) -CU_ImplementCUSmartPtr( castor3d, FrameListenerCache ) -CU_ImplementCUSmartPtr( castor3d, GpuFrameEvent ) -CU_ImplementCUSmartPtr( castor3d, CpuFunctorEvent ) -CU_ImplementCUSmartPtr( castor3d, GpuFunctorEvent ) +CU_ImplementSmartPtr( castor3d, CpuFrameEvent ) +CU_ImplementSmartPtr( castor3d, FrameListener ) +CU_ImplementSmartPtr( castor3d, FrameListenerCache ) +CU_ImplementSmartPtr( castor3d, GpuFrameEvent ) +CU_ImplementSmartPtr( castor3d, CpuFunctorEvent ) +CU_ImplementSmartPtr( castor3d, GpuFunctorEvent ) namespace castor3d { diff --git a/source/Core/Castor3D/Event/UserInput/UserInputEventModule.cpp b/source/Core/Castor3D/Event/UserInput/UserInputEventModule.cpp index 3cce952e3d..d1c2ac92f7 100644 --- a/source/Core/Castor3D/Event/UserInput/UserInputEventModule.cpp +++ b/source/Core/Castor3D/Event/UserInput/UserInputEventModule.cpp @@ -6,11 +6,7 @@ #include "Castor3D/Event/UserInput/MouseEvent.hpp" #include "Castor3D/Event/UserInput/UserInputEvent.hpp" -CU_ImplementCUSmartPtr( castor3d, EventHandler ) -CU_ImplementCUSmartPtr( castor3d, HandlerEvent ) -CU_ImplementCUSmartPtr( castor3d, KeyboardEvent ) -CU_ImplementCUSmartPtr( castor3d, MouseEvent ) -CU_ImplementCUSmartPtr( castor3d, UserInputEvent ) +CU_ImplementSmartPtr( castor3d, EventHandler ) namespace castor3d { diff --git a/source/Core/Castor3D/Event/UserInput/UserInputListener.cpp b/source/Core/Castor3D/Event/UserInput/UserInputListener.cpp index fc8a4af801..8ce320130b 100644 --- a/source/Core/Castor3D/Event/UserInput/UserInputListener.cpp +++ b/source/Core/Castor3D/Event/UserInput/UserInputListener.cpp @@ -11,7 +11,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, UserInputListener ) +CU_ImplementSmartPtr( castor3d, UserInputListener ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlButton.cpp b/source/Core/Castor3D/Gui/Controls/CtrlButton.cpp index b799333e1e..3221f42062 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlButton.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlButton.cpp @@ -14,7 +14,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ButtonCtrl ) +CU_ImplementSmartPtr( castor3d, ButtonCtrl ) namespace castor3d { @@ -100,7 +100,7 @@ namespace castor3d { m_onEnable = {}; - if ( auto text = m_text ) + if ( m_text ) { if ( m_scene ) { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlComboBox.cpp b/source/Core/Castor3D/Gui/Controls/CtrlComboBox.cpp index 18f961a5fb..2cfac302ce 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlComboBox.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlComboBox.cpp @@ -13,7 +13,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ComboBoxCtrl ) +CU_ImplementSmartPtr( castor3d, ComboBoxCtrl ) namespace castor3d { @@ -108,7 +108,7 @@ namespace castor3d ComboBoxCtrl::~ComboBoxCtrl()noexcept { - if ( auto text = m_text ) + if ( m_text ) { if ( m_scene ) { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlControl.cpp b/source/Core/Castor3D/Gui/Controls/CtrlControl.cpp index 63d36447a9..7f1179e507 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlControl.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlControl.cpp @@ -13,7 +13,7 @@ #include "Castor3D/Overlay/TextOverlay.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, Control ) +CU_ImplementSmartPtr( castor3d, Control ) namespace castor3d { @@ -109,7 +109,7 @@ namespace castor3d Control::~Control()noexcept { - if ( auto overlay = m_background ) + if ( m_background ) { if ( m_scene ) { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlEdit.cpp b/source/Core/Castor3D/Gui/Controls/CtrlEdit.cpp index 063260393f..7bb3f805b9 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlEdit.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlEdit.cpp @@ -13,7 +13,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, EditCtrl ) +CU_ImplementSmartPtr( castor3d, EditCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.cpp b/source/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.cpp index 12fb460a3b..b6595c8f82 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.cpp @@ -13,7 +13,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ExpandablePanelCtrl ) +CU_ImplementSmartPtr( castor3d, ExpandablePanelCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlFrame.cpp b/source/Core/Castor3D/Gui/Controls/CtrlFrame.cpp index fa497af2d8..ee5a437cfb 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlFrame.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlFrame.cpp @@ -13,7 +13,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, FrameCtrl ) +CU_ImplementSmartPtr( castor3d, FrameCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlLayoutControl.cpp b/source/Core/Castor3D/Gui/Controls/CtrlLayoutControl.cpp index fe09b305a0..5e5c937c44 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlLayoutControl.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlLayoutControl.cpp @@ -13,7 +13,7 @@ #include "Castor3D/Overlay/TextOverlay.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, LayoutControl ) +CU_ImplementSmartPtr( castor3d, LayoutControl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlListBox.cpp b/source/Core/Castor3D/Gui/Controls/CtrlListBox.cpp index 39707e004f..5f729879f6 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlListBox.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlListBox.cpp @@ -16,7 +16,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ListBoxCtrl ) +CU_ImplementSmartPtr( castor3d, ListBoxCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlPanel.cpp b/source/Core/Castor3D/Gui/Controls/CtrlPanel.cpp index 96f8374027..73a5cc4e2e 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlPanel.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlPanel.cpp @@ -11,7 +11,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PanelCtrl ) +CU_ImplementSmartPtr( castor3d, PanelCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlProgress.cpp b/source/Core/Castor3D/Gui/Controls/CtrlProgress.cpp index 2e0ef2d3d9..fa9cca786e 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlProgress.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlProgress.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ProgressCtrl ) +CU_ImplementSmartPtr( castor3d, ProgressCtrl ) namespace castor3d { @@ -84,7 +84,7 @@ namespace castor3d ProgressCtrl::~ProgressCtrl()noexcept { - if ( auto overlay = m_text ) + if ( m_text ) { if ( m_scene ) { @@ -100,7 +100,7 @@ namespace castor3d manager.unregisterControl( *m_progress ); manager.unregisterControl( *m_container ); - if ( auto overlay = m_title ) + if ( m_title ) { if ( m_scene ) { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlScrollBar.cpp b/source/Core/Castor3D/Gui/Controls/CtrlScrollBar.cpp index b4628099bb..d5fb3428ae 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlScrollBar.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlScrollBar.cpp @@ -14,7 +14,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ScrollBarCtrl ) +CU_ImplementSmartPtr( castor3d, ScrollBarCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlScrollable.cpp b/source/Core/Castor3D/Gui/Controls/CtrlScrollable.cpp index d2b551baca..186af63317 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlScrollable.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlScrollable.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ScrollableCtrl ) +CU_ImplementSmartPtr( castor3d, ScrollableCtrl ) namespace castor3d { @@ -82,7 +82,7 @@ namespace castor3d ScrollableCtrl::~ScrollableCtrl()noexcept { - if ( auto overlay = m_corner ) + if ( m_corner ) { if ( m_target.hasScene() ) { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlSlider.cpp b/source/Core/Castor3D/Gui/Controls/CtrlSlider.cpp index bb72966acb..fa707b55a9 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlSlider.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlSlider.cpp @@ -9,7 +9,7 @@ #include "Castor3D/Overlay/BorderPanelOverlay.hpp" #include "Castor3D/Overlay/Overlay.hpp" -CU_ImplementCUSmartPtr( castor3d, SliderCtrl ) +CU_ImplementSmartPtr( castor3d, SliderCtrl ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Controls/CtrlStatic.cpp b/source/Core/Castor3D/Gui/Controls/CtrlStatic.cpp index cfe4719d0a..452cdb46de 100644 --- a/source/Core/Castor3D/Gui/Controls/CtrlStatic.cpp +++ b/source/Core/Castor3D/Gui/Controls/CtrlStatic.cpp @@ -11,7 +11,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, StaticCtrl ) +CU_ImplementSmartPtr( castor3d, StaticCtrl ) namespace castor3d { @@ -75,7 +75,7 @@ namespace castor3d StaticCtrl::~StaticCtrl()noexcept { - if ( auto overlay = m_text ) + if ( m_text ) { if ( m_scene ) { diff --git a/source/Core/Castor3D/Gui/ControlsManager.cpp b/source/Core/Castor3D/Gui/ControlsManager.cpp index 62e7c22e50..0dbbe70d67 100644 --- a/source/Core/Castor3D/Gui/ControlsManager.cpp +++ b/source/Core/Castor3D/Gui/ControlsManager.cpp @@ -28,7 +28,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, ControlsManager ) +CU_ImplementSmartPtr( castor3d, ControlsManager ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/GuiModule.cpp b/source/Core/Castor3D/Gui/GuiModule.cpp index 61e1e5e91c..159e0592fd 100644 --- a/source/Core/Castor3D/Gui/GuiModule.cpp +++ b/source/Core/Castor3D/Gui/GuiModule.cpp @@ -26,21 +26,21 @@ #include -CU_ImplementCUSmartPtr( castor3d, StylesHolder ) -CU_ImplementCUSmartPtr( castor3d, Theme ) -CU_ImplementCUSmartPtr( castor3d, ControlStyle ) -CU_ImplementCUSmartPtr( castor3d, ButtonStyle ) -CU_ImplementCUSmartPtr( castor3d, ComboBoxStyle ) -CU_ImplementCUSmartPtr( castor3d, EditStyle ) -CU_ImplementCUSmartPtr( castor3d, ExpandablePanelStyle ) -CU_ImplementCUSmartPtr( castor3d, FrameStyle ) -CU_ImplementCUSmartPtr( castor3d, ListBoxStyle ) -CU_ImplementCUSmartPtr( castor3d, PanelStyle ) -CU_ImplementCUSmartPtr( castor3d, ProgressStyle ) -CU_ImplementCUSmartPtr( castor3d, ScrollableStyle ) -CU_ImplementCUSmartPtr( castor3d, ScrollBarStyle ) -CU_ImplementCUSmartPtr( castor3d, SliderStyle ) -CU_ImplementCUSmartPtr( castor3d, StaticStyle ) +CU_ImplementSmartPtr( castor3d, StylesHolder ) +CU_ImplementSmartPtr( castor3d, Theme ) +CU_ImplementSmartPtr( castor3d, ControlStyle ) +CU_ImplementSmartPtr( castor3d, ButtonStyle ) +CU_ImplementSmartPtr( castor3d, ComboBoxStyle ) +CU_ImplementSmartPtr( castor3d, EditStyle ) +CU_ImplementSmartPtr( castor3d, ExpandablePanelStyle ) +CU_ImplementSmartPtr( castor3d, FrameStyle ) +CU_ImplementSmartPtr( castor3d, ListBoxStyle ) +CU_ImplementSmartPtr( castor3d, PanelStyle ) +CU_ImplementSmartPtr( castor3d, ProgressStyle ) +CU_ImplementSmartPtr( castor3d, ScrollableStyle ) +CU_ImplementSmartPtr( castor3d, ScrollBarStyle ) +CU_ImplementSmartPtr( castor3d, SliderStyle ) +CU_ImplementSmartPtr( castor3d, StaticStyle ) namespace castor3d { diff --git a/source/Core/Castor3D/Gui/Gui_Parsers.cpp b/source/Core/Castor3D/Gui/Gui_Parsers.cpp index e79c96e03d..5d2313829d 100644 --- a/source/Core/Castor3D/Gui/Gui_Parsers.cpp +++ b/source/Core/Castor3D/Gui/Gui_Parsers.cpp @@ -474,7 +474,7 @@ namespace castor3d { bool value; params[0]->get( value ); - guiContext.edit->addFlag( EditFlag::eMultiline/* + edit->addFlag( EditFlag::eMultiline/* | EditFlag::eProcessEnter | EditFlag::eProcessTab*/ ); } diff --git a/source/Core/Castor3D/Gui/Layout/Layout.cpp b/source/Core/Castor3D/Gui/Layout/Layout.cpp index 2ec06c056c..6253a3478b 100644 --- a/source/Core/Castor3D/Gui/Layout/Layout.cpp +++ b/source/Core/Castor3D/Gui/Layout/Layout.cpp @@ -3,8 +3,8 @@ #include "Castor3D/Event/Frame/CpuFunctorEvent.hpp" #include "Castor3D/Gui/Controls/CtrlLayoutControl.hpp" -CU_ImplementCUSmartPtr( castor3d, Layout ) -CU_ImplementCUSmartPtr( castor3d, Spacer ) +CU_ImplementSmartPtr( castor3d, Layout ) +CU_ImplementSmartPtr( castor3d, Spacer ) namespace castor3d { diff --git a/source/Core/Castor3D/ImporterFile.cpp b/source/Core/Castor3D/ImporterFile.cpp index 453decd763..dbe2f8e4fe 100644 --- a/source/Core/Castor3D/ImporterFile.cpp +++ b/source/Core/Castor3D/ImporterFile.cpp @@ -3,7 +3,8 @@ #include "Castor3D/Binary/CmshImporter.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, ImporterFileFactory ) +CU_ImplementSmartPtr( castor3d, ImporterFile ) +CU_ImplementSmartPtr( castor3d, ImporterFileFactory ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Material.cpp b/source/Core/Castor3D/Material/Material.cpp index 4c34afcf2a..1201159f45 100644 --- a/source/Core/Castor3D/Material/Material.cpp +++ b/source/Core/Castor3D/Material/Material.cpp @@ -7,7 +7,7 @@ #include "Castor3D/Material/Pass/PassFactory.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, Material ) +CU_ImplementSmartPtr( castor3d, Material ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/MaterialImporter.cpp b/source/Core/Castor3D/Material/MaterialImporter.cpp index 44559e86cb..dd7203b6ce 100644 --- a/source/Core/Castor3D/Material/MaterialImporter.cpp +++ b/source/Core/Castor3D/Material/MaterialImporter.cpp @@ -10,6 +10,8 @@ #include +CU_ImplementSmartPtr( castor3d, MaterialImporter ) + namespace castor3d { namespace matimp diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/BlendComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/BlendComponent.cpp index eb398e4cd1..8c99d8a338 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/BlendComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/BlendComponent.cpp @@ -10,6 +10,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, BlendComponent ) + namespace castor { template<> @@ -117,9 +119,9 @@ namespace castor3d PassComponentUPtr BlendComponent::doClone( Pass & pass )const { - auto result = std::make_unique< BlendComponent >( pass ); + auto result = castor::makeUnique< BlendComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool BlendComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/FractalMappingComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/FractalMappingComponent.cpp index 41064db915..927f96d017 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/FractalMappingComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/FractalMappingComponent.cpp @@ -10,6 +10,8 @@ #include +CU_ImplementSmartPtr( castor3d, FractalMappingComponent ) + namespace castor { template<> @@ -228,9 +230,9 @@ namespace castor3d PassComponentUPtr FractalMappingComponent::doClone( Pass & pass )const { - auto result = std::make_unique< FractalMappingComponent >( pass ); + auto result = castor::makeUnique< FractalMappingComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool FractalMappingComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/NormalComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/NormalComponent.cpp index 3ba0f75e23..85c013455f 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/NormalComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/NormalComponent.cpp @@ -12,6 +12,8 @@ #include +CU_ImplementSmartPtr( castor3d, NormalComponent ) + namespace castor3d { //********************************************************************************************* @@ -83,7 +85,8 @@ namespace castor3d PassComponentUPtr NormalComponent::doClone( Pass & pass )const { - return std::make_unique< NormalComponent >( pass ); + auto result = castor::makeUnique< NormalComponent >( pass ); + return castor::ptrRefCast< PassComponent >( result ); } //********************************************************************************************* diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/PassHeaderComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/PassHeaderComponent.cpp index 8dbaade148..276685200e 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/PassHeaderComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/PassHeaderComponent.cpp @@ -10,6 +10,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, PassHeaderComponent ) + namespace castor { template<> @@ -117,9 +119,9 @@ namespace castor3d PassComponentUPtr PassHeaderComponent::doClone( Pass & pass )const { - auto result = std::make_unique< PassHeaderComponent >( pass ); + auto result = castor::makeUnique< PassHeaderComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool PassHeaderComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/PickableComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/PickableComponent.cpp index b508f3a67c..cbed628fb0 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/PickableComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/PickableComponent.cpp @@ -7,6 +7,8 @@ #include +CU_ImplementSmartPtr( castor3d, PickableComponent ) + namespace castor { template<> @@ -80,9 +82,9 @@ namespace castor3d PassComponentUPtr PickableComponent::doClone( Pass & pass )const { - auto result = std::make_unique< PickableComponent >( pass ); + auto result = castor::makeUnique< PickableComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool PickableComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/TextureCountComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/TextureCountComponent.cpp index 8ece04e869..b9bf9ea4d8 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/TextureCountComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/TextureCountComponent.cpp @@ -10,6 +10,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, TextureCountComponent ) + namespace castor3d { //********************************************************************************************* @@ -57,7 +59,7 @@ namespace castor3d PassComponentUPtr TextureCountComponent::doClone( Pass & pass )const { - return std::make_unique< TextureCountComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, TextureCountComponent >( pass ); } void TextureCountComponent::doFillBuffer( PassBuffer & buffer )const diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/TexturesComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/TexturesComponent.cpp index 37841d6e8b..d1fc8e95bd 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/TexturesComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/TexturesComponent.cpp @@ -12,6 +12,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, TexturesComponent ) + namespace castor3d { //********************************************************************************************* @@ -292,7 +294,7 @@ namespace castor3d PassComponentUPtr TexturesComponent::doClone( Pass & pass )const { - return std::make_unique< TexturesComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, TexturesComponent >( pass ); } void TexturesComponent::doFillBuffer( PassBuffer & buffer )const diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/TwoSidedComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/TwoSidedComponent.cpp index 64ce317b53..39e4ad9791 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/TwoSidedComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/TwoSidedComponent.cpp @@ -7,6 +7,8 @@ #include +CU_ImplementSmartPtr( castor3d, TwoSidedComponent ) + namespace castor { template<> @@ -80,9 +82,9 @@ namespace castor3d PassComponentUPtr TwoSidedComponent::doClone( Pass & pass )const { - auto result = std::make_unique< TwoSidedComponent >( pass ); + auto result = castor::makeUnique< TwoSidedComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool TwoSidedComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Base/UntileMappingComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Base/UntileMappingComponent.cpp index 4704b83804..b74a67cc3f 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Base/UntileMappingComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Base/UntileMappingComponent.cpp @@ -9,6 +9,8 @@ #include +CU_ImplementSmartPtr( castor3d, UntileMappingComponent ) + namespace castor { template<> @@ -181,9 +183,9 @@ namespace castor3d PassComponentUPtr UntileMappingComponent::doClone( Pass & pass )const { - auto result = std::make_unique< UntileMappingComponent >( pass ); + auto result = castor::makeUnique< UntileMappingComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool UntileMappingComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/AmbientComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/AmbientComponent.cpp index 62213152b3..26e60e1bdf 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/AmbientComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/AmbientComponent.cpp @@ -11,6 +11,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, AmbientComponent ) + namespace castor { template<> @@ -196,9 +198,9 @@ namespace castor3d PassComponentUPtr AmbientComponent::doClone( Pass & pass )const { - auto result = std::make_unique< AmbientComponent >( pass ); + auto result = castor::makeUnique< AmbientComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool AmbientComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/AttenuationComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/AttenuationComponent.cpp index 18150a1d8a..c5f5fa43ac 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/AttenuationComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/AttenuationComponent.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, AttenuationComponent ) + namespace castor { template<> @@ -209,9 +211,9 @@ namespace castor3d PassComponentUPtr AttenuationComponent::doClone( Pass & pass )const { - auto result = std::make_unique< AttenuationComponent >( pass ); + auto result = castor::makeUnique< AttenuationComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool AttenuationComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/ClearcoatComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/ClearcoatComponent.cpp index 067cfe5392..994876f106 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/ClearcoatComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/ClearcoatComponent.cpp @@ -15,6 +15,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, ClearcoatComponent ) + namespace castor { template<> @@ -239,9 +241,9 @@ namespace castor3d PassComponentUPtr ClearcoatComponent::doClone( Pass & pass )const { - auto result = std::make_unique< ClearcoatComponent >( pass ); + auto result = castor::makeUnique< ClearcoatComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool ClearcoatComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/EmissiveComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/EmissiveComponent.cpp index 7b057cb108..23d7238f54 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/EmissiveComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/EmissiveComponent.cpp @@ -11,6 +11,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, EmissiveComponent ) + namespace castor { template<> @@ -196,9 +198,9 @@ namespace castor3d PassComponentUPtr EmissiveComponent::doClone( Pass & pass )const { - auto result = std::make_unique< EmissiveComponent >( pass ); + auto result = castor::makeUnique< EmissiveComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool EmissiveComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/IridescenceComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/IridescenceComponent.cpp index 805d872de1..0cc5cee5ab 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/IridescenceComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/IridescenceComponent.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, IridescenceComponent ) + namespace castor { template<> @@ -332,9 +334,9 @@ namespace castor3d PassComponentUPtr IridescenceComponent::doClone( Pass & pass )const { - auto result = std::make_unique< IridescenceComponent >( pass ); + auto result = castor::makeUnique< IridescenceComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool IridescenceComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/LightingModelComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/LightingModelComponent.cpp index 7dd74dc8df..2d884d4f04 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/LightingModelComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/LightingModelComponent.cpp @@ -17,6 +17,8 @@ #include +CU_ImplementSmartPtr( castor3d, LightingModelComponent ) + namespace castor { template<> @@ -153,9 +155,9 @@ namespace castor3d PassComponentUPtr LightingModelComponent::doClone( Pass & pass )const { - auto result = std::make_unique< LightingModelComponent >( pass ); + auto result = castor::makeUnique< LightingModelComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool LightingModelComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/MetalnessComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/MetalnessComponent.cpp index 77ca4a5f7c..db1cb577fe 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/MetalnessComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/MetalnessComponent.cpp @@ -14,6 +14,8 @@ #include +CU_ImplementSmartPtr( castor3d, MetalnessComponent ) + namespace castor { template<> @@ -209,9 +211,9 @@ namespace castor3d PassComponentUPtr MetalnessComponent::doClone( Pass & pass )const { - auto result = std::make_unique< MetalnessComponent >( pass ); - result->m_value = m_value; - return result; + auto result = castor::makeUnique< MetalnessComponent >( pass ); + result->setData( getData() ); + return castor::ptrRefCast< PassComponent >( result ); } bool MetalnessComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/RoughnessComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/RoughnessComponent.cpp index 70c56dd8e1..6750dd5391 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/RoughnessComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/RoughnessComponent.cpp @@ -13,6 +13,8 @@ #include +CU_ImplementSmartPtr( castor3d, RoughnessComponent ) + namespace castor { template<> @@ -258,9 +260,9 @@ namespace castor3d PassComponentUPtr RoughnessComponent::doClone( Pass & pass )const { - auto result = std::make_unique< RoughnessComponent >( pass ); + auto result = castor::makeUnique< RoughnessComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool RoughnessComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/SheenComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/SheenComponent.cpp index f425bb569e..c724769956 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/SheenComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/SheenComponent.cpp @@ -15,6 +15,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, SheenComponent ) + namespace castor { template<> @@ -205,9 +207,9 @@ namespace castor3d PassComponentUPtr SheenComponent::doClone( Pass & pass )const { - auto result = std::make_unique< SheenComponent >( pass ); + auto result = castor::makeUnique< SheenComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool SheenComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/SpecularComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/SpecularComponent.cpp index 76bf50d272..c42018372a 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/SpecularComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/SpecularComponent.cpp @@ -20,6 +20,8 @@ //************************************************************************************************* +CU_ImplementSmartPtr( castor3d, SpecularComponent ) + namespace castor { template<> @@ -198,9 +200,9 @@ namespace castor3d PassComponentUPtr SpecularComponent::doClone( Pass & pass )const { - auto result = std::make_unique< SpecularComponent >( pass ); - result->m_value = m_value; - return result; + auto result = castor::makeUnique< SpecularComponent >( pass ); + result->setData( getData() ); + return castor::ptrRefCast< PassComponent >( result ); } bool SpecularComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/SubsurfaceScatteringComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/SubsurfaceScatteringComponent.cpp index dc5ecda1be..bb5b4a41ba 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/SubsurfaceScatteringComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/SubsurfaceScatteringComponent.cpp @@ -14,6 +14,8 @@ #include +CU_ImplementSmartPtr( castor3d, SubsurfaceScatteringComponent ) + namespace castor { template<> @@ -78,7 +80,7 @@ namespace castor3d } else { - parsingContext.subsurfaceScattering = std::make_unique< SubsurfaceScattering >(); + parsingContext.subsurfaceScattering = castor::makeUnique< SubsurfaceScattering >(); } } CU_EndAttributePush( Section::eSubsurfaceScattering ) @@ -371,13 +373,14 @@ namespace castor3d PassComponentUPtr SubsurfaceScatteringComponent::doClone( Pass & pass )const { auto & subsurfaceScattering = getSubsurfaceScattering(); - auto result = std::make_unique< SubsurfaceScatteringComponent >( pass ); - auto sss = std::make_unique< SubsurfaceScattering >(); + auto sss = castor::makeUnique< SubsurfaceScattering >(); sss->setGaussianWidth( subsurfaceScattering.getGaussianWidth() ); sss->setStrength( subsurfaceScattering.getStrength() ); sss->setSubsurfaceRadius( subsurfaceScattering.getSubsurfaceRadius() ); + + auto result = castor::makeUnique< SubsurfaceScatteringComponent >( pass ); result->setSubsurfaceScattering( std::move( sss ) ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool SubsurfaceScatteringComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/ThicknessComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/ThicknessComponent.cpp index 46da3808e2..25c756b77c 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/ThicknessComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/ThicknessComponent.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, ThicknessComponent ) + namespace castor { template<> @@ -172,9 +174,9 @@ namespace castor3d PassComponentUPtr ThicknessComponent::doClone( Pass & pass )const { - auto result = std::make_unique< ThicknessComponent >( pass ); + auto result = castor::makeUnique< ThicknessComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool ThicknessComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Lighting/TransmissionComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Lighting/TransmissionComponent.cpp index eefb003dec..fc2976ed66 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Lighting/TransmissionComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Lighting/TransmissionComponent.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, TransmissionComponent ) + namespace castor { template<> @@ -190,9 +192,9 @@ namespace castor3d PassComponentUPtr TransmissionComponent::doClone( Pass & pass )const { - auto result = std::make_unique< TransmissionComponent >( pass ); + auto result = castor::makeUnique< TransmissionComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool TransmissionComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/AttenuationMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/AttenuationMapComponent.cpp index 3ea78c3bca..f74634b56b 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/AttenuationMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/AttenuationMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, AttenuationMapComponent ) + namespace castor { template<> @@ -161,7 +163,7 @@ namespace castor3d void AttenuationMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< AttenuationMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, AttenuationMapComponent >( pass ) ); } bool AttenuationMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -187,7 +189,7 @@ namespace castor3d PassComponentUPtr AttenuationMapComponent::doClone( Pass & pass )const { - return std::make_unique< AttenuationMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, AttenuationMapComponent >( pass ); } void AttenuationMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatMapComponent.cpp index f9d88df959..4dac12cd6d 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, ClearcoatMapComponent ) + namespace castor { template<> @@ -160,7 +162,7 @@ namespace castor3d void ClearcoatMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< ClearcoatMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, ClearcoatMapComponent >( pass ) ); } bool ClearcoatMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -186,7 +188,7 @@ namespace castor3d PassComponentUPtr ClearcoatMapComponent::doClone( Pass & pass )const { - return std::make_unique< ClearcoatMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, ClearcoatMapComponent >( pass ); } void ClearcoatMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatNormalMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatNormalMapComponent.cpp index 7d193e255f..2df523333c 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatNormalMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatNormalMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, ClearcoatNormalMapComponent ) + namespace castor { template<> @@ -165,7 +167,7 @@ namespace castor3d void ClearcoatNormalMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< ClearcoatNormalMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, ClearcoatNormalMapComponent >( pass ) ); } bool ClearcoatNormalMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -191,7 +193,7 @@ namespace castor3d PassComponentUPtr ClearcoatNormalMapComponent::doClone( Pass & pass )const { - return std::make_unique< ClearcoatNormalMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, ClearcoatNormalMapComponent >( pass ); } void ClearcoatNormalMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatRoughnessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatRoughnessMapComponent.cpp index c1aebba267..8a6252a987 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatRoughnessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/ClearcoatRoughnessMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, ClearcoatRoughnessMapComponent ) + namespace castor { template<> @@ -159,7 +161,7 @@ namespace castor3d void ClearcoatRoughnessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< ClearcoatRoughnessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, ClearcoatRoughnessMapComponent >( pass ) ); } bool ClearcoatRoughnessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -185,7 +187,7 @@ namespace castor3d PassComponentUPtr ClearcoatRoughnessMapComponent::doClone( Pass & pass )const { - return std::make_unique< ClearcoatRoughnessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, ClearcoatRoughnessMapComponent >( pass ); } void ClearcoatRoughnessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/ColourMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/ColourMapComponent.cpp index 16d7ad6af0..d40d3ef1d3 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/ColourMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/ColourMapComponent.cpp @@ -16,6 +16,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, ColourMapComponent ) + namespace castor { template<> @@ -204,7 +206,7 @@ namespace castor3d void ColourMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< ColourMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, ColourMapComponent >( pass ) ); } //********************************************************************************************* @@ -222,7 +224,7 @@ namespace castor3d PassComponentUPtr ColourMapComponent::doClone( Pass & pass )const { - return std::make_unique< ColourMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, ColourMapComponent >( pass ); } void ColourMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/EmissiveMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/EmissiveMapComponent.cpp index 9ca108dc34..ccb4627314 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/EmissiveMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/EmissiveMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, EmissiveMapComponent ) + namespace castor { template<> @@ -154,7 +156,7 @@ namespace castor3d void EmissiveMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< EmissiveMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, EmissiveMapComponent >( pass ) ); } bool EmissiveMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -180,7 +182,7 @@ namespace castor3d PassComponentUPtr EmissiveMapComponent::doClone( Pass & pass )const { - return std::make_unique< EmissiveMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, EmissiveMapComponent >( pass ); } void EmissiveMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/GlossinessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/GlossinessMapComponent.cpp index 77a035ba56..f90c5e73a9 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/GlossinessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/GlossinessMapComponent.cpp @@ -22,6 +22,8 @@ //************************************************************************************************* +CU_ImplementSmartPtr( castor3d, GlossinessMapComponent ) + namespace castor { template<> @@ -188,7 +190,7 @@ namespace castor3d void GlossinessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< GlossinessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, GlossinessMapComponent >( pass ) ); } bool GlossinessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -219,7 +221,7 @@ namespace castor3d PassComponentUPtr GlossinessMapComponent::doClone( Pass & pass )const { - return std::make_unique< GlossinessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, GlossinessMapComponent >( pass ); } void GlossinessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/HeightMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/HeightMapComponent.cpp index d4e3b31a43..c58dffb448 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/HeightMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/HeightMapComponent.cpp @@ -17,6 +17,8 @@ #include +CU_ImplementSmartPtr( castor3d, HeightMapComponent ) + namespace castor { template<> @@ -543,7 +545,7 @@ namespace castor3d void HeightMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< HeightMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, HeightMapComponent >( pass ) ); } bool HeightMapComponent::Plugin::hasTexcoordModif( PassComponentRegister const & passComponents @@ -577,7 +579,7 @@ namespace castor3d PassComponentUPtr HeightMapComponent::doClone( Pass & pass )const { - return std::make_unique< HeightMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, HeightMapComponent >( pass ); } void HeightMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceMapComponent.cpp index 8c7f652c22..e0283c34b3 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, IridescenceMapComponent ) + namespace castor { template<> @@ -161,7 +163,7 @@ namespace castor3d void IridescenceMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< IridescenceMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, IridescenceMapComponent >( pass ) ); } bool IridescenceMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -187,7 +189,7 @@ namespace castor3d PassComponentUPtr IridescenceMapComponent::doClone( Pass & pass )const { - return std::make_unique< IridescenceMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, IridescenceMapComponent >( pass ); } void IridescenceMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceThicknessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceThicknessMapComponent.cpp index b7ed6135ad..0787ae4eda 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceThicknessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/IridescenceThicknessMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, IridescenceThicknessMapComponent ) + namespace castor { template<> @@ -165,7 +167,7 @@ namespace castor3d void IridescenceThicknessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< IridescenceThicknessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, IridescenceThicknessMapComponent >( pass ) ); } bool IridescenceThicknessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -191,7 +193,7 @@ namespace castor3d PassComponentUPtr IridescenceThicknessMapComponent::doClone( Pass & pass )const { - return std::make_unique< IridescenceThicknessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, IridescenceThicknessMapComponent >( pass ); } void IridescenceThicknessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/MetalnessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/MetalnessMapComponent.cpp index d51d9e00e1..d7dafa41ab 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/MetalnessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/MetalnessMapComponent.cpp @@ -17,6 +17,8 @@ #include +CU_ImplementSmartPtr( castor3d, MetalnessMapComponent ) + namespace castor { template<> @@ -156,7 +158,7 @@ namespace castor3d void MetalnessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< MetalnessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, MetalnessMapComponent >( pass ) ); } bool MetalnessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -196,7 +198,7 @@ namespace castor3d PassComponentUPtr MetalnessMapComponent::doClone( Pass & pass )const { - return std::make_unique< MetalnessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, MetalnessMapComponent >( pass ); } void MetalnessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/NormalMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/NormalMapComponent.cpp index 9e535d5dd8..73ced022c8 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/NormalMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/NormalMapComponent.cpp @@ -16,6 +16,8 @@ #include +CU_ImplementSmartPtr( castor3d, NormalMapComponent ) + namespace castor { template<> @@ -246,7 +248,7 @@ namespace castor3d void NormalMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< NormalMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, NormalMapComponent >( pass ) ); } bool NormalMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -272,7 +274,7 @@ namespace castor3d PassComponentUPtr NormalMapComponent::doClone( Pass & pass )const { - return std::make_unique< NormalMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, NormalMapComponent >( pass ); } void NormalMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/OcclusionMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/OcclusionMapComponent.cpp index 6f426a0538..c4e8cbd62d 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/OcclusionMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/OcclusionMapComponent.cpp @@ -14,6 +14,8 @@ #include +CU_ImplementSmartPtr( castor3d, OcclusionMapComponent ) + namespace castor { template<> @@ -193,7 +195,7 @@ namespace castor3d void OcclusionMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< OcclusionMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, OcclusionMapComponent >( pass ) ); } bool OcclusionMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -215,7 +217,7 @@ namespace castor3d PassComponentUPtr OcclusionMapComponent::doClone( Pass & pass )const { - return std::make_unique< OcclusionMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, OcclusionMapComponent >( pass ); } void OcclusionMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/OpacityMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/OpacityMapComponent.cpp index 8b28f00ac2..b55d73628b 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/OpacityMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/OpacityMapComponent.cpp @@ -17,6 +17,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, OpacityMapComponent ) + namespace castor { template<> @@ -155,7 +157,7 @@ namespace castor3d void OpacityMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< OpacityMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, OpacityMapComponent >( pass ) ); } bool OpacityMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -181,7 +183,7 @@ namespace castor3d PassComponentUPtr OpacityMapComponent::doClone( Pass & pass )const { - return std::make_unique< OpacityMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, OpacityMapComponent >( pass ); } void OpacityMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/RoughnessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/RoughnessMapComponent.cpp index 68f7d1c541..0ccf148fca 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/RoughnessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/RoughnessMapComponent.cpp @@ -16,6 +16,8 @@ #include +CU_ImplementSmartPtr( castor3d, RoughnessMapComponent ) + namespace castor { template<> @@ -155,7 +157,7 @@ namespace castor3d void RoughnessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< RoughnessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, RoughnessMapComponent >( pass ) ); } bool RoughnessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -181,7 +183,7 @@ namespace castor3d PassComponentUPtr RoughnessMapComponent::doClone( Pass & pass )const { - return std::make_unique< RoughnessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, RoughnessMapComponent >( pass ); } void RoughnessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/SheenMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/SheenMapComponent.cpp index 87a26475a2..2498d78d11 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/SheenMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/SheenMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, SheenMapComponent ) + namespace castor { template<> @@ -159,7 +161,7 @@ namespace castor3d void SheenMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< SheenMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, SheenMapComponent >( pass ) ); } bool SheenMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -185,7 +187,7 @@ namespace castor3d PassComponentUPtr SheenMapComponent::doClone( Pass & pass )const { - return std::make_unique< SheenMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, SheenMapComponent >( pass ); } void SheenMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/SheenRoughnessMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/SheenRoughnessMapComponent.cpp index 046f4175b8..6c34646ed2 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/SheenRoughnessMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/SheenRoughnessMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, SheenRoughnessMapComponent ) + namespace castor { template<> @@ -159,7 +161,7 @@ namespace castor3d void SheenRoughnessMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< SheenRoughnessMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, SheenRoughnessMapComponent >( pass ) ); } bool SheenRoughnessMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -185,7 +187,7 @@ namespace castor3d PassComponentUPtr SheenRoughnessMapComponent::doClone( Pass & pass )const { - return std::make_unique< SheenRoughnessMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, SheenRoughnessMapComponent >( pass ); } void SheenRoughnessMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/SpecularMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/SpecularMapComponent.cpp index aa6e32f8be..432eba0e19 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/SpecularMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/SpecularMapComponent.cpp @@ -20,6 +20,8 @@ //************************************************************************************************* +CU_ImplementSmartPtr( castor3d, SpecularMapComponent ) + namespace castor { template<> @@ -158,7 +160,7 @@ namespace castor3d void SpecularMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< SpecularMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, SpecularMapComponent >( pass ) ); } bool SpecularMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -199,7 +201,7 @@ namespace castor3d PassComponentUPtr SpecularMapComponent::doClone( Pass & pass )const { - return std::make_unique< SpecularMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, SpecularMapComponent >( pass ); } void SpecularMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/TransmissionMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/TransmissionMapComponent.cpp index 8c4844441c..943ac983f3 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/TransmissionMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/TransmissionMapComponent.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d, TransmissionMapComponent ) + namespace castor { template<> @@ -160,7 +162,7 @@ namespace castor3d void TransmissionMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< TransmissionMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, TransmissionMapComponent >( pass ) ); } bool TransmissionMapComponent::Plugin::doWriteTextureConfig( TextureConfiguration const & configuration @@ -186,7 +188,7 @@ namespace castor3d PassComponentUPtr TransmissionMapComponent::doClone( Pass & pass )const { - return std::make_unique< TransmissionMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, TransmissionMapComponent >( pass ); } void TransmissionMapComponent::doFillConfig( TextureConfiguration & configuration diff --git a/source/Core/Castor3D/Material/Pass/Component/Map/TransmittanceMapComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Map/TransmittanceMapComponent.cpp index 545bd5b702..5c9f3f9208 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Map/TransmittanceMapComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Map/TransmittanceMapComponent.cpp @@ -14,6 +14,8 @@ #include +CU_ImplementSmartPtr( castor3d, TransmittanceMapComponent ) + namespace castor { template<> @@ -219,7 +221,7 @@ namespace castor3d void TransmittanceMapComponent::Plugin::createMapComponent( Pass & pass , std::vector< PassComponentUPtr > & result )const { - result.push_back( std::make_unique< TransmittanceMapComponent >( pass ) ); + result.push_back( castor::makeUniqueDerived< PassComponent, TransmittanceMapComponent >( pass ) ); } void TransmittanceMapComponent::Plugin::zeroBuffer( Pass const & pass @@ -250,7 +252,7 @@ namespace castor3d PassComponentUPtr TransmittanceMapComponent::doClone( Pass & pass )const { - return std::make_unique< TransmittanceMapComponent >( pass ); + return castor::makeUniqueDerived< PassComponent, TransmittanceMapComponent >( pass ); } bool TransmittanceMapComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/AlphaTestComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/AlphaTestComponent.cpp index 18eca29909..60e3f39310 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/AlphaTestComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/AlphaTestComponent.cpp @@ -12,6 +12,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, AlphaTestComponent ) + namespace castor { template<> @@ -220,9 +222,9 @@ namespace castor3d PassComponentUPtr AlphaTestComponent::doClone( Pass & pass )const { - auto result = std::make_unique< AlphaTestComponent >( pass ); + auto result = castor::makeUnique< AlphaTestComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool AlphaTestComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/ColourComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/ColourComponent.cpp index 4abe8e1355..f988775199 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/ColourComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/ColourComponent.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, ColourComponent ) + namespace castor { template<> @@ -224,9 +226,9 @@ namespace castor3d PassComponentUPtr ColourComponent::doClone( Pass & pass )const { - auto result = std::make_unique< ColourComponent >( pass ); + auto result = castor::makeUnique< ColourComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool ColourComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/HeightComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/HeightComponent.cpp index 0270dda4e0..8439369f7d 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/HeightComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/HeightComponent.cpp @@ -11,6 +11,8 @@ #include +CU_ImplementSmartPtr( castor3d, HeightComponent ) + namespace castor { template<> @@ -149,9 +151,9 @@ namespace castor3d PassComponentUPtr HeightComponent::doClone( Pass & pass )const { - auto result = std::make_unique< HeightComponent >( pass ); + auto result = castor::makeUnique< HeightComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool HeightComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/OpacityComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/OpacityComponent.cpp index 5e00042849..88da1fbfa4 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/OpacityComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/OpacityComponent.cpp @@ -14,6 +14,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, OpacityComponent ) + namespace castor { template<> @@ -254,9 +256,9 @@ namespace castor3d PassComponentUPtr OpacityComponent::doClone( Pass & pass )const { - auto result = std::make_unique< OpacityComponent >( pass ); + auto result = castor::makeUnique< OpacityComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool OpacityComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/ReflectionComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/ReflectionComponent.cpp index 62fa8ab220..10f97de610 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/ReflectionComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/ReflectionComponent.cpp @@ -9,6 +9,8 @@ #include +CU_ImplementSmartPtr( castor3d, ReflectionComponent ) + namespace castor { template<> @@ -165,9 +167,9 @@ namespace castor3d PassComponentUPtr ReflectionComponent::doClone( Pass & pass )const { - auto result = std::make_unique< ReflectionComponent >( pass ); + auto result = castor::makeUnique< ReflectionComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool ReflectionComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/Other/RefractionComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/Other/RefractionComponent.cpp index d7edab0d2c..2bf8fb23a2 100644 --- a/source/Core/Castor3D/Material/Pass/Component/Other/RefractionComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/Other/RefractionComponent.cpp @@ -10,6 +10,8 @@ #include +CU_ImplementSmartPtr( castor3d, RefractionComponent ) + namespace castor { template<> @@ -167,9 +169,9 @@ namespace castor3d PassComponentUPtr RefractionComponent::doClone( Pass & pass )const { - auto result = std::make_unique< RefractionComponent >( pass ); + auto result = castor::makeUnique< RefractionComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool RefractionComponent::doWriteText( castor::String const & tabs diff --git a/source/Core/Castor3D/Material/Pass/Component/PassComponent.cpp b/source/Core/Castor3D/Material/Pass/Component/PassComponent.cpp index a93f803318..ae830d07d8 100644 --- a/source/Core/Castor3D/Material/Pass/Component/PassComponent.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/PassComponent.cpp @@ -12,7 +12,8 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, PassComponentPlugin ) +CU_ImplementSmartPtr( castor3d, PassComponent ) +CU_ImplementSmartPtr( castor3d, PassComponentPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Pass/Component/PassComponentRegister.cpp b/source/Core/Castor3D/Material/Pass/Component/PassComponentRegister.cpp index 5a6e740d94..8d8fe4a331 100644 --- a/source/Core/Castor3D/Material/Pass/Component/PassComponentRegister.cpp +++ b/source/Core/Castor3D/Material/Pass/Component/PassComponentRegister.cpp @@ -53,7 +53,7 @@ #include "Castor3D/Miscellaneous/Logger.hpp" #include "Castor3D/Render/RenderPipeline.hpp" -CU_ImplementCUSmartPtr( castor3d, PassComponentRegister ) +CU_ImplementSmartPtr( castor3d, PassComponentRegister ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Pass/Pass.cpp b/source/Core/Castor3D/Material/Pass/Pass.cpp index 89aedcb9be..51562739ac 100644 --- a/source/Core/Castor3D/Material/Pass/Pass.cpp +++ b/source/Core/Castor3D/Material/Pass/Pass.cpp @@ -41,7 +41,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, Pass ) +CU_ImplementSmartPtr( castor3d, Pass ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Pass/PassFactory.cpp b/source/Core/Castor3D/Material/Pass/PassFactory.cpp index 2c2e17a4f2..14abcee3ab 100644 --- a/source/Core/Castor3D/Material/Pass/PassFactory.cpp +++ b/source/Core/Castor3D/Material/Pass/PassFactory.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Material/Pass/Pass.hpp" #include "Castor3D/Shader/Shaders/GlslLighting.hpp" -CU_ImplementCUSmartPtr( castor3d, PassFactory ) +CU_ImplementSmartPtr( castor3d, PassFactory ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Pass/PassModule.cpp b/source/Core/Castor3D/Material/Pass/PassModule.cpp index b9362688fe..41df6ffd6d 100644 --- a/source/Core/Castor3D/Material/Pass/PassModule.cpp +++ b/source/Core/Castor3D/Material/Pass/PassModule.cpp @@ -1,7 +1,7 @@ #include "Castor3D/Material/Pass/PassModule.hpp" #include "Castor3D/Render/RenderModule.hpp" -CU_ImplementCUSmartPtr( castor3d, RenderPassRegisterInfo ) +CU_ImplementSmartPtr( castor3d, RenderPassRegisterInfo ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Pass/SubsurfaceScattering.cpp b/source/Core/Castor3D/Material/Pass/SubsurfaceScattering.cpp index 880aa5f54e..041e999178 100644 --- a/source/Core/Castor3D/Material/Pass/SubsurfaceScattering.cpp +++ b/source/Core/Castor3D/Material/Pass/SubsurfaceScattering.cpp @@ -2,6 +2,8 @@ #include "Castor3D/Material/Pass/PassVisitor.hpp" +CU_ImplementSmartPtr( castor3d, SubsurfaceScattering ) + namespace castor3d { void SubsurfaceScattering::accept( PassVisitorBase & vis ) diff --git a/source/Core/Castor3D/Material/Texture/Animation/TextureAnimation.cpp b/source/Core/Castor3D/Material/Texture/Animation/TextureAnimation.cpp index c7ffdb2884..42fb1f754b 100644 --- a/source/Core/Castor3D/Material/Texture/Animation/TextureAnimation.cpp +++ b/source/Core/Castor3D/Material/Texture/Animation/TextureAnimation.cpp @@ -5,7 +5,7 @@ #include "Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.hpp" #include "Castor3D/Scene/Animation/AnimatedTexture.hpp" -CU_ImplementCUSmartPtr( castor3d, TextureAnimation ) +CU_ImplementSmartPtr( castor3d, TextureAnimation ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.cpp b/source/Core/Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.cpp index 6eccdb13b9..7b069eb8fb 100644 --- a/source/Core/Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.cpp +++ b/source/Core/Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.cpp @@ -1,6 +1,6 @@ #include "Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.hpp" -CU_ImplementCUSmartPtr( castor3d, TextureAnimationKeyFrame ) +CU_ImplementSmartPtr( castor3d, TextureAnimationKeyFrame ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/Sampler.cpp b/source/Core/Castor3D/Material/Texture/Sampler.cpp index 393b8dacb1..fc691e4a52 100644 --- a/source/Core/Castor3D/Material/Texture/Sampler.cpp +++ b/source/Core/Castor3D/Material/Texture/Sampler.cpp @@ -9,7 +9,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, Sampler ) +CU_ImplementSmartPtr( castor3d, Sampler ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/TextureLayout.cpp b/source/Core/Castor3D/Material/Texture/TextureLayout.cpp index 991217025a..5ed7cd1989 100644 --- a/source/Core/Castor3D/Material/Texture/TextureLayout.cpp +++ b/source/Core/Castor3D/Material/Texture/TextureLayout.cpp @@ -17,8 +17,8 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, TextureLayout ) -CU_ImplementCUSmartPtr( castor3d, TextureSource ) +CU_ImplementSmartPtr( castor3d, TextureLayout ) +CU_ImplementSmartPtr( castor3d, TextureSource ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/TextureModule.cpp b/source/Core/Castor3D/Material/Texture/TextureModule.cpp index 24353328a8..f5a472af22 100644 --- a/source/Core/Castor3D/Material/Texture/TextureModule.cpp +++ b/source/Core/Castor3D/Material/Texture/TextureModule.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Material/Texture/Sampler.hpp" #include "Castor3D/Material/Texture/TextureLayout.hpp" -CU_ImplementCUSmartPtr( castor3d, SamplerCache ) +CU_ImplementSmartPtr( castor3d, SamplerCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/TextureUnit.cpp b/source/Core/Castor3D/Material/Texture/TextureUnit.cpp index 6ec34cb9a3..30ffb23aa6 100644 --- a/source/Core/Castor3D/Material/Texture/TextureUnit.cpp +++ b/source/Core/Castor3D/Material/Texture/TextureUnit.cpp @@ -11,8 +11,8 @@ #include -CU_ImplementCUSmartPtr( castor3d, TextureUnit ) -CU_ImplementCUSmartPtr( castor3d, TextureUnitData ) +CU_ImplementSmartPtr( castor3d, TextureUnit ) +CU_ImplementSmartPtr( castor3d, TextureUnitData ) namespace castor3d { diff --git a/source/Core/Castor3D/Material/Texture/TextureView.cpp b/source/Core/Castor3D/Material/Texture/TextureView.cpp index eb52a8af60..8617f437d7 100644 --- a/source/Core/Castor3D/Material/Texture/TextureView.cpp +++ b/source/Core/Castor3D/Material/Texture/TextureView.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, TextureView ) +CU_ImplementSmartPtr( castor3d, TextureView ) namespace castor3d { diff --git a/source/Core/Castor3D/Miscellaneous/LoadingScreen.cpp b/source/Core/Castor3D/Miscellaneous/LoadingScreen.cpp index c3288b9088..3246286069 100644 --- a/source/Core/Castor3D/Miscellaneous/LoadingScreen.cpp +++ b/source/Core/Castor3D/Miscellaneous/LoadingScreen.cpp @@ -26,7 +26,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, LoadingScreen ) +CU_ImplementSmartPtr( castor3d, LoadingScreen ) namespace castor3d { diff --git a/source/Core/Castor3D/Miscellaneous/ProgressBar.cpp b/source/Core/Castor3D/Miscellaneous/ProgressBar.cpp index fece711790..121d713757 100644 --- a/source/Core/Castor3D/Miscellaneous/ProgressBar.cpp +++ b/source/Core/Castor3D/Miscellaneous/ProgressBar.cpp @@ -9,7 +9,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ProgressBar ) +CU_ImplementSmartPtr( castor3d, ProgressBar ) namespace castor3d { diff --git a/source/Core/Castor3D/Miscellaneous/StagingData.cpp b/source/Core/Castor3D/Miscellaneous/StagingData.cpp index eecd48dc18..dcfb848b67 100644 --- a/source/Core/Castor3D/Miscellaneous/StagingData.cpp +++ b/source/Core/Castor3D/Miscellaneous/StagingData.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Render/RenderDevice.hpp" -CU_ImplementCUSmartPtr( castor3d, StagingData ) +CU_ImplementSmartPtr( castor3d, StagingData ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimation.cpp b/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimation.cpp index dcf3280baa..666339d9da 100644 --- a/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimation.cpp +++ b/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimation.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Model/Mesh/Mesh.hpp" -CU_ImplementCUSmartPtr( castor3d, MeshAnimation ) +CU_ImplementSmartPtr( castor3d, MeshAnimation ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimationSubmesh.cpp b/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimationSubmesh.cpp index 9bbfe6db95..b114b6c49b 100644 --- a/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimationSubmesh.cpp +++ b/source/Core/Castor3D/Model/Mesh/Animation/MeshAnimationSubmesh.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Model/Mesh/Submesh/Submesh.hpp" #include "Castor3D/Model/Mesh/Submesh/Component/MorphComponent.hpp" -CU_ImplementCUSmartPtr( castor3d, MeshAnimationSubmesh ) +CU_ImplementSmartPtr( castor3d, MeshAnimationSubmesh ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Animation/MeshMorphTarget.cpp b/source/Core/Castor3D/Model/Mesh/Animation/MeshMorphTarget.cpp index 12f0a42c18..8636e62646 100644 --- a/source/Core/Castor3D/Model/Mesh/Animation/MeshMorphTarget.cpp +++ b/source/Core/Castor3D/Model/Mesh/Animation/MeshMorphTarget.cpp @@ -6,7 +6,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, MeshMorphTarget ) +CU_ImplementSmartPtr( castor3d, MeshMorphTarget ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Cone.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Cone.cpp index acd6b1ba52..273e235cb1 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Cone.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Cone.cpp @@ -5,6 +5,8 @@ #include "Castor3D/Model/Vertex.hpp" #include "Castor3D/Miscellaneous/Parameter.hpp" +CU_ImplementSmartPtr( castor3d, Cone ) + namespace castor3d { Cone::Cone() @@ -17,7 +19,7 @@ namespace castor3d MeshGeneratorUPtr Cone::create() { - return std::make_unique< Cone >(); + return castor::makeUniqueDerived< MeshGenerator, Cone >(); } void Cone::doGenerate( Mesh & mesh diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Cube.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Cube.cpp index 78a3f287f5..14eedfb2c3 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Cube.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Cube.cpp @@ -4,6 +4,8 @@ #include "Castor3D/Model/Vertex.hpp" #include "Castor3D/Miscellaneous/Parameter.hpp" +CU_ImplementSmartPtr( castor3d, Cube ) + namespace castor3d { Cube::Cube() @@ -16,7 +18,7 @@ namespace castor3d MeshGeneratorUPtr Cube::create() { - return std::make_unique< Cube >(); + return castor::makeUniqueDerived< MeshGenerator, Cube >(); } void Cube::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Cylinder.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Cylinder.cpp index e93c8fdb24..c070846418 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Cylinder.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Cylinder.cpp @@ -6,6 +6,8 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" +CU_ImplementSmartPtr( castor3d, Cylinder ) + namespace castor3d { Cylinder::Cylinder() @@ -18,7 +20,7 @@ namespace castor3d MeshGeneratorUPtr Cylinder::create() { - return std::make_unique< Cylinder >(); + return castor::makeUniqueDerived< MeshGenerator, Cylinder >(); } void Cylinder::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Icosahedron.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Icosahedron.cpp index e3508c5fd2..6c9b2ca242 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Icosahedron.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Icosahedron.cpp @@ -9,6 +9,8 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" +CU_ImplementSmartPtr( castor3d, Icosahedron ) + namespace castor3d { Icosahedron::Icosahedron() @@ -20,7 +22,7 @@ namespace castor3d MeshGeneratorUPtr Icosahedron::create() { - return std::make_unique< Icosahedron >(); + return castor::makeUniqueDerived< MeshGenerator, Icosahedron >(); } void Icosahedron::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Plane.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Plane.cpp index d1762236f3..fb914ecf61 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Plane.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Plane.cpp @@ -5,6 +5,8 @@ #include "Castor3D/Model/Vertex.hpp" #include "Castor3D/Miscellaneous/Parameter.hpp" +CU_ImplementSmartPtr( castor3d, Plane ) + namespace castor3d { Plane::Plane() @@ -14,7 +16,7 @@ namespace castor3d MeshGeneratorUPtr Plane::create() { - return std::make_unique< Plane >(); + return castor::makeUniqueDerived< MeshGenerator, Plane >(); } void Plane::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Projection.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Projection.cpp index ee0981affd..906ea1197e 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Projection.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Projection.cpp @@ -3,6 +3,8 @@ #include "Castor3D/Model/Mesh/Submesh/Submesh.hpp" #include "Castor3D/Model/Vertex.hpp" +CU_ImplementSmartPtr( castor3d, Projection ) + namespace castor3d { Projection::Projection() @@ -15,7 +17,7 @@ namespace castor3d MeshGeneratorUPtr Projection::create() { - return std::make_unique< Projection >(); + return castor::makeUniqueDerived< MeshGenerator, Projection >(); } void Projection::setPoints( Pattern< castor::Point3f > const & pattern diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Sphere.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Sphere.cpp index e262d67f51..257c4788ca 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Sphere.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Sphere.cpp @@ -7,6 +7,8 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" +CU_ImplementSmartPtr( castor3d, Sphere ) + namespace castor3d { Sphere::Sphere() @@ -18,7 +20,7 @@ namespace castor3d MeshGeneratorUPtr Sphere::create() { - return std::make_unique< Sphere >(); + return castor::makeUniqueDerived< MeshGenerator, Sphere >(); } void Sphere::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/SphereSection.cpp b/source/Core/Castor3D/Model/Mesh/Generator/SphereSection.cpp index fa9297dbe2..774aa38016 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/SphereSection.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/SphereSection.cpp @@ -7,6 +7,8 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" +CU_ImplementSmartPtr( castor3d, SphereSection ) + namespace castor3d { SphereSection::SphereSection() @@ -19,7 +21,7 @@ namespace castor3d MeshGeneratorUPtr SphereSection::create() { - return std::make_unique< SphereSection >(); + return castor::makeUniqueDerived< MeshGenerator, SphereSection >(); } void SphereSection::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Generator/Torus.cpp b/source/Core/Castor3D/Model/Mesh/Generator/Torus.cpp index 1237eea0be..94790abcb4 100644 --- a/source/Core/Castor3D/Model/Mesh/Generator/Torus.cpp +++ b/source/Core/Castor3D/Model/Mesh/Generator/Torus.cpp @@ -6,6 +6,8 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" +CU_ImplementSmartPtr( castor3d, Torus ) + namespace castor3d { Torus::Torus() @@ -19,7 +21,7 @@ namespace castor3d MeshGeneratorUPtr Torus::create() { - return std::make_unique< Torus >(); + return castor::makeUniqueDerived< MeshGenerator, Torus >(); } void Torus::doGenerate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/Mesh.cpp b/source/Core/Castor3D/Model/Mesh/Mesh.cpp index 5ba5fad33c..566078a2bc 100644 --- a/source/Core/Castor3D/Model/Mesh/Mesh.cpp +++ b/source/Core/Castor3D/Model/Mesh/Mesh.cpp @@ -8,7 +8,8 @@ #include "Castor3D/Render/RenderSystem.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, MeshCache ) +CU_ImplementSmartPtr( castor3d, MeshCache ) +CU_ImplementSmartPtr( castor3d, Mesh ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/MeshFactory.cpp b/source/Core/Castor3D/Model/Mesh/MeshFactory.cpp index 86e30cb6da..7457ca080c 100644 --- a/source/Core/Castor3D/Model/Mesh/MeshFactory.cpp +++ b/source/Core/Castor3D/Model/Mesh/MeshFactory.cpp @@ -10,12 +10,12 @@ #include "Castor3D/Model/Mesh/Generator/SphereSection.hpp" #include "Castor3D/Model/Mesh/Generator/Torus.hpp" -CU_ImplementCUSmartPtr( castor3d, MeshFactory ) +CU_ImplementSmartPtr( castor3d, MeshFactory ) namespace castor3d { MeshFactory::MeshFactory() - : Factory < MeshGenerator, castor::String, std::unique_ptr< MeshGenerator > > {} + : Factory< MeshGenerator, castor::String, castor::UniquePtr< MeshGenerator > > {} { registerType( cuT( "cone" ), Cone::create ); registerType( cuT( "cube" ), Cube::create ); diff --git a/source/Core/Castor3D/Model/Mesh/MeshGenerator.cpp b/source/Core/Castor3D/Model/Mesh/MeshGenerator.cpp index 0c9d2d2982..5d9c076835 100644 --- a/source/Core/Castor3D/Model/Mesh/MeshGenerator.cpp +++ b/source/Core/Castor3D/Model/Mesh/MeshGenerator.cpp @@ -10,6 +10,8 @@ #include "Castor3D/Event/Frame/GpuFunctorEvent.hpp" #include "Castor3D/Scene/Scene.hpp" +CU_ImplementSmartPtr( castor3d, MeshGenerator ) + namespace castor3d { MeshGenerator::MeshGenerator( castor::String const & meshType ) @@ -23,7 +25,7 @@ namespace castor3d MeshGeneratorUPtr MeshGenerator::create() { - return std::make_unique< MeshGenerator >( cuT( "custom" ) ); + return castor::makeUnique< MeshGenerator >( cuT( "custom" ) ); } void MeshGenerator::generate( Mesh & mesh, Parameters const & parameters ) diff --git a/source/Core/Castor3D/Model/Mesh/MeshImporter.cpp b/source/Core/Castor3D/Model/Mesh/MeshImporter.cpp index 7cb00a6e21..cb636ea440 100644 --- a/source/Core/Castor3D/Model/Mesh/MeshImporter.cpp +++ b/source/Core/Castor3D/Model/Mesh/MeshImporter.cpp @@ -10,6 +10,8 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/SceneImporter.hpp" +CU_ImplementSmartPtr( castor3d, MeshImporter ) + namespace castor3d { namespace meshimp diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/IndexMapping.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/IndexMapping.cpp index d91738aa93..a7fb019295 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/IndexMapping.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/IndexMapping.cpp @@ -1,6 +1,6 @@ #include "Castor3D/Model/Mesh/Submesh/Component/IndexMapping.hpp" -CU_ImplementCUSmartPtr( castor3d, IndexMapping ) +CU_ImplementSmartPtr( castor3d, IndexMapping ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/InstantiationComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/InstantiationComponent.cpp index 874306a496..19ef15cfc3 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/InstantiationComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/InstantiationComponent.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, InstantiationComponent ) +CU_ImplementSmartPtr( castor3d, InstantiationComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/LinesMapping.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/LinesMapping.cpp index aef9c227f0..cc1fc76ac1 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/LinesMapping.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/LinesMapping.cpp @@ -12,7 +12,7 @@ //************************************************************************************************* -CU_ImplementCUSmartPtr( castor3d, LinesMapping ) +CU_ImplementSmartPtr( castor3d, LinesMapping ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/MeshletComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/MeshletComponent.cpp index e3566f0b7e..fa3c25ad2d 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/MeshletComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/MeshletComponent.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, MeshletComponent ) +CU_ImplementSmartPtr( castor3d, MeshletComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/MorphComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/MorphComponent.cpp index 42a738be04..9d326aa0e0 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/MorphComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/MorphComponent.cpp @@ -16,7 +16,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, MorphComponent ) +CU_ImplementSmartPtr( castor3d, MorphComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/PassMasksComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/PassMasksComponent.cpp index ba89a11fe1..ba4bfea3c9 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/PassMasksComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/PassMasksComponent.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PassMasksComponent ) +CU_ImplementSmartPtr( castor3d, PassMasksComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/SkinComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/SkinComponent.cpp index 5c061ddc65..01f5bf9339 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/SkinComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/SkinComponent.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SkinComponent ) +CU_ImplementSmartPtr( castor3d, SkinComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/SubmeshComponent.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/SubmeshComponent.cpp index 1d494b07d1..d2f50c8d42 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/SubmeshComponent.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/SubmeshComponent.cpp @@ -1,6 +1,6 @@ #include "Castor3D/Model/Mesh/Submesh/Component/SubmeshComponent.hpp" -CU_ImplementCUSmartPtr( castor3d, SubmeshComponent ) +CU_ImplementSmartPtr( castor3d, SubmeshComponent ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Component/TriFaceMapping.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Component/TriFaceMapping.cpp index e3918bbc98..b315cd8cd0 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Component/TriFaceMapping.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Component/TriFaceMapping.cpp @@ -15,7 +15,7 @@ //************************************************************************************************* -CU_ImplementCUSmartPtr( castor3d, TriFaceMapping ) +CU_ImplementSmartPtr( castor3d, TriFaceMapping ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Mesh/Submesh/Submesh.cpp b/source/Core/Castor3D/Model/Mesh/Submesh/Submesh.cpp index 1b88bbf4d5..2ec5f1cfc4 100644 --- a/source/Core/Castor3D/Model/Mesh/Submesh/Submesh.cpp +++ b/source/Core/Castor3D/Model/Mesh/Submesh/Submesh.cpp @@ -21,7 +21,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, Submesh ) +CU_ImplementSmartPtr( castor3d, Submesh ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimation.cpp b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimation.cpp index b33952182a..6213140db9 100644 --- a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimation.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimation.cpp @@ -6,7 +6,7 @@ #include "Castor3D/Model/Skeleton/BoneNode.hpp" #include "Castor3D/Animation/Animable.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimation ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimation ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationBone.cpp b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationBone.cpp index c0f7c0c5a5..6d3ce01d4b 100644 --- a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationBone.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationBone.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Model/Skeleton/BoneNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationBone ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationBone ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationKeyFrame.cpp b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationKeyFrame.cpp index 631d1a0d64..8c9535b732 100644 --- a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationKeyFrame.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationKeyFrame.cpp @@ -6,7 +6,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationKeyFrame ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationKeyFrame ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationNode.cpp b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationNode.cpp index 397768ffd9..3be7b83d7f 100644 --- a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationNode.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationNode.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Model/Skeleton/SkeletonNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationNode ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationObject.cpp b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationObject.cpp index 099ba2e063..2a84716c6d 100644 --- a/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationObject.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Animation/SkeletonAnimationObject.cpp @@ -1,6 +1,6 @@ #include "Castor3D/Model/Skeleton/Animation/SkeletonAnimationObject.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationObject ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationObject ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/BoneNode.cpp b/source/Core/Castor3D/Model/Skeleton/BoneNode.cpp index 9eb608983f..a50a2a6ba9 100644 --- a/source/Core/Castor3D/Model/Skeleton/BoneNode.cpp +++ b/source/Core/Castor3D/Model/Skeleton/BoneNode.cpp @@ -5,7 +5,7 @@ #include "Castor3D/Model/Mesh/Submesh/Submesh.hpp" #include "Castor3D/Model/Mesh/Submesh/Component/SkinComponent.hpp" -CU_ImplementCUSmartPtr( castor3d, BoneNode ) +CU_ImplementSmartPtr( castor3d, BoneNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/Skeleton.cpp b/source/Core/Castor3D/Model/Skeleton/Skeleton.cpp index 3be95fd1d7..67a9335c23 100644 --- a/source/Core/Castor3D/Model/Skeleton/Skeleton.cpp +++ b/source/Core/Castor3D/Model/Skeleton/Skeleton.cpp @@ -6,8 +6,8 @@ #include "Castor3D/Model/Skeleton/Animation/SkeletonAnimation.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonCache ) -CU_ImplementCUSmartPtr( castor3d, Skeleton ) +CU_ImplementSmartPtr( castor3d, SkeletonCache ) +CU_ImplementSmartPtr( castor3d, Skeleton ) namespace castor3d { diff --git a/source/Core/Castor3D/Model/Skeleton/SkeletonImporter.cpp b/source/Core/Castor3D/Model/Skeleton/SkeletonImporter.cpp index b30afb6acd..2bf4d3c1aa 100644 --- a/source/Core/Castor3D/Model/Skeleton/SkeletonImporter.cpp +++ b/source/Core/Castor3D/Model/Skeleton/SkeletonImporter.cpp @@ -6,6 +6,8 @@ #include "Castor3D/Model/Skeleton/BoneNode.hpp" #include "Castor3D/Scene/SceneImporter.hpp" +CU_ImplementSmartPtr( castor3d, SkeletonImporter ) + namespace castor3d { namespace skelimp diff --git a/source/Core/Castor3D/Model/Skeleton/SkeletonNode.cpp b/source/Core/Castor3D/Model/Skeleton/SkeletonNode.cpp index c0304789d0..6207a77fd5 100644 --- a/source/Core/Castor3D/Model/Skeleton/SkeletonNode.cpp +++ b/source/Core/Castor3D/Model/Skeleton/SkeletonNode.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Model/Skeleton/Skeleton.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonNode ) +CU_ImplementSmartPtr( castor3d, SkeletonNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/BorderPanelOverlay.cpp b/source/Core/Castor3D/Overlay/BorderPanelOverlay.cpp index 5dc8fbbf7c..5f4c3276ca 100644 --- a/source/Core/Castor3D/Overlay/BorderPanelOverlay.cpp +++ b/source/Core/Castor3D/Overlay/BorderPanelOverlay.cpp @@ -11,7 +11,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, BorderPanelOverlay ) +CU_ImplementSmartPtr( castor3d, BorderPanelOverlay ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/DebugOverlays.cpp b/source/Core/Castor3D/Overlay/DebugOverlays.cpp index 9816a8ca99..e098079929 100644 --- a/source/Core/Castor3D/Overlay/DebugOverlays.cpp +++ b/source/Core/Castor3D/Overlay/DebugOverlays.cpp @@ -22,7 +22,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, DebugOverlays ) +CU_ImplementSmartPtr( castor3d, DebugOverlays ) //********************************************************************************************* diff --git a/source/Core/Castor3D/Overlay/FontTexture.cpp b/source/Core/Castor3D/Overlay/FontTexture.cpp index d655070e3a..afcc3de9c3 100644 --- a/source/Core/Castor3D/Overlay/FontTexture.cpp +++ b/source/Core/Castor3D/Overlay/FontTexture.cpp @@ -12,7 +12,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, FontTexture ) +CU_ImplementSmartPtr( castor3d, FontTexture ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/Overlay.cpp b/source/Core/Castor3D/Overlay/Overlay.cpp index 90fc525fb2..00bb5e0f24 100644 --- a/source/Core/Castor3D/Overlay/Overlay.cpp +++ b/source/Core/Castor3D/Overlay/Overlay.cpp @@ -7,7 +7,7 @@ #include "Castor3D/Overlay/TextOverlay.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, Overlay ) +CU_ImplementSmartPtr( castor3d, Overlay ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/OverlayCategory.cpp b/source/Core/Castor3D/Overlay/OverlayCategory.cpp index 3cf4c1e5e6..e283be8186 100644 --- a/source/Core/Castor3D/Overlay/OverlayCategory.cpp +++ b/source/Core/Castor3D/Overlay/OverlayCategory.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Overlay/TextOverlay.hpp" #include "Castor3D/Render/Overlays/OverlayRenderer.hpp" -CU_ImplementCUSmartPtr( castor3d, OverlayCategory ) +CU_ImplementSmartPtr( castor3d, OverlayCategory ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/OverlayFactory.cpp b/source/Core/Castor3D/Overlay/OverlayFactory.cpp index dc74533079..6b782c8c55 100644 --- a/source/Core/Castor3D/Overlay/OverlayFactory.cpp +++ b/source/Core/Castor3D/Overlay/OverlayFactory.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Overlay/BorderPanelOverlay.hpp" #include "Castor3D/Overlay/TextOverlay.hpp" -CU_ImplementCUSmartPtr( castor3d, OverlayFactory ) +CU_ImplementSmartPtr( castor3d, OverlayFactory ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/PanelOverlay.cpp b/source/Core/Castor3D/Overlay/PanelOverlay.cpp index c65e95a601..9756a50fac 100644 --- a/source/Core/Castor3D/Overlay/PanelOverlay.cpp +++ b/source/Core/Castor3D/Overlay/PanelOverlay.cpp @@ -10,7 +10,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PanelOverlay ) +CU_ImplementSmartPtr( castor3d, PanelOverlay ) namespace castor3d { diff --git a/source/Core/Castor3D/Overlay/TextOverlay.cpp b/source/Core/Castor3D/Overlay/TextOverlay.cpp index c958c3b464..46921cd2b1 100644 --- a/source/Core/Castor3D/Overlay/TextOverlay.cpp +++ b/source/Core/Castor3D/Overlay/TextOverlay.cpp @@ -19,7 +19,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, TextOverlay ) +CU_ImplementSmartPtr( castor3d, TextOverlay ) #if defined( drawText ) # undef drawText diff --git a/source/Core/Castor3D/Plugin/DividerPlugin.cpp b/source/Core/Castor3D/Plugin/DividerPlugin.cpp index 8a29bf6648..6969f3256b 100644 --- a/source/Core/Castor3D/Plugin/DividerPlugin.cpp +++ b/source/Core/Castor3D/Plugin/DividerPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, DividerPlugin ) +CU_ImplementSmartPtr( castor3d, DividerPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/GeneratorPlugin.cpp b/source/Core/Castor3D/Plugin/GeneratorPlugin.cpp index 30333c7ddd..857794e1a2 100644 --- a/source/Core/Castor3D/Plugin/GeneratorPlugin.cpp +++ b/source/Core/Castor3D/Plugin/GeneratorPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, GeneratorPlugin ) +CU_ImplementSmartPtr( castor3d, GeneratorPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/GenericPlugin.cpp b/source/Core/Castor3D/Plugin/GenericPlugin.cpp index a0e839b338..53abfb5c05 100644 --- a/source/Core/Castor3D/Plugin/GenericPlugin.cpp +++ b/source/Core/Castor3D/Plugin/GenericPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, GenericPlugin ) +CU_ImplementSmartPtr( castor3d, GenericPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/ImporterPlugin.cpp b/source/Core/Castor3D/Plugin/ImporterPlugin.cpp index 521ca1964c..00ad7bfd47 100644 --- a/source/Core/Castor3D/Plugin/ImporterPlugin.cpp +++ b/source/Core/Castor3D/Plugin/ImporterPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ImporterPlugin ) +CU_ImplementSmartPtr( castor3d, ImporterPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/ParticlePlugin.cpp b/source/Core/Castor3D/Plugin/ParticlePlugin.cpp index a46d886264..e17e31d28d 100644 --- a/source/Core/Castor3D/Plugin/ParticlePlugin.cpp +++ b/source/Core/Castor3D/Plugin/ParticlePlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ParticlePlugin ) +CU_ImplementSmartPtr( castor3d, ParticlePlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/Plugin.cpp b/source/Core/Castor3D/Plugin/Plugin.cpp index 46f4ce121b..3cb9426945 100644 --- a/source/Core/Castor3D/Plugin/Plugin.cpp +++ b/source/Core/Castor3D/Plugin/Plugin.cpp @@ -7,7 +7,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, Plugin ) +CU_ImplementSmartPtr( castor3d, Plugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/PostFxPlugin.cpp b/source/Core/Castor3D/Plugin/PostFxPlugin.cpp index 9fd3a41f3b..d4ed5d5558 100644 --- a/source/Core/Castor3D/Plugin/PostFxPlugin.cpp +++ b/source/Core/Castor3D/Plugin/PostFxPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PostFxPlugin ) +CU_ImplementSmartPtr( castor3d, PostFxPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Plugin/ToneMappingPlugin.cpp b/source/Core/Castor3D/Plugin/ToneMappingPlugin.cpp index a61ee0b249..0a3fc5b8b5 100644 --- a/source/Core/Castor3D/Plugin/ToneMappingPlugin.cpp +++ b/source/Core/Castor3D/Plugin/ToneMappingPlugin.cpp @@ -2,7 +2,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ToneMappingPlugin ) +CU_ImplementSmartPtr( castor3d, ToneMappingPlugin ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Culling/SceneCuller.cpp b/source/Core/Castor3D/Render/Culling/SceneCuller.cpp index ee6e7d7c9c..9fced945b4 100644 --- a/source/Core/Castor3D/Render/Culling/SceneCuller.cpp +++ b/source/Core/Castor3D/Render/Culling/SceneCuller.cpp @@ -30,7 +30,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, SceneCuller ) +CU_ImplementSmartPtr( castor3d, SceneCuller ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.cpp b/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.cpp index f1ed137ed2..53f4e5f595 100644 --- a/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.cpp +++ b/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMap.cpp @@ -28,6 +28,8 @@ #include +CU_ImplementSmartPtr( castor3d, EnvironmentMap ) + namespace castor3d { namespace envmap @@ -113,12 +115,12 @@ namespace castor3d ++i; } - return { std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[0] ), index, CubeMapFace::ePositiveX, background ) - , std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[1] ), index, CubeMapFace::eNegativeX, background ) - , std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[2] ), index, CubeMapFace::ePositiveY, background ) - , std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[3] ), index, CubeMapFace::eNegativeY, background ) - , std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[4] ), index, CubeMapFace::ePositiveZ, background ) - , std::make_unique< EnvironmentMapPass >( graph, device, map, std::move( nodes[5] ), index, CubeMapFace::eNegativeZ, background ) }; + return { castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[0] ), index, CubeMapFace::ePositiveX, background ) + , castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[1] ), index, CubeMapFace::eNegativeX, background ) + , castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[2] ), index, CubeMapFace::ePositiveY, background ) + , castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[3] ), index, CubeMapFace::eNegativeY, background ) + , castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[4] ), index, CubeMapFace::ePositiveZ, background ) + , castor::makeUnique< EnvironmentMapPass >( graph, device, map, std::move( nodes[5] ), index, CubeMapFace::eNegativeZ, background ) }; } static std::vector< ashes::ImageView > createViews( Texture const & envMap @@ -197,6 +199,7 @@ namespace castor3d } ) } { m_environmentMap.create(); + m_depthBuffer.create(); m_environmentMapViews = envmap::createViews( m_environmentMap, m_image ); auto commandBuffer = queueData.commandPool->createCommandBuffer( "Env" + scene.getName() + "InitialiseViews" ); commandBuffer->begin(); @@ -226,6 +229,7 @@ namespace castor3d m_passes.clear(); m_environmentMapViews.clear(); m_image.reset(); + m_depthBuffer.destroy(); m_environmentMap.destroy(); m_graphs.clear(); m_sortedNodes.clear(); diff --git a/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapPass.cpp b/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapPass.cpp index 5a0e71c3e0..eff604467d 100644 --- a/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapPass.cpp +++ b/source/Core/Castor3D/Render/EnvironmentMap/EnvironmentMapPass.cpp @@ -22,6 +22,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, EnvironmentMapPass ) + namespace castor3d { namespace envpass @@ -63,7 +65,7 @@ namespace castor3d , m_node{ std::move( faceNode ) } , m_index{ index } , m_face{ face } - , m_camera{ envpass::doCreateCamera( *faceNode, getOwner()->getSize() ) } + , m_camera{ envpass::doCreateCamera( *m_node, getOwner()->getSize() ) } , m_culler{ castor::makeUniqueDerived< SceneCuller, FrustumCuller >( *m_camera ) } , m_cameraUbo{ m_device } , m_hdrConfigUbo{ m_device } diff --git a/source/Core/Castor3D/Render/Frustum.cpp b/source/Core/Castor3D/Render/Frustum.cpp index 5547b69be3..5c20383817 100644 --- a/source/Core/Castor3D/Render/Frustum.cpp +++ b/source/Core/Castor3D/Render/Frustum.cpp @@ -6,7 +6,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, Frustum ) +CU_ImplementSmartPtr( castor3d, Frustum ) #define C3D_DisableFrustumCulling 0 diff --git a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/GeometryInjectionPass.cpp b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/GeometryInjectionPass.cpp index 5c5d345e77..1728f12471 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/GeometryInjectionPass.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/GeometryInjectionPass.cpp @@ -42,7 +42,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, GeometryInjectionPass ) +CU_ImplementSmartPtr( castor3d, GeometryInjectionPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightInjectionPass.cpp b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightInjectionPass.cpp index 09b4792763..a8ede24629 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightInjectionPass.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightInjectionPass.cpp @@ -43,7 +43,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, LightInjectionPass ) +CU_ImplementSmartPtr( castor3d, LightInjectionPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationPass.cpp b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationPass.cpp index e5efef1ecf..86b6b08207 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationPass.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationPass.cpp @@ -33,7 +33,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, LightPropagationPass ) +CU_ImplementSmartPtr( castor3d, LightPropagationPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.cpp b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.cpp index 46f13eaff3..ae011c286e 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumesModule.cpp @@ -3,10 +3,10 @@ #include "Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LayeredLightPropagationVolumes.hpp" #include "Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightPropagationVolumes.hpp" -CU_ImplementCUSmartPtr( castor3d, LightPropagationVolumes ) -CU_ImplementCUSmartPtr( castor3d, LightPropagationVolumesG ) -CU_ImplementCUSmartPtr( castor3d, LayeredLightPropagationVolumes ) -CU_ImplementCUSmartPtr( castor3d, LayeredLightPropagationVolumesG ) +CU_ImplementSmartPtr( castor3d, LightPropagationVolumes ) +CU_ImplementSmartPtr( castor3d, LightPropagationVolumesG ) +CU_ImplementSmartPtr( castor3d, LayeredLightPropagationVolumes ) +CU_ImplementSmartPtr( castor3d, LayeredLightPropagationVolumesG ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightVolumePassResult.cpp b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightVolumePassResult.cpp index 9138709024..9c7fb0e605 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightVolumePassResult.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/LightPropagationVolumes/LightVolumePassResult.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Render/RenderDevice.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, LightVolumePassResult ) +CU_ImplementSmartPtr( castor3d, LightVolumePassResult ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelBufferToTexture.cpp b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelBufferToTexture.cpp index 67a88a95ee..092ad4ee79 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelBufferToTexture.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelBufferToTexture.cpp @@ -22,7 +22,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, VoxelBufferToTexture ) +CU_ImplementSmartPtr( castor3d, VoxelBufferToTexture ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelSecondaryBounce.cpp b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelSecondaryBounce.cpp index 3c0937ca84..0b161ff67b 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelSecondaryBounce.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelSecondaryBounce.cpp @@ -27,7 +27,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, VoxelSecondaryBounce ) +CU_ImplementSmartPtr( castor3d, VoxelSecondaryBounce ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizePass.cpp b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizePass.cpp index cbf77c9171..e23a12a770 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizePass.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/VoxelizePass.cpp @@ -43,7 +43,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, VoxelizePass ) +CU_ImplementSmartPtr( castor3d, VoxelizePass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/Voxelizer.cpp b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/Voxelizer.cpp index 47e4df0cf8..fb00241a1b 100644 --- a/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/Voxelizer.cpp +++ b/source/Core/Castor3D/Render/GlobalIllumination/VoxelConeTracing/Voxelizer.cpp @@ -31,7 +31,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, Voxelizer ) +CU_ImplementSmartPtr( castor3d, Voxelizer ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Node/BillboardRenderNode.cpp b/source/Core/Castor3D/Render/Node/BillboardRenderNode.cpp index e51cb39753..7be0aeabe1 100644 --- a/source/Core/Castor3D/Render/Node/BillboardRenderNode.cpp +++ b/source/Core/Castor3D/Render/Node/BillboardRenderNode.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Scene/BillboardList.hpp" -CU_ImplementCUSmartPtr( castor3d, BillboardRenderNode ) +CU_ImplementSmartPtr( castor3d, BillboardRenderNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp b/source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp index 3918c4d21f..6ba8a8d7af 100644 --- a/source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp +++ b/source/Core/Castor3D/Render/Node/QueueRenderNodes.cpp @@ -34,7 +34,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, QueueRenderNodes ) +CU_ImplementSmartPtr( castor3d, QueueRenderNodes ) using ashes::operator==; using ashes::operator!=; diff --git a/source/Core/Castor3D/Render/Node/SceneRenderNodes.cpp b/source/Core/Castor3D/Render/Node/SceneRenderNodes.cpp index 651c8c3c7d..09082d4851 100644 --- a/source/Core/Castor3D/Render/Node/SceneRenderNodes.cpp +++ b/source/Core/Castor3D/Render/Node/SceneRenderNodes.cpp @@ -33,7 +33,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, SceneRenderNodes ) +CU_ImplementSmartPtr( castor3d, SceneRenderNodes ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Node/SubmeshRenderNode.cpp b/source/Core/Castor3D/Render/Node/SubmeshRenderNode.cpp index 3d014c441e..46aedf162a 100644 --- a/source/Core/Castor3D/Render/Node/SubmeshRenderNode.cpp +++ b/source/Core/Castor3D/Render/Node/SubmeshRenderNode.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Render/RenderDevice.hpp" #include "Castor3D/Scene/Geometry.hpp" -CU_ImplementCUSmartPtr( castor3d, SubmeshRenderNode ) +CU_ImplementSmartPtr( castor3d, SubmeshRenderNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/DeferredRendering.cpp b/source/Core/Castor3D/Render/Opaque/DeferredRendering.cpp index 5c1da10433..55cc802d11 100644 --- a/source/Core/Castor3D/Render/Opaque/DeferredRendering.cpp +++ b/source/Core/Castor3D/Render/Opaque/DeferredRendering.cpp @@ -23,7 +23,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, DeferredRendering ) +CU_ImplementSmartPtr( castor3d, DeferredRendering ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/IndirectLightingPass.cpp b/source/Core/Castor3D/Render/Opaque/IndirectLightingPass.cpp index cb7d3cad56..655f7d2676 100644 --- a/source/Core/Castor3D/Render/Opaque/IndirectLightingPass.cpp +++ b/source/Core/Castor3D/Render/Opaque/IndirectLightingPass.cpp @@ -32,7 +32,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, IndirectLightingPass ) +CU_ImplementSmartPtr( castor3d, IndirectLightingPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/Lighting/SubsurfaceScatteringPass.cpp b/source/Core/Castor3D/Render/Opaque/Lighting/SubsurfaceScatteringPass.cpp index bddd2e4c31..1843e107d2 100644 --- a/source/Core/Castor3D/Render/Opaque/Lighting/SubsurfaceScatteringPass.cpp +++ b/source/Core/Castor3D/Render/Opaque/Lighting/SubsurfaceScatteringPass.cpp @@ -43,7 +43,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SubsurfaceScatteringPass ) +CU_ImplementSmartPtr( castor3d, SubsurfaceScatteringPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/LightingPass.cpp b/source/Core/Castor3D/Render/Opaque/LightingPass.cpp index c8f65246e6..41f1881771 100644 --- a/source/Core/Castor3D/Render/Opaque/LightingPass.cpp +++ b/source/Core/Castor3D/Render/Opaque/LightingPass.cpp @@ -22,7 +22,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, LightingPass ) +CU_ImplementSmartPtr( castor3d, LightingPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/OpaquePassResult.cpp b/source/Core/Castor3D/Render/Opaque/OpaquePassResult.cpp index 2d80fa7f86..4c777ac71b 100644 --- a/source/Core/Castor3D/Render/Opaque/OpaquePassResult.cpp +++ b/source/Core/Castor3D/Render/Opaque/OpaquePassResult.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Render/RenderDevice.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, OpaquePassResult ) +CU_ImplementSmartPtr( castor3d, OpaquePassResult ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/OpaqueRendering.cpp b/source/Core/Castor3D/Render/Opaque/OpaqueRendering.cpp index 8c947c4b43..c98158a7a6 100644 --- a/source/Core/Castor3D/Render/Opaque/OpaqueRendering.cpp +++ b/source/Core/Castor3D/Render/Opaque/OpaqueRendering.cpp @@ -33,7 +33,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, OpaqueRendering ) +CU_ImplementSmartPtr( castor3d, OpaqueRendering ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/OpaqueResolvePass.cpp b/source/Core/Castor3D/Render/Opaque/OpaqueResolvePass.cpp index 936c82a4f2..516b1f9260 100644 --- a/source/Core/Castor3D/Render/Opaque/OpaqueResolvePass.cpp +++ b/source/Core/Castor3D/Render/Opaque/OpaqueResolvePass.cpp @@ -51,7 +51,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, OpaqueResolvePass ) +CU_ImplementSmartPtr( castor3d, OpaqueResolvePass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Opaque/VisibilityReorderPass.cpp b/source/Core/Castor3D/Render/Opaque/VisibilityReorderPass.cpp index a8e25a2795..3c4330ceae 100644 --- a/source/Core/Castor3D/Render/Opaque/VisibilityReorderPass.cpp +++ b/source/Core/Castor3D/Render/Opaque/VisibilityReorderPass.cpp @@ -17,7 +17,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, VisibilityReorderPass ) +CU_ImplementSmartPtr( castor3d, VisibilityReorderPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Overlays/OverlayRenderer.cpp b/source/Core/Castor3D/Render/Overlays/OverlayRenderer.cpp index 04eee2886a..0b928cf45d 100644 --- a/source/Core/Castor3D/Render/Overlays/OverlayRenderer.cpp +++ b/source/Core/Castor3D/Render/Overlays/OverlayRenderer.cpp @@ -39,7 +39,7 @@ See LICENSE file in root folder #include -CU_ImplementCUSmartPtr( castor3d, OverlayRenderer ) +CU_ImplementSmartPtr( castor3d, OverlayRenderer ) #pragma GCC diagnostic ignored "-Wclass-memaccess" @@ -237,7 +237,7 @@ namespace castor3d , cameraUbo , *baseDescriptorLayout , MaxOverlaysPerBuffer - , std::make_unique< OverlayTextBufferPool >( *device.renderSystem.getEngine() + , castor::makeUnique< OverlayTextBufferPool >( *device.renderSystem.getEngine() , "TextsGlyphs" , device ) ) } { diff --git a/source/Core/Castor3D/Render/Overlays/OverlayTextBufferPool.cpp b/source/Core/Castor3D/Render/Overlays/OverlayTextBufferPool.cpp index 1a5c1f4d8a..ea0982799d 100644 --- a/source/Core/Castor3D/Render/Overlays/OverlayTextBufferPool.cpp +++ b/source/Core/Castor3D/Render/Overlays/OverlayTextBufferPool.cpp @@ -10,6 +10,8 @@ See LICENSE file in root folder #include #include +CU_ImplementSmartPtr( castor3d, OverlayTextBufferPool ) + namespace castor3d { //************************************************************************* diff --git a/source/Core/Castor3D/Render/PBR/IblTextures.cpp b/source/Core/Castor3D/Render/PBR/IblTextures.cpp index 9c1395b291..0fa037af2f 100644 --- a/source/Core/Castor3D/Render/PBR/IblTextures.cpp +++ b/source/Core/Castor3D/Render/PBR/IblTextures.cpp @@ -29,6 +29,8 @@ #include +CU_ImplementSmartPtr( castor3d, IblTextures ) + namespace castor3d { namespace ibltex diff --git a/source/Core/Castor3D/Render/Passes/BackgroundRenderer.cpp b/source/Core/Castor3D/Render/Passes/BackgroundRenderer.cpp index ab4039e422..85cda300f6 100644 --- a/source/Core/Castor3D/Render/Passes/BackgroundRenderer.cpp +++ b/source/Core/Castor3D/Render/Passes/BackgroundRenderer.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, BackgroundRenderer ) +CU_ImplementSmartPtr( castor3d, BackgroundRenderer ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Passes/DownscalePass.cpp b/source/Core/Castor3D/Render/Passes/DownscalePass.cpp index 6e59ba57c5..1a7676eec3 100644 --- a/source/Core/Castor3D/Render/Passes/DownscalePass.cpp +++ b/source/Core/Castor3D/Render/Passes/DownscalePass.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, DownscalePass ) +CU_ImplementSmartPtr( castor3d, DownscalePass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Passes/GaussianBlur.cpp b/source/Core/Castor3D/Render/Passes/GaussianBlur.cpp index 05c5847298..ccab289e86 100644 --- a/source/Core/Castor3D/Render/Passes/GaussianBlur.cpp +++ b/source/Core/Castor3D/Render/Passes/GaussianBlur.cpp @@ -21,7 +21,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, GaussianBlur ) +CU_ImplementSmartPtr( castor3d, GaussianBlur ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Passes/LineariseDepthPass.cpp b/source/Core/Castor3D/Render/Passes/LineariseDepthPass.cpp index 9b609e70cf..be7d977881 100644 --- a/source/Core/Castor3D/Render/Passes/LineariseDepthPass.cpp +++ b/source/Core/Castor3D/Render/Passes/LineariseDepthPass.cpp @@ -48,7 +48,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, LineariseDepthPass ) +CU_ImplementSmartPtr( castor3d, LineariseDepthPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Passes/PickingPass.cpp b/source/Core/Castor3D/Render/Passes/PickingPass.cpp index a0bfe75d96..2c56436ce0 100644 --- a/source/Core/Castor3D/Render/Passes/PickingPass.cpp +++ b/source/Core/Castor3D/Render/Passes/PickingPass.cpp @@ -46,7 +46,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PickingPass ) +CU_ImplementSmartPtr( castor3d, PickingPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Passes/RenderQuad.cpp b/source/Core/Castor3D/Render/Passes/RenderQuad.cpp index 83a9278086..d04534ea0b 100644 --- a/source/Core/Castor3D/Render/Passes/RenderQuad.cpp +++ b/source/Core/Castor3D/Render/Passes/RenderQuad.cpp @@ -34,7 +34,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, RenderQuad ) +CU_ImplementSmartPtr( castor3d, RenderQuad ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Picking.cpp b/source/Core/Castor3D/Render/Picking.cpp index 0bfaaa3304..89cd23d766 100644 --- a/source/Core/Castor3D/Render/Picking.cpp +++ b/source/Core/Castor3D/Render/Picking.cpp @@ -22,7 +22,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, Picking ) +CU_ImplementSmartPtr( castor3d, Picking ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/PostEffect/PostEffect.cpp b/source/Core/Castor3D/Render/PostEffect/PostEffect.cpp index 6f5e6ddc3c..cf424e5450 100644 --- a/source/Core/Castor3D/Render/PostEffect/PostEffect.cpp +++ b/source/Core/Castor3D/Render/PostEffect/PostEffect.cpp @@ -12,7 +12,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, PostEffect ) +CU_ImplementSmartPtr( castor3d, PostEffect ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Prepass/DepthPass.cpp b/source/Core/Castor3D/Render/Prepass/DepthPass.cpp index 6efaa27a5f..bd5d54f399 100644 --- a/source/Core/Castor3D/Render/Prepass/DepthPass.cpp +++ b/source/Core/Castor3D/Render/Prepass/DepthPass.cpp @@ -32,7 +32,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, DepthPass ) +CU_ImplementSmartPtr( castor3d, DepthPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Prepass/PrepassRendering.cpp b/source/Core/Castor3D/Render/Prepass/PrepassRendering.cpp index 45ecf9ca00..f9931e1d88 100644 --- a/source/Core/Castor3D/Render/Prepass/PrepassRendering.cpp +++ b/source/Core/Castor3D/Render/Prepass/PrepassRendering.cpp @@ -16,7 +16,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, PrepassRendering ) +CU_ImplementSmartPtr( castor3d, PrepassRendering ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Prepass/PrepassResult.cpp b/source/Core/Castor3D/Render/Prepass/PrepassResult.cpp index f3ec93d2ec..71d5c4fece 100644 --- a/source/Core/Castor3D/Render/Prepass/PrepassResult.cpp +++ b/source/Core/Castor3D/Render/Prepass/PrepassResult.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Render/RenderDevice.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, PrepassResult ) +CU_ImplementSmartPtr( castor3d, PrepassResult ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Prepass/VisibilityPass.cpp b/source/Core/Castor3D/Render/Prepass/VisibilityPass.cpp index 86c7ffb661..d1f7d822ad 100644 --- a/source/Core/Castor3D/Render/Prepass/VisibilityPass.cpp +++ b/source/Core/Castor3D/Render/Prepass/VisibilityPass.cpp @@ -31,7 +31,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, VisibilityPass ) +CU_ImplementSmartPtr( castor3d, VisibilityPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderDevice.cpp b/source/Core/Castor3D/Render/RenderDevice.cpp index 480544360b..b46d6fe0e8 100644 --- a/source/Core/Castor3D/Render/RenderDevice.cpp +++ b/source/Core/Castor3D/Render/RenderDevice.cpp @@ -15,7 +15,7 @@ #pragma GCC diagnostic ignored "-Wmissing-field-initializers" -CU_ImplementCUSmartPtr( castor3d, RenderDevice ) +CU_ImplementSmartPtr( castor3d, RenderDevice ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderLoop.cpp b/source/Core/Castor3D/Render/RenderLoop.cpp index eeba1eac5d..c63623cd17 100644 --- a/source/Core/Castor3D/Render/RenderLoop.cpp +++ b/source/Core/Castor3D/Render/RenderLoop.cpp @@ -24,7 +24,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, RenderLoop ) +CU_ImplementSmartPtr( castor3d, RenderLoop ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderNodesPass.cpp b/source/Core/Castor3D/Render/RenderNodesPass.cpp index 488a9fa418..482efafa72 100644 --- a/source/Core/Castor3D/Render/RenderNodesPass.cpp +++ b/source/Core/Castor3D/Render/RenderNodesPass.cpp @@ -67,6 +67,9 @@ #include #include +CU_ImplementSmartPtr( castor3d, RenderNodesPass ) +CU_ImplementSmartPtr( castor3d, IsRenderPassEnabled ) + namespace castor3d { //********************************************************************************************* diff --git a/source/Core/Castor3D/Render/RenderPipeline.cpp b/source/Core/Castor3D/Render/RenderPipeline.cpp index d19c51e725..c229ba512d 100644 --- a/source/Core/Castor3D/Render/RenderPipeline.cpp +++ b/source/Core/Castor3D/Render/RenderPipeline.cpp @@ -21,7 +21,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, RenderPipeline ) +CU_ImplementSmartPtr( castor3d, RenderPipeline ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderQueue.cpp b/source/Core/Castor3D/Render/RenderQueue.cpp index c3dbb0b868..88a14cfcd9 100644 --- a/source/Core/Castor3D/Render/RenderQueue.cpp +++ b/source/Core/Castor3D/Render/RenderQueue.cpp @@ -16,7 +16,7 @@ using ashes::operator==; using ashes::operator!=; -CU_ImplementCUSmartPtr( castor3d, RenderQueue ) +CU_ImplementSmartPtr( castor3d, RenderQueue ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderSystem.cpp b/source/Core/Castor3D/Render/RenderSystem.cpp index 19422d64f8..190fb850e0 100644 --- a/source/Core/Castor3D/Render/RenderSystem.cpp +++ b/source/Core/Castor3D/Render/RenderSystem.cpp @@ -38,7 +38,7 @@ # define C3D_DebugSpirV 0 #endif -CU_ImplementCUSmartPtr( castor3d, RenderSystem ) +CU_ImplementSmartPtr( castor3d, RenderSystem ) #pragma warning( disable: 4191 ) // Unsafe conversion from 'PFN_vkVoidFunction' to 'PFN_vkAnyOtherFunction' @@ -677,7 +677,7 @@ namespace castor3d , m_features.textureCompressionBC == VK_TRUE , false } ); - m_device = std::make_shared< RenderDevice >( *this + m_device = castor::makeUnique< RenderDevice >( *this , gpu , m_renderer.desc , std::move( pdeviceExtensions ) ); diff --git a/source/Core/Castor3D/Render/RenderTarget.cpp b/source/Core/Castor3D/Render/RenderTarget.cpp index fc4ca0abd2..208b899976 100644 --- a/source/Core/Castor3D/Render/RenderTarget.cpp +++ b/source/Core/Castor3D/Render/RenderTarget.cpp @@ -42,7 +42,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, RenderTarget ) +CU_ImplementSmartPtr( castor3d, RenderTarget ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderTechnique.cpp b/source/Core/Castor3D/Render/RenderTechnique.cpp index cbb27ee006..caa33bd8b1 100644 --- a/source/Core/Castor3D/Render/RenderTechnique.cpp +++ b/source/Core/Castor3D/Render/RenderTechnique.cpp @@ -50,7 +50,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, RenderTechnique ) +CU_ImplementSmartPtr( castor3d, RenderTechnique ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderTechniquePass.cpp b/source/Core/Castor3D/Render/RenderTechniquePass.cpp index d1753a6570..66649718d8 100644 --- a/source/Core/Castor3D/Render/RenderTechniquePass.cpp +++ b/source/Core/Castor3D/Render/RenderTechniquePass.cpp @@ -43,7 +43,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, RenderTechniquePass ) +CU_ImplementSmartPtr( castor3d, RenderTechniquePass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/RenderWindow.cpp b/source/Core/Castor3D/Render/RenderWindow.cpp index 641ea5b6bc..3418e9e804 100644 --- a/source/Core/Castor3D/Render/RenderWindow.cpp +++ b/source/Core/Castor3D/Render/RenderWindow.cpp @@ -49,7 +49,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, RenderWindow ) +CU_ImplementSmartPtr( castor3d, RenderWindow ) #define C3D_PersistLoadingScreen 1 @@ -1202,7 +1202,7 @@ namespace castor3d return; } - m_picking = std::make_shared< Picking >( m_resources + m_picking = castor::makeUnique< Picking >( m_resources , m_device , queueData , target->getSize() diff --git a/source/Core/Castor3D/Render/ShadowMap/ShadowMap.cpp b/source/Core/Castor3D/Render/ShadowMap/ShadowMap.cpp index 959c124080..4b7bbda0e4 100644 --- a/source/Core/Castor3D/Render/ShadowMap/ShadowMap.cpp +++ b/source/Core/Castor3D/Render/ShadowMap/ShadowMap.cpp @@ -18,7 +18,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, ShadowMap ) +CU_ImplementSmartPtr( castor3d, ShadowMap ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/ShadowMap/ShadowMapPass.cpp b/source/Core/Castor3D/Render/ShadowMap/ShadowMapPass.cpp index 51e682f648..55d155d685 100644 --- a/source/Core/Castor3D/Render/ShadowMap/ShadowMapPass.cpp +++ b/source/Core/Castor3D/Render/ShadowMap/ShadowMapPass.cpp @@ -20,7 +20,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ShadowMapPass ) +CU_ImplementSmartPtr( castor3d, ShadowMapPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Ssao/SsaoBlurPass.cpp b/source/Core/Castor3D/Render/Ssao/SsaoBlurPass.cpp index a47265e4ae..25c6532fb5 100644 --- a/source/Core/Castor3D/Render/Ssao/SsaoBlurPass.cpp +++ b/source/Core/Castor3D/Render/Ssao/SsaoBlurPass.cpp @@ -26,7 +26,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SsaoBlurPass ) +CU_ImplementSmartPtr( castor3d, SsaoBlurPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Ssao/SsaoPass.cpp b/source/Core/Castor3D/Render/Ssao/SsaoPass.cpp index 989c5f88cb..08234850ac 100644 --- a/source/Core/Castor3D/Render/Ssao/SsaoPass.cpp +++ b/source/Core/Castor3D/Render/Ssao/SsaoPass.cpp @@ -13,7 +13,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SsaoPass ) +CU_ImplementSmartPtr( castor3d, SsaoPass ) #define C3D_DebugRawPass 0 diff --git a/source/Core/Castor3D/Render/Ssao/SsaoRawAOPass.cpp b/source/Core/Castor3D/Render/Ssao/SsaoRawAOPass.cpp index 2e4e74c229..c6a7ad25b7 100644 --- a/source/Core/Castor3D/Render/Ssao/SsaoRawAOPass.cpp +++ b/source/Core/Castor3D/Render/Ssao/SsaoRawAOPass.cpp @@ -42,7 +42,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SsaoRawAOPass ) +CU_ImplementSmartPtr( castor3d, SsaoRawAOPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/ToTexture/EquirectangularToCube.cpp b/source/Core/Castor3D/Render/ToTexture/EquirectangularToCube.cpp index 7f48ab9c03..943636683e 100644 --- a/source/Core/Castor3D/Render/ToTexture/EquirectangularToCube.cpp +++ b/source/Core/Castor3D/Render/ToTexture/EquirectangularToCube.cpp @@ -24,6 +24,8 @@ #include +CU_ImplementSmartPtr( castor3d, EquirectangularToCube ) + namespace castor3d { //********************************************************************************************* diff --git a/source/Core/Castor3D/Render/ToTexture/RenderCube.cpp b/source/Core/Castor3D/Render/ToTexture/RenderCube.cpp index d88c64ffb2..5e3e2c0945 100644 --- a/source/Core/Castor3D/Render/ToTexture/RenderCube.cpp +++ b/source/Core/Castor3D/Render/ToTexture/RenderCube.cpp @@ -23,6 +23,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, RenderCube ) + namespace castor3d { namespace rendcube diff --git a/source/Core/Castor3D/Render/ToTexture/Texture3DTo2D.cpp b/source/Core/Castor3D/Render/ToTexture/Texture3DTo2D.cpp index 730c3461b5..dfe3a7f3df 100644 --- a/source/Core/Castor3D/Render/ToTexture/Texture3DTo2D.cpp +++ b/source/Core/Castor3D/Render/ToTexture/Texture3DTo2D.cpp @@ -38,7 +38,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, Texture3DTo2D ) +CU_ImplementSmartPtr( castor3d, Texture3DTo2D ) #define UBO_GRID( Writer, Binding )\ auto ubo = Writer.declUniformBuffer<>( "ubo", Binding, 0u );\ diff --git a/source/Core/Castor3D/Render/ToneMapping/ToneMapping.cpp b/source/Core/Castor3D/Render/ToneMapping/ToneMapping.cpp index cb54f3df95..735ff12608 100644 --- a/source/Core/Castor3D/Render/ToneMapping/ToneMapping.cpp +++ b/source/Core/Castor3D/Render/ToneMapping/ToneMapping.cpp @@ -18,7 +18,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ToneMapping ) +CU_ImplementSmartPtr( castor3d, ToneMapping ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transform/MeshletBoundsTransformPass.cpp b/source/Core/Castor3D/Render/Transform/MeshletBoundsTransformPass.cpp index d18acf0c18..649ddd1d95 100644 --- a/source/Core/Castor3D/Render/Transform/MeshletBoundsTransformPass.cpp +++ b/source/Core/Castor3D/Render/Transform/MeshletBoundsTransformPass.cpp @@ -17,7 +17,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, MeshletBoundsTransformPass ) +CU_ImplementSmartPtr( castor3d, MeshletBoundsTransformPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transform/VertexTransformPass.cpp b/source/Core/Castor3D/Render/Transform/VertexTransformPass.cpp index 8c096009ea..d59c156885 100644 --- a/source/Core/Castor3D/Render/Transform/VertexTransformPass.cpp +++ b/source/Core/Castor3D/Render/Transform/VertexTransformPass.cpp @@ -16,7 +16,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, VertexTransformPass ) +CU_ImplementSmartPtr( castor3d, VertexTransformPass ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transform/VertexTransforming.cpp b/source/Core/Castor3D/Render/Transform/VertexTransforming.cpp index 71cfb23a65..502ef3b654 100644 --- a/source/Core/Castor3D/Render/Transform/VertexTransforming.cpp +++ b/source/Core/Castor3D/Render/Transform/VertexTransforming.cpp @@ -28,7 +28,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, VertexTransforming ) +CU_ImplementSmartPtr( castor3d, VertexTransforming ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transparent/TransparentPassResult.cpp b/source/Core/Castor3D/Render/Transparent/TransparentPassResult.cpp index 4bd986d18b..cfa67bd8ac 100644 --- a/source/Core/Castor3D/Render/Transparent/TransparentPassResult.cpp +++ b/source/Core/Castor3D/Render/Transparent/TransparentPassResult.cpp @@ -4,7 +4,7 @@ #include "Castor3D/Material/Texture/TextureUnit.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, TransparentPassResult ) +CU_ImplementSmartPtr( castor3d, TransparentPassResult ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transparent/TransparentRendering.cpp b/source/Core/Castor3D/Render/Transparent/TransparentRendering.cpp index 6035822c6a..8735dffe30 100644 --- a/source/Core/Castor3D/Render/Transparent/TransparentRendering.cpp +++ b/source/Core/Castor3D/Render/Transparent/TransparentRendering.cpp @@ -20,7 +20,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, TransparentRendering ) +CU_ImplementSmartPtr( castor3d, TransparentRendering ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Transparent/WeightedBlendRendering.cpp b/source/Core/Castor3D/Render/Transparent/WeightedBlendRendering.cpp index 79bdbda7ce..c418da585b 100644 --- a/source/Core/Castor3D/Render/Transparent/WeightedBlendRendering.cpp +++ b/source/Core/Castor3D/Render/Transparent/WeightedBlendRendering.cpp @@ -18,7 +18,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, WeightedBlendRendering ) +CU_ImplementSmartPtr( castor3d, WeightedBlendRendering ) namespace castor3d { diff --git a/source/Core/Castor3D/Render/Viewport.cpp b/source/Core/Castor3D/Render/Viewport.cpp index 76c499f9b8..a8a5a4a331 100644 --- a/source/Core/Castor3D/Render/Viewport.cpp +++ b/source/Core/Castor3D/Render/Viewport.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Engine.hpp" #include "Castor3D/Render/RenderSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, Viewport ) +CU_ImplementSmartPtr( castor3d, Viewport ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedMesh.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedMesh.cpp index e9923d6176..7eee5932cf 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedMesh.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedMesh.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Scene/Animation/Mesh/MeshAnimationInstance.hpp" #include "Castor3D/Scene/Animation/Mesh/MeshAnimationInstanceSubmesh.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedMesh ) +CU_ImplementSmartPtr( castor3d, AnimatedMesh ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedObject.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedObject.cpp index 8336b2a1ae..693aab0aad 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedObject.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedObject.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Model/Mesh/Mesh.hpp" #include "Castor3D/Scene/Geometry.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedObject ) +CU_ImplementSmartPtr( castor3d, AnimatedObject ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedObjectGroup.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedObjectGroup.cpp index bf14b8153e..535bf85d50 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedObjectGroup.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedObjectGroup.cpp @@ -13,7 +13,7 @@ #include "Castor3D/Scene/Animation/AnimatedTexture.hpp" #include "Castor3D/Scene/Geometry.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedObjectGroup ) +CU_ImplementSmartPtr( castor3d, AnimatedObjectGroup ) namespace castor3d { @@ -135,7 +135,7 @@ namespace castor3d { m_objects.emplace( name, std::move( object ) ); - switch ( object->getKind() ) + switch ( obj->getKind() ) { case AnimationType::eSceneNode: onSceneNodeAdded( *this, static_cast< AnimatedSceneNode & >( *obj ) ); diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedSceneNode.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedSceneNode.cpp index 463e995ad1..971d17fdbf 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedSceneNode.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedSceneNode.cpp @@ -7,7 +7,7 @@ #include "Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationInstance.hpp" #include "Castor3D/Shader/Shaders/SdwModule.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedSceneNode ) +CU_ImplementSmartPtr( castor3d, AnimatedSceneNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedSkeleton.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedSkeleton.cpp index 9c2abab174..cc3e0e8ec7 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedSkeleton.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedSkeleton.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstance.hpp" #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceObject.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedSkeleton ) +CU_ImplementSmartPtr( castor3d, AnimatedSkeleton ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimatedTexture.cpp b/source/Core/Castor3D/Scene/Animation/AnimatedTexture.cpp index 2844c783a3..7784fc53ad 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimatedTexture.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimatedTexture.cpp @@ -10,7 +10,7 @@ #include "Castor3D/Scene/Animation/Texture/TextureAnimationInstance.hpp" #include "Castor3D/Shader/Shaders/SdwModule.hpp" -CU_ImplementCUSmartPtr( castor3d, AnimatedTexture ) +CU_ImplementSmartPtr( castor3d, AnimatedTexture ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/AnimationInstance.cpp b/source/Core/Castor3D/Scene/Animation/AnimationInstance.cpp index d4a883bbc6..da735ea706 100644 --- a/source/Core/Castor3D/Scene/Animation/AnimationInstance.cpp +++ b/source/Core/Castor3D/Scene/Animation/AnimationInstance.cpp @@ -3,9 +3,9 @@ #include "Castor3D/Animation/Animable.hpp" #include "Castor3D/Animation/Animation.hpp" -CU_ImplementCUSmartPtr( castor3d, Animable ) -CU_ImplementCUSmartPtr( castor3d, Animation ) -CU_ImplementCUSmartPtr( castor3d, AnimationInstance ) +CU_ImplementSmartPtr( castor3d, Animable ) +CU_ImplementSmartPtr( castor3d, Animation ) +CU_ImplementSmartPtr( castor3d, AnimationInstance ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationInstance.cpp b/source/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationInstance.cpp index a7ff6ba48c..708a0ee158 100644 --- a/source/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationInstance.cpp +++ b/source/Core/Castor3D/Scene/Animation/Mesh/MeshAnimationInstance.cpp @@ -8,6 +8,8 @@ #include "Castor3D/Scene/Animation/AnimatedMesh.hpp" #include "Castor3D/Scene/Animation/Mesh/MeshAnimationInstanceSubmesh.hpp" +CU_ImplementSmartPtr( castor3d, MeshAnimationInstance ) + namespace castor3d { //************************************************************************************************* diff --git a/source/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationInstance.cpp b/source/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationInstance.cpp index e7fe5417c0..29c679b1e1 100644 --- a/source/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationInstance.cpp +++ b/source/Core/Castor3D/Scene/Animation/SceneNode/SceneNodeAnimationInstance.cpp @@ -6,6 +6,8 @@ #include "Castor3D/Scene/Animation/SceneNodeAnimation.hpp" #include "Castor3D/Scene/Animation/SceneNodeAnimationKeyFrame.hpp" +CU_ImplementSmartPtr( castor3d, SceneNodeAnimationInstance ) + namespace castor3d { SceneNodeAnimationInstance::SceneNodeAnimationInstance( AnimatedSceneNode & object diff --git a/source/Core/Castor3D/Scene/Animation/SceneNodeAnimation.cpp b/source/Core/Castor3D/Scene/Animation/SceneNodeAnimation.cpp index 7cc36a9988..bc4603bfee 100644 --- a/source/Core/Castor3D/Scene/Animation/SceneNodeAnimation.cpp +++ b/source/Core/Castor3D/Scene/Animation/SceneNodeAnimation.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Scene/SceneNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SceneNodeAnimation ) +CU_ImplementSmartPtr( castor3d, SceneNodeAnimation ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/SceneNodeAnimationKeyFrame.cpp b/source/Core/Castor3D/Scene/Animation/SceneNodeAnimationKeyFrame.cpp index a23763b7f0..222ef15108 100644 --- a/source/Core/Castor3D/Scene/Animation/SceneNodeAnimationKeyFrame.cpp +++ b/source/Core/Castor3D/Scene/Animation/SceneNodeAnimationKeyFrame.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Scene/Animation/SceneNodeAnimation.hpp" -CU_ImplementCUSmartPtr( castor3d, SceneNodeAnimationKeyFrame ) +CU_ImplementSmartPtr( castor3d, SceneNodeAnimationKeyFrame ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstance.cpp b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstance.cpp index c803977c63..a4be00dc6c 100644 --- a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstance.cpp +++ b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstance.cpp @@ -10,7 +10,7 @@ #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.hpp" #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationInstance ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationInstance ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.cpp b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.cpp index 6d3c4ae198..c57cac45b3 100644 --- a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.cpp +++ b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Model/Skeleton/Animation/SkeletonAnimationBone.hpp" #include "Castor3D/Model/Skeleton/BoneNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationInstanceBone ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationInstanceBone ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.cpp b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.cpp index 1bf6d9a40b..de1dc70699 100644 --- a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.cpp +++ b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Model/Skeleton/Animation/SkeletonAnimationNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationInstanceNode ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationInstanceNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceObject.cpp b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceObject.cpp index 8c7c1f6588..05abe310e4 100644 --- a/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceObject.cpp +++ b/source/Core/Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceObject.cpp @@ -5,7 +5,7 @@ #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceBone.hpp" #include "Castor3D/Scene/Animation/Skeleton/SkeletonAnimationInstanceNode.hpp" -CU_ImplementCUSmartPtr( castor3d, SkeletonAnimationInstanceObject ) +CU_ImplementSmartPtr( castor3d, SkeletonAnimationInstanceObject ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Animation/Texture/TextureAnimationInstance.cpp b/source/Core/Castor3D/Scene/Animation/Texture/TextureAnimationInstance.cpp index c1e780ca63..cd53a4ee65 100644 --- a/source/Core/Castor3D/Scene/Animation/Texture/TextureAnimationInstance.cpp +++ b/source/Core/Castor3D/Scene/Animation/Texture/TextureAnimationInstance.cpp @@ -6,6 +6,8 @@ #include "Castor3D/Material/Texture/Animation/TextureAnimationKeyFrame.hpp" #include "Castor3D/Scene/Animation/AnimatedTexture.hpp" +CU_ImplementSmartPtr( castor3d, TextureAnimationInstance ) + namespace castor3d { //************************************************************************************************* diff --git a/source/Core/Castor3D/Scene/Background/Background.cpp b/source/Core/Castor3D/Scene/Background/Background.cpp index 01e4a0917f..4e5b16f157 100644 --- a/source/Core/Castor3D/Scene/Background/Background.cpp +++ b/source/Core/Castor3D/Scene/Background/Background.cpp @@ -30,6 +30,8 @@ #include +CU_ImplementSmartPtr( castor3d, SceneBackground ) + namespace castor3d { //********************************************************************************************* diff --git a/source/Core/Castor3D/Scene/Background/Colour.cpp b/source/Core/Castor3D/Scene/Background/Colour.cpp index 06a8cd19fe..3a755e8043 100644 --- a/source/Core/Castor3D/Scene/Background/Colour.cpp +++ b/source/Core/Castor3D/Scene/Background/Colour.cpp @@ -19,6 +19,8 @@ #include #include +CU_ImplementSmartPtr( castor3d, ColourBackground ) + namespace castor3d { //************************************************************************************************ diff --git a/source/Core/Castor3D/Scene/Background/Image.cpp b/source/Core/Castor3D/Scene/Background/Image.cpp index ce04463917..2cdd8392ac 100644 --- a/source/Core/Castor3D/Scene/Background/Image.cpp +++ b/source/Core/Castor3D/Scene/Background/Image.cpp @@ -10,6 +10,8 @@ #include +CU_ImplementSmartPtr( castor3d, ImageBackground ) + namespace castor { using namespace castor3d; diff --git a/source/Core/Castor3D/Scene/Background/Skybox.cpp b/source/Core/Castor3D/Scene/Background/Skybox.cpp index a79a114856..fc619ae19c 100644 --- a/source/Core/Castor3D/Scene/Background/Skybox.cpp +++ b/source/Core/Castor3D/Scene/Background/Skybox.cpp @@ -24,6 +24,8 @@ #include +CU_ImplementSmartPtr( castor3d, SkyboxBackground ) + namespace castor { using namespace castor3d; diff --git a/source/Core/Castor3D/Scene/BillboardList.cpp b/source/Core/Castor3D/Scene/BillboardList.cpp index 769dbcd888..1fb5d32c44 100644 --- a/source/Core/Castor3D/Scene/BillboardList.cpp +++ b/source/Core/Castor3D/Scene/BillboardList.cpp @@ -9,8 +9,8 @@ #include "Castor3D/Render/Node/SceneRenderNodes.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, BillboardBase ) -CU_ImplementCUSmartPtr( castor3d, BillboardList ) +CU_ImplementSmartPtr( castor3d, BillboardBase ) +CU_ImplementSmartPtr( castor3d, BillboardList ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Camera.cpp b/source/Core/Castor3D/Scene/Camera.cpp index b17b6c1eb2..bec89bfc26 100644 --- a/source/Core/Castor3D/Scene/Camera.cpp +++ b/source/Core/Castor3D/Scene/Camera.cpp @@ -5,7 +5,7 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/SceneNode.hpp" -CU_ImplementCUSmartPtr( castor3d, Camera ) +CU_ImplementSmartPtr( castor3d, Camera ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Geometry.cpp b/source/Core/Castor3D/Scene/Geometry.cpp index d0d44d0b77..dde9f746c1 100644 --- a/source/Core/Castor3D/Scene/Geometry.cpp +++ b/source/Core/Castor3D/Scene/Geometry.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Render/Node/SceneRenderNodes.hpp" #include "Castor3D/Scene/Scene.hpp" -CU_ImplementCUSmartPtr( castor3d, Geometry ) +CU_ImplementSmartPtr( castor3d, Geometry ) namespace castor3d { @@ -77,7 +77,12 @@ namespace castor3d if ( auto mesh = getMesh() ) { auto lock( castor::makeUniqueLock( m_mutex ) ); - CU_Require( submesh.getId() < mesh->getSubmeshCount() ); + + if ( submesh.getId() < mesh->getSubmeshCount() ) + { + CU_Failure( "Geometry::setMaterial" ); + } + bool changed = false; MaterialObs oldMaterial{}; auto itSubMat = m_submeshesMaterials.find( &submesh ); @@ -95,7 +100,7 @@ namespace castor3d else if ( material ) { oldMaterial = submesh.getDefaultMaterial(); - CU_Require( &submesh.getParent() == mesh.get() ); + CU_Require( &submesh.getParent() == mesh ); m_submeshesMaterials.emplace( &submesh, material ); changed = true; } @@ -275,7 +280,7 @@ namespace castor3d for ( auto & submesh : *mesh ) { - CU_Require( &submesh->getParent() == mesh.get() ); + CU_Require( &submesh->getParent() == mesh ); auto material = submesh->getDefaultMaterial(); m_submeshesMaterials.emplace( submesh.get(), material ); m_submeshesBoxes.emplace( submesh.get(), submesh->getBoundingBox() ); diff --git a/source/Core/Castor3D/Scene/Light/DirectionalLight.cpp b/source/Core/Castor3D/Scene/Light/DirectionalLight.cpp index 3b29e69720..dded6b9f43 100644 --- a/source/Core/Castor3D/Scene/Light/DirectionalLight.cpp +++ b/source/Core/Castor3D/Scene/Light/DirectionalLight.cpp @@ -172,7 +172,7 @@ namespace castor3d LightCategoryUPtr DirectionalLight::create( Light & light ) { - return std::unique_ptr< DirectionalLight >( new DirectionalLight{ light } ); + return LightCategoryUPtr( new DirectionalLight{ light } ); } void DirectionalLight::update() diff --git a/source/Core/Castor3D/Scene/Light/Light.cpp b/source/Core/Castor3D/Scene/Light/Light.cpp index bca86e46e5..a215738404 100644 --- a/source/Core/Castor3D/Scene/Light/Light.cpp +++ b/source/Core/Castor3D/Scene/Light/Light.cpp @@ -7,7 +7,7 @@ #include "Castor3D/Scene/Light/PointLight.hpp" #include "Castor3D/Scene/Light/SpotLight.hpp" -CU_ImplementCUSmartPtr( castor3d, Light ) +CU_ImplementSmartPtr( castor3d, Light ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Light/LightCategory.cpp b/source/Core/Castor3D/Scene/Light/LightCategory.cpp index 48137a6782..c60977cc66 100644 --- a/source/Core/Castor3D/Scene/Light/LightCategory.cpp +++ b/source/Core/Castor3D/Scene/Light/LightCategory.cpp @@ -7,6 +7,8 @@ #include +CU_ImplementSmartPtr( castor3d, LightCategory ) + namespace castor3d { LightCategory::LightCategory( LightType lightType, Light & light ) diff --git a/source/Core/Castor3D/Scene/Light/LightFactory.cpp b/source/Core/Castor3D/Scene/Light/LightFactory.cpp index 55fd88e896..52b4a2f98e 100644 --- a/source/Core/Castor3D/Scene/Light/LightFactory.cpp +++ b/source/Core/Castor3D/Scene/Light/LightFactory.cpp @@ -4,6 +4,8 @@ #include "Castor3D/Scene/Light/PointLight.hpp" #include "Castor3D/Scene/Light/SpotLight.hpp" +CU_ImplementSmartPtr( castor3d, LightFactory ) + namespace castor3d { LightFactory::LightFactory() diff --git a/source/Core/Castor3D/Scene/Light/LightImporter.cpp b/source/Core/Castor3D/Scene/Light/LightImporter.cpp index 459f227bc4..a18d38ed51 100644 --- a/source/Core/Castor3D/Scene/Light/LightImporter.cpp +++ b/source/Core/Castor3D/Scene/Light/LightImporter.cpp @@ -5,6 +5,8 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/Light/Light.hpp" +CU_ImplementSmartPtr( castor3d, LightImporter ) + namespace castor3d { LightImporter::LightImporter( Engine & engine ) diff --git a/source/Core/Castor3D/Scene/Light/PointLight.cpp b/source/Core/Castor3D/Scene/Light/PointLight.cpp index b32ca9ce8d..31565a3b65 100644 --- a/source/Core/Castor3D/Scene/Light/PointLight.cpp +++ b/source/Core/Castor3D/Scene/Light/PointLight.cpp @@ -38,7 +38,7 @@ namespace castor3d LightCategoryUPtr PointLight::create( Light & light ) { - return std::unique_ptr< PointLight >( new PointLight{ light } ); + return LightCategoryUPtr( new PointLight{ light } ); } castor::Point3fArray const & PointLight::generateVertices() diff --git a/source/Core/Castor3D/Scene/Light/SpotLight.cpp b/source/Core/Castor3D/Scene/Light/SpotLight.cpp index 2b69c50328..58bb03b68a 100644 --- a/source/Core/Castor3D/Scene/Light/SpotLight.cpp +++ b/source/Core/Castor3D/Scene/Light/SpotLight.cpp @@ -37,7 +37,7 @@ namespace castor3d LightCategoryUPtr SpotLight::create( Light & light ) { - return std::unique_ptr< SpotLight >( new SpotLight{ light } ); + return LightCategoryUPtr( new SpotLight{ light } ); } castor::Point3fArray const & SpotLight::generateVertices( uint32_t angle ) diff --git a/source/Core/Castor3D/Scene/MovableObject.cpp b/source/Core/Castor3D/Scene/MovableObject.cpp index b77c03cae1..990177098f 100644 --- a/source/Core/Castor3D/Scene/MovableObject.cpp +++ b/source/Core/Castor3D/Scene/MovableObject.cpp @@ -3,7 +3,7 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/SceneNode.hpp" -CU_ImplementCUSmartPtr( castor3d, MovableObject ) +CU_ImplementSmartPtr( castor3d, MovableObject ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/ComputeParticleSystem.cpp b/source/Core/Castor3D/Scene/ParticleSystem/ComputeParticleSystem.cpp index 8582bc2f5f..0b4bec735b 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/ComputeParticleSystem.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/ComputeParticleSystem.cpp @@ -22,7 +22,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ComputeParticleSystem ) +CU_ImplementSmartPtr( castor3d, ComputeParticleSystem ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/CpuParticleSystem.cpp b/source/Core/Castor3D/Scene/ParticleSystem/CpuParticleSystem.cpp index 6ebc6086bd..203012bd0e 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/CpuParticleSystem.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/CpuParticleSystem.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Scene/ParticleSystem/ParticleUpdater.hpp" #include "Castor3D/Scene/ParticleSystem/ParticleSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, CpuParticleSystem ) +CU_ImplementSmartPtr( castor3d, CpuParticleSystem ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/ParticleEmitter.cpp b/source/Core/Castor3D/Scene/ParticleSystem/ParticleEmitter.cpp index 313eda415c..7eca94d3cc 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/ParticleEmitter.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/ParticleEmitter.cpp @@ -2,7 +2,7 @@ #include "Castor3D/Scene/ParticleSystem/Particle.hpp" -CU_ImplementCUSmartPtr( castor3d, ParticleEmitter ) +CU_ImplementSmartPtr( castor3d, ParticleEmitter ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/ParticleModule.cpp b/source/Core/Castor3D/Scene/ParticleSystem/ParticleModule.cpp index 115c7da56d..0170abcd32 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/ParticleModule.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/ParticleModule.cpp @@ -3,8 +3,8 @@ #include "Castor3D/Cache/ObjectCache.hpp" #include "Castor3D/Scene/ParticleSystem/ParticleSystem.hpp" -CU_ImplementCUSmartPtr( castor3d, ParticleFactory ) -CU_ImplementCUSmartPtr( castor3d, ParticleSystemCache ) +CU_ImplementSmartPtr( castor3d, ParticleFactory ) +CU_ImplementSmartPtr( castor3d, ParticleSystemCache ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/ParticleSystem.cpp b/source/Core/Castor3D/Scene/ParticleSystem/ParticleSystem.cpp index 48ab1d0e4b..6c500a34f4 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/ParticleSystem.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/ParticleSystem.cpp @@ -16,7 +16,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ParticleSystem ) +CU_ImplementSmartPtr( castor3d, ParticleSystem ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/ParticleSystem/ParticleUpdater.cpp b/source/Core/Castor3D/Scene/ParticleSystem/ParticleUpdater.cpp index 668c80f0fb..ceb00837d3 100644 --- a/source/Core/Castor3D/Scene/ParticleSystem/ParticleUpdater.cpp +++ b/source/Core/Castor3D/Scene/ParticleSystem/ParticleUpdater.cpp @@ -1,6 +1,6 @@ #include "Castor3D/Scene/ParticleSystem/ParticleUpdater.hpp" -CU_ImplementCUSmartPtr( castor3d, ParticleUpdater ) +CU_ImplementSmartPtr( castor3d, ParticleUpdater ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/Scene.cpp b/source/Core/Castor3D/Scene/Scene.cpp index 0c27660bd0..4d3bde412b 100644 --- a/source/Core/Castor3D/Scene/Scene.cpp +++ b/source/Core/Castor3D/Scene/Scene.cpp @@ -45,7 +45,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d, Scene ) +CU_ImplementSmartPtr( castor3d, Scene ) namespace castor3d { @@ -108,8 +108,8 @@ namespace castor3d , m_rootNode{ m_sceneNodeCache->find( RootNode ) } , m_rootCameraNode{ m_sceneNodeCache->find( CameraRootNode ) } , m_rootObjectNode{ m_sceneNodeCache->find( ObjectRootNode ) } - , m_background{ std::make_shared< ColourBackground >( engine, *this ) } - , m_lightFactory{ std::make_shared< LightFactory >() } + , m_background{ castor::makeUniqueDerived< SceneBackground, ColourBackground >( engine, *this ) } + , m_lightFactory{ castor::makeUnique< LightFactory >() } , m_listener{ engine.addNewFrameListener( cuT( "Scene_" ) + name + castor::string::toString( intptr_t( this ) ) ) } , m_renderNodes{ castor::makeUnique< SceneRenderNodes >( *this ) } { @@ -213,7 +213,7 @@ namespace castor3d m_animatedObjectGroupCache->add( cuT( "C3D_Textures" ), *this ); auto & device = engine.getRenderSystem()->getRenderDevice(); auto data = device.graphicsData(); - m_reflectionMap = std::make_unique< EnvironmentMap >( m_resources + m_reflectionMap = castor::makeUnique< EnvironmentMap >( m_resources , device , *data , *this ); @@ -370,7 +370,6 @@ namespace castor3d m_renderNodes->clear(); - // These ones, being ResourceCache, need to be cleared in destructor only m_meshCache->cleanup(); if ( m_cleanBackground ) @@ -467,7 +466,7 @@ namespace castor3d } ); } - void Scene::setBackground( SceneBackgroundSPtr value ) + void Scene::setBackground( SceneBackgroundUPtr value ) { m_background = std::move( value ); m_background->initialise( getEngine()->getRenderSystem()->getRenderDevice() ); diff --git a/source/Core/Castor3D/Scene/SceneFileParser.cpp b/source/Core/Castor3D/Scene/SceneFileParser.cpp index a66ccf7d64..07aab62f55 100644 --- a/source/Core/Castor3D/Scene/SceneFileParser.cpp +++ b/source/Core/Castor3D/Scene/SceneFileParser.cpp @@ -13,8 +13,8 @@ #define C3D_PrintParsers 0 -CU_ImplementCUSmartPtr( castor3d, SceneFileContext ) -CU_ImplementCUSmartPtr( castor3d, SceneFileParser ) +CU_ImplementSmartPtr( castor3d, SceneFileContext ) +CU_ImplementSmartPtr( castor3d, SceneFileParser ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/SceneFileParser_Parsers.cpp b/source/Core/Castor3D/Scene/SceneFileParser_Parsers.cpp index 98d8d9dfe8..12ef5ce2e6 100644 --- a/source/Core/Castor3D/Scene/SceneFileParser_Parsers.cpp +++ b/source/Core/Castor3D/Scene/SceneFileParser_Parsers.cpp @@ -365,21 +365,21 @@ namespace castor3d else { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::ePanel , nullptr - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::ePanelOverlay ) @@ -395,21 +395,21 @@ namespace castor3d else { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eBorderPanel , nullptr - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::eBorderPanelOverlay ) @@ -425,21 +425,21 @@ namespace castor3d else { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eText , nullptr - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::eTextOverlay ) @@ -1095,11 +1095,11 @@ namespace castor3d } else if ( !params.empty() ) { - auto imgBackground = std::make_shared< ImageBackground >( *parsingContext.parser->getEngine() + auto imgBackground = castor::makeUnique< ImageBackground >( *parsingContext.parser->getEngine() , *parsingContext.scene ); castor::Path path; imgBackground->loadImage( context.file.getPath(), params[0]->get( path ) ); - parsingContext.scene->setBackground( imgBackground ); + parsingContext.scene->setBackground( castor::ptrRefCast< SceneBackground >( imgBackground ) ); parsingContext.skybox.reset(); } } @@ -1281,21 +1281,21 @@ namespace castor3d else if ( !params.empty() ) { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::ePanel , parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::ePanelOverlay ) @@ -1311,21 +1311,21 @@ namespace castor3d else if ( !params.empty() ) { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eBorderPanel , parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::eBorderPanelOverlay ) @@ -1341,21 +1341,21 @@ namespace castor3d else if ( !params.empty() ) { castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eText , parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } } CU_EndAttributePush( CSCNSection::eTextOverlay ) @@ -1370,7 +1370,7 @@ namespace castor3d } else { - parsingContext.skybox = std::make_shared< SkyboxBackground >( *parsingContext.parser->getEngine() + parsingContext.skybox = castor::makeUnique< SkyboxBackground >( *parsingContext.parser->getEngine() , *parsingContext.scene ); } } @@ -4868,11 +4868,11 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay ) + if ( parsingContext.overlay.rptr ) { castor::Point2d ptPosition; params[0]->get( ptPosition ); - parsingContext.overlay->setRelativePosition( ptPosition ); + parsingContext.overlay.rptr->setRelativePosition( ptPosition ); } else { @@ -4885,11 +4885,11 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay ) + if ( parsingContext.overlay.rptr ) { castor::Point2d ptSize; params[0]->get( ptSize ); - parsingContext.overlay->setRelativeSize( ptSize ); + parsingContext.overlay.rptr->setRelativeSize( ptSize ); } else { @@ -4902,11 +4902,11 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay ) + if ( parsingContext.overlay.rptr ) { castor::Size size; params[0]->get( size ); - parsingContext.overlay->setPixelSize( size ); + parsingContext.overlay.rptr->setPixelSize( size ); } else { @@ -4919,11 +4919,11 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay ) + if ( parsingContext.overlay.rptr ) { castor::Position position; params[0]->get( position ); - parsingContext.overlay->setPixelPosition( position ); + parsingContext.overlay.rptr->setPixelPosition( position ); } else { @@ -4936,11 +4936,11 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay ) + if ( parsingContext.overlay.rptr ) { castor::String name; params[0]->get( name ); - parsingContext.overlay->setMaterial( parsingContext.parser->getEngine()->findMaterial( name ) ); + parsingContext.overlay.rptr->setMaterial( parsingContext.parser->getEngine()->findMaterial( name ) ); } else { @@ -4953,23 +4953,23 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene ? parsingContext.scene->tryFindOverlay( params[0]->get( name ) ) : parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::ePanel - , parent ? parent->getScene() : parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ? parent.rptr->getScene() : parsingContext.scene + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } CU_EndAttributePush( CSCNSection::ePanelOverlay ) @@ -4977,23 +4977,23 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene ? parsingContext.scene->tryFindOverlay( params[0]->get( name ) ) : parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eBorderPanel - , parent ? parent->getScene() : parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ? parent.rptr->getScene() : parsingContext.scene + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } CU_EndAttributePush( CSCNSection::eBorderPanelOverlay ) @@ -5001,23 +5001,23 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); castor::String name; - parsingContext.parentOverlays.push_back( parsingContext.overlay ); - auto parent = parsingContext.parentOverlays.back(); - parsingContext.overlay = parsingContext.scene + parsingContext.parentOverlays.push_back( std::move( parsingContext.overlay ) ); + auto & parent = parsingContext.parentOverlays.back(); + parsingContext.overlay.rptr = parsingContext.scene ? parsingContext.scene->tryFindOverlay( params[0]->get( name ) ) : parsingContext.parser->getEngine()->tryFindOverlay( params[0]->get( name ) ); - if ( !parsingContext.overlay ) + if ( !parsingContext.overlay.rptr ) { - parsingContext.ownOverlay = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() + parsingContext.overlay.uptr = castor::makeUnique< Overlay >( *parsingContext.parser->getEngine() , OverlayType::eText - , parent ? parent->getScene() : parsingContext.scene - , parent ); - parsingContext.overlay = parsingContext.ownOverlay.get(); - parsingContext.overlay->rename( name ); + , parent.rptr ? parent.rptr->getScene() : parsingContext.scene + , parent.rptr ); + parsingContext.overlay.rptr = parsingContext.overlay.uptr.get(); + parsingContext.overlay.rptr->rename( name ); } - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); } CU_EndAttributePush( CSCNSection::eTextOverlay ) @@ -5025,43 +5025,43 @@ namespace castor3d { auto & parsingContext = getParserContext( context ); - if ( parsingContext.overlay->getType() == OverlayType::eText ) + if ( parsingContext.overlay.rptr->getType() == OverlayType::eText ) { - auto textOverlay = parsingContext.overlay->getTextOverlay(); + auto textOverlay = parsingContext.overlay.rptr->getTextOverlay(); if ( textOverlay->getFontTexture() ) { - parsingContext.overlay->setVisible( true ); + parsingContext.overlay.rptr->setVisible( true ); } else { - parsingContext.overlay->setVisible( false ); + parsingContext.overlay.rptr->setVisible( false ); CU_ParsingError( cuT( "TextOverlay's font has not been set, it will not be rendered" ) ); } } else { - parsingContext.overlay->setVisible( true ); + parsingContext.overlay.rptr->setVisible( true ); } - if ( parsingContext.ownOverlay ) + if ( parsingContext.overlay.uptr ) { if ( parsingContext.scene ) { - parsingContext.scene->addOverlay( parsingContext.overlay->getName() - , parsingContext.ownOverlay + parsingContext.scene->addOverlay( parsingContext.overlay.rptr->getName() + , parsingContext.overlay.uptr , true ); } else { - parsingContext.parser->getEngine()->addOverlay( parsingContext.overlay->getName() - , parsingContext.ownOverlay + parsingContext.parser->getEngine()->addOverlay( parsingContext.overlay.rptr->getName() + , parsingContext.overlay.uptr , true ); } } CU_Require( !parsingContext.parentOverlays.empty() ); - parsingContext.overlay = parsingContext.parentOverlays.back(); + parsingContext.overlay = std::move( parsingContext.parentOverlays.back() ); parsingContext.parentOverlays.pop_back(); } CU_EndAttributePop() @@ -5069,7 +5069,7 @@ namespace castor3d CU_ImplementAttributeParser( parserPanelOverlayUvs ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::ePanel ) { @@ -5087,7 +5087,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlaySizes ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5105,7 +5105,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayPixelSizes ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5123,7 +5123,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayMaterial ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5141,7 +5141,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayPosition ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5159,7 +5159,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayCenterUvs ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5177,7 +5177,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayOuterUvs ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5195,7 +5195,7 @@ namespace castor3d CU_ImplementAttributeParser( parserBorderPanelOverlayInnerUvs ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eBorderPanel ) { @@ -5213,7 +5213,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayFont ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5240,7 +5240,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayTextWrapping ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5259,7 +5259,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayVerticalAlign ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5278,7 +5278,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayHorizontalAlign ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5297,7 +5297,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayTexturingMode ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5316,7 +5316,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayLineSpacingMode ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; if ( overlay && overlay->getType() == OverlayType::eText ) { @@ -5335,7 +5335,7 @@ namespace castor3d CU_ImplementAttributeParser( parserTextOverlayText ) { auto & parsingContext = getParserContext( context ); - auto overlay = parsingContext.overlay; + auto overlay = parsingContext.overlay.rptr; castor::String strParams; params[0]->get( strParams ); @@ -5384,7 +5384,7 @@ namespace castor3d CU_ImplementAttributeParser( parserCameraViewport ) { auto & parsingContext = getParserContext( context ); - parsingContext.viewport = std::make_shared< Viewport >( *parsingContext.parser->getEngine() ); + parsingContext.viewport = castor::makeUnique< Viewport >( *parsingContext.parser->getEngine() ); parsingContext.viewport->setPerspective( 0.0_degrees, 1, 0, 1 ); } CU_EndAttributePush( CSCNSection::eViewport ) @@ -5427,10 +5427,9 @@ namespace castor3d auto camera = parsingContext.scene->addNewCamera( parsingContext.strName , *parsingContext.scene , *node - , std::move( *parsingContext.viewport ) ); + , std::move( *parsingContext.viewport.release() ) ); camera->setGamma( parsingContext.point2f[0] ); camera->setExposure( parsingContext.point2f[1] ); - parsingContext.viewport.reset(); } } CU_EndAttributePop() @@ -6163,7 +6162,7 @@ namespace castor3d if ( parsingContext.skybox ) { - parsingContext.scene->setBackground( std::move( parsingContext.skybox ) ); + parsingContext.scene->setBackground( castor::ptrRefCast< SceneBackground >( parsingContext.skybox ) ); } else { diff --git a/source/Core/Castor3D/Scene/SceneImporter.cpp b/source/Core/Castor3D/Scene/SceneImporter.cpp index 2e12a3ea34..1e927fabd3 100644 --- a/source/Core/Castor3D/Scene/SceneImporter.cpp +++ b/source/Core/Castor3D/Scene/SceneImporter.cpp @@ -20,6 +20,8 @@ #include "Castor3D/Scene/Light/Light.hpp" #include "Castor3D/Scene/Light/LightImporter.hpp" +CU_ImplementSmartPtr( castor3d, SceneImporter ) + namespace castor3d { //********************************************************************************************* diff --git a/source/Core/Castor3D/Scene/SceneModule.cpp b/source/Core/Castor3D/Scene/SceneModule.cpp index 3b72df6939..857d37314b 100644 --- a/source/Core/Castor3D/Scene/SceneModule.cpp +++ b/source/Core/Castor3D/Scene/SceneModule.cpp @@ -7,11 +7,11 @@ #include "Castor3D/Scene/SceneNode.hpp" CU_ImplementExportedOwnedBy( castor3d::Scene, Scene ) -CU_ImplementCUSmartPtr( castor3d, CameraCache ) -CU_ImplementCUSmartPtr( castor3d, SceneCache ) -CU_ImplementCUSmartPtr( castor3d, MaterialCacheView ) -CU_ImplementCUSmartPtr( castor3d, SamplerCacheView ) -CU_ImplementCUSmartPtr( castor3d, FontCacheView ) +CU_ImplementSmartPtr( castor3d, CameraCache ) +CU_ImplementSmartPtr( castor3d, SceneCache ) +CU_ImplementSmartPtr( castor3d, MaterialCacheView ) +CU_ImplementSmartPtr( castor3d, SamplerCacheView ) +CU_ImplementSmartPtr( castor3d, FontCacheView ) namespace castor3d diff --git a/source/Core/Castor3D/Scene/SceneNode.cpp b/source/Core/Castor3D/Scene/SceneNode.cpp index fb5a202180..a0847ee685 100644 --- a/source/Core/Castor3D/Scene/SceneNode.cpp +++ b/source/Core/Castor3D/Scene/SceneNode.cpp @@ -8,7 +8,7 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/Animation/SceneNodeAnimation.hpp" -CU_ImplementCUSmartPtr( castor3d, SceneNode ) +CU_ImplementSmartPtr( castor3d, SceneNode ) namespace castor3d { diff --git a/source/Core/Castor3D/Scene/SceneNodeImporter.cpp b/source/Core/Castor3D/Scene/SceneNodeImporter.cpp index 39b18311fd..3b5707e2aa 100644 --- a/source/Core/Castor3D/Scene/SceneNodeImporter.cpp +++ b/source/Core/Castor3D/Scene/SceneNodeImporter.cpp @@ -5,6 +5,8 @@ #include "Castor3D/Scene/Scene.hpp" #include "Castor3D/Scene/SceneNode.hpp" +CU_ImplementSmartPtr( castor3d, SceneNodeImporter ) + namespace castor3d { SceneNodeImporter::SceneNodeImporter( Engine & engine ) diff --git a/source/Core/Castor3D/Shader/LightingModelFactory.cpp b/source/Core/Castor3D/Shader/LightingModelFactory.cpp index e98e757a14..07e4941076 100644 --- a/source/Core/Castor3D/Shader/LightingModelFactory.cpp +++ b/source/Core/Castor3D/Shader/LightingModelFactory.cpp @@ -5,7 +5,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, LightingModelFactory ) +CU_ImplementSmartPtr( castor3d, LightingModelFactory ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/Program.cpp b/source/Core/Castor3D/Shader/Program.cpp index bd682c3050..56a07f36cb 100644 --- a/source/Core/Castor3D/Shader/Program.cpp +++ b/source/Core/Castor3D/Shader/Program.cpp @@ -4,7 +4,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ShaderProgram ) +CU_ImplementSmartPtr( castor3d, ShaderProgram ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffer.cpp index af733c0ea8..43c2d98b7e 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffer.cpp @@ -8,7 +8,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, ShaderBuffer ) +CU_ImplementSmartPtr( castor3d, ShaderBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/FontGlyphBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/FontGlyphBuffer.cpp index 8a18a5dc5c..5ebc548e81 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/FontGlyphBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/FontGlyphBuffer.cpp @@ -8,7 +8,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, FontGlyphBuffer ) +CU_ImplementSmartPtr( castor3d, FontGlyphBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/LightBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/LightBuffer.cpp index 4f0b983a12..c6d3f7d295 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/LightBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/LightBuffer.cpp @@ -7,7 +7,7 @@ #include "Castor3D/Scene/Light/SpotLight.hpp" #include "Castor3D/Shader/Shaders/SdwModule.hpp" -CU_ImplementCUSmartPtr( castor3d, LightBuffer ) +CU_ImplementSmartPtr( castor3d, LightBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/PassBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/PassBuffer.cpp index a8cb8d4d4e..2f3f28ed94 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/PassBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/PassBuffer.cpp @@ -9,7 +9,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, PassBuffer ) +CU_ImplementSmartPtr( castor3d, PassBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/SssProfileBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/SssProfileBuffer.cpp index b11be6a0d2..a1b003aae9 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/SssProfileBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/SssProfileBuffer.cpp @@ -5,7 +5,7 @@ #include "Castor3D/Material/Pass/Component/Lighting/SubsurfaceScatteringComponent.hpp" #include "Castor3D/Shader/Shaders/SdwModule.hpp" -CU_ImplementCUSmartPtr( castor3d, SssProfileBuffer ) +CU_ImplementSmartPtr( castor3d, SssProfileBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/TextureAnimationBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/TextureAnimationBuffer.cpp index bb65311ad9..e3e3ef850f 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/TextureAnimationBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/TextureAnimationBuffer.cpp @@ -10,7 +10,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, TextureAnimationBuffer ) +CU_ImplementSmartPtr( castor3d, TextureAnimationBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderBuffers/TextureConfigurationBuffer.cpp b/source/Core/Castor3D/Shader/ShaderBuffers/TextureConfigurationBuffer.cpp index e2dba3e3c1..0def34f678 100644 --- a/source/Core/Castor3D/Shader/ShaderBuffers/TextureConfigurationBuffer.cpp +++ b/source/Core/Castor3D/Shader/ShaderBuffers/TextureConfigurationBuffer.cpp @@ -10,7 +10,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, TextureConfigurationBuffer ) +CU_ImplementSmartPtr( castor3d, TextureConfigurationBuffer ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/ShaderModule.cpp b/source/Core/Castor3D/Shader/ShaderModule.cpp index 8a0027378a..6ebb604dec 100644 --- a/source/Core/Castor3D/Shader/ShaderModule.cpp +++ b/source/Core/Castor3D/Shader/ShaderModule.cpp @@ -8,7 +8,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d::shader, BufferBase ) +CU_ImplementSmartPtr( castor3d::shader, BufferBase ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/Shaders/GlslLight.cpp b/source/Core/Castor3D/Shader/Shaders/GlslLight.cpp index cee88c5f01..67ec406c4e 100644 --- a/source/Core/Castor3D/Shader/Shaders/GlslLight.cpp +++ b/source/Core/Castor3D/Shader/Shaders/GlslLight.cpp @@ -15,6 +15,8 @@ #include +CU_ImplementSmartPtr( castor3d::shader, LightsBuffer ) + namespace castor3d::shader { //********************************************************************************************* @@ -250,9 +252,9 @@ namespace castor3d::shader , m_brdf{ brdf } , m_utils{ utils } , m_enableVolumetric{ enableVolumetric } - , m_shadowModel{ std::make_shared< Shadow >( shadowOptions, m_writer ) } + , m_shadowModel{ castor::makeUnique< Shadow >( shadowOptions, m_writer ) } , m_sssTransmittance{ ( sssProfiles - ? std::make_shared< SssTransmittance >( m_writer + ? castor::makeUnique< SssTransmittance >( m_writer , std::move( shadowOptions ) , *sssProfiles ) : nullptr ) } @@ -283,7 +285,7 @@ namespace castor3d::shader , enableVolumetric } { m_shadowModel->declare( shadowMapBinding, shadowMapSet ); - m_lightsBuffer = std::make_unique< LightsBuffer >( m_writer + m_lightsBuffer = castor::makeUnique< LightsBuffer >( m_writer , lightsBufBinding , lightsBufSet ); } @@ -328,7 +330,7 @@ namespace castor3d::shader break; } - m_lightsBuffer = std::make_unique< LightsBuffer >( m_writer + m_lightsBuffer = castor::makeUnique< LightsBuffer >( m_writer , lightsBufBinding , lightsBufSet ); } diff --git a/source/Core/Castor3D/Shader/Shaders/GlslLighting.cpp b/source/Core/Castor3D/Shader/Shaders/GlslLighting.cpp index 0bb6cdf8e7..558c23718c 100644 --- a/source/Core/Castor3D/Shader/Shaders/GlslLighting.cpp +++ b/source/Core/Castor3D/Shader/Shaders/GlslLighting.cpp @@ -20,7 +20,7 @@ #include #include -CU_ImplementCUSmartPtr( castor3d::shader, LightingModel ) +CU_ImplementSmartPtr( castor3d::shader, LightingModel ) namespace castor3d::shader { diff --git a/source/Core/Castor3D/Shader/Shaders/GlslMaterial.cpp b/source/Core/Castor3D/Shader/Shaders/GlslMaterial.cpp index 6682567bf1..b6681f9c65 100644 --- a/source/Core/Castor3D/Shader/Shaders/GlslMaterial.cpp +++ b/source/Core/Castor3D/Shader/Shaders/GlslMaterial.cpp @@ -13,6 +13,8 @@ #include #include +CU_ImplementSmartPtr( castor3d::shader, Material ) + namespace castor3d::shader { //********************************************************************************************* diff --git a/source/Core/Castor3D/Shader/Shaders/GlslShadow.cpp b/source/Core/Castor3D/Shader/Shaders/GlslShadow.cpp index a7caab0486..635f30ebb6 100644 --- a/source/Core/Castor3D/Shader/Shaders/GlslShadow.cpp +++ b/source/Core/Castor3D/Shader/Shaders/GlslShadow.cpp @@ -14,6 +14,8 @@ #include #include +CU_ImplementSmartPtr( castor3d::shader, Shadow ) + namespace castor3d { namespace shader diff --git a/source/Core/Castor3D/Shader/Shaders/GlslSssTransmittance.cpp b/source/Core/Castor3D/Shader/Shaders/GlslSssTransmittance.cpp index 9fddaa8abb..d402978315 100644 --- a/source/Core/Castor3D/Shader/Shaders/GlslSssTransmittance.cpp +++ b/source/Core/Castor3D/Shader/Shaders/GlslSssTransmittance.cpp @@ -11,6 +11,8 @@ #include +CU_ImplementSmartPtr( castor3d::shader, SssTransmittance ) + namespace castor3d { namespace shader diff --git a/source/Core/Castor3D/Shader/Ubos/LayeredLpvGridConfigUbo.cpp b/source/Core/Castor3D/Shader/Ubos/LayeredLpvGridConfigUbo.cpp index 0e7d3d4810..f013dff652 100644 --- a/source/Core/Castor3D/Shader/Ubos/LayeredLpvGridConfigUbo.cpp +++ b/source/Core/Castor3D/Shader/Ubos/LayeredLpvGridConfigUbo.cpp @@ -7,7 +7,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, LayeredLpvGridConfigUbo ) +CU_ImplementSmartPtr( castor3d, LayeredLpvGridConfigUbo ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/Ubos/LpvGridConfigUbo.cpp b/source/Core/Castor3D/Shader/Ubos/LpvGridConfigUbo.cpp index 3d0f735a45..2df58de17d 100644 --- a/source/Core/Castor3D/Shader/Ubos/LpvGridConfigUbo.cpp +++ b/source/Core/Castor3D/Shader/Ubos/LpvGridConfigUbo.cpp @@ -12,7 +12,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, LpvGridConfigUbo ) +CU_ImplementSmartPtr( castor3d, LpvGridConfigUbo ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/Ubos/LpvLightConfigUbo.cpp b/source/Core/Castor3D/Shader/Ubos/LpvLightConfigUbo.cpp index 073151cb53..85ad360e2b 100644 --- a/source/Core/Castor3D/Shader/Ubos/LpvLightConfigUbo.cpp +++ b/source/Core/Castor3D/Shader/Ubos/LpvLightConfigUbo.cpp @@ -15,7 +15,7 @@ #pragma GCC diagnostic ignored "-Wuseless-cast" -CU_ImplementCUSmartPtr( castor3d, LpvLightConfigUbo ) +CU_ImplementSmartPtr( castor3d, LpvLightConfigUbo ) namespace castor3d { diff --git a/source/Core/Castor3D/Shader/Ubos/SceneUbo.cpp b/source/Core/Castor3D/Shader/Ubos/SceneUbo.cpp index d4d04ed0de..b40d8867a9 100644 --- a/source/Core/Castor3D/Shader/Ubos/SceneUbo.cpp +++ b/source/Core/Castor3D/Shader/Ubos/SceneUbo.cpp @@ -15,7 +15,7 @@ #include -CU_ImplementCUSmartPtr( castor3d, SceneUbo ) +CU_ImplementSmartPtr( castor3d, SceneUbo ) namespace castor3d { diff --git a/source/Core/CastorUtils/CMakeLists.txt b/source/Core/CastorUtils/CMakeLists.txt index 493b7bcbec..a80c87b04c 100644 --- a/source/Core/CastorUtils/CMakeLists.txt +++ b/source/Core/CastorUtils/CMakeLists.txt @@ -215,8 +215,6 @@ if ( ZLIB_FOUND AND FreeType_FOUND ) ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/ArrayView.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/BlockGuard.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/ChangeTracked.hpp - ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/Collection.hpp - ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/Collection.inl ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/DataHolder.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/DelayedInitialiser.hpp ${CASTOR_SOURCE_DIR}/include/Core/${PROJECT_NAME}/Design/DesignModule.hpp diff --git a/source/Core/CastorUtils/CastorUtilsPrerequisites.cpp b/source/Core/CastorUtils/CastorUtilsPrerequisites.cpp index 370056cf03..af68d3fb8c 100644 --- a/source/Core/CastorUtils/CastorUtilsPrerequisites.cpp +++ b/source/Core/CastorUtils/CastorUtilsPrerequisites.cpp @@ -9,8 +9,6 @@ namespace castor { - DummyDtor g_dummyDtor; - Point3f operator*( Matrix4x4f const & lhs, Point3f const & rhs ) { float const * mtx = lhs.constPtr(); diff --git a/source/Core/CastorUtils/FileParser/FileParserContext.cpp b/source/Core/CastorUtils/FileParser/FileParserContext.cpp index ed8aa28f8b..060c837d9e 100644 --- a/source/Core/CastorUtils/FileParser/FileParserContext.cpp +++ b/source/Core/CastorUtils/FileParser/FileParserContext.cpp @@ -2,7 +2,7 @@ #include "CastorUtils/FileParser/FileParser.hpp" -CU_ImplementCUSmartPtr( castor, FileParserContext ) +CU_ImplementSmartPtr( castor, FileParserContext ) namespace castor { diff --git a/source/Core/CastorUtils/Graphics/BoundingBox.cpp b/source/Core/CastorUtils/Graphics/BoundingBox.cpp index ad9094d6b2..0cb976e5e5 100644 --- a/source/Core/CastorUtils/Graphics/BoundingBox.cpp +++ b/source/Core/CastorUtils/Graphics/BoundingBox.cpp @@ -2,7 +2,7 @@ #include "CastorUtils/Design/ArrayView.hpp" -CU_ImplementCUSmartPtr( castor, BoundingBox ) +CU_ImplementSmartPtr( castor, BoundingBox ) namespace castor { diff --git a/source/Core/CastorUtils/Graphics/BoundingSphere.cpp b/source/Core/CastorUtils/Graphics/BoundingSphere.cpp index 3f7ff32b76..4905268a12 100644 --- a/source/Core/CastorUtils/Graphics/BoundingSphere.cpp +++ b/source/Core/CastorUtils/Graphics/BoundingSphere.cpp @@ -1,7 +1,7 @@ #include "CastorUtils/Graphics/BoundingSphere.hpp" #include "CastorUtils/Graphics/BoundingBox.hpp" -CU_ImplementCUSmartPtr( castor, BoundingSphere ) +CU_ImplementSmartPtr( castor, BoundingSphere ) namespace castor { diff --git a/source/Core/CastorUtils/Graphics/Font.cpp b/source/Core/CastorUtils/Graphics/Font.cpp index 63963d361f..7e8c059ec3 100644 --- a/source/Core/CastorUtils/Graphics/Font.cpp +++ b/source/Core/CastorUtils/Graphics/Font.cpp @@ -7,7 +7,7 @@ FT_BEGIN_HEADER # include FT_GLYPH_H FT_END_HEADER -CU_ImplementCUSmartPtr( castor, Font ) +CU_ImplementSmartPtr( castor, Font ) namespace castor { diff --git a/source/Core/CastorUtils/Graphics/FontCache.cpp b/source/Core/CastorUtils/Graphics/FontCache.cpp index 14c482264e..cf9d548917 100644 --- a/source/Core/CastorUtils/Graphics/FontCache.cpp +++ b/source/Core/CastorUtils/Graphics/FontCache.cpp @@ -5,7 +5,7 @@ #include "CastorUtils/Log/Logger.hpp" #include "CastorUtils/Miscellaneous/StringUtils.hpp" -CU_ImplementCUSmartPtr( castor, FontCache ) +CU_ImplementSmartPtr( castor, FontCache ) namespace castor { diff --git a/source/Core/CastorUtils/Graphics/Image.cpp b/source/Core/CastorUtils/Graphics/Image.cpp index 1493e04a69..026c363e8f 100644 --- a/source/Core/CastorUtils/Graphics/Image.cpp +++ b/source/Core/CastorUtils/Graphics/Image.cpp @@ -11,7 +11,7 @@ #include "stb_image_resize.h" #include "CastorUtils/Config/EndExternHeaderGuard.hpp" -CU_ImplementCUSmartPtr( castor, Image ) +CU_ImplementSmartPtr( castor, Image ) namespace castor { @@ -76,7 +76,7 @@ namespace castor { m_pathFile = image.m_pathFile; m_layout = image.m_layout; - m_buffer = std::move( image.m_buffer ? image.m_buffer->clone() : nullptr ); + m_buffer = image.m_buffer ? image.m_buffer->clone() : nullptr; return * this; } diff --git a/source/Core/CastorUtils/Graphics/PixelBufferBase.cpp b/source/Core/CastorUtils/Graphics/PixelBufferBase.cpp index 4485f1c49b..5002a86b04 100644 --- a/source/Core/CastorUtils/Graphics/PixelBufferBase.cpp +++ b/source/Core/CastorUtils/Graphics/PixelBufferBase.cpp @@ -11,7 +11,7 @@ #include "stb_image_resize.h" #include "CastorUtils/Config/EndExternHeaderGuard.hpp" -CU_ImplementCUSmartPtr( castor, PxBufferBase ) +CU_ImplementSmartPtr( castor, PxBufferBase ) namespace castor { diff --git a/source/Core/CastorUtils/Miscellaneous/DynamicLibrary.cpp b/source/Core/CastorUtils/Miscellaneous/DynamicLibrary.cpp index 4f2eb47bb4..e9c6c44c15 100644 --- a/source/Core/CastorUtils/Miscellaneous/DynamicLibrary.cpp +++ b/source/Core/CastorUtils/Miscellaneous/DynamicLibrary.cpp @@ -1,6 +1,6 @@ #include "CastorUtils/Miscellaneous/DynamicLibrary.hpp" -CU_ImplementCUSmartPtr( castor, DynamicLibrary ) +CU_ImplementSmartPtr( castor, DynamicLibrary ) namespace castor { diff --git a/source/Plugins/Generators/DiamondSquareTerrain/DiamondSquareTerrain.cpp b/source/Plugins/Generators/DiamondSquareTerrain/DiamondSquareTerrain.cpp index 51547e2554..9f86c2a706 100644 --- a/source/Plugins/Generators/DiamondSquareTerrain/DiamondSquareTerrain.cpp +++ b/source/Plugins/Generators/DiamondSquareTerrain/DiamondSquareTerrain.cpp @@ -58,7 +58,7 @@ namespace diamond_square_terrain castor3d::MeshGeneratorUPtr Generator::create() { - return std::make_unique< Generator >(); + return castor::makeUniqueDerived< castor3d::MeshGenerator, Generator >(); } void Generator::doGenerate( castor3d::Mesh & mesh diff --git a/source/Plugins/Generic/AtmosphereScattering/AtmosphereBackground.cpp b/source/Plugins/Generic/AtmosphereScattering/AtmosphereBackground.cpp index 086ac41f63..c0f8f9b90d 100644 --- a/source/Plugins/Generic/AtmosphereScattering/AtmosphereBackground.cpp +++ b/source/Plugins/Generic/AtmosphereScattering/AtmosphereBackground.cpp @@ -26,6 +26,8 @@ //************************************************************************************************* +CU_ImplementSmartPtr( atmosphere_scattering, AtmosphereBackground ) + namespace castor { using namespace castor3d; diff --git a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScatteringPrerequisites.hpp b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScatteringPrerequisites.hpp index 5d6e5efdf9..dcd1d78a09 100644 --- a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScatteringPrerequisites.hpp +++ b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScatteringPrerequisites.hpp @@ -26,6 +26,8 @@ namespace atmosphere_scattering struct CloudsData; struct WeatherData; + CU_DeclareSmartPtr( atmosphere_scattering, AtmosphereBackground, ); + template< template< typename DataT > typename WrapperT > struct AtmosphereScatteringConfigT; using AtmosphereScatteringConfig = AtmosphereScatteringConfigT< crg::RawTypeT >; diff --git a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.cpp b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.cpp index 928788b0f3..f2bf429ac5 100644 --- a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.cpp +++ b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.cpp @@ -29,7 +29,7 @@ namespace atmosphere_scattering { auto & parsingContext = castor3d::getSceneParserContext( context ); auto & atmosphereContext = parser::getParserContext( context ); - atmosphereContext.background = std::make_unique< AtmosphereBackground >( *parsingContext.parser->getEngine() + atmosphereContext.background = castor::makeUnique< AtmosphereBackground >( *parsingContext.parser->getEngine() , *parsingContext.scene ); } CU_EndAttributePush( AtmosphereSection::eRoot ) @@ -61,7 +61,7 @@ namespace atmosphere_scattering atmosphereContext.background->loadPerlinWorley( atmosphereContext.perlinWorleyDim ); atmosphereContext.background->loadCurl( atmosphereContext.curlDim ); atmosphereContext.background->loadWeather( atmosphereContext.weatherDim ); - parsingContext.scene->setBackground( std::move( atmosphereContext.background ) ); + parsingContext.scene->setBackground( castor::ptrRefCast< castor3d::SceneBackground >( atmosphereContext.background ) ); } } CU_EndAttributePop() diff --git a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.hpp b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.hpp index 2758f72b90..df06036d18 100644 --- a/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.hpp +++ b/source/Plugins/Generic/AtmosphereScattering/AtmosphereScattering_Parsers.hpp @@ -33,7 +33,7 @@ namespace atmosphere_scattering WeatherConfig weather{}; CloudsConfig clouds{}; DensityProfileLayer * densityLayer{}; - std::unique_ptr< AtmosphereBackground > background; + AtmosphereBackgroundUPtr background; }; enum class AtmosphereSection diff --git a/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.cpp b/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.cpp index 56faf6b8a7..f1766558e5 100644 --- a/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.cpp @@ -328,7 +328,7 @@ namespace ocean_fft , ashes::BufferBase const & displacement , std::array< castor3d::Texture, 2u > const & heightDisp , std::array< castor3d::Texture, 2u > const & gradJacob - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "BakeHeightGradient" , [&device, extent, heightMapSize, displacementDownsample, isEnabled]( crg::FramePass const & framePass diff --git a/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.hpp b/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.hpp index 49a4148dc3..437c314f18 100644 --- a/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/BakeHeightGradientPass.hpp @@ -90,7 +90,7 @@ namespace ocean_fft , ashes::BufferBase const & displacement , std::array< castor3d::Texture, 2u > const & heightDisp , std::array< castor3d::Texture, 2u > const & gradJacob - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledRPtr isEnabled ); } #endif diff --git a/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.cpp b/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.cpp index 7be9b5ee69..338cf1e6d9 100644 --- a/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.cpp @@ -227,7 +227,7 @@ namespace ocean_fft , OceanUbo const & ubo , ashes::BufferBase const & input , ashes::BufferBase const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "GenerateDistribution" + name , [&device, downsample, extent, isEnabled]( crg::FramePass const & framePass diff --git a/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.hpp b/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.hpp index d4d189b3b6..a9b720782c 100644 --- a/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/DownsampleDistributionPass.hpp @@ -76,7 +76,7 @@ namespace ocean_fft , OceanUbo const & ubo , ashes::BufferBase const & input , ashes::BufferBase const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledRPtr isEnabled ); } #endif diff --git a/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.cpp b/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.cpp index c2f686390e..2af7c84344 100644 --- a/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.cpp @@ -258,7 +258,7 @@ namespace ocean_fft , OceanUbo const & ubo , ashes::BufferBase const & input , ashes::BufferBase const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "GenerateDistribution" + name , [&device, normals, extent, isEnabled]( crg::FramePass const & framePass diff --git a/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.hpp b/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.hpp index 099127f819..0752dd419d 100644 --- a/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/GenerateDistributionPass.hpp @@ -76,7 +76,7 @@ namespace ocean_fft , OceanUbo const & ubo , ashes::BufferBase const & input , ashes::BufferBase const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledRPtr isEnabled ); } #endif diff --git a/source/Plugins/Generic/FFTOceanRendering/OceanFFT.cpp b/source/Plugins/Generic/FFTOceanRendering/OceanFFT.cpp index f81615512a..ba7e96927b 100644 --- a/source/Plugins/Generic/FFTOceanRendering/OceanFFT.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/OceanFFT.cpp @@ -29,7 +29,7 @@ namespace ocean_fft , crg::FramePassGroup & graph , crg::FramePass const * previousPass , crg::ImageViewId imageView - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "GenMips" + name , [&device, isEnabled]( crg::FramePass const & framePass @@ -57,7 +57,7 @@ namespace ocean_fft , crg::FramePassGroup & graph , crg::FramePass const * previousPass , crg::ImageViewId imageView - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "GenMips" + name , [&device, isEnabled]( crg::FramePass const & framePass @@ -87,7 +87,7 @@ namespace ocean_fft , crg::FramePass const & previousPass , ashes::BufferBase const & srcBuffer , crg::ImageViewId dstImageView - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto data = *dstImageView.data; data.name = data.image.data->name + "_L0"; @@ -194,7 +194,7 @@ namespace ocean_fft , crg::FramePassGroup & graph , crg::FramePassArray previousPasses , OceanUbo const & ubo - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) : m_device{ device } , m_group{ graph } , m_config{ ocean_fft::getConfig( *device.renderSystem.getEngine() ) } diff --git a/source/Plugins/Generic/FFTOceanRendering/OceanFFT.hpp b/source/Plugins/Generic/FFTOceanRendering/OceanFFT.hpp index 47e8daa95d..0c996a09d3 100644 --- a/source/Plugins/Generic/FFTOceanRendering/OceanFFT.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/OceanFFT.hpp @@ -42,7 +42,7 @@ namespace ocean_fft , OceanUbo const & ubo , ashes::BufferBase const & input , ashes::BufferBase const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "GenerateFrequency" + name , [&device, extent, isEnabled]( crg::FramePass const & framePass @@ -85,7 +85,7 @@ namespace ocean_fft , FFTConfig const & pfftConfig , ashes::Buffer< cfloat > const & distribution , FFTMode mode - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) : fftConfig{ pfftConfig } , frequency{ castor3d::makeBuffer< cfloat >( fftConfig.device , dimensions.width * dimensions.height @@ -153,7 +153,7 @@ namespace ocean_fft , crg::FramePassGroup & graph , crg::FramePassArray previousPasses , OceanUbo const & ubo - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledRPtr isEnabled ); ~OceanFFT(); /** *\copydoc castor3d::RenderTechniquePass::accept diff --git a/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.cpp b/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.cpp index 9f9b359d7e..83b5005992 100644 --- a/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.cpp @@ -213,15 +213,17 @@ namespace ocean_fft , castor3d::RenderTechnique & technique , castor3d::TechniquePasses & renderPasses , crg::FramePassArray previousPasses - , std::shared_ptr< OceanUbo > oceanUbo - , std::shared_ptr< OceanFFT > oceanFFT - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , std::unique_ptr< OceanUbo > oceanUbo + , std::unique_ptr< OceanFFT > oceanFFT + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto targetResult = technique.getTargetResult(); auto targetDepth = technique.getTargetDepth(); auto extent = technique.getTargetExtent(); + auto ocUbo = oceanUbo.release(); + auto ocFFT = oceanFFT.release(); auto & result = graph.createPass( "NodesPass" - , [extent, targetResult, targetDepth, oceanUbo, oceanFFT, isEnabled, &device, &technique, &renderPasses]( crg::FramePass const & framePass + , [extent, targetResult, targetDepth, ocUbo, ocFFT, isEnabled, &device, &technique, &renderPasses]( crg::FramePass const & framePass , crg::GraphContext & context , crg::RunnableGraph & runnableGraph ) { @@ -230,8 +232,8 @@ namespace ocean_fft , context , runnableGraph , device - , std::move( oceanUbo ) - , std::move( oceanFFT ) + , std::unique_ptr< OceanUbo >( ocUbo ) + , std::unique_ptr< OceanFFT >( ocFFT ) , targetResult , targetDepth , castor3d::RenderNodesPassDesc{ extent @@ -247,7 +249,7 @@ namespace ocean_fft .llpvResult( technique.getLlpvResult() ) .vctFirstBounce( technique.getFirstVctBounce() ) .vctSecondaryBounce( technique.getSecondaryVctBounce() ) - , isEnabled ); + , castor3d::IsRenderPassEnabledUPtr( isEnabled ) ); renderPasses[size_t( OceanRenderPass::Event )].push_back( res.get() ); device.renderSystem.getEngine()->registerTimer( framePass.getFullName() , res->getTimer() ); @@ -259,7 +261,7 @@ namespace ocean_fft result.addInOutDepthStencilView( technique.getTargetDepth() ); result.addInOutColourView( technique.getTargetResult() ); #else - result.addDependencies( oceanFFT->getLastPasses() ); + result.addDependencies( ocFFT->getLastPasses() ); result.addDependency( technique.getGetLastOpaquePass() ); result.addImplicitColourView( technique.getSampledIntermediate() , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); @@ -269,11 +271,11 @@ namespace ocean_fft , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); result.addImplicitDepthView( technique.getDiffuseLightingResult().sampledViewId , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); - result.addImplicitColourView( oceanFFT->getNormals().sampledViewId + result.addImplicitColourView( ocFFT->getNormals().sampledViewId , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); - result.addImplicitColourView( oceanFFT->getHeightDisplacement().sampledViewId + result.addImplicitColourView( ocFFT->getHeightDisplacement().sampledViewId , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); - result.addImplicitColourView( oceanFFT->getGradientJacobian().sampledViewId + result.addImplicitColourView( ocFFT->getGradientJacobian().sampledViewId , VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ); result.addInOutDepthStencilView( technique.getTargetDepth() ); result.addInOutColourView( technique.getTargetResult() ); @@ -294,13 +296,13 @@ namespace ocean_fft , crg::GraphContext & context , crg::RunnableGraph & graph , castor3d::RenderDevice const & device - , std::shared_ptr< OceanUbo > oceanUbo - , std::shared_ptr< OceanFFT > oceanFFT + , std::unique_ptr< OceanUbo > oceanUbo + , std::unique_ptr< OceanFFT > oceanFFT , crg::ImageViewIdArray targetImage , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledUPtr isEnabled ) : castor3d::RenderTechniqueNodesPass{ parent , pass , context @@ -311,8 +313,8 @@ namespace ocean_fft , std::move( targetDepth ) , renderPassDesc , techniquePassDesc } - , m_isEnabled{ isEnabled } - , m_ubo{ oceanUbo } + , m_isEnabled{ std::move( isEnabled ) } + , m_ubo{ std::move( oceanUbo ) } , m_oceanFFT{ std::move( oceanFFT ) } , m_linearWrapSampler{ device->createSampler( getName() , VK_SAMPLER_ADDRESS_MODE_REPEAT @@ -348,16 +350,16 @@ namespace ocean_fft , castor3d::TechniquePasses & renderPasses , crg::FramePassArray previousPasses ) { - auto isEnabled = std::make_shared< castor3d::IsRenderPassEnabled >(); + auto isEnabled = new castor3d::IsRenderPassEnabled{}; auto & graph = technique.getGraph().createPassGroup( OceanFFT::Name ); auto extent = technique.getTargetExtent(); crg::FramePassArray passes{ previousPasses }; - auto oceanUbo = std::make_shared< OceanUbo >( device ); + auto oceanUbo = std::make_unique< OceanUbo >( device ); #if Ocean_DebugFFTGraph crg::FrameGraph fftGraph{ graph.getHandler(), OceanFFT::Name }; auto & group = fftGraph.createPassGroup( OceanFFT::Name ); - auto oceanFFT = std::make_shared< OceanFFT >( device + auto oceanFFT = std::make_unique< OceanFFT >( device , group , previousPasses , *oceanUbo ); @@ -370,7 +372,7 @@ namespace ocean_fft auto runnable = fftGraph.compile( device.makeContext() ); runnable->record(); #else - auto oceanFFT = std::make_shared< OceanFFT >( device + auto oceanFFT = std::make_unique< OceanFFT >( device , technique.getResources() , graph , previousPasses diff --git a/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.hpp b/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.hpp index 22be54493e..c2f215be65 100644 --- a/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/OceanFFTRenderPass.hpp @@ -27,13 +27,13 @@ namespace ocean_fft , crg::GraphContext & context , crg::RunnableGraph & graph , castor3d::RenderDevice const & device - , std::shared_ptr< OceanUbo > oceanUbo - , std::shared_ptr< OceanFFT > oceanFFT + , std::unique_ptr< OceanUbo > oceanUbo + , std::unique_ptr< OceanFFT > oceanFFT , crg::ImageViewIdArray targetImage , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledUPtr isEnabled ); ~OceanRenderPass()override; static crg::FramePassArray create( castor3d::RenderDevice const & device , castor3d::RenderTechnique & technique @@ -84,9 +84,9 @@ namespace ocean_fft castor3d::ShaderPtr doGetPixelShaderSource( castor3d::PipelineFlags const & flags )const override; private: - std::shared_ptr< castor3d::IsRenderPassEnabled > m_isEnabled; - std::shared_ptr< OceanUbo > m_ubo; - std::shared_ptr< OceanFFT > m_oceanFFT; + castor3d::IsRenderPassEnabledUPtr m_isEnabled; + std::unique_ptr< OceanUbo > m_ubo; + std::unique_ptr< OceanFFT > m_oceanFFT; OceanUboConfiguration m_configuration; ashes::SamplerPtr m_linearWrapSampler; ashes::SamplerPtr m_pointClampSampler; diff --git a/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.cpp b/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.cpp index 007f9c3be9..fd0ba5bb2f 100644 --- a/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.cpp +++ b/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.cpp @@ -371,7 +371,7 @@ namespace ocean_fft , FFTConfig const & config , ashes::BufferBase const & input , std::array< ashes::BufferBasePtr, 2u > const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledRPtr isEnabled ) { auto & result = graph.createPass( "Process" + name , [&device, extent, isEnabled, &input, &output, &config]( crg::FramePass const & framePass diff --git a/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.hpp b/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.hpp index 55c2c97bda..22b2b8497c 100644 --- a/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.hpp +++ b/source/Plugins/Generic/FFTOceanRendering/ProcessFFTPass.hpp @@ -76,7 +76,7 @@ namespace ocean_fft , FFTConfig const & config , ashes::BufferBase const & input , std::array< ashes::BufferBasePtr, 2u > const & output - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledRPtr isEnabled ); } #endif diff --git a/source/Plugins/Generic/OceanRendering/OceanRenderPass.cpp b/source/Plugins/Generic/OceanRendering/OceanRenderPass.cpp index cbb775d914..4495be5813 100644 --- a/source/Plugins/Generic/OceanRendering/OceanRenderPass.cpp +++ b/source/Plugins/Generic/OceanRendering/OceanRenderPass.cpp @@ -165,12 +165,12 @@ namespace ocean , VK_IMAGE_VIEW_TYPE_2D , img.data->info.format , { VK_IMAGE_ASPECT_COLOR_BIT, 0u, image.getLevels(), 0u, 1u } } ); - auto buffer = image.getPixels(); engine.postEvent( castor3d::makeGpuFunctorEvent( castor3d::EventType::ePreRender - , [format, dim, buffer, &img, &view, &result, &runnable]( castor3d::RenderDevice const & device + , [format, dim, image, &img, &view, &result, &runnable]( castor3d::RenderDevice const & device , castor3d::QueueData const & queue ) { + auto buffer = image.getPixels(); auto staging = device->createStagingTexture( VkFormat( format ) , VkExtent2D{ dim.getWidth(), dim.getHeight() } , buffer->getLevels() ); @@ -209,7 +209,7 @@ namespace ocean , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledUPtr isEnabled ) : castor3d::RenderTechniqueNodesPass{ parent , pass , context @@ -263,7 +263,7 @@ namespace ocean , crg::FramePassArray previousPasses ) { std::string name{ Name }; - auto isEnabled = std::make_shared< castor3d::IsRenderPassEnabled >(); + auto isEnabled = new castor3d::IsRenderPassEnabled{}; auto extent = technique.getTargetExtent(); auto & graph = technique.getGraph().createPassGroup( name ); @@ -314,7 +314,7 @@ namespace ocean .llpvResult( technique.getLlpvResult() ) .vctFirstBounce( technique.getFirstVctBounce() ) .vctSecondaryBounce( technique.getSecondaryVctBounce() ) - , isEnabled ); + , castor3d::IsRenderPassEnabledUPtr( isEnabled ) ); renderPasses[size_t( Event )].push_back( res.get() ); device.renderSystem.getEngine()->registerTimer( framePass.getFullName() , res->getTimer() ); diff --git a/source/Plugins/Generic/OceanRendering/OceanRenderPass.hpp b/source/Plugins/Generic/OceanRendering/OceanRenderPass.hpp index 0d74d17fef..3d09ddce93 100644 --- a/source/Plugins/Generic/OceanRendering/OceanRenderPass.hpp +++ b/source/Plugins/Generic/OceanRendering/OceanRenderPass.hpp @@ -30,7 +30,7 @@ namespace ocean , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledUPtr isEnabled ); ~OceanRenderPass()override; static crg::FramePassArray create( castor3d::RenderDevice const & device , castor3d::RenderTechnique & technique @@ -85,7 +85,7 @@ namespace ocean castor3d::ShaderPtr doGetPixelShaderSource( castor3d::PipelineFlags const & flags )const override; private: - std::shared_ptr< castor3d::IsRenderPassEnabled > m_isEnabled; + castor3d::IsRenderPassEnabledUPtr m_isEnabled; OceanUboConfiguration m_configuration; ashes::SamplerPtr m_linearWrapSampler; ashes::SamplerPtr m_pointClampSampler; diff --git a/source/Plugins/Generic/ToonMaterial/EdgesComponent.cpp b/source/Plugins/Generic/ToonMaterial/EdgesComponent.cpp index db9f7b6f88..fd186b6b2d 100644 --- a/source/Plugins/Generic/ToonMaterial/EdgesComponent.cpp +++ b/source/Plugins/Generic/ToonMaterial/EdgesComponent.cpp @@ -22,6 +22,8 @@ #include +CU_ImplementSmartPtr( toon, EdgesComponent ) + namespace toon { //********************************************************************************************* @@ -328,9 +330,9 @@ namespace toon castor3d::PassComponentUPtr EdgesComponent::doClone( castor3d::Pass & pass )const { - auto result = std::make_unique< EdgesComponent >( pass ); + auto result = castor::makeUnique< EdgesComponent >( pass ); result->setData( getData() ); - return result; + return castor::ptrRefCast< PassComponent >( result ); } bool EdgesComponent::doWriteText( castor::String const & tabs diff --git a/source/Plugins/Generic/ToonMaterial/EdgesComponent.hpp b/source/Plugins/Generic/ToonMaterial/EdgesComponent.hpp index 6d0dd7dc70..1223e183ae 100644 --- a/source/Plugins/Generic/ToonMaterial/EdgesComponent.hpp +++ b/source/Plugins/Generic/ToonMaterial/EdgesComponent.hpp @@ -173,6 +173,8 @@ namespace toon , castor::String const & subfolder , castor::StringStream & file )const override; }; + + CU_DeclareSmartPtr( toon, EdgesComponent, C3D_ToonMaterial_API ); } #endif diff --git a/source/Plugins/Generic/WaterRendering/WaterRenderPass.cpp b/source/Plugins/Generic/WaterRendering/WaterRenderPass.cpp index c887e281e6..8d288d9f97 100644 --- a/source/Plugins/Generic/WaterRendering/WaterRenderPass.cpp +++ b/source/Plugins/Generic/WaterRendering/WaterRenderPass.cpp @@ -164,7 +164,7 @@ namespace water , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ) + , castor3d::IsRenderPassEnabledUPtr isEnabled ) : castor3d::RenderTechniqueNodesPass{ parent , pass , context @@ -217,7 +217,7 @@ namespace water , crg::FramePassArray previousPasses ) { std::string name{ Name }; - auto isEnabled = std::make_shared< castor3d::IsRenderPassEnabled >(); + auto isEnabled = new castor3d::IsRenderPassEnabled{}; auto extent = technique.getTargetExtent(); auto & graph = technique.getGraph().createPassGroup( name ); @@ -267,7 +267,7 @@ namespace water .llpvResult( technique.getLlpvResult() ) .vctFirstBounce( technique.getFirstVctBounce() ) .vctSecondaryBounce( technique.getSecondaryVctBounce() ) - , isEnabled ); + , castor3d::IsRenderPassEnabledUPtr( isEnabled ) ); renderPasses[size_t( Event )].push_back( res.get() ); device.renderSystem.getEngine()->registerTimer( framePass.getFullName() , res->getTimer() ); diff --git a/source/Plugins/Generic/WaterRendering/WaterRenderPass.hpp b/source/Plugins/Generic/WaterRendering/WaterRenderPass.hpp index 881bb2089c..509c114302 100644 --- a/source/Plugins/Generic/WaterRendering/WaterRenderPass.hpp +++ b/source/Plugins/Generic/WaterRendering/WaterRenderPass.hpp @@ -30,7 +30,7 @@ namespace water , crg::ImageViewIdArray targetDepth , castor3d::RenderNodesPassDesc const & renderPassDesc , castor3d::RenderTechniquePassDesc const & techniquePassDesc - , std::shared_ptr< castor3d::IsRenderPassEnabled > isEnabled ); + , castor3d::IsRenderPassEnabledUPtr isEnabled ); ~WaterRenderPass()override; static crg::FramePassArray create( castor3d::RenderDevice const & device , castor3d::RenderTechnique & technique @@ -79,7 +79,7 @@ namespace water castor3d::ShaderPtr doGetPixelShaderSource( castor3d::PipelineFlags const & flags )const override; private: - std::shared_ptr< castor3d::IsRenderPassEnabled > m_isEnabled; + castor3d::IsRenderPassEnabledUPtr m_isEnabled; WaterUboConfiguration m_configuration; ashes::SamplerPtr m_linearWrapSampler; ashes::SamplerPtr m_pointClampSampler; diff --git a/source/Plugins/Importers/AssimpImporter/AssimpImporterFile.cpp b/source/Plugins/Importers/AssimpImporter/AssimpImporterFile.cpp index 0b9c05dfd3..1024d886a0 100644 --- a/source/Plugins/Importers/AssimpImporter/AssimpImporterFile.cpp +++ b/source/Plugins/Importers/AssimpImporter/AssimpImporterFile.cpp @@ -634,7 +634,7 @@ namespace c3d_assimp castor3d::MaterialImporterUPtr AssimpImporterFile::createMaterialImporter() { - return std::make_unique< AssimpMaterialImporter >( *getOwner() ); + return castor::makeUniqueDerived< castor3d::MaterialImporter, AssimpMaterialImporter >( *getOwner() ); } castor3d::AnimationImporterUPtr AssimpImporterFile::createAnimationImporter() @@ -644,22 +644,22 @@ namespace c3d_assimp castor3d::SkeletonImporterUPtr AssimpImporterFile::createSkeletonImporter() { - return std::make_unique< AssimpSkeletonImporter >( *getOwner() ); + return castor::makeUniqueDerived< castor3d::SkeletonImporter, AssimpSkeletonImporter >( *getOwner() ); } castor3d::MeshImporterUPtr AssimpImporterFile::createMeshImporter() { - return std::make_unique< AssimpMeshImporter >( *getOwner() ); + return castor::makeUniqueDerived< castor3d::MeshImporter, AssimpMeshImporter >( *getOwner() ); } castor3d::SceneNodeImporterUPtr AssimpImporterFile::createSceneNodeImporter() { - return std::make_unique< AssimpSceneNodeImporter >( *getOwner() ); + return castor::makeUniqueDerived< castor3d::SceneNodeImporter, AssimpSceneNodeImporter >( *getOwner() ); } castor3d::LightImporterUPtr AssimpImporterFile::createLightImporter() { - return std::make_unique< AssimpLightImporter >( *getOwner() ); + return castor::makeUniqueDerived< castor3d::LightImporter, AssimpLightImporter >( *getOwner() ); } castor3d::ImporterFileUPtr AssimpImporterFile::create( castor3d::Engine & engine @@ -667,7 +667,7 @@ namespace c3d_assimp , castor::Path const & path , castor3d::Parameters const & parameters ) { - return std::make_unique< AssimpImporterFile >( engine, scene, path, parameters ); + return castor::makeUniqueDerived< castor3d::ImporterFile, AssimpImporterFile >( engine, scene, path, parameters ); } void AssimpImporterFile::doPrelistMaterials() diff --git a/test/Castor3D/BinaryExportTest.cpp b/test/Castor3D/BinaryExportTest.cpp index 7c38bbe523..61fc73fdc1 100644 --- a/test/Castor3D/BinaryExportTest.cpp +++ b/test/Castor3D/BinaryExportTest.cpp @@ -59,7 +59,6 @@ namespace Testing doTestMesh( *src ); - scene.removeMesh( name, true ); scene.cleanup(); m_engine.getRenderLoop().renderSyncFrame(); } @@ -103,7 +102,6 @@ namespace Testing doTestMesh( *src ); - scene.removeMesh( name, true ); scene.cleanup(); m_engine.getRenderLoop().renderSyncFrame(); } @@ -156,11 +154,8 @@ namespace Testing dst->setSkeleton( skeleton ); } } - } - for ( auto & submesh : *dst ) - { - submesh->initialise( device ); + dst->initialise(); } auto & rhs = static_cast< Mesh const & >( *dst ); diff --git a/test/CastorTest/BenchManager.cpp b/test/CastorTest/BenchManager.cpp index 9608fbdda1..4721c7b939 100644 --- a/test/CastorTest/BenchManager.cpp +++ b/test/CastorTest/BenchManager.cpp @@ -6,8 +6,8 @@ namespace Testing { - std::vector< BenchCaseUPtr > BenchManager::m_benchs; - std::vector< TestCaseUPtr > BenchManager::m_cases; + std::vector< BenchCasePtr > BenchManager::m_benchs; + std::vector< TestCasePtr > BenchManager::m_cases; BenchManager::BenchManager() { @@ -19,12 +19,12 @@ namespace Testing m_cases.clear(); } - void BenchManager::registerType( BenchCaseUPtr bench ) + void BenchManager::registerType( BenchCasePtr bench ) { m_benchs.push_back( std::move( bench ) ); } - void BenchManager::registerType( TestCaseUPtr test ) + void BenchManager::registerType( TestCasePtr test ) { test->registerTests(); m_cases.push_back( std::move( test ) ); @@ -120,13 +120,13 @@ namespace Testing //************************************************************************************************* - bool registerType( BenchCaseUPtr bench ) + bool registerType( BenchCasePtr bench ) { BenchManager::registerType( std::move( bench ) ); return true; } - bool registerType( TestCaseUPtr test ) + bool registerType( TestCasePtr test ) { BenchManager::registerType( std::move( test ) ); return true; diff --git a/test/CastorTest/BenchManager.hpp b/test/CastorTest/BenchManager.hpp index 17660dd344..80024ee73d 100644 --- a/test/CastorTest/BenchManager.hpp +++ b/test/CastorTest/BenchManager.hpp @@ -11,19 +11,19 @@ namespace Testing public: BenchManager(); ~BenchManager(); - static void registerType( BenchCaseUPtr bench ); - static void registerType( TestCaseUPtr test ); + static void registerType( BenchCasePtr bench ); + static void registerType( TestCasePtr test ); static void ExecuteBenchs(); static void BenchsSummary(); static uint32_t ExecuteTests(); private: - static std::vector< BenchCaseUPtr > m_benchs; - static std::vector< TestCaseUPtr > m_cases; + static std::vector< BenchCasePtr > m_benchs; + static std::vector< TestCasePtr > m_cases; }; - bool registerType( BenchCaseUPtr bench ); - bool registerType( TestCaseUPtr test ); + bool registerType( BenchCasePtr bench ); + bool registerType( TestCasePtr test ); #define BENCHLOOP( iMax, ret )\ ret = ::Testing::BenchManager::ExecuteTests();\ diff --git a/test/CastorTest/CastorTestPrerequisites.hpp b/test/CastorTest/CastorTestPrerequisites.hpp index 392e1fbaf1..d1df794d99 100644 --- a/test/CastorTest/CastorTestPrerequisites.hpp +++ b/test/CastorTest/CastorTestPrerequisites.hpp @@ -38,13 +38,9 @@ namespace Testing class TestCase; class BenchManager; - using BenchCaseSPtr = std::shared_ptr< BenchCase >; - using BenchCaseWPtr = std::weak_ptr< BenchCase >; - using BenchCaseUPtr = std::unique_ptr< BenchCase >; + using BenchCasePtr = std::unique_ptr< BenchCase >; - using TestCaseSPtr = std::shared_ptr< TestCase >; - using TestCaseWPtr = std::weak_ptr< TestCase >; - using TestCaseUPtr = std::unique_ptr< TestCase >; + using TestCasePtr = std::unique_ptr< TestCase >; } #endif diff --git a/test/CastorTest/UnitTest.hpp b/test/CastorTest/UnitTest.hpp index 30f0b3e2fb..90a6dd1e80 100644 --- a/test/CastorTest/UnitTest.hpp +++ b/test/CastorTest/UnitTest.hpp @@ -4,6 +4,8 @@ #include "CastorTestPrerequisites.hpp" +#include + #include #include #include @@ -268,6 +270,17 @@ namespace Testing } }; + template< typename ValueT > + struct Stringifier< castor::UniquePtr< ValueT > > + { + static std::string get( castor::UniquePtr< ValueT > const & value ) + { + std::stringstream stream; + stream << ( value ? toString( *value ) : std::string{ "null_uptr" } ); + return stream.str(); + } + }; + template< typename ValueT > struct Stringifier< std::weak_ptr< ValueT > > { diff --git a/tools/CastorTestLauncher/CastorTestLauncher.cpp b/tools/CastorTestLauncher/CastorTestLauncher.cpp index a20a085849..45dfff3fbc 100644 --- a/tools/CastorTestLauncher/CastorTestLauncher.cpp +++ b/tools/CastorTestLauncher/CastorTestLauncher.cpp @@ -182,14 +182,14 @@ namespace test_launcher return result; } - castor3d::EngineSPtr CastorTestLauncher::doInitialiseCastor() + castor3d::EngineUPtr CastorTestLauncher::doInitialiseCastor() { if ( !castor::File::directoryExists( castor3d::Engine::getEngineDirectory() ) ) { castor::File::directoryCreate( castor3d::Engine::getEngineDirectory() ); } - castor3d::EngineSPtr castor = std::make_shared< castor3d::Engine >( cuT( "CastorTestLauncher" ) + auto castor = castor::makeUnique< castor3d::Engine >( cuT( "CastorTestLauncher" ) , castor3d::Version{ CastorTestLauncher_VERSION_MAJOR, CastorTestLauncher_VERSION_MINOR, CastorTestLauncher_VERSION_BUILD } , m_config.validate , !m_config.disableRandom diff --git a/tools/CastorTestLauncher/CastorTestLauncher.hpp b/tools/CastorTestLauncher/CastorTestLauncher.hpp index 6698474be2..e3cf921b6c 100644 --- a/tools/CastorTestLauncher/CastorTestLauncher.hpp +++ b/tools/CastorTestLauncher/CastorTestLauncher.hpp @@ -27,7 +27,7 @@ namespace test_launcher private: bool doParseCommandLine(); - castor3d::EngineSPtr doInitialiseCastor(); + castor3d::EngineUPtr doInitialiseCastor(); bool OnInit() override; int OnRun() override; diff --git a/tools/CastorViewer/MainFrame.cpp b/tools/CastorViewer/MainFrame.cpp index 7b50a97b80..e8be8369df 100644 --- a/tools/CastorViewer/MainFrame.cpp +++ b/tools/CastorViewer/MainFrame.cpp @@ -989,7 +989,7 @@ namespace CastorViewer castor3d::exporter::ExportOptions options; GuiCommon::PropertiesDialog dialog{ this , _( "Export" ) - , std::make_unique< GuiCommon::ExportOptionsTreeItemProperty >( true, options ) }; + , castor::makeUniqueDerived< GuiCommon::TreeItemProperty, GuiCommon::ExportOptionsTreeItemProperty >( true, options ) }; if ( dialog.ShowModal() == wxID_CANCEL ) { diff --git a/tools/CastorViewer/RenderPanel.cpp b/tools/CastorViewer/RenderPanel.cpp index 8c263dc61a..32309fb60b 100644 --- a/tools/CastorViewer/RenderPanel.cpp +++ b/tools/CastorViewer/RenderPanel.cpp @@ -23,8 +23,8 @@ #include -CU_ImplementCUSmartPtr( CastorViewer, MouseNodeEvent ) -CU_ImplementCUSmartPtr( CastorViewer, TranslateNodeEvent ) +CU_ImplementSmartPtr( CastorViewer, MouseNodeEvent ) +CU_ImplementSmartPtr( CastorViewer, TranslateNodeEvent ) namespace CastorViewer { diff --git a/tools/CastorViewer/RenderPanel.hpp b/tools/CastorViewer/RenderPanel.hpp index 2a53f5265e..bd7852aa67 100644 --- a/tools/CastorViewer/RenderPanel.hpp +++ b/tools/CastorViewer/RenderPanel.hpp @@ -43,8 +43,8 @@ namespace CastorViewer class MouseNodeEvent; class TranslateNodeEvent; - CU_DeclareCUSmartPtr( CastorViewer, MouseNodeEvent, ); - CU_DeclareCUSmartPtr( CastorViewer, TranslateNodeEvent, ); + CU_DeclareSmartPtr( CastorViewer, MouseNodeEvent, ); + CU_DeclareSmartPtr( CastorViewer, TranslateNodeEvent, ); class RenderPanel : public wxPanel diff --git a/tools/GuiCommon/GuiCommonPrerequisites.hpp b/tools/GuiCommon/GuiCommonPrerequisites.hpp index c46eb88a6f..bc81df222e 100644 --- a/tools/GuiCommon/GuiCommonPrerequisites.hpp +++ b/tools/GuiCommon/GuiCommonPrerequisites.hpp @@ -139,15 +139,11 @@ namespace GuiCommon template< typename ListT > class TreeListContainerT; - typedef std::shared_ptr< std::thread > thread_sptr; - typedef std::shared_ptr< LanguageInfo > LanguageInfoPtr; - typedef std::shared_ptr< LanguageFileContext > LanguageFileContextPtr; - typedef std::shared_ptr< StyleInfo > StyleInfoPtr; + CU_DeclareSmartPtr( GuiCommon, LanguageInfo, ); + CU_DeclareSmartPtr( GuiCommon, TreeItemProperty, ); - CU_DeclareSmartPtr( TreeItemProperty ); CU_DeclareMap( uint32_t, wxImage *, ImageId ); - CU_DeclareVector( thread_sptr, ThreadPtr ); - CU_DeclareVector( LanguageInfoPtr, LanguageInfoPtr ); + CU_DeclareVector( LanguageInfoUPtr, LanguageInfo ); static const wxColour PANEL_BACKGROUND_COLOUR = wxColour( 30, 30, 30 ); static const wxColour PANEL_FOREGROUND_COLOUR = wxColour( 220, 220, 220 ); diff --git a/tools/GuiCommon/Properties/TreeItems/LightTreeItemProperty.cpp b/tools/GuiCommon/Properties/TreeItems/LightTreeItemProperty.cpp index 3e6d81e993..f41b1669a0 100644 --- a/tools/GuiCommon/Properties/TreeItems/LightTreeItemProperty.cpp +++ b/tools/GuiCommon/Properties/TreeItems/LightTreeItemProperty.cpp @@ -176,21 +176,21 @@ namespace GuiCommon if ( m_light.getLightType() == castor3d::LightType::eDirectional ) { - addPropertyT( shadows, PROPERTY_SHADOW_VOLUMETRIC_STEPS, m_light.getCategory()->getVolumetricSteps(), m_light.getCategory().get(), &castor3d::LightCategory::setVolumetricSteps ); - addPropertyT( shadows, PROPERTY_SHADOW_VOLUMETRIC_SCATTERING_FACTOR, m_light.getCategory()->getVolumetricScatteringFactor(), m_light.getCategory().get(), &castor3d::LightCategory::setVolumetricScatteringFactor ); + addPropertyT( shadows, PROPERTY_SHADOW_VOLUMETRIC_STEPS, m_light.getCategory()->getVolumetricSteps(), m_light.getCategory(), &castor3d::LightCategory::setVolumetricSteps ); + addPropertyT( shadows, PROPERTY_SHADOW_VOLUMETRIC_SCATTERING_FACTOR, m_light.getCategory()->getVolumetricScatteringFactor(), m_light.getCategory(), &castor3d::LightCategory::setVolumetricScatteringFactor ); } auto raw = addProperty( shadows, PROPERTY_CATEGORY_SHADOW_RAW ); - addPropertyT( raw, PROPERTY_SHADOW_RAW_MIN_OFFSET, m_light.getCategory()->getShadowRawOffsets()[0], m_light.getCategory().get(), &castor3d::LightCategory::setRawMinOffset ); - addPropertyT( raw, PROPERTY_SHADOW_RAW_MAX_SLOPE_OFFSET, m_light.getCategory()->getShadowRawOffsets()[1], m_light.getCategory().get(), &castor3d::LightCategory::setRawMaxSlopeOffset ); + addPropertyT( raw, PROPERTY_SHADOW_RAW_MIN_OFFSET, m_light.getCategory()->getShadowRawOffsets()[0], m_light.getCategory(), &castor3d::LightCategory::setRawMinOffset ); + addPropertyT( raw, PROPERTY_SHADOW_RAW_MAX_SLOPE_OFFSET, m_light.getCategory()->getShadowRawOffsets()[1], m_light.getCategory(), &castor3d::LightCategory::setRawMaxSlopeOffset ); auto pcf = addProperty( shadows, PROPERTY_CATEGORY_SHADOW_PCF ); - addPropertyT( pcf, PROPERTY_SHADOW_PCF_MIN_OFFSET, m_light.getCategory()->getShadowPcfOffsets()[0], m_light.getCategory().get(), &castor3d::LightCategory::setPcfMinOffset ); - addPropertyT( pcf, PROPERTY_SHADOW_PCF_MAX_SLOPE_OFFSET, m_light.getCategory()->getShadowPcfOffsets()[1], m_light.getCategory().get(), &castor3d::LightCategory::setPcfMaxSlopeOffset ); - addPropertyT( pcf, PROPERTY_SHADOW_PCF_FILTER_SIZE, m_light.getCategory()->getShadowPcfFilterSize(), m_light.getCategory().get(), &castor3d::LightCategory::setPcfFilterSize ); - addPropertyT( pcf, PROPERTY_SHADOW_PCF_SAMPLE_COUNT, m_light.getCategory()->getShadowPcfSampleCount(), m_light.getCategory().get(), &castor3d::LightCategory::setPcfSampleCount ); + addPropertyT( pcf, PROPERTY_SHADOW_PCF_MIN_OFFSET, m_light.getCategory()->getShadowPcfOffsets()[0], m_light.getCategory(), &castor3d::LightCategory::setPcfMinOffset ); + addPropertyT( pcf, PROPERTY_SHADOW_PCF_MAX_SLOPE_OFFSET, m_light.getCategory()->getShadowPcfOffsets()[1], m_light.getCategory(), &castor3d::LightCategory::setPcfMaxSlopeOffset ); + addPropertyT( pcf, PROPERTY_SHADOW_PCF_FILTER_SIZE, m_light.getCategory()->getShadowPcfFilterSize(), m_light.getCategory(), &castor3d::LightCategory::setPcfFilterSize ); + addPropertyT( pcf, PROPERTY_SHADOW_PCF_SAMPLE_COUNT, m_light.getCategory()->getShadowPcfSampleCount(), m_light.getCategory(), &castor3d::LightCategory::setPcfSampleCount ); auto vsm = addProperty( shadows, PROPERTY_CATEGORY_SHADOW_VSM ); - addPropertyT( vsm, PROPERTY_SHADOW_VSM_MIN_VARIANCE, m_light.getCategory()->getVsmMinVariance(), m_light.getCategory().get(), &castor3d::LightCategory::setVsmMinVariance ); - addPropertyT( vsm, PROPERTY_SHADOW_VSM_LIGHT_BLEEDING_REDUCTION, m_light.getCategory()->getVsmLightBleedingReduction(), m_light.getCategory().get(), &castor3d::LightCategory::setVsmLightBleedingReduction ); + addPropertyT( vsm, PROPERTY_SHADOW_VSM_MIN_VARIANCE, m_light.getCategory()->getVsmMinVariance(), m_light.getCategory(), &castor3d::LightCategory::setVsmMinVariance ); + addPropertyT( vsm, PROPERTY_SHADOW_VSM_LIGHT_BLEEDING_REDUCTION, m_light.getCategory()->getVsmLightBleedingReduction(), m_light.getCategory(), &castor3d::LightCategory::setVsmLightBleedingReduction ); auto globalIllum = addProperty( shadows, PROPERTY_CATEGORY_GLOBAL_ILLUM ); addPropertyE( globalIllum, PROPERTY_SHADOW_GLOBAL_ILLUM_TYPE, giChoices, convert( m_light.getGlobalIlluminationType() ) diff --git a/tools/GuiCommon/Properties/TreeItems/TreeItemProperty.cpp b/tools/GuiCommon/Properties/TreeItems/TreeItemProperty.cpp index 169cacfe4c..3b013bc440 100644 --- a/tools/GuiCommon/Properties/TreeItems/TreeItemProperty.cpp +++ b/tools/GuiCommon/Properties/TreeItems/TreeItemProperty.cpp @@ -4,6 +4,8 @@ #include #include +CU_ImplementSmartPtr( GuiCommon, TreeItemProperty ) + namespace GuiCommon { namespace tiprop diff --git a/tools/GuiCommon/Shader/LanguageFileContext.hpp b/tools/GuiCommon/Shader/LanguageFileContext.hpp index e95b692fe2..e1f945a845 100644 --- a/tools/GuiCommon/Shader/LanguageFileContext.hpp +++ b/tools/GuiCommon/Shader/LanguageFileContext.hpp @@ -23,13 +23,13 @@ namespace GuiCommon explicit LanguageFileContext(); public: - LanguageInfoPtr currentLanguage; - StyleInfo * currentStyle{ nullptr }; + LanguageInfoUPtr currentLanguage{}; + StyleInfo * currentStyle{}; castor::UInt32StrMap mapFoldFlags; castor::UInt32StrMap mapTypes; castor::String strName; castor::StringArray keywords; - uint32_t index; + uint32_t index{}; }; } diff --git a/tools/GuiCommon/Shader/LanguageFileParser.cpp b/tools/GuiCommon/Shader/LanguageFileParser.cpp index 49434da77f..a96c1d8ea9 100644 --- a/tools/GuiCommon/Shader/LanguageFileParser.cpp +++ b/tools/GuiCommon/Shader/LanguageFileParser.cpp @@ -370,7 +370,7 @@ namespace GuiCommon void LanguageFileParser::doValidate( castor::PreprocessedFile & preprocessed ) { auto & context = getParserContext( preprocessed.getContext() ); - m_stcContext->push_back( context.currentLanguage ); + m_stcContext->push_back( std::move( context.currentLanguage ) ); } castor::String LanguageFileParser::doGetSectionName( castor::SectionId section )const diff --git a/tools/GuiCommon/Shader/LanguageInfo.cpp b/tools/GuiCommon/Shader/LanguageInfo.cpp index 852e4341a5..85417183a8 100644 --- a/tools/GuiCommon/Shader/LanguageInfo.cpp +++ b/tools/GuiCommon/Shader/LanguageInfo.cpp @@ -2,6 +2,8 @@ #include "GuiCommon/Shader/StyleInfo.hpp" +CU_ImplementSmartPtr( GuiCommon, LanguageInfo ) + namespace GuiCommon { static wxColour const CommentColour{ wxT( "FOREST GREEN" ) }; diff --git a/tools/GuiCommon/Shader/StcContext.cpp b/tools/GuiCommon/Shader/StcContext.cpp index 836eb02213..b4b58a0022 100644 --- a/tools/GuiCommon/Shader/StcContext.cpp +++ b/tools/GuiCommon/Shader/StcContext.cpp @@ -7,7 +7,7 @@ namespace GuiCommon { StcContext::StcContext() { - m_languages.push_back( std::make_shared< LanguageInfo >() ); + m_languages.push_back( castor::makeUnique< LanguageInfo >() ); } void StcContext::parseFile( wxString const & fileName ) diff --git a/tools/GuiCommon/Shader/StcContext.hpp b/tools/GuiCommon/Shader/StcContext.hpp index 24aa8707fd..cd3cacb0bc 100644 --- a/tools/GuiCommon/Shader/StcContext.hpp +++ b/tools/GuiCommon/Shader/StcContext.hpp @@ -31,29 +31,29 @@ namespace GuiCommon return m_languages.size(); } - inline LanguageInfoPtrArrayIt begin() + inline LanguageInfoArrayIt begin() { return m_languages.begin(); } - inline LanguageInfoPtrArrayConstIt begin()const + inline LanguageInfoArrayConstIt begin()const { return m_languages.begin(); } - inline LanguageInfoPtrArrayIt end() + inline LanguageInfoArrayIt end() { return m_languages.end(); } - inline LanguageInfoPtrArrayConstIt end()const + inline LanguageInfoArrayConstIt end()const { return m_languages.end(); } - inline void push_back( LanguageInfoPtr language ) + inline void push_back( LanguageInfoUPtr language ) { - m_languages.push_back( language ); + m_languages.push_back( std::move( language ) ); } public: @@ -72,7 +72,7 @@ namespace GuiCommon wxString fontName; private: - LanguageInfoPtrArray m_languages; + LanguageInfoArray m_languages; }; } diff --git a/tools/GuiCommon/Shader/StcTextEditor.cpp b/tools/GuiCommon/Shader/StcTextEditor.cpp index 764382712d..687f28eb11 100644 --- a/tools/GuiCommon/Shader/StcTextEditor.cpp +++ b/tools/GuiCommon/Shader/StcTextEditor.cpp @@ -220,7 +220,7 @@ namespace GuiCommon { wxString result; - for ( auto currInfo : m_context ) + for ( auto & currInfo : m_context ) { if ( result.empty() ) { @@ -256,7 +256,7 @@ namespace GuiCommon auto it = std::find_if( m_context.begin() , m_context.end() - , [&name]( LanguageInfoPtr lookup ) + , [&name]( LanguageInfoUPtr const & lookup ) { return lookup->name.c_str() == name; } ); @@ -273,7 +273,7 @@ namespace GuiCommon } else { - m_language = *it; + m_language = it->get(); if ( m_language->isCLike ) { diff --git a/tools/GuiCommon/Shader/StcTextEditor.hpp b/tools/GuiCommon/Shader/StcTextEditor.hpp index 00efabb3dc..5625d2e548 100644 --- a/tools/GuiCommon/Shader/StcTextEditor.hpp +++ b/tools/GuiCommon/Shader/StcTextEditor.hpp @@ -115,7 +115,7 @@ namespace GuiCommon m_filename = filename; } - inline LanguageInfoPtr getLanguageInfo() + inline LanguageInfoRPtr getLanguageInfo() { return m_language; } @@ -166,7 +166,7 @@ namespace GuiCommon private: wxString m_filename; wxString m_currentWord; - LanguageInfoPtr m_language; + LanguageInfoRPtr m_language{}; StcContext & m_context; int m_lineNrID; int m_lineNrMargin; diff --git a/tools/GuiCommon/System/CastorApplication.cpp b/tools/GuiCommon/System/CastorApplication.cpp index d9118c97d9..b3146bf355 100644 --- a/tools/GuiCommon/System/CastorApplication.cpp +++ b/tools/GuiCommon/System/CastorApplication.cpp @@ -480,7 +480,7 @@ namespace GuiCommon castor::Logger::setFileName( castor3d::Engine::getEngineDirectory() / ( m_internalName + cuT( ".log" ) ) ); castor::Logger::logInfo( m_internalName + cuT( " - Start" ) ); - m_castor = std::make_shared< castor3d::Engine >( m_internalName + m_castor = castor::makeUnique< castor3d::Engine >( m_internalName , m_version , m_config.validate , !m_config.disableRandom ); diff --git a/tools/GuiCommon/System/CastorApplication.hpp b/tools/GuiCommon/System/CastorApplication.hpp index 84045bc492..dda6b5bd4d 100644 --- a/tools/GuiCommon/System/CastorApplication.hpp +++ b/tools/GuiCommon/System/CastorApplication.hpp @@ -216,7 +216,7 @@ namespace GuiCommon ImagesLoader m_imagesLoader; castor::String m_internalName; castor::String m_displayName; - std::shared_ptr< castor3d::Engine > m_castor; + castor3d::EngineUPtr m_castor; private: std::unique_ptr< wxLocale > m_locale;