mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	CitraQt: Apply config at startup
This commit is contained in:
		
							parent
							
								
									ad664b4a01
								
							
						
					
					
						commit
						f2c8619704
					
				
					 6 changed files with 19 additions and 12 deletions
				
			
		|  | @ -189,6 +189,7 @@ void Config::SaveValues() { | ||||||
| 
 | 
 | ||||||
| void Config::Reload() { | void Config::Reload() { | ||||||
|     ReadValues(); |     ReadValues(); | ||||||
|  |     Settings::Apply(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Config::Save() { | void Config::Save() { | ||||||
|  |  | ||||||
|  | @ -5,7 +5,6 @@ | ||||||
| #include "citra_qt/configure_debug.h" | #include "citra_qt/configure_debug.h" | ||||||
| #include "ui_configure_debug.h" | #include "ui_configure_debug.h" | ||||||
| 
 | 
 | ||||||
| #include "core/gdbstub/gdbstub.h" |  | ||||||
| #include "core/settings.h" | #include "core/settings.h" | ||||||
| 
 | 
 | ||||||
| ConfigureDebug::ConfigureDebug(QWidget *parent) : | ConfigureDebug::ConfigureDebug(QWidget *parent) : | ||||||
|  | @ -26,7 +25,7 @@ void ConfigureDebug::setConfiguration() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ConfigureDebug::applyConfiguration() { | void ConfigureDebug::applyConfiguration() { | ||||||
|     GDBStub::ToggleServer(ui->toogle_gdbstub->isChecked()); |  | ||||||
|     Settings::values.use_gdbstub = ui->toogle_gdbstub->isChecked(); |     Settings::values.use_gdbstub = ui->toogle_gdbstub->isChecked(); | ||||||
|     Settings::values.gdbstub_port = ui->gdbport_spinbox->value(); |     Settings::values.gdbstub_port = ui->gdbport_spinbox->value(); | ||||||
|  |     Settings::Apply(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -8,8 +8,6 @@ | ||||||
| 
 | 
 | ||||||
| #include "core/settings.h" | #include "core/settings.h" | ||||||
| 
 | 
 | ||||||
| #include "video_core/video_core.h" |  | ||||||
| 
 |  | ||||||
| ConfigureGeneral::ConfigureGeneral(QWidget *parent) : | ConfigureGeneral::ConfigureGeneral(QWidget *parent) : | ||||||
|     QWidget(parent), |     QWidget(parent), | ||||||
|     ui(new Ui::ConfigureGeneral) |     ui(new Ui::ConfigureGeneral) | ||||||
|  | @ -32,12 +30,8 @@ void ConfigureGeneral::setConfiguration() { | ||||||
| void ConfigureGeneral::applyConfiguration() { | void ConfigureGeneral::applyConfiguration() { | ||||||
|     UISettings::values.gamedir_deepscan = ui->toogle_deepscan->isChecked(); |     UISettings::values.gamedir_deepscan = ui->toogle_deepscan->isChecked(); | ||||||
|     UISettings::values.confirm_before_closing = ui->toogle_check_exit->isChecked(); |     UISettings::values.confirm_before_closing = ui->toogle_check_exit->isChecked(); | ||||||
| 
 |  | ||||||
|     Settings::values.region_value = ui->region_combobox->currentIndex(); |     Settings::values.region_value = ui->region_combobox->currentIndex(); | ||||||
| 
 |  | ||||||
|     VideoCore::g_hw_renderer_enabled = |  | ||||||
|     Settings::values.use_hw_renderer = ui->toogle_hw_renderer->isChecked(); |     Settings::values.use_hw_renderer = ui->toogle_hw_renderer->isChecked(); | ||||||
| 
 |  | ||||||
|     VideoCore::g_shader_jit_enabled = |  | ||||||
|     Settings::values.use_shader_jit = ui->toogle_shader_jit->isChecked(); |     Settings::values.use_shader_jit = ui->toogle_shader_jit->isChecked(); | ||||||
|  |     Settings::Apply(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -141,9 +141,6 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) | ||||||
| 
 | 
 | ||||||
|     game_list->LoadInterfaceLayout(); |     game_list->LoadInterfaceLayout(); | ||||||
| 
 | 
 | ||||||
|     GDBStub::ToggleServer(Settings::values.use_gdbstub); |  | ||||||
|     GDBStub::SetServerPort(static_cast<u32>(Settings::values.gdbstub_port)); |  | ||||||
| 
 |  | ||||||
|     ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode); |     ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode); | ||||||
|     ToggleWindowMode(); |     ToggleWindowMode(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,8 +4,22 @@ | ||||||
| 
 | 
 | ||||||
| #include "settings.h" | #include "settings.h" | ||||||
| 
 | 
 | ||||||
|  | #include "core/gdbstub/gdbstub.h" | ||||||
|  | 
 | ||||||
|  | #include "video_core/video_core.h" | ||||||
|  | 
 | ||||||
| namespace Settings { | namespace Settings { | ||||||
| 
 | 
 | ||||||
| Values values = {}; | Values values = {}; | ||||||
| 
 | 
 | ||||||
|  | void Apply() { | ||||||
|  | 
 | ||||||
|  |     GDBStub::SetServerPort(static_cast<u32>(values.gdbstub_port)); | ||||||
|  |     GDBStub::ToggleServer(values.use_gdbstub); | ||||||
|  | 
 | ||||||
|  |     VideoCore::g_hw_renderer_enabled = values.use_hw_renderer; | ||||||
|  |     VideoCore::g_shader_jit_enabled = values.use_shader_jit; | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | } // namespace
 | ||||||
|  |  | ||||||
|  | @ -67,4 +67,6 @@ struct Values { | ||||||
|     u16 gdbstub_port; |     u16 gdbstub_port; | ||||||
| } extern values; | } extern values; | ||||||
| 
 | 
 | ||||||
|  | void Apply(); | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue