Emu/overlays: fix background picture path

This commit is contained in:
Megamouse 2019-07-19 21:36:23 +02:00
parent 090c71aa7c
commit 71c56b719c
3 changed files with 41 additions and 8 deletions

View File

@ -49,16 +49,12 @@ namespace rsx
if (use_custom_background)
{
auto icon_path = Emu.GetSfoDir() + "/PIC1.PNG";
if (!fs::exists(icon_path))
{
// Fallback path
icon_path = Emu.GetSfoDir() + "/ICON0.PNG";
}
const auto picture_path = Emu.GetBackgroundPicturePath();
if (fs::exists(icon_path))
if (fs::exists(picture_path))
{
background_image = std::make_unique<image_info>(icon_path.c_str());
background_image = std::make_unique<image_info>(picture_path.c_str());
if (background_image->data)
{
f32 color = (100 - g_cfg.video.shader_preloading_dialog.darkening_strength) / 100.f;

View File

@ -492,6 +492,41 @@ const bool Emulator::SetUsr(const std::string& user)
return true;
}
const std::string Emulator::GetBackgroundPicturePath() const
{
std::string path = m_sfo_dir + "/PIC1.PNG";
if (!fs::exists(path))
{
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";
}
else
{
// Fallback to PIC1.PNG in disc dir
path = disc_dir + "/PIC1.PNG";
if (!fs::exists(path))
{
// Fallback to ICON0.PNG in update dir
path = m_sfo_dir + "/ICON0.PNG";
if (!fs::exists(path))
{
// Fallback to ICON0.PNG in disc dir
path = disc_dir + "/ICON0.PNG";
}
}
}
}
return path;
}
std::string Emulator::PPUCache() const
{
const auto _main = fxm::check_unlocked<ppu_module>();

View File

@ -328,6 +328,8 @@ public:
const bool SetUsr(const std::string& user);
const std::string GetBackgroundPicturePath() const;
u64 GetPauseTime()
{
return m_pause_amend_time;