summaryrefslogtreecommitdiff
path: root/src/citra_qt/debugger/profiler.cpp
diff options
context:
space:
mode:
authorGravatar Henrik RydgÄrd2016-04-29 02:17:31 +0200
committerGravatar bunnei2016-04-28 20:17:31 -0400
commit90501f20e6b91fcd2beaccf0b1a0174b189da09c (patch)
tree9f909f9402d09e9a6175d37383aece363baba2f9 /src/citra_qt/debugger/profiler.cpp
parentMerge pull request #1727 from MerryMage/minor-commit (diff)
downloadyuzu-90501f20e6b91fcd2beaccf0b1a0174b189da09c.tar.gz
yuzu-90501f20e6b91fcd2beaccf0b1a0174b189da09c.tar.xz
yuzu-90501f20e6b91fcd2beaccf0b1a0174b189da09c.zip
Make Citra build with MICROPROFILE_ENABLED set to 0 (#1709)
* Make Citra build with MICROPROFILE_ENABLED set to 0 * Buildfix with microprofile kept on * moc did not like a dialog to conditionally exist. * Cleanup * Fix end of line
Diffstat (limited to 'src/citra_qt/debugger/profiler.cpp')
-rw-r--r--src/citra_qt/debugger/profiler.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp
index 4f6ba0e1f..e90973b8e 100644
--- a/src/citra_qt/debugger/profiler.cpp
+++ b/src/citra_qt/debugger/profiler.cpp
@@ -14,8 +14,10 @@
14 14
15// Include the implementation of the UI in this file. This isn't in microprofile.cpp because the 15// Include the implementation of the UI in this file. This isn't in microprofile.cpp because the
16// non-Qt frontends don't need it (and don't implement the UI drawing hooks either). 16// non-Qt frontends don't need it (and don't implement the UI drawing hooks either).
17#if MICROPROFILE_ENABLED
17#define MICROPROFILEUI_IMPL 1 18#define MICROPROFILEUI_IMPL 1
18#include "common/microprofileui.h" 19#include "common/microprofileui.h"
20#endif
19 21
20using namespace Common::Profiling; 22using namespace Common::Profiling;
21 23
@@ -148,6 +150,8 @@ void ProfilerWidget::setProfilingInfoUpdateEnabled(bool enable)
148 } 150 }
149} 151}
150 152
153#if MICROPROFILE_ENABLED
154
151class MicroProfileWidget : public QWidget { 155class MicroProfileWidget : public QWidget {
152public: 156public:
153 MicroProfileWidget(QWidget* parent = nullptr); 157 MicroProfileWidget(QWidget* parent = nullptr);
@@ -171,6 +175,8 @@ private:
171 QTimer update_timer; 175 QTimer update_timer;
172}; 176};
173 177
178#endif
179
174MicroProfileDialog::MicroProfileDialog(QWidget* parent) 180MicroProfileDialog::MicroProfileDialog(QWidget* parent)
175 : QWidget(parent, Qt::Dialog) 181 : QWidget(parent, Qt::Dialog)
176{ 182{
@@ -180,6 +186,8 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent)
180 // Remove the "?" button from the titlebar and enable the maximize button 186 // Remove the "?" button from the titlebar and enable the maximize button
181 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::WindowMaximizeButtonHint); 187 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint | Qt::WindowMaximizeButtonHint);
182 188
189#if MICROPROFILE_ENABLED
190
183 MicroProfileWidget* widget = new MicroProfileWidget(this); 191 MicroProfileWidget* widget = new MicroProfileWidget(this);
184 192
185 QLayout* layout = new QVBoxLayout(this); 193 QLayout* layout = new QVBoxLayout(this);
@@ -191,6 +199,7 @@ MicroProfileDialog::MicroProfileDialog(QWidget* parent)
191 setFocusProxy(widget); 199 setFocusProxy(widget);
192 widget->setFocusPolicy(Qt::StrongFocus); 200 widget->setFocusPolicy(Qt::StrongFocus);
193 widget->setFocus(); 201 widget->setFocus();
202#endif
194} 203}
195 204
196QAction* MicroProfileDialog::toggleViewAction() { 205QAction* MicroProfileDialog::toggleViewAction() {
@@ -218,6 +227,9 @@ void MicroProfileDialog::hideEvent(QHideEvent* ev) {
218 QWidget::hideEvent(ev); 227 QWidget::hideEvent(ev);
219} 228}
220 229
230
231#if MICROPROFILE_ENABLED
232
221/// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the 233/// There's no way to pass a user pointer to MicroProfile, so this variable is used to make the
222/// QPainter available inside the drawing callbacks. 234/// QPainter available inside the drawing callbacks.
223static QPainter* mp_painter = nullptr; 235static QPainter* mp_painter = nullptr;
@@ -337,3 +349,4 @@ void MicroProfileDrawLine2D(u32 vertices_length, float* vertices, u32 hex_color)
337 mp_painter->drawPolyline(point_buf.data(), vertices_length); 349 mp_painter->drawPolyline(point_buf.data(), vertices_length);
338 point_buf.clear(); 350 point_buf.clear();
339} 351}
352#endif