Skip to content

Commit ff573a6

Browse files
committed
folders are not songs
1 parent 20b5084 commit ff573a6

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Encore/src/menus/SettingsMenu.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ void SettingsMenu::Draw() {
3030
SongTime &enctime = TheSongTime;
3131
settingsOptionRenderer sor;
3232
encOS::DrawTopOvershell(0.15f);
33-
GameMenu::DrawAlbumArtBackground(TheSongList.curSong->albumArtBlur);
33+
if (TheSongList.curSong != nullptr)
34+
GameMenu::DrawAlbumArtBackground(TheSongList.curSong->albumArtBlur);
3435
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color{50, 0, 0, 200});
3536

3637
float TextPlacementTB = u.hpct(0.05f);

Encore/src/menus/cacheLoadingScreen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ bool finished = false;
4343
bool started = false;
4444

4545
void LoadCache() {
46-
SongList &list = TheSongList;
47-
list.LoadCache(TheGameSettings.SongPaths);
46+
TheSongList.LoadCache(TheGameSettings.SongPaths);
4847
finished = true;
4948
}
5049

Encore/src/menus/gameMenu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void MainMenu::MainMenuScreen() {
392392
{ u.wpct(0.02f), u.hpct(0.3f), u.winpct(0.2f), u.hinpct(0.08f) },
393393
"Invalid song cache!"
394394
);
395-
TheSongList.ScanSongs(TheGameSettings.SongPaths);
395+
// TheSongList.ScanSongs(TheGameSettings.SongPaths);
396396
songsLoaded = false;
397397
DrawRectanglePro(
398398
{ ((float)GetScreenWidth() / 2) - 125,

Encore/src/song/songlist.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ void SongList::ScanFolder(const std::filesystem::path &folder) {
181181
}
182182

183183
directoryCount++;
184-
Song song;
184+
185185
std::filesystem::path infoPath = folder / "info.json";
186186
if (std::filesystem::exists(infoPath)) {
187+
Song song;
187188
song.songInfoPath = (folder / "info.json");
188189
song.songDir = folder.string();
189190
for (auto &file : std::filesystem::directory_iterator(folder)) {
@@ -193,19 +194,22 @@ void SongList::ScanFolder(const std::filesystem::path &folder) {
193194
}
194195
}
195196
song.LoadSongJSON(song.songInfoPath);
197+
songs.push_back(std::move(song));
196198
} else if (std::filesystem::exists(folder / "song.ini")) {
199+
Song song;
197200
song.songInfoPath = (folder / "song.ini").string();
198201
song.songDir = folder.string();
199202
song.LoadSongIni(folder);
200203
song.ini = true;
204+
songs.push_back(std::move(song));
201205
} else {
202206
// If this folder doesn't have song.ini or song.json, this must be a organizational folder; continue scanning.
203207
for (const auto &entry : std::filesystem::directory_iterator(folder)) {
204208
ScanFolder(entry.path());
205209
};
206210
}
207211

208-
songs.push_back(std::move(song));
212+
209213
songCount++;
210214
}
211215

0 commit comments

Comments
 (0)