mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
Misc: Swap make_array() for size deduction
This commit is contained in:
parent
e33082778e
commit
a96111eaeb
|
@ -29,7 +29,6 @@ add_library(common
|
||||||
layered_settings_interface.h
|
layered_settings_interface.h
|
||||||
log.cpp
|
log.cpp
|
||||||
log.h
|
log.h
|
||||||
make_array.h
|
|
||||||
memmap.cpp
|
memmap.cpp
|
||||||
memmap.h
|
memmap.h
|
||||||
md5_digest.cpp
|
md5_digest.cpp
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
<ClInclude Include="layered_settings_interface.h" />
|
<ClInclude Include="layered_settings_interface.h" />
|
||||||
<ClInclude Include="log.h" />
|
<ClInclude Include="log.h" />
|
||||||
<ClInclude Include="lru_cache.h" />
|
<ClInclude Include="lru_cache.h" />
|
||||||
<ClInclude Include="make_array.h" />
|
|
||||||
<ClInclude Include="memmap.h" />
|
<ClInclude Include="memmap.h" />
|
||||||
<ClInclude Include="memory_settings_interface.h" />
|
<ClInclude Include="memory_settings_interface.h" />
|
||||||
<ClInclude Include="md5_digest.h" />
|
<ClInclude Include="md5_digest.h" />
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
<ClInclude Include="dimensional_array.h" />
|
<ClInclude Include="dimensional_array.h" />
|
||||||
<ClInclude Include="image.h" />
|
<ClInclude Include="image.h" />
|
||||||
<ClInclude Include="minizip_helpers.h" />
|
<ClInclude Include="minizip_helpers.h" />
|
||||||
<ClInclude Include="make_array.h" />
|
|
||||||
<ClInclude Include="thirdparty\StackWalker.h">
|
<ClInclude Include="thirdparty\StackWalker.h">
|
||||||
<Filter>thirdparty</Filter>
|
<Filter>thirdparty</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
|
|
||||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include <array>
|
|
||||||
#include <type_traits>
|
|
||||||
|
|
||||||
// Source: https://gist.github.com/klmr/2775736#file-make_array-hpp
|
|
||||||
|
|
||||||
template<typename... T>
|
|
||||||
constexpr auto make_array(T&&... values)
|
|
||||||
-> std::array<typename std::decay<typename std::common_type<T...>::type>::type, sizeof...(T)>
|
|
||||||
{
|
|
||||||
return {std::forward<T>(values)...};
|
|
||||||
}
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/intrin.h"
|
#include "common/intrin.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/memmap.h"
|
#include "common/memmap.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -133,9 +132,9 @@ static std::vector<std::pair<u8*, size_t>> s_fastmem_ram_views;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static u8** s_fastmem_lut = nullptr;
|
static u8** s_fastmem_lut = nullptr;
|
||||||
static constexpr auto s_fastmem_ram_mirrors =
|
static constexpr const std::array s_fastmem_ram_mirrors = {0x00000000u, 0x00200000u, 0x00400000u, 0x00600000u,
|
||||||
make_array(0x00000000u, 0x00200000u, 0x00400000u, 0x00600000u, 0x80000000u, 0x80200000u, 0x80400000u, 0x80600000u,
|
0x80000000u, 0x80200000u, 0x80400000u, 0x80600000u,
|
||||||
0xA0000000u, 0xA0200000u, 0xA0400000u, 0xA0600000u);
|
0xA0000000u, 0xA0200000u, 0xA0400000u, 0xA0600000u};
|
||||||
|
|
||||||
static void SetRAMSize(bool enable_8mb_ram);
|
static void SetRAMSize(bool enable_8mb_ram);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#include "common/error.h"
|
#include "common/error.h"
|
||||||
#include "common/file_system.h"
|
#include "common/file_system.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/path.h"
|
#include "common/path.h"
|
||||||
#include "common/small_string.h"
|
#include "common/small_string.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
|
@ -2809,7 +2808,7 @@ void FullscreenUI::DrawInterfaceSettingsPage()
|
||||||
|
|
||||||
void FullscreenUI::DrawBIOSSettingsPage()
|
void FullscreenUI::DrawBIOSSettingsPage()
|
||||||
{
|
{
|
||||||
static constexpr auto config_keys = make_array("", "PathNTSCJ", "PathNTSCU", "PathPAL");
|
static constexpr const std::array config_keys = {"", "PathNTSCJ", "PathNTSCU", "PathPAL"};
|
||||||
|
|
||||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||||
const bool game_settings = IsEditingGameSettings(bsi);
|
const bool game_settings = IsEditingGameSettings(bsi);
|
||||||
|
@ -2881,15 +2880,26 @@ void FullscreenUI::DrawBIOSSettingsPage()
|
||||||
|
|
||||||
void FullscreenUI::DrawConsoleSettingsPage()
|
void FullscreenUI::DrawConsoleSettingsPage()
|
||||||
{
|
{
|
||||||
static constexpr auto cdrom_read_speeds = make_array(
|
static constexpr const std::array cdrom_read_speeds = {
|
||||||
FSUI_NSTR("None (Double Speed)"), FSUI_NSTR("2x (Quad Speed)"), FSUI_NSTR("3x (6x Speed)"),
|
FSUI_NSTR("None (Double Speed)"), FSUI_NSTR("2x (Quad Speed)"), FSUI_NSTR("3x (6x Speed)"),
|
||||||
FSUI_NSTR("4x (8x Speed)"), FSUI_NSTR("5x (10x Speed)"), FSUI_NSTR("6x (12x Speed)"), FSUI_NSTR("7x (14x Speed)"),
|
FSUI_NSTR("4x (8x Speed)"), FSUI_NSTR("5x (10x Speed)"), FSUI_NSTR("6x (12x Speed)"),
|
||||||
FSUI_NSTR("8x (16x Speed)"), FSUI_NSTR("9x (18x Speed)"), FSUI_NSTR("10x (20x Speed)"));
|
FSUI_NSTR("7x (14x Speed)"), FSUI_NSTR("8x (16x Speed)"), FSUI_NSTR("9x (18x Speed)"),
|
||||||
|
FSUI_NSTR("10x (20x Speed)"),
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr auto cdrom_seek_speeds =
|
static constexpr const std::array cdrom_seek_speeds = {
|
||||||
make_array(FSUI_NSTR("Infinite/Instantaneous"), FSUI_NSTR("None (Normal Speed)"), FSUI_NSTR("2x"), FSUI_NSTR("3x"),
|
FSUI_NSTR("Infinite/Instantaneous"),
|
||||||
FSUI_NSTR("4x"), FSUI_NSTR("5x"), FSUI_NSTR("6x"), FSUI_NSTR("7x"), FSUI_NSTR("8x"), FSUI_NSTR("9x"),
|
FSUI_NSTR("None (Normal Speed)"),
|
||||||
FSUI_NSTR("10x"));
|
FSUI_NSTR("2x"),
|
||||||
|
FSUI_NSTR("3x"),
|
||||||
|
FSUI_NSTR("4x"),
|
||||||
|
FSUI_NSTR("5x"),
|
||||||
|
FSUI_NSTR("6x"),
|
||||||
|
FSUI_NSTR("7x"),
|
||||||
|
FSUI_NSTR("8x"),
|
||||||
|
FSUI_NSTR("9x"),
|
||||||
|
FSUI_NSTR("10x"),
|
||||||
|
};
|
||||||
|
|
||||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||||
|
|
||||||
|
@ -2972,23 +2982,38 @@ void FullscreenUI::DrawConsoleSettingsPage()
|
||||||
|
|
||||||
void FullscreenUI::DrawEmulationSettingsPage()
|
void FullscreenUI::DrawEmulationSettingsPage()
|
||||||
{
|
{
|
||||||
static constexpr auto emulation_speed_values =
|
static constexpr const std::array emulation_speed_values = {
|
||||||
make_array(0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.25f, 1.5f, 1.75f, 2.0f, 2.5f, 3.0f,
|
0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.25f, 1.5f,
|
||||||
3.5f, 4.0f, 4.5f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
|
1.75f, 2.0f, 2.5f, 3.0f, 3.5f, 4.0f, 4.5f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f,
|
||||||
static constexpr auto emulation_speed_titles =
|
};
|
||||||
make_array(FSUI_NSTR("Unlimited"), "10% [6 FPS (NTSC) / 5 FPS (PAL)]",
|
static constexpr const std::array emulation_speed_titles = {
|
||||||
FSUI_NSTR("20% [12 FPS (NTSC) / 10 FPS (PAL)]"), FSUI_NSTR("30% [18 FPS (NTSC) / 15 FPS (PAL)]"),
|
FSUI_NSTR("Unlimited"),
|
||||||
FSUI_NSTR("40% [24 FPS (NTSC) / 20 FPS (PAL)]"), FSUI_NSTR("50% [30 FPS (NTSC) / 25 FPS (PAL)]"),
|
"10% [6 FPS (NTSC) / 5 FPS (PAL)]",
|
||||||
FSUI_NSTR("60% [36 FPS (NTSC) / 30 FPS (PAL)]"), FSUI_NSTR("70% [42 FPS (NTSC) / 35 FPS (PAL)]"),
|
FSUI_NSTR("20% [12 FPS (NTSC) / 10 FPS (PAL)]"),
|
||||||
FSUI_NSTR("80% [48 FPS (NTSC) / 40 FPS (PAL)]"), FSUI_NSTR("90% [54 FPS (NTSC) / 45 FPS (PAL)]"),
|
FSUI_NSTR("30% [18 FPS (NTSC) / 15 FPS (PAL)]"),
|
||||||
FSUI_NSTR("100% [60 FPS (NTSC) / 50 FPS (PAL)]"), FSUI_NSTR("125% [75 FPS (NTSC) / 62 FPS (PAL)]"),
|
FSUI_NSTR("40% [24 FPS (NTSC) / 20 FPS (PAL)]"),
|
||||||
FSUI_NSTR("150% [90 FPS (NTSC) / 75 FPS (PAL)]"), FSUI_NSTR("175% [105 FPS (NTSC) / 87 FPS (PAL)]"),
|
FSUI_NSTR("50% [30 FPS (NTSC) / 25 FPS (PAL)]"),
|
||||||
FSUI_NSTR("200% [120 FPS (NTSC) / 100 FPS (PAL)]"), FSUI_NSTR("250% [150 FPS (NTSC) / 125 FPS (PAL)]"),
|
FSUI_NSTR("60% [36 FPS (NTSC) / 30 FPS (PAL)]"),
|
||||||
FSUI_NSTR("300% [180 FPS (NTSC) / 150 FPS (PAL)]"), FSUI_NSTR("350% [210 FPS (NTSC) / 175 FPS (PAL)]"),
|
FSUI_NSTR("70% [42 FPS (NTSC) / 35 FPS (PAL)]"),
|
||||||
FSUI_NSTR("400% [240 FPS (NTSC) / 200 FPS (PAL)]"), FSUI_NSTR("450% [270 FPS (NTSC) / 225 FPS (PAL)]"),
|
FSUI_NSTR("80% [48 FPS (NTSC) / 40 FPS (PAL)]"),
|
||||||
FSUI_NSTR("500% [300 FPS (NTSC) / 250 FPS (PAL)]"), FSUI_NSTR("600% [360 FPS (NTSC) / 300 FPS (PAL)]"),
|
FSUI_NSTR("90% [54 FPS (NTSC) / 45 FPS (PAL)]"),
|
||||||
FSUI_NSTR("700% [420 FPS (NTSC) / 350 FPS (PAL)]"), FSUI_NSTR("800% [480 FPS (NTSC) / 400 FPS (PAL)]"),
|
FSUI_NSTR("100% [60 FPS (NTSC) / 50 FPS (PAL)]"),
|
||||||
FSUI_NSTR("900% [540 FPS (NTSC) / 450 FPS (PAL)]"), FSUI_NSTR("1000% [600 FPS (NTSC) / 500 FPS (PAL)]"));
|
FSUI_NSTR("125% [75 FPS (NTSC) / 62 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("150% [90 FPS (NTSC) / 75 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("175% [105 FPS (NTSC) / 87 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("200% [120 FPS (NTSC) / 100 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("250% [150 FPS (NTSC) / 125 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("300% [180 FPS (NTSC) / 150 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("350% [210 FPS (NTSC) / 175 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("400% [240 FPS (NTSC) / 200 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("450% [270 FPS (NTSC) / 225 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("500% [300 FPS (NTSC) / 250 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("600% [360 FPS (NTSC) / 300 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("700% [420 FPS (NTSC) / 350 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("800% [480 FPS (NTSC) / 400 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("900% [540 FPS (NTSC) / 450 FPS (PAL)]"),
|
||||||
|
FSUI_NSTR("1000% [600 FPS (NTSC) / 500 FPS (PAL)]"),
|
||||||
|
};
|
||||||
|
|
||||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||||
|
|
||||||
|
@ -3029,10 +3054,10 @@ void FullscreenUI::DrawEmulationSettingsPage()
|
||||||
const bool runahead_enabled = (runahead_frames > 0);
|
const bool runahead_enabled = (runahead_frames > 0);
|
||||||
const bool rewind_enabled = GetEffectiveBoolSetting(bsi, "Main", "RewindEnable", false);
|
const bool rewind_enabled = GetEffectiveBoolSetting(bsi, "Main", "RewindEnable", false);
|
||||||
|
|
||||||
static constexpr auto runahead_options =
|
static constexpr const std::array runahead_options = {
|
||||||
make_array(FSUI_NSTR("Disabled"), FSUI_NSTR("1 Frame"), FSUI_NSTR("2 Frames"), FSUI_NSTR("3 Frames"),
|
FSUI_NSTR("Disabled"), FSUI_NSTR("1 Frame"), FSUI_NSTR("2 Frames"), FSUI_NSTR("3 Frames"),
|
||||||
FSUI_NSTR("4 Frames"), FSUI_NSTR("5 Frames"), FSUI_NSTR("6 Frames"), FSUI_NSTR("7 Frames"),
|
FSUI_NSTR("4 Frames"), FSUI_NSTR("5 Frames"), FSUI_NSTR("6 Frames"), FSUI_NSTR("7 Frames"),
|
||||||
FSUI_NSTR("8 Frames"), FSUI_NSTR("9 Frames"), FSUI_NSTR("10 Frames"));
|
FSUI_NSTR("8 Frames"), FSUI_NSTR("9 Frames"), FSUI_NSTR("10 Frames")};
|
||||||
|
|
||||||
DrawIntListSetting(
|
DrawIntListSetting(
|
||||||
bsi, FSUI_CSTR("Runahead"),
|
bsi, FSUI_CSTR("Runahead"),
|
||||||
|
@ -3529,8 +3554,8 @@ void FullscreenUI::DrawHotkeySettingsPage()
|
||||||
|
|
||||||
void FullscreenUI::DrawMemoryCardSettingsPage()
|
void FullscreenUI::DrawMemoryCardSettingsPage()
|
||||||
{
|
{
|
||||||
static constexpr const auto type_keys = make_array("Card1Type", "Card2Type");
|
static constexpr const std::array type_keys = {"Card1Type", "Card2Type"};
|
||||||
static constexpr const auto path_keys = make_array("Card1Path", "Card2Path");
|
static constexpr const std::array path_keys = {"Card1Path", "Card2Path"};
|
||||||
|
|
||||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||||
const bool game_settings = IsEditingGameSettings(bsi);
|
const bool game_settings = IsEditingGameSettings(bsi);
|
||||||
|
@ -3664,12 +3689,25 @@ void FullscreenUI::DrawMemoryCardSettingsPage()
|
||||||
|
|
||||||
void FullscreenUI::DrawDisplaySettingsPage()
|
void FullscreenUI::DrawDisplaySettingsPage()
|
||||||
{
|
{
|
||||||
// TODO: Translation context
|
static constexpr const std::array resolution_scales = {
|
||||||
static constexpr auto resolution_scales =
|
FSUI_NSTR("Automatic based on window size"),
|
||||||
make_array(FSUI_NSTR("Automatic based on window size"), FSUI_NSTR("1x"), FSUI_NSTR("2x"),
|
FSUI_NSTR("1x"),
|
||||||
FSUI_NSTR("3x (for 720p)"), FSUI_NSTR("4x"), FSUI_NSTR("5x (for 1080p)"), FSUI_NSTR("6x (for 1440p)"),
|
FSUI_NSTR("2x"),
|
||||||
FSUI_NSTR("7x"), FSUI_NSTR("8x"), FSUI_NSTR("9x (for 4K)"), FSUI_NSTR("10x"), FSUI_NSTR("11x"),
|
FSUI_NSTR("3x (for 720p)"),
|
||||||
FSUI_NSTR("12x"), FSUI_NSTR("13x"), FSUI_NSTR("14x"), FSUI_NSTR("15x"), FSUI_NSTR("16x"));
|
FSUI_NSTR("4x"),
|
||||||
|
FSUI_NSTR("5x (for 1080p)"),
|
||||||
|
FSUI_NSTR("6x (for 1440p)"),
|
||||||
|
FSUI_NSTR("7x"),
|
||||||
|
FSUI_NSTR("8x"),
|
||||||
|
FSUI_NSTR("9x (for 4K)"),
|
||||||
|
FSUI_NSTR("10x"),
|
||||||
|
FSUI_NSTR("11x"),
|
||||||
|
FSUI_NSTR("12x"),
|
||||||
|
FSUI_NSTR("13x"),
|
||||||
|
FSUI_NSTR("14x"),
|
||||||
|
FSUI_NSTR("15x"),
|
||||||
|
FSUI_NSTR("16x"),
|
||||||
|
};
|
||||||
|
|
||||||
SettingsInterface* bsi = GetEditingSettingsInterface();
|
SettingsInterface* bsi = GetEditingSettingsInterface();
|
||||||
const bool game_settings = IsEditingGameSettings(bsi);
|
const bool game_settings = IsEditingGameSettings(bsi);
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "common/heterogeneous_containers.h"
|
#include "common/heterogeneous_containers.h"
|
||||||
#include "common/http_downloader.h"
|
#include "common/http_downloader.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/path.h"
|
#include "common/path.h"
|
||||||
#include "common/progress_callback.h"
|
#include "common/progress_callback.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
|
@ -674,7 +673,7 @@ static std::string GetFullCoverPath(const std::string_view& filename, const std:
|
||||||
|
|
||||||
std::string GameList::GetCoverImagePath(const std::string& path, const std::string& serial, const std::string& title)
|
std::string GameList::GetCoverImagePath(const std::string& path, const std::string& serial, const std::string& title)
|
||||||
{
|
{
|
||||||
static constexpr auto extensions = make_array("jpg", "jpeg", "png", "webp");
|
static constexpr const std::array extensions = {"jpg", "jpeg", "png", "webp"};
|
||||||
|
|
||||||
for (const char* extension : extensions)
|
for (const char* extension : extensions)
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/intrin.h"
|
#include "common/intrin.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
@ -50,10 +49,10 @@ bool GPU_SW::Initialize()
|
||||||
if (!GPU::Initialize() || !m_backend.Initialize(false))
|
if (!GPU::Initialize() || !m_backend.Initialize(false))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
static constexpr auto formats_for_16bit = make_array(GPUTexture::Format::RGB565, GPUTexture::Format::RGBA5551,
|
static constexpr const std::array formats_for_16bit = {GPUTexture::Format::RGB565, GPUTexture::Format::RGBA5551,
|
||||||
GPUTexture::Format::RGBA8, GPUTexture::Format::BGRA8);
|
GPUTexture::Format::RGBA8, GPUTexture::Format::BGRA8};
|
||||||
static constexpr auto formats_for_24bit = make_array(GPUTexture::Format::RGBA8, GPUTexture::Format::BGRA8,
|
static constexpr const std::array formats_for_24bit = {GPUTexture::Format::RGBA8, GPUTexture::Format::BGRA8,
|
||||||
GPUTexture::Format::RGB565, GPUTexture::Format::RGBA5551);
|
GPUTexture::Format::RGB565, GPUTexture::Format::RGBA5551};
|
||||||
for (const GPUTexture::Format format : formats_for_16bit)
|
for (const GPUTexture::Format format : formats_for_16bit)
|
||||||
{
|
{
|
||||||
if (g_gpu_device->SupportsTextureFormat(format))
|
if (g_gpu_device->SupportsTextureFormat(format))
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/file_system.h"
|
#include "common/file_system.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/path.h"
|
#include "common/path.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
|
|
||||||
|
@ -743,13 +742,14 @@ void Settings::SetDefaultControllerConfig(SettingsInterface& si)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, LOGLEVEL_COUNT> s_log_level_names = {
|
static constexpr const std::array s_log_level_names = {"None", "Error", "Warning", "Perf", "Info",
|
||||||
{"None", "Error", "Warning", "Perf", "Info", "Verbose", "Dev", "Profile", "Debug", "Trace"}};
|
"Verbose", "Dev", "Profile", "Debug", "Trace"};
|
||||||
static std::array<const char*, LOGLEVEL_COUNT> s_log_level_display_names = {
|
static constexpr const std::array s_log_level_display_names = {
|
||||||
{TRANSLATE_NOOP("LogLevel", "None"), TRANSLATE_NOOP("LogLevel", "Error"), TRANSLATE_NOOP("LogLevel", "Warning"),
|
TRANSLATE_NOOP("LogLevel", "None"), TRANSLATE_NOOP("LogLevel", "Error"),
|
||||||
TRANSLATE_NOOP("LogLevel", "Performance"), TRANSLATE_NOOP("LogLevel", "Information"),
|
TRANSLATE_NOOP("LogLevel", "Warning"), TRANSLATE_NOOP("LogLevel", "Performance"),
|
||||||
TRANSLATE_NOOP("LogLevel", "Verbose"), TRANSLATE_NOOP("LogLevel", "Developer"),
|
TRANSLATE_NOOP("LogLevel", "Information"), TRANSLATE_NOOP("LogLevel", "Verbose"),
|
||||||
TRANSLATE_NOOP("LogLevel", "Profile"), TRANSLATE_NOOP("LogLevel", "Debug"), TRANSLATE_NOOP("LogLevel", "Trace")}};
|
TRANSLATE_NOOP("LogLevel", "Developer"), TRANSLATE_NOOP("LogLevel", "Profile"),
|
||||||
|
TRANSLATE_NOOP("LogLevel", "Debug"), TRANSLATE_NOOP("LogLevel", "Trace")};
|
||||||
|
|
||||||
std::optional<LOGLEVEL> Settings::ParseLogLevelName(const char* str)
|
std::optional<LOGLEVEL> Settings::ParseLogLevelName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -775,11 +775,10 @@ const char* Settings::GetLogLevelDisplayName(LOGLEVEL level)
|
||||||
return Host::TranslateToCString("LogLevel", s_log_level_display_names[static_cast<int>(level)]);
|
return Host::TranslateToCString("LogLevel", s_log_level_display_names[static_cast<int>(level)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 4> s_console_region_names = {{"Auto", "NTSC-J", "NTSC-U", "PAL"}};
|
static constexpr const std::array s_console_region_names = {"Auto", "NTSC-J", "NTSC-U", "PAL"};
|
||||||
static std::array<const char*, 4> s_console_region_display_names = {
|
static constexpr const std::array s_console_region_display_names = {
|
||||||
{TRANSLATE_NOOP("ConsoleRegion", "Auto-Detect"), TRANSLATE_NOOP("ConsoleRegion", "NTSC-J (Japan)"),
|
TRANSLATE_NOOP("ConsoleRegion", "Auto-Detect"), TRANSLATE_NOOP("ConsoleRegion", "NTSC-J (Japan)"),
|
||||||
TRANSLATE_NOOP("ConsoleRegion", "NTSC-U/C (US, Canada)"),
|
TRANSLATE_NOOP("ConsoleRegion", "NTSC-U/C (US, Canada)"), TRANSLATE_NOOP("ConsoleRegion", "PAL (Europe, Australia)")};
|
||||||
TRANSLATE_NOOP("ConsoleRegion", "PAL (Europe, Australia)")}};
|
|
||||||
|
|
||||||
std::optional<ConsoleRegion> Settings::ParseConsoleRegionName(const char* str)
|
std::optional<ConsoleRegion> Settings::ParseConsoleRegionName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -805,11 +804,11 @@ const char* Settings::GetConsoleRegionDisplayName(ConsoleRegion region)
|
||||||
return Host::TranslateToCString("ConsoleRegion", s_console_region_display_names[static_cast<int>(region)]);
|
return Host::TranslateToCString("ConsoleRegion", s_console_region_display_names[static_cast<int>(region)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 5> s_disc_region_names = {{"NTSC-J", "NTSC-U", "PAL", "Other", "Non-PS1"}};
|
static constexpr const std::array s_disc_region_names = {"NTSC-J", "NTSC-U", "PAL", "Other", "Non-PS1"};
|
||||||
static std::array<const char*, 5> s_disc_region_display_names = {
|
static constexpr const std::array s_disc_region_display_names = {
|
||||||
{TRANSLATE_NOOP("DiscRegion", "NTSC-J (Japan)"), TRANSLATE_NOOP("DiscRegion", "NTSC-U/C (US, Canada)"),
|
TRANSLATE_NOOP("DiscRegion", "NTSC-J (Japan)"), TRANSLATE_NOOP("DiscRegion", "NTSC-U/C (US, Canada)"),
|
||||||
TRANSLATE_NOOP("DiscRegion", "PAL (Europe, Australia)"), TRANSLATE_NOOP("DiscRegion", "Other"),
|
TRANSLATE_NOOP("DiscRegion", "PAL (Europe, Australia)"), TRANSLATE_NOOP("DiscRegion", "Other"),
|
||||||
TRANSLATE_NOOP("DiscRegion", "Non-PS1")}};
|
TRANSLATE_NOOP("DiscRegion", "Non-PS1")};
|
||||||
|
|
||||||
std::optional<DiscRegion> Settings::ParseDiscRegionName(const char* str)
|
std::optional<DiscRegion> Settings::ParseDiscRegionName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -835,11 +834,11 @@ const char* Settings::GetDiscRegionDisplayName(DiscRegion region)
|
||||||
return Host::TranslateToCString("DiscRegion", s_disc_region_display_names[static_cast<int>(region)]);
|
return Host::TranslateToCString("DiscRegion", s_disc_region_display_names[static_cast<int>(region)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 3> s_cpu_execution_mode_names = {{"Interpreter", "CachedInterpreter", "Recompiler"}};
|
static constexpr const std::array s_cpu_execution_mode_names = {"Interpreter", "CachedInterpreter", "Recompiler"};
|
||||||
static std::array<const char*, 3> s_cpu_execution_mode_display_names = {
|
static constexpr const std::array s_cpu_execution_mode_display_names = {
|
||||||
{TRANSLATE_NOOP("CPUExecutionMode", "Interpreter (Slowest)"),
|
TRANSLATE_NOOP("CPUExecutionMode", "Interpreter (Slowest)"),
|
||||||
TRANSLATE_NOOP("CPUExecutionMode", "Cached Interpreter (Faster)"),
|
TRANSLATE_NOOP("CPUExecutionMode", "Cached Interpreter (Faster)"),
|
||||||
TRANSLATE_NOOP("CPUExecutionMode", "Recompiler (Fastest)")}};
|
TRANSLATE_NOOP("CPUExecutionMode", "Recompiler (Fastest)")};
|
||||||
|
|
||||||
std::optional<CPUExecutionMode> Settings::ParseCPUExecutionMode(const char* str)
|
std::optional<CPUExecutionMode> Settings::ParseCPUExecutionMode(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -865,12 +864,11 @@ const char* Settings::GetCPUExecutionModeDisplayName(CPUExecutionMode mode)
|
||||||
return Host::TranslateToCString("CPUExecutionMode", s_cpu_execution_mode_display_names[static_cast<u8>(mode)]);
|
return Host::TranslateToCString("CPUExecutionMode", s_cpu_execution_mode_display_names[static_cast<u8>(mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, static_cast<u32>(CPUFastmemMode::Count)> s_cpu_fastmem_mode_names = {
|
static constexpr const std::array s_cpu_fastmem_mode_names = {"Disabled", "MMap", "LUT"};
|
||||||
{"Disabled", "MMap", "LUT"}};
|
static constexpr const std::array s_cpu_fastmem_mode_display_names = {
|
||||||
static std::array<const char*, static_cast<u32>(CPUFastmemMode::Count)> s_cpu_fastmem_mode_display_names = {
|
TRANSLATE_NOOP("CPUFastmemMode", "Disabled (Slowest)"),
|
||||||
{TRANSLATE_NOOP("CPUFastmemMode", "Disabled (Slowest)"),
|
TRANSLATE_NOOP("CPUFastmemMode", "MMap (Hardware, Fastest, 64-Bit Only)"),
|
||||||
TRANSLATE_NOOP("CPUFastmemMode", "MMap (Hardware, Fastest, 64-Bit Only)"),
|
TRANSLATE_NOOP("CPUFastmemMode", "LUT (Faster)")};
|
||||||
TRANSLATE_NOOP("CPUFastmemMode", "LUT (Faster)")}};
|
|
||||||
|
|
||||||
std::optional<CPUFastmemMode> Settings::ParseCPUFastmemMode(const char* str)
|
std::optional<CPUFastmemMode> Settings::ParseCPUFastmemMode(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -896,11 +894,10 @@ const char* Settings::GetCPUFastmemModeDisplayName(CPUFastmemMode mode)
|
||||||
return Host::TranslateToCString("CPUFastmemMode", s_cpu_fastmem_mode_display_names[static_cast<u8>(mode)]);
|
return Host::TranslateToCString("CPUFastmemMode", s_cpu_fastmem_mode_display_names[static_cast<u8>(mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr std::array<const char*, static_cast<u32>(GPURenderer::Count)> s_gpu_renderer_names = {{
|
static constexpr const std::array s_gpu_renderer_names = {
|
||||||
"Automatic",
|
"Automatic",
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
"D3D11",
|
"D3D11", "D3D12",
|
||||||
"D3D12",
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
"Metal",
|
"Metal",
|
||||||
|
@ -912,12 +909,11 @@ static constexpr std::array<const char*, static_cast<u32>(GPURenderer::Count)> s
|
||||||
"OpenGL",
|
"OpenGL",
|
||||||
#endif
|
#endif
|
||||||
"Software",
|
"Software",
|
||||||
}};
|
};
|
||||||
static constexpr std::array<const char*, static_cast<u32>(GPURenderer::Count)> s_gpu_renderer_display_names = {{
|
static constexpr const std::array s_gpu_renderer_display_names = {
|
||||||
TRANSLATE_NOOP("GPURenderer", "Automatic"),
|
TRANSLATE_NOOP("GPURenderer", "Automatic"),
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
TRANSLATE_NOOP("GPURenderer", "Hardware (D3D11)"),
|
TRANSLATE_NOOP("GPURenderer", "Hardware (D3D11)"), TRANSLATE_NOOP("GPURenderer", "Hardware (D3D12)"),
|
||||||
TRANSLATE_NOOP("GPURenderer", "Hardware (D3D12)"),
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
TRANSLATE_NOOP("GPURenderer", "Hardware (Metal)"),
|
TRANSLATE_NOOP("GPURenderer", "Hardware (Metal)"),
|
||||||
|
@ -929,7 +925,7 @@ static constexpr std::array<const char*, static_cast<u32>(GPURenderer::Count)> s
|
||||||
TRANSLATE_NOOP("GPURenderer", "Hardware (OpenGL)"),
|
TRANSLATE_NOOP("GPURenderer", "Hardware (OpenGL)"),
|
||||||
#endif
|
#endif
|
||||||
TRANSLATE_NOOP("GPURenderer", "Software"),
|
TRANSLATE_NOOP("GPURenderer", "Software"),
|
||||||
}};
|
};
|
||||||
|
|
||||||
std::optional<GPURenderer> Settings::ParseRendererName(const char* str)
|
std::optional<GPURenderer> Settings::ParseRendererName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -983,14 +979,16 @@ RenderAPI Settings::GetRenderAPIForRenderer(GPURenderer renderer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr auto s_texture_filter_names =
|
static constexpr const std::array s_texture_filter_names = {"Nearest", "Bilinear", "BilinearBinAlpha", "JINC2",
|
||||||
make_array("Nearest", "Bilinear", "BilinearBinAlpha", "JINC2", "JINC2BinAlpha", "xBR", "xBRBinAlpha");
|
"JINC2BinAlpha", "xBR", "xBRBinAlpha"};
|
||||||
static constexpr auto s_texture_filter_display_names = make_array(
|
static constexpr const std::array s_texture_filter_display_names = {
|
||||||
TRANSLATE_NOOP("GPUTextureFilter", "Nearest-Neighbor"), TRANSLATE_NOOP("GPUTextureFilter", "Bilinear"),
|
TRANSLATE_NOOP("GPUTextureFilter", "Nearest-Neighbor"),
|
||||||
TRANSLATE_NOOP("GPUTextureFilter", "Bilinear (No Edge Blending)"), TRANSLATE_NOOP("GPUTextureFilter", "JINC2 (Slow)"),
|
TRANSLATE_NOOP("GPUTextureFilter", "Bilinear"),
|
||||||
|
TRANSLATE_NOOP("GPUTextureFilter", "Bilinear (No Edge Blending)"),
|
||||||
|
TRANSLATE_NOOP("GPUTextureFilter", "JINC2 (Slow)"),
|
||||||
TRANSLATE_NOOP("GPUTextureFilter", "JINC2 (Slow, No Edge Blending)"),
|
TRANSLATE_NOOP("GPUTextureFilter", "JINC2 (Slow, No Edge Blending)"),
|
||||||
TRANSLATE_NOOP("GPUTextureFilter", "xBR (Very Slow)"),
|
TRANSLATE_NOOP("GPUTextureFilter", "xBR (Very Slow)"),
|
||||||
TRANSLATE_NOOP("GPUTextureFilter", "xBR (Very Slow, No Edge Blending)"));
|
TRANSLATE_NOOP("GPUTextureFilter", "xBR (Very Slow, No Edge Blending)")};
|
||||||
|
|
||||||
std::optional<GPUTextureFilter> Settings::ParseTextureFilterName(const char* str)
|
std::optional<GPUTextureFilter> Settings::ParseTextureFilterName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1016,11 +1014,11 @@ const char* Settings::GetTextureFilterDisplayName(GPUTextureFilter filter)
|
||||||
return Host::TranslateToCString("GPUTextureFilter", s_texture_filter_display_names[static_cast<int>(filter)]);
|
return Host::TranslateToCString("GPUTextureFilter", s_texture_filter_display_names[static_cast<int>(filter)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr auto s_downsample_mode_names = make_array("Disabled", "Box", "Adaptive");
|
static constexpr const std::array s_downsample_mode_names = {"Disabled", "Box", "Adaptive"};
|
||||||
static constexpr auto s_downsample_mode_display_names =
|
static constexpr const std::array s_downsample_mode_display_names = {
|
||||||
make_array(TRANSLATE_NOOP("GPUDownsampleMode", "Disabled"),
|
TRANSLATE_NOOP("GPUDownsampleMode", "Disabled"),
|
||||||
TRANSLATE_NOOP("GPUDownsampleMode", "Box (Downsample 3D/Smooth All)"),
|
TRANSLATE_NOOP("GPUDownsampleMode", "Box (Downsample 3D/Smooth All)"),
|
||||||
TRANSLATE_NOOP("GPUDownsampleMode", "Adaptive (Preserve 3D/Smooth 2D)"));
|
TRANSLATE_NOOP("GPUDownsampleMode", "Adaptive (Preserve 3D/Smooth 2D)")};
|
||||||
|
|
||||||
std::optional<GPUDownsampleMode> Settings::ParseDownsampleModeName(const char* str)
|
std::optional<GPUDownsampleMode> Settings::ParseDownsampleModeName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1046,10 +1044,10 @@ const char* Settings::GetDownsampleModeDisplayName(GPUDownsampleMode mode)
|
||||||
return Host::TranslateToCString("GPUDownsampleMode", s_downsample_mode_display_names[static_cast<int>(mode)]);
|
return Host::TranslateToCString("GPUDownsampleMode", s_downsample_mode_display_names[static_cast<int>(mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr auto s_wireframe_mode_names = make_array("Disabled", "OverlayWireframe", "OnlyWireframe");
|
static constexpr const std::array s_wireframe_mode_names = {"Disabled", "OverlayWireframe", "OnlyWireframe"};
|
||||||
static constexpr auto s_wireframe_mode_display_names =
|
static constexpr const std::array s_wireframe_mode_display_names = {
|
||||||
make_array(TRANSLATE_NOOP("GPUWireframeMode", "Disabled"), TRANSLATE_NOOP("GPUWireframeMode", "Overlay Wireframe"),
|
TRANSLATE_NOOP("GPUWireframeMode", "Disabled"), TRANSLATE_NOOP("GPUWireframeMode", "Overlay Wireframe"),
|
||||||
TRANSLATE_NOOP("GPUWireframeMode", "Only Wireframe"));
|
TRANSLATE_NOOP("GPUWireframeMode", "Only Wireframe")};
|
||||||
|
|
||||||
std::optional<GPUWireframeMode> Settings::ParseGPUWireframeMode(const char* str)
|
std::optional<GPUWireframeMode> Settings::ParseGPUWireframeMode(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1075,10 +1073,10 @@ const char* Settings::GetGPUWireframeModeDisplayName(GPUWireframeMode mode)
|
||||||
return Host::TranslateToCString("GPUWireframeMode", s_wireframe_mode_display_names[static_cast<int>(mode)]);
|
return Host::TranslateToCString("GPUWireframeMode", s_wireframe_mode_display_names[static_cast<int>(mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 3> s_display_crop_mode_names = {{"None", "Overscan", "Borders"}};
|
static constexpr const std::array s_display_crop_mode_names = {"None", "Overscan", "Borders"};
|
||||||
static std::array<const char*, 3> s_display_crop_mode_display_names = {
|
static constexpr const std::array s_display_crop_mode_display_names = {
|
||||||
{TRANSLATE_NOOP("DisplayCropMode", "None"), TRANSLATE_NOOP("DisplayCropMode", "Only Overscan Area"),
|
TRANSLATE_NOOP("DisplayCropMode", "None"), TRANSLATE_NOOP("DisplayCropMode", "Only Overscan Area"),
|
||||||
TRANSLATE_NOOP("DisplayCropMode", "All Borders")}};
|
TRANSLATE_NOOP("DisplayCropMode", "All Borders")};
|
||||||
|
|
||||||
std::optional<DisplayCropMode> Settings::ParseDisplayCropMode(const char* str)
|
std::optional<DisplayCropMode> Settings::ParseDisplayCropMode(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1104,11 +1102,17 @@ const char* Settings::GetDisplayCropModeDisplayName(DisplayCropMode crop_mode)
|
||||||
return Host::TranslateToCString("DisplayCropMode", s_display_crop_mode_display_names[static_cast<int>(crop_mode)]);
|
return Host::TranslateToCString("DisplayCropMode", s_display_crop_mode_display_names[static_cast<int>(crop_mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, static_cast<size_t>(DisplayAspectRatio::Count)> s_display_aspect_ratio_names = {
|
static constexpr const std::array s_display_aspect_ratio_names = {
|
||||||
{TRANSLATE_NOOP("DisplayAspectRatio", "Auto (Game Native)"), TRANSLATE_NOOP("DisplayAspectRatio", "Stretch To Fill"),
|
TRANSLATE_NOOP("DisplayAspectRatio", "Auto (Game Native)"),
|
||||||
TRANSLATE_NOOP("DisplayAspectRatio", "Custom"), "4:3", "16:9", "19:9", "20:9", "PAR 1:1"}};
|
TRANSLATE_NOOP("DisplayAspectRatio", "Stretch To Fill"),
|
||||||
static constexpr std::array<float, static_cast<size_t>(DisplayAspectRatio::Count)> s_display_aspect_ratio_values = {
|
TRANSLATE_NOOP("DisplayAspectRatio", "Custom"),
|
||||||
{-1.0f, -1.0f, -1.0f, 4.0f / 3.0f, 16.0f / 9.0f, 19.0f / 9.0f, 20.0f / 9.0f, -1.0f}};
|
"4:3",
|
||||||
|
"16:9",
|
||||||
|
"19:9",
|
||||||
|
"20:9",
|
||||||
|
"PAR 1:1"};
|
||||||
|
static constexpr const std::array s_display_aspect_ratio_values = {
|
||||||
|
-1.0f, -1.0f, -1.0f, 4.0f / 3.0f, 16.0f / 9.0f, 19.0f / 9.0f, 20.0f / 9.0f, -1.0f};
|
||||||
|
|
||||||
std::optional<DisplayAspectRatio> Settings::ParseDisplayAspectRatio(const char* str)
|
std::optional<DisplayAspectRatio> Settings::ParseDisplayAspectRatio(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1159,11 +1163,10 @@ float Settings::GetDisplayAspectRatioValue() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, static_cast<size_t>(DisplayAlignment::Count)> s_display_alignment_names = {
|
static constexpr const std::array s_display_alignment_names = {"LeftOrTop", "Center", "RightOrBottom"};
|
||||||
{"LeftOrTop", "Center", "RightOrBottom"}};
|
static constexpr const std::array s_display_alignment_display_names = {
|
||||||
static std::array<const char*, static_cast<size_t>(DisplayAlignment::Count)> s_display_alignment_display_names = {
|
TRANSLATE_NOOP("DisplayAlignment", "Left / Top"), TRANSLATE_NOOP("DisplayAlignment", "Center"),
|
||||||
{TRANSLATE_NOOP("DisplayAlignment", "Left / Top"), TRANSLATE_NOOP("DisplayAlignment", "Center"),
|
TRANSLATE_NOOP("DisplayAlignment", "Right / Bottom")};
|
||||||
TRANSLATE_NOOP("DisplayAlignment", "Right / Bottom")}};
|
|
||||||
|
|
||||||
std::optional<DisplayAlignment> Settings::ParseDisplayAlignment(const char* str)
|
std::optional<DisplayAlignment> Settings::ParseDisplayAlignment(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1189,18 +1192,18 @@ const char* Settings::GetDisplayAlignmentDisplayName(DisplayAlignment alignment)
|
||||||
return Host::TranslateToCString("DisplayAlignment", s_display_alignment_display_names[static_cast<int>(alignment)]);
|
return Host::TranslateToCString("DisplayAlignment", s_display_alignment_display_names[static_cast<int>(alignment)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, static_cast<size_t>(DisplayScalingMode::Count)> s_display_scaling_names = {{
|
static constexpr const std::array s_display_scaling_names = {
|
||||||
"Nearest",
|
"Nearest",
|
||||||
"BilinearSmooth",
|
"BilinearSmooth",
|
||||||
"NearestInteger",
|
"NearestInteger",
|
||||||
"BilinearSharp",
|
"BilinearSharp",
|
||||||
}};
|
};
|
||||||
static std::array<const char*, static_cast<size_t>(DisplayScalingMode::Count)> s_display_scaling_display_names = {{
|
static constexpr const std::array s_display_scaling_display_names = {
|
||||||
TRANSLATE_NOOP("DisplayScalingMode", "Nearest-Neighbor"),
|
TRANSLATE_NOOP("DisplayScalingMode", "Nearest-Neighbor"),
|
||||||
TRANSLATE_NOOP("DisplayScalingMode", "Bilinear (Smooth)"),
|
TRANSLATE_NOOP("DisplayScalingMode", "Bilinear (Smooth)"),
|
||||||
TRANSLATE_NOOP("DisplayScalingMode", "Nearest-Neighbor (Integer)"),
|
TRANSLATE_NOOP("DisplayScalingMode", "Nearest-Neighbor (Integer)"),
|
||||||
TRANSLATE_NOOP("DisplayScalingMode", "Bilinear (Sharp)"),
|
TRANSLATE_NOOP("DisplayScalingMode", "Bilinear (Sharp)"),
|
||||||
}};
|
};
|
||||||
|
|
||||||
std::optional<DisplayScalingMode> Settings::ParseDisplayScaling(const char* str)
|
std::optional<DisplayScalingMode> Settings::ParseDisplayScaling(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1226,7 +1229,7 @@ const char* Settings::GetDisplayScalingDisplayName(DisplayScalingMode mode)
|
||||||
return Host::TranslateToCString("DisplayScalingMode", s_display_scaling_display_names[static_cast<int>(mode)]);
|
return Host::TranslateToCString("DisplayScalingMode", s_display_scaling_display_names[static_cast<int>(mode)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr const char* s_audio_backend_names[] = {
|
static constexpr const std::array s_audio_backend_names = {
|
||||||
"Null",
|
"Null",
|
||||||
#ifdef ENABLE_CUBEB
|
#ifdef ENABLE_CUBEB
|
||||||
"Cubeb",
|
"Cubeb",
|
||||||
|
@ -1238,7 +1241,7 @@ static constexpr const char* s_audio_backend_names[] = {
|
||||||
"AAudio", "OpenSLES",
|
"AAudio", "OpenSLES",
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
static constexpr const char* s_audio_backend_display_names[] = {
|
static constexpr const std::array s_audio_backend_display_names = {
|
||||||
TRANSLATE_NOOP("AudioBackend", "Null (No Output)"),
|
TRANSLATE_NOOP("AudioBackend", "Null (No Output)"),
|
||||||
#ifdef ENABLE_CUBEB
|
#ifdef ENABLE_CUBEB
|
||||||
TRANSLATE_NOOP("AudioBackend", "Cubeb"),
|
TRANSLATE_NOOP("AudioBackend", "Cubeb"),
|
||||||
|
@ -1276,13 +1279,16 @@ const char* Settings::GetAudioBackendDisplayName(AudioBackend backend)
|
||||||
return Host::TranslateToCString("AudioBackend", s_audio_backend_display_names[static_cast<int>(backend)]);
|
return Host::TranslateToCString("AudioBackend", s_audio_backend_display_names[static_cast<int>(backend)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 7> s_controller_type_names = {
|
static constexpr const std::array s_controller_type_names = {
|
||||||
{"None", "DigitalController", "AnalogController", "AnalogJoystick", "GunCon", "PlayStationMouse", "NeGcon"}};
|
"None", "DigitalController", "AnalogController", "AnalogJoystick", "GunCon", "PlayStationMouse", "NeGcon"};
|
||||||
static std::array<const char*, 7> s_controller_display_names = {
|
static constexpr const std::array s_controller_display_names = {
|
||||||
{TRANSLATE_NOOP("ControllerType", "None"), TRANSLATE_NOOP("ControllerType", "Digital Controller"),
|
TRANSLATE_NOOP("ControllerType", "None"),
|
||||||
TRANSLATE_NOOP("ControllerType", "Analog Controller (DualShock)"),
|
TRANSLATE_NOOP("ControllerType", "Digital Controller"),
|
||||||
TRANSLATE_NOOP("ControllerType", "Analog Joystick"), TRANSLATE_NOOP("ControllerType", "GunCon"),
|
TRANSLATE_NOOP("ControllerType", "Analog Controller (DualShock)"),
|
||||||
TRANSLATE_NOOP("ControllerType", "PlayStation Mouse"), TRANSLATE_NOOP("ControllerType", "NeGcon")}};
|
TRANSLATE_NOOP("ControllerType", "Analog Joystick"),
|
||||||
|
TRANSLATE_NOOP("ControllerType", "GunCon"),
|
||||||
|
TRANSLATE_NOOP("ControllerType", "PlayStation Mouse"),
|
||||||
|
TRANSLATE_NOOP("ControllerType", "NeGcon")};
|
||||||
|
|
||||||
std::optional<ControllerType> Settings::ParseControllerTypeName(const char* str)
|
std::optional<ControllerType> Settings::ParseControllerTypeName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1308,14 +1314,15 @@ const char* Settings::GetControllerTypeDisplayName(ControllerType type)
|
||||||
return Host::TranslateToCString("ControllerType", s_controller_display_names[static_cast<int>(type)]);
|
return Host::TranslateToCString("ControllerType", s_controller_display_names[static_cast<int>(type)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 6> s_memory_card_type_names = {
|
static constexpr const std::array s_memory_card_type_names = {"None", "Shared", "PerGame",
|
||||||
{"None", "Shared", "PerGame", "PerGameTitle", "PerGameFileTitle", "NonPersistent"}};
|
"PerGameTitle", "PerGameFileTitle", "NonPersistent"};
|
||||||
static std::array<const char*, 6> s_memory_card_type_display_names = {
|
static constexpr const std::array s_memory_card_type_display_names = {
|
||||||
{TRANSLATE_NOOP("MemoryCardType", "No Memory Card"), TRANSLATE_NOOP("MemoryCardType", "Shared Between All Games"),
|
TRANSLATE_NOOP("MemoryCardType", "No Memory Card"),
|
||||||
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (Serial)"),
|
TRANSLATE_NOOP("MemoryCardType", "Shared Between All Games"),
|
||||||
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (Title)"),
|
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (Serial)"),
|
||||||
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (File Title)"),
|
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (Title)"),
|
||||||
TRANSLATE_NOOP("MemoryCardType", "Non-Persistent Card (Do Not Save)")}};
|
TRANSLATE_NOOP("MemoryCardType", "Separate Card Per Game (File Title)"),
|
||||||
|
TRANSLATE_NOOP("MemoryCardType", "Non-Persistent Card (Do Not Save)")};
|
||||||
|
|
||||||
std::optional<MemoryCardType> Settings::ParseMemoryCardTypeName(const char* str)
|
std::optional<MemoryCardType> Settings::ParseMemoryCardTypeName(const char* str)
|
||||||
{
|
{
|
||||||
|
@ -1365,10 +1372,10 @@ std::string Settings::GetGameMemoryCardPath(const std::string_view& serial, u32
|
||||||
return Path::Combine(EmuFolders::MemoryCards, fmt::format("{}_{}.mcd", serial, slot + 1));
|
return Path::Combine(EmuFolders::MemoryCards, fmt::format("{}_{}.mcd", serial, slot + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::array<const char*, 4> s_multitap_enable_mode_names = {{"Disabled", "Port1Only", "Port2Only", "BothPorts"}};
|
static constexpr const std::array s_multitap_enable_mode_names = {"Disabled", "Port1Only", "Port2Only", "BothPorts"};
|
||||||
static std::array<const char*, 4> s_multitap_enable_mode_display_names = {
|
static constexpr const std::array s_multitap_enable_mode_display_names = {
|
||||||
{TRANSLATE_NOOP("MultitapMode", "Disabled"), TRANSLATE_NOOP("MultitapMode", "Enable on Port 1 Only"),
|
TRANSLATE_NOOP("MultitapMode", "Disabled"), TRANSLATE_NOOP("MultitapMode", "Enable on Port 1 Only"),
|
||||||
TRANSLATE_NOOP("MultitapMode", "Enable on Port 2 Only"), TRANSLATE_NOOP("MultitapMode", "Enable on Ports 1 and 2")}};
|
TRANSLATE_NOOP("MultitapMode", "Enable on Port 2 Only"), TRANSLATE_NOOP("MultitapMode", "Enable on Ports 1 and 2")};
|
||||||
|
|
||||||
std::optional<MultitapMode> Settings::ParseMultitapModeName(const char* str)
|
std::optional<MultitapMode> Settings::ParseMultitapModeName(const char* str)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,7 +48,6 @@
|
||||||
#include "common/error.h"
|
#include "common/error.h"
|
||||||
#include "common/file_system.h"
|
#include "common/file_system.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/path.h"
|
#include "common/path.h"
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
#include "common/threading.h"
|
#include "common/threading.h"
|
||||||
|
@ -502,11 +501,13 @@ bool System::IsPsfFileName(const std::string_view& path)
|
||||||
|
|
||||||
bool System::IsLoadableFilename(const std::string_view& path)
|
bool System::IsLoadableFilename(const std::string_view& path)
|
||||||
{
|
{
|
||||||
static constexpr auto extensions = make_array(".bin", ".cue", ".img", ".iso", ".chd", ".ecm", ".mds", // discs
|
static constexpr const std::array extensions = {
|
||||||
".exe", ".psexe", ".ps-exe", // exes
|
".bin", ".cue", ".img", ".iso", ".chd", ".ecm", ".mds", // discs
|
||||||
".psf", ".minipsf", // psf
|
".exe", ".psexe", ".ps-exe", // exes
|
||||||
".m3u", // playlists
|
".psf", ".minipsf", // psf
|
||||||
".pbp");
|
".m3u", // playlists
|
||||||
|
".pbp",
|
||||||
|
};
|
||||||
|
|
||||||
for (const char* test_extension : extensions)
|
for (const char* test_extension : extensions)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||||
|
|
||||||
#include "emulationsettingswidget.h"
|
#include "emulationsettingswidget.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
#include "qtutils.h"
|
#include "qtutils.h"
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
|
@ -128,8 +127,8 @@ void EmulationSettingsWidget::fillComboBoxWithEmulationSpeeds(QComboBox* cb, flo
|
||||||
|
|
||||||
cb->addItem(tr("Unlimited"), QVariant(0.0f));
|
cb->addItem(tr("Unlimited"), QVariant(0.0f));
|
||||||
|
|
||||||
static constexpr auto speeds = make_array(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175, 200, 250, 300, 350,
|
static constexpr const std::array speeds = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 125, 150, 175,
|
||||||
400, 450, 500, 600, 700, 800, 900, 1000);
|
200, 250, 300, 350, 400, 450, 500, 600, 700, 800, 900, 1000};
|
||||||
for (const int speed : speeds)
|
for (const int speed : speeds)
|
||||||
{
|
{
|
||||||
cb->addItem(tr("%1% [%2 FPS (NTSC) / %3 FPS (PAL)]").arg(speed).arg((60 * speed) / 100).arg((50 * speed) / 100),
|
cb->addItem(tr("%1% [%2 FPS (NTSC) / %3 FPS (PAL)]").arg(speed).arg((60 * speed) / 100).arg((50 * speed) / 100),
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
|
|
||||||
#include "common/byte_stream.h"
|
#include "common/byte_stream.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QMetaObject>
|
#include <QtCore/QMetaObject>
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
||||||
|
|
||||||
#include "audio_stream.h"
|
#include "audio_stream.h"
|
||||||
|
#include "host.h"
|
||||||
|
|
||||||
#include "common/align.h"
|
#include "common/align.h"
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/intrin.h"
|
#include "common/intrin.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
|
|
||||||
#include "SoundTouch.h"
|
#include "SoundTouch.h"
|
||||||
|
@ -54,8 +54,10 @@ u32 AudioStream::GetMSForBufferSize(u32 sample_rate, u32 buffer_size)
|
||||||
return (buffer_size * 1000u) / sample_rate;
|
return (buffer_size * 1000u) / sample_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr const auto s_stretch_mode_names = make_array("None", "Resample", "TimeStretch");
|
static constexpr const std::array s_stretch_mode_names = {"None", "Resample", "TimeStretch"};
|
||||||
static constexpr const auto s_stretch_mode_display_names = make_array("None", "Resampling", "Time Stretching");
|
static constexpr const std::array s_stretch_mode_display_names = {TRANSLATE_NOOP("AudioStream", "None"),
|
||||||
|
TRANSLATE_NOOP("AudioStream", "Resampling"),
|
||||||
|
TRANSLATE_NOOP("AudioStream", "Time Stretching")};
|
||||||
|
|
||||||
const char* AudioStream::GetStretchModeName(AudioStretchMode mode)
|
const char* AudioStream::GetStretchModeName(AudioStretchMode mode)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +67,7 @@ const char* AudioStream::GetStretchModeName(AudioStretchMode mode)
|
||||||
const char* AudioStream::GetStretchModeDisplayName(AudioStretchMode mode)
|
const char* AudioStream::GetStretchModeDisplayName(AudioStretchMode mode)
|
||||||
{
|
{
|
||||||
return (static_cast<u32>(mode) < s_stretch_mode_display_names.size()) ?
|
return (static_cast<u32>(mode) < s_stretch_mode_display_names.size()) ?
|
||||||
s_stretch_mode_display_names[static_cast<u32>(mode)] :
|
Host::TranslateToCString("AudioStream", s_stretch_mode_display_names[static_cast<u32>(mode)]) :
|
||||||
"";
|
"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/log.h"
|
#include "common/log.h"
|
||||||
#include "common/make_array.h"
|
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
|
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
|
|
Loading…
Reference in a new issue