mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-06 15:09:58 +01:00
qt: Add game launch stress test functionality behind new ENABLE_DEVELOPER_OPTIONS CMake option (#1442)
* qt: Implemented game launch stress test * qt: Hide stress test behind ENABLE_DEVELOPER_OPTIONS CMake option
This commit is contained in:
parent
1f483e1d33
commit
67f6735f02
@ -121,6 +121,8 @@ option(ENABLE_MICROPROFILE "Enables microprofile capabilities" OFF)
|
||||
|
||||
option(ENABLE_SSE42 "Enable SSE4.2 optimizations on x86_64" ON)
|
||||
|
||||
option(ENABLE_DEVELOPER_OPTIONS "Enable functionality targeted at emulator developers" OFF)
|
||||
|
||||
# Compile options
|
||||
CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
|
||||
option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
|
||||
|
||||
@ -174,6 +174,9 @@ endif()
|
||||
if(ENABLE_VULKAN)
|
||||
add_compile_definitions(ENABLE_VULKAN)
|
||||
endif()
|
||||
if(ENABLE_DEVELOPER_OPTIONS)
|
||||
add_compile_definitions(ENABLE_DEVELOPER_OPTIONS)
|
||||
endif()
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(core)
|
||||
|
||||
@ -980,6 +980,10 @@ void GMainWindow::ConnectWidgetEvents() {
|
||||
connect(game_list, &GameList::ShowList, this, &GMainWindow::OnGameListShowList);
|
||||
connect(game_list, &GameList::PopulatingCompleted, this,
|
||||
[this] { multiplayer_state->UpdateGameList(game_list->GetModel()); });
|
||||
#ifdef ENABLE_DEVELOPER_OPTIONS
|
||||
connect(game_list, &GameList::StartingLaunchStressTest, this,
|
||||
&GMainWindow::StartLaunchStressTest);
|
||||
#endif
|
||||
|
||||
connect(game_list, &GameList::OpenPerGameGeneralRequested, this,
|
||||
&GMainWindow::OnGameListOpenPerGameProperties);
|
||||
@ -1576,6 +1580,16 @@ void GMainWindow::ShutdownGame() {
|
||||
secondary_window->ReleaseRenderTarget();
|
||||
}
|
||||
|
||||
void GMainWindow::StartLaunchStressTest(const QString& game_path) {
|
||||
QThreadPool::globalInstance()->start([this, game_path] {
|
||||
do {
|
||||
ui->action_Stop->trigger();
|
||||
emit game_list->GameChosen(game_path);
|
||||
QThread::sleep(2);
|
||||
} while (emulation_running);
|
||||
});
|
||||
}
|
||||
|
||||
void GMainWindow::StoreRecentFile(const QString& filename) {
|
||||
UISettings::values.recent_files.prepend(filename);
|
||||
UISettings::values.recent_files.removeDuplicates();
|
||||
|
||||
@ -306,6 +306,7 @@ private slots:
|
||||
#endif
|
||||
void OnSwitchDiskResources(VideoCore::LoadCallbackStage stage, std::size_t value,
|
||||
std::size_t total);
|
||||
void StartLaunchStressTest(const QString& game_path);
|
||||
|
||||
private:
|
||||
Q_INVOKABLE void OnMoviePlaybackCompleted();
|
||||
|
||||
@ -644,6 +644,11 @@ void GameList::AddGamePopup(QMenu& context_menu, const QString& path, const QStr
|
||||
shortcut_menu->addAction(tr("Add to Applications Menu"));
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEVELOPER_OPTIONS
|
||||
context_menu.addSeparator();
|
||||
QAction* stress_test_launch = context_menu.addAction(tr("Stress Test: App Launch"));
|
||||
#endif
|
||||
|
||||
context_menu.addSeparator();
|
||||
QAction* properties = context_menu.addAction(tr("Properties"));
|
||||
|
||||
@ -755,6 +760,10 @@ void GameList::AddGamePopup(QMenu& context_menu, const QString& path, const QStr
|
||||
[this, path, program_id] { emit DumpRomFSRequested(path, program_id); });
|
||||
connect(remove_play_time_data, &QAction::triggered,
|
||||
[this, program_id]() { emit RemovePlayTimeRequested(program_id); });
|
||||
#ifdef ENABLE_DEVELOPER_OPTIONS
|
||||
connect(stress_test_launch, &QAction::triggered,
|
||||
[this, path]() { emit StartingLaunchStressTest(path); });
|
||||
#endif
|
||||
connect(properties, &QAction::triggered, this,
|
||||
[this, path]() { emit OpenPerGameGeneralRequested(path); });
|
||||
connect(open_shader_cache_location, &QAction::triggered, this, [this, program_id] {
|
||||
|
||||
@ -107,6 +107,7 @@ signals:
|
||||
void AddDirectory();
|
||||
void ShowList(bool show);
|
||||
void PopulatingCompleted();
|
||||
void StartingLaunchStressTest(const QString& game_path);
|
||||
|
||||
private slots:
|
||||
void OnItemExpanded(const QModelIndex& item);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user