Fix runtime failures after sfml-bridge merge

This commit is contained in:
NaiJi ✨ 2022-01-12 00:01:28 +03:00
parent 381e4442ae
commit 5b5b2c2aa1
5 changed files with 12 additions and 3 deletions

View File

@ -141,6 +141,9 @@ private:
inline void updateTopNote(const microsec& music_offset) noexcept inline void updateTopNote(const microsec& music_offset) noexcept
{ {
if (isExpired(_top_note))
return;
const auto& top_note = *_top_note; const auto& top_note = *_top_note;
bool already_played = top_note->getPerfectOffset() < music_offset bool already_played = top_note->getPerfectOffset() < music_offset

View File

@ -7,7 +7,7 @@
BPMCalculatorWidget::BPMCalculatorWidget(const std::shared_ptr<BPMCalculator>& bpm_calculator, const std::shared_ptr<kku::CoreFactory>& factory) : BPMCalculatorWidget::BPMCalculatorWidget(const std::shared_ptr<BPMCalculator>& bpm_calculator, const std::shared_ptr<kku::CoreFactory>& factory) :
Window(factory, "BPM Calculation"), Window(factory, "BPM Calculation"),
_bpm_calculator(bpm_calculator), _bpm_calculator(bpm_calculator),
_slider(std::make_shared<BPMSlider>()), _slider(std::make_shared<BPMSlider>(factory)),
_core_factory(factory), _core_factory(factory),
_ticked(false) _ticked(false)
{ {

View File

@ -1,7 +1,10 @@
#include "bpmslider.h" #include "bpmslider.h"
BPMSlider::BPMSlider() BPMSlider::BPMSlider(const std::shared_ptr<kku::CoreFactory> &factory)
{ {
_slider_background = factory->getRectangle();
_slider_tick = factory->getRectangle();
_slider_background->setColor(kku::Color{0, 0, 0, 255}); _slider_background->setColor(kku::Color{0, 0, 0, 255});
_slider_tick->setColor(kku::Color{255, 0, 0, 255}); _slider_tick->setColor(kku::Color{255, 0, 0, 255});
} }

View File

@ -2,11 +2,12 @@
#include "widget.h" #include "widget.h"
#include "core/rectangle.h" #include "core/rectangle.h"
#include "core/corefactory.h"
class BPMSlider : public Widget class BPMSlider : public Widget
{ {
public: public:
explicit BPMSlider(); explicit BPMSlider(const std::shared_ptr<kku::CoreFactory>& factory);
virtual void input(const kku::SystemEvent& event) override; virtual void input(const kku::SystemEvent& event) override;
virtual void update(const kku::microsec& dt) override; virtual void update(const kku::microsec& dt) override;

View File

@ -6,6 +6,8 @@ CascadeMenuButton::CascadeMenuButton(const std::string& text, const std::shared_
{ {
_color_idle = kku::Color{230, 230, 230, 255}; _color_idle = kku::Color{230, 230, 230, 255};
_color_hover = kku::Color{84, 158, 253, 255}; _color_hover = kku::Color{84, 158, 253, 255};
_button_content = factory->getRectangle();
_button_content->setColor(_color_idle); _button_content->setColor(_color_idle);
} }