summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-12-26 20:56:06 +0100
committerGitHub <noreply@github.com>2017-12-26 20:56:06 +0100
commit3bc61ed3635f5932cad8b460812ad8545aada4da (patch)
treec74c0da5d6edaf35551038a90f13bf40cbc19f67 /Source/Core/DolphinWX/FrameTools.cpp
parentc9b78e23a20b3bab7af132ca870b4df8440c2145 (diff)
parent9dd88d76dd1b6fa06b2d3702e39d2773424f6417 (diff)
Merge pull request #6271 from JosJuice/load-state-at-boot
Redesign the ability to load state at boot
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index bf1072b68c..929e435bd9 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -9,6 +9,7 @@
#include <cstdio>
#include <future>
#include <mutex>
+#include <optional>
#include <string>
#include <vector>
#include <wx/app.h>
@@ -301,7 +302,7 @@ void CFrame::OpenGeneralConfiguration(wxWindowID tab_id)
// 1. Show the game list and boot the selected game.
// 2. Default ISO
// 3. Boot last selected game
-void CFrame::BootGame(const std::string& filename)
+void CFrame::BootGame(const std::string& filename, const std::optional<std::string>& savestate_path)
{
std::string bootfile = filename;
SConfig& StartUp = SConfig::GetInstance();
@@ -331,7 +332,7 @@ void CFrame::BootGame(const std::string& filename)
}
if (!bootfile.empty())
{
- StartGame(BootParameters::GenerateFromFile(bootfile));
+ StartGame(BootParameters::GenerateFromFile(bootfile, savestate_path));
}
}
@@ -513,8 +514,9 @@ void CFrame::OnPlayRecording(wxCommandEvent& WXUNUSED(event))
GetMenuBar()->FindItem(IDM_RECORD_READ_ONLY)->Check();
}
- if (Movie::PlayInput(WxStrToStr(path)))
- BootGame("");
+ std::optional<std::string> savestate_path;
+ if (Movie::PlayInput(WxStrToStr(path), &savestate_path))
+ BootGame("", savestate_path);
}
void CFrame::OnStopRecording(wxCommandEvent& WXUNUSED(event))