mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +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;
|
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");
|
disc_dir.clear();
|
||||||
|
}
|
||||||
|
|
||||||
if (disc_dir.empty())
|
std::initializer_list<std::string> testees =
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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++)
|
||||||
|
{
|
||||||
|
const std::string& path = testees.begin()[index];
|
||||||
|
|
||||||
|
fs::stat_t file_stat{};
|
||||||
|
|
||||||
|
if (path.empty() || !fs::get_stat(path, file_stat))
|
||||||
{
|
{
|
||||||
// Fallback to ICON0.PNG
|
continue;
|
||||||
path = m_sfo_dir + "/ICON0.PNG";
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (max_file_size < file_stat.size)
|
||||||
{
|
{
|
||||||
// Fallback to PIC1.PNG in disc dir
|
max_file_size = file_stat.size;
|
||||||
path = disc_dir + "/PIC1.PNG";
|
index_of_largest_file = index;
|
||||||
|
|
||||||
if (!fs::is_file(path))
|
|
||||||
{
|
|
||||||
// Fallback to ICON0.PNG in update dir
|
|
||||||
path = m_sfo_dir + "/ICON0.PNG";
|
|
||||||
|
|
||||||
if (!fs::is_file(path))
|
|
||||||
{
|
|
||||||
// Fallback to ICON0.PNG in disc dir
|
|
||||||
path = disc_dir + "/ICON0.PNG";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
if (index_of_largest_file == umax)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return testees.begin()[index_of_largest_file];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Emulator::BootRsxCapture(const std::string& path)
|
bool Emulator::BootRsxCapture(const std::string& path)
|
||||||
|
Loading…
Reference in New Issue
Block a user