mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-15 00:11:55 +07:00
dummy editor system
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "components/sprite_renderer.hpp"
|
||||
#include "components/touchable.hpp"
|
||||
|
||||
#include "systems/editor_system.hpp"
|
||||
#include "systems/flipbook_system.hpp"
|
||||
#include "systems/input_system.hpp"
|
||||
#include "systems/label_system.hpp"
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace e2d
|
||||
class sprite_renderer;
|
||||
class touchable;
|
||||
|
||||
class editor_system;
|
||||
class flipbook_system;
|
||||
class input_system;
|
||||
class label_system;
|
||||
|
||||
26
headers/enduro2d/high/systems/editor_system.hpp
Normal file
26
headers/enduro2d/high/systems/editor_system.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "_systems.hpp"
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
class editor_system final
|
||||
: public ecs::system<ecs::after<systems::post_render_event>> {
|
||||
public:
|
||||
editor_system();
|
||||
~editor_system() noexcept final;
|
||||
|
||||
void process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::post_render_event>& trigger) override;
|
||||
private:
|
||||
class internal_state;
|
||||
std::unique_ptr<internal_state> state_;
|
||||
};
|
||||
}
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <enduro2d/high/components/sprite_renderer.hpp>
|
||||
#include <enduro2d/high/components/touchable.hpp>
|
||||
|
||||
#include <enduro2d/high/systems/editor_system.hpp>
|
||||
#include <enduro2d/high/systems/flipbook_system.hpp>
|
||||
#include <enduro2d/high/systems/input_system.hpp>
|
||||
#include <enduro2d/high/systems/label_system.hpp>
|
||||
@@ -58,6 +59,8 @@ namespace
|
||||
|
||||
bool initialize() final {
|
||||
ecs::registry_filler(the<world>().registry())
|
||||
.feature<struct editor_feature>(ecs::feature()
|
||||
.add_system<editor_system>())
|
||||
.feature<struct flipbook_feature>(ecs::feature()
|
||||
.add_system<flipbook_system>())
|
||||
.feature<struct input_feature>(ecs::feature()
|
||||
|
||||
41
sources/enduro2d/high/systems/editor_system.cpp
Normal file
41
sources/enduro2d/high/systems/editor_system.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#include <enduro2d/high/systems/editor_system.hpp>
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
//
|
||||
// editor_system::internal_state
|
||||
//
|
||||
|
||||
class editor_system::internal_state final : private noncopyable {
|
||||
public:
|
||||
internal_state() = default;
|
||||
~internal_state() noexcept = default;
|
||||
|
||||
void process(ecs::registry& owner) {
|
||||
E2D_UNUSED(owner);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// editor_system
|
||||
//
|
||||
|
||||
editor_system::editor_system()
|
||||
: state_(new internal_state()) {}
|
||||
editor_system::~editor_system() noexcept = default;
|
||||
|
||||
void editor_system::process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::post_render_event>& trigger)
|
||||
{
|
||||
E2D_UNUSED(trigger);
|
||||
E2D_PROFILER_SCOPE("editor_system.process");
|
||||
state_->process(owner);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user