From 45560b5c5b972cd861a7e53f482e1be59f4529c2 Mon Sep 17 00:00:00 2001 From: sguionni Date: Thu, 10 Oct 2024 21:44:10 +0200 Subject: [PATCH] Remove no more used scene_item_entity --- .../app/core/renderer/renderer_system.hpp | 4 +++ .../app/entity/scene/scene_item_entity.hpp | 18 ----------- lib/app/src/app/application/scene.cpp | 1 + .../app/entity/scene/scene_item_entity.cpp | 30 ------------------- .../src/app/entity/scene/viewpoint_entity.cpp | 1 - 5 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 lib/app/include/app/entity/scene/scene_item_entity.hpp delete mode 100644 lib/app/src/app/entity/scene/scene_item_entity.cpp diff --git a/lib/app/include/app/core/renderer/renderer_system.hpp b/lib/app/include/app/core/renderer/renderer_system.hpp index 0d4b7d5f6..e5817169b 100644 --- a/lib/app/include/app/core/renderer/renderer_system.hpp +++ b/lib/app/include/app/core/renderer/renderer_system.hpp @@ -14,6 +14,10 @@ namespace VTX::App::Core::Renderer RendererSystem() : VTX::Renderer::Facade( 1, 1, SHADER_DIR ) {} + /** + * @brief Initialize the renderer system, must be called before construction. + * @param p_shaderPath the path to the shader directory. + */ inline static void init( const FilePath & p_shaderPath ) { SHADER_DIR = p_shaderPath; } }; diff --git a/lib/app/include/app/entity/scene/scene_item_entity.hpp b/lib/app/include/app/entity/scene/scene_item_entity.hpp deleted file mode 100644 index 5c45d3d91..000000000 --- a/lib/app/include/app/entity/scene/scene_item_entity.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __VTX_APP_ENTITY_APPLICATION_SCENE_ITEM_ENTITY__ -#define __VTX_APP_ENTITY_APPLICATION_SCENE_ITEM_ENTITY__ - -#include "app/core/ecs/base_entity.hpp" -#include - -namespace VTX::App::Entity::Scene -{ - class SceneItemEntityBuilder - { - public: - static void addComponent( const Core::ECS::BaseEntity & p_entity, const Util::VariantMap & p_extraData ); - static void setup( const Core::ECS::BaseEntity & p_entity, const Util::VariantMap & p_extraData ); - static void postSetup( const Core::ECS::BaseEntity & p_entity, const Util::VariantMap & p_extraData ); - }; - -} // namespace VTX::App::Entity::Scene -#endif diff --git a/lib/app/src/app/application/scene.cpp b/lib/app/src/app/application/scene.cpp index 00919687f..231f08652 100644 --- a/lib/app/src/app/application/scene.cpp +++ b/lib/app/src/app/application/scene.cpp @@ -247,6 +247,7 @@ namespace VTX::App::Application // TOCHECK: do that in state or in scene? // (let that here instead of doing the exact same things in all states for the moment) + // TODO: remove polymorphism. Core::ECS::View updatables = MAIN_REGISTRY().findComponents(); diff --git a/lib/app/src/app/entity/scene/scene_item_entity.cpp b/lib/app/src/app/entity/scene/scene_item_entity.cpp deleted file mode 100644 index b2468bc9e..000000000 --- a/lib/app/src/app/entity/scene/scene_item_entity.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "app/entity/scene/scene_item_entity.hpp" -#include "app/application/scene.hpp" -#include "app/component/chemistry/molecule.hpp" -#include "app/vtx_app.hpp" - -namespace VTX::App::Entity::Scene -{ - void SceneItemEntityBuilder::addComponent( - const Core::ECS::BaseEntity & p_entity, - const Util::VariantMap & p_extraData - ) - { - MAIN_REGISTRY().addComponent( p_entity ); - } - - void SceneItemEntityBuilder::setup( const Core::ECS::BaseEntity & p_entity, const Util::VariantMap & p_extraData ) - { - } - void SceneItemEntityBuilder::postSetup( - const Core::ECS::BaseEntity & p_entity, - const Util::VariantMap & p_extraData - ) - { - Application::Scene * const scene = p_extraData.at( "scene" ).getPtr(); - Component::Scene::SceneItemComponent & sceneItemComponent - = MAIN_REGISTRY().getComponent( p_entity ); - - scene->referenceItem( sceneItemComponent ); - } -} // namespace VTX::App::Entity::Scene diff --git a/lib/app/src/app/entity/scene/viewpoint_entity.cpp b/lib/app/src/app/entity/scene/viewpoint_entity.cpp index d6de1f1f9..949e45537 100644 --- a/lib/app/src/app/entity/scene/viewpoint_entity.cpp +++ b/lib/app/src/app/entity/scene/viewpoint_entity.cpp @@ -3,7 +3,6 @@ #include "app/component/render/viewpoint.hpp" #include "app/component/scene/selectable.hpp" #include "app/component/scene/transform_component.hpp" -#include "app/entity/scene/scene_item_entity.hpp" #include "app/vtx_app.hpp" #include #include