36 lines
1021 B
C
36 lines
1021 B
C
|
#pragma once
|
||
|
|
||
|
#include "spritecontainer.h"
|
||
|
#include "classicmode/classicactions.h"
|
||
|
#include "graphics/classicspritefactory.h"
|
||
|
#include "classicnote.h"
|
||
|
#include "core/timeline.h"
|
||
|
|
||
|
#include <SFML/Graphics/RenderTarget.hpp>
|
||
|
|
||
|
class ClassicSprite;
|
||
|
|
||
|
class ClassicGraphicsManager : public sf::Drawable
|
||
|
{
|
||
|
public:
|
||
|
explicit ClassicGraphicsManager(Timeline<ClassicNote>& timeline, const microsec& visibility_offset);
|
||
|
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
|
||
|
|
||
|
std::shared_ptr<ClassicSprite> getSprite(Type type);
|
||
|
void update(const microsec& offset);
|
||
|
|
||
|
private:
|
||
|
using Iterator = Timeline<ClassicNote>::Iterator;
|
||
|
|
||
|
Iterator _first;
|
||
|
Iterator _last;
|
||
|
|
||
|
SpriteContainer<Type, ClassicSpriteFactory, ClassicSprite> _sprite_container;
|
||
|
Timeline<ClassicNote> * const _timeline;
|
||
|
|
||
|
microsec _visibility_offset;
|
||
|
|
||
|
inline bool nothingToDraw() const noexcept;
|
||
|
inline bool isVisiblyClose(const Iterator& iterator, const microsec& music_offset) const noexcept;
|
||
|
};
|