mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-08 16:27:49 +00:00
Compare commits
11 Commits
cc55c10911
...
7c6b6f980c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7c6b6f980c | ||
![]() |
24b0bf01d5 | ||
![]() |
19fbbf0dba | ||
![]() |
1786e34bd3 | ||
![]() |
65f3ba70f5 | ||
![]() |
5906512847 | ||
![]() |
d766c527c7 | ||
![]() |
4b65cc9a4c | ||
![]() |
f99d3dbd5c | ||
![]() |
34e8fb068f | ||
![]() |
f240e20e3f |
@ -0,0 +1,28 @@
|
||||
package org.dolphinemu.dolphinemu.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioManager
|
||||
import androidx.annotation.Keep
|
||||
import org.dolphinemu.dolphinemu.DolphinApplication
|
||||
|
||||
object AudioUtils {
|
||||
@JvmStatic @Keep
|
||||
fun getSampleRate(): Int =
|
||||
getAudioServiceProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE, 48000)
|
||||
|
||||
@JvmStatic @Keep
|
||||
fun getFramesPerBuffer(): Int =
|
||||
getAudioServiceProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER, 256)
|
||||
|
||||
private fun getAudioServiceProperty(property: String, fallback: Int): Int {
|
||||
return try {
|
||||
val context = DolphinApplication.getAppContext()
|
||||
val am = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
Integer.parseUnsignedInt(am.getProperty(property))
|
||||
} catch (e: NullPointerException) {
|
||||
fallback
|
||||
} catch (e: NumberFormatException) {
|
||||
fallback
|
||||
}
|
||||
}
|
||||
}
|
@ -122,6 +122,10 @@ static jmethodID s_permission_handler_request_record_audio_permission;
|
||||
|
||||
static jmethodID s_runnable_run;
|
||||
|
||||
static jclass s_audio_utils_class;
|
||||
static jmethodID s_audio_utils_get_sample_rate;
|
||||
static jmethodID s_audio_utils_get_frames_per_buffer;
|
||||
|
||||
namespace IDCache
|
||||
{
|
||||
JNIEnv* GetEnvForThread()
|
||||
@ -562,6 +566,21 @@ jmethodID GetRunnableRun()
|
||||
return s_runnable_run;
|
||||
}
|
||||
|
||||
jclass GetAudioUtilsClass()
|
||||
{
|
||||
return s_audio_utils_class;
|
||||
}
|
||||
|
||||
jmethodID GetAudioUtilsGetSampleRate()
|
||||
{
|
||||
return s_audio_utils_get_sample_rate;
|
||||
}
|
||||
|
||||
jmethodID GetAudioUtilsGetFramesPerBuffer()
|
||||
{
|
||||
return s_audio_utils_get_frames_per_buffer;
|
||||
}
|
||||
|
||||
} // namespace IDCache
|
||||
|
||||
extern "C" {
|
||||
@ -798,6 +817,13 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
s_runnable_run = env->GetMethodID(runnable_class, "run", "()V");
|
||||
env->DeleteLocalRef(runnable_class);
|
||||
|
||||
const jclass audio_utils_class = env->FindClass("org/dolphinemu/dolphinemu/utils/AudioUtils");
|
||||
s_audio_utils_class = reinterpret_cast<jclass>(env->NewGlobalRef(audio_utils_class));
|
||||
s_audio_utils_get_sample_rate = env->GetStaticMethodID(audio_utils_class, "getSampleRate", "()I");
|
||||
s_audio_utils_get_frames_per_buffer =
|
||||
env->GetStaticMethodID(audio_utils_class, "getFramesPerBuffer", "()I");
|
||||
env->DeleteLocalRef(audio_utils_class);
|
||||
|
||||
return JNI_VERSION;
|
||||
}
|
||||
|
||||
@ -834,5 +860,6 @@ JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved)
|
||||
env->DeleteGlobalRef(s_core_device_control_class);
|
||||
env->DeleteGlobalRef(s_input_detector_class);
|
||||
env->DeleteGlobalRef(s_permission_handler_class);
|
||||
env->DeleteGlobalRef(s_audio_utils_class);
|
||||
}
|
||||
}
|
||||
|
@ -121,4 +121,8 @@ jmethodID GetPermissionHandlerRequestRecordAudioPermission();
|
||||
|
||||
jmethodID GetRunnableRun();
|
||||
|
||||
jclass GetAudioUtilsClass();
|
||||
jmethodID GetAudioUtilsGetSampleRate();
|
||||
jmethodID GetAudioUtilsGetFramesPerBuffer();
|
||||
|
||||
} // namespace IDCache
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "AudioCommon/WASAPIStream.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/System.h"
|
||||
@ -219,8 +220,11 @@ void StartAudioDump(Core::System& system)
|
||||
|
||||
std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID();
|
||||
|
||||
std::string base_name =
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, fmt::localtime(start_time));
|
||||
const auto local_time = Common::LocalTime(start_time);
|
||||
if (!local_time)
|
||||
return;
|
||||
|
||||
std::string base_name = fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *local_time);
|
||||
|
||||
const std::string audio_file_name_dtk = fmt::format("{}_dtkdump.wav", base_name);
|
||||
const std::string audio_file_name_dsp = fmt::format("{}_dspdump.wav", base_name);
|
||||
|
@ -8,40 +8,27 @@
|
||||
|
||||
#include <SLES/OpenSLES.h>
|
||||
#include <SLES/OpenSLES_Android.h>
|
||||
#include <jni.h>
|
||||
|
||||
#include "Common/Assert.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "jni/AndroidCommon/IDCache.h"
|
||||
|
||||
// engine interfaces
|
||||
static SLObjectItf engineObject;
|
||||
static SLEngineItf engineEngine;
|
||||
static SLObjectItf outputMixObject;
|
||||
|
||||
// buffer queue player interfaces
|
||||
static SLObjectItf bqPlayerObject = nullptr;
|
||||
static SLPlayItf bqPlayerPlay;
|
||||
static SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;
|
||||
static SLVolumeItf bqPlayerVolume;
|
||||
static Mixer* g_mixer;
|
||||
#define BUFFER_SIZE 512
|
||||
#define BUFFER_SIZE_IN_SAMPLES (BUFFER_SIZE / 2)
|
||||
|
||||
// Double buffering.
|
||||
static short buffer[2][BUFFER_SIZE];
|
||||
static int curBuffer = 0;
|
||||
|
||||
static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context)
|
||||
void OpenSLESStream::BQPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context)
|
||||
{
|
||||
ASSERT(bq == bqPlayerBufferQueue);
|
||||
ASSERT(nullptr == context);
|
||||
reinterpret_cast<OpenSLESStream*>(context)->PushSamples(bq);
|
||||
}
|
||||
|
||||
void OpenSLESStream::PushSamples(SLAndroidSimpleBufferQueueItf bq)
|
||||
{
|
||||
ASSERT(bq == m_bq_player_buffer_queue);
|
||||
|
||||
// Render to the fresh buffer
|
||||
g_mixer->Mix(reinterpret_cast<short*>(buffer[curBuffer]), BUFFER_SIZE_IN_SAMPLES);
|
||||
SLresult result =
|
||||
(*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[curBuffer], sizeof(buffer[0]));
|
||||
curBuffer ^= 1; // Switch buffer
|
||||
m_mixer->Mix(m_buffer[m_current_buffer].data(), m_frames_per_buffer);
|
||||
SLresult result = (*bq)->Enqueue(bq, m_buffer[m_current_buffer].data(), m_bytes_per_buffer);
|
||||
m_current_buffer ^= 1; // Switch buffer
|
||||
|
||||
// Comment from sample code:
|
||||
// the most likely other result is SL_RESULT_BUFFER_INSUFFICIENT,
|
||||
@ -51,61 +38,78 @@ static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context)
|
||||
|
||||
bool OpenSLESStream::Init()
|
||||
{
|
||||
JNIEnv* env = IDCache::GetEnvForThread();
|
||||
jclass audio_utils = IDCache::GetAudioUtilsClass();
|
||||
const SLuint32 sample_rate =
|
||||
env->CallStaticIntMethod(audio_utils, IDCache::GetAudioUtilsGetSampleRate());
|
||||
m_frames_per_buffer =
|
||||
env->CallStaticIntMethod(audio_utils, IDCache::GetAudioUtilsGetFramesPerBuffer());
|
||||
|
||||
INFO_LOG_FMT(AUDIO, "OpenSLES configuration: {} Hz, {} frames per buffer", sample_rate,
|
||||
m_frames_per_buffer);
|
||||
|
||||
constexpr SLuint32 channels = 2;
|
||||
const SLuint32 samples_per_buffer = m_frames_per_buffer * channels;
|
||||
m_bytes_per_buffer = m_frames_per_buffer * channels * sizeof(m_buffer[0][0]);
|
||||
|
||||
for (std::vector<short>& buffer : m_buffer)
|
||||
buffer.resize(samples_per_buffer);
|
||||
|
||||
SLresult result;
|
||||
// create engine
|
||||
result = slCreateEngine(&engineObject, 0, nullptr, 0, nullptr, nullptr);
|
||||
result = slCreateEngine(&m_engine_object, 0, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE);
|
||||
result = (*m_engine_object)->Realize(m_engine_object, SL_BOOLEAN_FALSE);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine);
|
||||
result = (*m_engine_object)->GetInterface(m_engine_object, SL_IID_ENGINE, &m_engine_engine);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*engineEngine)->CreateOutputMix(engineEngine, &outputMixObject, 0, 0, 0);
|
||||
result = (*m_engine_engine)->CreateOutputMix(m_engine_engine, &m_output_mix_object, 0, 0, 0);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*outputMixObject)->Realize(outputMixObject, SL_BOOLEAN_FALSE);
|
||||
result = (*m_output_mix_object)->Realize(m_output_mix_object, SL_BOOLEAN_FALSE);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2};
|
||||
SLDataFormat_PCM format_pcm = {SL_DATAFORMAT_PCM,
|
||||
2,
|
||||
m_mixer->GetSampleRate() * 1000,
|
||||
SL_PCMSAMPLEFORMAT_FIXED_16,
|
||||
SL_PCMSAMPLEFORMAT_FIXED_16,
|
||||
SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT,
|
||||
SLDataFormat_PCM format_pcm = {
|
||||
SL_DATAFORMAT_PCM, channels,
|
||||
sample_rate * 1000, SL_PCMSAMPLEFORMAT_FIXED_16,
|
||||
SL_PCMSAMPLEFORMAT_FIXED_16, SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT,
|
||||
SL_BYTEORDER_LITTLEENDIAN};
|
||||
|
||||
SLDataSource audioSrc = {&loc_bufq, &format_pcm};
|
||||
|
||||
// configure audio sink
|
||||
SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, outputMixObject};
|
||||
SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, m_output_mix_object};
|
||||
SLDataSink audioSnk = {&loc_outmix, nullptr};
|
||||
|
||||
// create audio player
|
||||
const SLInterfaceID ids[2] = {SL_IID_BUFFERQUEUE, SL_IID_VOLUME};
|
||||
const SLboolean req[2] = {SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE};
|
||||
result =
|
||||
(*engineEngine)
|
||||
->CreateAudioPlayer(engineEngine, &bqPlayerObject, &audioSrc, &audioSnk, 2, ids, req);
|
||||
result = (*m_engine_engine)
|
||||
->CreateAudioPlayer(m_engine_engine, &m_bq_player_object, &audioSrc, &audioSnk, 2,
|
||||
ids, req);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
result = (*bqPlayerObject)->Realize(bqPlayerObject, SL_BOOLEAN_FALSE);
|
||||
result = (*m_bq_player_object)->Realize(m_bq_player_object, SL_BOOLEAN_FALSE);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_PLAY, &bqPlayerPlay);
|
||||
result = (*m_bq_player_object)->GetInterface(m_bq_player_object, SL_IID_PLAY, &m_bq_player_play);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*m_bq_player_object)
|
||||
->GetInterface(m_bq_player_object, SL_IID_BUFFERQUEUE, &m_bq_player_buffer_queue);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result =
|
||||
(*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_BUFFERQUEUE, &bqPlayerBufferQueue);
|
||||
(*m_bq_player_object)->GetInterface(m_bq_player_object, SL_IID_VOLUME, &m_bq_player_volume);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerObject)->GetInterface(bqPlayerObject, SL_IID_VOLUME, &bqPlayerVolume);
|
||||
result = (*m_bq_player_buffer_queue)
|
||||
->RegisterCallback(m_bq_player_buffer_queue, BQPlayerCallback, this);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerBufferQueue)->RegisterCallback(bqPlayerBufferQueue, bqPlayerCallback, nullptr);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
result = (*m_bq_player_play)->SetPlayState(m_bq_player_play, SL_PLAYSTATE_PLAYING);
|
||||
ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// Render and enqueue a first buffer.
|
||||
curBuffer ^= 1;
|
||||
g_mixer = m_mixer.get();
|
||||
m_current_buffer ^= 1;
|
||||
|
||||
result = (*bqPlayerBufferQueue)->Enqueue(bqPlayerBufferQueue, buffer[0], sizeof(buffer[0]));
|
||||
result = (*m_bq_player_buffer_queue)
|
||||
->Enqueue(m_bq_player_buffer_queue, m_buffer[0].data(), m_bytes_per_buffer);
|
||||
if (SL_RESULT_SUCCESS != result)
|
||||
return false;
|
||||
|
||||
@ -114,39 +118,39 @@ bool OpenSLESStream::Init()
|
||||
|
||||
OpenSLESStream::~OpenSLESStream()
|
||||
{
|
||||
if (bqPlayerObject != nullptr)
|
||||
if (m_bq_player_object != nullptr)
|
||||
{
|
||||
(*bqPlayerObject)->Destroy(bqPlayerObject);
|
||||
bqPlayerObject = nullptr;
|
||||
bqPlayerPlay = nullptr;
|
||||
bqPlayerBufferQueue = nullptr;
|
||||
bqPlayerVolume = nullptr;
|
||||
(*m_bq_player_object)->Destroy(m_bq_player_object);
|
||||
m_bq_player_object = nullptr;
|
||||
m_bq_player_play = nullptr;
|
||||
m_bq_player_buffer_queue = nullptr;
|
||||
m_bq_player_volume = nullptr;
|
||||
}
|
||||
|
||||
if (outputMixObject != nullptr)
|
||||
if (m_output_mix_object != nullptr)
|
||||
{
|
||||
(*outputMixObject)->Destroy(outputMixObject);
|
||||
outputMixObject = nullptr;
|
||||
(*m_output_mix_object)->Destroy(m_output_mix_object);
|
||||
m_output_mix_object = nullptr;
|
||||
}
|
||||
|
||||
if (engineObject != nullptr)
|
||||
if (m_engine_object != nullptr)
|
||||
{
|
||||
(*engineObject)->Destroy(engineObject);
|
||||
engineObject = nullptr;
|
||||
engineEngine = nullptr;
|
||||
(*m_engine_object)->Destroy(m_engine_object);
|
||||
m_engine_object = nullptr;
|
||||
m_engine_engine = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenSLESStream::SetRunning(bool running)
|
||||
{
|
||||
SLuint32 new_state = running ? SL_PLAYSTATE_PLAYING : SL_PLAYSTATE_PAUSED;
|
||||
return (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, new_state) == SL_RESULT_SUCCESS;
|
||||
return (*m_bq_player_play)->SetPlayState(m_bq_player_play, new_state) == SL_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void OpenSLESStream::SetVolume(int volume)
|
||||
{
|
||||
const SLmillibel attenuation =
|
||||
volume <= 0 ? SL_MILLIBEL_MIN : static_cast<SLmillibel>(2000 * std::log10(volume / 100.0f));
|
||||
(*bqPlayerVolume)->SetVolumeLevel(bqPlayerVolume, attenuation);
|
||||
(*m_bq_player_volume)->SetVolumeLevel(m_bq_player_volume, attenuation);
|
||||
}
|
||||
#endif // HAVE_OPENSL_ES
|
||||
|
@ -3,10 +3,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
#ifdef HAVE_OPENSL_ES
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include <SLES/OpenSLES.h>
|
||||
#include <SLES/OpenSLES_Android.h>
|
||||
#endif // HAVE_OPENSL_ES
|
||||
|
||||
#include "AudioCommon/SoundStream.h"
|
||||
#include "Common/Event.h"
|
||||
|
||||
class OpenSLESStream final : public SoundStream
|
||||
{
|
||||
@ -19,7 +24,25 @@ public:
|
||||
static bool IsValid() { return true; }
|
||||
|
||||
private:
|
||||
std::thread thread;
|
||||
Common::Event soundSyncEvent;
|
||||
static void BQPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context);
|
||||
void PushSamples(SLAndroidSimpleBufferQueueItf bq);
|
||||
|
||||
// engine interfaces
|
||||
SLObjectItf m_engine_object;
|
||||
SLEngineItf m_engine_engine;
|
||||
SLObjectItf m_output_mix_object;
|
||||
|
||||
// buffer queue player interfaces
|
||||
SLObjectItf m_bq_player_object = nullptr;
|
||||
SLPlayItf m_bq_player_play;
|
||||
SLAndroidSimpleBufferQueueItf m_bq_player_buffer_queue;
|
||||
SLVolumeItf m_bq_player_volume;
|
||||
|
||||
SLuint32 m_frames_per_buffer;
|
||||
SLuint32 m_bytes_per_buffer;
|
||||
|
||||
// Double buffering.
|
||||
std::array<std::vector<short>, 2> m_buffer;
|
||||
int m_current_buffer = 0;
|
||||
#endif // HAVE_OPENSL_ES
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -5,9 +5,19 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <version>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
#if defined(__cpp_lib_ranges_contains) && __cpp_lib_ranges_contains >= 202202L
|
||||
|
||||
// Use the standard library functions if available (C++23)
|
||||
inline constexpr auto& Contains = std::ranges::contains;
|
||||
inline constexpr auto& ContainsSubrange = std::ranges::contains_subrange;
|
||||
|
||||
#else
|
||||
// TODO C++23: This old implementation likely isn't needed once migrated to C++23. Remove them or
|
||||
// this file itself. Ad hoc implementations for C++20
|
||||
struct ContainsFn
|
||||
{
|
||||
template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity>
|
||||
@ -54,8 +64,8 @@ struct ContainsSubrangeFn
|
||||
}
|
||||
};
|
||||
|
||||
// TODO C++23: Replace with std::ranges::contains.
|
||||
inline constexpr ContainsFn Contains{};
|
||||
// TODO C++23: Replace with std::ranges::contains_subrange.
|
||||
inline constexpr ContainsSubrangeFn ContainsSubrange{};
|
||||
|
||||
#endif
|
||||
} // namespace Common
|
||||
|
@ -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{};
|
||||
};
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/ScopeGuard.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
|
||||
@ -95,12 +96,7 @@ int SDCardDiskIOCtl(File::IOFile* image, u8 pdrv, u8 cmd, void* buff)
|
||||
u32 GetSystemTimeFAT()
|
||||
{
|
||||
const std::time_t time = std::time(nullptr);
|
||||
std::tm tm;
|
||||
#ifdef _WIN32
|
||||
localtime_s(&tm, &time);
|
||||
#else
|
||||
localtime_r(&time, &tm);
|
||||
#endif
|
||||
std::tm tm = *Common::LocalTime(time);
|
||||
|
||||
DWORD fattime = 0;
|
||||
fattime |= (tm.tm_year - 80) << 25;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -122,7 +122,6 @@ std::string SettingsWriter::GenerateSerialNumber()
|
||||
|
||||
// Must be 9 characters at most; otherwise the serial number will be rejected by SDK libraries,
|
||||
// as there is a check to ensure the string length is strictly lower than 10.
|
||||
// 3 for %j, 2 for %H, 2 for %M, 2 for %S.
|
||||
return fmt::format("{:%j%H%M%S}", fmt::localtime(t));
|
||||
return fmt::format("{:09}", t % 1000000000);
|
||||
}
|
||||
} // namespace Common
|
||||
|
@ -2,23 +2,25 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <optional>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
std::optional<std::tm> Localtime(std::time_t time)
|
||||
std::optional<std::tm> LocalTime(std::time_t time)
|
||||
{
|
||||
std::tm local_time;
|
||||
#ifdef _MSC_VER
|
||||
if (localtime_s(&local_time, &time) != 0)
|
||||
return std::nullopt;
|
||||
#else
|
||||
std::tm* result = localtime_r(&time, &local_time);
|
||||
if (result != &local_time)
|
||||
return std::nullopt;
|
||||
if (localtime_r(&time, &local_time) == NULL)
|
||||
#endif
|
||||
{
|
||||
ERROR_LOG_FMT(COMMON, "Failed to convert time to local time: {}", std::strerror(errno));
|
||||
return std::nullopt;
|
||||
}
|
||||
return local_time;
|
||||
}
|
||||
} // Namespace Common
|
||||
|
@ -9,5 +9,5 @@
|
||||
namespace Common
|
||||
{
|
||||
// Threadsafe and error-checking variant of std::localtime()
|
||||
std::optional<std::tm> Localtime(std::time_t time);
|
||||
std::optional<std::tm> LocalTime(std::time_t time);
|
||||
} // Namespace Common
|
||||
|
@ -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); }
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <queue>
|
||||
#include <utility>
|
||||
#include <variant>
|
||||
@ -34,6 +35,7 @@
|
||||
#include "Common/ScopeGuard.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/Version.h"
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
@ -733,15 +735,17 @@ static std::string GenerateScreenshotFolderPath()
|
||||
return path;
|
||||
}
|
||||
|
||||
static std::string GenerateScreenshotName()
|
||||
static std::optional<std::string> GenerateScreenshotName()
|
||||
{
|
||||
// append gameId, path only contains the folder here.
|
||||
const std::string path_prefix =
|
||||
GenerateScreenshotFolderPath() + SConfig::GetInstance().GetGameID();
|
||||
|
||||
const std::time_t cur_time = std::time(nullptr);
|
||||
const std::string base_name =
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, fmt::localtime(cur_time));
|
||||
const auto local_time = Common::LocalTime(cur_time);
|
||||
if (!local_time)
|
||||
return std::nullopt;
|
||||
const std::string base_name = fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *local_time);
|
||||
|
||||
// First try a filename without any suffixes, if already exists then append increasing numbers
|
||||
std::string name = fmt::format("{}.png", base_name);
|
||||
@ -757,7 +761,9 @@ static std::string GenerateScreenshotName()
|
||||
void SaveScreenShot()
|
||||
{
|
||||
const Core::CPUThreadGuard guard(Core::System::GetInstance());
|
||||
g_frame_dumper->SaveScreenshot(GenerateScreenshotName());
|
||||
std::optional<std::string> name = GenerateScreenshotName();
|
||||
if (name)
|
||||
g_frame_dumper->SaveScreenshot(*name);
|
||||
}
|
||||
|
||||
void SaveScreenShot(std::string_view name)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "Common/Network.h"
|
||||
#include "Common/PcapFile.h"
|
||||
#include "Common/ScopeGuard.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
@ -82,7 +83,7 @@ PCAPSSLCaptureLogger::PCAPSSLCaptureLogger()
|
||||
{
|
||||
const std::string filepath =
|
||||
fmt::format("{}{} {:%Y-%m-%d %Hh%Mm%Ss}.pcap", File::GetUserPath(D_DUMPSSL_IDX),
|
||||
SConfig::GetInstance().GetGameID(), fmt::localtime(std::time(nullptr)));
|
||||
SConfig::GetInstance().GetGameID(), *Common::LocalTime(std::time(nullptr)));
|
||||
m_file = std::make_unique<Common::PCAP>(
|
||||
new File::IOFile(filepath, "wb", File::SharedAccess::Read), Common::PCAP::LinkType::Ethernet);
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -281,7 +281,7 @@ static std::string SystemTimeAsDoubleToString(double time)
|
||||
{
|
||||
// revert adjustments from GetSystemTimeAsDouble() to get a normal Unix timestamp again
|
||||
const time_t seconds = static_cast<time_t>(time) + DOUBLE_TIME_OFFSET;
|
||||
const auto local_time = Common::Localtime(seconds);
|
||||
const auto local_time = Common::LocalTime(seconds);
|
||||
if (!local_time)
|
||||
return "";
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -15,7 +15,7 @@ class GCPadWiiUConfigDialog final : public QDialog
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GCPadWiiUConfigDialog(int port, QWidget* parent = nullptr);
|
||||
~GCPadWiiUConfigDialog();
|
||||
~GCPadWiiUConfigDialog() override;
|
||||
|
||||
private:
|
||||
void LoadSettings();
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/QtUtils/BlockUserInputFilter.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
#include "InputCommon/ControlReference/ControlReference.h"
|
||||
@ -259,8 +258,6 @@ IOWindow::IOWindow(MappingWindow* window, ControllerEmu::EmulatedController* con
|
||||
: QDialog(window), m_reference(ref), m_original_expression(ref->GetExpression()),
|
||||
m_controller(controller), m_type(type)
|
||||
{
|
||||
SetQWidgetWindowDecorations(this);
|
||||
|
||||
CreateMainLayout();
|
||||
|
||||
connect(window, &MappingWindow::Update, this, &IOWindow::Update);
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "DolphinQt/Config/Mapping/MappingIndicator.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingNumeric.h"
|
||||
#include "DolphinQt/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include "InputCommon/ControllerEmu/Control/Control.h"
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
||||
@ -282,7 +281,6 @@ void MappingWidget::ShowAdvancedControlGroupDialog(ControllerEmu::ControlGroup*
|
||||
// Enable "Close" button functionality.
|
||||
connect(button_box, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,6 @@
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/WindowActivationEventFilter.h"
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
@ -271,7 +270,6 @@ void MappingWindow::OnDeleteProfilePressed()
|
||||
error.setIcon(QMessageBox::Critical);
|
||||
error.setWindowTitle(tr("Error"));
|
||||
error.setText(tr("The profile '%1' does not exist").arg(profile_name));
|
||||
SetQWidgetWindowDecorations(&error);
|
||||
error.exec();
|
||||
return;
|
||||
}
|
||||
@ -284,7 +282,6 @@ void MappingWindow::OnDeleteProfilePressed()
|
||||
confirm.setInformativeText(tr("This cannot be undone!"));
|
||||
confirm.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel);
|
||||
|
||||
SetQWidgetWindowDecorations(&confirm);
|
||||
if (confirm.exec() != QMessageBox::Yes)
|
||||
{
|
||||
return;
|
||||
@ -312,7 +309,6 @@ void MappingWindow::OnLoadProfilePressed()
|
||||
error.setIcon(QMessageBox::Critical);
|
||||
error.setWindowTitle(tr("Error"));
|
||||
error.setText(tr("The profile '%1' does not exist").arg(m_profiles_combo->currentText()));
|
||||
SetQWidgetWindowDecorations(&error);
|
||||
error.exec();
|
||||
return;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
@ -43,7 +42,6 @@ void WiimoteEmuExtensionMotionInput::CreateNunchukLayout()
|
||||
warning_layout->addWidget(warning_input_sources_button);
|
||||
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
|
||||
ControllerInterfaceWindow window{this};
|
||||
SetQWidgetWindowDecorations(&window);
|
||||
window.exec();
|
||||
});
|
||||
layout->addLayout(warning_layout, 0, 0, 1, -1);
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
|
||||
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include "InputCommon/InputConfig.h"
|
||||
|
||||
@ -41,7 +40,6 @@ void WiimoteEmuMotionControlIMU::CreateMainLayout()
|
||||
warning_layout->addWidget(warning_input_sources_button);
|
||||
connect(warning_input_sources_button, &QPushButton::clicked, this, [this] {
|
||||
ControllerInterfaceWindow window{this};
|
||||
SetQWidgetWindowDecorations(&window);
|
||||
window.exec();
|
||||
});
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include "DolphinQt/Config/HardcoreWarningWidget.h"
|
||||
#include "DolphinQt/Config/NewPatchDialog.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
|
||||
#include "UICommon/GameFile.h"
|
||||
|
||||
@ -94,7 +93,6 @@ void PatchesWidget::OnAdd()
|
||||
bool new_patch_confirmed = false;
|
||||
{
|
||||
NewPatchDialog dialog(this, patch);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
new_patch_confirmed = dialog.exec();
|
||||
}
|
||||
if (new_patch_confirmed)
|
||||
@ -124,7 +122,6 @@ void PatchesWidget::OnEdit()
|
||||
bool new_patch_confirmed = false;
|
||||
{
|
||||
NewPatchDialog dialog(this, patch);
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
new_patch_confirmed = dialog.exec();
|
||||
}
|
||||
if (new_patch_confirmed)
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "DiscIO/Volume.h"
|
||||
#include "DiscIO/VolumeVerifier.h"
|
||||
#include "DolphinQt/QtUtils/ParallelProgressDialog.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
VerifyWidget::VerifyWidget(std::shared_ptr<DiscIO::Volume> volume) : m_volume(std::move(volume))
|
||||
@ -180,7 +179,6 @@ void VerifyWidget::Verify()
|
||||
progress.Reset();
|
||||
return verifier.GetResult();
|
||||
});
|
||||
SetQWidgetWindowDecorations(progress.GetRaw());
|
||||
progress.GetRaw()->exec();
|
||||
|
||||
std::optional<DiscIO::VolumeVerifier::Result> result = future.get();
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
#include "DolphinQt/QtUtils/QueueOnObject.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/QtUtils/SignalBlocking.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -378,7 +377,6 @@ void WiimoteControllersWidget::OnWiimoteConfigure(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();
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/ParallelProgressDialog.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "UICommon/GameFile.h"
|
||||
#include "UICommon/UICommon.h"
|
||||
|
||||
@ -283,7 +282,6 @@ bool ConvertDialog::ShowAreYouSureDialog(const QString& text)
|
||||
warning.setInformativeText(text);
|
||||
warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
SetQWidgetWindowDecorations(&warning);
|
||||
return warning.exec() == QMessageBox::Yes;
|
||||
}
|
||||
|
||||
@ -408,7 +406,6 @@ void ConvertDialog::Convert()
|
||||
.arg(dst_info.fileName()));
|
||||
confirm_replace.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
SetQWidgetWindowDecorations(&confirm_replace);
|
||||
if (confirm_replace.exec() == QMessageBox::No)
|
||||
continue;
|
||||
}
|
||||
@ -519,7 +516,6 @@ void ConvertDialog::Convert()
|
||||
break;
|
||||
}
|
||||
|
||||
SetQWidgetWindowDecorations(progress_dialog.GetRaw());
|
||||
progress_dialog.GetRaw()->exec();
|
||||
if (!success.get())
|
||||
{
|
||||
|
@ -31,10 +31,10 @@ public:
|
||||
|
||||
bool ApplicationCloseRequest();
|
||||
|
||||
~AssemblerWidget();
|
||||
~AssemblerWidget() override;
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent*);
|
||||
void closeEvent(QCloseEvent*) override;
|
||||
|
||||
private:
|
||||
enum class AsmKind
|
||||
|
@ -47,7 +47,6 @@
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/DolphinFileDialog.h"
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "DolphinQt/Debugger/BreakpointDialog.h"
|
||||
#include "DolphinQt/Debugger/MemoryWidget.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -65,7 +64,8 @@ public:
|
||||
CustomDelegate(BreakpointWidget* parent) : QStyledItemDelegate(parent) {}
|
||||
|
||||
private:
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||
void paint(QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const override
|
||||
{
|
||||
Q_ASSERT(index.isValid());
|
||||
|
||||
@ -442,7 +442,6 @@ void BreakpointWidget::OnNewBreakpoint()
|
||||
{
|
||||
BreakpointDialog* dialog = new BreakpointDialog(this);
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
SetQWidgetWindowDecorations(dialog);
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
@ -453,7 +452,6 @@ void BreakpointWidget::OnEditBreakpoint(u32 address, bool is_instruction_bp)
|
||||
auto* dialog = new BreakpointDialog(
|
||||
this, m_system.GetPowerPC().GetBreakPoints().GetRegularBreakpoint(address));
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
SetQWidgetWindowDecorations(dialog);
|
||||
dialog->exec();
|
||||
}
|
||||
else
|
||||
@ -461,7 +459,6 @@ void BreakpointWidget::OnEditBreakpoint(u32 address, bool is_instruction_bp)
|
||||
auto* dialog =
|
||||
new BreakpointDialog(this, m_system.GetPowerPC().GetMemChecks().GetMemCheck(address));
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
SetQWidgetWindowDecorations(dialog);
|
||||
dialog->exec();
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class BreakpointWidget : public QDockWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BreakpointWidget(QWidget* parent = nullptr);
|
||||
~BreakpointWidget();
|
||||
~BreakpointWidget() override;
|
||||
|
||||
void AddBP(u32 addr);
|
||||
void AddBP(u32 addr, bool break_on_hit, bool log_on_hit, const QString& condition);
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "DolphinQt/Debugger/PatchInstructionDialog.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/FromStdString.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Resources.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
@ -743,7 +742,6 @@ void CodeViewWidget::AutoStep(CodeTrace::AutoStop option)
|
||||
.arg(QString::fromStdString(fmt::format("{:#x}", fmt::join(mem_out, ", "))));
|
||||
|
||||
msgbox.setInformativeText(msgtext);
|
||||
SetQWidgetWindowDecorations(&msgbox);
|
||||
msgbox.exec();
|
||||
|
||||
} while (msgbox.clickedButton() == (QAbstractButton*)run_button);
|
||||
@ -1031,7 +1029,6 @@ void CodeViewWidget::DoPatchInstruction(bool assemble)
|
||||
if (assemble)
|
||||
{
|
||||
AssembleInstructionDialog dialog(this, addr, debug_interface.ReadInstruction(guard, addr));
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
debug_interface.SetPatch(guard, addr, dialog.GetCode());
|
||||
@ -1041,7 +1038,6 @@ void CodeViewWidget::DoPatchInstruction(bool assemble)
|
||||
else
|
||||
{
|
||||
PatchInstructionDialog dialog(this, addr, debug_interface.ReadInstruction(guard, addr));
|
||||
SetQWidgetWindowDecorations(&dialog);
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
debug_interface.SetPatch(guard, addr, dialog.GetCode());
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "Core/System.h"
|
||||
#include "DolphinQt/Debugger/BranchWatchDialog.h"
|
||||
#include "DolphinQt/Host.h"
|
||||
#include "DolphinQt/QtUtils/SetWindowDecorations.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
static const QString BOX_SPLITTER_STYLESHEET = QStringLiteral(
|
||||
@ -222,7 +221,6 @@ void CodeWidget::OnBranchWatchDialog()
|
||||
m_branch_watch_dialog = new BranchWatchDialog(m_system, m_system.GetPowerPC().GetBranchWatch(),
|
||||
m_ppc_symbol_db, this, this);
|
||||
}
|
||||
SetQWidgetWindowDecorations(m_branch_watch_dialog);
|
||||
m_branch_watch_dialog->show();
|
||||
m_branch_watch_dialog->raise();
|
||||
m_branch_watch_dialog->activateWindow();
|
||||
|
@ -33,7 +33,7 @@ class CodeWidget : public QDockWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CodeWidget(QWidget* parent = nullptr);
|
||||
~CodeWidget();
|
||||
~CodeWidget() override;
|
||||
|
||||
void Step();
|
||||
void StepOver();
|
||||
|
@ -16,7 +16,7 @@ using namespace Common::GekkoAssembler::detail;
|
||||
class HighlightParsePlugin : public ParsePlugin
|
||||
{
|
||||
public:
|
||||
virtual ~HighlightParsePlugin() = default;
|
||||
~HighlightParsePlugin() override = default;
|
||||
|
||||
std::vector<std::pair<int, int>>&& MoveParens() { return std::move(m_matched_parens); }
|
||||
std::vector<std::tuple<int, int, HighlightFormat>>&& MoveFormatting()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user