Merge pull request #14268 from JoshuaVandaele/std-tounderlying
c++23: Replace Common::ToUnderlying with std::to_underlying
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "DolphinQt/Config/Graphics/EnhancementsWidget.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QGroupBox>
|
||||
#include <QLabel>
|
||||
@@ -10,7 +12,6 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/EnumUtils.h"
|
||||
|
||||
#include "Core/Config/GraphicsSettings.h"
|
||||
|
||||
@@ -47,14 +48,14 @@ EnhancementsWidget::EnhancementsWidget(GraphicsPane* gfx_pane)
|
||||
});
|
||||
}
|
||||
|
||||
constexpr int ANISO_1x = Common::ToUnderlying(AnisotropicFilteringMode::Force1x);
|
||||
constexpr int ANISO_2X = Common::ToUnderlying(AnisotropicFilteringMode::Force2x);
|
||||
constexpr int ANISO_4X = Common::ToUnderlying(AnisotropicFilteringMode::Force4x);
|
||||
constexpr int ANISO_8X = Common::ToUnderlying(AnisotropicFilteringMode::Force8x);
|
||||
constexpr int ANISO_16X = Common::ToUnderlying(AnisotropicFilteringMode::Force16x);
|
||||
constexpr int FILTERING_DEFAULT = Common::ToUnderlying(TextureFilteringMode::Default);
|
||||
constexpr int FILTERING_NEAREST = Common::ToUnderlying(TextureFilteringMode::Nearest);
|
||||
constexpr int FILTERING_LINEAR = Common::ToUnderlying(TextureFilteringMode::Linear);
|
||||
constexpr int ANISO_1x = std::to_underlying(AnisotropicFilteringMode::Force1x);
|
||||
constexpr int ANISO_2X = std::to_underlying(AnisotropicFilteringMode::Force2x);
|
||||
constexpr int ANISO_4X = std::to_underlying(AnisotropicFilteringMode::Force4x);
|
||||
constexpr int ANISO_8X = std::to_underlying(AnisotropicFilteringMode::Force8x);
|
||||
constexpr int ANISO_16X = std::to_underlying(AnisotropicFilteringMode::Force16x);
|
||||
constexpr int FILTERING_DEFAULT = std::to_underlying(TextureFilteringMode::Default);
|
||||
constexpr int FILTERING_NEAREST = std::to_underlying(TextureFilteringMode::Nearest);
|
||||
constexpr int FILTERING_LINEAR = std::to_underlying(TextureFilteringMode::Linear);
|
||||
|
||||
void EnhancementsWidget::CreateWidgets()
|
||||
{
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "DolphinQt/Config/SettingsWindow.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QColor>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -14,8 +16,6 @@
|
||||
#include <QTabWidget>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "Common/EnumUtils.h"
|
||||
|
||||
#include "DolphinQt/Config/ControllersPane.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsPane.h"
|
||||
#include "DolphinQt/MainWindow.h"
|
||||
@@ -206,5 +206,5 @@ SettingsWindow::SettingsWindow(MainWindow* parent) : StackedSettingsWindow{paren
|
||||
|
||||
void SettingsWindow::SelectPane(SettingsWindowPaneIndex index)
|
||||
{
|
||||
ActivatePane(Common::ToUnderlying(index));
|
||||
ActivatePane(std::to_underlying(index));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <ranges>
|
||||
#include <utility>
|
||||
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
@@ -20,7 +21,6 @@
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/EnumUtils.h"
|
||||
#include "Common/Swap.h"
|
||||
#include "Core/FifoPlayer/FifoPlayer.h"
|
||||
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
const u32 object_prim_size = num_vertices * vertex_size;
|
||||
|
||||
const u8 opcode =
|
||||
0x80 | Common::ToUnderlying(primitive) << OpcodeDecoder::GX_PRIMITIVE_SHIFT | vat;
|
||||
0x80 | std::to_underlying(primitive) << OpcodeDecoder::GX_PRIMITIVE_SHIFT | vat;
|
||||
text = QStringLiteral("PRIMITIVE %1 (%2) %3 vertices %4 bytes/vertex %5 total bytes")
|
||||
.arg(QString::fromStdString(name))
|
||||
.arg(opcode, 2, 16, QLatin1Char('0'))
|
||||
|
||||
Reference in New Issue
Block a user