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

Function SaveState_SaveScreenshot

pcsx2/SaveState.cpp:758–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758std::unique_ptr<SaveStateScreenshotData> SaveState_SaveScreenshot()
759{
760 static constexpr u32 SCREENSHOT_WIDTH = 640;
761 static constexpr u32 SCREENSHOT_HEIGHT = 480;
762
763 u32 width, height;
764 std::vector<u32> pixels;
765 if (!MTGS::SaveMemorySnapshot(SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT, true, false, &width, &height, &pixels))
766 {
767 // saving failed for some reason, device lost?
768 return nullptr;
769 }
770
771 std::unique_ptr<SaveStateScreenshotData> data = std::make_unique<SaveStateScreenshotData>();
772 data->width = width;
773 data->height = height;
774 data->pixels = std::move(pixels);
775 return data;
776}
777
778static bool SaveState_CompressScreenshot(SaveStateScreenshotData* data, zip_t* zf)
779{

Callers 1

DoSaveStateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected