| 290 | } |
| 291 | |
| 292 | std::optional<RGBA8Image> ImGuiFullscreen::LoadTextureImage(const char* path) |
| 293 | { |
| 294 | std::optional<RGBA8Image> image; |
| 295 | |
| 296 | std::optional<std::vector<u8>> data; |
| 297 | if (Path::IsAbsolute(path)) |
| 298 | data = FileSystem::ReadBinaryFile(path); |
| 299 | else |
| 300 | data = FileSystem::ReadBinaryFile(Path::Combine(EmuFolders::Resources, path).c_str()); |
| 301 | if (data.has_value()) |
| 302 | { |
| 303 | image = RGBA8Image(); |
| 304 | if (!image->LoadFromBuffer(path, data->data(), data->size())) |
| 305 | { |
| 306 | Console.Error("Failed to read texture resource '%s'", path); |
| 307 | image.reset(); |
| 308 | } |
| 309 | } |
| 310 | else |
| 311 | { |
| 312 | Console.Error("Failed to open texture resource '%s'", path); |
| 313 | } |
| 314 | |
| 315 | return image; |
| 316 | } |
| 317 | |
| 318 | std::shared_ptr<GSTexture> ImGuiFullscreen::UploadTexture(const char* path, const RGBA8Image& image) |
| 319 | { |
nothing calls this directly
no test coverage detected