From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/citra_qt/debugger/graphics_cmdlists.cpp | 47 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp') diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 3e0a0a145..daf1cf1de 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -20,9 +20,9 @@ #include "common/vector_math.h" +#include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" -#include "video_core/debug_utils/debug_utils.h" QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { QImage decoded_image(info.width, info.height, QImage::Format_ARGB32); @@ -38,7 +38,8 @@ QImage LoadTexture(u8* src, const Pica::DebugUtils::TextureInfo& info) { class TextureInfoWidget : public QWidget { public: - TextureInfoWidget(u8* src, const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr) : QWidget(parent) { + TextureInfoWidget(u8* src, const Pica::DebugUtils::TextureInfo& info, QWidget* parent = nullptr) + : QWidget(parent) { QLabel* image_widget = new QLabel; QPixmap image_pixmap = QPixmap::fromImage(LoadTexture(src, info)); image_pixmap = image_pixmap.scaled(200, 100, Qt::KeepAspectRatio, Qt::SmoothTransformation); @@ -51,7 +52,6 @@ public: }; GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) { - } int GPUCommandListModel::rowCount(const QModelIndex& parent) const { @@ -70,7 +70,7 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { if (role == Qt::DisplayRole) { QString content; - switch ( index.column() ) { + switch (index.column()) { case 0: return QString::fromLatin1(Pica::Regs::GetCommandName(write.cmd_id).c_str()); case 1: @@ -88,9 +88,8 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { } QVariant GPUCommandListModel::headerData(int section, Qt::Orientation orientation, int role) const { - switch(role) { - case Qt::DisplayRole: - { + switch (role) { + case Qt::DisplayRole: { switch (section) { case 0: return tr("Command Name"); @@ -117,14 +116,14 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace& endResetModel(); } -#define COMMAND_IN_RANGE(cmd_id, reg_name) \ - (cmd_id >= PICA_REG_INDEX(reg_name) && \ +#define COMMAND_IN_RANGE(cmd_id, reg_name) \ + (cmd_id >= PICA_REG_INDEX(reg_name) && \ cmd_id < PICA_REG_INDEX(reg_name) + sizeof(decltype(Pica::g_state.regs.reg_name)) / 4) void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { - const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); - if (COMMAND_IN_RANGE(command_id, texture0) || - COMMAND_IN_RANGE(command_id, texture1) || + const unsigned int command_id = + list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); + if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || COMMAND_IN_RANGE(command_id, texture2)) { unsigned index; @@ -148,9 +147,9 @@ void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) { QWidget* new_info_widget = nullptr; - const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); - if (COMMAND_IN_RANGE(command_id, texture0) || - COMMAND_IN_RANGE(command_id, texture1) || + const unsigned int command_id = + list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt(); + if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) || COMMAND_IN_RANGE(command_id, texture2)) { unsigned index; @@ -179,7 +178,8 @@ void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) { } #undef COMMAND_IN_RANGE -GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pica Command List"), parent) { +GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) + : QDockWidget(tr("Pica Command List"), parent) { setObjectName("Pica Command List"); GPUCommandListModel* model = new GPUCommandListModel(this); @@ -191,23 +191,24 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pi list_widget->setRootIsDecorated(false); list_widget->setUniformRowHeights(true); -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents); #else list_widget->header()->setResizeMode(QHeaderView::ResizeToContents); #endif - connect(list_widget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), - this, SLOT(SetCommandInfo(const QModelIndex&))); - connect(list_widget, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(OnCommandDoubleClicked(const QModelIndex&))); + connect(list_widget->selectionModel(), + SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this, + SLOT(SetCommandInfo(const QModelIndex&))); + connect(list_widget, SIGNAL(doubleClicked(const QModelIndex&)), this, + SLOT(OnCommandDoubleClicked(const QModelIndex&))); toggle_tracing = new QPushButton(tr("Start Tracing")); QPushButton* copy_all = new QPushButton(tr("Copy All")); connect(toggle_tracing, SIGNAL(clicked()), this, SLOT(OnToggleTracing())); - connect(this, SIGNAL(TracingFinished(const Pica::DebugUtils::PicaTrace&)), - model, SLOT(OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&))); + connect(this, SIGNAL(TracingFinished(const Pica::DebugUtils::PicaTrace&)), model, + SLOT(OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&))); connect(copy_all, SIGNAL(clicked()), this, SLOT(CopyAllToClipboard())); -- cgit v1.2.3 From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/citra_qt/debugger/graphics_cmdlists.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp') diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index daf1cf1de..b088ad29d 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -51,8 +51,7 @@ public: } }; -GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) { -} +GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} int GPUCommandListModel::rowCount(const QModelIndex& parent) const { return static_cast(pica_trace.writes.size()); -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/citra_qt/debugger/graphics_cmdlists.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp') diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index b088ad29d..35be9b9bd 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_cmdlists.h" #include #include #include @@ -13,13 +14,9 @@ #include #include #include - -#include "citra_qt/debugger/graphics_cmdlists.h" #include "citra_qt/util/spinbox.h" #include "citra_qt/util/util.h" - #include "common/vector_math.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/citra_qt/debugger/graphics_cmdlists.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp') diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 35be9b9bd..8a784d108 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_cmdlists.h" #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include "citra_qt/debugger/graphics_cmdlists.h" #include "citra_qt/util/spinbox.h" #include "citra_qt/util/util.h" #include "common/vector_math.h" -- cgit v1.2.3