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

Method ZipSaveState

pcsx2/VMManager.cpp:1968–1989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1966}
1967
1968void VMManager::ZipSaveState(std::unique_ptr<ArchiveEntryList> elist,
1969 std::unique_ptr<SaveStateScreenshotData> screenshot, const char* filename,
1970 s32 slot_for_message, std::function<void(const std::string&)> error_callback)
1971{
1972 Common::Timer timer;
1973
1974 Error error;
1975 if (!SaveState_ZipToDisk(std::move(elist), std::move(screenshot), filename, &error))
1976 {
1977 error_callback(error.GetDescription());
1978 return;
1979 }
1980
1981 if (slot_for_message >= 0 && VMManager::HasValidVM())
1982 {
1983 Host::AddIconOSDMessage(fmt::format("SaveStateSlot{}", slot_for_message), ICON_FA_FLOPPY_DISK,
1984 fmt::format(TRANSLATE_FS("VMManager", "Saved state to slot {}."), slot_for_message),
1985 Host::OSD_QUICK_DURATION);
1986 }
1987
1988 DevCon.WriteLn("Zipping save state to '%s' took %.2f ms", filename, timer.GetTimeMilliseconds());
1989}
1990
1991void VMManager::ZipSaveStateOnThread(std::unique_ptr<ArchiveEntryList> elist,
1992 std::unique_ptr<SaveStateScreenshotData> screenshot, std::string filename,

Callers

nothing calls this directly

Calls 6

SaveState_ZipToDiskFunction · 0.85
error_callbackFunction · 0.85
GetDescriptionMethod · 0.80
GetTimeMillisecondsMethod · 0.80
formatFunction · 0.50
WriteLnMethod · 0.45

Tested by

no test coverage detected