2022-03-02 23:59:19 +01:00
|
|
|
#pragma once
|
2019-04-06 22:35:17 +02:00
|
|
|
|
2022-04-04 22:03:10 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <imgui-SFML.h>
|
|
|
|
|
2019-04-06 22:35:17 +02:00
|
|
|
#include <SFML/Graphics.hpp>
|
2022-03-17 02:50:30 +01:00
|
|
|
#include <SFML/Graphics/RenderTexture.hpp>
|
2020-05-22 11:02:47 +02:00
|
|
|
|
2022-04-07 00:14:01 +02:00
|
|
|
#include "better_note.hpp"
|
|
|
|
#include "better_timing.hpp"
|
|
|
|
#include "ln_marker.hpp"
|
|
|
|
#include "marker.hpp"
|
2019-04-06 22:35:17 +02:00
|
|
|
|
|
|
|
class Playfield {
|
2022-04-07 00:14:01 +02:00
|
|
|
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;
|
|
|
|
|
|
|
|
sf::RenderTexture marker_layer;
|
|
|
|
sf::Sprite marker_sprite;
|
|
|
|
|
|
|
|
struct LongNote {
|
|
|
|
template<typename ...Ts>
|
|
|
|
LongNote(Ts&&... Args) : marker(std::forward<Ts>(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);
|
|
|
|
|
|
|
|
void draw_tail_and_receptor(
|
|
|
|
const better::LongNote& note,
|
|
|
|
const sf::Time& playbackPosition,
|
|
|
|
const better::Timing& timing
|
|
|
|
);
|
|
|
|
|
|
|
|
void draw_long_note(
|
|
|
|
const better::LongNote& note,
|
|
|
|
const sf::Time& playbackPosition,
|
|
|
|
const better::Timing& timing,
|
|
|
|
Marker& marker,
|
|
|
|
MarkerEndingState& markerEndingState
|
|
|
|
);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const std::filesystem::path texture_path;
|
2019-04-06 22:35:17 +02:00
|
|
|
};
|