MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / LoadTextureImage

Method LoadTextureImage

pcsx2/ImGui/ImGuiFullscreen.cpp:292–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292std::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
318std::shared_ptr<GSTexture> ImGuiFullscreen::UploadTexture(const char* path, const RGBA8Image& image)
319{

Callers

nothing calls this directly

Calls 8

CombineFunction · 0.85
RGBA8ImageClass · 0.85
LoadFromBufferMethod · 0.80
c_strMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
ErrorMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected