early-access version 2104

This commit is contained in:
pineappleEA 2021-10-04 03:26:31 +02:00
parent b5bacdc486
commit 4981320657
30 changed files with 314 additions and 181 deletions

View file

@ -237,7 +237,7 @@ yuzu_find_packages()
# Qt5 requires that we find components, so it doesn't fit our pretty little find package function # Qt5 requires that we find components, so it doesn't fit our pretty little find package function
if(ENABLE_QT) if(ENABLE_QT)
set(QT_VERSION 5.12) set(QT_VERSION 5.15)
# We want to load the generated conan qt config so that we get the QT_ROOT var so that we can use the official # We want to load the generated conan qt config so that we get the QT_ROOT var so that we can use the official
# Qt5Config inside the root folder instead of the conan generated one. # Qt5Config inside the root folder instead of the conan generated one.
if(EXISTS ${CMAKE_BINARY_DIR}/qtConfig.cmake) if(EXISTS ${CMAKE_BINARY_DIR}/qtConfig.cmake)
@ -339,8 +339,8 @@ if(ENABLE_QT)
set(QT_PREFIX_HINT) set(QT_PREFIX_HINT)
if(YUZU_USE_BUNDLED_QT) if(YUZU_USE_BUNDLED_QT)
if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64) if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
set(QT_BUILD qt-5.12.8-msvc2017_64) set(QT_BUILD qt-5.15.2-msvc2019_64)
elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64) elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND NOT MINGW AND ARCHITECTURE_x86_64)
set(QT_BUILD qt5_5_15_2) set(QT_BUILD qt5_5_15_2)
else() else()
@ -369,7 +369,7 @@ endif()
if (ENABLE_SDL2) if (ENABLE_SDL2)
if (YUZU_USE_BUNDLED_SDL2) if (YUZU_USE_BUNDLED_SDL2)
# Detect toolchain and platform # Detect toolchain and platform
if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64) if ((MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1940) AND ARCHITECTURE_x86_64)
set(SDL2_VER "SDL2-2.0.16") set(SDL2_VER "SDL2-2.0.16")
else() else()
message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.") message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable YUZU_USE_BUNDLED_SDL2 and provide your own.")
@ -462,7 +462,7 @@ if (CONAN_REQUIRED_LIBS)
if(ENABLE_QT) if(ENABLE_QT)
list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}") list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}") list(APPEND CMAKE_PREFIX_PATH "${CONAN_QT_ROOT_RELEASE}")
find_package(Qt5 5.12 REQUIRED COMPONENTS Widgets) find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets)
if (YUZU_USE_QT_WEB_ENGINE) if (YUZU_USE_QT_WEB_ENGINE)
find_package(Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets) find_package(Qt5 REQUIRED COMPONENTS WebEngineCore WebEngineWidgets)
endif() endif()

View file

@ -33,6 +33,7 @@ function(copy_yuzu_Qt5_deps target_dir)
Qt5Positioning$<$<CONFIG:Debug>:d>.* Qt5Positioning$<$<CONFIG:Debug>:d>.*
Qt5PrintSupport$<$<CONFIG:Debug>:d>.* Qt5PrintSupport$<$<CONFIG:Debug>:d>.*
Qt5Qml$<$<CONFIG:Debug>:d>.* Qt5Qml$<$<CONFIG:Debug>:d>.*
Qt5QmlModels$<$<CONFIG:Debug>:d>.*
Qt5Quick$<$<CONFIG:Debug>:d>.* Qt5Quick$<$<CONFIG:Debug>:d>.*
Qt5QuickWidgets$<$<CONFIG:Debug>:d>.* Qt5QuickWidgets$<$<CONFIG:Debug>:d>.*
Qt5WebChannel$<$<CONFIG:Debug>:d>.* Qt5WebChannel$<$<CONFIG:Debug>:d>.*

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2101. This is the source code for early-access 2104.
## Legal Notice ## Legal Notice

View file

