F.E.I.S/src/widgets/playfield.hpp

60 lines
1.3 KiB
C++
Raw Normal View History

#pragma once
#include <SFML/Graphics.hpp>
2022-03-17 02:50:30 +01:00
#include <SFML/Graphics/RenderTexture.hpp>
#include <imgui-SFML.h>
2020-05-22 11:02:47 +02:00
#include <string>
2022-03-17 02:50:30 +01:00
#include "../better_note.hpp"
#include "../better_timing.hpp"
2021-12-31 14:59:39 +01:00
#include "../ln_marker.hpp"
#include "../marker.hpp"
#include "../note.hpp"
class Playfield {
public:
Playfield(std::filesystem::path assets_folder);
sf::Texture base_texture;
sf::Sprite button;
sf::Sprite button_pressed;
sf::Sprite note_selected;
sf::Sprite note_collision;
2022-03-17 02:50:30 +01:00
sf::RenderTexture marker_layer;
sf::Sprite marker_sprite;
2022-03-17 02:50:30 +01:00
struct LongNote {
template<class... Args>
LongNote(Args&& ...args) : marker(std::forward<Args>(args)...) {};
LNMarker marker;
sf::RenderTexture layer;
sf::Sprite backgroud;
sf::Sprite outline;
sf::Sprite highlight;
sf::Sprite tail;
sf::Sprite triangle;
};
LongNote long_note;
void resize(unsigned int width);
2022-03-17 02:50:30 +01:00
void draw_long_note(
const better::LongNote& note,
const sf::Time& playbackPosition,
2022-03-17 02:50:30 +01:00
const better::Timing& timing
);
void drawLongNote(
const Note& note,
const sf::Time& playbackPosition,
2022-03-17 02:50:30 +01:00
const better::Timing& timing,
Marker& marker,
2022-03-17 02:50:30 +01:00
MarkerEndingState& markerEndingState
);
private:
const std::filesystem::path texture_path;
};