Skip to content

Commit

Permalink
Adds gfxr capture to dive ui
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantComm committed Jan 9, 2025
1 parent ddf30f0 commit d2b2a3d
Show file tree
Hide file tree
Showing 4 changed files with 432 additions and 15 deletions.
25 changes: 22 additions & 3 deletions ui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,12 @@ void MainWindow::OnOpenFile()
}
}

//--------------------------------------------------------------------------------------------------
void MainWindow::OnGFXRCapture()
{
emit OnCapture(false, true);
}

// =================================================================================================
// OnNormalCapture is triggered for captures without counters.
// =================================================================================================
Expand Down Expand Up @@ -689,8 +695,9 @@ void MainWindow::OnCaptureTrigger()
}

//--------------------------------------------------------------------------------------------------
void MainWindow::OnCapture(bool is_capture_delayed)
void MainWindow::OnCapture(bool is_capture_delayed, bool is_gfxr_capture)
{
m_trace_dig->useGfxrCapture(is_gfxr_capture);
m_trace_dig->UpdateDeviceList(true);
m_trace_dig->exec();
}
Expand Down Expand Up @@ -927,6 +934,17 @@ void MainWindow::CreateActions()
m_capture_action->setShortcut(QKeySequence("f5"));
connect(m_capture_action, &QAction::triggered, this, &MainWindow::OnNormalCapture);

// PM4 Capture action
m_pm4_capture_action = new QAction(tr("PM4 Capture"), this);
m_pm4_capture_action->setStatusTip(tr("Capture a Dive trace (PM4)"));
m_pm4_capture_action->setShortcut(QKeySequence("f5"));
connect(m_pm4_capture_action, &QAction::triggered, this, &MainWindow::OnNormalCapture);
// GFXR Capture action
m_gfxr_capture_action = new QAction(tr("GFXR Capture"), this);
m_gfxr_capture_action->setStatusTip(tr("Capture a Dive trace (GFXR)"));
m_gfxr_capture_action->setShortcut(QKeySequence("f6"));
connect(m_gfxr_capture_action, &QAction::triggered, this, &MainWindow::OnGFXRCapture);

// Capture with delay action
m_capture_delay_action = new QAction(tr("Capture with delay"), this);
m_capture_delay_action->setStatusTip(tr("Capture a Dive trace after a delay"));
Expand Down Expand Up @@ -960,7 +978,8 @@ void MainWindow::CreateMenus()
m_file_menu->addAction(m_exit_action);

m_capture_menu = menuBar()->addMenu(tr("&Capture"));
m_capture_menu->addAction(m_capture_action);
m_capture_menu->addAction(m_pm4_capture_action);
m_capture_menu->addAction(m_gfxr_capture_action);

m_help_menu = menuBar()->addMenu(tr("&Help"));
m_help_menu->addAction(m_shortcuts_action);
Expand All @@ -984,7 +1003,7 @@ void MainWindow::CreateToolBars()
QToolButton *m_capture_button = new QToolButton();
m_capture_button->setPopupMode(QToolButton::MenuButtonPopup);
m_capture_button->setMenu(m_capture_menu);
m_capture_button->setDefaultAction(m_capture_action);
m_capture_button->setDefaultAction(m_pm4_capture_action);
m_capture_button->setIcon(QIcon(":/images/capture.png"));

m_file_tool_bar->addWidget(m_capture_button);
Expand Down
5 changes: 4 additions & 1 deletion ui/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ class MainWindow : public QMainWindow
void FileLoaded();

public slots:
void OnCapture(bool is_capture_delayed = false);
void OnCapture(bool is_capture_delayed = false, bool is_gfxr_capture = false);
void OnSwitchToShaderTab();

private slots:
void OnCommandViewModeChange(const QString &string);
void OnCommandViewModeComboBoxHover(const QString &);
void OnSelectionChanged(const QModelIndex &index);
void OnOpenFile();
void OnGFXRCapture();
void OnNormalCapture();
void OnCaptureTrigger();
void OnExpandToLevel();
Expand Down Expand Up @@ -119,6 +120,8 @@ private slots:
QAction *m_save_as_action;
QAction *m_exit_action;
QMenu *m_capture_menu;
QAction *m_gfxr_capture_action;
QAction *m_pm4_capture_action;
QAction *m_capture_action;
QAction *m_capture_delay_action;
QAction *m_capture_setting_action;
Expand Down
Loading

0 comments on commit d2b2a3d

Please sign in to comment.