mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Reformat all the things!
This commit is contained in:
@@ -10,7 +10,7 @@ AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
|
||||
@@ -186,8 +186,9 @@ bool AlsaSound::AlsaInit()
|
||||
// it is probably a bad idea to try to send more than one buffer of data
|
||||
if ((unsigned int)frames_to_deliver > buffer_size)
|
||||
frames_to_deliver = buffer_size;
|
||||
NOTICE_LOG(AUDIO, "ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d "
|
||||
"samples per fragments.",
|
||||
NOTICE_LOG(AUDIO,
|
||||
"ALSA gave us a %ld sample \"hardware\" buffer with %d periods. Will send %d "
|
||||
"samples per fragments.",
|
||||
buffer_size, periods, frames_to_deliver);
|
||||
|
||||
snd_pcm_sw_params_alloca(&swparams);
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
bool SetRunning(bool running) override;
|
||||
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
// maximum number of frames the buffer can hold
|
||||
static constexpr size_t BUFFER_SIZE_MAX = 8192;
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
float GetCurrentSpeed() const { return m_speed.load(); }
|
||||
void UpdateSpeed(float val) { m_speed.store(val); }
|
||||
|
||||
private:
|
||||
static constexpr u32 MAX_SAMPLES = 1024 * 4; // 128 ms
|
||||
static constexpr u32 INDEX_MASK = MAX_SAMPLES * 2 - 1;
|
||||
|
||||
@@ -17,6 +17,7 @@ public:
|
||||
bool Init() override;
|
||||
bool SetRunning(bool running) override { return running; }
|
||||
static bool isValid() { return true; }
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
Common::Event soundSyncEvent;
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
void SetSkipSilence(bool skip) { skip_silence = skip; }
|
||||
void AddStereoSamplesBE(const short* sample_data, u32 count, int sample_rate); // big endian
|
||||
u32 GetAudioSize() const { return audio_size; }
|
||||
|
||||
private:
|
||||
static constexpr size_t BUFFER_SIZE = 32 * 1024;
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ public:
|
||||
|
||||
// For convenience.
|
||||
void Send(AnalyticsReportBuilder& report) { Send(std::move(report)); }
|
||||
|
||||
protected:
|
||||
void ThreadProc();
|
||||
|
||||
|
||||
@@ -201,8 +201,12 @@ bool IsImmLogical(uint64_t value, unsigned int width, unsigned int* n, unsigned
|
||||
// (1 + 2^d + 2^(2d) + ...), i.e. 0x0001000100010001 or similar. These can
|
||||
// be derived using a table lookup on CLZ(d).
|
||||
static const std::array<uint64_t, 6> multipliers = {{
|
||||
0x0000000000000001UL, 0x0000000100000001UL, 0x0001000100010001UL, 0x0101010101010101UL,
|
||||
0x1111111111111111UL, 0x5555555555555555UL,
|
||||
0x0000000000000001UL,
|
||||
0x0000000100000001UL,
|
||||
0x0001000100010001UL,
|
||||
0x0101010101010101UL,
|
||||
0x1111111111111111UL,
|
||||
0x5555555555555555UL,
|
||||
}};
|
||||
|
||||
int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57;
|
||||
|
||||
@@ -147,6 +147,7 @@ public:
|
||||
constexpr operator T() const { return Value(); }
|
||||
constexpr std::size_t StartBit() const { return position; }
|
||||
constexpr std::size_t NumBits() const { return bits; }
|
||||
|
||||
private:
|
||||
// StorageType is T for non-enum types and the underlying type of T if
|
||||
// T is an enumeration. Note that T is wrapped within an enable_if in the
|
||||
|
||||
@@ -164,6 +164,7 @@ public:
|
||||
constexpr int operator*() const { return m_bit; }
|
||||
constexpr bool operator==(Iterator other) const { return m_bit == other.m_bit; }
|
||||
constexpr bool operator!=(Iterator other) const { return m_bit != other.m_bit; }
|
||||
|
||||
private:
|
||||
IntTy m_val;
|
||||
int m_bit;
|
||||
|
||||
@@ -230,6 +230,7 @@ public:
|
||||
// This function should be triggered regularly over time so
|
||||
// that we will fall back from the busy loop to sleeping.
|
||||
void AllowSleep() { m_may_sleep.Set(); }
|
||||
|
||||
private:
|
||||
std::mutex m_wait_lock;
|
||||
std::mutex m_prepare_lock;
|
||||
|
||||
@@ -22,12 +22,12 @@ std::string LastStrerrorString()
|
||||
{
|
||||
char error_message[BUFFER_SIZE];
|
||||
|
||||
// There are two variants of strerror_r. The XSI version stores the message to the passed-in
|
||||
// buffer and returns an int (0 on success). The GNU version returns a pointer to the message,
|
||||
// which might have been stored in the passed-in buffer or might be a static string.
|
||||
// There are two variants of strerror_r. The XSI version stores the message to the passed-in
|
||||
// buffer and returns an int (0 on success). The GNU version returns a pointer to the message,
|
||||
// which might have been stored in the passed-in buffer or might be a static string.
|
||||
|
||||
// We check defines in order to figure out variant is in use, and we store the returned value
|
||||
// to a variable so that we'll get a compile-time check that our assumption was correct.
|
||||
// We check defines in order to figure out variant is in use, and we store the returned value
|
||||
// to a variable so that we'll get a compile-time check that our assumption was correct.
|
||||
|
||||
#if defined(__GLIBC__) && (_GNU_SOURCE || (_POSIX_C_SOURCE < 200112L && _XOPEN_SOURCE < 600))
|
||||
const char* str = strerror_r(errno, error_message, BUFFER_SIZE);
|
||||
|
||||
@@ -203,8 +203,7 @@ static bool GetModuleVersion(const wchar_t* name, Version* version)
|
||||
|
||||
void CompatPatchesInstall(LdrWatcher* watcher)
|
||||
{
|
||||
watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"},
|
||||
[](const LdrDllLoadEvent& event) {
|
||||
watcher->Install({{L"EZFRD64.dll", L"811EZFRD64.DLL"}, [](const LdrDllLoadEvent& event) {
|
||||
// *EZFRD64 is incldued in software packages for cheapo third-party gamepads
|
||||
// (and gamepad adapters). The module cannot handle its heap being above 4GB,
|
||||
// which tends to happen very often on modern Windows.
|
||||
@@ -214,8 +213,7 @@ void CompatPatchesInstall(LdrWatcher* watcher)
|
||||
auto patcher = ImportPatcher(event.base_address);
|
||||
patcher.PatchIAT("kernel32.dll", "HeapCreate", HeapCreateLow4GB);
|
||||
}});
|
||||
watcher->Install({{L"ucrtbase.dll"},
|
||||
[](const LdrDllLoadEvent& event) {
|
||||
watcher->Install({{L"ucrtbase.dll"}, [](const LdrDllLoadEvent& event) {
|
||||
// ucrtbase implements caching between fseek/fread, old versions have a bug
|
||||
// such that some reads return incorrect data. This causes noticable bugs
|
||||
// in dolphin since we use these APIs for reading game images.
|
||||
|
||||
@@ -34,7 +34,12 @@ enum class System
|
||||
};
|
||||
|
||||
constexpr std::array<LayerType, 7> SEARCH_ORDER{{
|
||||
LayerType::CurrentRun, LayerType::CommandLine, LayerType::Movie, LayerType::Netplay,
|
||||
LayerType::LocalGame, LayerType::GlobalGame, LayerType::Base,
|
||||
LayerType::CurrentRun,
|
||||
LayerType::CommandLine,
|
||||
LayerType::Movie,
|
||||
LayerType::Netplay,
|
||||
LayerType::LocalGame,
|
||||
LayerType::GlobalGame,
|
||||
LayerType::Base,
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
Section(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
|
||||
iterator begin() const { return m_begin; }
|
||||
iterator end() const { return m_end; }
|
||||
|
||||
private:
|
||||
iterator m_begin;
|
||||
iterator m_end;
|
||||
@@ -81,6 +82,7 @@ public:
|
||||
ConstSection(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
|
||||
iterator begin() const { return m_begin; }
|
||||
iterator end() const { return m_end; }
|
||||
|
||||
private:
|
||||
iterator m_begin;
|
||||
iterator m_end;
|
||||
|
||||
@@ -12,6 +12,7 @@ class DebugInterface
|
||||
{
|
||||
protected:
|
||||
virtual ~DebugInterface() {}
|
||||
|
||||
public:
|
||||
virtual std::string Disassemble(unsigned int /*address*/) { return "NODEBUGGER"; }
|
||||
virtual std::string GetRawMemoryString(int /*memory*/, unsigned int /*address*/)
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
T& front() { return storage[head]; }
|
||||
const T& front() const { return storage[head]; }
|
||||
size_t size() const { return count; }
|
||||
|
||||
private:
|
||||
std::array<T, N> storage;
|
||||
int head = 0;
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
}
|
||||
|
||||
bool TestAndClear() { return TestAndSet(false); }
|
||||
|
||||
private:
|
||||
std::atomic_bool m_val;
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,8 @@ void cInterfaceEGL::DetectMode()
|
||||
EGLint num_configs;
|
||||
bool supportsGL = false, supportsGLES2 = false, supportsGLES3 = false;
|
||||
std::array<int, 3> renderable_types{{
|
||||
EGL_OPENGL_BIT, (1 << 6), /* EGL_OPENGL_ES3_BIT_KHR */
|
||||
EGL_OPENGL_BIT,
|
||||
(1 << 6), /* EGL_OPENGL_ES3_BIT_KHR */
|
||||
EGL_OPENGL_ES2_BIT,
|
||||
}};
|
||||
|
||||
@@ -237,7 +238,13 @@ bool cInterfaceEGL::Create(void* window_handle, bool stereo, bool core)
|
||||
if (supports_core_profile && core && s_opengl_mode == GLInterfaceMode::MODE_OPENGL)
|
||||
{
|
||||
std::array<std::pair<int, int>, 7> versions_to_try = {{
|
||||
{4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3},
|
||||
{4, 5},
|
||||
{4, 4},
|
||||
{4, 3},
|
||||
{4, 2},
|
||||
{4, 1},
|
||||
{4, 0},
|
||||
{3, 3},
|
||||
}};
|
||||
|
||||
for (const auto& version : versions_to_try)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user