Config: Fix Movie config loading/saving

* Add missing Language setting loading/saving. This was added after the
  original OnionConfig PR, which is why support for it was missing.

* Change MovieConfigLoader to reuse ConfigInfos. Less duplication.

* Extract MovieConfigLoader::Save into SaveToDTM. The DTM should use
  the current config and not just the movie layer. This makes more
  sense than just saving the movie layer, which may not always exist,
  and also fixes a crash that would happen when creating a new
  recording because the movie layer wouldn't exist in that case.

  (Plus, having to get the loader from the layer and call ChangeDTM
  on it manually is not very pretty.)
This commit is contained in:
Léo Lam
2017-08-03 16:42:18 +08:00
parent fa7e3e55d2
commit 940cc843ed
7 changed files with 74 additions and 146 deletions

View File

@ -33,6 +33,7 @@
#include "Common/Config/Config.h"
#include "Core/Boot/Boot.h"
#include "Core/Config/MainSettings.h"
#include "Core/Config/SYSCONFSettings.h"
#include "Core/ConfigLoaders/BaseConfigLoader.h"
#include "Core/ConfigLoaders/GameConfigLoader.h"
@ -312,13 +313,14 @@ bool BootCore(std::unique_ptr<BootParameters> boot)
// Movie settings
if (Movie::IsPlayingInput() && Movie::IsConfigSaved())
{
StartUp.bCPUThread = Movie::IsDualCore();
StartUp.bDSPHLE = Movie::IsDSPHLE();
StartUp.bFastDiscSpeed = Movie::IsFastDiscSpeed();
StartUp.iCPUCore = Movie::GetCPUMode();
StartUp.bSyncGPU = Movie::IsSyncGPU();
// TODO: remove this once ConfigManager starts using OnionConfig.
StartUp.bCPUThread = Config::Get(Config::MAIN_CPU_THREAD);
StartUp.bDSPHLE = Config::Get(Config::MAIN_DSP_HLE);
StartUp.bFastDiscSpeed = Config::Get(Config::MAIN_FAST_DISC_SPEED);
StartUp.iCPUCore = Config::Get(Config::MAIN_CPU_CORE);
StartUp.bSyncGPU = Config::Get(Config::MAIN_SYNC_GPU);
if (!StartUp.bWii)
StartUp.SelectedLanguage = Movie::GetLanguage();
StartUp.SelectedLanguage = Config::Get(Config::MAIN_GC_LANGUAGE);
for (int i = 0; i < 2; ++i)
{
if (Movie::IsUsingMemcard(i) && Movie::IsStartingFromClearSave() && !StartUp.bWii)