2022-03-02 23:59:19 +01:00
|
|
|
#pragma once
|
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>
|
2019-04-06 22:35:17 +02:00
|
|
|
#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"
|
2019-04-06 22:35:17 +02:00
|
|
|
|
|
|
|
class Playfield {
|
|
|
|
public:
|
2022-01-04 01:31:17 +01:00
|
|
|
Playfield(std::filesystem::path assets_folder);
|
2019-04-06 22:35:17 +02:00
|
|
|
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;
|
2019-04-06 22:35:17 +02:00
|
|
|
|
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;
|
2019-04-06 22:35:17 +02:00
|
|
|
|
|
|
|
void resize(unsigned int width);
|
|
|
|
|
2022-03-17 02:50:30 +01:00
|
|
|
void draw_long_note(
|
|
|
|
const better::LongNote& note,
|
2019-04-06 22:35:17 +02:00
|
|
|
const sf::Time& playbackPosition,
|
2022-03-17 02:50:30 +01:00
|
|
|
const better::Timing& timing
|
|
|
|
);
|
2019-04-06 22:35:17 +02:00
|
|
|
|
|
|
|
void drawLongNote(
|
|
|
|
const Note& note,
|
|
|
|
const sf::Time& playbackPosition,
|
2022-03-17 02:50:30 +01:00
|
|
|
const better::Timing& timing,
|
2019-04-06 22:35:17 +02:00
|
|
|
Marker& marker,
|
2022-03-17 02:50:30 +01:00
|
|
|
MarkerEndingState& markerEndingState
|
|
|
|
);
|
2019-04-06 22:35:17 +02:00
|
|
|
|
|
|
|
private:
|
2022-01-04 01:31:17 +01:00
|
|
|
const std::filesystem::path texture_path;
|
2019-04-06 22:35:17 +02:00
|
|
|
};
|