mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 22:28:45 +00:00
Save data memory: fix overriding icon
This commit is contained in:
parent
8399cb6b74
commit
b7ec7e4957
1 changed files with 11 additions and 6 deletions
|
@ -190,14 +190,19 @@ void SetIcon(void* buf, size_t buf_size) {
|
||||||
if (buf == nullptr) {
|
if (buf == nullptr) {
|
||||||
const auto& src_icon = g_mnt->GetHostPath("/app0/sce_sys/save_data.png");
|
const auto& src_icon = g_mnt->GetHostPath("/app0/sce_sys/save_data.png");
|
||||||
if (fs::exists(src_icon)) {
|
if (fs::exists(src_icon)) {
|
||||||
|
if (fs::exists(g_icon_path)) {
|
||||||
|
fs::remove(g_icon_path);
|
||||||
|
}
|
||||||
fs::copy_file(src_icon, g_icon_path);
|
fs::copy_file(src_icon, g_icon_path);
|
||||||
}
|
}
|
||||||
IOFile file(g_icon_path, Common::FS::FileAccessMode::Read);
|
if (fs::exists(g_icon_path)) {
|
||||||
size_t size = file.GetSize();
|
IOFile file(g_icon_path, Common::FS::FileAccessMode::Read);
|
||||||
file.Seek(0);
|
size_t size = file.GetSize();
|
||||||
g_icon_memory.resize(size);
|
file.Seek(0);
|
||||||
file.ReadRaw<u8>(g_icon_memory.data(), size);
|
g_icon_memory.resize(size);
|
||||||
file.Close();
|
file.ReadRaw<u8>(g_icon_memory.data(), size);
|
||||||
|
file.Close();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
g_icon_memory.resize(buf_size);
|
g_icon_memory.resize(buf_size);
|
||||||
std::memcpy(g_icon_memory.data(), buf, buf_size);
|
std::memcpy(g_icon_memory.data(), buf, buf_size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue