You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
project-kyoku/src/application/widgets/editorwidget.cpp

56 lines
1.0 KiB
C++

#include "editorwidget.h"
#include "core/editor.h"
EditorWidget::EditorWidget(const std::shared_ptr<Editor>& editor) :
_editor(editor)
{}
void EditorWidget::input(const sf::Event& event)
{
_editor->input(PlayerInput{0, event});
}
void EditorWidget::update(const sf::Time& dt)
{
_editor->update(dt);
}
void EditorWidget::draw(sf::RenderTarget& target, sf::RenderStates states) const
{
// !!!!!!!!!!!!!!!!!
(void)target; (void)states;
_editor->draw();
}
void EditorWidget::move(const sf::Vector2f& delta)
{
(void)delta;
// delegate to children
}
bool EditorWidget::isUnderMouse(int mouse_x, int mouse_y) const
{
return _parent->isUnderMouse(mouse_x, mouse_y);
}
void EditorWidget::setRect(const sf::FloatRect& rect)
{
(void)rect;
// basically useless beacuse editor widget fills the entire screen
}
sf::FloatRect EditorWidget::rect() const
{
return {};
}
void EditorWidget::setPosition(const sf::Vector2f& position)
{
(void)position;
}
sf::Vector2f EditorWidget::position() const
{
return {};
}