make main print available songs by default

This commit is contained in:
jacekpoz 2024-04-26 20:24:09 +02:00
parent 3aa342d46b
commit 7c2d4da6e2
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -102,41 +102,17 @@ int main(int argc, char *argv[]) {
TextureManager tman(skinDir); TextureManager tman(skinDir);
Difficulty::DifficultySettings diff{
.hpDrainRate = 3.,
.circleSize = 5.,
.overallDifficulty = 9.,
.approachRate = 9.,
};
float deltaTime; float deltaTime;
std::vector<HitObjectDrawable> hitObjects;
hitObjects.push_back(HitObjectDrawable( fs::path songsDir = osuPath / "Songs";
tman, for (const auto& songDir : fs::directory_iterator(songsDir)) {
HitObject{ for (const auto& beatmapDiff : fs::directory_iterator(songDir)) {
.x = 400, if (beatmapDiff.path().extension() == ".osu" || beatmapDiff.path().extension() == ".os") {
.y = 300, Difficulty diff = parseDifficulty(beatmapDiff);
.time = 2000, std::cout << diff.metadata.artist << " - " << diff.metadata.titleUnicode << "\n";
.type = HitObjectType(), }
.hitSound = HitSound(), }
}, }
diff,
1
));
hitObjects.push_back(HitObjectDrawable(
tman,
HitObject{
.x = 500,
.y = 200,
.time = 2500,
.type = HitObjectType(),
.hitSound = HitSound(),
},
diff,
2
));
while (window.isOpen()) { while (window.isOpen()) {
sf::Event event; sf::Event event;
@ -147,17 +123,9 @@ int main(int argc, char *argv[]) {
} }
deltaTime = clock.restart().asMilliseconds(); deltaTime = clock.restart().asMilliseconds();
for (HitObjectDrawable &hitObject : hitObjects) {
hitObject.update(deltaTime);
}
window.clear(sf::Color::Black); window.clear(sf::Color::Black);
for (HitObjectDrawable &hitObject : hitObjects) {
window.draw(hitObject);
}
window.display(); window.display();
} }