mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2025-08-04 11:12:24 -07:00
remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistency
Signed-off-by: arades79 <scravers@protonmail.com>
This commit is contained in:
@@ -720,7 +720,7 @@ void GRenderWindow::TouchEndEvent() {
|
||||
|
||||
void GRenderWindow::InitializeCamera() {
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && YUZU_USE_QT_MULTIMEDIA
|
||||
constexpr static auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz)
|
||||
constexpr auto camera_update_ms = std::chrono::milliseconds{50}; // (50ms, 20Hz)
|
||||
if (!Settings::values.enable_ir_sensor) {
|
||||
return;
|
||||
}
|
||||
|
@@ -317,9 +317,9 @@ void PlayerControlPreview::DrawLeftController(QPainter& p, const QPointF center)
|
||||
|
||||
// D-pad constants
|
||||
const QPointF dpad_center = center + QPoint(9, 14);
|
||||
constexpr static int dpad_distance = 23;
|
||||
constexpr static int dpad_radius = 11;
|
||||
constexpr static float dpad_arrow_size = 1.2f;
|
||||
constexpr int dpad_distance = 23;
|
||||
constexpr int dpad_radius = 11;
|
||||
constexpr float dpad_arrow_size = 1.2f;
|
||||
|
||||
// D-pad buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -439,9 +439,9 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center
|
||||
|
||||
// Face buttons constants
|
||||
const QPointF face_center = center + QPoint(-9, -73);
|
||||
constexpr static int face_distance = 23;
|
||||
constexpr static int face_radius = 11;
|
||||
constexpr static float text_size = 1.1f;
|
||||
constexpr int face_distance = 23;
|
||||
constexpr int face_radius = 11;
|
||||
constexpr float text_size = 1.1f;
|
||||
|
||||
// Face buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -559,9 +559,9 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center)
|
||||
|
||||
// Face buttons constants
|
||||
const QPointF face_center = center + QPoint(65, -65);
|
||||
constexpr static int face_distance = 20;
|
||||
constexpr static int face_radius = 10;
|
||||
constexpr static float text_size = 1.0f;
|
||||
constexpr int face_distance = 20;
|
||||
constexpr int face_radius = 10;
|
||||
constexpr float text_size = 1.0f;
|
||||
|
||||
// Face buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -581,9 +581,9 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center)
|
||||
|
||||
// D-pad constants
|
||||
const QPointF dpad_center = center + QPoint(-65, 12);
|
||||
constexpr static int dpad_distance = 20;
|
||||
constexpr static int dpad_radius = 10;
|
||||
constexpr static float dpad_arrow_size = 1.1f;
|
||||
constexpr int dpad_distance = 20;
|
||||
constexpr int dpad_radius = 10;
|
||||
constexpr float dpad_arrow_size = 1.1f;
|
||||
|
||||
// D-pad buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -651,9 +651,9 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen
|
||||
|
||||
// Face buttons constants
|
||||
const QPointF face_center = center + QPoint(171, -41);
|
||||
constexpr static float face_distance = 12.8f;
|
||||
constexpr static float face_radius = 6.4f;
|
||||
constexpr static float text_size = 0.6f;
|
||||
constexpr float face_distance = 12.8f;
|
||||
constexpr float face_radius = 6.4f;
|
||||
constexpr float text_size = 0.6f;
|
||||
|
||||
// Face buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -673,9 +673,9 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen
|
||||
|
||||
// D-pad constants
|
||||
const QPointF dpad_center = center + QPoint(-171, 8);
|
||||
constexpr static float dpad_distance = 12.8f;
|
||||
constexpr static float dpad_radius = 6.4f;
|
||||
constexpr static float dpad_arrow_size = 0.68f;
|
||||
constexpr float dpad_distance = 12.8f;
|
||||
constexpr float dpad_radius = 6.4f;
|
||||
constexpr float dpad_arrow_size = 0.68f;
|
||||
|
||||
// D-pad buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -754,9 +754,9 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)
|
||||
|
||||
// Face buttons constants
|
||||
const QPointF face_center = center + QPoint(105, -56);
|
||||
constexpr static int face_distance = 31;
|
||||
constexpr static int face_radius = 15;
|
||||
constexpr static float text_size = 1.5f;
|
||||
constexpr int face_distance = 31;
|
||||
constexpr int face_radius = 15;
|
||||
constexpr float text_size = 1.5f;
|
||||
|
||||
// Face buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -846,7 +846,7 @@ void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {
|
||||
using namespace Settings::NativeButton;
|
||||
|
||||
// Face buttons constants
|
||||
constexpr static float text_size = 1.1f;
|
||||
constexpr float text_size = 1.1f;
|
||||
|
||||
// Face buttons
|
||||
p.setPen(colors.outline);
|
||||
@@ -1497,7 +1497,7 @@ void PlayerControlPreview::DrawProBody(QPainter& p, const QPointF center) {
|
||||
std::array<QPointF, pro_left_handle.size() / 2> qleft_handle;
|
||||
std::array<QPointF, pro_left_handle.size() / 2> qright_handle;
|
||||
std::array<QPointF, pro_body.size()> qbody;
|
||||
constexpr static int radius1 = 32;
|
||||
constexpr int radius1 = 32;
|
||||
|
||||
for (std::size_t point = 0; point < pro_left_handle.size() / 2; ++point) {
|
||||
const float left_x = pro_left_handle[point * 2 + 0];
|
||||
@@ -1539,7 +1539,7 @@ void PlayerControlPreview::DrawGCBody(QPainter& p, const QPointF center) {
|
||||
std::array<QPointF, gc_body.size()> qbody;
|
||||
std::array<QPointF, 8> left_hex;
|
||||
std::array<QPointF, 8> right_hex;
|
||||
constexpr static float angle = 2 * 3.1415f / 8;
|
||||
constexpr float angle = 2 * 3.1415f / 8;
|
||||
|
||||
for (std::size_t point = 0; point < gc_left_body.size() / 2; ++point) {
|
||||
const float body_x = gc_left_body[point * 2 + 0];
|
||||
@@ -1676,9 +1676,9 @@ void PlayerControlPreview::DrawDualBody(QPainter& p, const QPointF center) {
|
||||
std::array<QPointF, left_joycon_slider_topview.size() / 2> qright_joycon_slider_topview;
|
||||
std::array<QPointF, left_joycon_topview.size() / 2> qleft_joycon_topview;
|
||||
std::array<QPointF, left_joycon_topview.size() / 2> qright_joycon_topview;
|
||||
constexpr static float size = 1.61f;
|
||||
constexpr static float size2 = 0.9f;
|
||||
constexpr static float offset = 209.3f;
|
||||
constexpr float size = 1.61f;
|
||||
constexpr float size2 = 0.9f;
|
||||
constexpr float offset = 209.3f;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_body.size() / 2; ++point) {
|
||||
const float body_x = left_joycon_body[point * 2 + 0];
|
||||
@@ -1767,10 +1767,10 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) {
|
||||
std::array<QPointF, left_joycon_slider.size() / 2> qleft_joycon_slider;
|
||||
std::array<QPointF, left_joycon_slider_topview.size() / 2> qleft_joycon_slider_topview;
|
||||
std::array<QPointF, left_joycon_topview.size() / 2> qleft_joycon_topview;
|
||||
constexpr static float size = 1.78f;
|
||||
constexpr static float size2 = 1.1115f;
|
||||
constexpr static float offset = 312.39f;
|
||||
constexpr static float offset2 = 335;
|
||||
constexpr float size = 1.78f;
|
||||
constexpr float size2 = 1.1115f;
|
||||
constexpr float offset = 312.39f;
|
||||
constexpr float offset2 = 335;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_body.size() / 2; ++point) {
|
||||
left_joycon[point] = center + QPointF(left_joycon_body[point * 2] * size + offset,
|
||||
@@ -1867,10 +1867,10 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) {
|
||||
std::array<QPointF, left_joycon_slider.size() / 2> qright_joycon_slider;
|
||||
std::array<QPointF, left_joycon_slider_topview.size() / 2> qright_joycon_slider_topview;
|
||||
std::array<QPointF, left_joycon_topview.size() / 2> qright_joycon_topview;
|
||||
constexpr static float size = 1.78f;
|
||||
constexpr static float size2 = 1.1115f;
|
||||
constexpr static float offset = 312.39f;
|
||||
constexpr static float offset2 = 335;
|
||||
constexpr float size = 1.78f;
|
||||
constexpr float size2 = 1.1115f;
|
||||
constexpr float offset = 312.39f;
|
||||
constexpr float offset2 = 335;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_body.size() / 2; ++point) {
|
||||
right_joycon[point] = center + QPointF(-left_joycon_body[point * 2] * size - offset,
|
||||
@@ -2068,8 +2068,8 @@ void PlayerControlPreview::DrawDualTriggers(QPainter& p, const QPointF center,
|
||||
const Common::Input::ButtonStatus& right_pressed) {
|
||||
std::array<QPointF, left_joycon_trigger.size() / 2> qleft_trigger;
|
||||
std::array<QPointF, left_joycon_trigger.size() / 2> qright_trigger;
|
||||
constexpr static float size = 1.62f;
|
||||
constexpr static float offset = 210.6f;
|
||||
constexpr float size = 1.62f;
|
||||
constexpr float offset = 210.6f;
|
||||
for (std::size_t point = 0; point < left_joycon_trigger.size() / 2; ++point) {
|
||||
const float left_trigger_x = left_joycon_trigger[point * 2 + 0];
|
||||
const float left_trigger_y = left_joycon_trigger[point * 2 + 1];
|
||||
@@ -2097,7 +2097,7 @@ void PlayerControlPreview::DrawDualTriggersTopView(
|
||||
const Common::Input::ButtonStatus& right_pressed) {
|
||||
std::array<QPointF, left_joystick_L_topview.size() / 2> qleft_trigger;
|
||||
std::array<QPointF, left_joystick_L_topview.size() / 2> qright_trigger;
|
||||
constexpr static float size = 0.9f;
|
||||
constexpr float size = 0.9f;
|
||||
|
||||
for (std::size_t point = 0; point < left_joystick_L_topview.size() / 2; ++point) {
|
||||
const float top_view_x = left_joystick_L_topview[point * 2 + 0];
|
||||
@@ -2134,7 +2134,7 @@ void PlayerControlPreview::DrawDualZTriggersTopView(
|
||||
const Common::Input::ButtonStatus& right_pressed) {
|
||||
std::array<QPointF, left_joystick_ZL_topview.size() / 2> qleft_trigger;
|
||||
std::array<QPointF, left_joystick_ZL_topview.size() / 2> qright_trigger;
|
||||
constexpr static float size = 0.9f;
|
||||
constexpr float size = 0.9f;
|
||||
|
||||
for (std::size_t point = 0; point < left_joystick_ZL_topview.size() / 2; ++point) {
|
||||
qleft_trigger[point] =
|
||||
@@ -2167,8 +2167,8 @@ void PlayerControlPreview::DrawDualZTriggersTopView(
|
||||
void PlayerControlPreview::DrawLeftTriggers(QPainter& p, const QPointF center,
|
||||
const Common::Input::ButtonStatus& left_pressed) {
|
||||
std::array<QPointF, left_joycon_trigger.size() / 2> qleft_trigger;
|
||||
constexpr static float size = 1.78f;
|
||||
constexpr static float offset = 311.5f;
|
||||
constexpr float size = 1.78f;
|
||||
constexpr float offset = 311.5f;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_trigger.size() / 2; ++point) {
|
||||
qleft_trigger[point] = center + QPointF(left_joycon_trigger[point * 2] * size + offset,
|
||||
@@ -2184,8 +2184,8 @@ void PlayerControlPreview::DrawLeftTriggers(QPainter& p, const QPointF center,
|
||||
void PlayerControlPreview::DrawLeftZTriggers(QPainter& p, const QPointF center,
|
||||
const Common::Input::ButtonStatus& left_pressed) {
|
||||
std::array<QPointF, left_joycon_sideview_zl.size() / 2> qleft_trigger;
|
||||
constexpr static float size = 1.1115f;
|
||||
constexpr static float offset2 = 335;
|
||||
constexpr float size = 1.1115f;
|
||||
constexpr float offset2 = 335;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_sideview_zl.size() / 2; ++point) {
|
||||
qleft_trigger[point] = center + QPointF(left_joycon_sideview_zl[point * 2] * size + offset2,
|
||||
@@ -2241,8 +2241,8 @@ void PlayerControlPreview::DrawLeftZTriggersTopView(
|
||||
void PlayerControlPreview::DrawRightTriggers(QPainter& p, const QPointF center,
|
||||
const Common::Input::ButtonStatus& right_pressed) {
|
||||
std::array<QPointF, left_joycon_trigger.size() / 2> qright_trigger;
|
||||
constexpr static float size = 1.78f;
|
||||
constexpr static float offset = 311.5f;
|
||||
constexpr float size = 1.78f;
|
||||
constexpr float offset = 311.5f;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_trigger.size() / 2; ++point) {
|
||||
qright_trigger[point] = center + QPointF(-left_joycon_trigger[point * 2] * size - offset,
|
||||
@@ -2258,8 +2258,8 @@ void PlayerControlPreview::DrawRightTriggers(QPainter& p, const QPointF center,
|
||||
void PlayerControlPreview::DrawRightZTriggers(QPainter& p, const QPointF center,
|
||||
const Common::Input::ButtonStatus& right_pressed) {
|
||||
std::array<QPointF, left_joycon_sideview_zl.size() / 2> qright_trigger;
|
||||
constexpr static float size = 1.1115f;
|
||||
constexpr static float offset2 = 335;
|
||||
constexpr float size = 1.1115f;
|
||||
constexpr float offset2 = 335;
|
||||
|
||||
for (std::size_t point = 0; point < left_joycon_sideview_zl.size() / 2; ++point) {
|
||||
qright_trigger[point] =
|
||||
@@ -2433,7 +2433,7 @@ void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPo
|
||||
|
||||
void PlayerControlPreview::DrawJoystickProperties(
|
||||
QPainter& p, const QPointF center, const Common::Input::AnalogProperties& properties) {
|
||||
constexpr static float size = 45.0f;
|
||||
constexpr float size = 45.0f;
|
||||
const float range = size * properties.range;
|
||||
const float deadzone = size * properties.deadzone;
|
||||
|
||||
@@ -2453,7 +2453,7 @@ void PlayerControlPreview::DrawJoystickProperties(
|
||||
|
||||
void PlayerControlPreview::DrawJoystickDot(QPainter& p, const QPointF center,
|
||||
const Common::Input::StickStatus& stick, bool raw) {
|
||||
constexpr static float size = 45.0f;
|
||||
constexpr float size = 45.0f;
|
||||
const float range = size * stick.x.properties.range;
|
||||
|
||||
if (raw) {
|
||||
|
@@ -476,8 +476,8 @@ void GameList::DonePopulating(const QStringList& watch_list) {
|
||||
// Workaround: Add the watch paths in chunks to allow the gui to refresh
|
||||
// This prevents the UI from stalling when a large number of watch paths are added
|
||||
// Also artificially caps the watcher to a certain number of directories
|
||||
constexpr static int LIMIT_WATCH_DIRECTORIES = 5000;
|
||||
constexpr static int SLICE_SIZE = 25;
|
||||
constexpr int LIMIT_WATCH_DIRECTORIES = 5000;
|
||||
constexpr int SLICE_SIZE = 25;
|
||||
int len = std::min(static_cast<int>(watch_list.size()), LIMIT_WATCH_DIRECTORIES);
|
||||
for (int i = 0; i < len; i += SLICE_SIZE) {
|
||||
watcher->addPaths(watch_list.mid(i, i + SLICE_SIZE));
|
||||
|
@@ -219,7 +219,7 @@ static void LogRuntimes() {
|
||||
#ifdef _MSC_VER
|
||||
// It is possible that the name of the dll will change.
|
||||
// vcruntime140.dll is for 2015 and onwards
|
||||
constexpr static char runtime_dll_name[] = "vcruntime140.dll";
|
||||
static constexpr char runtime_dll_name[] = "vcruntime140.dll";
|
||||
UINT sz = GetFileVersionInfoSizeA(runtime_dll_name, nullptr);
|
||||
bool runtime_version_inspection_worked = false;
|
||||
if (sz > 0) {
|
||||
@@ -4490,8 +4490,8 @@ static void SetHighDPIAttributes() {
|
||||
|
||||
// Recommended minimum width and height for proper window fit.
|
||||
// Any screen with a lower resolution than this will still have a scale of 1.
|
||||
constexpr static float minimum_width = 1350.0f;
|
||||
constexpr static float minimum_height = 900.0f;
|
||||
constexpr float minimum_width = 1350.0f;
|
||||
constexpr float minimum_height = 900.0f;
|
||||
|
||||
const float width_ratio = std::max(1.0f, real_width / minimum_width);
|
||||
const float height_ratio = std::max(1.0f, real_height / minimum_height);
|
||||
|
Reference in New Issue
Block a user