コード例 #1
0
ファイル: GeneralPane.cpp プロジェクト: MerryMage/dolphin
void GeneralPane::OnSaveConfig()
{
  auto& settings = SConfig::GetInstance();
  if (AutoUpdateChecker::SystemSupportsAutoUpdates())
  {
    Settings::Instance().SetAutoUpdateTrack(
        UpdateTrackFromIndex(m_combobox_update_track->currentIndex()));
  }

#ifdef USE_DISCORD_PRESENCE
  Discord::SetDiscordPresenceEnabled(m_checkbox_discord_presence->isChecked());
#endif

#if defined(USE_ANALYTICS) && USE_ANALYTICS
  Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
#endif
  settings.bCPUThread = m_checkbox_dualcore->isChecked();
  Config::SetBaseOrCurrent(Config::MAIN_CPU_THREAD, m_checkbox_dualcore->isChecked());
  Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
  Config::SetBaseOrCurrent(Config::MAIN_ENABLE_CHEATS, m_checkbox_cheats->isChecked());
  settings.m_EmulationSpeed = m_combobox_speedlimit->currentIndex() * 0.1f;

  for (size_t i = 0; i < m_cpu_cores.size(); ++i)
  {
    if (m_cpu_cores[i]->isChecked())
    {
      settings.cpu_core = PowerPC::AvailableCPUCores()[i];
      Config::SetBaseOrCurrent(Config::MAIN_CPU_CORE, PowerPC::AvailableCPUCores()[i]);
      break;
    }
  }

  settings.SaveSettings();
}
コード例 #2
0
ファイル: GeneralPane.cpp プロジェクト: Tinob/Ishiiruka
void GeneralPane::OnSaveConfig()
{
  auto& settings = SConfig::GetInstance();
  if (AutoUpdateChecker::SystemSupportsAutoUpdates())
  {
    Settings::Instance().SetAutoUpdateTrack(
        UpdateTrackFromIndex(m_combobox_update_track->currentIndex()));
  }

#if defined(USE_ANALYTICS) && USE_ANALYTICS
  Settings::Instance().SetAnalyticsEnabled(m_checkbox_enable_analytics->isChecked());
#endif
  settings.bCPUThread = m_checkbox_dualcore->isChecked();
  Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
  settings.m_EmulationSpeed = m_combobox_speedlimit->currentIndex() * 0.1f;
  int engine_value = 0;
  if (m_radio_interpreter->isChecked())
    engine_value = PowerPC::CPUCore::CORE_INTERPRETER;
  else if (m_radio_cached_interpreter->isChecked())
    engine_value = PowerPC::CPUCore::CORE_CACHEDINTERPRETER;
  else if (m_radio_jit->isChecked())
    engine_value = PowerPC::CPUCore::CORE_JIT64;
  else
    engine_value = PowerPC::CPUCore::CORE_JIT64;

  settings.iCPUCore = engine_value;
  settings.SaveSettings();
}