Skip to content

Commit

Permalink
Limit shown roms by file size
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Feb 7, 2025
1 parent 1557a84 commit 7f1f1e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main(int argc, char **argv) {
romDirectories.emplace_back(directoryPath);

for (const auto& romFile: std::filesystem::directory_iterator(directoryPath)) {
if (romFile.is_directory()) {
if (romFile.is_directory() || romFile.file_size() > 3584) {
continue;
}

Expand Down
5 changes: 2 additions & 3 deletions src/sdl/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ void MainMenu::callback(void* userdata, const char* const* directory, int filter
instance->romDirectories.emplace_back(directoryString);

for (const auto &file: std::filesystem::directory_iterator(directoryString)) {
if (file.is_directory()) {
continue; // TODO: Make sure its a file that can be emulated, at least basic checks so it isn't like
// a word doc
if (file.is_directory() || file.file_size() > 3584) {
continue; // TODO: Make sure its a file that can be emulated, at least basic checks so it isn't like a word doc
}

std::cout << "Processing file - : " << file.path().c_str() << std::endl;
Expand Down

0 comments on commit 7f1f1e7

Please sign in to comment.