address comment

This commit is contained in:
raven02
2020-02-10 00:08:25 +08:00
parent 9966e20bc9
commit 84281ad391
9 changed files with 28 additions and 24 deletions
+13 -10
View File
@@ -28,19 +28,22 @@ __declspec(noinline, noreturn)
}
#define ASSERT(_a_) \
if (!(_a_)) { \
LOG_CRITICAL(Debug, "Assertion Failed!"); \
}
do \
if (!(_a_)) { \
assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \
} \
while (0)
#define ASSERT_MSG(_a_, ...) \
if (!(_a_)) { \
LOG_CRITICAL(Debug, "Assertion Failed! " __VA_ARGS__); \
}
do \
if (!(_a_)) { \
assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \
} \
while (0)
#define UNREACHABLE() \
{ LOG_CRITICAL(Debug, "Unreachable code!"); }
#define UNREACHABLE() assert_noinline_call([] { LOG_CRITICAL(Debug, "Unreachable code!"); })
#define UNREACHABLE_MSG(...) \
{ LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); }
assert_noinline_call([&] { LOG_CRITICAL(Debug, "Unreachable code!\n" __VA_ARGS__); })
#ifdef _DEBUG
#define DEBUG_ASSERT(_a_) ASSERT(_a_)
@@ -72,4 +75,4 @@ __declspec(noinline, noreturn)
if (!(_a_)) { \
_b_ \
} \
} while (0)
} while (0)
+1 -2
View File
@@ -28,10 +28,9 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) {
FramebufferLayout res{width, height};
const float emulation_aspect_ratio =
Settings::values.stretch_to_full
Settings::values.stretch_to_fullscreen
? static_cast<float>(height) / width
: static_cast<float>(ScreenUndocked::Height) / ScreenUndocked::Width;
const auto window_aspect_ratio = static_cast<float>(height) / width;
const Common::Rectangle<u32> screen_window_area{0, 0, width, height};
+1 -1
View File
@@ -94,7 +94,7 @@ void LogSettings() {
LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation);
LogSetting("Renderer_UseAsynchronousGpuEmulation",
Settings::values.use_asynchronous_gpu_emulation);
LogSetting("Renderer_StretchToFull", Settings::values.stretch_to_full);
LogSetting("Renderer_StretchToFullscreen", Settings::values.stretch_to_fullscreen);
LogSetting("Audio_OutputEngine", Settings::values.sink_id);
LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching);
LogSetting("Audio_OutputDevice", Settings::values.audio_device_id);
+1 -1
View File
@@ -434,7 +434,7 @@ struct Values {
bool use_disk_shader_cache;
bool use_accurate_gpu_emulation;
bool use_asynchronous_gpu_emulation;
bool stretch_to_full;
bool stretch_to_fullscreen;
bool force_30fps_mode;
float bg_red;
+1 -1
View File
@@ -188,7 +188,7 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
Settings::values.use_accurate_gpu_emulation);
AddField(field_type, "Renderer_UseAsynchronousGpuEmulation",
Settings::values.use_asynchronous_gpu_emulation);
AddField(field_type, "Renderer_StretchToFull", Settings::values.stretch_to_full);
AddField(field_type, "Renderer_StretchToFullscreen", Settings::values.stretch_to_fullscreen);
AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode);
}
+4 -3
View File
@@ -639,8 +639,8 @@ void Config::ReadRendererValues() {
ReadSetting(QStringLiteral("use_accurate_gpu_emulation"), false).toBool();
Settings::values.use_asynchronous_gpu_emulation =
ReadSetting(QStringLiteral("use_asynchronous_gpu_emulation"), false).toBool();
Settings::values.stretch_to_full =
ReadSetting(QStringLiteral("stretch_to_full"), false).toBool();
Settings::values.stretch_to_fullscreen =
ReadSetting(QStringLiteral("stretch_to_fullscreen"), false).toBool();
Settings::values.force_30fps_mode =
ReadSetting(QStringLiteral("force_30fps_mode"), false).toBool();
@@ -1075,7 +1075,8 @@ void Config::SaveRendererValues() {
Settings::values.use_accurate_gpu_emulation, false);
WriteSetting(QStringLiteral("use_asynchronous_gpu_emulation"),
Settings::values.use_asynchronous_gpu_emulation, false);
WriteSetting(QStringLiteral("stretch_to_full"), Settings::values.stretch_to_full, false);
WriteSetting(QStringLiteral("stretch_to_fullscreen"), Settings::values.stretch_to_fullscreen,
false);
WriteSetting(QStringLiteral("force_30fps_mode"), Settings::values.force_30fps_mode, false);
// Cast to double because Qt's written float values are not human-readable
@@ -102,8 +102,8 @@ void ConfigureGraphics::SetConfiguration() {
ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation);
ui->use_asynchronous_gpu_emulation->setEnabled(runtime_lock);
ui->use_asynchronous_gpu_emulation->setChecked(Settings::values.use_asynchronous_gpu_emulation);
ui->stretch_to_full->setEnabled(runtime_lock);
ui->stretch_to_full->setChecked(Settings::values.stretch_to_full);
ui->stretch_to_fullscreen->setEnabled(runtime_lock);
ui->stretch_to_fullscreen->setChecked(Settings::values.stretch_to_fullscreen);
ui->force_30fps_mode->setEnabled(runtime_lock);
ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode);
UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red, Settings::values.bg_green,
@@ -120,7 +120,7 @@ void ConfigureGraphics::ApplyConfiguration() {
Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked();
Settings::values.use_asynchronous_gpu_emulation =
ui->use_asynchronous_gpu_emulation->isChecked();
Settings::values.stretch_to_full = ui->stretch_to_full->isChecked();
Settings::values.stretch_to_fullscreen = ui->stretch_to_fullscreen->isChecked();
Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked();
Settings::values.bg_red = static_cast<float>(bg_color.redF());
Settings::values.bg_green = static_cast<float>(bg_color.greenF());
+3 -2
View File
@@ -388,8 +388,9 @@ void Config::ReadValues() {
sdl2_config->GetBoolean("Renderer", "use_accurate_gpu_emulation", false);
Settings::values.use_asynchronous_gpu_emulation =
sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false);
Settings::values.stretch_to_full =
sdl2_config->GetBoolean("Renderer", "stretch_to_full", false);
Settings::values.stretch_to_fullscreen =
sdl2_config->GetBoolean("Renderer", "stretch_to_fullscreen", false);
Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0));
Settings::values.bg_green =
static_cast<float>(sdl2_config->GetReal("Renderer", "bg_green", 0.0));
+1 -1
View File
@@ -148,7 +148,7 @@ use_asynchronous_gpu_emulation =
# Whether to stretch to full screen
# 0 (default): Off, 1 : On
stretch_to_full =
stretch_to_fullscreen =
# The clear color for the renderer. What shows up on the sides of the bottom screen.
# Must be in range of 0.0-1.0. Defaults to 1.0 for all.