From b92bffb43e03a2fac08a294c0f4effe627497015 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 10 Mar 2022 20:45:19 +0300 Subject: [PATCH] Implement resource sprites and about page with third-party logos --- include/core/corefactory.h | 4 +- include/core/resourceholder.h | 21 ++- include/core/sprite.h | 10 +- resources/gui-texture.png | Bin 0 -> 25062 bytes src/application/include/application/about.h | 39 ++++++ .../include/application/mainmenu.h | 1 + src/application/include/application/state.h | 1 + src/application/src/about.cpp | 59 +++++++++ src/application/src/application.cpp | 7 +- src/application/src/mainmenu.cpp | 6 + src/impl/sfml/corefactorysfml.cpp | 28 +++- src/impl/sfml/corefactorysfml.h | 4 + src/impl/sfml/spritesfml.cpp | 33 +++++ src/impl/sfml/spritesfml.h | 25 ++++ src/modes/classicmode/editor/mockelement.h | 8 +- .../classicmode/editor/selectionmanager.cpp | 2 +- src/modes/classicmode/game/arrowelement.h | 4 +- .../animations/classicanimationscenario.h | 6 +- .../classicdyinganimationscenario.cpp | 4 +- .../classicdyinganimationscenario.h | 2 +- .../classicflyinganimationscenario.cpp | 4 +- .../classicflyinganimationscenario.h | 2 +- .../graphics/classicgraphicsfactory.cpp | 8 +- .../graphics/classicgraphicsfactory.h | 8 +- .../graphics/classicnotegraphics.cpp | 70 ++++++++++ .../graphics/classicnotegraphics.h | 41 ++++++ .../graphics/classicscenegraphicsmanager.h | 12 +- .../classicmode/graphics/classicselection.cpp | 25 ---- .../graphics/classicselectiongraphics.cpp | 25 ++++ ...selection.h => classicselectiongraphics.h} | 12 +- .../classicmode/graphics/classicsprite.cpp | 70 ---------- .../classicmode/graphics/classicsprite.h | 41 ------ .../classictimelinegraphicsmanager.cpp | 121 ------------------ .../graphics/classictimelinegraphicsmanager.h | 42 ------ 34 files changed, 403 insertions(+), 342 deletions(-) create mode 100644 resources/gui-texture.png create mode 100644 src/application/include/application/about.h create mode 100644 src/application/src/about.cpp create mode 100644 src/impl/sfml/spritesfml.cpp create mode 100644 src/impl/sfml/spritesfml.h create mode 100644 src/modes/classicmode/graphics/classicnotegraphics.cpp create mode 100644 src/modes/classicmode/graphics/classicnotegraphics.h delete mode 100644 src/modes/classicmode/graphics/classicselection.cpp create mode 100644 src/modes/classicmode/graphics/classicselectiongraphics.cpp rename src/modes/classicmode/graphics/{classicselection.h => classicselectiongraphics.h} (53%) delete mode 100644 src/modes/classicmode/graphics/classicsprite.cpp delete mode 100644 src/modes/classicmode/graphics/classicsprite.h delete mode 100644 src/modes/classicmode/graphics/classictimelinegraphicsmanager.cpp delete mode 100644 src/modes/classicmode/graphics/classictimelinegraphicsmanager.h diff --git a/include/core/corefactory.h b/include/core/corefactory.h index c96357b..8c73f9e 100644 --- a/include/core/corefactory.h +++ b/include/core/corefactory.h @@ -8,6 +8,7 @@ #include "core/rectangle.h" #include "core/vector.h" #include "core/line.h" +#include "core/sprite.h" namespace kku { @@ -20,7 +21,8 @@ public: virtual std::shared_ptr getText(kku::Font::Id id) const = 0; virtual std::shared_ptr getRectangle() const = 0; virtual std::shared_ptr getLine() const = 0; + virtual std::shared_ptr getSprite(kku::GUISprite::Id id) const = 0; virtual kku::Vector2 getRenderSize() const = 0; }; -} \ No newline at end of file +} diff --git a/include/core/resourceholder.h b/include/core/resourceholder.h index fee19ed..5b76e3f 100644 --- a/include/core/resourceholder.h +++ b/include/core/resourceholder.h @@ -15,7 +15,7 @@ public: _resources[id] = std::move(resource); } - inline const std::shared_ptr& get(Id id) const + inline std::shared_ptr get(Id id) const { return _resources.find(id)->second; } @@ -32,4 +32,21 @@ namespace Font }; } -} \ No newline at end of file +namespace Texture +{ + enum class Id + { + GUI + }; +} + +namespace GUISprite +{ + enum class Id + { + SFML_LOGO, + CRYPTOPP_LOGO + }; +} + +} diff --git a/include/core/sprite.h b/include/core/sprite.h index 6a67176..63707b2 100644 --- a/include/core/sprite.h +++ b/include/core/sprite.h @@ -1,5 +1,7 @@ #pragma once +#include "core/area.h" + namespace kku { @@ -7,8 +9,12 @@ class Sprite { public: virtual ~Sprite() = default; - virtual void reset() = 0; + + virtual void setPosition(const Point& position) = 0; + virtual Point getPosition() const = 0; + virtual void move(const kku::Vector2& delta) = 0; + virtual void display() const = 0; }; -} \ No newline at end of file +} diff --git a/resources/gui-texture.png b/resources/gui-texture.png new file mode 100644 index 0000000000000000000000000000000000000000..3473180fd853f2c627271a121eec3a98892735a8 GIT binary patch literal 25062 zcmXtA1yqym+uz9114fE4LPC&k5JrbeDc#+Tlypd^h?JznOPA8pB}fWLmlDz~{oVf0 z`NomM#x|Zk&vjqduWqB%R1^qssc|6?2!WEKtOf)EO$0w{!mz-1>%H1Q@IaWYjEtI+ zj11Dn&DqMi!w-6Ekt){r;9W2`yehYFvEZ|4?G{ zFABblYD^ofj5e%-F@#A(Zhc6%99GgG`MSPC3;nv(>z#VvB&m>)QAY`fM_H$v&h60Ve6j;B(Fc^Mw5K2CN9uq>6MN?UzfO}pW#Y+ zMz4(%OM_Q}3f;ZxykGHZ&8caEr>CakDh_u(UvW z*?QO@6_j46X$KQhKp;qnlC0D#@3~z=pEShO=lezdXI`oo9v2>?U(xwGs`0zOM&@F@ zN@R6XFX(#4War1@Y8-_}U7%zXJKFOIS3D!i5C`d}@AJGE*=-#DqJtJA$a7un;p(&1Uq+e=l=Bih1pmh9$b#oohgjKOedD zy??}j`gCC=E(_J+{92G-ZjoYcv5(xTFHf!)Nsh7#4uwmX@&}K2!W^FEc%gQtR^fws6dsXH9SIoom}$L1^itN)Tx+`qA+lQej6G}@bNP=e3;5* zOsI~qr{Fa3Hr3Laj&~k1@D|UeGOB8bO!Ph)pbVYgi%FnZ9!pvV@I6JAxoVRYJ85K7q@}pYOG=uim!v3!)urKX+#r zpnF})23Jy#j!$@{`CYfxVo*O6i-5Y_WmVdrPBX!2#Iv)r^WASb z_{uA-xGCh%dA>W#cROpHV`wdyiK+bGxF|Y3#>0mX|6Yy;256g_u5!I}R{0@t`Wd3# z%io}OqF(%W)tGvCgrn|cPBK=^%jNxggkZ7l@OUx#)6@qYL6oRbyASdy30{j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x1n+ye01v}AmZ08@Cni2wiq literal 0 HcmV?d00001 diff --git a/src/application/include/application/about.h b/src/application/include/application/about.h new file mode 100644 index 0000000..2785529 --- /dev/null +++ b/src/application/include/application/about.h @@ -0,0 +1,39 @@ +#pragma once + +#include "application/state.h" +#include "core/corefactory.h" +#include "core/functional.h" + +class Group; +class PushButton; + +namespace kku { class Sprite; class Text; } + +class About : public GUIState +{ +public: + + struct Callbacks + { + kku::lambda onLeaveAboutState; + }; + + explicit About(const std::shared_ptr& factory, Callbacks&& callbacks); + virtual void input(const kku::SystemEvent& event) override; + virtual void update(const kku::microsec& dt) override; + virtual void display() const override; + + virtual void enter() override; + virtual void leave() override; + +private: + const Callbacks _callbacks; + const std::shared_ptr _core_factory; + const std::shared_ptr _sfml_logo; + const std::shared_ptr _cryptopp_logo; + const std::shared_ptr _powered_by_text; + + std::shared_ptr _buttons; + std::shared_ptr _exit_button; +}; + diff --git a/src/application/include/application/mainmenu.h b/src/application/include/application/mainmenu.h index 5b4c293..c61f32f 100644 --- a/src/application/include/application/mainmenu.h +++ b/src/application/include/application/mainmenu.h @@ -14,6 +14,7 @@ public: { kku::lambda onAppendGameState; kku::lambda onAppendEditorState; + kku::lambda onAppendAboutState; }; explicit MainMenu(const std::shared_ptr& factory, Callbacks&& callbacks); diff --git a/src/application/include/application/state.h b/src/application/include/application/state.h index 3260284..1db6b3e 100644 --- a/src/application/include/application/state.h +++ b/src/application/include/application/state.h @@ -19,6 +19,7 @@ public: EDITOR_PICKER, EDITOR, SETTINGS, + ABOUT, AMOUNT }; diff --git a/src/application/src/about.cpp b/src/application/src/about.cpp new file mode 100644 index 0000000..eb1a31d --- /dev/null +++ b/src/application/src/about.cpp @@ -0,0 +1,59 @@ +#include "application/about.h" +#include "widgets/pushbutton.h" +#include "widgets/group.h" + +About::About(const std::shared_ptr& factory, About::Callbacks&& callbacks) : + _callbacks(std::move(callbacks)), + _core_factory(factory), + _sfml_logo(factory->getSprite(kku::GUISprite::Id::SFML_LOGO)), + _cryptopp_logo(factory->getSprite(kku::GUISprite::Id::CRYPTOPP_LOGO)), + _powered_by_text(factory->getText(kku::Font::Id::GUI)), + _buttons(std::make_shared()) +{ + _powered_by_text->setString("Powered by: "); + _powered_by_text->move(kku::Vector2{0., 60}); + _sfml_logo->move(kku::Vector2{230., 60}); + _cryptopp_logo->move(kku::Vector2{250., 180}); +} + +void About::input(const kku::SystemEvent& event) +{ + _buttons->input(event); +} + +void About::update(const kku::microsec& dt) +{ + _buttons->update(dt); +} + +void About::display() const +{ + _buttons->display(); + _sfml_logo->display(); + _cryptopp_logo->display(); + _powered_by_text->display(); +} + +void About::enter() +{ + const auto render_size = _core_factory->getRenderSize(); + const float window_width = render_size.first; + const float window_height = render_size.second; + + if (!_exit_button) + { + _exit_button = std::make_shared("Return", _core_factory, 48); + _exit_button->setCallback(_callbacks.onLeaveAboutState); + _buttons->addChild(_exit_button); + } + + _exit_button->setRect(kku::Area{window_width / 3.f, window_height / 7.f * 4, + window_width / 3.f, window_height / 7.f}); + _buttons->setVisibility(); +} + +void About::leave() +{ + _buttons->setVisibility(false); +} + diff --git a/src/application/src/application.cpp b/src/application/src/application.cpp index ab19aee..5b992b7 100644 --- a/src/application/src/application.cpp +++ b/src/application/src/application.cpp @@ -5,6 +5,7 @@ #include "application/mainmenu.h" #include "application/gamestate.h" #include "application/editorstate.h" +#include "application/about.h" #include "classicmode/classicfactory.h" @@ -16,18 +17,22 @@ bool Application::init() MainMenu::Callbacks callbacks = { [&](){ pushState(GUIState::Tag::GAME); }, - [&](){ pushState(GUIState::Tag::EDITOR); } + [&](){ pushState(GUIState::Tag::EDITOR); }, + [&](){ pushState(GUIState::Tag::ABOUT); }, }; EditorState::Callbacks editor_callbacks = {[&](){ popState(); }}; + About::Callbacks about_callbacks = {[&](){ popState(); }}; const auto main_menu = std::make_shared(_core_factory, std::move(callbacks)); const auto game_state = std::make_shared(_core_factory, classic::getGame(_core_factory), GameState::Callbacks()); const auto editor = std::make_shared(_core_factory, classic::getEditor(_core_factory), std::move(editor_callbacks)); + const auto about = std::make_shared(_core_factory, std::move(about_callbacks)); _states[GUIState::Tag::MAIN_MENU] = main_menu; _states[GUIState::Tag::GAME] = game_state; _states[GUIState::Tag::EDITOR] = editor; + _states[GUIState::Tag::ABOUT] = about; pushState(GUIState::Tag::MAIN_MENU); diff --git a/src/application/src/mainmenu.cpp b/src/application/src/mainmenu.cpp index b19e5e8..e5fb395 100644 --- a/src/application/src/mainmenu.cpp +++ b/src/application/src/mainmenu.cpp @@ -40,8 +40,14 @@ void MainMenu::enter() window_width / 3.f, window_height / 7.f}); button_editor->setCallback(_callbacks.onAppendEditorState); + auto button_about = std::make_shared("About", _core_factory, 48); + button_about->setRect(kku::Area{window_width / 3.f, window_height / 7.f * 5, + window_width / 3.f, window_height / 7.f}); + button_about->setCallback(_callbacks.onAppendAboutState); + _buttons->addChild(button_start); _buttons->addChild(button_editor); + _buttons->addChild(button_about); _buttons->setVisibility(); } diff --git a/src/impl/sfml/corefactorysfml.cpp b/src/impl/sfml/corefactorysfml.cpp index 84d98cc..f8f2626 100644 --- a/src/impl/sfml/corefactorysfml.cpp +++ b/src/impl/sfml/corefactorysfml.cpp @@ -4,13 +4,18 @@ #include "musicsfml.h" #include "textsfml.h" #include "linesfml.h" +#include "spritesfml.h" CoreFactorySFML::CoreFactorySFML(sf::RenderTarget * const render_target) : _render_target(render_target) { auto gui_font = std::make_unique(); - gui_font->loadFromFile("SourceCodePro-Regular.ttf"); + gui_font->loadFromFile("resources/SourceCodePro-Regular.ttf"); _font_holder.load(kku::Font::Id::GUI, std::move(gui_font)); + + auto menu_texture = std::make_unique(); + menu_texture->loadFromFile("resources/gui-texture.png"); + _texture_holder.load(kku::Texture::Id::GUI, std::move(menu_texture)); } std::shared_ptr CoreFactorySFML::getMusic() const @@ -33,6 +38,27 @@ std::shared_ptr CoreFactorySFML::getRectangle() const return std::make_unique(_render_target); } + std::shared_ptr CoreFactorySFML::getSprite(kku::GUISprite::Id id) const + { + const auto texture = _texture_holder.get(kku::Texture::Id::GUI); + switch (id) + { + default: + return nullptr; + break; + + case kku::GUISprite::Id::SFML_LOGO: + return std::make_unique(_render_target, _texture_holder.get(kku::Texture::Id::GUI), + kku::Area{0, 0, 252, 81}); + break; + + case kku::GUISprite::Id::CRYPTOPP_LOGO: + return std::make_unique(_render_target, _texture_holder.get(kku::Texture::Id::GUI), + kku::Area{252, 0, 135, 36}); + break; + } + } + kku::Vector2 CoreFactorySFML::getRenderSize() const { const sf::Vector2u size = _render_target->getSize(); diff --git a/src/impl/sfml/corefactorysfml.h b/src/impl/sfml/corefactorysfml.h index dd71524..5592466 100644 --- a/src/impl/sfml/corefactorysfml.h +++ b/src/impl/sfml/corefactorysfml.h @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "core/corefactory.h" @@ -14,9 +16,11 @@ public: virtual std::shared_ptr getText(kku::Font::Id id) const override; virtual std::shared_ptr getRectangle() const override; virtual std::shared_ptr getLine() const override; + virtual std::shared_ptr getSprite(kku::GUISprite::Id id) const override; virtual kku::Vector2 getRenderSize() const override; private: sf::RenderTarget * const _render_target; kku::ResourceHolder _font_holder; + kku::ResourceHolder _texture_holder; }; diff --git a/src/impl/sfml/spritesfml.cpp b/src/impl/sfml/spritesfml.cpp new file mode 100644 index 0000000..dc0706b --- /dev/null +++ b/src/impl/sfml/spritesfml.cpp @@ -0,0 +1,33 @@ +#include "spritesfml.h" + +SpriteSFML::SpriteSFML(sf::RenderTarget * const render_target, + const std::shared_ptr& texture, + const kku::Area &cropping) : + _render_target(render_target), + _sprite(*texture, sf::IntRect(cropping.left, cropping.top, cropping.width, cropping.height)) +{} + +void SpriteSFML::setPosition(const kku::Point& position) +{ + _sprite.setPosition(position.x, position.y); +} + +kku::Point SpriteSFML::getPosition() const +{ + const auto& position = _sprite.getPosition(); + return kku::Point + { + position.x, + position.y + }; +} + +void SpriteSFML::move(const kku::Vector2& delta) +{ + _sprite.move({delta.first, delta.second}); +} + +void SpriteSFML::display() const +{ + _render_target->draw(_sprite); +} diff --git a/src/impl/sfml/spritesfml.h b/src/impl/sfml/spritesfml.h new file mode 100644 index 0000000..e7310f9 --- /dev/null +++ b/src/impl/sfml/spritesfml.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include + +#include "core/sprite.h" + +class SpriteSFML : public kku::Sprite +{ +public: + explicit SpriteSFML(sf::RenderTarget * const render_target, + const std::shared_ptr &texture, + const kku::Area& cropping); + + virtual void setPosition(const kku::Point& position) override; + virtual kku::Point getPosition() const override; + virtual void move(const kku::Vector2& delta) override; + + virtual void display() const override; + +protected: + sf::RenderTarget * const _render_target; + sf::Sprite _sprite; +}; diff --git a/src/modes/classicmode/editor/mockelement.h b/src/modes/classicmode/editor/mockelement.h index 91f7f0c..bcc0dff 100644 --- a/src/modes/classicmode/editor/mockelement.h +++ b/src/modes/classicmode/editor/mockelement.h @@ -10,13 +10,13 @@ #include class ClassicAnimationScenario; -class ClassicSprite; -class ClassicSelection; +class ClassicNoteGraphics; +class ClassicSelectionGraphics; struct MockElement { - std::shared_ptr sprite; - std::shared_ptr selection; + std::shared_ptr sprite; + std::shared_ptr selection; bool selected; std::array, 5> animations; diff --git a/src/modes/classicmode/editor/selectionmanager.cpp b/src/modes/classicmode/editor/selectionmanager.cpp index ec7330d..40276fd 100644 --- a/src/modes/classicmode/editor/selectionmanager.cpp +++ b/src/modes/classicmode/editor/selectionmanager.cpp @@ -1,7 +1,7 @@ #include "selectionmanager.h" #include "classicmocknote.h" #include "mockelement.h" -#include "graphics/classicselection.h" +#include "graphics/classicselectiongraphics.h" #include SelectionManager::SelectionManager() : diff --git a/src/modes/classicmode/game/arrowelement.h b/src/modes/classicmode/game/arrowelement.h index c6c3043..3eb43bd 100644 --- a/src/modes/classicmode/game/arrowelement.h +++ b/src/modes/classicmode/game/arrowelement.h @@ -9,12 +9,12 @@ #include #include -class ClassicSprite; +class ClassicNoteGraphics; class ClassicAnimationScenario; struct ArrowElement { - std::shared_ptr sprite; + std::shared_ptr sprite; std::array, 5> animations; kku::SystemEvent::Key::Code pressed_as = kku::SystemEvent::Key::Code::Unknown; diff --git a/src/modes/classicmode/graphics/animations/classicanimationscenario.h b/src/modes/classicmode/graphics/animations/classicanimationscenario.h index 8ce4e3e..aa001f7 100644 --- a/src/modes/classicmode/graphics/animations/classicanimationscenario.h +++ b/src/modes/classicmode/graphics/animations/classicanimationscenario.h @@ -4,19 +4,19 @@ #include -class ClassicSprite; +class ClassicNoteGraphics; class ClassicAnimationScenario { public: virtual ~ClassicAnimationScenario() = default; - virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) = 0; + virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) = 0; virtual void update(const kku::microsec& music_offset) = 0; virtual bool isDone() const = 0; protected: - std::shared_ptr _sprite; + std::shared_ptr _sprite; kku::microsec _time_begin; kku::microsec _time_end; }; diff --git a/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.cpp b/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.cpp index 610fba2..117e164 100644 --- a/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.cpp +++ b/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.cpp @@ -1,7 +1,7 @@ #include "classicdyinganimationscenario.h" -#include "graphics/classicsprite.h" +#include "graphics/classicnotegraphics.h" -void ClassicDyingAnimationScenario::launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) +void ClassicDyingAnimationScenario::launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) { _sprite = sprite; _time_begin = time_begin; diff --git a/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.h b/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.h index 9e71198..300f7ae 100644 --- a/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.h +++ b/src/modes/classicmode/graphics/animations/classicdyinganimationscenario.h @@ -5,7 +5,7 @@ class ClassicDyingAnimationScenario : public ClassicAnimationScenario { public: - virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec& time_end) override; + virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec& time_end) override; virtual void update(const kku::microsec& music_offset) override; virtual bool isDone() const override; }; diff --git a/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.cpp b/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.cpp index 5fd1b74..70a25ed 100644 --- a/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.cpp +++ b/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.cpp @@ -1,7 +1,7 @@ #include "classicflyinganimationscenario.h" -#include "graphics/classicsprite.h" +#include "graphics/classicnotegraphics.h" -void ClassicFlyingAnimationScenario::launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) +void ClassicFlyingAnimationScenario::launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec &time_end) { _sprite = sprite; _time_begin = time_begin; diff --git a/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.h b/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.h index 6771a5a..fda6911 100644 --- a/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.h +++ b/src/modes/classicmode/graphics/animations/classicflyinganimationscenario.h @@ -6,7 +6,7 @@ class ClassicFlyingAnimationScenario : public ClassicAnimationScenario { public: - virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec& time_end) override; + virtual void launch(const std::shared_ptr sprite, const kku::microsec& time_begin, const kku::microsec& time_end) override; virtual void update(const kku::microsec& music_offset) override; virtual bool isDone() const override; diff --git a/src/modes/classicmode/graphics/classicgraphicsfactory.cpp b/src/modes/classicmode/graphics/classicgraphicsfactory.cpp index efaf9e0..bd9e49f 100644 --- a/src/modes/classicmode/graphics/classicgraphicsfactory.cpp +++ b/src/modes/classicmode/graphics/classicgraphicsfactory.cpp @@ -43,14 +43,14 @@ auto ClassicGraphicsFactory::generate(Type type) const -> SpriteData return SpriteData{shape, trail, color}; } -std::shared_ptr ClassicGraphicsFactory::createSprite(Type type) const +std::shared_ptr ClassicGraphicsFactory::createSprite(Type type) const { const auto data = generate(type); - return std::make_shared(ClassicSprite::Init{data.shape, data.trail, data.color}); + return std::make_shared(ClassicNoteGraphics::Init{data.shape, data.trail, data.color}); } -std::shared_ptr ClassicGraphicsFactory::createSelection() const +std::shared_ptr ClassicGraphicsFactory::createSelection() const { const auto shape = _core_factory->getRectangle(); - return std::make_shared(ClassicSelection::Init{shape, kku::Color{51, 153, 255, 120}}); + return std::make_shared(ClassicSelectionGraphics::Init{shape, kku::Color{51, 153, 255, 120}}); } diff --git a/src/modes/classicmode/graphics/classicgraphicsfactory.h b/src/modes/classicmode/graphics/classicgraphicsfactory.h index 8688bca..cfe19e4 100644 --- a/src/modes/classicmode/graphics/classicgraphicsfactory.h +++ b/src/modes/classicmode/graphics/classicgraphicsfactory.h @@ -3,8 +3,8 @@ #include #include "classicmode/classicactions.h" -#include "graphics/classicsprite.h" -#include "graphics/classicselection.h" +#include "graphics/classicnotegraphics.h" +#include "graphics/classicselectiongraphics.h" #include "core/rectangle.h" #include "core/corefactory.h" @@ -13,8 +13,8 @@ class ClassicGraphicsFactory public: explicit ClassicGraphicsFactory(const std::shared_ptr& core_factory); - std::shared_ptr createSprite(Type type) const; - std::shared_ptr createSelection() const; + std::shared_ptr createSprite(Type type) const; + std::shared_ptr createSelection() const; private: const std::shared_ptr _core_factory; diff --git a/src/modes/classicmode/graphics/classicnotegraphics.cpp b/src/modes/classicmode/graphics/classicnotegraphics.cpp new file mode 100644 index 0000000..134e4e8 --- /dev/null +++ b/src/modes/classicmode/graphics/classicnotegraphics.cpp @@ -0,0 +1,70 @@ +#include "classicnotegraphics.h" + +ClassicNoteGraphics::ClassicNoteGraphics(ClassicNoteGraphics::Init&& init) : + _reset_color(init.color), + _shape(init.shape), + _trail(init.trail) +{ + _shape->setColor(init.color); + _trail->setColor(init.color); +} + +void ClassicNoteGraphics::reset() +{ + _shape->setPosition(kku::Point{0, 0}); + _trail->setPosition(kku::Point{0, 0}); + + _shape->setColor(_reset_color); + _trail->setColor(_reset_color); +} + +void ClassicNoteGraphics::setPosition(const kku::Point& position) +{ + _shape->setPosition(position); +} + +void ClassicNoteGraphics::setTrailPosition(const kku::Point &position) +{ + _trail->setPosition(position); +} + +kku::Point ClassicNoteGraphics::getPosition() const +{ + return _shape->getPosition(); +} + +kku::Point ClassicNoteGraphics::getTrailPosition() const +{ + return _trail->getPosition(); +} + +void ClassicNoteGraphics::setColor(const kku::Color& color) +{ + _shape->setColor(color); +} + +void ClassicNoteGraphics::setTrailColor(const kku::Color& color) +{ + _trail->setColor(color); +} + +kku::Color ClassicNoteGraphics::getColor() const +{ + return _shape->getColor(); +} + +kku::Color ClassicNoteGraphics::getTrailColor() const +{ + return _trail->getColor(); +} + +void ClassicNoteGraphics::display() const +{ + _shape->display(); + _trail->display(); +} + +std::shared_ptr ClassicNoteGraphics::getRectangle() const +{ + return _shape; +} diff --git a/src/modes/classicmode/graphics/classicnotegraphics.h b/src/modes/classicmode/graphics/classicnotegraphics.h new file mode 100644 index 0000000..f0b5831 --- /dev/null +++ b/src/modes/classicmode/graphics/classicnotegraphics.h @@ -0,0 +1,41 @@ +#pragma once + +#include "core/sprite.h" +#include "core/point.h" +#include "core/color.h" +#include "core/rectangle.h" + +#include + +class ClassicNoteGraphics +{ +public: + + struct Init + { + std::shared_ptr shape; + std::shared_ptr trail; + kku::Color color; + }; + + ClassicNoteGraphics(ClassicNoteGraphics::Init&& init); + void reset(); + void display() const; + + void setPosition(const kku::Point &position); + void setTrailPosition(const kku::Point &position); + kku::Point getPosition() const; + kku::Point getTrailPosition() const; + + void setColor(const kku::Color& color); + void setTrailColor(const kku::Color& color); + kku::Color getColor() const; + kku::Color getTrailColor() const; + + std::shared_ptr getRectangle() const; + +protected: + kku::Color _reset_color; + std::shared_ptr _shape; + std::shared_ptr _trail; +}; diff --git a/src/modes/classicmode/graphics/classicscenegraphicsmanager.h b/src/modes/classicmode/graphics/classicscenegraphicsmanager.h index 4764b89..a35156c 100644 --- a/src/modes/classicmode/graphics/classicscenegraphicsmanager.h +++ b/src/modes/classicmode/graphics/classicscenegraphicsmanager.h @@ -48,7 +48,7 @@ public: for (auto it = _first; it != _last; ++it) { - display((*it)->getElements()); + //display((*it)->getElements()); } } @@ -139,8 +139,8 @@ public: element.sprite->setPosition(element.position); element.sprite->setTrailPosition(kku::Point( 0.f, 9.f )); - element.selection = _factory->createSelection(); - element.selection->adjustTo(element.sprite); + //element.selection = _factory->createSelection(); + //element.selection->adjustTo(element.sprite); element.animations[ClassicNote::State::NONE] = nullptr; element.animations[ClassicNote::State::FLYING] = std::make_shared(); @@ -165,7 +165,7 @@ public: } protected: - kku::SpriteContainer _sprite_container; + kku::SpriteContainer _sprite_container; const std::shared_ptr _factory; typedef typename std::set::const_iterator Iterator; @@ -207,7 +207,7 @@ protected: && offset <= note->getPerfectOffset()) { note->setState(ClassicNote::State::FLYING); - setGraphics(note, kku::TimeRange{note->getPerfectOffset() - _visibility_offset, note->getPerfectOffset()}); + //setGraphics(note, kku::TimeRange{note->getPerfectOffset() - _visibility_offset, note->getPerfectOffset()}); } } else @@ -242,7 +242,7 @@ protected: && offset <= note->getPerfectOffset()) { note->setState(ClassicNote::State::FLYING); - note->setGraphics(this, kku::TimeRange{note->getPerfectOffset() - _visibility_offset, note->getPerfectOffset()}); + //note->setGraphics(this, kku::TimeRange{note->getPerfectOffset() - _visibility_offset, note->getPerfectOffset()}); } ++note_iterator; diff --git a/src/modes/classicmode/graphics/classicselection.cpp b/src/modes/classicmode/graphics/classicselection.cpp deleted file mode 100644 index bae13b9..0000000 --- a/src/modes/classicmode/graphics/classicselection.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "classicselection.h" -#include "classicsprite.h" - -ClassicSelection::ClassicSelection(ClassicSelection::Init&& init) : - _fill_color(init.color), - _shape(init.shape) -{ - _shape->setColor(init.color); -} - -void ClassicSelection::reset() -{ - _shape->setPosition(kku::Point{0, 0}); - _shape->setColor(kku::Color{51, 153, 255, 120}); -} - -void ClassicSelection::display() const -{ - _shape->display(); -} - -void ClassicSelection::adjustTo(const std::shared_ptr& sprite) -{ - _shape->setRect(sprite->getRectangle()->getRect()); -} diff --git a/src/modes/classicmode/graphics/classicselectiongraphics.cpp b/src/modes/classicmode/graphics/classicselectiongraphics.cpp new file mode 100644 index 0000000..8781425 --- /dev/null +++ b/src/modes/classicmode/graphics/classicselectiongraphics.cpp @@ -0,0 +1,25 @@ +#include "classicselectiongraphics.h" +#include "classicnotegraphics.h" + +ClassicSelectionGraphics::ClassicSelectionGraphics(ClassicSelectionGraphics::Init&& init) : + _fill_color(init.color), + _shape(init.shape) +{ + _shape->setColor(init.color); +} + +void ClassicSelectionGraphics::reset() +{ + _shape->setPosition(kku::Point{0, 0}); + _shape->setColor(kku::Color{51, 153, 255, 120}); +} + +void ClassicSelectionGraphics::display() const +{ + _shape->display(); +} + +void ClassicSelectionGraphics::adjustTo(const std::shared_ptr& sprite) +{ + _shape->setRect(sprite->getRectangle()->getRect()); +} diff --git a/src/modes/classicmode/graphics/classicselection.h b/src/modes/classicmode/graphics/classicselectiongraphics.h similarity index 53% rename from src/modes/classicmode/graphics/classicselection.h rename to src/modes/classicmode/graphics/classicselectiongraphics.h index e3808bc..1108fc1 100644 --- a/src/modes/classicmode/graphics/classicselection.h +++ b/src/modes/classicmode/graphics/classicselectiongraphics.h @@ -6,9 +6,9 @@ #include -class ClassicSprite; +class ClassicNoteGraphics; -class ClassicSelection : public kku::Sprite +class ClassicSelectionGraphics { public: @@ -18,11 +18,11 @@ public: kku::Color color; }; - explicit ClassicSelection(ClassicSelection::Init&& init); - virtual void reset() override; - virtual void display() const override; + explicit ClassicSelectionGraphics(ClassicSelectionGraphics::Init&& init); + void reset(); + void display() const; - void adjustTo(const std::shared_ptr& sprite); + void adjustTo(const std::shared_ptr& sprite); protected: kku::Color _fill_color; diff --git a/src/modes/classicmode/graphics/classicsprite.cpp b/src/modes/classicmode/graphics/classicsprite.cpp deleted file mode 100644 index 5fc94f6..0000000 --- a/src/modes/classicmode/graphics/classicsprite.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "classicsprite.h" - -ClassicSprite::ClassicSprite(ClassicSprite::Init&& init) : - _reset_color(init.color), - _shape(init.shape), - _trail(init.trail) -{ - _shape->setColor(init.color); - _trail->setColor(init.color); -} - -void ClassicSprite::reset() -{ - _shape->setPosition(kku::Point{0, 0}); - _trail->setPosition(kku::Point{0, 0}); - - _shape->setColor(_reset_color); - _trail->setColor(_reset_color); -} - -void ClassicSprite::setPosition(const kku::Point& position) -{ - _shape->setPosition(position); -} - -void ClassicSprite::setTrailPosition(const kku::Point &position) -{ - _trail->setPosition(position); -} - -kku::Point ClassicSprite::getPosition() const -{ - return _shape->getPosition(); -} - -kku::Point ClassicSprite::getTrailPosition() const -{ - return _trail->getPosition(); -} - -void ClassicSprite::setColor(const kku::Color& color) -{ - _shape->setColor(color); -} - -void ClassicSprite::setTrailColor(const kku::Color& color) -{ - _trail->setColor(color); -} - -kku::Color ClassicSprite::getColor() const -{ - return _shape->getColor(); -} - -kku::Color ClassicSprite::getTrailColor() const -{ - return _trail->getColor(); -} - -void ClassicSprite::display() const -{ - _shape->display(); - _trail->display(); -} - -std::shared_ptr ClassicSprite::getRectangle() const -{ - return _shape; -} diff --git a/src/modes/classicmode/graphics/classicsprite.h b/src/modes/classicmode/graphics/classicsprite.h deleted file mode 100644 index 40f7e0a..0000000 --- a/src/modes/classicmode/graphics/classicsprite.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "core/sprite.h" -#include "core/point.h" -#include "core/color.h" -#include "core/rectangle.h" - -#include - -class ClassicSprite : public kku::Sprite -{ -public: - - struct Init - { - std::shared_ptr shape; - std::shared_ptr trail; - kku::Color color; - }; - - explicit ClassicSprite(ClassicSprite::Init&& init); - virtual void reset() override; - virtual void display() const override; - - virtual void setPosition(const kku::Point &position); - virtual void setTrailPosition(const kku::Point &position); - virtual kku::Point getPosition() const; - virtual kku::Point getTrailPosition() const; - - virtual void setColor(const kku::Color& color); - virtual void setTrailColor(const kku::Color& color); - virtual kku::Color getColor() const; - virtual kku::Color getTrailColor() const; - - std::shared_ptr getRectangle() const; - -protected: - kku::Color _reset_color; - std::shared_ptr _shape; - std::shared_ptr _trail; -}; diff --git a/src/modes/classicmode/graphics/classictimelinegraphicsmanager.cpp b/src/modes/classicmode/graphics/classictimelinegraphicsmanager.cpp deleted file mode 100644 index c497860..0000000 --- a/src/modes/classicmode/graphics/classictimelinegraphicsmanager.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "classictimelinegraphicsmanager.h" - -#include "editor/mockelement.h" -#include "game/arrowelement.h" - -ClassicTimelineGraphicsManager::ClassicTimelineGraphicsManager(const std::shared_ptr>& timeline, - const std::shared_ptr& factory, - const kku::microsec& visibility_offset) : - ClassicGraphicsManager(visibility_offset), - _sprite_container({Type::UP, Type::DOWN, - Type::LEFT, Type::RIGHT}, - factory), - _factory(factory), - _timeline(timeline) -{ -} - -void ClassicTimelineGraphicsManager::input(kku::GameEvent&& input) -{ - (void)input; -} - -void ClassicTimelineGraphicsManager::display() const -{ - if (nothingToDraw()) - return; -} - -void ClassicTimelineGraphicsManager::update(const kku::microsec &offset) -{ - fetchLastNote(offset); - fetchFirstNote(offset); - - updateVisibleNotes(offset); -} - -void ClassicTimelineGraphicsManager::display(const std::vector& elements) const -{ - for (std::size_t i = 0; i < elements.size(); ++i) - { - const auto& sprite = elements[i].sprite; - - if (i >= 1) - { - //const auto& neighbor_sprite = elements[i - 1].sprite; - - //const auto c1 = neighbor_sprite->trailPosition(); - //const auto c2 = sprite->trailPosition(); - - //_render_target->draw(makeLine(c1, c2)); - } - - sprite->display(); - } -} - -void ClassicTimelineGraphicsManager::setGraphics(std::vector& elements, kku::TimeRange &&range) -{ - (void)elements; (void)range; -} - -void ClassicTimelineGraphicsManager::display(const std::vector& elements) const -{ - for (std::size_t i = 0; i < elements.size(); ++i) - { - const auto& sprite = elements[i].sprite; - - if (i >= 1) - { - //const auto& neighbor_sprite = elements[i - 1].sprite; - - //const auto c1 = neighbor_sprite->trailPosition(); - //const auto c2 = sprite->trailPosition(); - - //_render_target->draw(makeLine(c1, c2)); - } - - sprite->display(); - } -} - -void ClassicTimelineGraphicsManager::setGraphics(std::vector& elements, kku::TimeRange &&range) -{ - (void)elements; (void)range; -} - -/*sf::VertexArray ClassicSceneGraphicsSFML::makeLine(const kku::Point& c1, const kku::Point& c2) const -{ - sf::VertexArray line(sf::LinesStrip, 2); - line[0].color = sf::Color::Yellow; - line[0].position = {c1.x + 10, c1.y}; - line[1].color = sf::Color::Blue; - line[1].position = {c2.x + 10, c2.y}; - - return line; -}*/ - -void ClassicTimelineGraphicsManager::updateVisibleNotes(const kku::microsec &offset) -{ - (void)offset; -} - -void ClassicTimelineGraphicsManager::fetchFirstNote(const kku::microsec& offset) -{ - (void)offset; // ???? -} - -void ClassicTimelineGraphicsManager::fetchLastNote(const kku::microsec& offset) -{ - (void)offset; // ???? -} - -bool ClassicTimelineGraphicsManager::nothingToDraw() const noexcept -{ - return true; -} - -bool ClassicTimelineGraphicsManager::isVisiblyClose(const ClassicNote * const note, const kku::microsec& music_offset) const noexcept -{ - return note && music_offset; -} diff --git a/src/modes/classicmode/graphics/classictimelinegraphicsmanager.h b/src/modes/classicmode/graphics/classictimelinegraphicsmanager.h deleted file mode 100644 index ac92422..0000000 --- a/src/modes/classicmode/graphics/classictimelinegraphicsmanager.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "classicmode/classicnote.h" -#include "graphics/classicgraphicsmanager.h" -#include "graphics/classicgraphicsfactory.h" -#include "core/timeline.h" -#include "core/spritecontainer.h" - -class ClassicSprite; - -class ClassicTimelineGraphicsManager : public ClassicGraphicsManager -{ -public: - explicit ClassicTimelineGraphicsManager(const std::shared_ptr>& timeline, - const std::shared_ptr& factory, - const kku::microsec& visibility_offset); - - virtual void input(kku::GameEvent&& input) override; - - virtual void display() const override; - virtual void update(const kku::microsec& offset) override; - - virtual void display(const std::vector& elements) const override; - virtual void setGraphics(std::vector& elements, kku::TimeRange&& range) override; - - virtual void display(const std::vector& elements) const override; - virtual void setGraphics(std::vector& elements, kku::TimeRange&& range) override; - -protected: - kku::SpriteContainer _sprite_container; - const std::shared_ptr _factory; - - const std::shared_ptr> _timeline; - - inline bool nothingToDraw() const noexcept; - inline bool isVisiblyClose(const ClassicNote * const note, const kku::microsec& music_offset) const noexcept; - //inline sf::VertexArray makeLine(const kku::Point& c1, const kku::Point& c2) const; - - void fetchFirstNote(const kku::microsec& offset); - void fetchLastNote(const kku::microsec& offset); - void updateVisibleNotes(const kku::microsec& offset); -};