2020-02-11 22:12:17 +01:00
|
|
|
#include <iostream>
|
|
|
|
|
2019-10-22 01:53:08 +02:00
|
|
|
#include <SFML/Graphics.hpp>
|
2020-02-11 22:12:17 +01:00
|
|
|
#include <cereal/archives/json.hpp>
|
2020-03-05 18:14:19 +01:00
|
|
|
#include <whereami/whereami++.hpp>
|
2019-10-22 01:53:08 +02:00
|
|
|
|
2020-02-18 01:44:21 +01:00
|
|
|
#include "Data/Song.hpp"
|
2020-02-11 22:12:17 +01:00
|
|
|
#include "Data/Preferences.hpp"
|
2020-03-02 00:16:58 +01:00
|
|
|
#include "Resources/Marker.hpp"
|
2019-11-03 00:55:54 +01:00
|
|
|
// #include "Data/Chart.hpp"
|
|
|
|
// #include "Data/Score.hpp"
|
2019-10-22 01:53:08 +02:00
|
|
|
|
2019-11-02 01:24:45 +01:00
|
|
|
#include "Screens/MusicSelect/MusicSelect.hpp"
|
2019-11-03 00:55:54 +01:00
|
|
|
// #include "Screens/Gameplay.hpp"
|
|
|
|
// #include "Screens/Result.hpp"
|
2019-10-23 01:13:01 +02:00
|
|
|
|
2020-03-02 14:29:14 +01:00
|
|
|
int main(int, char const **) {
|
2020-03-02 00:16:58 +01:00
|
|
|
|
2020-03-08 14:39:37 +01:00
|
|
|
// Load prefs, music, markers
|
2020-03-05 18:14:19 +01:00
|
|
|
const std::string jujube_path = whereami::executable_dir();
|
|
|
|
Data::Preferences preferences{jujube_path};
|
2020-03-08 14:39:37 +01:00
|
|
|
Data::SongList song_list{jujube_path};
|
|
|
|
MusicSelect::SharedResources music_select_resources{preferences};
|
|
|
|
if (music_select_resources.markers.find(preferences.options.marker) == music_select_resources.markers.end()) {
|
|
|
|
preferences.options.marker = music_select_resources.markers.begin()->first;
|
|
|
|
}
|
|
|
|
MusicSelect::Screen music_select{song_list, music_select_resources};
|
|
|
|
|
|
|
|
// Create the window
|
2020-02-15 20:50:47 +01:00
|
|
|
sf::ContextSettings settings;
|
|
|
|
settings.antialiasingLevel = 8;
|
2020-02-11 23:37:57 +01:00
|
|
|
sf::RenderWindow window{
|
|
|
|
sf::VideoMode(
|
|
|
|
preferences.screen.width,
|
|
|
|
preferences.screen.height
|
|
|
|
),
|
|
|
|
"jujube",
|
2020-02-15 20:50:47 +01:00
|
|
|
preferences.screen.fullscreen ? sf::Style::Fullscreen : sf::Style::Default,
|
|
|
|
settings
|
2020-02-11 23:37:57 +01:00
|
|
|
};
|
2020-03-08 14:54:03 +01:00
|
|
|
auto chart = music_select.select_chart(window);
|
|
|
|
std::cout << "Selected Chart : " << chart.song.title << " [" << chart.difficulty << "]" << std::endl;
|
2019-11-03 00:55:54 +01:00
|
|
|
/*
|
2019-10-23 01:13:01 +02:00
|
|
|
while (true) {
|
2019-10-23 23:39:10 +02:00
|
|
|
|
|
|
|
Chart& selected_chart = music_select.select_chart(window);
|
|
|
|
|
2019-10-23 01:13:01 +02:00
|
|
|
Screen::Gameplay gameplay(selected_chart);
|
2019-10-23 23:39:10 +02:00
|
|
|
Score score = gameplay.play_chart(window);
|
|
|
|
|
2019-10-29 18:42:21 +01:00
|
|
|
Screen::Result result_screen(score);
|
|
|
|
result_screen.display(window);
|
2019-10-23 23:39:10 +02:00
|
|
|
|
2019-10-22 01:53:08 +02:00
|
|
|
}
|
2019-11-03 00:55:54 +01:00
|
|
|
*/
|
2019-10-23 23:39:10 +02:00
|
|
|
|
2019-10-22 01:53:08 +02:00
|
|
|
return 0;
|
2019-10-23 23:39:10 +02:00
|
|
|
|
2019-10-22 01:53:08 +02:00
|
|
|
}
|