make main print available songs by default
This commit is contained in:
parent
3aa342d46b
commit
7c2d4da6e2
1 changed files with 9 additions and 41 deletions
50
src/main.cpp
50
src/main.cpp
|
@ -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;
|
||||||
|
@ -148,16 +124,8 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue