From 63c2e32e207d31ecadd9022e1d7cd705c9febac8 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Sat, 15 Sep 2018 15:21:06 +0200 Subject: Port #4182 from Citra: "Prefix all size_t with std::" --- src/yuzu/configuration/configure_gamelist.cpp | 2 +- src/yuzu/debugger/graphics/graphics_breakpoints.cpp | 3 ++- src/yuzu/debugger/graphics/graphics_surface.cpp | 4 ++-- src/yuzu/debugger/wait_tree.cpp | 2 +- src/yuzu/main.cpp | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/yuzu') diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 0be030434..8743ce982 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -89,7 +89,7 @@ void ConfigureGameList::InitializeIconSizeComboBox() { } void ConfigureGameList::InitializeRowComboBoxes() { - for (size_t i = 0; i < row_text_names.size(); ++i) { + for (std::size_t i = 0; i < row_text_names.size(); ++i) { ui->row_1_text_combobox->addItem(row_text_names[i], QVariant::fromValue(i)); ui->row_2_text_combobox->addItem(row_text_names[i], QVariant::fromValue(i)); } diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp index fe682b3b8..b5c88f944 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp +++ b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp @@ -42,7 +42,8 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const { tr("Finished primitive batch")}, }; - DEBUG_ASSERT(map.size() == static_cast(Tegra::DebugContext::Event::NumEvents)); + DEBUG_ASSERT(map.size() == + static_cast(Tegra::DebugContext::Event::NumEvents)); return (map.find(event) != map.end()) ? map.at(event) : QString(); } diff --git a/src/yuzu/debugger/graphics/graphics_surface.cpp b/src/yuzu/debugger/graphics/graphics_surface.cpp index 7e37962d5..cbcd5dd5f 100644 --- a/src/yuzu/debugger/graphics/graphics_surface.cpp +++ b/src/yuzu/debugger/graphics/graphics_surface.cpp @@ -341,8 +341,8 @@ void GraphicsSurfaceWidget::OnUpdate() { // directly... const auto& registers = gpu.Maxwell3D().regs; - const auto& rt = registers.rt[static_cast(surface_source) - - static_cast(Source::RenderTarget0)]; + const auto& rt = registers.rt[static_cast(surface_source) - + static_cast(Source::RenderTarget0)]; surface_address = rt.Address(); surface_width = rt.width; diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index dc1023113..f2a7e23f0 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp @@ -117,7 +117,7 @@ QString WaitTreeCallstack::GetText() const { std::vector> WaitTreeCallstack::GetChildren() const { std::vector> list; - constexpr size_t BaseRegister = 29; + constexpr std::size_t BaseRegister = 29; u64 base_pointer = thread.context.cpu_registers[BaseRegister]; while (base_pointer != 0) { diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 22a317737..45bb1d1d1 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -804,7 +804,7 @@ void GMainWindow::OnMenuInstallToNAND() { tr("Cancel"), 0, progress_maximum, this); progress.setWindowModality(Qt::WindowModal); - for (size_t i = 0; i < src->GetSize(); i += buffer.size()) { + for (std::size_t i = 0; i < src->GetSize(); i += buffer.size()) { if (progress.wasCanceled()) { dest->Resize(0); return false; -- cgit v1.2.3 From 51b561907962906ce916708feba8226665d33d7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Sep 2018 05:30:09 -0400 Subject: game_list_p: Take map iterator contents by const reference We don't need to copy the whole struct in this instance, we can just utilize a reference instead. --- src/yuzu/game_list_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu') diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index f22e422e5..094437090 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -128,7 +128,7 @@ public: LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); return; } - CompatStatus status = iterator->second; + const CompatStatus& status = iterator->second; setData(compatiblity, CompatNumberRole); setText(QObject::tr(status.text)); setToolTip(QObject::tr(status.tooltip)); -- cgit v1.2.3 From 13930f0c338c78623d9b71770984e9d08befaace Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Sep 2018 05:31:27 -0400 Subject: game_list_p: Amend typo in GameListItemCompat's constructor parameter Adds a missing 'i' character that was missing in compatibility. --- src/yuzu/game_list_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/yuzu') diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 094437090..b6272d536 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -106,7 +106,7 @@ class GameListItemCompat : public GameListItem { public: static const int CompatNumberRole = Qt::UserRole + 1; GameListItemCompat() = default; - explicit GameListItemCompat(const QString& compatiblity) { + explicit GameListItemCompat(const QString& compatibility) { struct CompatStatus { QString color; const char* text; @@ -123,13 +123,13 @@ public: {"99", {"#000000", QT_TR_NOOP("Not Tested"), QT_TR_NOOP("The game has not yet been tested.")}}}; // clang-format on - auto iterator = status_data.find(compatiblity); + auto iterator = status_data.find(compatibility); if (iterator == status_data.end()) { - LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); + LOG_WARNING(Frontend, "Invalid compatibility number {}", compatibility.toStdString()); return; } const CompatStatus& status = iterator->second; - setData(compatiblity, CompatNumberRole); + setData(compatibility, CompatNumberRole); setText(QObject::tr(status.text)); setToolTip(QObject::tr(status.tooltip)); setData(CreateCirclePixmapFromColor(status.color), Qt::DecorationRole); -- cgit v1.2.3 From 9dbe9d42914adc007cab42fd1c73f5f52313ec71 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Sep 2018 05:57:23 -0400 Subject: yuzu/util: Antialias game list compatibility pixmaps We pass a hint to the QPainter instance that we want anti-aliasing on the compatibility icons, which prevents the circles from looking fairly jagged, and actually makes them look circular. --- src/yuzu/util/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yuzu') diff --git a/src/yuzu/util/util.cpp b/src/yuzu/util/util.cpp index e99042a23..62c080aff 100644 --- a/src/yuzu/util/util.cpp +++ b/src/yuzu/util/util.cpp @@ -30,8 +30,9 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color) { QPixmap circle_pixmap(16, 16); circle_pixmap.fill(Qt::transparent); QPainter painter(&circle_pixmap); + painter.setRenderHint(QPainter::Antialiasing); painter.setPen(color); painter.setBrush(color); - painter.drawEllipse(0, 0, 15, 15); + painter.drawEllipse({circle_pixmap.width() / 2.0, circle_pixmap.height() / 2.0}, 7.0, 7.0); return circle_pixmap; } -- cgit v1.2.3