mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-09 08:47:48 +00:00
Compare commits
49 Commits
076d0dfd09
...
5195cfcd09
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5195cfcd09 | ||
![]() |
1786e34bd3 | ||
![]() |
65f3ba70f5 | ||
![]() |
ec52a74967 | ||
![]() |
8b7669550f | ||
![]() |
46e66fe945 | ||
![]() |
056ece6f29 | ||
![]() |
a07a2fe398 | ||
![]() |
5906512847 | ||
![]() |
52fcdde485 | ||
![]() |
752cd4d449 | ||
![]() |
5eb61024c6 | ||
![]() |
a27b845514 | ||
![]() |
1b1ca019a4 | ||
![]() |
241834709b | ||
![]() |
c3d3b81533 | ||
![]() |
774a84a953 | ||
![]() |
b3f50c969e | ||
![]() |
3b83907b88 | ||
![]() |
d940d62cae | ||
![]() |
7afa9e6c6f | ||
![]() |
12d178a8df | ||
![]() |
f910c1d934 | ||
![]() |
70abcb2030 | ||
![]() |
d8ea31ca46 | ||
![]() |
2ae43324cb | ||
![]() |
7d59c2743d | ||
![]() |
8113399b68 | ||
![]() |
bafe78203d | ||
![]() |
15f125ebee | ||
![]() |
316740daed | ||
![]() |
9ec69b5925 | ||
![]() |
d7de49ccf6 | ||
![]() |
2de9122b5f | ||
![]() |
bae0e5f67a | ||
![]() |
2ae928ca79 | ||
![]() |
f04f659710 | ||
![]() |
ec1d659363 | ||
![]() |
c37933932d | ||
![]() |
23af1e025b | ||
![]() |
135b6840e5 | ||
![]() |
e3df00b7f4 | ||
![]() |
71da0f2d24 | ||
![]() |
8192d9d2a9 | ||
![]() |
a6b04f53e0 | ||
![]() |
a6a5e201b6 | ||
![]() |
7c237bbd7c | ||
![]() |
f240e20e3f | ||
![]() |
096ab8c026 |
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -84,6 +84,9 @@
|
||||
[submodule "Externals/Vulkan-Headers"]
|
||||
path = Externals/Vulkan-Headers
|
||||
url = https://github.com/KhronosGroup/Vulkan-Headers.git
|
||||
[submodule "Externals/watcher/watcher"]
|
||||
path = Externals/watcher/watcher
|
||||
url = https://github.com/e-dant/watcher.git
|
||||
[submodule "Externals/SFML/SFML"]
|
||||
path = Externals/SFML/SFML
|
||||
url = https://github.com/SFML/SFML.git
|
||||
|
@ -784,6 +784,8 @@ if (USE_RETRO_ACHIEVEMENTS)
|
||||
add_subdirectory(Externals/rcheevos)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Externals/watcher)
|
||||
|
||||
########################################
|
||||
# Pre-build events: Define configuration variables and write SCM info header
|
||||
#
|
||||
|
4
Externals/watcher/CMakeLists.txt
vendored
Normal file
4
Externals/watcher/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
add_library(watcher INTERFACE IMPORTED GLOBAL)
|
||||
set_target_properties(watcher PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/watcher/include
|
||||
)
|
1
Externals/watcher/watcher
vendored
Submodule
1
Externals/watcher/watcher
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b03bdcfc11549df595b77239cefe2643943a3e2f
|
@ -3,9 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#if defined(HAVE_ALSA) && HAVE_ALSA
|
||||
|
@ -166,7 +166,8 @@ void UpdateSoundStream(Core::System& system)
|
||||
|
||||
if (sound_stream)
|
||||
{
|
||||
int volume = Config::Get(Config::MAIN_AUDIO_MUTED) ? 0 : Config::Get(Config::MAIN_AUDIO_VOLUME);
|
||||
int const volume =
|
||||
Config::Get(Config::MAIN_AUDIO_MUTED) ? 0 : Config::Get(Config::MAIN_AUDIO_VOLUME);
|
||||
sound_stream->SetVolume(volume);
|
||||
}
|
||||
}
|
||||
@ -192,7 +193,7 @@ void SetSoundStreamRunning(Core::System& system, bool running)
|
||||
|
||||
void SendAIBuffer(Core::System& system, const short* samples, unsigned int num_samples)
|
||||
{
|
||||
SoundStream* sound_stream = system.GetSoundStream();
|
||||
const SoundStream* const sound_stream = system.GetSoundStream();
|
||||
|
||||
if (!sound_stream)
|
||||
return;
|
||||
@ -212,9 +213,9 @@ void SendAIBuffer(Core::System& system, const short* samples, unsigned int num_s
|
||||
|
||||
void StartAudioDump(Core::System& system)
|
||||
{
|
||||
SoundStream* sound_stream = system.GetSoundStream();
|
||||
const SoundStream* const sound_stream = system.GetSoundStream();
|
||||
|
||||
std::time_t start_time = std::time(nullptr);
|
||||
std::time_t const start_time = std::time(nullptr);
|
||||
|
||||
std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID();
|
||||
|
||||
@ -232,7 +233,7 @@ void StartAudioDump(Core::System& system)
|
||||
|
||||
void StopAudioDump(Core::System& system)
|
||||
{
|
||||
SoundStream* sound_stream = system.GetSoundStream();
|
||||
const SoundStream* const sound_stream = system.GetSoundStream();
|
||||
|
||||
if (!sound_stream)
|
||||
return;
|
||||
@ -265,7 +266,7 @@ void DecreaseVolume(Core::System& system, unsigned short offset)
|
||||
|
||||
void ToggleMuteVolume(Core::System& system)
|
||||
{
|
||||
bool isMuted = Config::Get(Config::MAIN_AUDIO_MUTED);
|
||||
bool const isMuted = Config::Get(Config::MAIN_AUDIO_MUTED);
|
||||
Config::SetBaseOrCurrent(Config::MAIN_AUDIO_MUTED, !isMuted);
|
||||
UpdateSoundStream(system);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "Common/Event.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/ScopeGuard.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -23,7 +22,7 @@ constexpr u32 BUFFER_SAMPLES = 512;
|
||||
long CubebStream::DataCallback(cubeb_stream* stream, void* user_data, const void* /*input_buffer*/,
|
||||
void* output_buffer, long num_frames)
|
||||
{
|
||||
auto* self = static_cast<CubebStream*>(user_data);
|
||||
const auto* const self = static_cast<CubebStream*>(user_data);
|
||||
|
||||
if (self->m_stereo)
|
||||
self->m_mixer->Mix(static_cast<short*>(output_buffer), num_frames);
|
||||
@ -44,7 +43,7 @@ CubebStream::CubebStream()
|
||||
Common::Event sync_event;
|
||||
m_work_queue.Push([this, &sync_event] {
|
||||
Common::ScopeGuard sync_event_guard([&sync_event] { sync_event.Set(); });
|
||||
auto result = ::CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE);
|
||||
auto const result = CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE);
|
||||
m_coinit_success = result == S_OK;
|
||||
m_should_couninit = result == S_OK || result == S_FALSE;
|
||||
});
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
@ -182,7 +182,8 @@ std::size_t Mixer::MixSurround(float* samples, std::size_t num_samples)
|
||||
|
||||
memset(samples, 0, num_samples * SURROUND_CHANNELS * sizeof(float));
|
||||
|
||||
std::size_t needed_frames = m_surround_decoder.QueryFramesNeededForSurroundOutput(num_samples);
|
||||
std::size_t const needed_frames =
|
||||
m_surround_decoder.QueryFramesNeededForSurroundOutput(num_samples);
|
||||
|
||||
constexpr std::size_t max_samples = 0x8000;
|
||||
ASSERT_MSG(AUDIO, needed_frames <= max_samples,
|
||||
@ -190,7 +191,7 @@ std::size_t Mixer::MixSurround(float* samples, std::size_t num_samples)
|
||||
needed_frames, max_samples);
|
||||
|
||||
std::array<s16, max_samples> buffer;
|
||||
std::size_t available_frames = Mix(buffer.data(), static_cast<std::size_t>(needed_frames));
|
||||
std::size_t const available_frames = Mix(buffer.data(), static_cast<std::size_t>(needed_frames));
|
||||
if (available_frames != needed_frames)
|
||||
{
|
||||
ERROR_LOG_FMT(AUDIO,
|
||||
@ -229,7 +230,7 @@ void Mixer::PushSamples(const s16* samples, std::size_t num_samples)
|
||||
if (m_log_dsp_audio)
|
||||
{
|
||||
const s32 sample_rate_divisor = m_dma_mixer.GetInputSampleRateDivisor();
|
||||
auto volume = m_dma_mixer.GetVolume();
|
||||
auto const volume = m_dma_mixer.GetVolume();
|
||||
m_wave_writer_dsp.AddStereoSamplesBE(samples, static_cast<u32>(num_samples),
|
||||
sample_rate_divisor, volume.first, volume.second);
|
||||
}
|
||||
@ -241,7 +242,7 @@ void Mixer::PushStreamingSamples(const s16* samples, std::size_t num_samples)
|
||||
if (m_log_dtk_audio)
|
||||
{
|
||||
const s32 sample_rate_divisor = m_streaming_mixer.GetInputSampleRateDivisor();
|
||||
auto volume = m_streaming_mixer.GetVolume();
|
||||
auto const volume = m_streaming_mixer.GetVolume();
|
||||
m_wave_writer_dtk.AddStereoSamplesBE(samples, static_cast<u32>(num_samples),
|
||||
sample_rate_divisor, volume.first, volume.second);
|
||||
}
|
||||
@ -286,7 +287,8 @@ void Mixer::PushSkylanderPortalSamples(const u8* samples, std::size_t num_sample
|
||||
{
|
||||
for (std::size_t i = 0; i < num_samples; ++i)
|
||||
{
|
||||
s16 sample = static_cast<u16>(samples[i * 2 + 1]) << 8 | static_cast<u16>(samples[i * 2]);
|
||||
s16 const sample =
|
||||
static_cast<u16>(samples[i * 2 + 1]) << 8 | static_cast<u16>(samples[i * 2]);
|
||||
samples_stereo[i * 2] = sample;
|
||||
samples_stereo[i * 2 + 1] = sample;
|
||||
}
|
||||
@ -335,7 +337,8 @@ void Mixer::StartLogDTKAudio(const std::string& filename)
|
||||
{
|
||||
if (!m_log_dtk_audio)
|
||||
{
|
||||
bool success = m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRateDivisor());
|
||||
bool const success =
|
||||
m_wave_writer_dtk.Start(filename, m_streaming_mixer.GetInputSampleRateDivisor());
|
||||
if (success)
|
||||
{
|
||||
m_log_dtk_audio = true;
|
||||
@ -372,7 +375,7 @@ void Mixer::StartLogDSPAudio(const std::string& filename)
|
||||
{
|
||||
if (!m_log_dsp_audio)
|
||||
{
|
||||
bool success = m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRateDivisor());
|
||||
bool const success = m_wave_writer_dsp.Start(filename, m_dma_mixer.GetInputSampleRateDivisor());
|
||||
if (success)
|
||||
{
|
||||
m_log_dsp_audio = true;
|
||||
@ -494,10 +497,10 @@ void Mixer::MixerFifo::Enqueue()
|
||||
0.0002984010f, 0.0002102045f, 0.0001443499f, 0.0000961509f, 0.0000616906f, 0.0000377350f,
|
||||
0.0000216492f, 0.0000113187f, 0.0000050749f, 0.0000016272f};
|
||||
|
||||
const std::size_t head = m_queue_head.load(std::memory_order_acquire);
|
||||
std::size_t const head = m_queue_head.load(std::memory_order_acquire);
|
||||
|
||||
// Check if we run out of space in the circular queue. (rare)
|
||||
std::size_t next_head = (head + 1) & GRANULE_QUEUE_MASK;
|
||||
std::size_t const next_head = (head + 1) & GRANULE_QUEUE_MASK;
|
||||
if (next_head == m_queue_tail.load(std::memory_order_acquire))
|
||||
{
|
||||
WARN_LOG_FMT(AUDIO,
|
||||
|
@ -3,11 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
|
||||
#include "AudioCommon/SurroundDecoder.h"
|
||||
#include "AudioCommon/WaveFile.h"
|
||||
|
@ -76,7 +76,7 @@ static bool InitLibrary()
|
||||
|
||||
if (!InitFunctions())
|
||||
{
|
||||
::FreeLibrary(s_openal_dll);
|
||||
FreeLibrary(s_openal_dll);
|
||||
s_openal_dll = nullptr;
|
||||
return false;
|
||||
}
|
||||
@ -168,7 +168,7 @@ bool OpenALStream::SetRunning(bool running)
|
||||
|
||||
static ALenum CheckALError(const char* desc)
|
||||
{
|
||||
ALenum err = palGetError();
|
||||
ALenum const err = palGetError();
|
||||
|
||||
if (err != AL_NO_ERROR)
|
||||
{
|
||||
@ -211,16 +211,16 @@ void OpenALStream::SoundLoop()
|
||||
{
|
||||
Common::SetCurrentThreadName("Audio thread - openal");
|
||||
|
||||
bool float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
|
||||
bool surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
|
||||
bool const float32_capable = palIsExtensionPresent("AL_EXT_float32") != 0;
|
||||
bool const surround_capable = palIsExtensionPresent("AL_EXT_MCFORMATS") || IsCreativeXFi();
|
||||
bool use_surround = Config::ShouldUseDPL2Decoder() && surround_capable;
|
||||
|
||||
// As there is no extension to check for 32-bit fixed point support
|
||||
// and we know that only a X-Fi with hardware OpenAL supports it,
|
||||
// we just check if one is being used.
|
||||
bool fixed32_capable = IsCreativeXFi();
|
||||
bool const fixed32_capable = IsCreativeXFi();
|
||||
|
||||
u32 frequency = m_mixer->GetSampleRate();
|
||||
u32 const frequency = m_mixer->GetSampleRate();
|
||||
|
||||
u32 frames_per_buffer;
|
||||
// Can't have zero samples per buffer
|
||||
@ -288,12 +288,12 @@ void OpenALStream::SoundLoop()
|
||||
num_buffers_queued -= num_buffers_processed;
|
||||
}
|
||||
|
||||
unsigned int min_frames = frames_per_buffer;
|
||||
unsigned int const min_frames = frames_per_buffer;
|
||||
|
||||
if (use_surround)
|
||||
{
|
||||
std::array<float, OAL_MAX_FRAMES * SURROUND_CHANNELS> dpl2;
|
||||
u32 rendered_frames = static_cast<u32>(m_mixer->MixSurround(dpl2.data(), min_frames));
|
||||
u32 const rendered_frames = static_cast<u32>(m_mixer->MixSurround(dpl2.data(), min_frames));
|
||||
|
||||
if (rendered_frames < min_frames)
|
||||
continue;
|
||||
@ -351,7 +351,8 @@ void OpenALStream::SoundLoop()
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 rendered_frames = static_cast<u32>(m_mixer->Mix(m_realtime_buffer.data(), min_frames));
|
||||
u32 const rendered_frames =
|
||||
static_cast<u32>(m_mixer->Mix(m_realtime_buffer.data(), min_frames));
|
||||
|
||||
if (!rendered_frames)
|
||||
continue;
|
||||
|
@ -7,9 +7,6 @@
|
||||
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/Event.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/AudioInterface.h"
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <al.h>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#endif
|
||||
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Flag.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
|
@ -32,7 +32,7 @@ size_t SurroundDecoder::QueryFramesNeededForSurroundOutput(const size_t output_f
|
||||
if (m_decoded_fifo.size() < output_frames * SURROUND_CHANNELS)
|
||||
{
|
||||
// Output stereo frames needed to have at least the desired number of surround frames
|
||||
size_t frames_needed = output_frames - m_decoded_fifo.size() / SURROUND_CHANNELS;
|
||||
size_t const frames_needed = output_frames - m_decoded_fifo.size() / SURROUND_CHANNELS;
|
||||
return frames_needed + m_frame_block_size - frames_needed % m_frame_block_size;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
// clang-format off
|
||||
#include <Audioclient.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <devpkey.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
#include <wil/resource.h>
|
||||
// clang-format on
|
||||
@ -159,8 +158,9 @@ ComPtr<IMMDevice> WASAPIStream::GetDeviceByName(std::string_view name)
|
||||
bool WASAPIStream::Init()
|
||||
{
|
||||
ASSERT(m_enumerator == nullptr);
|
||||
HRESULT result = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(m_enumerator.GetAddressOf()));
|
||||
HRESULT const result =
|
||||
CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(m_enumerator.GetAddressOf()));
|
||||
|
||||
if (!HandleWinAPI("Failed to create MMDeviceEnumerator", result))
|
||||
return false;
|
||||
|
@ -32,7 +32,7 @@ class WASAPIStream final : public SoundStream
|
||||
#ifdef _WIN32
|
||||
public:
|
||||
explicit WASAPIStream();
|
||||
~WASAPIStream();
|
||||
~WASAPIStream() override;
|
||||
bool Init() override;
|
||||
bool SetRunning(bool running) override;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
{
|
||||
m_active_block = &m_output_result.blocks.emplace_back(base_addr);
|
||||
}
|
||||
virtual ~GekkoIRPlugin() = default;
|
||||
~GekkoIRPlugin() override = default;
|
||||
|
||||
void OnDirectivePre(GekkoDirective directive) override;
|
||||
void OnDirectivePost(GekkoDirective directive) override;
|
||||
|
@ -64,6 +64,8 @@ add_library(common
|
||||
FatFsUtil.h
|
||||
FileSearch.cpp
|
||||
FileSearch.h
|
||||
FilesystemWatcher.cpp
|
||||
FilesystemWatcher.h
|
||||
FileUtil.cpp
|
||||
FileUtil.h
|
||||
FixedSizeQueue.h
|
||||
@ -184,6 +186,7 @@ PRIVATE
|
||||
FatFs
|
||||
Iconv::Iconv
|
||||
spng::spng
|
||||
watcher
|
||||
${VTUNE_LIBRARIES}
|
||||
)
|
||||
|
||||
|
@ -46,8 +46,7 @@ public:
|
||||
ASSERT(!mbedtls_aes_setkey_dec(&ctx, key, 128));
|
||||
}
|
||||
|
||||
virtual bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out,
|
||||
size_t len) const override
|
||||
bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out, size_t len) const override
|
||||
{
|
||||
std::array<u8, BLOCK_SIZE> iv_tmp{};
|
||||
if (iv)
|
||||
@ -206,8 +205,7 @@ public:
|
||||
_mm_storeu_si128(&((__m128i*)buf_out)[d], block[d]);
|
||||
}
|
||||
|
||||
virtual bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out,
|
||||
size_t len) const override
|
||||
bool Crypt(const u8* iv, u8* iv_out, const u8* buf_in, u8* buf_out, size_t len) const override
|
||||
{
|
||||
if (len % BLOCK_SIZE)
|
||||
return false;
|
||||
|
@ -41,18 +41,18 @@ public:
|
||||
mbedtls_sha1_init(&ctx);
|
||||
ASSERT(!mbedtls_sha1_starts_ret(&ctx));
|
||||
}
|
||||
~ContextMbed() { mbedtls_sha1_free(&ctx); }
|
||||
virtual void Update(const u8* msg, size_t len) override
|
||||
~ContextMbed() override { mbedtls_sha1_free(&ctx); }
|
||||
void Update(const u8* msg, size_t len) override
|
||||
{
|
||||
ASSERT(!mbedtls_sha1_update_ret(&ctx, msg, len));
|
||||
}
|
||||
virtual Digest Finish() override
|
||||
Digest Finish() override
|
||||
{
|
||||
Digest digest;
|
||||
ASSERT(!mbedtls_sha1_finish_ret(&ctx, digest.data()));
|
||||
return digest;
|
||||
}
|
||||
virtual bool HwAccelerated() const override { return false; }
|
||||
bool HwAccelerated() const override { return false; }
|
||||
|
||||
private:
|
||||
mbedtls_sha1_context ctx{};
|
||||
@ -204,7 +204,7 @@ private:
|
||||
}
|
||||
|
||||
ATTRIBUTE_TARGET("sha")
|
||||
virtual void ProcessBlock(const u8* msg) override
|
||||
void ProcessBlock(const u8* msg) override
|
||||
{
|
||||
// There are 80 rounds with 4 bytes per round, giving 0x140 byte work space, but we can keep
|
||||
// active state in just 0x40 bytes.
|
||||
@ -248,7 +248,7 @@ private:
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
virtual Digest GetDigest() override
|
||||
Digest GetDigest() override
|
||||
{
|
||||
Digest digest;
|
||||
_mm_storeu_si128((__m128i*)&digest[0], byterev_16B(state[0]));
|
||||
@ -257,7 +257,7 @@ private:
|
||||
return digest;
|
||||
}
|
||||
|
||||
virtual bool HwAccelerated() const override { return true; }
|
||||
bool HwAccelerated() const override { return true; }
|
||||
|
||||
std::array<XmmReg, 2> state{};
|
||||
};
|
||||
|
@ -872,7 +872,7 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
||||
s_user_paths[D_DUMPDEBUG_IDX] + DUMP_DEBUG_BRANCHWATCH_DIR DIR_SEP;
|
||||
s_user_paths[D_DUMPDEBUG_JITBLOCKS_IDX] =
|
||||
s_user_paths[D_DUMPDEBUG_IDX] + DUMP_DEBUG_JITBLOCKS_DIR DIR_SEP;
|
||||
s_user_paths[D_LOGS_IDX] = s_user_paths[D_APPLICATIONSTATE_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_LOGS_IDX] = s_user_paths[D_USER_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
s_user_paths[D_THEMES_IDX] = s_user_paths[D_USER_IDX] + THEMES_DIR DIR_SEP;
|
||||
s_user_paths[D_STYLES_IDX] = s_user_paths[D_USER_IDX] + STYLES_DIR DIR_SEP;
|
||||
@ -936,23 +936,27 @@ static void RebuildUserDirectories(unsigned int dir_index)
|
||||
|
||||
case D_APPLICATIONSTATE_IDX:
|
||||
// Use legacy locations if they already exist.
|
||||
s_user_paths[D_LOGS_IDX] = Exists(s_user_paths[D_USER_IDX] + LOGS_DIR DIR_SEP) ?
|
||||
s_user_paths[D_USER_IDX] + LOGS_DIR DIR_SEP :
|
||||
s_user_paths[D_APPLICATIONSTATE_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[F_QSETTINGSCONFIG_IDX] =
|
||||
Exists(s_user_paths[D_CONFIG_IDX] + QSETTINGS_CONFIG) ?
|
||||
s_user_paths[D_CONFIG_IDX] + QSETTINGS_CONFIG :
|
||||
s_user_paths[D_APPLICATIONSTATE_IDX] + QSETTINGS_CONFIG;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
if (!Exists(s_user_paths[F_QSETTINGSCONFIG_IDX]))
|
||||
s_user_paths[F_QSETTINGSCONFIG_IDX] = s_user_paths[D_APPLICATIONSTATE_IDX] + QSETTINGS_CONFIG;
|
||||
if (!Exists(s_user_paths[D_LOGS_IDX]))
|
||||
{
|
||||
s_user_paths[D_LOGS_IDX] = s_user_paths[D_APPLICATIONSTATE_IDX] + LOGS_DIR DIR_SEP;
|
||||
s_user_paths[F_MAINLOG_IDX] = s_user_paths[D_LOGS_IDX] + MAIN_LOG;
|
||||
s_user_paths[D_MAILLOGS_IDX] = s_user_paths[D_LOGS_IDX] + MAIL_LOGS_DIR DIR_SEP;
|
||||
}
|
||||
break;
|
||||
|
||||
case D_CACHE_IDX:
|
||||
s_user_paths[D_COVERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + COVERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_REDUMPCACHE_IDX] = s_user_paths[D_CACHE_IDX] + REDUMPCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
s_user_paths[D_RETROACHIEVEMENTSCACHE_IDX] =
|
||||
s_user_paths[D_CACHE_IDX] + RETROACHIEVEMENTSCACHE_DIR DIR_SEP;
|
||||
// Use legacy locations if they already exist.
|
||||
if (!Exists(s_user_paths[D_COVERCACHE_IDX]))
|
||||
s_user_paths[D_COVERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + COVERCACHE_DIR DIR_SEP;
|
||||
if (!Exists(s_user_paths[D_REDUMPCACHE_IDX]))
|
||||
s_user_paths[D_REDUMPCACHE_IDX] = s_user_paths[D_CACHE_IDX] + REDUMPCACHE_DIR DIR_SEP;
|
||||
if (!Exists(s_user_paths[D_SHADERCACHE_IDX]))
|
||||
s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP;
|
||||
if (!Exists(s_user_paths[D_RETROACHIEVEMENTSCACHE_IDX]))
|
||||
s_user_paths[D_RETROACHIEVEMENTSCACHE_IDX] =
|
||||
s_user_paths[D_CACHE_IDX] + RETROACHIEVEMENTSCACHE_DIR DIR_SEP;
|
||||
break;
|
||||
|
||||
case D_GCUSER_IDX:
|
||||
|
@ -236,18 +236,6 @@ std::string GetThemeDir(const std::string& theme_name);
|
||||
// Returns the path to where the sys file are
|
||||
const std::string& GetSysDirectory();
|
||||
|
||||
// Returns the last modified time of the file or directory at the given path.
|
||||
std::chrono::system_clock::time_point GetLastModifiedTime(const std::string& path);
|
||||
|
||||
// Converts a file time to a system time point.
|
||||
std::chrono::system_clock::time_point FileTimeToSysTime(std::filesystem::file_time_type file_time);
|
||||
|
||||
// Migrates a file from old_path to new_path.
|
||||
void MigrateFile(const std::string& old_path, const std::string& new_path);
|
||||
|
||||
// Migrates a directory from old_path to new_path.
|
||||
void MigrateDirectory(const std::string& old_path, const std::string& new_path);
|
||||
|
||||
#ifdef ANDROID
|
||||
void SetSysDirectory(const std::string& path);
|
||||
void SetGpuDriverDirectories(const std::string& path, const std::string& lib_path);
|
||||
|
67
Source/Core/Common/FilesystemWatcher.cpp
Normal file
67
Source/Core/Common/FilesystemWatcher.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
// Copyright 2025 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "Common/FilesystemWatcher.h"
|
||||
|
||||
#include <wtr/watcher.hpp>
|
||||
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
namespace Common
|
||||
{
|
||||
FilesystemWatcher::FilesystemWatcher() = default;
|
||||
FilesystemWatcher::~FilesystemWatcher() = default;
|
||||
|
||||
void FilesystemWatcher::Watch(const std::string& path)
|
||||
{
|
||||
const auto [iter, inserted] = m_watched_paths.try_emplace(path, nullptr);
|
||||
if (inserted)
|
||||
{
|
||||
iter->second = std::make_unique<wtr::watch>(path, [this](wtr::event e) {
|
||||
const auto watched_path = PathToString(e.path_name);
|
||||
if (e.path_type == wtr::event::path_type::watcher)
|
||||
{
|
||||
if (watched_path.starts_with('e'))
|
||||
ERROR_LOG_FMT(COMMON, "Filesystem watcher: '{}'", watched_path);
|
||||
else if (watched_path.starts_with('w'))
|
||||
WARN_LOG_FMT(COMMON, "Filesystem watcher: '{}'", watched_path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.effect_type == wtr::event::effect_type::create)
|
||||
{
|
||||
const auto path = WithUnifiedPathSeparators(watched_path);
|
||||
PathAdded(path);
|
||||
}
|
||||
else if (e.effect_type == wtr::event::effect_type::modify)
|
||||
{
|
||||
const auto path = WithUnifiedPathSeparators(watched_path);
|
||||
PathModified(path);
|
||||
}
|
||||
else if (e.effect_type == wtr::event::effect_type::rename)
|
||||
{
|
||||
if (!e.associated)
|
||||
{
|
||||
WARN_LOG_FMT(COMMON, "Rename on path '{}' seen without association!", watched_path);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto old_path = WithUnifiedPathSeparators(watched_path);
|
||||
const auto new_path = WithUnifiedPathSeparators(PathToString(e.associated->path_name));
|
||||
PathRenamed(old_path, new_path);
|
||||
}
|
||||
else if (e.effect_type == wtr::event::effect_type::destroy)
|
||||
{
|
||||
const auto path = WithUnifiedPathSeparators(watched_path);
|
||||
PathDeleted(path);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void FilesystemWatcher::Unwatch(const std::string& path)
|
||||
{
|
||||
m_watched_paths.erase(path);
|
||||
}
|
||||
} // namespace Common
|
47
Source/Core/Common/FilesystemWatcher.h
Normal file
47
Source/Core/Common/FilesystemWatcher.h
Normal file
@ -0,0 +1,47 @@
|
||||
// Copyright 2025 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace wtr
|
||||
{
|
||||
inline namespace watcher
|
||||
{
|
||||
class watch;
|
||||
}
|
||||
} // namespace wtr
|
||||
|
||||
namespace Common
|
||||
{
|
||||
// A class that can watch a path and receive callbacks
|
||||
// when files or directories underneath that path receive events
|
||||
class FilesystemWatcher
|
||||
{
|
||||
public:
|
||||
FilesystemWatcher();
|
||||
virtual ~FilesystemWatcher();
|
||||
|
||||
void Watch(const std::string& path);
|
||||
void Unwatch(const std::string& path);
|
||||
|
||||
private:
|
||||
// A new file or folder was added to one of the watched paths
|
||||
virtual void PathAdded(std::string_view path) {}
|
||||
|
||||
// A file or folder was modified in one of the watched paths
|
||||
virtual void PathModified(std::string_view path) {}
|
||||
|
||||
// A file or folder was renamed in one of the watched paths
|
||||
virtual void PathRenamed(std::string_view old_path, std::string_view new_path) {}
|
||||
|
||||
// A file or folder was deleted in one of the watched paths
|
||||
virtual void PathDeleted(std::string_view path) {}
|
||||
|
||||
std::map<std::string, std::unique_ptr<wtr::watch>> m_watched_paths;
|
||||
};
|
||||
} // namespace Common
|
@ -10,9 +10,9 @@
|
||||
class GLContextWGL final : public GLContext
|
||||
{
|
||||
public:
|
||||
~GLContextWGL();
|
||||
~GLContextWGL() override;
|
||||
|
||||
bool IsHeadless() const;
|
||||
bool IsHeadless() const override;
|
||||
|
||||
std::unique_ptr<GLContext> CreateSharedContext() override;
|
||||
|
||||
|
@ -101,7 +101,7 @@ class HostDisassemblerBochs final : public HostDisassembler
|
||||
{
|
||||
public:
|
||||
explicit HostDisassemblerBochs();
|
||||
~HostDisassemblerBochs() = default;
|
||||
~HostDisassemblerBochs() override = default;
|
||||
|
||||
private:
|
||||
disassembler m_disasm;
|
||||
|
@ -9,7 +9,7 @@ class ConsoleListener : public Common::Log::LogListener
|
||||
{
|
||||
public:
|
||||
ConsoleListener();
|
||||
~ConsoleListener();
|
||||
~ConsoleListener() override;
|
||||
|
||||
void Log(Common::Log::LogLevel level, const char* text) override;
|
||||
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
explicit DolReader(const std::string& filename);
|
||||
explicit DolReader(File::IOFile file);
|
||||
explicit DolReader(std::vector<u8> buffer);
|
||||
~DolReader();
|
||||
~DolReader() override;
|
||||
|
||||
bool IsValid() const override { return m_is_valid; }
|
||||
bool IsWii() const override { return m_is_wii; }
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
explicit ElfReader(const std::string& filename);
|
||||
explicit ElfReader(File::IOFile file);
|
||||
explicit ElfReader(std::vector<u8> buffer);
|
||||
~ElfReader();
|
||||
~ElfReader() override;
|
||||
u32 Read32(int off) const { return base32[off >> 2]; }
|
||||
// Quick accessors
|
||||
ElfType GetType() const { return (ElfType)(header->e_type); }
|
||||
|
@ -82,7 +82,6 @@
|
||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||
#include "InputCommon/GCAdapter.h"
|
||||
|
||||
#include "VideoCommon/Assets/CustomAssetLoader.h"
|
||||
#include "VideoCommon/AsyncRequests.h"
|
||||
#include "VideoCommon/Fifo.h"
|
||||
#include "VideoCommon/FrameDumper.h"
|
||||
@ -528,9 +527,6 @@ static void EmuThread(Core::System& system, std::unique_ptr<BootParameters> boot
|
||||
|
||||
FreeLook::LoadInputConfig();
|
||||
|
||||
system.GetCustomAssetLoader().Init();
|
||||
Common::ScopeGuard asset_loader_guard([&system] { system.GetCustomAssetLoader().Shutdown(); });
|
||||
|
||||
system.GetMovie().Init(*boot);
|
||||
Common::ScopeGuard movie_guard([&system] { system.GetMovie().Shutdown(); });
|
||||
|
||||
|
@ -132,7 +132,7 @@ class OSThreadView : public Common::Debug::ThreadView
|
||||
{
|
||||
public:
|
||||
explicit OSThreadView(const Core::CPUThreadGuard& guard, u32 addr);
|
||||
~OSThreadView() = default;
|
||||
~OSThreadView() override = default;
|
||||
|
||||
const OSThread& Data() const;
|
||||
|
||||
|
@ -220,7 +220,7 @@ class FifoPlayer::CPUCore final : public CPUCoreBase
|
||||
public:
|
||||
explicit CPUCore(FifoPlayer* parent) : m_parent(parent) {}
|
||||
CPUCore(const CPUCore&) = delete;
|
||||
~CPUCore() {}
|
||||
~CPUCore() override {}
|
||||
CPUCore& operator=(const CPUCore&) = delete;
|
||||
|
||||
void Init() override
|
||||
|
@ -157,7 +157,7 @@ class VAListStruct : public VAList
|
||||
{
|
||||
public:
|
||||
explicit VAListStruct(const Core::CPUThreadGuard& guard, u32 address);
|
||||
~VAListStruct() = default;
|
||||
~VAListStruct() override = default;
|
||||
|
||||
private:
|
||||
struct svr4_va_list
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
DSPHLE(DSPHLE&& other) = delete;
|
||||
DSPHLE& operator=(const DSPHLE& other) = delete;
|
||||
DSPHLE& operator=(DSPHLE&& other) = delete;
|
||||
~DSPHLE();
|
||||
~DSPHLE() override;
|
||||
|
||||
bool Initialize(bool wii, bool dsp_thread) override;
|
||||
void Shutdown() override;
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
AESndAccelerator(AESndAccelerator&&) = delete;
|
||||
AESndAccelerator& operator=(const AESndAccelerator&) = delete;
|
||||
AESndAccelerator& operator=(AESndAccelerator&&) = delete;
|
||||
~AESndAccelerator();
|
||||
~AESndAccelerator() override;
|
||||
|
||||
protected:
|
||||
void OnRawReadEndException() override {}
|
||||
|
@ -129,7 +129,7 @@ public:
|
||||
HLEAccelerator(HLEAccelerator&&) = delete;
|
||||
HLEAccelerator& operator=(const HLEAccelerator&) = delete;
|
||||
HLEAccelerator& operator=(HLEAccelerator&&) = delete;
|
||||
~HLEAccelerator() = default;
|
||||
~HLEAccelerator() override = default;
|
||||
|
||||
PB_TYPE* acc_pb = nullptr;
|
||||
|
||||
|
@ -20,7 +20,7 @@ class DSPLLE : public DSPEmulator
|
||||
{
|
||||
public:
|
||||
DSPLLE();
|
||||
~DSPLLE();
|
||||
~DSPLLE() override;
|
||||
|
||||
bool Initialize(bool wii, bool dsp_thread) override;
|
||||
void Shutdown() override;
|
||||
|
@ -18,7 +18,7 @@ class CEXIAgp : public IEXIDevice
|
||||
{
|
||||
public:
|
||||
CEXIAgp(Core::System& system, const Slot slot);
|
||||
virtual ~CEXIAgp() override;
|
||||
~CEXIAgp() override;
|
||||
bool IsPresent() const override { return true; }
|
||||
void ImmWrite(u32 _uData, u32 _uSize) override;
|
||||
u32 ImmRead(u32 _uSize) override;
|
||||
|
@ -216,7 +216,7 @@ class CEXIETHERNET : public IEXIDevice
|
||||
{
|
||||
public:
|
||||
CEXIETHERNET(Core::System& system, BBADeviceType type);
|
||||
virtual ~CEXIETHERNET();
|
||||
~CEXIETHERNET() override;
|
||||
void SetCS(int cs) override;
|
||||
bool IsPresent() const override;
|
||||
bool IsInterruptSet() override;
|
||||
|
@ -18,7 +18,7 @@ class CEXIMic : public IEXIDevice
|
||||
{
|
||||
public:
|
||||
CEXIMic(Core::System& system, const int index);
|
||||
virtual ~CEXIMic();
|
||||
~CEXIMic() override;
|
||||
void SetCS(int cs) override;
|
||||
bool IsInterruptSet() override;
|
||||
bool IsPresent() const override;
|
||||
|
@ -33,7 +33,7 @@ class CEXIModem : public IEXIDevice
|
||||
{
|
||||
public:
|
||||
CEXIModem(Core::System& system, ModemDeviceType type);
|
||||
virtual ~CEXIModem();
|
||||
~CEXIModem() override;
|
||||
void SetCS(int cs) override;
|
||||
bool IsPresent() const override;
|
||||
bool IsInterruptSet() override;
|
||||
@ -136,13 +136,13 @@ private:
|
||||
TAPServerNetworkInterface(CEXIModem* modem_ref, const std::string& destination);
|
||||
|
||||
public:
|
||||
virtual bool Activate() override;
|
||||
virtual void Deactivate() override;
|
||||
virtual bool IsActivated() override;
|
||||
virtual bool SendAndRemoveAllHDLCFrames(std::string* send_buffer) override;
|
||||
virtual bool RecvInit() override;
|
||||
virtual void RecvStart() override;
|
||||
virtual void RecvStop() override;
|
||||
bool Activate() override;
|
||||
void Deactivate() override;
|
||||
bool IsActivated() override;
|
||||
bool SendAndRemoveAllHDLCFrames(std::string* send_buffer) override;
|
||||
bool RecvInit() override;
|
||||
void RecvStart() override;
|
||||
void RecvStop() override;
|
||||
|
||||
private:
|
||||
TAPServerConnection m_tapserver_if;
|
||||
|
@ -24,7 +24,7 @@ class GCMemcardDirectory : public MemoryCardBase
|
||||
public:
|
||||
GCMemcardDirectory(const std::string& directory, ExpansionInterface::Slot slot,
|
||||
const Memcard::HeaderData& header_data, u32 game_id);
|
||||
~GCMemcardDirectory();
|
||||
~GCMemcardDirectory() override;
|
||||
|
||||
GCMemcardDirectory(const GCMemcardDirectory&) = delete;
|
||||
GCMemcardDirectory& operator=(const GCMemcardDirectory&) = delete;
|
||||
|
@ -19,7 +19,7 @@ class MemoryCard : public MemoryCardBase
|
||||
public:
|
||||
MemoryCard(const std::string& filename, ExpansionInterface::Slot card_slot,
|
||||
u16 size_mbits = Memcard::MBIT_SIZE_MEMORY_CARD_2043);
|
||||
~MemoryCard();
|
||||
~MemoryCard() override;
|
||||
void FlushThread();
|
||||
void MakeDirty();
|
||||
|
||||
|
@ -39,7 +39,7 @@ class ConstantHandlingMethod : public ReadHandlingMethod<T>
|
||||
{
|
||||
public:
|
||||
explicit ConstantHandlingMethod(T value) : value_(value) {}
|
||||
virtual ~ConstantHandlingMethod() = default;
|
||||
~ConstantHandlingMethod() override = default;
|
||||
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
|
||||
{
|
||||
v.VisitConstant(value_);
|
||||
@ -62,7 +62,7 @@ class NopHandlingMethod : public WriteHandlingMethod<T>
|
||||
{
|
||||
public:
|
||||
NopHandlingMethod() {}
|
||||
virtual ~NopHandlingMethod() = default;
|
||||
~NopHandlingMethod() override = default;
|
||||
void AcceptWriteVisitor(WriteHandlingMethodVisitor<T>& v) const override { v.VisitNop(); }
|
||||
};
|
||||
template <typename T>
|
||||
@ -79,7 +79,7 @@ class DirectHandlingMethod : public ReadHandlingMethod<T>, public WriteHandlingM
|
||||
{
|
||||
public:
|
||||
DirectHandlingMethod(T* addr, u32 mask) : addr_(addr), mask_(mask) {}
|
||||
virtual ~DirectHandlingMethod() = default;
|
||||
~DirectHandlingMethod() override = default;
|
||||
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
|
||||
{
|
||||
v.VisitDirect(addr_, mask_);
|
||||
@ -122,7 +122,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~ComplexHandlingMethod() = default;
|
||||
~ComplexHandlingMethod() override = default;
|
||||
void AcceptReadVisitor(ReadHandlingMethodVisitor<T>& v) const override
|
||||
{
|
||||
v.VisitComplex(&read_lambda_);
|
||||
|
@ -21,7 +21,7 @@ class CSIDevice_GBAEmu final : public ISIDevice
|
||||
{
|
||||
public:
|
||||
CSIDevice_GBAEmu(Core::System& system, SIDevices device, int device_number);
|
||||
~CSIDevice_GBAEmu();
|
||||
~CSIDevice_GBAEmu() override;
|
||||
|
||||
int RunBuffer(u8* buffer, int request_length) override;
|
||||
int TransferInterval() override;
|
||||
|
@ -120,7 +120,7 @@ protected:
|
||||
using EncryptedExtension::EncryptedExtension;
|
||||
|
||||
private:
|
||||
void UpdateEncryptionKey() final override;
|
||||
void UpdateEncryptionKey() final;
|
||||
};
|
||||
|
||||
class Extension3rdParty : public EncryptedExtension
|
||||
@ -129,7 +129,7 @@ protected:
|
||||
using EncryptedExtension::EncryptedExtension;
|
||||
|
||||
private:
|
||||
void UpdateEncryptionKey() final override;
|
||||
void UpdateEncryptionKey() final;
|
||||
};
|
||||
|
||||
} // namespace WiimoteEmu
|
||||
|
@ -137,7 +137,7 @@ public:
|
||||
static constexpr const char* SIDEWAYS_OPTION = "Sideways Wiimote";
|
||||
|
||||
explicit Wiimote(unsigned int index);
|
||||
~Wiimote();
|
||||
~Wiimote() override;
|
||||
|
||||
std::string GetName() const override;
|
||||
|
||||
|
@ -34,7 +34,7 @@ class WiimoteScannerHidapi final : public WiimoteScannerBackend
|
||||
{
|
||||
public:
|
||||
WiimoteScannerHidapi();
|
||||
~WiimoteScannerHidapi();
|
||||
~WiimoteScannerHidapi() override;
|
||||
bool IsReady() const override;
|
||||
void FindWiimotes(std::vector<Wiimote*>&, Wiimote*&) override;
|
||||
void Update() override {} // not needed for hidapi
|
||||
|
@ -233,7 +233,7 @@ class HotkeyManager : public ControllerEmu::EmulatedController
|
||||
{
|
||||
public:
|
||||
HotkeyManager();
|
||||
~HotkeyManager();
|
||||
~HotkeyManager() override;
|
||||
|
||||
void GetInput(HotkeyStatus* hk, bool ignore_focus);
|
||||
std::string GetName() const override;
|
||||
|
@ -234,7 +234,7 @@ public:
|
||||
ESDevice(ESDevice&& other) = delete;
|
||||
ESDevice& operator=(const ESDevice& other) = delete;
|
||||
ESDevice& operator=(ESDevice&& other) = delete;
|
||||
~ESDevice();
|
||||
~ESDevice() override;
|
||||
|
||||
static void InitializeEmulationState(CoreTiming::CoreTimingManager& core_timing);
|
||||
static void FinalizeEmulationState();
|
||||
|
@ -117,7 +117,7 @@ class FSDevice final : public EmulationDevice
|
||||
{
|
||||
public:
|
||||
FSDevice(EmulationKernel& ios, FSCore& core, const std::string& device_name);
|
||||
~FSDevice();
|
||||
~FSDevice() override;
|
||||
|
||||
void DoState(PointerWrap& p) override;
|
||||
|
||||
|
@ -23,7 +23,7 @@ class HostFileSystem final : public FileSystem
|
||||
{
|
||||
public:
|
||||
HostFileSystem(const std::string& root_path, std::vector<NandRedirect> nand_redirects = {});
|
||||
~HostFileSystem();
|
||||
~HostFileSystem() override;
|
||||
|
||||
void DoState(PointerWrap& p) override;
|
||||
|
||||
|
@ -153,7 +153,7 @@ class EmulationKernel final : public Kernel
|
||||
{
|
||||
public:
|
||||
EmulationKernel(Core::System& system, u64 ios_title_id);
|
||||
~EmulationKernel();
|
||||
~EmulationKernel() override;
|
||||
|
||||
// Get a resource manager by name.
|
||||
// This only works for devices which are part of the device map.
|
||||
|
@ -84,7 +84,7 @@ class NetSSLDevice : public EmulationDevice
|
||||
public:
|
||||
NetSSLDevice(EmulationKernel& ios, const std::string& device_name);
|
||||
|
||||
virtual ~NetSSLDevice();
|
||||
~NetSSLDevice() override;
|
||||
|
||||
std::optional<IPCReply> IOCtl(const IOCtlRequest& request) override;
|
||||
std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override;
|
||||
|
@ -41,7 +41,7 @@ class BluetoothEmuDevice final : public BluetoothBaseDevice
|
||||
public:
|
||||
BluetoothEmuDevice(EmulationKernel& ios, const std::string& device_name);
|
||||
|
||||
virtual ~BluetoothEmuDevice();
|
||||
~BluetoothEmuDevice() override;
|
||||
|
||||
std::optional<IPCReply> Close(u32 fd) override;
|
||||
std::optional<IPCReply> IOCtlV(const IOCtlVRequest& request) override;
|
||||
|
@ -73,7 +73,7 @@ class SkylanderUSB final : public Device
|
||||
{
|
||||
public:
|
||||
SkylanderUSB();
|
||||
~SkylanderUSB();
|
||||
~SkylanderUSB() override;
|
||||
DeviceDescriptor GetDeviceDescriptor() const override;
|
||||
std::vector<ConfigDescriptor> GetConfigurations() const override;
|
||||
std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override;
|
||||
|
@ -78,8 +78,8 @@ std::string USBHost::GetDeviceNameFromVIDPID(u16 vid, u16 pid)
|
||||
libusb_get_string_descriptor_ascii(handle, desc.iProduct, buffer, sizeof(buffer)) > 0)
|
||||
{
|
||||
device_name = reinterpret_cast<char*>(buffer);
|
||||
libusb_close(handle);
|
||||
}
|
||||
libusb_close(handle);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class USBHost : public EmulationDevice
|
||||
{
|
||||
public:
|
||||
USBHost(EmulationKernel& ios, const std::string& device_name);
|
||||
virtual ~USBHost();
|
||||
~USBHost() override;
|
||||
|
||||
std::optional<IPCReply> Open(const OpenRequest& request) override;
|
||||
|
||||
|
@ -27,7 +27,7 @@ class LibusbDevice final : public Device
|
||||
{
|
||||
public:
|
||||
LibusbDevice(libusb_device* device, const libusb_device_descriptor& device_descriptor);
|
||||
~LibusbDevice();
|
||||
~LibusbDevice() override;
|
||||
DeviceDescriptor GetDeviceDescriptor() const override;
|
||||
std::vector<ConfigDescriptor> GetConfigurations() const override;
|
||||
std::vector<InterfaceDescriptor> GetInterfaces(u8 config) const override;
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
|
||||
NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog,
|
||||
const std::string& name, const NetTraversalConfig& traversal_config);
|
||||
~NetPlayClient();
|
||||
~NetPlayClient() override;
|
||||
|
||||
std::vector<const Player*> GetPlayers();
|
||||
const NetSettings& GetNetSettings() const;
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
|
||||
NetPlayServer(u16 port, bool forward_port, NetPlayUI* dialog,
|
||||
const NetTraversalConfig& traversal_config);
|
||||
~NetPlayServer();
|
||||
~NetPlayServer() override;
|
||||
|
||||
bool ChangeGame(const SyncIdentifier& sync_identifier, const std::string& netplay_name);
|
||||
bool ComputeGameDigest(const SyncIdentifier& sync_identifier);
|
||||
|
@ -86,7 +86,7 @@ class PCAPSSLCaptureLogger final : public NetworkCaptureLogger
|
||||
{
|
||||
public:
|
||||
PCAPSSLCaptureLogger();
|
||||
~PCAPSSLCaptureLogger();
|
||||
~PCAPSSLCaptureLogger() override;
|
||||
|
||||
void OnNewSocket(s32 socket) override;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
CachedInterpreter(CachedInterpreter&&) = delete;
|
||||
CachedInterpreter& operator=(const CachedInterpreter&) = delete;
|
||||
CachedInterpreter& operator=(CachedInterpreter&&) = delete;
|
||||
~CachedInterpreter();
|
||||
~CachedInterpreter() override;
|
||||
|
||||
void Init() override;
|
||||
void Shutdown() override;
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
Interpreter(Interpreter&&) = delete;
|
||||
Interpreter& operator=(const Interpreter&) = delete;
|
||||
Interpreter& operator=(Interpreter&&) = delete;
|
||||
~Interpreter();
|
||||
~Interpreter() override;
|
||||
|
||||
void Init() override;
|
||||
void Shutdown() override;
|
||||
|
@ -8,7 +8,7 @@
|
||||
class CSVSignatureDB final : public HashSignatureDB
|
||||
{
|
||||
public:
|
||||
~CSVSignatureDB() = default;
|
||||
~CSVSignatureDB() override = default;
|
||||
bool Load(const std::string& file_path) override;
|
||||
bool Save(const std::string& file_path) const override;
|
||||
};
|
||||
|
@ -8,7 +8,7 @@
|
||||
class DSYSignatureDB final : public HashSignatureDB
|
||||
{
|
||||
public:
|
||||
~DSYSignatureDB() = default;
|
||||
~DSYSignatureDB() override = default;
|
||||
bool Load(const std::string& file_path) override;
|
||||
bool Save(const std::string& file_path) const override;
|
||||
};
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "IOS/USB/Emulated/Infinity.h"
|
||||
#include "IOS/USB/Emulated/Skylanders/Skylander.h"
|
||||
#include "IOS/USB/USBScanner.h"
|
||||
#include "VideoCommon/Assets/CustomAssetLoader.h"
|
||||
#include "VideoCommon/Assets/CustomResourceManager.h"
|
||||
#include "VideoCommon/CommandProcessor.h"
|
||||
#include "VideoCommon/Fifo.h"
|
||||
#include "VideoCommon/GeometryShaderManager.h"
|
||||
@ -96,7 +96,7 @@ struct System::Impl
|
||||
VideoInterface::VideoInterfaceManager m_video_interface;
|
||||
Interpreter m_interpreter;
|
||||
JitInterface m_jit_interface;
|
||||
VideoCommon::CustomAssetLoader m_custom_asset_loader;
|
||||
VideoCommon::CustomResourceManager m_custom_resource_manager;
|
||||
FifoPlayer m_fifo_player;
|
||||
FifoRecorder m_fifo_recorder;
|
||||
Movie::MovieManager m_movie;
|
||||
@ -335,8 +335,8 @@ VideoInterface::VideoInterfaceManager& System::GetVideoInterface() const
|
||||
return m_impl->m_video_interface;
|
||||
}
|
||||
|
||||
VideoCommon::CustomAssetLoader& System::GetCustomAssetLoader() const
|
||||
VideoCommon::CustomResourceManager& System::GetCustomResourceManager() const
|
||||
{
|
||||
return m_impl->m_custom_asset_loader;
|
||||
return m_impl->m_custom_resource_manager;
|
||||
}
|
||||
} // namespace Core
|
||||
|
@ -108,8 +108,8 @@ class SystemTimersManager;
|
||||
}
|
||||
namespace VideoCommon
|
||||
{
|
||||
class CustomAssetLoader;
|
||||
}
|
||||
class CustomResourceManager;
|
||||
} // namespace VideoCommon
|
||||
namespace VideoInterface
|
||||
{
|
||||
class VideoInterfaceManager;
|
||||
@ -197,7 +197,7 @@ public:
|
||||
VertexShaderManager& GetVertexShaderManager() const;
|
||||
XFStateManager& GetXFStateManager() const;
|
||||
VideoInterface::VideoInterfaceManager& GetVideoInterface() const;
|
||||
VideoCommon::CustomAssetLoader& GetCustomAssetLoader() const;
|
||||
VideoCommon::CustomResourceManager& GetCustomResourceManager() const;
|
||||
|
||||
private:
|
||||
System();
|
||||
|
@ -107,7 +107,7 @@ protected:
|
||||
class SectorReader : public BlobReader
|
||||
{
|
||||
public:
|
||||
virtual ~SectorReader() = 0;
|
||||
~SectorReader() override = 0;
|
||||
|
||||
bool Read(u64 offset, u64 size, u8* out_ptr) override;
|
||||
|
||||
|
@ -45,7 +45,7 @@ class CompressedBlobReader final : public SectorReader
|
||||
public:
|
||||
static std::unique_ptr<CompressedBlobReader> Create(File::IOFile file,
|
||||
const std::string& filename);
|
||||
~CompressedBlobReader();
|
||||
~CompressedBlobReader() override;
|
||||
|
||||
const CompressedBlobHeader& GetHeader() const { return m_header; }
|
||||
|
||||
|
@ -29,7 +29,7 @@ class VolumeGC final : public VolumeDisc
|
||||
{
|
||||
public:
|
||||
VolumeGC(std::unique_ptr<BlobReader> reader);
|
||||
~VolumeGC();
|
||||
~VolumeGC() override;
|
||||
bool Read(u64 offset, u64 length, u8* buffer,
|
||||
const Partition& partition = PARTITION_NONE) const override;
|
||||
const FileSystem* GetFileSystem(const Partition& partition = PARTITION_NONE) const override;
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
static_assert(sizeof(HashBlock) == BLOCK_HEADER_SIZE);
|
||||
|
||||
VolumeWii(std::unique_ptr<BlobReader> reader);
|
||||
~VolumeWii();
|
||||
~VolumeWii() override;
|
||||
bool Read(u64 offset, u64 length, u8* buffer, const Partition& partition) const override;
|
||||
bool HasWiiHashes() const override;
|
||||
bool HasWiiEncryption() const override;
|
||||
|
@ -44,7 +44,7 @@ template <bool RVZ>
|
||||
class WIARVZFileReader final : public BlobReader
|
||||
{
|
||||
public:
|
||||
~WIARVZFileReader();
|
||||
~WIARVZFileReader() override;
|
||||
|
||||
static std::unique_ptr<WIARVZFileReader> Create(File::IOFile file, const std::string& path);
|
||||
|
||||
|
@ -75,7 +75,7 @@ private:
|
||||
class Bzip2Decompressor final : public Decompressor
|
||||
{
|
||||
public:
|
||||
~Bzip2Decompressor();
|
||||
~Bzip2Decompressor() override;
|
||||
|
||||
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
|
||||
size_t* in_bytes_read) override;
|
||||
@ -89,7 +89,7 @@ class LZMADecompressor final : public Decompressor
|
||||
{
|
||||
public:
|
||||
LZMADecompressor(bool lzma2, const u8* filter_options, size_t filter_options_size);
|
||||
~LZMADecompressor();
|
||||
~LZMADecompressor() override;
|
||||
|
||||
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
|
||||
size_t* in_bytes_read) override;
|
||||
@ -106,7 +106,7 @@ class ZstdDecompressor final : public Decompressor
|
||||
{
|
||||
public:
|
||||
ZstdDecompressor();
|
||||
~ZstdDecompressor();
|
||||
~ZstdDecompressor() override;
|
||||
|
||||
bool Decompress(const DecompressionBuffer& in, DecompressionBuffer* out,
|
||||
size_t* in_bytes_read) override;
|
||||
@ -164,7 +164,7 @@ class PurgeCompressor final : public Compressor
|
||||
{
|
||||
public:
|
||||
PurgeCompressor();
|
||||
~PurgeCompressor();
|
||||
~PurgeCompressor() override;
|
||||
|
||||
bool Start(std::optional<u64> size) override;
|
||||
bool AddPrecedingDataOnlyForPurgeHashing(const u8* data, size_t size) override;
|
||||
@ -184,7 +184,7 @@ class Bzip2Compressor final : public Compressor
|
||||
{
|
||||
public:
|
||||
Bzip2Compressor(int compression_level);
|
||||
~Bzip2Compressor();
|
||||
~Bzip2Compressor() override;
|
||||
|
||||
bool Start(std::optional<u64> size) override;
|
||||
bool Compress(const u8* data, size_t size) override;
|
||||
@ -206,7 +206,7 @@ class LZMACompressor final : public Compressor
|
||||
public:
|
||||
LZMACompressor(bool lzma2, int compression_level, u8 compressor_data_out[7],
|
||||
u8* compressor_data_size_out);
|
||||
~LZMACompressor();
|
||||
~LZMACompressor() override;
|
||||
|
||||
bool Start(std::optional<u64> size) override;
|
||||
bool Compress(const u8* data, size_t size) override;
|
||||
@ -229,7 +229,7 @@ class ZstdCompressor final : public Compressor
|
||||
{
|
||||
public:
|
||||
ZstdCompressor(int compression_level);
|
||||
~ZstdCompressor();
|
||||
~ZstdCompressor() override;
|
||||
|
||||
bool Start(std::optional<u64> size) override;
|
||||
bool Compress(const u8* data, size_t size) override;
|
||||
|
@ -18,7 +18,7 @@ static constexpr u32 WBFS_MAGIC = 0x53464257; // "WBFS" (byteswapped to little
|
||||
class WbfsFileReader final : public BlobReader
|
||||
{
|
||||
public:
|
||||
~WbfsFileReader();
|
||||
~WbfsFileReader() override;
|
||||
|
||||
static std::unique_ptr<WbfsFileReader> Create(File::IOFile file, const std::string& path);
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
<ClInclude Include="Common\Event.h" />
|
||||
<ClInclude Include="Common\FatFsUtil.h" />
|
||||
<ClInclude Include="Common\FileSearch.h" />
|
||||
<ClInclude Include="Common\FilesystemWatcher.h" />
|
||||
<ClInclude Include="Common\FileUtil.h" />
|
||||
<ClInclude Include="Common\FixedSizeQueue.h" />
|
||||
<ClInclude Include="Common\Flag.h" />
|
||||
@ -669,12 +670,16 @@
|
||||
<ClInclude Include="VideoCommon\Assets\CustomAsset.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\CustomAssetLibrary.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\CustomAssetLoader.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\CustomResourceManager.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\CustomTextureData.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\MaterialAsset.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\MeshAsset.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\ShaderAsset.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\TextureAsset.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\TextureAssetUtils.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\Types.h" />
|
||||
<ClInclude Include="VideoCommon\Assets\WatchableFilesystemAssetLibrary.h" />
|
||||
<ClInclude Include="VideoCommon\AsyncRequests.h" />
|
||||
<ClInclude Include="VideoCommon\AsyncShaderCompiler.h" />
|
||||
<ClInclude Include="VideoCommon\BoundingBox.h" />
|
||||
@ -814,6 +819,7 @@
|
||||
<ClCompile Include="Common\ENet.cpp" />
|
||||
<ClCompile Include="Common\FatFsUtil.cpp" />
|
||||
<ClCompile Include="Common\FileSearch.cpp" />
|
||||
<ClCompile Include="Common\FilesystemWatcher.cpp" />
|
||||
<ClCompile Include="Common\FileUtil.cpp" />
|
||||
<ClCompile Include="Common\FloatUtils.cpp" />
|
||||
<ClCompile Include="Common\GekkoDisassembler.cpp" />
|
||||
@ -1320,14 +1326,15 @@
|
||||
<ClCompile Include="VideoCommon\AbstractStagingTexture.cpp" />
|
||||
<ClCompile Include="VideoCommon\AbstractTexture.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\CustomAsset.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\CustomAssetLibrary.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\CustomAssetLoader.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\CustomResourceManager.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\CustomTextureData.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\DirectFilesystemAssetLibrary.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\MaterialAsset.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\MeshAsset.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\ShaderAsset.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\TextureAsset.cpp" />
|
||||
<ClCompile Include="VideoCommon\Assets\TextureAssetUtils.cpp" />
|
||||
<ClCompile Include="VideoCommon\AsyncRequests.cpp" />
|
||||
<ClCompile Include="VideoCommon\AsyncShaderCompiler.cpp" />
|
||||
<ClCompile Include="VideoCommon\BoundingBox.cpp" />
|
||||
|
@ -4,10 +4,8 @@
|
||||
#include "DolphinNoGUI/Platform.h"
|
||||
|
||||
#include <OptionParser.h>
|
||||
#include <cstddef>
|
||||
#include <csignal>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <signal.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -32,15 +30,13 @@
|
||||
#endif
|
||||
#include "UICommon/UICommon.h"
|
||||
|
||||
#include "InputCommon/GCAdapter.h"
|
||||
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
|
||||
static std::unique_ptr<Platform> s_platform;
|
||||
|
||||
static void signal_handler(int)
|
||||
{
|
||||
const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
|
||||
constexpr char message[] = "A signal was received. A second signal will force Dolphin to stop.\n";
|
||||
#ifdef _WIN32
|
||||
puts(message);
|
||||
#else
|
||||
@ -75,7 +71,7 @@ bool Host_UIBlocksControllerState()
|
||||
}
|
||||
|
||||
static Common::Event s_update_main_frame_event;
|
||||
void Host_Message(HostMessageID id)
|
||||
void Host_Message(const HostMessageID id)
|
||||
{
|
||||
if (id == HostMessageID::WMUserStop)
|
||||
s_platform->Stop();
|
||||
@ -201,11 +197,12 @@ static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
|
||||
#define main app_main
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int main(const int argc, char* argv[])
|
||||
{
|
||||
Core::DeclareAsHostThread();
|
||||
|
||||
auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions);
|
||||
const auto parser =
|
||||
CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions);
|
||||
parser->add_option("-p", "--platform")
|
||||
.action("store")
|
||||
.help("Window platform to use [%choices]")
|
||||
@ -301,14 +298,14 @@ int main(int argc, char* argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
Core::AddOnStateChangedCallback([](Core::State state) {
|
||||
Core::AddOnStateChangedCallback([](const Core::State state) {
|
||||
if (state == Core::State::Uninitialized)
|
||||
s_platform->Stop();
|
||||
});
|
||||
|
||||
#ifdef _WIN32
|
||||
signal(SIGINT, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
std::signal(SIGINT, signal_handler);
|
||||
std::signal(SIGTERM, signal_handler);
|
||||
#else
|
||||
// Shut down cleanly on SIGINT and SIGTERM
|
||||
struct sigaction sa;
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "Core/HW/ProcessorInterface.h"
|
||||
#include "Core/IOS/IOS.h"
|
||||
#include "Core/IOS/STM/STM.h"
|
||||
#include "Core/State.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
Platform::~Platform() = default;
|
||||
@ -24,7 +23,7 @@ void Platform::UpdateRunningFlag()
|
||||
{
|
||||
if (m_shutdown_requested.TestAndClear())
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
const auto& system = Core::System::GetInstance();
|
||||
const auto ios = system.GetIOS();
|
||||
const auto stm = ios ? ios->GetDeviceByName("/dev/stm/eventhook") : nullptr;
|
||||
if (!m_tried_graceful_shutdown.IsSet() && stm &&
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
class PlatformHeadless : public Platform
|
||||
class PlatformHeadless final : public Platform
|
||||
{
|
||||
public:
|
||||
void SetTitle(const std::string& title) override;
|
||||
|
@ -3,16 +3,13 @@
|
||||
|
||||
#include "DolphinNoGUI/Platform.h"
|
||||
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/State.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#include <Windows.h>
|
||||
#include <climits>
|
||||
#include <cstdio>
|
||||
#include <dwmapi.h>
|
||||
|
||||
#include "VideoCommon/Present.h"
|
||||
@ -20,7 +17,7 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
class PlatformWin32 : public Platform
|
||||
class PlatformWin32 final : public Platform
|
||||
{
|
||||
public:
|
||||
~PlatformWin32() override;
|
||||
@ -29,14 +26,14 @@ public:
|
||||
void SetTitle(const std::string& string) override;
|
||||
void MainLoop() override;
|
||||
|
||||
WindowSystemInfo GetWindowSystemInfo() const;
|
||||
WindowSystemInfo GetWindowSystemInfo() const override;
|
||||
|
||||
private:
|
||||
static constexpr TCHAR WINDOW_CLASS_NAME[] = _T("DolphinNoGUI");
|
||||
|
||||
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
bool RegisterRenderWindowClass();
|
||||
static bool RegisterRenderWindowClass();
|
||||
bool CreateRenderWindow();
|
||||
void UpdateWindowPosition();
|
||||
void ProcessEvents();
|
||||
@ -66,7 +63,7 @@ bool PlatformWin32::RegisterRenderWindowClass()
|
||||
wc.hInstance = GetModuleHandle(nullptr);
|
||||
wc.hIcon = LoadIcon(nullptr, IDI_ICON1);
|
||||
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||
wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_WINDOW + 1);
|
||||
wc.lpszMenuName = nullptr;
|
||||
wc.lpszClassName = WINDOW_CLASS_NAME;
|
||||
wc.hIconSm = LoadIcon(nullptr, IDI_ICON1);
|
||||
@ -168,7 +165,8 @@ void PlatformWin32::ProcessEvents()
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT PlatformWin32::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT PlatformWin32::WndProc(const HWND hwnd, const UINT msg, const WPARAM wParam,
|
||||
const LPARAM lParam)
|
||||
{
|
||||
PlatformWin32* platform = reinterpret_cast<PlatformWin32*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
|
||||
switch (msg)
|
||||
@ -185,7 +183,7 @@ LRESULT PlatformWin32::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
|
||||
if (hwnd)
|
||||
{
|
||||
// Remove rounded corners from the render window on Windows 11
|
||||
const DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND;
|
||||
constexpr DWM_WINDOW_CORNER_PREFERENCE corner_preference = DWMWCP_DONOTROUND;
|
||||
DwmSetWindowAttribute(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &corner_preference,
|
||||
sizeof(corner_preference));
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class CheatsManager : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CheatsManager(Core::System& system, QWidget* parent = nullptr);
|
||||
~CheatsManager();
|
||||
~CheatsManager() override;
|
||||
|
||||
signals:
|
||||
void OpenGeneralSettings();
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "DolphinQt/Config/CheatWarningWidget.h"
|
||||
#include "DolphinQt/Config/HardcoreWarningWidget.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
ARCodeWidget::ARCodeWidget(std::string game_id, u16 game_revision, bool restart_required)
|
||||
: m_game_id(std::move(game_id)), m_game_revision(game_revision),
|
||||
@ -257,7 +256,6 @@ void ARCodeWidget::OnCodeAddClicked()
|
||||
ar.enabled = true;
|
||||
|
||||
m_cheat_code_editor->SetARCode(&ar);
|
||||
SetQWidgetWindowDecorations(m_cheat_code_editor);
|
||||
if (m_cheat_code_editor->exec() == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
@ -275,7 +273,6 @@ void ARCodeWidget::OnCodeEditClicked()
|
||||
|
||||
const auto* const selected = items[0];
|
||||
auto& current_ar = m_ar_codes[m_code_list->row(selected)];
|
||||
SetQWidgetWindowDecorations(m_cheat_code_editor);
|
||||
|
||||
if (current_ar.user_defined)
|
||||
{
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/SignalBlocking.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -60,7 +59,6 @@ void CommonControllersWidget::OnControllerInterfaceConfigure()
|
||||
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
|
||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
||||
SetQWidgetWindowDecorations(window);
|
||||
window->show();
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,36 @@ void ConfigSlider::OnConfigChanged()
|
||||
}
|
||||
}
|
||||
|
||||
ConfigSliderU32::ConfigSliderU32(u32 minimum, u32 maximum, const Config::Info<u32>& setting,
|
||||
u32 scale)
|
||||
: ConfigSliderU32(minimum, maximum, setting, nullptr, scale)
|
||||
{
|
||||
}
|
||||
|
||||
ConfigSliderU32::ConfigSliderU32(u32 minimum, u32 maximum, const Config::Info<u32>& setting,
|
||||
Config::Layer* layer, u32 scale)
|
||||
: ConfigControl(Qt::Horizontal, setting.GetLocation(), layer), m_setting(setting),
|
||||
m_scale(scale)
|
||||
|
||||
{
|
||||
setMinimum(minimum);
|
||||
setMaximum(maximum);
|
||||
setValue(ReadValue(setting));
|
||||
OnConfigChanged();
|
||||
|
||||
connect(this, &ConfigSliderU32::valueChanged, this, &ConfigSliderU32::Update);
|
||||
}
|
||||
|
||||
void ConfigSliderU32::Update(u32 value)
|
||||
{
|
||||
SaveValue(m_setting, value * m_scale);
|
||||
}
|
||||
|
||||
void ConfigSliderU32::OnConfigChanged()
|
||||
{
|
||||
setValue(ReadValue(m_setting) / m_scale);
|
||||
}
|
||||
|
||||
ConfigSliderLabel::ConfigSliderLabel(const QString& text, ConfigSlider* slider)
|
||||
: QLabel(text), m_slider(QPointer<ConfigSlider>(slider))
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Config/ConfigInfo.h"
|
||||
|
||||
class ConfigSlider final : public ConfigControl<ToolTipSlider>
|
||||
@ -38,6 +39,25 @@ private:
|
||||
std::vector<int> m_tick_values;
|
||||
};
|
||||
|
||||
class ConfigSliderU32 final : public ConfigControl<ToolTipSlider>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConfigSliderU32(u32 minimum, u32 maximum, const Config::Info<u32>& setting, u32 scale = 1);
|
||||
ConfigSliderU32(u32 minimum, u32 maximum, const Config::Info<u32>& setting, Config ::Layer* layer,
|
||||
u32 scale = 1);
|
||||
|
||||
void Update(u32 value);
|
||||
|
||||
protected:
|
||||
void OnConfigChanged() override;
|
||||
|
||||
private:
|
||||
const Config::Info<u32> m_setting;
|
||||
|
||||
u32 m_scale = 1;
|
||||
};
|
||||
|
||||
class ConfigSliderLabel final : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "Common/Config/Config.h"
|
||||
#include "DolphinQt/Config/ControllerInterface/DualShockUDPClientAddServerDialog.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "InputCommon/ControllerInterface/DualShockUDPClient/DualShockUDPClient.h"
|
||||
|
||||
DualShockUDPClientWidget::DualShockUDPClientWidget()
|
||||
@ -112,7 +111,6 @@ void DualShockUDPClientWidget::OnServerAdded()
|
||||
DualShockUDPClientAddServerDialog add_server_dialog(this);
|
||||
connect(&add_server_dialog, &DualShockUDPClientAddServerDialog::accepted, this,
|
||||
&DualShockUDPClientWidget::RefreshServerList);
|
||||
SetQWidgetWindowDecorations(&add_server_dialog);
|
||||
add_server_dialog.exec();
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/ParallelProgressDialog.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
|
||||
#include "UICommon/UICommon.h"
|
||||
@ -367,7 +366,6 @@ void FilesystemWidget::ExtractDirectory(const DiscIO::Partition& partition, cons
|
||||
dialog.Reset();
|
||||
});
|
||||
|
||||
SetQWidgetWindowDecorations(dialog.GetRaw());
|
||||
dialog.GetRaw()->exec();
|
||||
future.get();
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
FreeLookWidget::FreeLookWidget(QWidget* parent) : QWidget(parent)
|
||||
@ -104,7 +103,6 @@ void FreeLookWidget::OnFreeLookControllerConfigured()
|
||||
MappingWindow* window = new MappingWindow(this, MappingWindow::Type::MAPPING_FREELOOK, index);
|
||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
||||
SetQWidgetWindowDecorations(window);
|
||||
window->show();
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class GameConfigHighlighter : public QSyntaxHighlighter
|
||||
|
||||
public:
|
||||
explicit GameConfigHighlighter(QTextDocument* parent = nullptr);
|
||||
~GameConfigHighlighter();
|
||||
~GameConfigHighlighter() override;
|
||||
|
||||
protected:
|
||||
void highlightBlock(const QString& text) override;
|
||||
|
@ -29,7 +29,7 @@ class GameConfigWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GameConfigWidget(const UICommon::GameFile& game);
|
||||
~GameConfigWidget();
|
||||
~GameConfigWidget() override;
|
||||
|
||||
private:
|
||||
void CreateWidgets();
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "DolphinQt/Config/Mapping/GCPadWiiUConfigDialog.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/SignalBlocking.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -140,7 +139,6 @@ void GamecubeControllersWidget::OnGCPadConfigure(size_t index)
|
||||
case SerialInterface::SIDEVICE_WIIU_ADAPTER:
|
||||
{
|
||||
GCPadWiiUConfigDialog dialog(static_cast<int>(index), this);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
dialog.exec();
|
||||
return;
|
||||
}
|
||||
@ -166,7 +164,6 @@ void GamecubeControllersWidget::OnGCPadConfigure(size_t index)
|
||||
MappingWindow* window = new MappingWindow(this, type, static_cast<int>(index));
|
||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
||||
SetQWidgetWindowDecorations(window);
|
||||
window->show();
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
|
||||
GeckoCodeWidget::GeckoCodeWidget(std::string game_id, std::string gametdb_id, u16 game_revision,
|
||||
@ -210,7 +209,6 @@ void GeckoCodeWidget::AddCode()
|
||||
code.enabled = true;
|
||||
|
||||
m_cheat_code_editor->SetGeckoCode(&code);
|
||||
SetQWidgetWindowDecorations(m_cheat_code_editor);
|
||||
if (m_cheat_code_editor->exec() == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
@ -228,7 +226,6 @@ void GeckoCodeWidget::EditCode()
|
||||
const int index = item->data(Qt::UserRole).toInt();
|
||||
|
||||
m_cheat_code_editor->SetGeckoCode(&m_gecko_codes[index]);
|
||||
SetQWidgetWindowDecorations(m_cheat_code_editor);
|
||||
if (m_cheat_code_editor->exec() == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "DolphinQt/Config/Graphics/PostProcessingConfigWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipPushButton.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#include "VideoCommon/PostProcessing.h"
|
||||
@ -629,7 +628,6 @@ void EnhancementsWidget::AddDescriptions()
|
||||
void EnhancementsWidget::ConfigureColorCorrection()
|
||||
{
|
||||
ColorCorrectionConfigWindow dialog(this);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
@ -637,6 +635,5 @@ void EnhancementsWidget::ConfigurePostProcessingShader()
|
||||
{
|
||||
const std::string shader = ReadSetting(Config::GFX_ENHANCE_POST_SHADER);
|
||||
PostProcessingConfigWindow dialog(this, shader);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
dialog.exec();
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
@ -199,7 +198,6 @@ void GeneralWidget::BackendWarning()
|
||||
confirm_sw.setWindowTitle(tr("Confirm backend change"));
|
||||
confirm_sw.setText(tr(warningMessage->c_str()));
|
||||
|
||||
SetQWidgetWindowDecorations(&confirm_sw);
|
||||
if (confirm_sw.exec() != QMessageBox::Yes)
|
||||
{
|
||||
m_backend_combo->setCurrentIndex(m_previous_backend);
|
||||
|
@ -27,7 +27,7 @@ class PostProcessingConfigWindow final : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PostProcessingConfigWindow(EnhancementsWidget* parent, const std::string& shader);
|
||||
~PostProcessingConfigWindow();
|
||||
~PostProcessingConfigWindow() override;
|
||||
|
||||
private:
|
||||
class ConfigGroup final
|
||||
|
@ -35,7 +35,7 @@ class GraphicsModListWidget : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GraphicsModListWidget(const UICommon::GameFile& game);
|
||||
~GraphicsModListWidget();
|
||||
~GraphicsModListWidget() override;
|
||||
|
||||
void SaveToDisk();
|
||||
|
||||
|
@ -17,7 +17,7 @@ class LogConfigWidget final : public QDockWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LogConfigWidget(QWidget* parent = nullptr);
|
||||
~LogConfigWidget();
|
||||
~LogConfigWidget() override;
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
@ -23,7 +23,7 @@ class LogWidget final : public QDockWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LogWidget(QWidget* parent = nullptr);
|
||||
~LogWidget();
|
||||
~LogWidget() override;
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent*) override;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include "Core/FreeLookManager.h"
|
||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
FreeLookRotation::FreeLookRotation(MappingWindow* window) : MappingWidget(window)
|
||||
@ -34,7 +33,6 @@ void FreeLookRotation::CreateMainLayout()
|
||||
ControllerInterfaceWindow* window = new ControllerInterfaceWindow(this);
|
||||
window->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
window->setWindowModality(Qt::WindowModality::WindowModal);
|
||||
SetQWidgetWindowDecorations(window);
|
||||
window->show();
|
||||
});
|
||||
m_main_layout->addLayout(alternate_input_layout, 0, 0, 1, -1);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user