mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 14:02:59 +01:00
Replace platform_enumerate_directories_begin with FileScanner code
This is isn't a particularly pretty implementation but it is only temporary until we can use std::filesystem.
This commit is contained in:
committed by
Michael Steenbeek
parent
6fd56d140d
commit
cb720025fa
@@ -816,24 +816,19 @@ static void window_loadsave_populate_list(rct_window *w, sint32 includeNewItem,
|
||||
w->disabled_widgets &= ~(1 << WIDX_NEW_FOLDER);
|
||||
|
||||
// List all directories
|
||||
char subDir[MAX_PATH];
|
||||
sint32 fileEnumHandle = platform_enumerate_directories_begin(directory);
|
||||
while (platform_enumerate_directories_next(fileEnumHandle, subDir))
|
||||
auto subDirectories = Path::GetDirectories(directory);
|
||||
for (const auto &sdName : subDirectories)
|
||||
{
|
||||
auto subDir = sdName + PATH_SEPARATOR;
|
||||
|
||||
LoadSaveListItem newListItem;
|
||||
|
||||
char path[MAX_PATH];
|
||||
safe_strcpy(path, directory, sizeof(path));
|
||||
safe_strcat_path(path, subDir, sizeof(path));
|
||||
|
||||
newListItem.path = path;
|
||||
newListItem.path = Path::Combine(directory, subDir);
|
||||
newListItem.name = subDir;
|
||||
newListItem.type = TYPE_DIRECTORY;
|
||||
newListItem.loaded = false;
|
||||
|
||||
_listItems.push_back(newListItem);
|
||||
}
|
||||
platform_enumerate_files_end(fileEnumHandle);
|
||||
|
||||
// List all files with the wanted extensions
|
||||
char filter[MAX_PATH];
|
||||
|
||||
Reference in New Issue
Block a user