[Kernel] Added support for writing/reading GPD files

This breaks settings in games that are using them and savefiles in games that use settings to store progress
This commit is contained in:
Gliniak
2024-12-15 13:58:08 +01:00
committed by Radosław Gliński
parent ccf7adf015
commit 1110cdd372
58 changed files with 4642 additions and 2122 deletions

View File

@@ -245,10 +245,13 @@ std::map<uint32_t, std::unique_ptr<ImmediateTexture>> ImGuiDrawer::LoadIcons(
int width, height, channels;
for (const auto& icon : data) {
unsigned char* image_data =
stbi_load_from_memory(icon.second.first, icon.second.second, &width,
&height, &channels, STBI_rgb_alpha);
unsigned char* image_data = stbi_load_from_memory(
icon.second.data(), static_cast<int>(icon.second.size()), &width,
&height, &channels, STBI_rgb_alpha);
if (!image_data) {
continue;
}
icons_[icon.first] = (immediate_drawer_->CreateTexture(
width, height, ImmediateTextureFilter::kLinear, true,
reinterpret_cast<uint8_t*>(image_data)));

View File

@@ -14,6 +14,7 @@
#include <cstdint>
#include <memory>
#include <optional>
#include <span>
#include <vector>
#include "third_party/imgui/imgui.h"
@@ -34,7 +35,7 @@ class ImGuiDialog;
class ImGuiNotification;
class Window;
using IconsData = std::map<uint32_t, std::pair<const uint8_t*, uint32_t>>;
using IconsData = std::map<uint32_t, std::span<const uint8_t>>;
class ImGuiDrawer : public WindowInputListener, public UIDrawer {
public: