From 9dd88d76dd1b6fa06b2d3702e39d2773424f6417 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 25 Dec 2017 18:07:29 +0100 Subject: Redesign the ability to load state at boot BootParameters can now contain the path of a savestate to load at boot. Movie has been made to use this instead of poking at Core.cpp's state. --- Source/Core/DolphinWX/FrameTools.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') 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 #include #include +#include #include #include #include @@ -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& 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 savestate_path; + if (Movie::PlayInput(WxStrToStr(path), &savestate_path)) + BootGame("", savestate_path); } void CFrame::OnStopRecording(wxCommandEvent& WXUNUSED(event)) -- cgit v1.2.3