mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-21 18:22:33 +01:00
High-Resolution Game Background for loading
This commit is contained in:
parent
7858053bb9
commit
c782b45b97
@ -732,37 +732,56 @@ std::string Emulator::GetBackgroundPicturePath() const
|
||||
return path;
|
||||
}
|
||||
|
||||
path = m_sfo_dir + "/PIC1.PNG";
|
||||
std::string disc_dir = vfs::get("/dev_bdvd/PS3_GAME");
|
||||
|
||||
if (!fs::is_file(path))
|
||||
if (m_sfo_dir == disc_dir)
|
||||
{
|
||||
const std::string disc_dir = vfs::get("/dev_bdvd/PS3_GAME");
|
||||
|
||||
if (disc_dir.empty())
|
||||
{
|
||||
// Fallback to ICON0.PNG
|
||||
path = m_sfo_dir + "/ICON0.PNG";
|
||||
disc_dir.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to PIC1.PNG in disc dir
|
||||
path = disc_dir + "/PIC1.PNG";
|
||||
|
||||
if (!fs::is_file(path))
|
||||
std::initializer_list<std::string> testees =
|
||||
{
|
||||
// Fallback to ICON0.PNG in update dir
|
||||
path = m_sfo_dir + "/ICON0.PNG";
|
||||
m_sfo_dir + "/ICON0.PNG",
|
||||
m_sfo_dir + "/PIC0.PNG",
|
||||
m_sfo_dir + "/PIC1.PNG",
|
||||
m_sfo_dir + "/PIC2.PNG",
|
||||
m_sfo_dir + "/PIC3.PNG",
|
||||
disc_dir.empty() ? (disc_dir + "/ICON0.PNG") : disc_dir,
|
||||
disc_dir.empty() ? (disc_dir + "/PIC0.PNG") : disc_dir,
|
||||
disc_dir.empty() ? (disc_dir + "/PIC1.PNG") : disc_dir,
|
||||
disc_dir.empty() ? (disc_dir + "/PIC2.PNG") : disc_dir,
|
||||
disc_dir.empty() ? (disc_dir + "/PIC3.PNG") : disc_dir,
|
||||
};
|
||||
|
||||
if (!fs::is_file(path))
|
||||
// Try to return the picture with the highest resultion
|
||||
// Be naive and assume that its the one that spans over the most bytes
|
||||
usz max_file_size = 0;
|
||||
usz index_of_largest_file = umax;
|
||||
|
||||
for (usz index = 0; index < testees.size(); index++)
|
||||
{
|
||||
// Fallback to ICON0.PNG in disc dir
|
||||
path = disc_dir + "/ICON0.PNG";
|
||||
}
|
||||
const std::string& path = testees.begin()[index];
|
||||
|
||||
fs::stat_t file_stat{};
|
||||
|
||||
if (path.empty() || !fs::get_stat(path, file_stat))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (max_file_size < file_stat.size)
|
||||
{
|
||||
max_file_size = file_stat.size;
|
||||
index_of_largest_file = index;
|
||||
}
|
||||
}
|
||||
|
||||
return path;
|
||||
if (index_of_largest_file == umax)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
return testees.begin()[index_of_largest_file];
|
||||
}
|
||||
|
||||
bool Emulator::BootRsxCapture(const std::string& path)
|
||||
|
Loading…
Reference in New Issue
Block a user