mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-02-24 14:03:54 +01:00
46 lines
918 B
C
46 lines
918 B
C
|
//
|
||
|
// Created by symeon on 06/04/19.
|
||
|
//
|
||
|
|
||
|
#ifndef FEIS_DENSITYGRAPH_H
|
||
|
#define FEIS_DENSITYGRAPH_H
|
||
|
|
||
|
|
||
|
#include <SFML/Graphics.hpp>
|
||
|
#include <imgui-SFML.h>
|
||
|
#include "../Chart.h"
|
||
|
|
||
|
|
||
|
class DensityGraph {
|
||
|
|
||
|
public:
|
||
|
|
||
|
struct density_entry {
|
||
|
int density;
|
||
|
bool has_collisions;
|
||
|
};
|
||
|
|
||
|
DensityGraph();
|
||
|
sf::Texture base_texture;
|
||
|
sf::Sprite normal_square;
|
||
|
sf::Sprite collision_square;
|
||
|
sf::RenderTexture graph;
|
||
|
sf::FloatRect graph_rect;
|
||
|
|
||
|
bool should_recompute = true;
|
||
|
|
||
|
std::vector<DensityGraph::density_entry> densities;
|
||
|
|
||
|
std::optional<int> last_height;
|
||
|
std::optional<float> last_section_length;
|
||
|
|
||
|
void computeDensities(int height, float chartRuntime, Chart& chart, float BPM, int resolution);
|
||
|
void updateGraphTexture();
|
||
|
|
||
|
private:
|
||
|
std::__cxx11::string texture_path = "assets/textures/edit_textures/game_front_edit_tex_1.tex.png";
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif //FEIS_DENSITYGRAPH_H
|