MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / collectGameInfo

Function collectGameInfo

android/src/rpcsx-android.cpp:883–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883static void collectGameInfo(JNIEnv *env, jlong progressId,
884 const std::vector<std::string> &rootDirs) {
885 std::vector<std::string> paths;
886 for (auto &&rootDir : rootDirs) {
887 collectGamePaths(paths, rootDir);
888
889 rpcsx_android.notice("collectGameInfo: processed %s", rootDir);
890 }
891
892 rpcsx_android.notice("collectGameInfo: found %d paths", paths.size());
893
894 Progress progress(env, progressId);
895 progress.report(0, paths.size());
896
897 std::vector<GameInfo> gameInfos;
898 gameInfos.reserve(10);
899 std::size_t processed = 0;
900
901 auto submit = [&] {
902 if (gameInfos.empty()) {
903 return;
904 }
905
906 sendGameInfo(env, progressId, gameInfos);
907 progress.report(processed, paths.size());
908 gameInfos.clear();
909 };
910
911 for (auto &&path : paths) {
912 processed++;
913
914 if (!std::filesystem::is_regular_file(path + "/PARAM.SFO")) {
915 continue;
916 }
917
918 const auto psf = psf::load_object(path + "/PARAM.SFO");
919
920 rpcsx_android.notice("collectGameInfo: sfo at %s", path);
921
922 if (auto gameInfo = fetchGameInfo(psf, path)) {
923 gameInfos.push_back(std::move(*gameInfo));
924
925 if (gameInfos.size() >= 10) {
926 submit();
927 }
928 }
929 }
930
931 submit();
932
933 progress.success(processed);
934}
935
936class MainThreadProcessor {
937 std::mutex mutex;

Callers 5

_rpcsx_collectGameInfoFunction · 0.85
installPkgFunction · 0.85
installEdatFunction · 0.85
installRapFunction · 0.85
installIsoFunction · 0.85

Calls 11

collectGamePathsFunction · 0.85
sendGameInfoFunction · 0.85
load_objectFunction · 0.85
fetchGameInfoFunction · 0.85
push_backMethod · 0.80
successMethod · 0.80
sizeMethod · 0.45
reportMethod · 0.45
reserveMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected