Skip to content

Commit

Permalink
Castor3D: Replaced remaining XxxSPtrs with their UPtr counterpart.
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonJoker committed Apr 10, 2023
1 parent 021f841 commit d7d320e
Show file tree
Hide file tree
Showing 450 changed files with 1,687 additions and 1,599 deletions.
2 changes: 1 addition & 1 deletion data/vcpkg/ports/ashes/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 6 additions & 5 deletions include/Core/Castor3D/Animation/AnimationModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;
//@}
Expand Down
15 changes: 8 additions & 7 deletions include/Core/Castor3D/Buffer/BufferModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Buffer/UniformBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/Core/Castor3D/Cache/CacheModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
//@}
}

Expand Down
35 changes: 0 additions & 35 deletions include/Core/Castor3D/Cache/ElementProducer.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/Core/Castor3D/Cache/ShaderCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace castor3d
struct AutoGeneratedProgram
{
PipelineFlags flags;
ShaderProgramRPtr program{};
ShaderProgramRPtr program;
};
using ShaderProgramCont = std::vector< AutoGeneratedProgram >;

Expand Down
8 changes: 4 additions & 4 deletions include/Core/Castor3D/Castor3DModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
1 change: 0 additions & 1 deletion include/Core/Castor3D/Castor3DPch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ See LICENSE file in root folder
#include <CastorUtils/Design/ArrayView.hpp>
#include <CastorUtils/Design/BlockGuard.hpp>
#include <CastorUtils/Design/ChangeTracked.hpp>
#include <CastorUtils/Design/Collection.hpp>
#include <CastorUtils/Design/DelayedInitialiser.hpp>
#include <CastorUtils/Design/Factory.hpp>
#include <CastorUtils/Design/FlagCombination.hpp>
Expand Down
1 change: 0 additions & 1 deletion include/Core/Castor3D/Castor3DPrerequisites.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ See LICENSE file in root folder

#include "Castor3D/Miscellaneous/Logger.hpp"

#include <CastorUtils/Design/Collection.hpp>
#include <CastorUtils/Graphics/Size.hpp>
#include <CastorUtils/Math/Quaternion.hpp>
#include <CastorUtils/Math/SquareMatrix.hpp>
Expand Down
12 changes: 6 additions & 6 deletions include/Core/Castor3D/Event/Frame/FrameEventModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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.
Expand Down
16 changes: 9 additions & 7 deletions include/Core/Castor3D/Event/UserInput/UserInputEventModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//@}
//@}
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlButton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlComboBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace castor3d
{
}

C3D_API ~ComboBoxCtrl()noexcept;
C3D_API ~ComboBoxCtrl()noexcept override;

/** Appends a new item
*\param[in] value The item
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlEdit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlExpandablePanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlListBox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace castor3d
{
}

C3D_API ~ListBoxCtrl()noexcept;
C3D_API ~ListBoxCtrl()noexcept override;

/** Appends a new item
*\param[in] value The item
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlProgress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlScrollBar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlSlider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/Core/Castor3D/Gui/Controls/CtrlStatic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
64 changes: 32 additions & 32 deletions include/Core/Castor3D/Gui/GuiModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;

Expand Down
9 changes: 4 additions & 5 deletions include/Core/Castor3D/Material/MaterialModule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 );
Expand Down
Loading

0 comments on commit d7d320e

Please sign in to comment.