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/modes/classicmode/game/classicgamegraphicsmanager.h

38 lines
1.3 KiB
C++

#pragma once
#include "game/classicarrownote.h"
#include "graphics/classicgraphicsmanager.h"
#include "core/timeline.h"
#include <SFML/Graphics/RenderTarget.hpp>
class ClassicSprite;
class ClassicGameGraphicsManager : public ClassicGraphicsManager
{
public:
explicit ClassicGameGraphicsManager(Timeline<ClassicNote>& timeline, const microsec& visibility_offset);
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
void draw(const std::vector<ClassicArrowNote::ArrowElement>& elements, sf::RenderTarget& target, sf::RenderStates states) const;
void setGraphics(std::vector<ClassicArrowNote::ArrowElement> &elements, TimeRange&& range);
virtual void update(const microsec& offset) override;
private:
using Iterator = Timeline<ClassicNote>::Iterator;
Iterator _first;
Iterator _last;
Timeline<ClassicNote> * const _timeline;
inline bool nothingToDraw() const noexcept;
inline bool isVisiblyClose(const Iterator& iterator, const microsec& music_offset) const noexcept;
inline sf::VertexArray makeLine(const Coordinates& c1, const Coordinates& c2) const;
void fetchFirstNote(const microsec& offset);
void fetchLastNote(const microsec& offset);
void updateVisibleNotes(const microsec& offset);
};