@ -2,13 +2,16 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <algorithm>
#include <cmath> #include <cmath>
#include <numbers> #include <numbers>
#include "audio_core/algorithm/interpolate.h" #include "audio_core/algorithm/interpolate.h"
#include "audio_core/command_generator.h" #include "audio_core/command_generator.h"
#include "audio_core/effect_context.h" #include "audio_core/effect_context.h"
#include "audio_core/mix_context.h" #include "audio_core/mix_context.h"
#include "audio_core/voice_context.h" #include "audio_core/voice_context.h"
#include "common/common_types.h"
#include "core/memory.h" #include "core/memory.h"
namespace AudioCore { namespace AudioCore {

View file

@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <algorithm>
#include "audio_core/behavior_info.h" #include "audio_core/behavior_info.h"
#include "audio_core/common.h" #include "audio_core/common.h"
#include "audio_core/effect_context.h" #include "audio_core/effect_context.h"

View file

@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <algorithm>
#include "audio_core/behavior_info.h" #include "audio_core/behavior_info.h"
#include "audio_core/voice_context.h" #include "audio_core/voice_context.h"
#include "core/memory.h" #include "core/memory.h"

View file

@ -79,6 +79,7 @@ add_library(common STATIC
logging/filter.cpp logging/filter.cpp
logging/filter.h logging/filter.h
logging/log.h logging/log.h
logging/log_entry.h
logging/text_formatter.cpp logging/text_formatter.cpp
logging/text_formatter.h logging/text_formatter.h
logging/types.h logging/types.h

View file

@ -9,6 +9,8 @@
#include <thread> #include <thread>
#include <vector> #include <vector>
#include <fmt/format.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> // For OutputDebugStringW #include <windows.h> // For OutputDebugStringW
#endif #endif
@ -22,6 +24,7 @@
#include "common/logging/backend.h" #include "common/logging/backend.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/logging/log_entry.h"
#include "common/logging/text_formatter.h" #include "common/logging/text_formatter.h"
#include "common/settings.h" #include "common/settings.h"
#ifdef _WIN32 #ifdef _WIN32

View file

@ -4,7 +4,11 @@
#pragma once #pragma once
#include <fmt/format.h> #include <algorithm>
#include <string_view>
#include <fmt/core.h>
#include "common/logging/types.h" #include "common/logging/types.h"
namespace Common::Log { namespace Common::Log {

28
src/common/logging/log_entry.h Executable file
View file

@ -0,0 +1,28 @@
// Copyright 2021 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <chrono>
#include "common/logging/types.h"
namespace Common::Log {
/**
* A log entry. Log entries are store in a structured format to permit more varied output
* formatting on different frontends, as well as facilitating filtering and aggregation.
*/
struct Entry {
std::chrono::microseconds timestamp;
Class log_class{};
Level log_level{};
const char* filename = nullptr;
unsigned int line_num = 0;
std::string function;
std::string message;
bool final_entry = false;
};
} // namespace Common::Log

View file

@ -13,6 +13,7 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/logging/filter.h" #include "common/logging/filter.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/logging/log_entry.h"
#include "common/logging/text_formatter.h" #include "common/logging/text_formatter.h"
#include "common/string_util.h" #include "common/string_util.h"

View file

@ -4,8 +4,6 @@
#pragma once #pragma once
#include <chrono>
#include "common/common_types.h" #include "common/common_types.h"
namespace Common::Log { namespace Common::Log {
@ -131,19 +129,4 @@ enum class Class : u8 {
Count ///< Total number of logging classes Count ///< Total number of logging classes
}; };
/**
* A log entry. Log entries are store in a structured format to permit more varied output
* formatting on different frontends, as well as facilitating filtering and aggregation.
*/
struct Entry {
std::chrono::microseconds timestamp;
Class log_class{};
Level log_level{};
const char* filename = nullptr;
unsigned int line_num = 0;
std::string function;
std::string message;
bool final_entry = false;
};
} // namespace Common::Log } // namespace Common::Log

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <array> #include <array>
#include <stdexcept>
#include <utility> #include <utility>
#include <vector> #include <vector>

View file

@ -2,6 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <algorithm>
#include "core/hle/kernel/k_auto_object_container.h" #include "core/hle/kernel/k_auto_object_container.h"
namespace Kernel { namespace Kernel {

View file

@ -24,6 +24,7 @@
#include "core/hle/service/am/applets/applet_web_browser.h" #include "core/hle/service/am/applets/applet_web_browser.h"
#include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/ns/pl_u.h" #include "core/hle/service/ns/pl_u.h"
#include "core/loader/loader.h"
namespace Service::AM::Applets { namespace Service::AM::Applets {
@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id,
const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type);
if (nca == nullptr) { if (nca == nullptr) {
if (nca_type == FileSys::ContentRecordType::HtmlDocument) {
LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS.");
FileSys::VirtualFile romfs;
system.GetAppLoader().ReadManualRomFS(romfs);
if (romfs != nullptr) {
return romfs;
}
}
LOG_ERROR(Service_AM, LOG_ERROR(Service_AM,
"NCA of type={} with title_id={:016X} is not found in the ContentProvider!", "NCA of type={} with title_id={:016X} is not found in the ContentProvider!",
nca_type, title_id); nca_type, title_id);

View file

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <cmath>
#include <memory> #include <memory>
#include "common/logging/log.h" #include "common/logging/log.h"

View file

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <memory>
#include <vector> #include <vector>
#include "core/hle/service/time/clock_types.h" #include "core/hle/service/time/clock_types.h"

View file

@ -4,6 +4,8 @@
#pragma once #pragma once
#include <memory>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/service/time/clock_types.h" #include "core/hle/service/time/clock_types.h"

View file

@ -366,8 +366,6 @@ std::optional<IPv4Address> GetHostIPv4Address() {
if (res != network_interfaces.end()) { if (res != network_interfaces.end()) {
char ip_addr[16] = {}; char ip_addr[16] = {};
ASSERT(inet_ntop(AF_INET, &res->ip_address, ip_addr, sizeof(ip_addr)) != nullptr); ASSERT(inet_ntop(AF_INET, &res->ip_address, ip_addr, sizeof(ip_addr)) != nullptr);
LOG_INFO(Network, "IP address: {}", ip_addr);
return TranslateIPv4(res->ip_address); return TranslateIPv4(res->ip_address);
} else { } else {
LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", selected_network_interface); LOG_ERROR(Network, "Couldn't find selected interface \"{}\"", selected_network_interface);

View file

@ -3,6 +3,7 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#pragma once #pragma once
#include <memory> #include <memory>
#include "common/bit_field.h" #include "common/bit_field.h"

View file

@ -20,6 +20,7 @@
#include "video_core/surface.h" #include "video_core/surface.h"
#include "video_core/texture_cache/formatter.h" #include "video_core/texture_cache/formatter.h"
#include "video_core/texture_cache/samples_helper.h" #include "video_core/texture_cache/samples_helper.h"
#include "video_core/texture_cache/util.h"
namespace OpenGL { namespace OpenGL {
namespace { namespace {

View file

@ -12,6 +12,7 @@
#include "shader_recompiler/shader_info.h" #include "shader_recompiler/shader_info.h"
#include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/util_shaders.h" #include "video_core/renderer_opengl/util_shaders.h"
#include "video_core/texture_cache/image_view_base.h"
#include "video_core/texture_cache/texture_cache_base.h" #include "video_core/texture_cache/texture_cache_base.h"
namespace OpenGL { namespace OpenGL {

View file

@ -21,6 +21,7 @@
#include "video_core/renderer_vulkan/vk_texture_cache.h" #include "video_core/renderer_vulkan/vk_texture_cache.h"
#include "video_core/texture_cache/formatter.h" #include "video_core/texture_cache/formatter.h"
#include "video_core/texture_cache/samples_helper.h" #include "video_core/texture_cache/samples_helper.h"
#include "video_core/texture_cache/util.h"
#include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_device.h"
#include "video_core/vulkan_common/vulkan_memory_allocator.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h"
#include "video_core/vulkan_common/vulkan_wrapper.h" #include "video_core/vulkan_common/vulkan_wrapper.h"

View file

@ -4,11 +4,11 @@
#pragma once #pragma once
#include <compare>
#include <span> #include <span>
#include "shader_recompiler/shader_info.h" #include "shader_recompiler/shader_info.h"
#include "video_core/renderer_vulkan/vk_staging_buffer_pool.h" #include "video_core/renderer_vulkan/vk_staging_buffer_pool.h"
#include "video_core/texture_cache/image_view_base.h"
#include "video_core/texture_cache/texture_cache_base.h" #include "video_core/texture_cache/texture_cache_base.h"
#include "video_core/vulkan_common/vulkan_memory_allocator.h" #include "video_core/vulkan_common/vulkan_memory_allocator.h"
#include "video_core/vulkan_common/vulkan_wrapper.h" #include "video_core/vulkan_common/vulkan_wrapper.h"

View file

@ -8,6 +8,7 @@
#include "video_core/texture_cache/image_view_info.h" #include "video_core/texture_cache/image_view_info.h"
#include "video_core/texture_cache/texture_cache_base.h" #include "video_core/texture_cache/texture_cache_base.h"
#include "video_core/texture_cache/types.h" #include "video_core/texture_cache/types.h"
#include "video_core/texture_cache/util.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace VideoCommon { namespace VideoCommon {

View file

@ -4,10 +4,15 @@
#pragma once #pragma once
#include <unordered_set>
#include "common/alignment.h" #include "common/alignment.h"
#include "video_core/dirty_flags.h" #include "video_core/dirty_flags.h"
#include "video_core/engines/kepler_compute.h"
#include "video_core/texture_cache/image_view_base.h"
#include "video_core/texture_cache/samples_helper.h" #include "video_core/texture_cache/samples_helper.h"
#include "video_core/texture_cache/texture_cache_base.h" #include "video_core/texture_cache/texture_cache_base.h"
#include "video_core/texture_cache/util.h"
namespace VideoCommon { namespace VideoCommon {

View file

@ -8,7 +8,6 @@
#include <span> #include <span>
#include <type_traits> #include <type_traits>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include <vector> #include <vector>
#include <queue> #include <queue>
@ -18,10 +17,6 @@
#include "video_core/compatible_formats.h" #include "video_core/compatible_formats.h"
#include "video_core/delayed_destruction_ring.h" #include "video_core/delayed_destruction_ring.h"
#include "video_core/engines/fermi_2d.h" #include "video_core/engines/fermi_2d.h"
#include "video_core/engines/kepler_compute.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/surface.h" #include "video_core/surface.h"
#include "video_core/texture_cache/descriptor_table.h" #include "video_core/texture_cache/descriptor_table.h"
#include "video_core/texture_cache/image_base.h" #include "video_core/texture_cache/image_base.h"
@ -30,7 +25,6 @@
#include "video_core/texture_cache/render_targets.h" #include "video_core/texture_cache/render_targets.h"
#include "video_core/texture_cache/slot_vector.h" #include "video_core/texture_cache/slot_vector.h"
#include "video_core/texture_cache/types.h" #include "video_core/texture_cache/types.h"
#include "video_core/texture_cache/util.h"
#include "video_core/textures/texture.h" #include "video_core/textures/texture.h"
namespace VideoCommon { namespace VideoCommon {

View file

@ -18,6 +18,7 @@ ConfigureTasDialog::ConfigureTasDialog(QWidget* parent)
setFocusPolicy(Qt::ClickFocus); setFocusPolicy(Qt::ClickFocus);
setWindowTitle(tr("TAS Configuration")); setWindowTitle(tr("TAS Configuration"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(ui->tas_path_button, &QToolButton::pressed, this, connect(ui->tas_path_button, &QToolButton::pressed, this,
[this] { SetDirectory(DirectoryTarget::TAS, ui->tas_path_edit); }); [this] { SetDirectory(DirectoryTarget::TAS, ui->tas_path_edit); });

View file

@ -2,6 +2,14 @@
<ui version="4.0"> <ui version="4.0">
<class>ConfigureTas</class> <class>ConfigureTas</class>
<widget class="QDialog" name="ConfigureTas"> <widget class="QDialog" name="ConfigureTas">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>316</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1"> <layout class="QVBoxLayout" name="verticalLayout_1">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_1"> <layout class="QHBoxLayout" name="horizontalLayout_1">
@ -21,7 +29,7 @@
<item row="1" column="0" colspan="4"> <item row="1" column="0" colspan="4">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -> Hotkeys).</string> <string>To check which hotkeys control the playback/recording, please refer to the Hotkey settings (General -&gt; Hotkeys).</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -117,6 +125,19 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy"> <property name="sizePolicy">
@ -142,12 +163,32 @@
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>ConfigureTas</receiver> <receiver>ConfigureTas</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection> </connection>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>ConfigureTas</receiver> <receiver>ConfigureTas</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection> </connection>
</connections> </connections>
</ui> </ui>

View file

@ -59,6 +59,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include <QProgressBar> #include <QProgressBar>
#include <QProgressDialog> #include <QProgressDialog>
#include <QPushButton> #include <QPushButton>
#include <QScreen>
#include <QShortcut> #include <QShortcut>
#include <QStatusBar> #include <QStatusBar>
#include <QString> #include <QString>
@ -2920,8 +2921,13 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie
if (title_name.empty()) { if (title_name.empty()) {
setWindowTitle(QString::fromStdString(window_title)); setWindowTitle(QString::fromStdString(window_title));
} else { } else {
const auto run_title = const auto run_title = [window_title, title_name, title_version, gpu_vendor]() {
fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor); if (title_version.empty()) {
return fmt::format("{} | {} | {}", window_title, title_name, gpu_vendor);
}
return fmt::format("{} | {} | {} | {}", window_title, title_name, title_version,
gpu_vendor);
}();
setWindowTitle(QString::fromStdString(run_title)); setWindowTitle(QString::fromStdString(run_title));
} }
} }
@ -3452,6 +3458,41 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
#undef main #undef main
#endif #endif
static void SetHighDPIAttributes(int argc, char* argv[]) {
// Create a temporary QApplication as a workaround to get the current screen geometry.
QApplication* temp_app = new QApplication(argc, argv);
const QScreen* primary_screen = temp_app->primaryScreen();
const QRect screen_rect = primary_screen->geometry();
const int real_width = screen_rect.width();
const int real_height = screen_rect.height();
const float real_ratio = primary_screen->logicalDotsPerInch() / 96.0f;
delete temp_app;
// 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 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);
// Get the lower of the 2 ratios and truncate, this is the maximum integer scale.
const float max_ratio = std::trunc(std::min(width_ratio, height_ratio));
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
if (max_ratio > real_ratio) {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Round);
} else {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
}
}
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
Common::DetachedTasks detached_tasks; Common::DetachedTasks detached_tasks;
MicroProfileOnThreadCreate("Frontend"); MicroProfileOnThreadCreate("Frontend");
@ -3484,8 +3525,11 @@ int main(int argc, char* argv[]) {
} }
#endif #endif
SetHighDPIAttributes(argc, argv);
// Enables the core to make the qt created contexts current on std::threads // Enables the core to make the qt created contexts current on std::threads
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
QApplication app(argc, argv); QApplication app(argc, argv);
// Qt changes the locale and causes issues in float conversion using std::to_string() when // Qt changes the locale and causes issues in float conversion using std::to_string() when