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.
This commit is contained in:
JosJuice
2017-12-25 18:07:29 +01:00
parent c9b78e23a2
commit 9dd88d76dd
13 changed files with 93 additions and 81 deletions

View File

@ -5,6 +5,7 @@
#include <OptionParser.h>
#include <cstdio>
#include <cstring>
#include <optional>
#include <string>
#include <utility>
#include <wx/app.h>
@ -256,12 +257,18 @@ void DolphinApp::AfterInit()
if (m_play_movie && !m_movie_file.empty())
{
if (Movie::PlayInput(WxStrToStr(m_movie_file)))
std::optional<std::string> savestate_path;
if (Movie::PlayInput(WxStrToStr(m_movie_file), &savestate_path))
{
if (m_boot)
{
m_boot->savestate_path = savestate_path;
main_frame->StartGame(std::move(m_boot));
}
else
main_frame->BootGame("");
{
main_frame->BootGame("", savestate_path);
}
}
}
// First check if we have an exec command line.