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