Merge e3904df851
into 9ab4e4d70c
This commit is contained in:
commit
7519040f13
|
@ -16,7 +16,7 @@ class BinarySpanReader
|
|||
{
|
||||
public:
|
||||
BinarySpanReader();
|
||||
BinarySpanReader(std::span<const u8> buf);
|
||||
explicit BinarySpanReader(std::span<const u8> buf);
|
||||
|
||||
BinarySpanReader(const BinarySpanReader&) = delete;
|
||||
BinarySpanReader& operator=(const BinarySpanReader&) = delete;
|
||||
|
@ -146,7 +146,7 @@ class BinarySpanWriter
|
|||
{
|
||||
public:
|
||||
BinarySpanWriter();
|
||||
BinarySpanWriter(std::span<u8> buf);
|
||||
explicit BinarySpanWriter(std::span<u8> buf);
|
||||
|
||||
BinarySpanWriter(const BinarySpanWriter&) = delete;
|
||||
BinarySpanWriter& operator=(const BinarySpanWriter&) = delete;
|
||||
|
@ -217,8 +217,8 @@ class BinaryFileReader
|
|||
{
|
||||
public:
|
||||
BinaryFileReader();
|
||||
BinaryFileReader(std::FILE* fp);
|
||||
|
||||
explicit BinaryFileReader(std::FILE* fp);
|
||||
|
||||
BinaryFileReader(const BinaryFileReader&) = delete;
|
||||
BinaryFileReader& operator=(const BinaryFileReader&) = delete;
|
||||
|
||||
|
@ -308,8 +308,8 @@ class BinaryFileWriter
|
|||
{
|
||||
public:
|
||||
BinaryFileWriter();
|
||||
BinaryFileWriter(std::FILE* fp);
|
||||
|
||||
explicit BinaryFileWriter(std::FILE* fp);
|
||||
|
||||
BinaryFileWriter(const BinaryFileWriter&) = delete;
|
||||
BinaryFileWriter& operator=(const BinaryFileWriter&) = delete;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
DynamicLibrary();
|
||||
|
||||
/// Automatically loads the specified library. Call IsOpen() to check validity before use.
|
||||
DynamicLibrary(const char* filename);
|
||||
explicit DynamicLibrary(const char* filename);
|
||||
|
||||
/// Move constructor, transfers ownership.
|
||||
DynamicLibrary(DynamicLibrary&& move);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// From https://github.com/nicolausYes/easing-functions/blob/master/src/easing.cpp
|
||||
|
||||
namespace Easing {
|
||||
static constexpr float pi = 3.1415926545f;
|
||||
inline constexpr float pi = 3.1415926545f;
|
||||
|
||||
template<typename T>
|
||||
ALWAYS_INLINE_RELEASE static T InSine(T t)
|
||||
|
|
|
@ -165,8 +165,8 @@ class POSIXLock
|
|||
{
|
||||
public:
|
||||
POSIXLock();
|
||||
POSIXLock(int fd, bool block = true, Error* error = nullptr);
|
||||
POSIXLock(std::FILE* fp, bool block = true, Error* error = nullptr);
|
||||
explicit POSIXLock(int fd, bool block = true, Error* error = nullptr);
|
||||
explicit POSIXLock(std::FILE* fp, bool block = true, Error* error = nullptr);
|
||||
POSIXLock(POSIXLock&& move);
|
||||
POSIXLock(const POSIXLock&) = delete;
|
||||
~POSIXLock();
|
||||
|
|
|
@ -167,7 +167,7 @@ public:
|
|||
using this_type = DynamicHeapArray<T, alignment>;
|
||||
|
||||
DynamicHeapArray() : m_data(nullptr), m_size(0) {}
|
||||
DynamicHeapArray(size_t size) { internal_resize(size, nullptr, 0); }
|
||||
explicit DynamicHeapArray(size_t size) { internal_resize(size, nullptr, 0); }
|
||||
DynamicHeapArray(const T* begin, const T* end)
|
||||
{
|
||||
const size_t size = reinterpret_cast<const char*>(end) - reinterpret_cast<const char*>(begin);
|
||||
|
@ -195,7 +195,7 @@ public:
|
|||
m_size = 0;
|
||||
}
|
||||
}
|
||||
DynamicHeapArray(const std::span<const T> data)
|
||||
explicit DynamicHeapArray(const std::span<const T> data)
|
||||
{
|
||||
if (!data.empty())
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#endif
|
||||
|
||||
/// Only currently using 128-bit vectors at max.
|
||||
static constexpr u32 VECTOR_ALIGNMENT = 16;
|
||||
inline constexpr u32 VECTOR_ALIGNMENT = 16;
|
||||
|
||||
/// Aligns allocation/pitch size to preferred host size.
|
||||
template<typename T>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
class PerfScope
|
||||
{
|
||||
public:
|
||||
constexpr PerfScope(const char* prefix) : m_prefix(prefix) {}
|
||||
constexpr explicit PerfScope(const char* prefix) : m_prefix(prefix) {}
|
||||
bool HasPrefix() const { return (m_prefix && m_prefix[0]); }
|
||||
|
||||
void Register(const void* ptr, size_t size, const char* symbol);
|
||||
|
|
|
@ -444,7 +444,7 @@ ALWAYS_INLINE std::optional<std::string_view> GetNextToken(std::string_view& car
|
|||
}
|
||||
|
||||
/// Unicode replacement character.
|
||||
static constexpr char32_t UNICODE_REPLACEMENT_CHARACTER = 0xFFFD;
|
||||
inline constexpr char32_t UNICODE_REPLACEMENT_CHARACTER = 0xFFFD;
|
||||
|
||||
/// Appends a UTF-16/UTF-32 codepoint to a UTF-8 string.
|
||||
void EncodeAndAppendUTF8(std::string& s, char32_t ch);
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
#include <cstdint>
|
||||
|
||||
/****************************** MACROS ******************************/
|
||||
static constexpr uint32_t AES_BLOCK_SIZE = 16; // AES operates on 16 bytes at a time
|
||||
static constexpr uint32_t AES_KEY_SCHEDULE_SIZE = 60;
|
||||
inline constexpr uint32_t AES_BLOCK_SIZE = 16; // AES operates on 16 bytes at a time
|
||||
inline constexpr uint32_t AES_KEY_SCHEDULE_SIZE = 60;
|
||||
|
||||
/*********************** FUNCTION DECLARATIONS **********************/
|
||||
///////////////////
|
||||
|
@ -119,4 +119,4 @@ bool aes_decrypt_ccm(
|
|||
// authentication.
|
||||
const uint8_t key[], // IN - The AES key for decryption.
|
||||
int keysize); // IN - The length of the key in BITS. Valid values are 128, 192, 256.
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -212,29 +212,29 @@ extern const u32 HOST_PAGE_MASK;
|
|||
extern const u32 HOST_PAGE_SHIFT;
|
||||
#else
|
||||
#if defined(OVERRIDE_HOST_PAGE_SIZE)
|
||||
static constexpr u32 HOST_PAGE_SIZE = OVERRIDE_HOST_PAGE_SIZE;
|
||||
static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
static constexpr u32 HOST_PAGE_SHIFT = std::bit_width(HOST_PAGE_MASK);
|
||||
inline constexpr u32 HOST_PAGE_SIZE = OVERRIDE_HOST_PAGE_SIZE;
|
||||
inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
inline constexpr u32 HOST_PAGE_SHIFT = std::bit_width(HOST_PAGE_MASK);
|
||||
#elif defined(__APPLE__) && defined(__aarch64__)
|
||||
static constexpr u32 HOST_PAGE_SIZE = 0x4000;
|
||||
static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
static constexpr u32 HOST_PAGE_SHIFT = 14;
|
||||
inline constexpr u32 HOST_PAGE_SIZE = 0x4000;
|
||||
inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
inline constexpr u32 HOST_PAGE_SHIFT = 14;
|
||||
#else
|
||||
static constexpr u32 HOST_PAGE_SIZE = 0x1000;
|
||||
static constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
static constexpr u32 HOST_PAGE_SHIFT = 12;
|
||||
inline constexpr u32 HOST_PAGE_SIZE = 0x1000;
|
||||
inline constexpr u32 HOST_PAGE_MASK = HOST_PAGE_SIZE - 1;
|
||||
inline constexpr u32 HOST_PAGE_SHIFT = 12;
|
||||
#endif
|
||||
static constexpr u32 MIN_HOST_PAGE_SIZE = HOST_PAGE_SIZE;
|
||||
static constexpr u32 MAX_HOST_PAGE_SIZE = HOST_PAGE_SIZE;
|
||||
inline constexpr u32 MIN_HOST_PAGE_SIZE = HOST_PAGE_SIZE;
|
||||
inline constexpr u32 MAX_HOST_PAGE_SIZE = HOST_PAGE_SIZE;
|
||||
#endif
|
||||
|
||||
// Host cache line sizes.
|
||||
#if defined(OVERRIDE_HOST_CACHE_LINE_SIZE)
|
||||
static constexpr u32 HOST_CACHE_LINE_SIZE = OVERRIDE_HOST_CACHE_LINE_SIZE;
|
||||
inline constexpr u32 HOST_CACHE_LINE_SIZE = OVERRIDE_HOST_CACHE_LINE_SIZE;
|
||||
#elif defined(__APPLE__) && defined(__aarch64__)
|
||||
static constexpr u32 HOST_CACHE_LINE_SIZE = 128; // Apple Silicon uses 128b cache lines.
|
||||
inline constexpr u32 HOST_CACHE_LINE_SIZE = 128; // Apple Silicon uses 128b cache lines.
|
||||
#else
|
||||
static constexpr u32 HOST_CACHE_LINE_SIZE = 64; // Everything else is 64b.
|
||||
inline constexpr u32 HOST_CACHE_LINE_SIZE = 64; // Everything else is 64b.
|
||||
#endif
|
||||
#define ALIGN_TO_CACHE_LINE alignas(HOST_CACHE_LINE_SIZE)
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ enum class LoginRequestReason
|
|||
TokenInvalid,
|
||||
};
|
||||
|
||||
static constexpr size_t GAME_HASH_LENGTH = 16;
|
||||
inline constexpr size_t GAME_HASH_LENGTH = 16;
|
||||
using GameHash = std::array<u8, GAME_HASH_LENGTH>;
|
||||
|
||||
struct HashDatabaseEntry
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
AnalogController(u32 index);
|
||||
explicit AnalogController(u32 index);
|
||||
~AnalogController() override;
|
||||
|
||||
static std::unique_ptr<AnalogController> Create(u32 index);
|
||||
|
|
|
@ -80,7 +80,7 @@ static_assert(sizeof(PSEXEHeader) == 0x800);
|
|||
#pragma pack(pop)
|
||||
|
||||
// .cpe files
|
||||
static constexpr u32 CPE_MAGIC = 0x01455043;
|
||||
inline constexpr u32 CPE_MAGIC = 0x01455043;
|
||||
|
||||
std::optional<Image> LoadImageFromFile(const char* filename, Error* error);
|
||||
|
||||
|
@ -105,4 +105,4 @@ std::vector<std::pair<std::string, const BIOS::ImageInfo*>> FindBIOSImagesInDire
|
|||
|
||||
/// Returns true if any BIOS images are found in the configured BIOS directory.
|
||||
bool HasAnyBIOSImages();
|
||||
} // namespace BIOS
|
||||
} // namespace BIOS
|
||||
|
|
|
@ -109,7 +109,7 @@ enum : u32
|
|||
|
||||
#ifdef ENABLE_MMAP_FASTMEM
|
||||
// Fastmem region size is 4GB to cover the entire 32-bit address space.
|
||||
static constexpr size_t FASTMEM_ARENA_SIZE = UINT64_C(0x100000000);
|
||||
inline constexpr size_t FASTMEM_ARENA_SIZE = UINT64_C(0x100000000);
|
||||
#endif
|
||||
|
||||
bool AllocateMemory(bool export_shared_memory, Error* error);
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace {
|
|||
class CheatFileReader
|
||||
{
|
||||
public:
|
||||
CheatFileReader(const std::string_view contents) : m_contents(contents) {}
|
||||
explicit CheatFileReader(const std::string_view contents) : m_contents(contents) {}
|
||||
|
||||
ALWAYS_INLINE size_t GetCurrentOffset() const { return m_current_offset; }
|
||||
ALWAYS_INLINE size_t GetCurrentLineOffset() const { return m_current_line_offset; }
|
||||
|
@ -178,7 +178,7 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
CheatCode(Metadata metadata);
|
||||
explicit CheatCode(Metadata metadata);
|
||||
virtual ~CheatCode();
|
||||
|
||||
ALWAYS_INLINE const Metadata& GetMetadata() const { return m_metadata; }
|
||||
|
@ -2034,7 +2034,7 @@ namespace {
|
|||
class GamesharkCheatCode final : public CheatCode
|
||||
{
|
||||
public:
|
||||
GamesharkCheatCode(Metadata metadata);
|
||||
explicit GamesharkCheatCode(Metadata metadata);
|
||||
~GamesharkCheatCode() override;
|
||||
|
||||
static std::unique_ptr<GamesharkCheatCode> Parse(Metadata metadata, const std::string_view data, Error* error);
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
static constexpr float DEFAULT_STICK_SENSITIVITY = 1.33f;
|
||||
static constexpr float DEFAULT_BUTTON_DEADZONE = 0.25f;
|
||||
|
||||
Controller(u32 index);
|
||||
explicit Controller(u32 index);
|
||||
virtual ~Controller();
|
||||
|
||||
/// Returns the type of controller.
|
||||
|
|
|
@ -253,7 +253,7 @@ struct DebuggerRegisterListEntry
|
|||
u32* value_ptr;
|
||||
};
|
||||
|
||||
static constexpr u32 NUM_DEBUGGER_REGISTER_LIST_ENTRIES = 103;
|
||||
inline constexpr u32 NUM_DEBUGGER_REGISTER_LIST_ENTRIES = 103;
|
||||
extern const std::array<DebuggerRegisterListEntry, NUM_DEBUGGER_REGISTER_LIST_ENTRIES> g_debugger_register_list;
|
||||
|
||||
} // namespace CPU
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
DDGoController(u32 index);
|
||||
explicit DDGoController(u32 index);
|
||||
~DDGoController() override;
|
||||
|
||||
static std::unique_ptr<DDGoController> Create(u32 index);
|
||||
|
|
|
@ -48,9 +48,9 @@ void SetTheme();
|
|||
void UpdateRunIdleState();
|
||||
void UpdateTransitionState();
|
||||
|
||||
static constexpr float SHORT_TRANSITION_TIME = 0.08f;
|
||||
static constexpr float DEFAULT_TRANSITION_TIME = 0.15f;
|
||||
static constexpr float LONG_TRANSITION_TIME = 0.3f;
|
||||
inline constexpr float SHORT_TRANSITION_TIME = 0.08f;
|
||||
inline constexpr float DEFAULT_TRANSITION_TIME = 0.15f;
|
||||
inline constexpr float LONG_TRANSITION_TIME = 0.3f;
|
||||
|
||||
enum class TransitionState : u8
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ void SetStandardSelectionFooterText(bool back_instead_of_cancel);
|
|||
class BackgroundProgressCallback final : public ProgressCallback
|
||||
{
|
||||
public:
|
||||
BackgroundProgressCallback(std::string name);
|
||||
explicit BackgroundProgressCallback(std::string name);
|
||||
~BackgroundProgressCallback() override;
|
||||
|
||||
void SetStatusText(const std::string_view text) override;
|
||||
|
|
|
@ -37,7 +37,7 @@ enum class PacketType : u8
|
|||
Comment = 0x12,
|
||||
};
|
||||
|
||||
static constexpr u32 MAX_PACKET_LENGTH = ((1u << 24) - 1); // 3 bytes for packet size
|
||||
inline constexpr u32 MAX_PACKET_LENGTH = ((1u << 24) - 1); // 3 bytes for packet size
|
||||
|
||||
union PacketHeader
|
||||
{
|
||||
|
|
|
@ -19,9 +19,9 @@ class GPU_HW;
|
|||
namespace GPUTextureCache {
|
||||
|
||||
/// 4 pages in C16 mode, 2+4 pages in P8 mode, 1+1 pages in P4 mode.
|
||||
static constexpr u32 MAX_PAGE_REFS_PER_SOURCE = 6;
|
||||
inline constexpr u32 MAX_PAGE_REFS_PER_SOURCE = 6;
|
||||
|
||||
static constexpr u32 MAX_PAGE_REFS_PER_WRITE = 32;
|
||||
inline constexpr u32 MAX_PAGE_REFS_PER_WRITE = 32;
|
||||
|
||||
enum class PaletteRecordFlags : u32
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
class GPU_SW final : public GPUBackend
|
||||
{
|
||||
public:
|
||||
GPU_SW(GPUPresenter& presenter);
|
||||
explicit GPU_SW(GPUPresenter& presenter);
|
||||
~GPU_SW() override;
|
||||
|
||||
bool Initialize(bool upload_vram, Error* error) override;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
namespace GPU_SW_Rasterizer {
|
||||
|
||||
// this is actually (31 * 255) >> 4) == 494, but to simplify addressing we use the next power of two (512)
|
||||
static constexpr u32 DITHER_LUT_SIZE = 512;
|
||||
inline constexpr u32 DITHER_LUT_SIZE = 512;
|
||||
using DitherLUT = std::array<std::array<std::array<u8, DITHER_LUT_SIZE>, DITHER_MATRIX_SIZE>, DITHER_MATRIX_SIZE>;
|
||||
extern const DitherLUT g_dither_lut;
|
||||
|
||||
|
|
|
@ -550,7 +550,7 @@ ALWAYS_INLINE static constexpr GSVector4i GetPaletteRect(GPUTexturePaletteReg pa
|
|||
}
|
||||
|
||||
// 4x4 dither matrix.
|
||||
static constexpr s32 DITHER_MATRIX[DITHER_MATRIX_SIZE][DITHER_MATRIX_SIZE] = {{-4, +0, -3, +1}, // row 0
|
||||
inline constexpr s32 DITHER_MATRIX[DITHER_MATRIX_SIZE][DITHER_MATRIX_SIZE] = {{-4, +0, -3, +1}, // row 0
|
||||
{+2, -2, +3, -1}, // row 1
|
||||
{-3, +1, -4, +0}, // row 2
|
||||
{+3, -1, +2, -2}}; // row 3
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
GunCon(u32 index);
|
||||
explicit GunCon(u32 index);
|
||||
~GunCon() override;
|
||||
|
||||
static std::unique_ptr<GunCon> Create(u32 index);
|
||||
|
|
|
@ -13,7 +13,7 @@ class GPUBackend;
|
|||
|
||||
namespace ImGuiManager {
|
||||
|
||||
static constexpr const char* LOGO_IMAGE_NAME = "images/duck.png";
|
||||
inline constexpr const char* LOGO_IMAGE_NAME = "images/duck.png";
|
||||
|
||||
void UpdateInputOverlay();
|
||||
void RenderTextOverlays(const GPUBackend* gpu);
|
||||
|
@ -30,7 +30,7 @@ void DestroyOverlayTextures();
|
|||
|
||||
namespace SaveStateSelectorUI {
|
||||
|
||||
static constexpr float DEFAULT_OPEN_TIME = 7.5f;
|
||||
inline constexpr float DEFAULT_OPEN_TIME = 7.5f;
|
||||
|
||||
bool IsOpen();
|
||||
void Open(float open_time = DEFAULT_OPEN_TIME);
|
||||
|
|
|
@ -8,7 +8,7 @@ class StateWrapper;
|
|||
|
||||
namespace InterruptController {
|
||||
|
||||
static constexpr u32 NUM_IRQS = 11;
|
||||
inline constexpr u32 NUM_IRQS = 11;
|
||||
|
||||
enum class IRQ : u32
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
JogCon(u32 index);
|
||||
explicit JogCon(u32 index);
|
||||
~JogCon() override;
|
||||
|
||||
static std::unique_ptr<JogCon> Create(u32 index);
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
NeGcon(u32 index);
|
||||
explicit NeGcon(u32 index);
|
||||
~NeGcon() override;
|
||||
|
||||
static std::unique_ptr<NeGcon> Create(u32 index);
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
NeGconRumble(u32 index);
|
||||
explicit NeGconRumble(u32 index);
|
||||
~NeGconRumble() override;
|
||||
|
||||
static std::unique_ptr<NeGconRumble> Create(u32 index);
|
||||
|
@ -148,4 +148,4 @@ private:
|
|||
|
||||
float m_steering_deadzone = 0.00f;
|
||||
float m_steering_sensitivity = 1.00f;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ class GPUBackend;
|
|||
|
||||
namespace PerformanceCounters
|
||||
{
|
||||
static constexpr u32 NUM_FRAME_TIME_SAMPLES = 150;
|
||||
inline constexpr u32 NUM_FRAME_TIME_SAMPLES = 150;
|
||||
using FrameTimeHistory = std::array<float, NUM_FRAME_TIME_SAMPLES>;
|
||||
|
||||
float GetFPS();
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
static const Controller::ControllerInfo INFO;
|
||||
|
||||
PlayStationMouse(u32 index);
|
||||
explicit PlayStationMouse(u32 index);
|
||||
~PlayStationMouse() override;
|
||||
|
||||
static std::unique_ptr<PlayStationMouse> Create(u32 index);
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
#include "common/types.h"
|
||||
|
||||
static constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
|
||||
static constexpr u32 SAVE_STATE_VERSION = 82;
|
||||
static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42;
|
||||
inline constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
|
||||
inline constexpr u32 SAVE_STATE_VERSION = 82;
|
||||
inline constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42;
|
||||
|
||||
static_assert(SAVE_STATE_VERSION >= SAVE_STATE_MINIMUM_VERSION);
|
||||
|
||||
|
@ -36,7 +36,7 @@ struct SAVE_STATE_HEADER
|
|||
u32 media_path_length;
|
||||
u32 offset_to_media_path;
|
||||
u32 media_subimage_index;
|
||||
|
||||
|
||||
// Screenshot compression added in version 69.
|
||||
// Uncompressed size not stored, it can be inferred from width/height.
|
||||
u32 screenshot_compression_type;
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
|
||||
#include "common/types.h"
|
||||
|
||||
static constexpr u32 SHADER_CACHE_VERSION = 33;
|
||||
inline constexpr u32 SHADER_CACHE_VERSION = 33;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "common/types.h"
|
||||
|
||||
#include <array>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
|
@ -15,7 +14,7 @@
|
|||
|
||||
namespace SDLKeyNames {
|
||||
|
||||
static const std::map<int, const char*> s_sdl_key_names = {
|
||||
inline const std::map<int, const char*> s_sdl_key_names = {
|
||||
{SDLK_RETURN, "Return"},
|
||||
{SDLK_ESCAPE, "Escape"},
|
||||
{SDLK_BACKSPACE, "Backspace"},
|
||||
|
@ -246,13 +245,13 @@ static const std::map<int, const char*> s_sdl_key_names = {
|
|||
{SDLK_SLEEP, "Sleep"},
|
||||
};
|
||||
|
||||
static const char* GetKeyName(u32 key)
|
||||
inline const char* GetKeyName(u32 key)
|
||||
{
|
||||
const auto it = s_sdl_key_names.find(key);
|
||||
return it == s_sdl_key_names.end() ? nullptr : it->second;
|
||||
}
|
||||
|
||||
static std::optional<u32> GetKeyCodeForName(const std::string_view& key_name)
|
||||
inline std::optional<u32> GetKeyCodeForName(const std::string_view key_name)
|
||||
{
|
||||
for (const auto& it : s_sdl_key_names)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ class ControllerMacroWidget : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ControllerMacroWidget(ControllerBindingWidget* parent);
|
||||
explicit ControllerMacroWidget(ControllerBindingWidget* parent);
|
||||
~ControllerMacroWidget();
|
||||
|
||||
void updateListItem(u32 index);
|
||||
|
@ -133,7 +133,7 @@ class ControllerCustomSettingsWidget : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ControllerCustomSettingsWidget(ControllerBindingWidget* parent);
|
||||
explicit ControllerCustomSettingsWidget(ControllerBindingWidget* parent);
|
||||
~ControllerCustomSettingsWidget();
|
||||
|
||||
void createSettingWidgets(ControllerBindingWidget* parent, QWidget* parent_widget, QGridLayout* layout,
|
||||
|
|
|
@ -20,7 +20,7 @@ class DebuggerCodeModel final : public QAbstractTableModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerCodeModel(QObject* parent = nullptr);
|
||||
explicit DebuggerCodeModel(QObject* parent = nullptr);
|
||||
~DebuggerCodeModel() override;
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
|
@ -61,7 +61,7 @@ class DebuggerRegistersModel final : public QAbstractListModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerRegistersModel(QObject* parent = nullptr);
|
||||
explicit DebuggerRegistersModel(QObject* parent = nullptr);
|
||||
~DebuggerRegistersModel() override;
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
|
@ -82,7 +82,7 @@ class DebuggerStackModel final : public QAbstractListModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerStackModel(QObject* parent = nullptr);
|
||||
explicit DebuggerStackModel(QObject* parent = nullptr);
|
||||
~DebuggerStackModel() override;
|
||||
|
||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
||||
|
@ -98,7 +98,7 @@ class DebuggerAddBreakpointDialog final : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebuggerAddBreakpointDialog(QWidget* parent = nullptr);
|
||||
explicit DebuggerAddBreakpointDialog(QWidget* parent = nullptr);
|
||||
~DebuggerAddBreakpointDialog() override;
|
||||
|
||||
u32 getAddress() const { return m_address; }
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QSemaphore>
|
||||
#include <QtCore/QThread>
|
||||
|
||||
#include "common/progress_callback.h"
|
||||
|
@ -14,7 +13,7 @@ class GameListRefreshThread;
|
|||
class AsyncRefreshProgressCallback : public ProgressCallback
|
||||
{
|
||||
public:
|
||||
AsyncRefreshProgressCallback(GameListRefreshThread* parent);
|
||||
explicit AsyncRefreshProgressCallback(GameListRefreshThread* parent);
|
||||
|
||||
float timeSinceStart() const;
|
||||
|
||||
|
@ -46,7 +45,7 @@ class GameListRefreshThread final : public QThread
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GameListRefreshThread(bool invalidate_cache);
|
||||
explicit GameListRefreshThread(bool invalidate_cache);
|
||||
~GameListRefreshThread();
|
||||
|
||||
float timeSinceStart() const;
|
||||
|
@ -58,7 +57,7 @@ Q_SIGNALS:
|
|||
void refreshComplete();
|
||||
|
||||
protected:
|
||||
void run();
|
||||
void run() final;
|
||||
|
||||
private:
|
||||
AsyncRefreshProgressCallback m_progress;
|
||||
|
|
|
@ -1037,7 +1037,7 @@ namespace {
|
|||
class GameListCenterIconStyleDelegate final : public QStyledItemDelegate
|
||||
{
|
||||
public:
|
||||
GameListCenterIconStyleDelegate(QWidget* parent) : QStyledItemDelegate(parent) {}
|
||||
explicit GameListCenterIconStyleDelegate(QWidget* parent) : QStyledItemDelegate(parent) {}
|
||||
~GameListCenterIconStyleDelegate() = default;
|
||||
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override
|
||||
|
|
|
@ -210,7 +210,7 @@ class GameListWidget final : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GameListWidget(QWidget* parent = nullptr);
|
||||
explicit GameListWidget(QWidget* parent = nullptr);
|
||||
~GameListWidget();
|
||||
|
||||
ALWAYS_INLINE GameListModel* getModel() const { return m_model; }
|
||||
|
|
|
@ -17,7 +17,7 @@ class InputBindingWidget : public QPushButton
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
InputBindingWidget(QWidget* parent);
|
||||
explicit InputBindingWidget(QWidget* parent);
|
||||
InputBindingWidget(QWidget* parent, SettingsInterface* sif, InputBindingInfo::Type bind_type,
|
||||
std::string section_name, std::string key_name);
|
||||
~InputBindingWidget();
|
||||
|
@ -76,7 +76,7 @@ class InputVibrationBindingWidget : public QPushButton
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
InputVibrationBindingWidget(QWidget* parent);
|
||||
explicit InputVibrationBindingWidget(QWidget* parent);
|
||||
InputVibrationBindingWidget(QWidget* parent, ControllerSettingsWindow* dialog, std::string section_name,
|
||||
std::string key_name);
|
||||
~InputVibrationBindingWidget();
|
||||
|
|
|
@ -12,7 +12,7 @@ class ISOBrowserWindow : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ISOBrowserWindow(QWidget* parent = nullptr);
|
||||
explicit ISOBrowserWindow(QWidget* parent = nullptr);
|
||||
~ISOBrowserWindow();
|
||||
|
||||
static ISOBrowserWindow* createAndOpenFile(QWidget* parent, const QString& path);
|
||||
|
|
|
@ -281,7 +281,7 @@ public:
|
|||
|
||||
using DeviceList = QList<Device>;
|
||||
|
||||
InputDeviceListModel(QObject* parent = nullptr);
|
||||
explicit InputDeviceListModel(QObject* parent = nullptr);
|
||||
~InputDeviceListModel() override;
|
||||
|
||||
// Safe to access on UI thread.
|
||||
|
@ -325,7 +325,7 @@ Q_SIGNALS:
|
|||
void completed(QtAsyncTask* self);
|
||||
|
||||
private:
|
||||
QtAsyncTask(WorkCallback callback);
|
||||
explicit QtAsyncTask(WorkCallback callback);
|
||||
|
||||
std::variant<WorkCallback, CompletionCallback> m_callback;
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ class QtModalProgressCallback final : public QObject, public ProgressCallback
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtModalProgressCallback(QWidget* parent_widget, float show_delay = 0.0f);
|
||||
explicit QtModalProgressCallback(QWidget* parent_widget, float show_delay = 0.0f);
|
||||
~QtModalProgressCallback();
|
||||
|
||||
QProgressDialog& GetDialog() { return m_dialog; }
|
||||
|
@ -53,7 +53,7 @@ class QtAsyncProgressThread : public QThread, public ProgressCallback
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtAsyncProgressThread(QWidget* parent);
|
||||
explicit QtAsyncProgressThread(QWidget* parent);
|
||||
~QtAsyncProgressThread();
|
||||
|
||||
bool IsCancelled() const override;
|
||||
|
|
|
@ -14,7 +14,7 @@ class SelectDiscDialog final : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SelectDiscDialog(const std::string& disc_set_name, QWidget* parent = nullptr);
|
||||
explicit SelectDiscDialog(const std::string& disc_set_name, QWidget* parent = nullptr);
|
||||
~SelectDiscDialog();
|
||||
|
||||
ALWAYS_INLINE const std::string& getSelectedDiscPath() { return m_selected_path; }
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
#include <type_traits>
|
||||
|
||||
namespace SettingWidgetBinder {
|
||||
static constexpr const char* NULLABLE_PROPERTY = "SettingWidgetBinder_isNullable";
|
||||
static constexpr const char* IS_NULL_PROPERTY = "SettingWidgetBinder_isNull";
|
||||
static constexpr const char* GLOBAL_VALUE_PROPERTY = "SettingWidgetBinder_globalValue";
|
||||
inline constexpr const char* NULLABLE_PROPERTY = "SettingWidgetBinder_isNullable";
|
||||
inline constexpr const char* IS_NULL_PROPERTY = "SettingWidgetBinder_isNull";
|
||||
inline constexpr const char* GLOBAL_VALUE_PROPERTY = "SettingWidgetBinder_globalValue";
|
||||
|
||||
template<typename T>
|
||||
struct SettingAccessor
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
class Updater
|
||||
{
|
||||
public:
|
||||
Updater(ProgressCallback* progress);
|
||||
explicit Updater(ProgressCallback* progress);
|
||||
~Updater();
|
||||
|
||||
bool Initialize(std::string staging_directory, std::string destination_directory);
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace {
|
|||
class TrackFileInterface
|
||||
{
|
||||
public:
|
||||
TrackFileInterface(std::string filename);
|
||||
explicit TrackFileInterface(std::string filename);
|
||||
virtual ~TrackFileInterface();
|
||||
|
||||
ALWAYS_INLINE const std::string& GetFileName() const { return m_filename; }
|
||||
|
|
|
@ -172,7 +172,7 @@ IMPLEMENT_ENUM_CLASS_BITWISE_OPERATORS(GPUDriverType);
|
|||
class GPUShader
|
||||
{
|
||||
public:
|
||||
GPUShader(GPUShaderStage stage);
|
||||
explicit GPUShader(GPUShaderStage stage);
|
||||
virtual ~GPUShader();
|
||||
|
||||
static const char* GetStageName(GPUShaderStage stage);
|
||||
|
|
|
@ -36,31 +36,31 @@ namespace ImGuiFullscreen {
|
|||
// end_ptr() for string_view
|
||||
#define IMSTR_START_END(sv) (sv).data(), (sv).data() + (sv).length()
|
||||
|
||||
static constexpr float LAYOUT_SCREEN_WIDTH = 1280.0f;
|
||||
static constexpr float LAYOUT_SCREEN_HEIGHT = 720.0f;
|
||||
static constexpr float LAYOUT_LARGE_FONT_SIZE = 26.0f;
|
||||
static constexpr float LAYOUT_MEDIUM_FONT_SIZE = 16.0f;
|
||||
static constexpr float LAYOUT_MEDIUM_LARGE_FONT_SIZE = 21.0f;
|
||||
static constexpr float LAYOUT_SMALL_FONT_SIZE = 10.0f;
|
||||
static constexpr float LAYOUT_MENU_BUTTON_X_PADDING = 15.0f;
|
||||
static constexpr float LAYOUT_MENU_BUTTON_Y_PADDING = 10.0f;
|
||||
static constexpr float LAYOUT_MENU_BUTTON_SPACING = 6.0f;
|
||||
static constexpr float LAYOUT_MENU_WINDOW_X_PADDING = 12.0f;
|
||||
static constexpr float LAYOUT_MENU_WINDOW_Y_PADDING = 12.0f;
|
||||
static constexpr float LAYOUT_MENU_ITEM_TITLE_SUMMARY_SPACING = 6.0f;
|
||||
static constexpr float LAYOUT_MENU_ITEM_EXTRA_HEIGHT = 2.0f;
|
||||
static constexpr float LAYOUT_FOOTER_PADDING = 10.0f;
|
||||
static constexpr float LAYOUT_FOOTER_HEIGHT = LAYOUT_MEDIUM_FONT_SIZE + LAYOUT_FOOTER_PADDING * 2.0f;
|
||||
static constexpr float LAYOUT_HORIZONTAL_MENU_HEIGHT = 320.0f;
|
||||
static constexpr float LAYOUT_HORIZONTAL_MENU_PADDING = 30.0f;
|
||||
static constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_WIDTH = 250.0f;
|
||||
static constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_IMAGE_SIZE = 150.0f;
|
||||
static constexpr float LAYOUT_SHADOW_OFFSET = 1.0f;
|
||||
static constexpr float LAYOUT_SMALL_POPUP_PADDING = 20.0f;
|
||||
static constexpr float LAYOUT_LARGE_POPUP_PADDING = 30.0f;
|
||||
static constexpr float LAYOUT_LARGE_POPUP_ROUNDING = 40.0f;
|
||||
static constexpr float LAYOUT_WIDGET_FRAME_ROUNDING = 20.0f;
|
||||
static constexpr ImVec2 LAYOUT_CENTER_ALIGN_TEXT = ImVec2(0.5f, 0.0f);
|
||||
inline constexpr float LAYOUT_SCREEN_WIDTH = 1280.0f;
|
||||
inline constexpr float LAYOUT_SCREEN_HEIGHT = 720.0f;
|
||||
inline constexpr float LAYOUT_LARGE_FONT_SIZE = 26.0f;
|
||||
inline constexpr float LAYOUT_MEDIUM_FONT_SIZE = 16.0f;
|
||||
inline constexpr float LAYOUT_MEDIUM_LARGE_FONT_SIZE = 21.0f;
|
||||
inline constexpr float LAYOUT_SMALL_FONT_SIZE = 10.0f;
|
||||
inline constexpr float LAYOUT_MENU_BUTTON_X_PADDING = 15.0f;
|
||||
inline constexpr float LAYOUT_MENU_BUTTON_Y_PADDING = 10.0f;
|
||||
inline constexpr float LAYOUT_MENU_BUTTON_SPACING = 6.0f;
|
||||
inline constexpr float LAYOUT_MENU_WINDOW_X_PADDING = 12.0f;
|
||||
inline constexpr float LAYOUT_MENU_WINDOW_Y_PADDING = 12.0f;
|
||||
inline constexpr float LAYOUT_MENU_ITEM_TITLE_SUMMARY_SPACING = 6.0f;
|
||||
inline constexpr float LAYOUT_MENU_ITEM_EXTRA_HEIGHT = 2.0f;
|
||||
inline constexpr float LAYOUT_FOOTER_PADDING = 10.0f;
|
||||
inline constexpr float LAYOUT_FOOTER_HEIGHT = LAYOUT_MEDIUM_FONT_SIZE + LAYOUT_FOOTER_PADDING * 2.0f;
|
||||
inline constexpr float LAYOUT_HORIZONTAL_MENU_HEIGHT = 320.0f;
|
||||
inline constexpr float LAYOUT_HORIZONTAL_MENU_PADDING = 30.0f;
|
||||
inline constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_WIDTH = 250.0f;
|
||||
inline constexpr float LAYOUT_HORIZONTAL_MENU_ITEM_IMAGE_SIZE = 150.0f;
|
||||
inline constexpr float LAYOUT_SHADOW_OFFSET = 1.0f;
|
||||
inline constexpr float LAYOUT_SMALL_POPUP_PADDING = 20.0f;
|
||||
inline constexpr float LAYOUT_LARGE_POPUP_PADDING = 30.0f;
|
||||
inline constexpr float LAYOUT_LARGE_POPUP_ROUNDING = 40.0f;
|
||||
inline constexpr float LAYOUT_WIDGET_FRAME_ROUNDING = 20.0f;
|
||||
inline constexpr ImVec2 LAYOUT_CENTER_ALIGN_TEXT = ImVec2(0.5f, 0.0f);
|
||||
|
||||
struct ALIGN_TO_CACHE_LINE UIStyles
|
||||
{
|
||||
|
|
|
@ -71,9 +71,9 @@ using TextFontOrder = std::array<TextFont, static_cast<size_t>(TextFont::MaxCoun
|
|||
|
||||
/// Default size for screen margins.
|
||||
#ifndef __ANDROID__
|
||||
static constexpr float DEFAULT_SCREEN_MARGIN = 10.0f;
|
||||
inline constexpr float DEFAULT_SCREEN_MARGIN = 10.0f;
|
||||
#else
|
||||
static constexpr float DEFAULT_SCREEN_MARGIN = 16.0f;
|
||||
inline constexpr float DEFAULT_SCREEN_MARGIN = 16.0f;
|
||||
#endif
|
||||
|
||||
/// Sets the order for text fonts.
|
||||
|
@ -223,11 +223,11 @@ void ProcessAuxiliaryRenderWindowInputEvent(Host::AuxiliaryRenderWindowUserData
|
|||
namespace Host {
|
||||
|
||||
/// Typical durations for OSD messages.
|
||||
static constexpr float OSD_CRITICAL_ERROR_DURATION = 20.0f;
|
||||
static constexpr float OSD_ERROR_DURATION = 15.0f;
|
||||
static constexpr float OSD_WARNING_DURATION = 10.0f;
|
||||
static constexpr float OSD_INFO_DURATION = 5.0f;
|
||||
static constexpr float OSD_QUICK_DURATION = 2.5f;
|
||||
inline constexpr float OSD_CRITICAL_ERROR_DURATION = 20.0f;
|
||||
inline constexpr float OSD_ERROR_DURATION = 15.0f;
|
||||
inline constexpr float OSD_WARNING_DURATION = 10.0f;
|
||||
inline constexpr float OSD_INFO_DURATION = 5.0f;
|
||||
inline constexpr float OSD_QUICK_DURATION = 2.5f;
|
||||
|
||||
/// Adds OSD messages, duration is in seconds.
|
||||
void AddOSDMessage(std::string message, float duration = 2.0f);
|
||||
|
|
|
@ -191,24 +191,24 @@ public:
|
|||
namespace InputManager {
|
||||
|
||||
/// Maximum number of buttons that can be part of a chord.
|
||||
static constexpr u32 MAX_KEYS_PER_BINDING = 4;
|
||||
inline constexpr u32 MAX_KEYS_PER_BINDING = 4;
|
||||
|
||||
/// Maximum number of output vibration motors per pad.
|
||||
static constexpr u32 MAX_MOTORS_PER_PAD = 2;
|
||||
inline constexpr u32 MAX_MOTORS_PER_PAD = 2;
|
||||
|
||||
/// Minimum interval between vibration updates when the effect is continuous.
|
||||
static constexpr double VIBRATION_UPDATE_INTERVAL_SECONDS = 0.5; // 500ms
|
||||
inline constexpr double VIBRATION_UPDATE_INTERVAL_SECONDS = 0.5; // 500ms
|
||||
|
||||
/// Maximum number of host mouse devices.
|
||||
static constexpr u32 MAX_POINTER_DEVICES = 8;
|
||||
static constexpr u32 MAX_POINTER_BUTTONS = 3;
|
||||
inline constexpr u32 MAX_POINTER_DEVICES = 8;
|
||||
inline constexpr u32 MAX_POINTER_BUTTONS = 3;
|
||||
|
||||
/// Maximum number of software cursors. We allocate an extra two for controllers with
|
||||
/// positioning data from the controller instead of a mouse.
|
||||
static constexpr u32 MAX_SOFTWARE_CURSORS = MAX_POINTER_DEVICES + 2;
|
||||
inline constexpr u32 MAX_SOFTWARE_CURSORS = MAX_POINTER_DEVICES + 2;
|
||||
|
||||
/// Number of macro buttons per controller.
|
||||
static constexpr u32 NUM_MACRO_BUTTONS_PER_CONTROLLER = 4;
|
||||
inline constexpr u32 NUM_MACRO_BUTTONS_PER_CONTROLLER = 4;
|
||||
|
||||
/// Returns a pointer to the external input source class, if present.
|
||||
InputSource* GetInputSourceInterface(InputSourceType type);
|
||||
|
|
|
@ -93,8 +93,8 @@ struct ShaderOption
|
|||
};
|
||||
|
||||
namespace Config {
|
||||
static constexpr const char* DISPLAY_CHAIN_SECTION = "PostProcessing";
|
||||
static constexpr const char* INTERNAL_CHAIN_SECTION = "InternalPostProcessing";
|
||||
inline constexpr const char* DISPLAY_CHAIN_SECTION = "PostProcessing";
|
||||
inline constexpr const char* INTERNAL_CHAIN_SECTION = "InternalPostProcessing";
|
||||
|
||||
bool IsEnabled(const SettingsInterface& si, const char* section);
|
||||
u32 GetStageCount(const SettingsInterface& si, const char* section);
|
||||
|
@ -114,7 +114,7 @@ void ClearStages(SettingsInterface& si, const char* section);
|
|||
class Chain final
|
||||
{
|
||||
public:
|
||||
Chain(const char* section);
|
||||
explicit Chain(const char* section);
|
||||
~Chain();
|
||||
|
||||
ALWAYS_INLINE bool HasStages() const { return !m_stages.empty(); }
|
||||
|
|
|
@ -27,7 +27,7 @@ class Shader
|
|||
{
|
||||
public:
|
||||
Shader();
|
||||
Shader(std::string name);
|
||||
explicit Shader(std::string name);
|
||||
virtual ~Shader();
|
||||
|
||||
ALWAYS_INLINE const std::string& GetName() const { return m_name; }
|
||||
|
@ -64,4 +64,4 @@ protected:
|
|||
OptionList m_options;
|
||||
};
|
||||
|
||||
} // namespace PostProcessing
|
||||
} // namespace PostProcessing
|
||||
|
|
Loading…
Reference in New Issue