From a74bb0aa00fda0b448f1442338bc54096c98c296 Mon Sep 17 00:00:00 2001 From: ShenMian <70068015+ShenMian@users.noreply.github.com> Date: Wed, 27 Apr 2022 21:13:36 +0800 Subject: [PATCH 1/2] Remove unnecessary code --- engine/source/runtime/engine.h | 3 --- .../runtime/function/framework/world/world_manager.h | 3 --- engine/source/runtime/function/scene/scene_manager.h | 4 ---- engine/source/runtime/function/scene/scene_object.h | 7 ------- engine/source/runtime/function/ui/ui_system.h | 3 --- 5 files changed, 20 deletions(-) diff --git a/engine/source/runtime/engine.h b/engine/source/runtime/engine.h index e11d9596e..a12c4c321 100644 --- a/engine/source/runtime/engine.h +++ b/engine/source/runtime/engine.h @@ -72,9 +72,6 @@ namespace Pilot void fps(float delta_time); public: - PilotEngine(const PilotEngine&) = delete; - PilotEngine& operator=(const PilotEngine&) = delete; - void startEngine(const EngineInitParams& param); void shutdownEngine(); diff --git a/engine/source/runtime/function/framework/world/world_manager.h b/engine/source/runtime/function/framework/world/world_manager.h index 58cbd1efd..3d48fca5e 100644 --- a/engine/source/runtime/function/framework/world/world_manager.h +++ b/engine/source/runtime/function/framework/world/world_manager.h @@ -18,9 +18,6 @@ namespace Pilot public: virtual ~WorldManager(); - WorldManager(const WorldManager&) = delete; - WorldManager& operator=(const WorldManager&) = delete; - void initialize(); void clear(); diff --git a/engine/source/runtime/function/scene/scene_manager.h b/engine/source/runtime/function/scene/scene_manager.h index 915e255b6..a77d70b07 100644 --- a/engine/source/runtime/function/scene/scene_manager.h +++ b/engine/source/runtime/function/scene/scene_manager.h @@ -17,10 +17,6 @@ namespace Pilot { friend class PublicSingleton; - public: - SceneManager(const SceneManager&) = delete; - SceneManager& operator=(const SceneManager&) = delete; - protected: SceneManager() = default; std::shared_ptr m_scene = std::make_shared(); diff --git a/engine/source/runtime/function/scene/scene_object.h b/engine/source/runtime/function/scene/scene_object.h index b2959345d..1cb429578 100644 --- a/engine/source/runtime/function/scene/scene_object.h +++ b/engine/source/runtime/function/scene/scene_object.h @@ -85,13 +85,6 @@ namespace Pilot GameObjectDesc(size_t go_id, const std::vector& components) : m_go_id(go_id), m_components(components) {} - GameObjectDesc(const GameObjectDesc& t) { *this = t; } - GameObjectDesc& operator=(const GameObjectDesc& t) - { - m_go_id = t.m_go_id; - m_components = t.m_components; - return *this; - } size_t getId() const { return m_go_id; } const std::vector& getComponents() const { return m_components; } diff --git a/engine/source/runtime/function/ui/ui_system.h b/engine/source/runtime/function/ui/ui_system.h index cd4b551bb..7983f003f 100644 --- a/engine/source/runtime/function/ui/ui_system.h +++ b/engine/source/runtime/function/ui/ui_system.h @@ -9,9 +9,6 @@ namespace Pilot friend class PublicSingleton; public: - PUIManager(const PUIManager&) = delete; - PUIManager& operator=(const PUIManager&) = delete; - int initialize(); int update(); int clear(); From 943bdd5eb61ae989fa52e67aa1cfa309e66e0bcb Mon Sep 17 00:00:00 2001 From: ShenMian <70068015+ShenMian@users.noreply.github.com> Date: Wed, 27 Apr 2022 21:15:21 +0800 Subject: [PATCH 2/2] Fix config_manager.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 防止创建多个实例. --- .../runtime/resource/config_manager/config_manager.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/engine/source/runtime/resource/config_manager/config_manager.h b/engine/source/runtime/resource/config_manager/config_manager.h index 158fdfbf2..e3dcfc8a3 100644 --- a/engine/source/runtime/resource/config_manager/config_manager.h +++ b/engine/source/runtime/resource/config_manager/config_manager.h @@ -10,12 +10,6 @@ namespace Pilot { friend class PublicSingleton; - public: - ConfigManager(const ConfigManager&) = delete; - ConfigManager& operator=(const ConfigManager&) = delete; - // - ConfigManager() = default; - private: std::filesystem::path m_root_folder; std::filesystem::path m_asset_folder; @@ -26,6 +20,9 @@ namespace Pilot std::filesystem::path m_editor_font_path; std::filesystem::path m_global_rendering_res_path; + protected: + ConfigManager() = default; + public: void initialize(const EngineInitParams& init_param);