This commit is contained in:
Nayla Hanegan 2023-06-05 14:59:15 -04:00
commit 14d3c60d22
No known key found for this signature in database
GPG key ID: BAFE9001DA16CFA2
1071 changed files with 159471 additions and 31684 deletions

View file

@ -83,7 +83,7 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
"trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.")));
QLabel* logo = new QLabel();
logo->setPixmap(Resources::GetMisc(Resources::MiscID::LogoLarge));
logo->setPixmap(Resources::GetAppIcon().pixmap(200, 200));
logo->setContentsMargins(30, 0, 30, 0);
QVBoxLayout* main_layout = new QVBoxLayout;

View file

@ -13,18 +13,12 @@ endif()
set(CMAKE_AUTOMOC ON)
# For some reason the method in Qt6 documentation is not working (at least on ubuntu jammy)
# When Qt5 and Qt6 are given in same NAMES entry, only Qt5 is ever found.
find_package(QT NAMES Qt6 COMPONENTS Core Gui Widgets)
if(NOT QT_DIR)
find_package(QT NAMES Qt5 COMPONENTS Core Gui Widgets)
endif()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets)
message(STATUS "Found Qt version ${QT_VERSION}")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
message(STATUS "Found Qt version ${Qt6_VERSION}")
set_property(TARGET Qt${QT_VERSION_MAJOR}::Core PROPERTY INTERFACE_COMPILE_FEATURES "")
set_property(TARGET Qt6::Core PROPERTY INTERFACE_COMPILE_FEATURES "")
add_executable(dolphin-emu
add_executable(dolphin-mpn
AboutDialog.cpp
AboutDialog.h
CheatSearchFactoryWidget.cpp
@ -41,6 +35,16 @@ add_executable(dolphin-emu
Config/CheatWarningWidget.h
Config/CommonControllersWidget.cpp
Config/CommonControllersWidget.h
Config/ConfigControls/ConfigBool.cpp
Config/ConfigControls/ConfigBool.h
Config/ConfigControls/ConfigChoice.cpp
Config/ConfigControls/ConfigChoice.h
Config/ConfigControls/ConfigInteger.cpp
Config/ConfigControls/ConfigInteger.h
Config/ConfigControls/ConfigRadio.cpp
Config/ConfigControls/ConfigRadio.h
Config/ConfigControls/ConfigSlider.cpp
Config/ConfigControls/ConfigSlider.h
Config/ControllerInterface/ControllerInterfaceWindow.cpp
Config/ControllerInterface/ControllerInterfaceWindow.h
Config/ControllerInterface/DualShockUDPClientAddServerDialog.cpp
@ -73,17 +77,6 @@ add_executable(dolphin-emu
Config/Graphics/EnhancementsWidget.h
Config/Graphics/GeneralWidget.cpp
Config/Graphics/GeneralWidget.h
Config/Graphics/GraphicsBool.cpp
Config/Graphics/GraphicsBool.h
Config/Graphics/GraphicsChoice.cpp
Config/Graphics/GraphicsChoice.h
Config/Graphics/GraphicsInteger.cpp
Config/Graphics/GraphicsInteger.h
Config/Graphics/GraphicsRadio.cpp
Config/Graphics/GraphicsRadio.h
Config/Graphics/GraphicsSlider.cpp
Config/Graphics/GraphicsSlider.h
Config/Graphics/GraphicsWidget.h
Config/Graphics/GraphicsWindow.cpp
Config/Graphics/GraphicsWindow.h
Config/Graphics/HacksWidget.cpp
@ -240,6 +233,8 @@ add_executable(dolphin-emu
Host.h
HotkeyScheduler.cpp
HotkeyScheduler.h
InfinityBase/InfinityBaseWindow.cpp
InfinityBase/InfinityBaseWindow.h
Main.cpp
MainWindow.cpp
MainWindow.h
@ -291,8 +286,6 @@ add_executable(dolphin-emu
QtUtils/UTF8CodePointCountValidator.h
QtUtils/WindowActivationEventFilter.cpp
QtUtils/WindowActivationEventFilter.h
QtUtils/WinIconHelper.cpp
QtUtils/WinIconHelper.h
QtUtils/WrapInScrollArea.cpp
QtUtils/WrapInScrollArea.h
RenderWidget.cpp
@ -358,36 +351,36 @@ add_executable(dolphin-emu
)
if (NOT WIN32)
target_sources(dolphin-emu PRIVATE
target_sources(dolphin-mpn PRIVATE
QtUtils/SignalDaemon.cpp
QtUtils/SignalDaemon.h
)
endif()
target_compile_definitions(dolphin-emu
target_compile_definitions(dolphin-mpn
PRIVATE
-DQT_USE_QSTRINGBUILDER
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
)
target_include_directories(dolphin-emu
target_include_directories(dolphin-mpn
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${Qt${QT_VERSION_MAJOR}Gui_PRIVATE_INCLUDE_DIRS}
${Qt6Gui_PRIVATE_INCLUDE_DIRS}
)
target_link_libraries(dolphin-emu
target_link_libraries(dolphin-mpn
PRIVATE
core
Qt${QT_VERSION_MAJOR}::Widgets
Qt6::Widgets
uicommon
imgui
implot
)
if (WIN32)
target_link_libraries(dolphin-emu
target_link_libraries(dolphin-mpn
PRIVATE
gdi32.lib
shell32.lib
@ -401,64 +394,52 @@ if (MSVC)
list(TRANSFORM Qt6Gui_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtGui)
list(TRANSFORM Qt6Gui_PRIVATE_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtGuiPriv)
list(TRANSFORM Qt6Widgets_PRIVATE_INCLUDE_DIRS PREPEND "/external:I" OUTPUT_VARIABLE qtWidgetsPriv)
target_compile_options(dolphin-emu PRIVATE "${qtGui}")
target_compile_options(dolphin-emu PRIVATE "${qtGuiPriv}")
target_compile_options(dolphin-emu PRIVATE "${qtWidgets}")
target_compile_options(dolphin-mpn PRIVATE "${qtGui}")
target_compile_options(dolphin-mpn PRIVATE "${qtGuiPriv}")
target_compile_options(dolphin-mpn PRIVATE "${qtWidgets}")
# Qt 6.3.0 headers use std::aligned_storage instead of alignas
target_compile_definitions(dolphin-emu PRIVATE _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING)
target_compile_definitions(dolphin-mpn PRIVATE _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING)
if ("${QT_VERSION_MAJOR}" GREATER_EQUAL 6)
# Qt6 requires RTTI
remove_cxx_flag_from_target(dolphin-emu "/GR-")
target_compile_options(dolphin-emu PRIVATE "/GR")
else()
# Add precompiled header
target_link_libraries(audiocommon PRIVATE use_pch)
endif()
# Qt6 requires RTTI
remove_cxx_flag_from_target(dolphin-mpn "/GR-")
target_compile_options(dolphin-mpn PRIVATE "/GR")
endif()
if(WIN32)
target_sources(dolphin-emu PRIVATE DolphinQt.manifest DolphinQt.rc)
target_sources(dolphin-mpn PRIVATE DolphinQt.manifest DolphinQt.rc)
set_target_properties(dolphin-emu PROPERTIES
set_target_properties(dolphin-mpn PROPERTIES
DEBUG_POSTFIX D
OUTPUT_NAME Dolphin
WIN32_EXECUTABLE TRUE
)
# Copy Sys dir
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
)
# Copy COPYING
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/COPYING" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/COPYING"
)
# Copy Licenses dir
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/LICENSES" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Licenses"
)
# Copy qt.conf
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.win" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
)
# Delegate to Qt's official deployment binary on Windows to copy over the necessary Qt-specific libraries, etc.
get_target_property(MOC_EXECUTABLE_LOCATION Qt${QT_VERSION_MAJOR}::moc IMPORTED_LOCATION)
get_target_property(MOC_EXECUTABLE_LOCATION Qt6::moc IMPORTED_LOCATION)
get_filename_component(QT_BINARY_DIRECTORY "${MOC_EXECUTABLE_LOCATION}" DIRECTORY)
find_program(WINDEPLOYQT_EXE windeployqt HINTS "${QT_BINARY_DIRECTORY}")
if ("${QT_VERSION_MAJOR}" LESS 6)
set(NO_ANGLE_PARAM "--no-angle")
else()
# parameter no longer exists in Qt6
set(NO_ANGLE_PARAM "")
endif()
# Note: We set the PATH for the duration of this command so that the
# deployment application is able to locate the Qt libraries to copy.
# if the necessary paths aren't already set beforehand.
@ -473,7 +454,7 @@ if(WIN32)
# means proper path variables will not be set up, thus the need to ensure they're
# always set up.
#
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E env PATH="${QT_BINARY_DIRECTORY}"
"${WINDEPLOYQT_EXE}" --libdir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
--plugindir="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/QtPlugins"
@ -481,9 +462,8 @@ if(WIN32)
--no-translations
--no-compiler-runtime
--no-system-d3d-compiler
"${NO_ANGLE_PARAM}"
--no-opengl-sw
"$<TARGET_FILE:dolphin-emu>"
"$<TARGET_FILE:dolphin-mpn>"
)
endif()
@ -496,10 +476,10 @@ if(WIN32 AND NOT Gettext_FOUND)
endif()
if(GETTEXT_MSGFMT_EXECUTABLE)
set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-emu.pot")
set(pot_file "${CMAKE_SOURCE_DIR}/Languages/po/dolphin-mpn.pot")
file(GLOB LINGUAS ${CMAKE_SOURCE_DIR}/Languages/po/*.po)
target_sources(dolphin-emu PRIVATE ${pot_file} ${LINGUAS})
target_sources(dolphin-mpn PRIVATE ${pot_file} ${LINGUAS})
source_group("Localization" FILES ${LINGUAS})
source_group("Localization\\\\Generated" FILES ${pot_file})
@ -510,10 +490,10 @@ if(GETTEXT_MSGFMT_EXECUTABLE)
set(mo ${mo_dir}/${lang}.mo)
else()
set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang})
set(mo ${mo_dir}/dolphin-emu.mo)
set(mo ${mo_dir}/dolphin-mpn.mo)
endif()
target_sources(dolphin-emu PRIVATE ${mo})
target_sources(dolphin-mpn PRIVATE ${mo})
source_group("Localization\\\\Generated" FILES ${mo})
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -544,7 +524,7 @@ if(APPLE)
set(BUNDLE_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Dolphin.app)
# Ask for an application bundle.
set_target_properties(dolphin-emu PROPERTIES
set_target_properties(dolphin-mpn PROPERTIES
MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/DolphinEmu.entitlements"
@ -553,33 +533,31 @@ if(APPLE)
)
# Copy qt.conf into the bundle
target_sources(dolphin-emu PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
target_sources(dolphin-mpn PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# Copy icon into the bundle
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns")
target_sources(dolphin-mpn PRIVATE "${CMAKE_SOURCE_DIR}/Data/Dolphin.icns")
set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/Dolphin.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# Plugins have to be manually included with Qt 6
if (QT_VERSION_MAJOR EQUAL 6)
find_package(Qt6QMacStylePlugin REQUIRED PATHS ${Qt6Widgets_DIR})
find_package(Qt6QCocoaIntegrationPlugin REQUIRED PATHS ${Qt6Gui_DIR})
endif()
# Manually include plugins
find_package(Qt6QMacStylePlugin REQUIRED PATHS ${Qt6Widgets_DIR})
find_package(Qt6QCocoaIntegrationPlugin REQUIRED PATHS ${Qt6Gui_DIR})
# Copy Qt plugins into the bundle
get_target_property(qtcocoa_location Qt${QT_VERSION_MAJOR}::QCocoaIntegrationPlugin LOCATION)
target_sources(dolphin-emu PRIVATE "${qtcocoa_location}")
get_target_property(qtcocoa_location Qt6::QCocoaIntegrationPlugin LOCATION)
target_sources(dolphin-mpn PRIVATE "${qtcocoa_location}")
set_source_files_properties("${qtcocoa_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/platforms)
get_target_property(qtmacstyle_location Qt${QT_VERSION_MAJOR}::QMacStylePlugin LOCATION)
target_sources(dolphin-emu PRIVATE "${qtmacstyle_location}")
get_target_property(qtmacstyle_location Qt6::QMacStylePlugin LOCATION)
target_sources(dolphin-mpn PRIVATE "${qtmacstyle_location}")
set_source_files_properties("${qtmacstyle_location}" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS/styles)
# Copy resources into the bundle
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys")
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*")
foreach(res ${resources})
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
target_sources(dolphin-mpn PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
get_filename_component(resdir "${res}" DIRECTORY)
set_source_files_properties("${CMAKE_SOURCE_DIR}/Data/${res}" PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources/${resdir}")
@ -589,16 +567,16 @@ if(APPLE)
# Copy MoltenVK into the bundle
if(ENABLE_VULKAN)
if(USE_BUNDLED_MOLTENVK)
add_dependencies(dolphin-emu MoltenVK)
add_dependencies(dolphin-mpn MoltenVK)
ExternalProject_Get_Property(MoltenVK SOURCE_DIR)
target_sources(dolphin-emu PRIVATE "${SOURCE_DIR}/Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib")
target_sources(dolphin-mpn PRIVATE "${SOURCE_DIR}/Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib")
set_source_files_properties("${SOURCE_DIR}/Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib" PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks GENERATED ON)
else()
find_file(MOLTENVK_DYLIB NAMES libMoltenVK.dylib PATH_SUFFIXES lib)
if(NOT MOLTENVK_DYLIB)
message(FATAL_ERROR "Couldn't find libMoltenVK.dylib. Enable USE_BUNDLED_MOLTENVK?")
endif()
target_sources(dolphin-emu PRIVATE ${MOLTENVK_DYLIB})
target_sources(dolphin-mpn PRIVATE ${MOLTENVK_DYLIB})
set_source_files_properties(${MOLTENVK_DYLIB} PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks)
endif()
endif()
@ -606,48 +584,48 @@ if(APPLE)
if(NOT SKIP_POSTPROCESS_BUNDLE)
# Update library references to make the bundle portable
include(DolphinPostprocessBundle)
dolphin_postprocess_bundle(dolphin-emu)
dolphin_postprocess_bundle(dolphin-mpn)
# Fix rpath
add_custom_command(TARGET dolphin-emu
add_custom_command(TARGET dolphin-mpn
POST_BUILD COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@executable_path/../Frameworks/"
$<TARGET_FILE:dolphin-emu>)
$<TARGET_FILE:dolphin-mpn>)
endif()
if(MACOS_CODE_SIGNING)
# Code sign make file builds
add_custom_command(TARGET dolphin-emu POST_BUILD
COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$<CONFIG:Debug>:Debug>.entitlements" "$<TARGET_BUNDLE_DIR:dolphin-emu>")
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu$<$<CONFIG:Debug>:Debug>.entitlements" "$<TARGET_BUNDLE_DIR:dolphin-mpn>")
endif()
else()
install(TARGETS dolphin-emu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS dolphin-mpn RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM)
# Set that we want ORIGIN in FLAGS.
# We also want RPATH, not RUNPATH, so disable the new tags.
target_link_options(dolphin-emu
target_link_options(dolphin-mpn
PRIVATE
LINKER:-z,origin
LINKER:--disable-new-dtags
)
# For Steam Runtime builds, our Qt shared libraries will be in a "lib" folder.
set_target_properties(dolphin-emu PROPERTIES
set_target_properties(dolphin-mpn PROPERTIES
BUILD_WITH_INSTALL_RPATH true
INSTALL_RPATH "\$ORIGIN/lib"
)
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND cp "${QT_DIR}/../../LICENSE.*" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND cp -P "${QT_DIR}/../../*.so*" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${QT_DIR}/../../../plugins" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins"
COMMAND cp "${Qt6_DIR}/../../LICENSE.*" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND cp -P "${Qt6_DIR}/../../*.so*" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${Qt6_DIR}/../../../plugins" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins"
)
# Copy qt.conf
target_sources(dolphin-emu PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
add_custom_command(TARGET dolphin-emu POST_BUILD
target_sources(dolphin-mpn PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
)
@ -655,18 +633,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys")
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*")
foreach(res ${resources})
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
target_sources(dolphin-mpn PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}")
endforeach()
# Copy Sys folder
add_custom_command(TARGET dolphin-emu POST_BUILD
add_custom_command(TARGET dolphin-mpn POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
)
endif()
if(USE_MGBA)
target_sources(dolphin-emu PRIVATE
target_sources(dolphin-mpn PRIVATE
GBAHost.cpp
GBAHost.h
GBAWidget.cpp
@ -675,10 +653,10 @@ if(USE_MGBA)
endif()
if(USE_DISCORD_PRESENCE)
target_compile_definitions(dolphin-emu PRIVATE -DUSE_DISCORD_PRESENCE)
target_compile_definitions(dolphin-mpn PRIVATE -DUSE_DISCORD_PRESENCE)
endif()
if(USE_RETRO_ACHIEVEMENTS)
target_link_libraries(dolphin-emu PRIVATE rcheevos)
target_compile_definitions(dolphin-emu PRIVATE -DUSE_RETRO_ACHIEVEMENTS)
target_link_libraries(dolphin-mpn PRIVATE rcheevos)
target_compile_definitions(dolphin-mpn PRIVATE -DUSE_RETRO_ACHIEVEMENTS)
endif()

View file

@ -3,6 +3,7 @@
#include "DolphinQt/Config/ARCodeWidget.h"
#include <algorithm>
#include <utility>
#include <QCursor>
@ -113,6 +114,8 @@ void ARCodeWidget::OnContextMenuRequested()
QMenu menu;
menu.addAction(tr("Sort Alphabetically"), this, &ARCodeWidget::SortAlphabetically);
menu.addAction(tr("Show Enabled Codes First"), this, &ARCodeWidget::SortEnabledCodesFirst);
menu.addAction(tr("Show Disabled Codes First"), this, &ARCodeWidget::SortDisabledCodesFirst);
menu.exec(QCursor::pos());
}
@ -123,6 +126,26 @@ void ARCodeWidget::SortAlphabetically()
OnListReordered();
}
void ARCodeWidget::SortEnabledCodesFirst()
{
std::stable_sort(m_ar_codes.begin(), m_ar_codes.end(), [](const auto& a, const auto& b) {
return a.enabled && a.enabled != b.enabled;
});
UpdateList();
SaveCodes();
}
void ARCodeWidget::SortDisabledCodesFirst()
{
std::stable_sort(m_ar_codes.begin(), m_ar_codes.end(), [](const auto& a, const auto& b) {
return !a.enabled && a.enabled != b.enabled;
});
UpdateList();
SaveCodes();
}
void ARCodeWidget::OnListReordered()
{
// Reorder codes based on the indices of table item

View file

@ -43,6 +43,8 @@ private:
void UpdateList();
void SaveCodes();
void SortAlphabetically();
void SortEnabledCodesFirst();
void SortDisabledCodesFirst();
void OnCodeAddClicked();
void OnCodeEditClicked();

View file

@ -1,7 +1,7 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include <QEvent>
#include <QFont>
@ -11,10 +11,10 @@
#include "DolphinQt/Settings.h"
GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
ConfigBool::ConfigBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
: ToolTipCheckBox(label), m_setting(setting), m_reverse(reverse)
{
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
connect(this, &QCheckBox::toggled, this, &ConfigBool::Update);
setChecked(Config::Get(m_setting) ^ reverse);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
@ -27,7 +27,7 @@ GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setti
});
}
void GraphicsBool::Update()
void ConfigBool::Update()
{
Config::SetBaseOrCurrent(m_setting, static_cast<bool>(isChecked() ^ m_reverse));
}

View file

@ -11,11 +11,11 @@ template <typename T>
class Info;
}
class GraphicsBool : public ToolTipCheckBox
class ConfigBool : public ToolTipCheckBox
{
Q_OBJECT
public:
GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse = false);
ConfigBool(const QString& label, const Config::Info<bool>& setting, bool reverse = false);
private:
void Update();

View file

@ -1,7 +1,7 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include <QSignalBlocker>
@ -9,11 +9,11 @@
#include "DolphinQt/Settings.h"
GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<int>& setting)
ConfigChoice::ConfigChoice(const QStringList& options, const Config::Info<int>& setting)
: m_setting(setting)
{
addItems(options);
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &GraphicsChoice::Update);
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &ConfigChoice::Update);
setCurrentIndex(Config::Get(m_setting));
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
@ -26,7 +26,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<in
});
}
void GraphicsChoice::Update(int choice)
void ConfigChoice::Update(int choice)
{
Config::SetBaseOrCurrent(m_setting, choice);
}

View file

@ -7,11 +7,11 @@
#include "Common/Config/Config.h"
class GraphicsChoice : public ToolTipComboBox
class ConfigChoice : public ToolTipComboBox
{
Q_OBJECT
public:
GraphicsChoice(const QStringList& options, const Config::Info<int>& setting);
ConfigChoice(const QStringList& options, const Config::Info<int>& setting);
private:
void Update(int choice);

View file

@ -1,7 +1,7 @@
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
#include <QSignalBlocker>
@ -9,8 +9,7 @@
#include "DolphinQt/Settings.h"
GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting,
int step)
ConfigInteger::ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, int step)
: ToolTipSpinBox(), m_setting(setting)
{
setMinimum(minimum);
@ -19,7 +18,7 @@ GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<in
setValue(Config::Get(setting));
connect(this, qOverload<int>(&GraphicsInteger::valueChanged), this, &GraphicsInteger::Update);
connect(this, qOverload<int>(&ConfigInteger::valueChanged), this, &ConfigInteger::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
@ -30,7 +29,7 @@ GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<in
});
}
void GraphicsInteger::Update(int value)
void ConfigInteger::Update(int value)
{
Config::SetBaseOrCurrent(m_setting, value);
}

View file

@ -11,11 +11,11 @@ template <typename T>
class Info;
}
class GraphicsInteger : public ToolTipSpinBox
class ConfigInteger : public ToolTipSpinBox
{
Q_OBJECT
public:
GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
void Update(int value);
private:

View file

@ -1,7 +1,7 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include <QSignalBlocker>
@ -9,12 +9,11 @@
#include "DolphinQt/Settings.h"
GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>& setting,
int value)
ConfigRadioInt::ConfigRadioInt(const QString& label, const Config::Info<int>& setting, int value)
: ToolTipRadioButton(label), m_setting(setting), m_value(value)
{
setChecked(Config::Get(m_setting) == m_value);
connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
connect(this, &QRadioButton::toggled, this, &ConfigRadioInt::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
@ -26,7 +25,7 @@ GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>
});
}
void GraphicsRadioInt::Update()
void ConfigRadioInt::Update()
{
if (!isChecked())
return;

View file

@ -7,11 +7,11 @@
#include "Common/Config/Config.h"
class GraphicsRadioInt : public ToolTipRadioButton
class ConfigRadioInt : public ToolTipRadioButton
{
Q_OBJECT
public:
GraphicsRadioInt(const QString& label, const Config::Info<int>& setting, int value);
ConfigRadioInt(const QString& label, const Config::Info<int>& setting, int value);
private:
void Update();

View file

@ -1,7 +1,7 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include <QSignalBlocker>
@ -9,7 +9,7 @@
#include "DolphinQt/Settings.h"
GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
: ToolTipSlider(Qt::Horizontal), m_setting(setting)
{
setMinimum(minimum);
@ -18,7 +18,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>
setValue(Config::Get(setting));
connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update);
connect(this, &ConfigSlider::valueChanged, this, &ConfigSlider::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
@ -30,7 +30,7 @@ GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>
});
}
void GraphicsSlider::Update(int value)
void ConfigSlider::Update(int value)
{
Config::SetBaseOrCurrent(m_setting, value);
}

View file

@ -11,11 +11,11 @@ template <typename T>
class Info;
}
class GraphicsSlider : public ToolTipSlider
class ConfigSlider : public ToolTipSlider
{
Q_OBJECT
public:
GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick = 0);
ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick = 0);
void Update(int value);
private:

View file

@ -90,12 +90,12 @@ void FilesystemWidget::ConnectWidgets()
void FilesystemWidget::PopulateView()
{
// Cache these two icons, the tree will use them a lot.
m_folder_icon = Resources::GetScaledIcon("isoproperties_folder");
m_file_icon = Resources::GetScaledIcon("isoproperties_file");
m_folder_icon = Resources::GetResourceIcon("isoproperties_folder");
m_file_icon = Resources::GetResourceIcon("isoproperties_file");
auto* disc = new QStandardItem(tr("Disc"));
disc->setEditable(false);
disc->setIcon(Resources::GetScaledIcon("isoproperties_disc"));
disc->setIcon(Resources::GetResourceIcon("isoproperties_disc"));
disc->setData(QVariant::fromValue(EntryType::Disc), ENTRY_TYPE);
m_tree_model->appendRow(disc);
m_tree_view->expand(disc->index());
@ -107,7 +107,7 @@ void FilesystemWidget::PopulateView()
auto* item = new QStandardItem;
item->setEditable(false);
item->setIcon(Resources::GetScaledIcon("isoproperties_disc"));
item->setIcon(Resources::GetResourceIcon("isoproperties_disc"));
item->setData(static_cast<qlonglong>(i), ENTRY_PARTITION);
item->setData(QVariant::fromValue(EntryType::Partition), ENTRY_TYPE);
@ -168,7 +168,7 @@ void FilesystemWidget::PopulateDirectory(int partition_id, QStandardItem* root,
for (u32 i = 0; i < 4; i++)
{
char c = static_cast<char>(title_id.value() >> 8 * (3 - i));
if (IsPrintableCharacter(c))
if (Common::IsPrintableCharacter(c))
text += QLatin1Char(c);
else
text += QLatin1Char('.');

View file

@ -13,7 +13,7 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/Mapping/MappingWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
@ -37,8 +37,8 @@ void FreeLookWidget::CreateLayout()
"leave this unchecked.</dolphin_emphasis>"));
m_freelook_controller_configure_button = new NonDefaultQPushButton(tr("Configure Controller"));
m_freelook_control_type = new GraphicsChoice({tr("Six Axis"), tr("First Person"), tr("Orbital")},
Config::FL1_CONTROL_TYPE);
m_freelook_control_type = new ConfigChoice({tr("Six Axis"), tr("First Person"), tr("Orbital")},
Config::FL1_CONTROL_TYPE);
m_freelook_control_type->SetTitle(tr("Free Look Control Type"));
m_freelook_control_type->SetDescription(tr(
"Changes the in-game camera type during Free Look.<br><br>"

View file

@ -5,7 +5,7 @@
#include <QWidget>
class GraphicsChoice;
class ConfigChoice;
class QCheckBox;
class QPushButton;
class ToolTipCheckBox;
@ -25,7 +25,7 @@ private:
void SaveSettings();
ToolTipCheckBox* m_enable_freelook;
GraphicsChoice* m_freelook_control_type;
ConfigChoice* m_freelook_control_type;
QPushButton* m_freelook_controller_configure_button;
QCheckBox* m_freelook_background_input;
};

View file

@ -19,8 +19,8 @@
#include "Core/ConfigLoaders/GameConfigLoader.h"
#include "Core/ConfigManager.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include "DolphinQt/Config/GameConfigEdit.h"
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "UICommon/GameFile.h"

View file

@ -3,6 +3,7 @@
#include "DolphinQt/Config/GeckoCodeWidget.h"
#include <algorithm>
#include <utility>
#include <QCursor>
@ -257,6 +258,8 @@ void GeckoCodeWidget::OnContextMenuRequested()
QMenu menu;
menu.addAction(tr("Sort Alphabetically"), this, &GeckoCodeWidget::SortAlphabetically);
menu.addAction(tr("Show Enabled Codes First"), this, &GeckoCodeWidget::SortEnabledCodesFirst);
menu.addAction(tr("Show Disabled Codes First"), this, &GeckoCodeWidget::SortDisabledCodesFirst);
menu.exec(QCursor::pos());
}
@ -267,6 +270,26 @@ void GeckoCodeWidget::SortAlphabetically()
OnListReordered();
}
void GeckoCodeWidget::SortEnabledCodesFirst()
{
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
return a.enabled && a.enabled != b.enabled;
});
UpdateList();
SaveCodes();
}
void GeckoCodeWidget::SortDisabledCodesFirst()
{
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
return !a.enabled && a.enabled != b.enabled;
});
UpdateList();
SaveCodes();
}
void GeckoCodeWidget::OnListReordered()
{
// Reorder codes based on the indices of table item

View file

@ -48,6 +48,8 @@ private:
void DownloadCodes();
void SaveCodes();
void SortAlphabetically();
void SortEnabledCodesFirst();
void SortDisabledCodesFirst();
std::string m_game_id;
std::string m_gametdb_id;

View file

@ -15,9 +15,9 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
@ -50,17 +50,17 @@ void AdvancedWidget::CreateWidgets()
auto* performance_layout = new QGridLayout();
performance_box->setLayout(performance_layout);
m_show_fps = new GraphicsBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_ftimes = new GraphicsBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES);
m_show_vps = new GraphicsBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
m_show_vtimes = new GraphicsBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES);
m_show_graphs = new GraphicsBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
m_show_speed = new GraphicsBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
m_show_speed_colors = new GraphicsBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
m_perf_samp_window = new GraphicsInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES);
m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES);
m_show_graphs = new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
m_show_speed_colors = new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
m_perf_samp_window->SetTitle(tr("Performance Sample Window (ms)"));
m_log_render_time =
new GraphicsBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
new ConfigBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
performance_layout->addWidget(m_show_fps, 0, 0);
performance_layout->addWidget(m_show_ftimes, 0, 1);
@ -78,12 +78,12 @@ void AdvancedWidget::CreateWidgets()
auto* debugging_layout = new QGridLayout();
debugging_box->setLayout(debugging_layout);
m_enable_wireframe = new GraphicsBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME);
m_show_statistics = new GraphicsBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS);
m_enable_wireframe = new ConfigBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME);
m_show_statistics = new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS);
m_enable_format_overlay =
new GraphicsBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE);
new ConfigBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE);
m_enable_api_validation =
new GraphicsBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER);
new ConfigBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER);
debugging_layout->addWidget(m_enable_wireframe, 0, 0);
debugging_layout->addWidget(m_show_statistics, 0, 1);
@ -95,13 +95,13 @@ void AdvancedWidget::CreateWidgets()
auto* utility_layout = new QGridLayout();
utility_box->setLayout(utility_layout);
m_load_custom_textures = new GraphicsBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES);
m_load_custom_textures = new ConfigBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES);
m_prefetch_custom_textures =
new GraphicsBool(tr("Prefetch Custom Textures"), Config::GFX_CACHE_HIRES_TEXTURES);
m_dump_efb_target = new GraphicsBool(tr("Dump EFB Target"), Config::GFX_DUMP_EFB_TARGET);
m_dump_xfb_target = new GraphicsBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET);
new ConfigBool(tr("Prefetch Custom Textures"), Config::GFX_CACHE_HIRES_TEXTURES);
m_dump_efb_target = new ConfigBool(tr("Dump EFB Target"), Config::GFX_DUMP_EFB_TARGET);
m_dump_xfb_target = new ConfigBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET);
m_disable_vram_copies =
new GraphicsBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
new ConfigBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
m_enable_graphics_mods = new ToolTipCheckBox(tr("Enable Graphics Mods"));
utility_layout->addWidget(m_load_custom_textures, 0, 0);
@ -117,9 +117,9 @@ void AdvancedWidget::CreateWidgets()
auto* texture_dump_box = new QGroupBox(tr("Texture Dumping"));
auto* texture_dump_layout = new QGridLayout();
texture_dump_box->setLayout(texture_dump_layout);
m_dump_textures = new GraphicsBool(tr("Enable"), Config::GFX_DUMP_TEXTURES);
m_dump_base_textures = new GraphicsBool(tr("Dump Base Textures"), Config::GFX_DUMP_BASE_TEXTURES);
m_dump_mip_textures = new GraphicsBool(tr("Dump Mip Maps"), Config::GFX_DUMP_MIP_TEXTURES);
m_dump_textures = new ConfigBool(tr("Enable"), Config::GFX_DUMP_TEXTURES);
m_dump_base_textures = new ConfigBool(tr("Dump Base Textures"), Config::GFX_DUMP_BASE_TEXTURES);
m_dump_mip_textures = new ConfigBool(tr("Dump Mip Maps"), Config::GFX_DUMP_MIP_TEXTURES);
texture_dump_layout->addWidget(m_dump_textures, 0, 0);
@ -131,11 +131,11 @@ void AdvancedWidget::CreateWidgets()
auto* dump_layout = new QGridLayout();
dump_box->setLayout(dump_layout);
m_use_fullres_framedumps = new GraphicsBool(tr("Dump at Internal Resolution"),
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
m_dump_use_ffv1 = new GraphicsBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
m_dump_bitrate = new GraphicsInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
m_png_compression_level = new GraphicsInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
m_use_fullres_framedumps = new ConfigBool(tr("Dump at Internal Resolution"),
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
m_dump_use_ffv1 = new ConfigBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
m_dump_bitrate = new ConfigInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
m_png_compression_level = new ConfigInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
dump_layout->addWidget(m_use_fullres_framedumps, 0, 0);
#if defined(HAVE_FFMPEG)
@ -152,14 +152,14 @@ void AdvancedWidget::CreateWidgets()
auto* misc_layout = new QGridLayout();
misc_box->setLayout(misc_layout);
m_enable_cropping = new GraphicsBool(tr("Crop"), Config::GFX_CROP);
m_enable_cropping = new ConfigBool(tr("Crop"), Config::GFX_CROP);
m_enable_prog_scan = new ToolTipCheckBox(tr("Enable Progressive Scan"));
m_backend_multithreading =
new GraphicsBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING);
m_prefer_vs_for_point_line_expansion = new GraphicsBool(
new ConfigBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING);
m_prefer_vs_for_point_line_expansion = new ConfigBool(
// i18n: VS is short for vertex shaders.
tr("Prefer VS for Point/Line Expansion"), Config::GFX_PREFER_VS_FOR_LINE_POINT_EXPANSION);
m_cpu_cull = new GraphicsBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL);
m_cpu_cull = new ConfigBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL);
misc_layout->addWidget(m_enable_cropping, 0, 0);
misc_layout->addWidget(m_enable_prog_scan, 0, 1);
@ -168,7 +168,7 @@ void AdvancedWidget::CreateWidgets()
misc_layout->addWidget(m_cpu_cull, 2, 0);
#ifdef _WIN32
m_borderless_fullscreen =
new GraphicsBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN);
new ConfigBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN);
misc_layout->addWidget(m_borderless_fullscreen, 2, 1);
#endif
@ -179,9 +179,9 @@ void AdvancedWidget::CreateWidgets()
experimental_box->setLayout(experimental_layout);
m_defer_efb_access_invalidation =
new GraphicsBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION);
new ConfigBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION);
m_manual_texture_sampling =
new GraphicsBool(tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, true);
new ConfigBool(tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, true);
experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0);
experimental_layout->addWidget(m_manual_texture_sampling, 0, 1);

View file

@ -3,26 +3,26 @@
#pragma once
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class GraphicsChoice;
class GraphicsInteger;
class ConfigBool;
class ConfigChoice;
class ConfigInteger;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
class QSpinBox;
class ToolTipCheckBox;
class AdvancedWidget final : public GraphicsWidget
class AdvancedWidget final : public QWidget
{
Q_OBJECT
public:
explicit AdvancedWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -31,48 +31,48 @@ private:
void OnEmulationStateChanged(bool running);
// Debugging
GraphicsBool* m_enable_wireframe;
GraphicsBool* m_show_statistics;
GraphicsBool* m_enable_format_overlay;
GraphicsBool* m_enable_api_validation;
GraphicsBool* m_show_fps;
GraphicsBool* m_show_ftimes;
GraphicsBool* m_show_vps;
GraphicsBool* m_show_vtimes;
GraphicsBool* m_show_graphs;
GraphicsBool* m_show_speed;
GraphicsBool* m_show_speed_colors;
GraphicsInteger* m_perf_samp_window;
GraphicsBool* m_log_render_time;
ConfigBool* m_enable_wireframe;
ConfigBool* m_show_statistics;
ConfigBool* m_enable_format_overlay;
ConfigBool* m_enable_api_validation;
ConfigBool* m_show_fps;
ConfigBool* m_show_ftimes;
ConfigBool* m_show_vps;
ConfigBool* m_show_vtimes;
ConfigBool* m_show_graphs;
ConfigBool* m_show_speed;
ConfigBool* m_show_speed_colors;
ConfigInteger* m_perf_samp_window;
ConfigBool* m_log_render_time;
// Utility
GraphicsBool* m_prefetch_custom_textures;
GraphicsBool* m_dump_efb_target;
GraphicsBool* m_dump_xfb_target;
GraphicsBool* m_disable_vram_copies;
GraphicsBool* m_load_custom_textures;
ConfigBool* m_prefetch_custom_textures;
ConfigBool* m_dump_efb_target;
ConfigBool* m_dump_xfb_target;
ConfigBool* m_disable_vram_copies;
ConfigBool* m_load_custom_textures;
ToolTipCheckBox* m_enable_graphics_mods;
// Texture dumping
GraphicsBool* m_dump_textures;
GraphicsBool* m_dump_mip_textures;
GraphicsBool* m_dump_base_textures;
ConfigBool* m_dump_textures;
ConfigBool* m_dump_mip_textures;
ConfigBool* m_dump_base_textures;
// Frame dumping
GraphicsBool* m_dump_use_ffv1;
GraphicsBool* m_use_fullres_framedumps;
GraphicsInteger* m_dump_bitrate;
GraphicsInteger* m_png_compression_level;
ConfigBool* m_dump_use_ffv1;
ConfigBool* m_use_fullres_framedumps;
ConfigInteger* m_dump_bitrate;
ConfigInteger* m_png_compression_level;
// Misc
GraphicsBool* m_enable_cropping;
ConfigBool* m_enable_cropping;
ToolTipCheckBox* m_enable_prog_scan;
GraphicsBool* m_backend_multithreading;
GraphicsBool* m_prefer_vs_for_point_line_expansion;
GraphicsBool* m_cpu_cull;
GraphicsBool* m_borderless_fullscreen;
ConfigBool* m_backend_multithreading;
ConfigBool* m_prefer_vs_for_point_line_expansion;
ConfigBool* m_cpu_cull;
ConfigBool* m_borderless_fullscreen;
// Experimental
GraphicsBool* m_defer_efb_access_invalidation;
GraphicsBool* m_manual_texture_sampling;
ConfigBool* m_defer_efb_access_invalidation;
ConfigBool* m_manual_texture_sampling;
};

View file

@ -14,10 +14,10 @@
#include "Core/Config/GraphicsSettings.h"
#include "Core/ConfigManager.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/Graphics/PostProcessingConfigWindow.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
@ -82,7 +82,7 @@ void EnhancementsWidget::CreateWidgets()
QString::number(static_cast<int>(EFB_HEIGHT) * scale)));
}
m_ir_combo = new GraphicsChoice(resolution_options, Config::GFX_EFB_SCALE);
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE);
m_ir_combo->setMaxVisibleItems(visible_resolution_option_count);
m_aa_combo = new ToolTipComboBox();
@ -106,18 +106,18 @@ void EnhancementsWidget::CreateWidgets()
m_pp_effect = new ToolTipComboBox();
m_configure_pp_effect = new NonDefaultQPushButton(tr("Configure"));
m_scaled_efb_copy = new GraphicsBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED);
m_scaled_efb_copy = new ConfigBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED);
m_per_pixel_lighting =
new GraphicsBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING);
new ConfigBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING);
m_widescreen_hack = new GraphicsBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK);
m_disable_fog = new GraphicsBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG);
m_widescreen_hack = new ConfigBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK);
m_disable_fog = new ConfigBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG);
m_force_24bit_color =
new GraphicsBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
new ConfigBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
m_disable_copy_filter =
new GraphicsBool(tr("Disable Copy Filter"), Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
m_arbitrary_mipmap_detection = new GraphicsBool(tr("Arbitrary Mipmap Detection"),
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
new ConfigBool(tr("Disable Copy Filter"), Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
m_arbitrary_mipmap_detection = new ConfigBool(tr("Arbitrary Mipmap Detection"),
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
int row = 0;
enhancements_layout->addWidget(new QLabel(tr("Internal Resolution:")), row, 0);
@ -157,13 +157,13 @@ void EnhancementsWidget::CreateWidgets()
auto* stereoscopy_layout = new QGridLayout();
stereoscopy_box->setLayout(stereoscopy_layout);
m_3d_mode = new GraphicsChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"),
tr("Anaglyph"), tr("HDMI 3D"), tr("Passive")},
Config::GFX_STEREO_MODE);
m_3d_depth = new GraphicsSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
m_3d_convergence = new GraphicsSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
Config::GFX_STEREO_CONVERGENCE, 100);
m_3d_swap_eyes = new GraphicsBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
m_3d_mode = new ConfigChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"), tr("Anaglyph"),
tr("HDMI 3D"), tr("Passive")},
Config::GFX_STEREO_MODE);
m_3d_depth = new ConfigSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
m_3d_convergence = new ConfigSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
Config::GFX_STEREO_CONVERGENCE, 100);
m_3d_swap_eyes = new ConfigBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
stereoscopy_layout->addWidget(m_3d_mode, 0, 1);

View file

@ -5,11 +5,11 @@
#include <array>
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class GraphicsChoice;
class GraphicsSlider;
class ConfigBool;
class ConfigChoice;
class ConfigSlider;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
@ -17,15 +17,15 @@ class QPushButton;
class QSlider;
class ToolTipComboBox;
class EnhancementsWidget final : public GraphicsWidget
class EnhancementsWidget final : public QWidget
{
Q_OBJECT
public:
explicit EnhancementsWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -34,24 +34,24 @@ private:
void LoadPPShaders();
// Enhancements
GraphicsChoice* m_ir_combo;
ConfigChoice* m_ir_combo;
ToolTipComboBox* m_aa_combo;
ToolTipComboBox* m_texture_filtering_combo;
ToolTipComboBox* m_pp_effect;
QPushButton* m_configure_pp_effect;
GraphicsBool* m_scaled_efb_copy;
GraphicsBool* m_per_pixel_lighting;
GraphicsBool* m_widescreen_hack;
GraphicsBool* m_disable_fog;
GraphicsBool* m_force_24bit_color;
GraphicsBool* m_disable_copy_filter;
GraphicsBool* m_arbitrary_mipmap_detection;
ConfigBool* m_scaled_efb_copy;
ConfigBool* m_per_pixel_lighting;
ConfigBool* m_widescreen_hack;
ConfigBool* m_disable_fog;
ConfigBool* m_force_24bit_color;
ConfigBool* m_disable_copy_filter;
ConfigBool* m_arbitrary_mipmap_detection;
// Stereoscopy
GraphicsChoice* m_3d_mode;
GraphicsSlider* m_3d_depth;
GraphicsSlider* m_3d_convergence;
GraphicsBool* m_3d_swap_eyes;
ConfigChoice* m_3d_mode;
ConfigSlider* m_3d_depth;
ConfigSlider* m_3d_convergence;
ConfigBool* m_3d_swap_eyes;
int m_msaa_modes;
bool m_block_save;

View file

@ -18,21 +18,18 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/Settings.h"
#include "UICommon/VideoUtils.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
GeneralWidget::GeneralWidget(X11Utils::XRRConfiguration* xrr_config, GraphicsWindow* parent)
: m_xrr_config(xrr_config)
GeneralWidget::GeneralWidget(GraphicsWindow* parent)
{
CreateWidgets();
LoadSettings();
@ -57,11 +54,11 @@ void GeneralWidget::CreateWidgets()
m_backend_combo = new ToolTipComboBox();
m_aspect_combo =
new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
Config::GFX_ASPECT_RATIO);
new ConfigChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
Config::GFX_ASPECT_RATIO);
m_adapter_combo = new ToolTipComboBox;
m_enable_vsync = new GraphicsBool(tr("V-Sync"), Config::GFX_VSYNC);
m_enable_fullscreen = new GraphicsBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC);
m_enable_fullscreen = new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
m_video_box->setLayout(m_video_layout);
@ -87,13 +84,12 @@ void GeneralWidget::CreateWidgets()
auto* m_options_box = new QGroupBox(tr("Other"));
auto* m_options_layout = new QGridLayout();
m_show_ping = new GraphicsBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
m_show_turn_count = new GraphicsBool(tr("Show MP Turn"), Config::GFX_SHOW_MP_TURN);
m_show_ping = new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
m_show_turn_count = new ConfigBool(tr("Show MP Turn"), Config::GFX_SHOW_MP_TURN);
m_autoadjust_window_size =
new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
m_show_messages =
new GraphicsBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES);
m_render_main_window = new GraphicsBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN);
new ConfigBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
m_show_messages = new ConfigBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES);
m_render_main_window = new ConfigBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN);
m_options_box->setLayout(m_options_layout);
@ -116,13 +112,13 @@ void GeneralWidget::CreateWidgets()
}};
for (size_t i = 0; i < modes.size(); i++)
{
m_shader_compilation_mode[i] = new GraphicsRadioInt(
tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
m_shader_compilation_mode[i] =
new ConfigRadioInt(tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
shader_compilation_layout->addWidget(m_shader_compilation_mode[i], static_cast<int>(i / 2),
static_cast<int>(i % 2));
}
m_wait_for_shaders = new GraphicsBool(tr("Compile Shaders Before Starting"),
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
m_wait_for_shaders = new ConfigBool(tr("Compile Shaders Before Starting"),
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
shader_compilation_layout->addWidget(m_wait_for_shaders);
shader_compilation_box->setLayout(shader_compilation_layout);

View file

@ -4,11 +4,12 @@
#pragma once
#include <array>
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
class GraphicsBool;
class GraphicsChoice;
class GraphicsRadioInt;
#include <QWidget>
class ConfigBool;
class ConfigChoice;
class ConfigRadioInt;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
@ -16,22 +17,17 @@ class QRadioButton;
class QGridLayout;
class ToolTipComboBox;
namespace X11Utils
{
class XRRConfiguration;
}
class GeneralWidget final : public GraphicsWidget
class GeneralWidget final : public QWidget
{
Q_OBJECT
public:
explicit GeneralWidget(X11Utils::XRRConfiguration* xrr_config, GraphicsWindow* parent);
explicit GeneralWidget(GraphicsWindow* parent);
signals:
void BackendChanged(const QString& backend);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -44,18 +40,16 @@ private:
QGridLayout* m_video_layout;
ToolTipComboBox* m_backend_combo;
ToolTipComboBox* m_adapter_combo;
GraphicsChoice* m_aspect_combo;
GraphicsBool* m_enable_vsync;
GraphicsBool* m_enable_fullscreen;
ConfigChoice* m_aspect_combo;
ConfigBool* m_enable_vsync;
ConfigBool* m_enable_fullscreen;
// Options
GraphicsBool* m_show_ping;
GraphicsBool* m_show_turn_count;
GraphicsBool* m_autoadjust_window_size;
GraphicsBool* m_show_messages;
GraphicsBool* m_render_main_window;
std::array<GraphicsRadioInt*, 4> m_shader_compilation_mode{};
GraphicsBool* m_wait_for_shaders;
X11Utils::XRRConfiguration* m_xrr_config;
ConfigBool* m_show_ping;
ConfigBool* m_show_turn_count;
ConfigBool* m_autoadjust_window_size;
ConfigBool* m_show_messages;
ConfigBool* m_render_main_window;
std::array<ConfigRadioInt*, 4> m_shader_compilation_mode{};
ConfigBool* m_wait_for_shaders;
};

View file

@ -1,14 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QWidget>
class GraphicsWidget : public QWidget
{
Q_OBJECT
protected:
virtual void LoadSettings() = 0;
virtual void SaveSettings() = 0;
};

View file

@ -24,8 +24,7 @@
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent)
: QDialog(parent), m_xrr_config(xrr_config)
GraphicsWindow::GraphicsWindow(MainWindow* parent) : QDialog(parent)
{
CreateMainLayout();
@ -37,32 +36,31 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo
void GraphicsWindow::CreateMainLayout()
{
auto* main_layout = new QVBoxLayout();
m_tab_widget = new QTabWidget();
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
auto* const main_layout = new QVBoxLayout();
auto* const tab_widget = new QTabWidget();
auto* const button_box = new QDialogButtonBox(QDialogButtonBox::Close);
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
main_layout->addWidget(m_tab_widget);
main_layout->addWidget(m_button_box);
main_layout->addWidget(tab_widget);
main_layout->addWidget(button_box);
m_general_widget = new GeneralWidget(m_xrr_config, this);
m_enhancements_widget = new EnhancementsWidget(this);
m_hacks_widget = new HacksWidget(this);
m_advanced_widget = new AdvancedWidget(this);
auto* const general_widget = new GeneralWidget(this);
auto* const enhancements_widget = new EnhancementsWidget(this);
auto* const hacks_widget = new HacksWidget(this);
auto* const advanced_widget = new AdvancedWidget(this);
connect(m_general_widget, &GeneralWidget::BackendChanged, this,
&GraphicsWindow::OnBackendChanged);
connect(general_widget, &GeneralWidget::BackendChanged, this, &GraphicsWindow::OnBackendChanged);
m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 100);
m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 100);
m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 100);
m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 100);
QWidget* const wrapped_general = GetWrappedWidget(general_widget, this, 50, 100);
QWidget* const wrapped_enhancements = GetWrappedWidget(enhancements_widget, this, 50, 100);
QWidget* const wrapped_hacks = GetWrappedWidget(hacks_widget, this, 50, 100);
QWidget* const wrapped_advanced = GetWrappedWidget(advanced_widget, this, 50, 100);
m_tab_widget->addTab(m_wrapped_general, tr("General"));
m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements"));
m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks"));
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
tab_widget->addTab(wrapped_general, tr("General"));
tab_widget->addTab(wrapped_enhancements, tr("Enhancements"));
tab_widget->addTab(wrapped_hacks, tr("Hacks"));
tab_widget->addTab(wrapped_advanced, tr("Advanced"));
setLayout(main_layout);
}

View file

@ -16,16 +16,11 @@ class QTabWidget;
class QDialogButtonBox;
class SoftwareRendererWidget;
namespace X11Utils
{
class XRRConfiguration;
}
class GraphicsWindow final : public QDialog
{
Q_OBJECT
public:
explicit GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent);
explicit GraphicsWindow(MainWindow* parent);
signals:
void BackendChanged(const QString& backend);
@ -33,21 +28,4 @@ signals:
private:
void CreateMainLayout();
void OnBackendChanged(const QString& backend);
QTabWidget* m_tab_widget;
QDialogButtonBox* m_button_box;
AdvancedWidget* m_advanced_widget;
EnhancementsWidget* m_enhancements_widget;
HacksWidget* m_hacks_widget;
GeneralWidget* m_general_widget;
SoftwareRendererWidget* m_software_renderer;
QWidget* m_wrapped_advanced;
QWidget* m_wrapped_enhancements;
QWidget* m_wrapped_hacks;
QWidget* m_wrapped_general;
QWidget* m_wrapped_software;
X11Utils::XRRConfiguration* m_xrr_config;
};

View file

@ -13,8 +13,8 @@
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
#include "DolphinQt/Settings.h"
@ -42,13 +42,13 @@ void HacksWidget::CreateWidgets()
auto* efb_layout = new QGridLayout();
efb_box->setLayout(efb_layout);
m_skip_efb_cpu =
new GraphicsBool(tr("Skip EFB Access from CPU"), Config::GFX_HACK_EFB_ACCESS_ENABLE, true);
m_ignore_format_changes = new GraphicsBool(tr("Ignore Format Changes"),
Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, true);
m_store_efb_copies = new GraphicsBool(tr("Store EFB Copies to Texture Only"),
Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
new ConfigBool(tr("Skip EFB Access from CPU"), Config::GFX_HACK_EFB_ACCESS_ENABLE, true);
m_ignore_format_changes = new ConfigBool(tr("Ignore Format Changes"),
Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, true);
m_store_efb_copies =
new ConfigBool(tr("Store EFB Copies to Texture Only"), Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
m_defer_efb_copies =
new GraphicsBool(tr("Defer EFB Copies to RAM"), Config::GFX_HACK_DEFER_EFB_COPIES);
new ConfigBool(tr("Defer EFB Copies to RAM"), Config::GFX_HACK_DEFER_EFB_COPIES);
efb_layout->addWidget(m_skip_efb_cpu, 0, 0);
efb_layout->addWidget(m_ignore_format_changes, 0, 1);
@ -66,7 +66,7 @@ void HacksWidget::CreateWidgets()
m_accuracy->setPageStep(1);
m_accuracy->setTickPosition(QSlider::TicksBelow);
m_gpu_texture_decoding =
new GraphicsBool(tr("GPU Texture Decoding"), Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
new ConfigBool(tr("GPU Texture Decoding"), Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
auto* safe_label = new QLabel(tr("Safe"));
safe_label->setAlignment(Qt::AlignRight);
@ -84,11 +84,11 @@ void HacksWidget::CreateWidgets()
auto* xfb_layout = new QVBoxLayout();
xfb_box->setLayout(xfb_layout);
m_store_xfb_copies = new GraphicsBool(tr("Store XFB Copies to Texture Only"),
Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
m_immediate_xfb = new GraphicsBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
m_skip_duplicate_xfbs = new GraphicsBool(tr("Skip Presenting Duplicate Frames"),
Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
m_store_xfb_copies =
new ConfigBool(tr("Store XFB Copies to Texture Only"), Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
m_immediate_xfb = new ConfigBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
m_skip_duplicate_xfbs =
new ConfigBool(tr("Skip Presenting Duplicate Frames"), Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
xfb_layout->addWidget(m_store_xfb_copies);
xfb_layout->addWidget(m_immediate_xfb);
@ -100,13 +100,13 @@ void HacksWidget::CreateWidgets()
other_box->setLayout(other_layout);
m_fast_depth_calculation =
new GraphicsBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC);
new ConfigBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC);
m_disable_bounding_box =
new GraphicsBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, true);
m_vertex_rounding = new GraphicsBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
new ConfigBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, true);
m_vertex_rounding = new ConfigBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
m_save_texture_cache_state =
new GraphicsBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
m_vi_skip = new GraphicsBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP);
new ConfigBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
m_vi_skip = new ConfigBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP);
other_layout->addWidget(m_fast_depth_calculation, 0, 0);
other_layout->addWidget(m_disable_bounding_box, 0, 1);

View file

@ -3,47 +3,47 @@
#pragma once
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class ConfigBool;
class GraphicsWindow;
class QLabel;
class ToolTipSlider;
class HacksWidget final : public GraphicsWidget
class HacksWidget final : public QWidget
{
Q_OBJECT
public:
explicit HacksWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void OnBackendChanged(const QString& backend_name);
// EFB
GraphicsBool* m_skip_efb_cpu;
GraphicsBool* m_ignore_format_changes;
GraphicsBool* m_store_efb_copies;
GraphicsBool* m_defer_efb_copies;
ConfigBool* m_skip_efb_cpu;
ConfigBool* m_ignore_format_changes;
ConfigBool* m_store_efb_copies;
ConfigBool* m_defer_efb_copies;
// Texture Cache
QLabel* m_accuracy_label;
ToolTipSlider* m_accuracy;
GraphicsBool* m_gpu_texture_decoding;
ConfigBool* m_gpu_texture_decoding;
// External Framebuffer
GraphicsBool* m_store_xfb_copies;
GraphicsBool* m_immediate_xfb;
GraphicsBool* m_skip_duplicate_xfbs;
ConfigBool* m_store_xfb_copies;
ConfigBool* m_immediate_xfb;
ConfigBool* m_skip_duplicate_xfbs;
// Other
GraphicsBool* m_fast_depth_calculation;
GraphicsBool* m_disable_bounding_box;
GraphicsBool* m_vertex_rounding;
GraphicsBool* m_vi_skip;
GraphicsBool* m_save_texture_cache_state;
ConfigBool* m_fast_depth_calculation;
ConfigBool* m_disable_bounding_box;
ConfigBool* m_vertex_rounding;
ConfigBool* m_vi_skip;
ConfigBool* m_save_texture_cache_state;
void CreateWidgets();
void ConnectWidgets();

View file

@ -93,12 +93,17 @@ void PostProcessingConfigWindow::Create()
u32 row = 0;
bool add_general_page = false;
for (const auto& it : m_config_groups)
for (auto& it : m_config_groups)
{
if (it->HasSubGroups())
{
auto* const tab = CreateDependentTab(it);
m_tabs->addTab(tab, QString::fromStdString(it->GetGUIName()));
if (it->GetConfigurationOption()->m_type == OptionType::Bool)
{
it->EnableSuboptions(it->GetCheckboxValue());
}
}
else
{
@ -213,6 +218,12 @@ bool PostProcessingConfigWindow::ConfigGroup::HasSubGroups() const noexcept
return !m_subgroups.empty();
}
const ConfigurationOption*
PostProcessingConfigWindow::ConfigGroup::GetConfigurationOption() const noexcept
{
return m_config_option;
}
const std::vector<std::unique_ptr<PostProcessingConfigWindow::ConfigGroup>>&
PostProcessingConfigWindow::ConfigGroup::GetSubGroups() const noexcept
{
@ -300,11 +311,12 @@ u32 PostProcessingConfigWindow::ConfigGroup::AddFloat(PostProcessingConfigWindow
for (size_t i = 0; i < vector_size; ++i)
{
const int current_value =
m_config_option->m_float_values[i] / m_config_option->m_float_step_values[i];
const float range =
m_config_option->m_float_max_values[i] - m_config_option->m_float_min_values[i];
const int steps = std::ceil(range / m_config_option->m_float_step_values[i]);
const int current_value =
std::round((m_config_option->m_float_values[i] - m_config_option->m_float_min_values[i]) /
m_config_option->m_float_step_values[i]);
auto* const slider = new QSlider(Qt::Orientation::Horizontal);
slider->setMinimum(0);
@ -351,6 +363,11 @@ void PostProcessingConfigWindow::ConfigGroup::EnableSuboptions(const bool state)
}
}
int PostProcessingConfigWindow::ConfigGroup::GetCheckboxValue() const
{
return m_checkbox->isChecked();
}
int PostProcessingConfigWindow::ConfigGroup::GetSliderValue(size_t index) const
{
return m_sliders[index]->value();

View file

@ -41,9 +41,12 @@ private:
const std::string& GetOptionName() const noexcept;
void AddSubGroup(std::unique_ptr<ConfigGroup>&& subgroup);
bool HasSubGroups() const noexcept;
const VideoCommon::PostProcessingConfiguration::ConfigurationOption*
GetConfigurationOption() const noexcept;
const std::vector<std::unique_ptr<ConfigGroup>>& GetSubGroups() const noexcept;
u32 AddWidgets(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
void EnableSuboptions(bool state);
int GetCheckboxValue() const;
int GetSliderValue(size_t index) const;
void SetSliderText(size_t index, const QString& text);

View file

@ -16,12 +16,7 @@
#include <QPushButton>
#include <QStyle>
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#include <QScreen>
#else
#include <QApplication>
#include <QDesktopWidget>
#endif
#if defined(__APPLE__)
#include <QToolTip>
@ -105,11 +100,7 @@ BalloonTip::BalloonTip(PrivateTag, const QIcon& icon, QString title, QString mes
message_label->setTextFormat(Qt::RichText);
message_label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const int limit = QApplication::desktop()->availableGeometry(message_label).width() / 3;
#else
const int limit = message_label->screen()->availableGeometry().width() / 3;
#endif
message_label->setMaximumWidth(limit);
message_label->setSizePolicy(QSizePolicy::Policy::MinimumExpanding,
QSizePolicy::Policy::MinimumExpanding);
@ -136,14 +127,11 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& pos, ShowArrow show_arrow)
{
m_show_arrow = show_arrow == ShowArrow::Yes;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const QRect screen_rect = QApplication::desktop()->screenGeometry(pos);
#else
QScreen* screen = QGuiApplication::screenAt(pos);
if (!screen)
screen = QGuiApplication::primaryScreen();
const QRect screen_rect = screen->geometry();
#endif
QSize sh = sizeHint();
// The look should resemble the default tooltip style set in Settings::SetCurrentUserStyle()
const int border = 1;

View file

@ -22,11 +22,7 @@ public:
void SetDescription(QString description) { m_description = std::move(description); }
private:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void enterEvent(QEvent* event) override
#else
void enterEvent(QEnterEvent* event) override
#endif
{
if (m_timer_id)
return;

View file

@ -126,11 +126,11 @@ void BreakpointWidget::CreateWidgets()
void BreakpointWidget::UpdateIcons()
{
m_new->setIcon(Resources::GetScaledThemeIcon("debugger_add_breakpoint"));
m_delete->setIcon(Resources::GetScaledThemeIcon("debugger_delete"));
m_clear->setIcon(Resources::GetScaledThemeIcon("debugger_clear"));
m_load->setIcon(Resources::GetScaledThemeIcon("debugger_load"));
m_save->setIcon(Resources::GetScaledThemeIcon("debugger_save"));
m_new->setIcon(Resources::GetThemeIcon("debugger_add_breakpoint"));
m_delete->setIcon(Resources::GetThemeIcon("debugger_delete"));
m_clear->setIcon(Resources::GetThemeIcon("debugger_clear"));
m_load->setIcon(Resources::GetThemeIcon("debugger_load"));
m_save->setIcon(Resources::GetThemeIcon("debugger_save"));
}
void BreakpointWidget::closeEvent(QCloseEvent*)

View file

@ -7,10 +7,12 @@
#include <string>
#include <vector>
#include <QGuiApplication>
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>
#include <QPushButton>
#include <QStyleHints>
#include <QTableWidget>
#include <QVBoxLayout>
@ -30,6 +32,10 @@
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/Settings.h"
static const QString RECORD_BUTTON_STYLESHEET =
QStringLiteral("QPushButton:checked { background-color: rgb(150, 0, 0); border-style: solid; "
"border-width: 3px; border-color: rgb(150,0,0); color: rgb(255, 255, 255);}");
CodeDiffDialog::CodeDiffDialog(CodeWidget* parent) : QDialog(parent), m_code_widget(parent)
{
setWindowTitle(tr("Code Diff Tool"));
@ -54,9 +60,7 @@ void CodeDiffDialog::CreateWidgets()
m_include_btn = new QPushButton(tr("Code has been executed"));
m_record_btn = new QPushButton(tr("Start Recording"));
m_record_btn->setCheckable(true);
m_record_btn->setStyleSheet(
QStringLiteral("QPushButton:checked { background-color: rgb(150, 0, 0); border-style: solid; "
"border-width: 3px; border-color: rgb(150,0,0); color: rgb(255, 255, 255);}"));
m_record_btn->setStyleSheet(RECORD_BUTTON_STYLESHEET);
m_exclude_btn->setEnabled(false);
m_include_btn->setEnabled(false);
@ -105,6 +109,13 @@ void CodeDiffDialog::CreateWidgets()
void CodeDiffDialog::ConnectWidgets()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[this](Qt::ColorScheme colorScheme) {
m_record_btn->setStyleSheet(RECORD_BUTTON_STYLESHEET);
});
#endif
connect(m_record_btn, &QPushButton::toggled, this, &CodeDiffDialog::OnRecord);
connect(m_include_btn, &QPushButton::pressed, [this]() { Update(true); });
connect(m_exclude_btn, &QPushButton::pressed, [this]() { Update(false); });

View file

@ -19,15 +19,16 @@
#include <QPainter>
#include <QResizeEvent>
#include <QScrollBar>
#include <QStyleHints>
#include <QStyledItemDelegate>
#include <QTableWidgetItem>
#include <QWheelEvent>
#include "Common/Assert.h"
#include "Common/Debug/CodeTrace.h"
#include "Common/GekkoDisassembler.h"
#include "Common/StringUtil.h"
#include "Core/Core.h"
#include "Core/Debugger/CodeTrace.h"
#include "Core/Debugger/PPCDebugInterface.h"
#include "Core/PowerPC/MMU.h"
#include "Core/PowerPC/PPCAnalyst.h"
@ -161,6 +162,11 @@ CodeViewWidget::CodeViewWidget() : m_system(Core::System::GetInstance())
FontBasedSizing();
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[this](Qt::ColorScheme colorScheme) { OnSelectionChanged(); });
#endif
connect(this, &CodeViewWidget::customContextMenuRequested, this, &CodeViewWidget::OnContextMenu);
connect(this, &CodeViewWidget::itemSelectionChanged, this, &CodeViewWidget::OnSelectionChanged);
connect(&Settings::Instance(), &Settings::DebugFontChanged, this, &QWidget::setFont);
@ -373,8 +379,7 @@ void CodeViewWidget::Update(const Core::CPUThreadGuard* guard)
if (debug_interface.IsBreakpoint(addr))
{
auto icon =
Resources::GetScaledThemeIcon("debugger_breakpoint").pixmap(QSize(rowh - 2, rowh - 2));
auto icon = Resources::GetThemeIcon("debugger_breakpoint").pixmap(QSize(rowh - 2, rowh - 2));
if (!m_system.GetPowerPC().GetBreakPoints().IsBreakPointEnable(addr))
{
QPixmap disabled_icon(icon.size());

View file

@ -8,7 +8,7 @@
#include <QTableWidget>
#include "Common/CommonTypes.h"
#include "Common/Debug/CodeTrace.h"
#include "Core/Debugger/CodeTrace.h"
class QKeyEvent;
class QMouseEvent;

View file

@ -9,11 +9,13 @@
#include <QGridLayout>
#include <QGroupBox>
#include <QGuiApplication>
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
#include <QPushButton>
#include <QSplitter>
#include <QStyleHints>
#include <QTableWidget>
#include <QWidget>
@ -28,6 +30,10 @@
#include "DolphinQt/Host.h"
#include "DolphinQt/Settings.h"
static const QString BOX_SPLITTER_STYLESHEET = QStringLiteral(
"QSplitter::handle { border-top: 1px dashed black; width: 1px; margin-left: 10px; "
"margin-right: 10px; }");
CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent), m_system(Core::System::GetInstance())
{
setWindowTitle(tr("Code"));
@ -104,9 +110,7 @@ void CodeWidget::CreateWidgets()
m_search_address->setPlaceholderText(tr("Search Address"));
m_box_splitter = new QSplitter(Qt::Vertical);
m_box_splitter->setStyleSheet(QStringLiteral(
"QSplitter::handle { border-top: 1px dashed black; width: 1px; margin-left: 10px; "
"margin-right: 10px; }"));
m_box_splitter->setStyleSheet(BOX_SPLITTER_STYLESHEET);
auto add_search_line_edit = [this](const QString& name, QListWidget* list_widget) {
auto* widget = new QWidget;
@ -154,6 +158,13 @@ void CodeWidget::CreateWidgets()
void CodeWidget::ConnectWidgets()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[this](Qt::ColorScheme colorScheme) {
m_box_splitter->setStyleSheet(BOX_SPLITTER_STYLESHEET);
});
#endif
connect(m_search_address, &QLineEdit::textChanged, this, &CodeWidget::OnSearchAddress);
connect(m_search_address, &QLineEdit::returnPressed, this, &CodeWidget::OnSearchAddress);
connect(m_search_symbols, &QLineEdit::textChanged, this, &CodeWidget::OnSearchSymbols);

View file

@ -212,11 +212,7 @@ void MemoryViewWidget::UpdateFont()
// BoundingRect is too unpredictable, a custom one would be needed for each view type. Different
// fonts have wildly different spacing between two characters and horizontalAdvance includes
// spacing.
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
m_font_width = fm.horizontalAdvance(QLatin1Char('0'));
#else
m_font_width = fm.width(QLatin1Char('0'));
#endif
m_table->setFont(Settings::Instance().GetDebugFont());
CreateTable();
@ -499,8 +495,8 @@ QString MemoryViewWidget::ValueToString(const Core::CPUThreadGuard& guard, u32 a
case Type::ASCII:
{
const char value = accessors->ReadU8(guard, address);
return IsPrintableCharacter(value) ? QString{QChar::fromLatin1(value)} :
QString{QChar::fromLatin1('.')};
return Common::IsPrintableCharacter(value) ? QString{QChar::fromLatin1(value)} :
QString{QChar::fromLatin1('.')};
}
case Type::Hex16:
{
@ -587,7 +583,7 @@ void MemoryViewWidget::UpdateBreakpointTags()
{
m_table->item(i, 0)->setData(
Qt::DecorationRole,
Resources::GetScaledThemeIcon("debugger_breakpoint")
Resources::GetThemeIcon("debugger_breakpoint")
.pixmap(QSize(m_table->rowHeight(0) - 3, m_table->rowHeight(0) - 3)));
}
else

View file

@ -239,6 +239,16 @@ void NetworkWidget::Update()
if (!isVisible())
return;
if (Core::GetState() != Core::State::Paused)
{
m_socket_table->setDisabled(true);
m_ssl_table->setDisabled(true);
return;
}
m_socket_table->setDisabled(false);
m_ssl_table->setDisabled(false);
// needed because there's a race condition on the IOS instance otherwise
Core::CPUThreadGuard guard(Core::System::GetInstance());

View file

@ -12,8 +12,8 @@
#include <QTableWidget>
#include <QVBoxLayout>
#include "Common/Debug/CodeTrace.h"
#include "Core/Core.h"
#include "Core/Debugger/CodeTrace.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/PowerPC/PowerPC.h"
#include "Core/System.h"

View file

@ -131,11 +131,11 @@ void WatchWidget::ConnectWidgets()
void WatchWidget::UpdateIcons()
{
// TODO: Create a "debugger_add_watch" icon
m_new->setIcon(Resources::GetScaledThemeIcon("debugger_add_breakpoint"));
m_delete->setIcon(Resources::GetScaledThemeIcon("debugger_delete"));
m_clear->setIcon(Resources::GetScaledThemeIcon("debugger_clear"));
m_load->setIcon(Resources::GetScaledThemeIcon("debugger_load"));
m_save->setIcon(Resources::GetScaledThemeIcon("debugger_save"));
m_new->setIcon(Resources::GetThemeIcon("debugger_add_breakpoint"));
m_delete->setIcon(Resources::GetThemeIcon("debugger_delete"));
m_clear->setIcon(Resources::GetThemeIcon("debugger_clear"));
m_load->setIcon(Resources::GetThemeIcon("debugger_load"));
m_save->setIcon(Resources::GetThemeIcon("debugger_save"));
}
void WatchWidget::UpdateButtonsEnabled()

View file

@ -2,7 +2,6 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</asmv3:windowsSettings>
</asmv3:application>

View file

@ -59,6 +59,11 @@
<ClCompile Include="Config\CheatCodeEditor.cpp" />
<ClCompile Include="Config\CheatWarningWidget.cpp" />
<ClCompile Include="Config\CommonControllersWidget.cpp" />
<ClCompile Include="Config\ConfigControls\ConfigBool.cpp" />
<ClCompile Include="Config\ConfigControls\ConfigChoice.cpp" />
<ClCompile Include="Config\ConfigControls\ConfigInteger.cpp" />
<ClCompile Include="Config\ConfigControls\ConfigRadio.cpp" />
<ClCompile Include="Config\ConfigControls\ConfigSlider.cpp" />
<ClCompile Include="Config\ControllerInterface\ControllerInterfaceWindow.cpp" />
<ClCompile Include="Config\ControllerInterface\DualShockUDPClientAddServerDialog.cpp" />
<ClCompile Include="Config\ControllerInterface\DualShockUDPClientWidget.cpp" />
@ -75,11 +80,6 @@
<ClCompile Include="Config\Graphics\AdvancedWidget.cpp" />
<ClCompile Include="Config\Graphics\EnhancementsWidget.cpp" />
<ClCompile Include="Config\Graphics\GeneralWidget.cpp" />
<ClCompile Include="Config\Graphics\GraphicsBool.cpp" />
<ClCompile Include="Config\Graphics\GraphicsChoice.cpp" />
<ClCompile Include="Config\Graphics\GraphicsInteger.cpp" />
<ClCompile Include="Config\Graphics\GraphicsRadio.cpp" />
<ClCompile Include="Config\Graphics\GraphicsSlider.cpp" />
<ClCompile Include="Config\Graphics\GraphicsWindow.cpp" />
<ClCompile Include="Config\Graphics\HacksWidget.cpp" />
<ClCompile Include="Config\Graphics\PostProcessingConfigWindow.cpp" />
@ -160,6 +160,7 @@
<ClCompile Include="GCMemcardManager.cpp" />
<ClCompile Include="Host.cpp" />
<ClCompile Include="HotkeyScheduler.cpp" />
<ClCompile Include="InfinityBase/InfinityBaseWindow.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="MainWindow.cpp" />
<ClCompile Include="MenuBar.cpp" />
@ -188,7 +189,6 @@
<ClCompile Include="QtUtils\PartiallyClosableTabWidget.cpp" />
<ClCompile Include="QtUtils\UTF8CodePointCountValidator.cpp" />
<ClCompile Include="QtUtils\WindowActivationEventFilter.cpp" />
<ClCompile Include="QtUtils\WinIconHelper.cpp" />
<ClCompile Include="QtUtils\WrapInScrollArea.cpp" />
<ClCompile Include="RenderWidget.cpp" />
<ClCompile Include="ResourcePackManager.cpp" />
@ -245,7 +245,6 @@
<ClInclude Include="QtUtils\QueueOnObject.h" />
<ClInclude Include="QtUtils\RunOnObject.h" />
<ClInclude Include="QtUtils\SignalBlocking.h" />
<ClInclude Include="QtUtils\WinIconHelper.h" />
<ClInclude Include="QtUtils\WrapInScrollArea.h" />
<ClInclude Include="ResourcePackManager.h" />
<ClInclude Include="Resources.h" />
@ -260,6 +259,11 @@
<QtMoc Include="Config\ARCodeWidget.h" />
<QtMoc Include="Config\CheatWarningWidget.h" />
<QtMoc Include="Config\CommonControllersWidget.h" />
<QtMoc Include="Config\ConfigControls\ConfigBool.h" />
<QtMoc Include="Config\ConfigControls\ConfigChoice.h" />
<QtMoc Include="Config\ConfigControls\ConfigInteger.h" />
<QtMoc Include="Config\ConfigControls\ConfigRadio.h" />
<QtMoc Include="Config\ConfigControls\ConfigSlider.h" />
<QtMoc Include="Config\ControllerInterface\ControllerInterfaceWindow.h" />
<QtMoc Include="Config\ControllerInterface\DualShockUDPClientAddServerDialog.h" />
<QtMoc Include="Config\ControllerInterface\DualShockUDPClientWidget.h" />
@ -275,12 +279,6 @@
<QtMoc Include="Config\Graphics\AdvancedWidget.h" />
<QtMoc Include="Config\Graphics\EnhancementsWidget.h" />
<QtMoc Include="Config\Graphics\GeneralWidget.h" />
<QtMoc Include="Config\Graphics\GraphicsBool.h" />
<QtMoc Include="Config\Graphics\GraphicsChoice.h" />
<QtMoc Include="Config\Graphics\GraphicsInteger.h" />
<QtMoc Include="Config\Graphics\GraphicsRadio.h" />
<QtMoc Include="Config\Graphics\GraphicsSlider.h" />
<QtMoc Include="Config\Graphics\GraphicsWidget.h" />
<QtMoc Include="Config\Graphics\GraphicsWindow.h" />
<QtMoc Include="Config\Graphics\HacksWidget.h" />
<QtMoc Include="Config\Graphics\PostProcessingConfigWindow.h" />
@ -355,6 +353,7 @@
<QtMoc Include="GCMemcardManager.h" />
<QtMoc Include="Host.h" />
<QtMoc Include="HotkeyScheduler.h" />
<QtMoc Include="InfinityBase/InfinityBaseWindow.h" />
<QtMoc Include="MainWindow.h" />
<QtMoc Include="MenuBar.h" />
<QtMoc Include="NetPlay\ChunkedProgressDialog.h" />
@ -446,6 +445,8 @@
<ImportGroup Label="ExtensionTargets" />
<!--Copy Exe, Data directory and DLLs which should be located in the executable directory-->
<ItemGroup>
<DataSysFiles Include="$(DolphinRootDir)Data\**\Extras\**\*.*" />
<DataSysFiles Include="$(DolphinRootDir)Data\**\Games\**\*.*" />
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
<DataUserFiles Include="$(DolphinRootDir)Data\**\Updater\**\*.*" />
<DataUserFiles Include="$(DolphinRootDir)Data\**\User\**\*.*" />

View file

@ -514,12 +514,7 @@ void GBAWidget::mouseMoveEvent(QMouseEvent* event)
{
if (!m_moving)
return;
auto event_pos =
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
event->globalPosition().toPoint();
#else
event->globalPos();
#endif
auto event_pos = event->globalPosition().toPoint();
move(event_pos - m_move_pos - (geometry().topLeft() - pos()));
}

View file

@ -62,13 +62,13 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
{
case Column::Platform:
if (role == Qt::DecorationRole)
return Resources::GetPlatform(game.GetPlatform());
return Resources::GetPlatform(game.GetPlatform()).pixmap(32, 32);
if (role == SORT_ROLE)
return static_cast<int>(game.GetPlatform());
break;
case Column::Country:
if (role == Qt::DecorationRole)
return Resources::GetCountry(game.GetCountry());
return Resources::GetCountry(game.GetCountry()).pixmap(32, 22);
if (role == SORT_ROLE)
return static_cast<int>(game.GetCountry());
break;
@ -78,7 +78,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
// GameCube banners are 96x32, but Wii banners are 192x64.
QPixmap banner = ToQPixmap(game.GetBannerImage());
if (banner.isNull())
banner = Resources::GetMisc(Resources::MiscID::BannerMissing);
banner = Resources::GetMisc(Resources::MiscID::BannerMissing).pixmap(GAMECUBE_BANNER_SIZE);
banner.setDevicePixelRatio(
std::max(static_cast<qreal>(banner.width()) / GAMECUBE_BANNER_SIZE.width(),

View file

@ -0,0 +1,321 @@
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/InfinityBase/InfinityBaseWindow.h"
#include <QCheckBox>
#include <QComboBox>
#include <QCompleter>
#include <QDialogButtonBox>
#include <QGroupBox>
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
#include <QPushButton>
#include <QScrollArea>
#include <QString>
#include <QVBoxLayout>
#include "Common/IOFile.h"
#include "Core/Config/MainSettings.h"
#include "Core/System.h"
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
#include "DolphinQt/Settings.h"
// Qt is not guaranteed to keep track of file paths using native file pickers, so we use this
// static variable to ensure we open at the most recent figure file location
static QString s_last_figure_path;
InfinityBaseWindow::InfinityBaseWindow(QWidget* parent) : QWidget(parent)
{
setWindowTitle(tr("Infinity Manager"));
setObjectName(QStringLiteral("infinity_manager"));
setMinimumSize(QSize(700, 200));
CreateMainWindow();
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
&InfinityBaseWindow::OnEmulationStateChanged);
installEventFilter(this);
OnEmulationStateChanged(Core::GetState());
};
InfinityBaseWindow::~InfinityBaseWindow() = default;
void InfinityBaseWindow::CreateMainWindow()
{
auto* main_layout = new QVBoxLayout();
auto* checkbox_group = new QGroupBox();
auto* checkbox_layout = new QHBoxLayout();
checkbox_layout->setAlignment(Qt::AlignHCenter);
m_checkbox = new QCheckBox(tr("Emulate Infinity Base"), this);
m_checkbox->setChecked(Config::Get(Config::MAIN_EMULATE_INFINITY_BASE));
connect(m_checkbox, &QCheckBox::toggled, [=](bool checked) { EmulateBase(checked); });
checkbox_layout->addWidget(m_checkbox);
checkbox_group->setLayout(checkbox_layout);
main_layout->addWidget(checkbox_group);
auto add_line = [](QVBoxLayout* vbox) {
auto* line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vbox->addWidget(line);
};
m_group_figures = new QGroupBox(tr("Active Infinity Figures:"));
auto* vbox_group = new QVBoxLayout();
auto* scroll_area = new QScrollArea();
AddFigureSlot(vbox_group, QString(tr("Play Set/Power Disc")), 0);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player One")), 1);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player One Ability One")), 3);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player One Ability Two")), 5);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player Two")), 2);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player Two Ability One")), 4);
add_line(vbox_group);
AddFigureSlot(vbox_group, QString(tr("Player Two Ability Two")), 6);
m_group_figures->setLayout(vbox_group);
scroll_area->setWidget(m_group_figures);
scroll_area->setWidgetResizable(true);
m_group_figures->setVisible(Config::Get(Config::MAIN_EMULATE_INFINITY_BASE));
main_layout->addWidget(scroll_area);
setLayout(main_layout);
}
void InfinityBaseWindow::AddFigureSlot(QVBoxLayout* vbox_group, QString name, u8 slot)
{
auto* hbox_infinity = new QHBoxLayout();
auto* label_skyname = new QLabel(name);
auto* clear_btn = new QPushButton(tr("Clear"));
auto* create_btn = new QPushButton(tr("Create"));
auto* load_btn = new QPushButton(tr("Load"));
m_edit_figures[slot] = new QLineEdit();
m_edit_figures[slot]->setEnabled(false);
m_edit_figures[slot]->setText(tr("None"));
connect(clear_btn, &QAbstractButton::clicked, this, [this, slot] { ClearFigure(slot); });
connect(create_btn, &QAbstractButton::clicked, this, [this, slot] { CreateFigure(slot); });
connect(load_btn, &QAbstractButton::clicked, this, [this, slot] { LoadFigure(slot); });
hbox_infinity->addWidget(label_skyname);
hbox_infinity->addWidget(m_edit_figures[slot]);
hbox_infinity->addWidget(clear_btn);
hbox_infinity->addWidget(create_btn);
hbox_infinity->addWidget(load_btn);
vbox_group->addLayout(hbox_infinity);
}
void InfinityBaseWindow::ClearFigure(u8 slot)
{
auto& system = Core::System::GetInstance();
m_edit_figures[slot]->setText(tr("None"));
system.GetInfinityBase().RemoveFigure(slot);
}
void InfinityBaseWindow::LoadFigure(u8 slot)
{
const QString file_path =
DolphinFileDialog::getOpenFileName(this, tr("Select Figure File"), s_last_figure_path,
QStringLiteral("Infinity Figure (*.bin);;"));
if (file_path.isEmpty())
{
return;
}
s_last_figure_path = QFileInfo(file_path).absolutePath() + QLatin1Char('/');
m_edit_figures[slot]->setText(QFileInfo(file_path).fileName());
LoadFigurePath(slot, file_path);
}
void InfinityBaseWindow::CreateFigure(u8 slot)
{
CreateFigureDialog create_dlg(this, slot);
if (create_dlg.exec() == CreateFigureDialog::Accepted)
{
LoadFigurePath(slot, create_dlg.GetFilePath());
}
}
void InfinityBaseWindow::LoadFigurePath(u8 slot, const QString& path)
{
File::IOFile inf_file(path.toStdString(), "r+b");
if (!inf_file)
{
QMessageBox::warning(
this, tr("Failed to open the Infinity file!"),
tr("Failed to open the Infinity file(%1)!\nFile may already be in use on the base.")
.arg(path),
QMessageBox::Ok);
return;
}
std::array<u8, IOS::HLE::USB::INFINITY_NUM_BLOCKS * IOS::HLE::USB::INFINITY_BLOCK_SIZE> file_data;
if (!inf_file.ReadBytes(file_data.data(), file_data.size()))
{
QMessageBox::warning(this, tr("Failed to read the Infinity file!"),
tr("Failed to read the Infinity file(%1)!\nFile was too small.").arg(path),
QMessageBox::Ok);
return;
}
auto& system = Core::System::GetInstance();
system.GetInfinityBase().RemoveFigure(slot);
m_edit_figures[slot]->setText(QString::fromStdString(
system.GetInfinityBase().LoadFigure(file_data, std::move(inf_file), slot)));
}
CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(parent)
{
setWindowTitle(tr("Infinity Figure Creator"));
setObjectName(QStringLiteral("infinity_creator"));
setMinimumSize(QSize(500, 150));
auto* layout = new QVBoxLayout;
auto* combo_figlist = new QComboBox();
QStringList filterlist;
u32 first_entry = 0;
for (const auto& entry : Core::System::GetInstance().GetInfinityBase().GetFigureList())
{
const auto figure = entry.second;
// Only display entry if it is a piece appropriate for the slot
if ((slot == 0 &&
((figure > 0x1E8480 && figure < 0x2DC6BF) || (figure > 0x3D0900 && figure < 0x4C4B3F))) ||
((slot == 1 || slot == 2) && figure < 0x1E847F) ||
((slot == 3 || slot == 4 || slot == 5 || slot == 6) &&
(figure > 0x2DC6C0 && figure < 0x3D08FF)))
{
combo_figlist->addItem(QString::fromStdString(entry.first), QVariant(figure));
filterlist << QString::fromStdString(entry.first);
if (first_entry == 0)
{
first_entry = figure;
}
}
}
combo_figlist->addItem(tr("--Unknown--"), QVariant(0xFFFF));
combo_figlist->setEditable(true);
combo_figlist->setInsertPolicy(QComboBox::NoInsert);
auto* co_compl = new QCompleter(filterlist, this);
co_compl->setCaseSensitivity(Qt::CaseInsensitive);
co_compl->setCompletionMode(QCompleter::PopupCompletion);
co_compl->setFilterMode(Qt::MatchContains);
combo_figlist->setCompleter(co_compl);
layout->addWidget(combo_figlist);
auto* line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
layout->addWidget(line);
auto* hbox_idvar = new QHBoxLayout();
auto* label_id = new QLabel(tr("Figure Number:"));
auto* edit_num = new QLineEdit(QString::fromStdString(std::to_string(first_entry)));
auto* rxv = new QRegularExpressionValidator(QRegularExpression(QStringLiteral("\\d*")), this);
edit_num->setValidator(rxv);
hbox_idvar->addWidget(label_id);
hbox_idvar->addWidget(edit_num);
layout->addLayout(hbox_idvar);
auto* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
buttons->button(QDialogButtonBox::Ok)->setText(tr("Create"));
layout->addWidget(buttons);
setLayout(layout);
connect(combo_figlist, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](int index) {
const u32 char_info = combo_figlist->itemData(index).toUInt();
if (char_info != 0xFFFFFFFF)
{
edit_num->setText(QString::number(char_info));
}
});
connect(buttons, &QDialogButtonBox::accepted, this, [=, this]() {
bool ok_char = false;
const u32 char_number = edit_num->text().toULong(&ok_char);
if (!ok_char)
{
QMessageBox::warning(this, tr("Error converting value"), tr("Character entered is invalid!"),
QMessageBox::Ok);
return;
}
QString predef_name = s_last_figure_path;
auto& system = Core::System::GetInstance();
const auto found_fig = system.GetInfinityBase().FindFigure(char_number);
if (!found_fig.empty())
{
predef_name += QString::fromStdString(std::string(found_fig) + ".bin");
}
else
{
QString str = tr("Unknown(%1).bin");
predef_name += str.arg(char_number);
}
m_file_path = DolphinFileDialog::getSaveFileName(this, tr("Create Infinity File"), predef_name,
tr("Infinity Object (*.bin);;"));
if (m_file_path.isEmpty())
{
return;
}
if (!system.GetInfinityBase().CreateFigure(m_file_path.toStdString(), char_number))
{
QMessageBox::warning(
this, tr("Failed to create Infinity file"),
tr("Blank figure creation failed at:\n%1, try again with a different character")
.arg(m_file_path),
QMessageBox::Ok);
return;
}
s_last_figure_path = QFileInfo(m_file_path).absolutePath() + QLatin1Char('/');
accept();
});
connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(co_compl, QOverload<const QString&>::of(&QCompleter::activated),
[=](const QString& text) {
combo_figlist->setCurrentText(text);
combo_figlist->setCurrentIndex(combo_figlist->findText(text));
});
}
QString CreateFigureDialog::GetFilePath() const
{
return m_file_path;
}
void InfinityBaseWindow::EmulateBase(bool emulate)
{
Config::SetBaseOrCurrent(Config::MAIN_EMULATE_INFINITY_BASE, emulate);
m_group_figures->setVisible(emulate);
}
void InfinityBaseWindow::OnEmulationStateChanged(Core::State state)
{
const bool running = state != Core::State::Uninitialized;
m_checkbox->setEnabled(!running);
}

View file

@ -0,0 +1,52 @@
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <array>
#include <string>
#include <QDialog>
#include <QVBoxLayout>
#include <QWidget>
#include "Core/Core.h"
#include "Core/IOS/USB/Emulated/Infinity.h"
class QCheckBox;
class QGroupBox;
class QLineEdit;
class InfinityBaseWindow : public QWidget
{
Q_OBJECT
public:
explicit InfinityBaseWindow(QWidget* parent = nullptr);
~InfinityBaseWindow() override;
protected:
std::array<QLineEdit*, 7> m_edit_figures;
private:
void CreateMainWindow();
void AddFigureSlot(QVBoxLayout* vbox_group, QString name, u8 slot);
void OnEmulationStateChanged(Core::State state);
void EmulateBase(bool emulate);
void ClearFigure(u8 slot);
void LoadFigure(u8 slot);
void CreateFigure(u8 slot);
void LoadFigurePath(u8 slot, const QString& path);
QCheckBox* m_checkbox;
QGroupBox* m_group_figures;
};
class CreateFigureDialog : public QDialog
{
Q_OBJECT
public:
explicit CreateFigureDialog(QWidget* parent, u8 slot);
QString GetFilePath() const;
protected:
QString m_file_path;
};

View file

@ -149,10 +149,6 @@ int main(int argc, char* argv[])
#endif
#endif
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
const std::vector<std::string> args = parser->args();
// setHighDpiScaleFactorRoundingPolicy was added in 5.14, but default behavior changed in 6.0
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
// Set to the previous default behavior
@ -166,11 +162,12 @@ int main(int argc, char* argv[])
QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org"));
QCoreApplication::setApplicationName(QStringLiteral("dolphin-emu"));
#ifdef _WIN32
QApplication app(__argc, __argv);
#else
// QApplication will parse arguments and remove any it recognizes as targeting Qt
QApplication app(argc, argv);
#endif
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::IncludeGUIOptions);
const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv);
const std::vector<std::string> args = parser->args();
#ifdef _WIN32
FreeConsole();
@ -313,7 +310,7 @@ int main(int argc, char* argv[])
#ifdef _WIN32
int WINAPI wWinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int)
{
std::vector<std::string> args = CommandLineToUtf8Argv(GetCommandLineW());
std::vector<std::string> args = Common::CommandLineToUtf8Argv(GetCommandLineW());
const int argc = static_cast<int>(args.size());
std::vector<char*> argv(args.size());
for (size_t i = 0; i < args.size(); ++i)

View file

@ -14,6 +14,7 @@
#include <QIcon>
#include <QMimeData>
#include <QStackedWidget>
#include <QStyleHints>
#include <QVBoxLayout>
#include <QWindow>
@ -94,6 +95,7 @@
#include "DolphinQt/GameList/GameList.h"
#include "DolphinQt/Host.h"
#include "DolphinQt/HotkeyScheduler.h"
#include "DolphinQt/InfinityBase/InfinityBaseWindow.h"
#include "DolphinQt/MenuBar.h"
#include "DolphinQt/NKitWarningDialog.h"
#include "DolphinQt/NetPlay/NetPlayBrowser.h"
@ -238,6 +240,13 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
ConnectMenuBar();
ConnectHotkeys();
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this,
[](Qt::ColorScheme colorScheme) {
Settings::Instance().SetCurrentUserStyle(Settings::Instance().GetCurrentUserStyle());
});
#endif
connect(m_cheats_manager, &CheatsManager::OpenGeneralSettings, this,
&MainWindow::ShowGeneralWindow);
@ -530,6 +539,7 @@ void MainWindow::ConnectMenuBar()
connect(m_menu_bar, &MenuBar::BootWiiSystemMenu, this, &MainWindow::BootWiiSystemMenu);
connect(m_menu_bar, &MenuBar::ShowFIFOPlayer, this, &MainWindow::ShowFIFOPlayer);
connect(m_menu_bar, &MenuBar::ShowSkylanderPortal, this, &MainWindow::ShowSkylanderPortal);
connect(m_menu_bar, &MenuBar::ShowInfinityBase, this, &MainWindow::ShowInfinityBase);
connect(m_menu_bar, &MenuBar::ConnectWiiRemote, this, &MainWindow::OnConnectWiiRemote);
// Movie
@ -1378,10 +1388,8 @@ void MainWindow::ShowGraphicsWindow()
"display", windowHandle())),
winId());
}
m_graphics_window = new GraphicsWindow(m_xrr_config.get(), this);
#else
m_graphics_window = new GraphicsWindow(nullptr, this);
#endif
m_graphics_window = new GraphicsWindow(this);
InstallHotkeyFilter(m_graphics_window);
}
@ -1423,7 +1431,7 @@ void MainWindow::ShowSkylanderPortal()
{
if (!m_skylander_window)
{
m_skylander_window = new SkylanderPortalWindow;
m_skylander_window = new SkylanderPortalWindow();
}
m_skylander_window->show();
@ -1431,12 +1439,25 @@ void MainWindow::ShowSkylanderPortal()
m_skylander_window->activateWindow();
}
void MainWindow::ShowInfinityBase()
{
if (!m_infinity_window)
{
m_infinity_window = new InfinityBaseWindow();
}
m_infinity_window->show();
m_infinity_window->raise();
m_infinity_window->activateWindow();
}
void MainWindow::StateLoad()
{
QString path =
DolphinFileDialog::getOpenFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::LoadAs(path.toStdString());
if (!path.isEmpty())
State::LoadAs(path.toStdString());
}
void MainWindow::StateSave()
@ -1444,7 +1465,8 @@ void MainWindow::StateSave()
QString path =
DolphinFileDialog::getSaveFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::SaveAs(path.toStdString());
if (!path.isEmpty())
State::SaveAs(path.toStdString());
}
void MainWindow::StateLoadSlot()

View file

@ -30,6 +30,7 @@ class GBATASInputWindow;
class GCTASInputWindow;
class GraphicsWindow;
class HotkeyScheduler;
class InfinityBaseWindow;
class JITWidget;
class LogConfigWidget;
class LogWidget;
@ -162,6 +163,7 @@ private:
void ShowNetPlayBrowser();
void ShowFIFOPlayer();
void ShowSkylanderPortal();
void ShowInfinityBase();
void ShowMemcardManager();
void ShowResourcePackManager();
void ShowCheatsManager();
@ -226,6 +228,7 @@ private:
GraphicsWindow* m_graphics_window = nullptr;
FIFOPlayerWindow* m_fifo_window = nullptr;
SkylanderPortalWindow* m_skylander_window = nullptr;
InfinityBaseWindow* m_infinity_window = nullptr;
MappingWindow* m_hotkey_window = nullptr;
FreeLookWindow* m_freelook_window = nullptr;

View file

@ -192,7 +192,11 @@ void MenuBar::OnDebugModeToggled(bool enabled)
void MenuBar::AddFileMenu()
{
QMenu* file_menu = addMenu(tr("&File"));
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
m_open_action = file_menu->addAction(tr("&Open..."), QKeySequence::Open, this, &MenuBar::Open);
#else
m_open_action = file_menu->addAction(tr("&Open..."), this, &MenuBar::Open, QKeySequence::Open);
#endif
file_menu->addSeparator();
@ -221,7 +225,10 @@ void MenuBar::AddToolsMenu()
tools_menu->addAction(tr("FIFO Player"), this, &MenuBar::ShowFIFOPlayer);
tools_menu->addAction(tr("&Skylanders Portal"), this, &MenuBar::ShowSkylanderPortal);
auto* usb_device_menu = new QMenu(tr("Emulated USB Devices"), tools_menu);
usb_device_menu->addAction(tr("&Skylanders Portal"), this, &MenuBar::ShowSkylanderPortal);
usb_device_menu->addAction(tr("&Infinity Base"), this, &MenuBar::ShowInfinityBase);
tools_menu->addMenu(usb_device_menu);
tools_menu->addSeparator();
@ -497,14 +504,23 @@ void MenuBar::AddViewMenu()
connect(&Settings::Instance(), &Settings::GameListRefreshStarted, purge_action,
[purge_action] { purge_action->setEnabled(true); });
view_menu->addSeparator();
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
view_menu->addAction(tr("Search"), QKeySequence::Find, this, &MenuBar::ShowSearch);
#else
view_menu->addAction(tr("Search"), this, &MenuBar::ShowSearch, QKeySequence::Find);
#endif
}
void MenuBar::AddOptionsMenu()
{
QMenu* options_menu = addMenu(tr("&Options"));
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
options_menu->addAction(tr("Co&nfiguration"), QKeySequence::Preferences, this,
&MenuBar::Configure);
#else
options_menu->addAction(tr("Co&nfiguration"), this, &MenuBar::Configure,
QKeySequence::Preferences);
#endif
options_menu->addSeparator();
options_menu->addAction(tr("&Graphics Settings"), this, &MenuBar::ConfigureGraphics);
options_menu->addAction(tr("&Audio Settings"), this, &MenuBar::ConfigureAudio);
@ -974,7 +990,7 @@ void MenuBar::UpdateToolsMenu(bool emulation_started)
if (!emulation_started)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
const auto tmd = ios.GetESCore().FindInstalledTMD(Titles::SYSTEM_MENU);
const QString sysmenu_version =
tmd.IsValid() ? QString::fromStdString(

View file

@ -90,6 +90,7 @@ signals:
void ShowCheatsManager();
void ShowResourcePackManager();
void ShowSkylanderPortal();
void ShowInfinityBase();
void ConnectWiiRemote(int id);
// Options

View file

@ -65,7 +65,7 @@
namespace
{
QString InetAddressToString(const TraversalInetAddress& addr)
QString InetAddressToString(const Common::TraversalInetAddress& addr)
{
QString ip;
@ -327,7 +327,7 @@ void NetPlayDialog::ConnectWidgets()
&NetPlayDialog::UpdateGUI);
connect(m_hostcode_action_button, &QPushButton::clicked, [this] {
if (m_is_copy_button_retry)
g_TraversalClient->ReconnectToServer();
Common::g_TraversalClient->ReconnectToServer();
else
QApplication::clipboard()->setText(m_hostcode_label->text());
});
@ -587,9 +587,9 @@ void NetPlayDialog::UpdateDiscordPresence()
if (IsHosting())
{
if (g_TraversalClient)
if (Common::g_TraversalClient)
{
const auto host_id = g_TraversalClient->GetHostID();
const auto host_id = Common::g_TraversalClient->GetHostID();
if (host_id[0] == '\0')
return use_default();
@ -712,26 +712,27 @@ void NetPlayDialog::UpdateGUI()
}
else if (m_use_traversal)
{
switch (g_TraversalClient->GetState())
switch (Common::g_TraversalClient->GetState())
{
case TraversalClient::State::Connecting:
case Common::TraversalClient::State::Connecting:
m_hostcode_label->setText(tr("Connecting"));
m_hostcode_action_button->setEnabled(false);
m_hostcode_action_button->setText(tr("..."));
break;
case TraversalClient::State::Connected:
case Common::TraversalClient::State::Connected:
{
if (m_room_box->currentIndex() == 0)
{
// Display Room ID.
const auto host_id = g_TraversalClient->GetHostID();
const auto host_id = Common::g_TraversalClient->GetHostID();
m_hostcode_label->setText(
QString::fromStdString(std::string(host_id.begin(), host_id.end())));
}
else
{
// Externally mapped IP and port are known when using the traversal server.
m_hostcode_label->setText(InetAddressToString(g_TraversalClient->GetExternalAddress()));
m_hostcode_label->setText(
InetAddressToString(Common::g_TraversalClient->GetExternalAddress()));
}
m_hostcode_action_button->setEnabled(true);
@ -739,7 +740,7 @@ void NetPlayDialog::UpdateGUI()
m_is_copy_button_retry = false;
break;
}
case TraversalClient::State::Failure:
case Common::TraversalClient::State::Failure:
m_hostcode_label->setText(tr("Error"));
m_hostcode_action_button->setText(tr("Retry"));
m_hostcode_action_button->setEnabled(true);
@ -987,35 +988,35 @@ void NetPlayDialog::OnConnectionError(const std::string& message)
});
}
void NetPlayDialog::OnTraversalError(TraversalClient::FailureReason error)
void NetPlayDialog::OnTraversalError(Common::TraversalClient::FailureReason error)
{
QueueOnObject(this, [this, error] {
switch (error)
{
case TraversalClient::FailureReason::BadHost:
case Common::TraversalClient::FailureReason::BadHost:
ModalMessageBox::critical(this, tr("Traversal Error"), tr("Couldn't look up central server"));
QDialog::reject();
break;
case TraversalClient::FailureReason::VersionTooOld:
case Common::TraversalClient::FailureReason::VersionTooOld:
ModalMessageBox::critical(this, tr("Traversal Error"),
tr("Dolphin is too old for traversal server"));
QDialog::reject();
break;
case TraversalClient::FailureReason::ServerForgotAboutUs:
case TraversalClient::FailureReason::SocketSendError:
case TraversalClient::FailureReason::ResendTimeout:
case Common::TraversalClient::FailureReason::ServerForgotAboutUs:
case Common::TraversalClient::FailureReason::SocketSendError:
case Common::TraversalClient::FailureReason::ResendTimeout:
UpdateGUI();
break;
}
});
}
void NetPlayDialog::OnTraversalStateChanged(TraversalClient::State state)
void NetPlayDialog::OnTraversalStateChanged(Common::TraversalClient::State state)
{
switch (state)
{
case TraversalClient::State::Connected:
case TraversalClient::State::Failure:
case Common::TraversalClient::State::Connected:
case Common::TraversalClient::State::Failure:
UpdateDiscordPresence();
break;
default:

View file

@ -67,8 +67,8 @@ public:
void OnDesync(u32 frame, const std::string& player) override;
void OnConnectionLost() override;
void OnConnectionError(const std::string& message) override;
void OnTraversalError(TraversalClient::FailureReason error) override;
void OnTraversalStateChanged(TraversalClient::State state) override;
void OnTraversalError(Common::TraversalClient::FailureReason error) override;
void OnTraversalStateChanged(Common::TraversalClient::State state) override;
void OnGameStartAborted() override;
void OnGolferChanged(bool is_golfer, const std::string& golfer_name) override;

View file

@ -1,93 +0,0 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/QtUtils/WinIconHelper.h"
#ifdef _WIN32
#include <Windows.h>
// The following code is adapted from qpixmap_win.cpp (c) The Qt Company Ltd. (https://qt.io)
// Licensed under the GNU GPL v3
static inline BITMAPINFO GetBMI(int width, int height, bool topToBottom)
{
BITMAPINFO bmi = {};
auto& bih = bmi.bmiHeader;
bih.biSize = sizeof(BITMAPINFOHEADER);
bih.biWidth = width;
bih.biHeight = topToBottom ? -height : height;
bih.biPlanes = 1;
bih.biBitCount = 32;
bih.biCompression = BI_RGB;
bih.biSizeImage = width * height * 4;
return bmi;
}
static QPixmap PixmapFromHICON(HICON icon)
{
HDC screenDevice = GetDC(0);
HDC hdc = CreateCompatibleDC(screenDevice);
ReleaseDC(0, screenDevice);
ICONINFO iconinfo;
const bool result = GetIconInfo(icon, &iconinfo); // x and y Hotspot describes the icon center
if (!result)
{
qErrnoWarning("QPixmap::fromWinHICON(), failed to GetIconInfo()");
DeleteDC(hdc);
return QPixmap();
}
const int w = iconinfo.xHotspot * 2;
const int h = iconinfo.yHotspot * 2;
BITMAPINFO bitmapInfo = GetBMI(w, h, false);
DWORD* bits;
HBITMAP winBitmap = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, (VOID**)&bits, nullptr, 0);
HGDIOBJ oldhdc = reinterpret_cast<HBITMAP>(SelectObject(hdc, winBitmap));
DrawIconEx(hdc, 0, 0, icon, iconinfo.xHotspot * 2, iconinfo.yHotspot * 2, 0, 0, DI_NORMAL);
QImage image(w, h, QImage::Format_ARGB32_Premultiplied);
if (image.isNull())
return {};
BITMAPINFO bmi = GetBMI(w, h, true);
QScopedArrayPointer<uchar> data(new uchar[bmi.bmiHeader.biSizeImage]);
if (!GetDIBits(hdc, winBitmap, 0, h, data.data(), &bmi, DIB_RGB_COLORS))
return {};
for (int y = 0; y < image.height(); ++y)
{
void* dest = static_cast<void*>(image.scanLine(y));
const void* src = data.data() + y * image.bytesPerLine();
memcpy(dest, src, image.bytesPerLine());
}
// dispose resources created by iconinfo call
DeleteObject(iconinfo.hbmMask);
DeleteObject(iconinfo.hbmColor);
SelectObject(hdc, oldhdc); // restore state
DeleteObject(winBitmap);
DeleteDC(hdc);
return QPixmap::fromImage(image);
}
QIcon WinIconHelper::GetNativeIcon()
{
QIcon icon;
for (int size : {16, 32, 48, 256})
{
HANDLE h = LoadImageW(GetModuleHandleW(nullptr), L"\"DOLPHIN\"", IMAGE_ICON, size, size,
LR_CREATEDIBSECTION);
if (h && h != INVALID_HANDLE_VALUE)
{
auto* icon_handle = static_cast<HICON>(h);
icon.addPixmap(PixmapFromHICON(icon_handle));
}
}
return icon;
}
#endif

View file

@ -1,15 +0,0 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#ifdef _WIN32
#include <QIcon>
namespace WinIconHelper
{
QIcon GetNativeIcon();
};
#endif

View file

@ -3,53 +3,58 @@
#include "DolphinQt/Resources.h"
#include <QGuiApplication>
#include <QFileInfo>
#include <QIcon>
#include <QImageReader>
#include <QPixmap>
#include <QScreen>
#include "Common/Assert.h"
#include "Common/FileUtil.h"
#include "Core/Config/MainSettings.h"
#include "DolphinQt/Settings.h"
#ifdef _WIN32
#include "DolphinQt/QtUtils/WinIconHelper.h"
#endif
bool Resources::m_svg_supported;
QList<QIcon> Resources::m_platforms;
QList<QIcon> Resources::m_countries;
QList<QIcon> Resources::m_misc;
QList<QPixmap> Resources::m_platforms;
QList<QPixmap> Resources::m_countries;
QList<QPixmap> Resources::m_misc;
QIcon Resources::GetIcon(std::string_view name, const QString& dir)
QIcon Resources::LoadNamedIcon(std::string_view name, const QString& dir)
{
QString name_owned = QString::fromLatin1(name.data(), static_cast<int>(name.size()));
QString base_path = dir + QLatin1Char{'/'} + name_owned;
const QString base_path = dir + QLatin1Char{'/'} + QString::fromLatin1(name);
const QString svg_path = base_path + QStringLiteral(".svg");
const auto dpr = QGuiApplication::primaryScreen()->devicePixelRatio();
// Prefer svg
if (m_svg_supported && QFileInfo(svg_path).exists())
return QIcon(svg_path);
QIcon icon(base_path.append(QStringLiteral(".png")));
QIcon icon;
if (dpr > 2)
{
QPixmap pixmap(base_path.append(QStringLiteral("@4x.png")));
auto load_png = [&](int scale) {
QString suffix = QStringLiteral(".png");
if (scale > 1)
suffix = QString::fromLatin1("@%1x.png").arg(scale);
QPixmap pixmap(base_path + suffix);
if (!pixmap.isNull())
{
pixmap.setDevicePixelRatio(4.0);
pixmap.setDevicePixelRatio(scale);
icon.addPixmap(pixmap);
}
}
};
// Since we are caching the files, we need to try and load all known sizes up-front.
// Otherwise, a dynamic change of devicePixelRatio could result in use of non-ideal image from
// cache while a better one exists on disk.
for (auto scale : {1, 2, 4})
load_png(scale);
// ASSERT(icon.availableSizes().size() > 0);
return icon;
}
QPixmap Resources::GetPixmap(std::string_view name, const QString& dir)
{
const auto icon = GetIcon(name, dir);
return icon.pixmap(icon.availableSizes()[0]);
}
static QString GetCurrentThemeDir()
{
return QString::fromStdString(File::GetThemeDir(Config::Get(Config::MAIN_THEME_NAME)));
@ -60,27 +65,24 @@ static QString GetResourcesDir()
return QString::fromStdString(File::GetSysDirectory() + "Resources");
}
QIcon Resources::GetScaledIcon(std::string_view name)
QIcon Resources::GetResourceIcon(std::string_view name)
{
return GetIcon(name, GetResourcesDir());
return LoadNamedIcon(name, GetResourcesDir());
}
QIcon Resources::GetScaledThemeIcon(std::string_view name)
QIcon Resources::GetThemeIcon(std::string_view name)
{
return GetIcon(name, GetCurrentThemeDir());
}
QPixmap Resources::GetScaledPixmap(std::string_view name)
{
return GetPixmap(name, GetResourcesDir());
return LoadNamedIcon(name, GetCurrentThemeDir());
}
void Resources::Init()
{
m_svg_supported = QImageReader::supportedImageFormats().contains("svg");
for (std::string_view platform :
{"Platform_Gamecube", "Platform_Wii", "Platform_Wad", "Platform_File"})
{
m_platforms.append(GetScaledPixmap(platform));
m_platforms.append(GetResourceIcon(platform));
}
for (std::string_view country :
@ -88,39 +90,29 @@ void Resources::Init()
"Flag_Italy", "Flag_Korea", "Flag_Netherlands", "Flag_Russia", "Flag_Spain", "Flag_Taiwan",
"Flag_International", "Flag_Unknown"})
{
m_countries.append(GetScaledPixmap(country));
m_countries.append(GetResourceIcon(country));
}
m_misc.append(GetScaledPixmap("nobanner"));
m_misc.append(GetScaledPixmap("dolphin_logo"));
m_misc.append(GetScaledPixmap("Dolphin"));
m_misc.append(GetResourceIcon("nobanner"));
m_misc.append(GetResourceIcon("dolphin_logo"));
}
QPixmap Resources::GetPlatform(DiscIO::Platform platform)
QIcon Resources::GetPlatform(DiscIO::Platform platform)
{
return m_platforms[static_cast<int>(platform)];
}
QPixmap Resources::GetCountry(DiscIO::Country country)
QIcon Resources::GetCountry(DiscIO::Country country)
{
return m_countries[static_cast<int>(country)];
}
QPixmap Resources::GetMisc(MiscID id)
QIcon Resources::GetMisc(MiscID id)
{
return m_misc[static_cast<int>(id)];
}
QIcon Resources::GetAppIcon()
{
QIcon icon;
#ifdef _WIN32
icon = WinIconHelper::GetNativeIcon();
#else
icon.addPixmap(GetScaledPixmap("dolphin_logo"));
icon.addPixmap(GetScaledPixmap("Dolphin"));
#endif
return icon;
return GetMisc(MiscID::Logo);
}

View file

@ -3,8 +3,8 @@
#pragma once
#include <QIcon>
#include <QList>
#include <QPixmap>
#include <string_view>
namespace DiscIO
@ -20,29 +20,26 @@ public:
enum class MiscID
{
BannerMissing,
LogoLarge,
LogoSmall
Logo,
};
static void Init();
static QPixmap GetPlatform(DiscIO::Platform platform);
static QPixmap GetCountry(DiscIO::Country country);
static QIcon GetPlatform(DiscIO::Platform platform);
static QIcon GetCountry(DiscIO::Country country);
static QPixmap GetMisc(MiscID id);
static QIcon GetMisc(MiscID id);
static QIcon GetScaledIcon(std::string_view name);
static QIcon GetScaledThemeIcon(std::string_view name);
static QIcon GetResourceIcon(std::string_view name);
static QIcon GetThemeIcon(std::string_view name);
static QIcon GetAppIcon();
static QPixmap GetScaledPixmap(std::string_view name);
private:
Resources() {}
static QIcon GetIcon(std::string_view name, const QString& dir);
static QPixmap GetPixmap(std::string_view name, const QString& dir);
static QIcon LoadNamedIcon(std::string_view name, const QString& dir);
static QList<QPixmap> m_platforms;
static QList<QPixmap> m_countries;
static QList<QPixmap> m_misc;
static bool m_svg_supported;
static QList<QIcon> m_platforms;
static QList<QIcon> m_countries;
static QList<QIcon> m_misc;
};

View file

@ -159,42 +159,42 @@ void ToolBar::UpdatePausePlayButtonState(const bool playing_state)
{
disconnect(m_pause_play_action, nullptr, nullptr, nullptr);
m_pause_play_action->setText(tr("Pause"));
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("pause"));
m_pause_play_action->setIcon(Resources::GetThemeIcon("pause"));
connect(m_pause_play_action, &QAction::triggered, this, &ToolBar::PausePressed);
}
else
{
disconnect(m_pause_play_action, nullptr, nullptr, nullptr);
m_pause_play_action->setText(tr("Local Play"));
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("play"));
m_pause_play_action->setIcon(Resources::GetThemeIcon("play"));
connect(m_pause_play_action, &QAction::triggered, this, &ToolBar::PlayPressed);
}
}
void ToolBar::UpdateIcons()
{
m_step_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_in"));
m_step_over_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_over"));
m_step_out_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_out"));
m_skip_action->setIcon(Resources::GetScaledThemeIcon("debugger_skip"));
m_show_pc_action->setIcon(Resources::GetScaledThemeIcon("debugger_show_pc"));
m_set_pc_action->setIcon(Resources::GetScaledThemeIcon("debugger_set_pc"));
m_step_action->setIcon(Resources::GetThemeIcon("debugger_step_in"));
m_step_over_action->setIcon(Resources::GetThemeIcon("debugger_step_over"));
m_step_out_action->setIcon(Resources::GetThemeIcon("debugger_step_out"));
m_skip_action->setIcon(Resources::GetThemeIcon("debugger_skip"));
m_show_pc_action->setIcon(Resources::GetThemeIcon("debugger_show_pc"));
m_set_pc_action->setIcon(Resources::GetThemeIcon("debugger_set_pc"));
m_open_action->setIcon(Resources::GetScaledThemeIcon("open"));
m_refresh_action->setIcon(Resources::GetScaledThemeIcon("refresh"));
m_open_action->setIcon(Resources::GetThemeIcon("open"));
m_refresh_action->setIcon(Resources::GetThemeIcon("refresh"));
const Core::State state = Core::GetState();
const bool playing = state != Core::State::Uninitialized && state != Core::State::Paused;
if (!playing)
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("play"));
m_pause_play_action->setIcon(Resources::GetThemeIcon("play"));
else
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("pause"));
m_pause_play_action->setIcon(Resources::GetThemeIcon("pause"));
m_stop_action->setIcon(Resources::GetScaledThemeIcon("stop"));
m_fullscreen_action->setIcon(Resources::GetScaledThemeIcon("fullscreen"));
m_screenshot_action->setIcon(Resources::GetScaledThemeIcon("screenshot"));
m_config_action->setIcon(Resources::GetScaledThemeIcon("config"));
m_controllers_action->setIcon(Resources::GetScaledThemeIcon("classic"));
m_graphics_action->setIcon(Resources::GetScaledThemeIcon("graphics"));
m_start_netplay_action->setIcon(Resources::GetScaledThemeIcon("wifi"));
m_stop_action->setIcon(Resources::GetThemeIcon("stop"));
m_fullscreen_action->setIcon(Resources::GetThemeIcon("fullscreen"));
m_screenshot_action->setIcon(Resources::GetThemeIcon("screenshot"));
m_config_action->setIcon(Resources::GetThemeIcon("config"));
m_controllers_action->setIcon(Resources::GetThemeIcon("classic"));
m_graphics_action->setIcon(Resources::GetThemeIcon("graphics"));
m_start_netplay_action->setIcon(Resources::GetThemeIcon("wifi"));
}