Savestate: The callback is already an std::function, so no cbUserdata value is needed.

This commit is contained in:
Henrik Rydgård committed 2025-05-16 01:55:15 +02:00
1 parent 8e206d891f
commit a698486f9c
7 files changed
+52 -62

No files matched your search

+5 -8
View File
@@ -493,18 +493,12 @@ void EmuScreen::dialogFinished(const Screen *dialog, DialogResult result) {
lastImguiEnabled_ = false;
}
static void AfterSaveStateAction(SaveState::Status status, std::string_view message, void *) {
static void AfterSaveStateAction(SaveState::Status status, std::string_view message) {
if (!message.empty() && (!g_Config.bDumpFrames || !g_Config.bDumpVideoOutput)) {
g_OSD.Show(status == SaveState::Status::SUCCESS ? OSDType::MESSAGE_SUCCESS : OSDType::MESSAGE_ERROR, message, status == SaveState::Status::SUCCESS ? 2.0 : 5.0);
}
}
static void AfterStateBoot(SaveState::Status status, std::string_view message, void *ignored) {
AfterSaveStateAction(status, message, ignored);
Core_Resume();
System_Notify(SystemNotification::DISASSEMBLY);
}
void EmuScreen::focusChanged(ScreenFocusChange focusChange) {
Screen::focusChanged(focusChange);
@@ -567,7 +561,10 @@ void EmuScreen::sendMessage(UIMessage message, const char *value) {
}
const char *ext = strrchr(value, '.');
if (ext != nullptr && !strcmp(ext, ".ppst")) {
SaveState::Load(Path(value), -1, &AfterStateBoot);
SaveState::Load(Path(value), -1, [](SaveState::Status status, std::string_view message) {
Core_Resume();
System_Notify(SystemNotification::DISASSEMBLY);
});
} else {
PSP_Shutdown(true);
Achievements::UnloadGame();