summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/async_shaders.cpp4
-rw-r--r--src/yuzu/game_list.cpp2
-rw-r--r--src/yuzu/game_list_worker.cpp2
-rw-r--r--src/yuzu/main.cpp55
-rw-r--r--src/yuzu/main.h2
-rw-r--r--src/yuzu/main.ui9
-rw-r--r--src/yuzu/uisettings.h8
7 files changed, 54 insertions, 28 deletions
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp
index 6c19eaf07..f815584f7 100644
--- a/src/video_core/shader/async_shaders.cpp
+++ b/src/video_core/shader/async_shaders.cpp
@@ -42,8 +42,8 @@ void AsyncShaders::AllocateWorkers() {
42 // Create workers 42 // Create workers
43 for (std::size_t i = 0; i < num_workers; i++) { 43 for (std::size_t i = 0; i < num_workers; i++) {
44 context_list.push_back(emu_window.CreateSharedContext()); 44 context_list.push_back(emu_window.CreateSharedContext());
45 worker_threads.push_back(std::move( 45 worker_threads.push_back(
46 std::thread(&AsyncShaders::ShaderCompilerThread, this, context_list[i].get()))); 46 std::thread(&AsyncShaders::ShaderCompilerThread, this, context_list[i].get()));
47 } 47 }
48} 48}
49 49
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 62acc3720..967ef4a21 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -406,7 +406,7 @@ bool GameList::isEmpty() const {
406 type == GameListItemType::SysNandDir)) { 406 type == GameListItemType::SysNandDir)) {
407 item_model->invisibleRootItem()->removeRow(child->row()); 407 item_model->invisibleRootItem()->removeRow(child->row());
408 i--; 408 i--;
409 }; 409 }
410 } 410 }
411 return !item_model->invisibleRootItem()->hasChildren(); 411 return !item_model->invisibleRootItem()->hasChildren();
412} 412}
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp
index 643ca6491..c9a395222 100644
--- a/src/yuzu/game_list_worker.cpp
+++ b/src/yuzu/game_list_worker.cpp
@@ -374,7 +374,7 @@ void GameListWorker::run() {
374 ScanFileSystem(ScanTarget::PopulateGameList, game_dir.path.toStdString(), 374 ScanFileSystem(ScanTarget::PopulateGameList, game_dir.path.toStdString(),
375 game_dir.deep_scan ? 256 : 0, game_list_dir); 375 game_dir.deep_scan ? 256 : 0, game_list_dir);
376 } 376 }
377 }; 377 }
378 378
379 emit Finished(watch_list); 379 emit Finished(watch_list);
380} 380}
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 592993c36..3ef59fbad 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -894,6 +894,8 @@ void GMainWindow::ConnectMenuEvents() {
894 connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); 894 connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ);
895 connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); 895 connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
896 connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); 896 connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
897 connect(ui.action_Configure_Current_Game, &QAction::triggered, this,
898 &GMainWindow::OnConfigurePerGame);
897 899
898 // View 900 // View
899 connect(ui.action_Single_Window_Mode, &QAction::triggered, this, 901 connect(ui.action_Single_Window_Mode, &QAction::triggered, this,
@@ -1167,6 +1169,7 @@ void GMainWindow::ShutdownGame() {
1167 ui.action_Pause->setEnabled(false); 1169 ui.action_Pause->setEnabled(false);
1168 ui.action_Stop->setEnabled(false); 1170 ui.action_Stop->setEnabled(false);
1169 ui.action_Restart->setEnabled(false); 1171 ui.action_Restart->setEnabled(false);
1172 ui.action_Configure_Current_Game->setEnabled(false);
1170 ui.action_Report_Compatibility->setEnabled(false); 1173 ui.action_Report_Compatibility->setEnabled(false);
1171 ui.action_Load_Amiibo->setEnabled(false); 1174 ui.action_Load_Amiibo->setEnabled(false);
1172 ui.action_Capture_Screenshot->setEnabled(false); 1175 ui.action_Capture_Screenshot->setEnabled(false);
@@ -1718,26 +1721,7 @@ void GMainWindow::OnGameListOpenPerGameProperties(const std::string& file) {
1718 return; 1721 return;
1719 } 1722 }
1720 1723
1721 ConfigurePerGame dialog(this, title_id); 1724 OpenPerGameConfiguration(title_id, file);
1722 dialog.LoadFromFile(v_file);
1723 auto result = dialog.exec();
1724 if (result == QDialog::Accepted) {
1725 dialog.ApplyConfiguration();
1726
1727 const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false);
1728 if (reload) {
1729 game_list->PopulateAsync(UISettings::values.game_dirs);
1730 }
1731
1732 // Do not cause the global config to write local settings into the config file
1733 Settings::RestoreGlobalState();
1734
1735 if (!Core::System::GetInstance().IsPoweredOn()) {
1736 config->Save();
1737 }
1738 } else {
1739 Settings::RestoreGlobalState();
1740 }
1741} 1725}
1742 1726
1743void GMainWindow::OnMenuLoadFile() { 1727void GMainWindow::OnMenuLoadFile() {
@@ -2066,6 +2050,7 @@ void GMainWindow::OnStartGame() {
2066 ui.action_Pause->setEnabled(true); 2050 ui.action_Pause->setEnabled(true);
2067 ui.action_Stop->setEnabled(true); 2051 ui.action_Stop->setEnabled(true);
2068 ui.action_Restart->setEnabled(true); 2052 ui.action_Restart->setEnabled(true);
2053 ui.action_Configure_Current_Game->setEnabled(true);
2069 ui.action_Report_Compatibility->setEnabled(true); 2054 ui.action_Report_Compatibility->setEnabled(true);
2070 2055
2071 discord_rpc->Update(); 2056 discord_rpc->Update();
@@ -2255,6 +2240,36 @@ void GMainWindow::OnConfigure() {
2255 UpdateStatusButtons(); 2240 UpdateStatusButtons();
2256} 2241}
2257 2242
2243void GMainWindow::OnConfigurePerGame() {
2244 const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
2245 OpenPerGameConfiguration(title_id, game_path.toStdString());
2246}
2247
2248void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file_name) {
2249 const auto v_file = Core::GetGameFileFromPath(vfs, file_name);
2250
2251 ConfigurePerGame dialog(this, title_id);
2252 dialog.LoadFromFile(v_file);
2253 auto result = dialog.exec();
2254 if (result == QDialog::Accepted) {
2255 dialog.ApplyConfiguration();
2256
2257 const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false);
2258 if (reload) {
2259 game_list->PopulateAsync(UISettings::values.game_dirs);
2260 }
2261
2262 // Do not cause the global config to write local settings into the config file
2263 Settings::RestoreGlobalState();
2264
2265 if (!Core::System::GetInstance().IsPoweredOn()) {
2266 config->Save();
2267 }
2268 } else {
2269 Settings::RestoreGlobalState();
2270 }
2271}
2272
2258void GMainWindow::OnLoadAmiibo() { 2273void GMainWindow::OnLoadAmiibo() {
2259 const QString extensions{QStringLiteral("*.bin")}; 2274 const QString extensions{QStringLiteral("*.bin")};
2260 const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions); 2275 const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 73a44a3bf..64c33830d 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -216,6 +216,7 @@ private slots:
216 void OnMenuInstallToNAND(); 216 void OnMenuInstallToNAND();
217 void OnMenuRecentFile(); 217 void OnMenuRecentFile();
218 void OnConfigure(); 218 void OnConfigure();
219 void OnConfigurePerGame();
219 void OnLoadAmiibo(); 220 void OnLoadAmiibo();
220 void OnOpenYuzuFolder(); 221 void OnOpenYuzuFolder();
221 void OnAbout(); 222 void OnAbout();
@@ -249,6 +250,7 @@ private:
249 void ShowMouseCursor(); 250 void ShowMouseCursor();
250 void OpenURL(const QUrl& url); 251 void OpenURL(const QUrl& url);
251 void LoadTranslation(); 252 void LoadTranslation();
253 void OpenPerGameConfiguration(u64 title_id, const std::string& file_name);
252 254
253 Ui::MainWindow ui; 255 Ui::MainWindow ui;
254 256
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui
index c3a1d715e..87ea985d8 100644
--- a/src/yuzu/main.ui
+++ b/src/yuzu/main.ui
@@ -81,6 +81,7 @@
81 <addaction name="action_Restart"/> 81 <addaction name="action_Restart"/>
82 <addaction name="separator"/> 82 <addaction name="separator"/>
83 <addaction name="action_Configure"/> 83 <addaction name="action_Configure"/>
84 <addaction name="action_Configure_Current_Game"/>
84 </widget> 85 </widget>
85 <widget class="QMenu" name="menu_View"> 86 <widget class="QMenu" name="menu_View">
86 <property name="title"> 87 <property name="title">
@@ -287,6 +288,14 @@
287 <string>Capture Screenshot</string> 288 <string>Capture Screenshot</string>
288 </property> 289 </property>
289 </action> 290 </action>
291 <action name="action_Configure_Current_Game">
292 <property name="enabled">
293 <bool>false</bool>
294 </property>
295 <property name="text">
296 <string>Configure Current Game..</string>
297 </property>
298 </action>
290 </widget> 299 </widget>
291 <resources/> 300 <resources/>
292 <connections/> 301 <connections/>
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index bbfeafc55..2d2e82f15 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -29,14 +29,14 @@ extern const Themes themes;
29 29
30struct GameDir { 30struct GameDir {
31 QString path; 31 QString path;
32 bool deep_scan; 32 bool deep_scan = false;
33 bool expanded; 33 bool expanded = false;
34 bool operator==(const GameDir& rhs) const { 34 bool operator==(const GameDir& rhs) const {
35 return path == rhs.path; 35 return path == rhs.path;
36 }; 36 }
37 bool operator!=(const GameDir& rhs) const { 37 bool operator!=(const GameDir& rhs) const {
38 return !operator==(rhs); 38 return !operator==(rhs);
39 }; 39 }
40}; 40};
41 41
42struct Values { 42struct Values {