mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-07 19:23:14 +00:00
Rewrite Save Data & Impl Save Data Dialog (#824)
* core: Rewrite PSF parser & add encoder add .sfo hex pattern to /scripts * core/fs: allow to mount path as read-only * common: Add CString wrapper to handle native null-terminated strings * SaveData: rewrite to implement full functionality * mock value for SYSTEM_VER * SavaData: backup features * SavaData: SaveDataMemory features * imgui Ref-counted textures - has a background thread to decode textures * imgui: rework gamepad navigation * PSF: fixed psf not using enum class for PSFEntryFmt (was a standard old ugly enum) - Add null check to CString when itself is used in a nullable field * SaveDataDialog implementation - Fix Mounting/Unmounting check of SaveInstance
This commit is contained in:
parent
077f8981a7
commit
0f4bcd8c83
51 changed files with 4919 additions and 1134 deletions
45
src/imgui/imgui_texture.h
Normal file
45
src/imgui/imgui_texture.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <imgui.h>
|
||||
|
||||
namespace ImGui {
|
||||
|
||||
namespace Core::TextureManager {
|
||||
struct Inner;
|
||||
} // namespace Core::TextureManager
|
||||
|
||||
class RefCountedTexture {
|
||||
Core::TextureManager::Inner* inner;
|
||||
|
||||
explicit RefCountedTexture(Core::TextureManager::Inner* inner);
|
||||
|
||||
public:
|
||||
struct Image {
|
||||
ImTextureID im_id;
|
||||
u32 width;
|
||||
u32 height;
|
||||
};
|
||||
|
||||
static RefCountedTexture DecodePngTexture(std::vector<u8> data);
|
||||
|
||||
static RefCountedTexture DecodePngFile(std::filesystem::path path);
|
||||
|
||||
RefCountedTexture();
|
||||
|
||||
RefCountedTexture(const RefCountedTexture& other);
|
||||
RefCountedTexture(RefCountedTexture&& other) noexcept;
|
||||
RefCountedTexture& operator=(const RefCountedTexture& other);
|
||||
RefCountedTexture& operator=(RefCountedTexture&& other) noexcept;
|
||||
|
||||
virtual ~RefCountedTexture();
|
||||
|
||||
[[nodiscard]] Image GetTexture() const;
|
||||
|
||||
explicit(false) operator bool() const;
|
||||
};
|
||||
|
||||
}; // namespace ImGui
|
Loading…
Add table
Add a link
Reference in a new issue