|
37 | 37 | #else |
38 | 38 | #include "tools/PsfPlayer/Source/SH_OpenAL.h" |
39 | 39 | #endif |
| 40 | + |
| 41 | +#ifdef PROFILE |
| 42 | +#include "profiledialog.h" |
| 43 | +#include "ui_profilemenu.h" |
| 44 | +#endif |
| 45 | + |
40 | 46 | #include "input/PH_GenericInput.h" |
41 | 47 | #include "DiskUtils.h" |
42 | 48 | #include "PathUtils.h" |
@@ -75,11 +81,13 @@ MainWindow::MainWindow(QWidget* parent) |
75 | 81 |
|
76 | 82 | #ifdef PROFILE |
77 | 83 | { |
78 | | - m_profileStatsLabel = new QLabel(this); |
79 | | - QFont courierFont("Courier"); |
80 | | - m_profileStatsLabel->setFont(courierFont); |
81 | | - m_profileStatsLabel->setAlignment(Qt::AlignTop); |
82 | | - ui->gridLayout->addWidget(m_profileStatsLabel, 0, 1); |
| 84 | + m_profileDialog = new ProfileDialog(this); |
| 85 | + auto profileMenu = new QMenu(this); |
| 86 | + profileMenuUi = new Ui::ProfileMenu(); |
| 87 | + profileMenuUi->setupUi(profileMenu); |
| 88 | + ui->menuBar->insertMenu(ui->menuHelp->menuAction(), profileMenu); |
| 89 | + connect(profileMenuUi->actionShowProfile, &QAction::triggered, m_profileDialog, &QWidget::show); |
| 90 | + connect(profileMenuUi->actionResetProfile, &QAction::triggered, []() { CStatsManager::GetInstance().ResetStats(); }); |
83 | 91 | } |
84 | 92 | #endif |
85 | 93 |
|
@@ -475,7 +483,10 @@ void MainWindow::updateStats() |
475 | 483 | uint32 drawCalls = CStatsManager::GetInstance().GetDrawCalls(); |
476 | 484 | uint32 dcpf = (frames != 0) ? (drawCalls / frames) : 0; |
477 | 485 | #ifdef PROFILE |
478 | | - m_profileStatsLabel->setText(QString::fromStdString(CStatsManager::GetInstance().GetProfilingInfo())); |
| 486 | + if(m_profileDialog->isVisible()) |
| 487 | + { |
| 488 | + m_profileDialog->updateStats(CStatsManager::GetInstance().GetProfilingInfo()); |
| 489 | + } |
479 | 490 | #endif |
480 | 491 | m_fpsLabel->setText(QString("%1 f/s, %2 dc/f").arg(frames).arg(dcpf)); |
481 | 492 | CStatsManager::GetInstance().ClearStats(); |
|
0 commit comments