2021-12-29 15:59:18 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "game/classicnote.h"
|
|
|
|
#include "graphics/classicgraphicsmanager.h"
|
2022-01-18 04:15:59 +01:00
|
|
|
#include "graphics/classicspritefactory.h"
|
2021-12-29 15:59:18 +01:00
|
|
|
#include "core/timeline.h"
|
2022-01-18 04:15:59 +01:00
|
|
|
#include "core/spritecontainer.h"
|
2021-12-29 15:59:18 +01:00
|
|
|
|
|
|
|
class ClassicSprite;
|
|
|
|
|
|
|
|
class ClassicSceneGraphicsManager : public ClassicGraphicsManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ClassicSceneGraphicsManager(const std::shared_ptr<kku::Timeline<ClassicNote>>& timeline,
|
|
|
|
const std::shared_ptr<ClassicSpriteFactory>& factory,
|
|
|
|
const kku::microsec& visibility_offset);
|
|
|
|
|
|
|
|
virtual void display() const override;
|
|
|
|
virtual void update(const kku::microsec& offset) override;
|
|
|
|
|
|
|
|
virtual void display(const std::vector<ArrowElement>& elements) const override;
|
|
|
|
virtual void setGraphics(std::vector<ArrowElement>& elements, kku::TimeRange&& range) override;
|
|
|
|
|
|
|
|
protected:
|
2022-01-18 04:15:59 +01:00
|
|
|
kku::SpriteContainer<Type, ClassicSpriteFactory, ClassicSprite> _sprite_container;
|
2021-12-29 15:59:18 +01:00
|
|
|
using Iterator = kku::Timeline<ClassicNote>::Iterator;
|
|
|
|
|
|
|
|
Iterator _first;
|
|
|
|
Iterator _last;
|
|
|
|
|
|
|
|
const std::shared_ptr<kku::Timeline<ClassicNote>> _timeline;
|
|
|
|
|
|
|
|
inline bool nothingToDraw() const noexcept;
|
|
|
|
inline bool isVisiblyClose(const Iterator& iterator, 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);
|
|
|
|
};
|