Actually fix the race condition

This commit is contained in:
xperia64 2019-01-18 16:32:16 -05:00
parent 5f5646c850
commit c1ac39f058
4 changed files with 6 additions and 5 deletions

View File

@ -404,7 +404,7 @@ void Config::SaveValues() {
qt_config->beginGroup("Layout"); qt_config->beginGroup("Layout");
WriteSetting("toggle_3d", Settings::values.toggle_3d, false); WriteSetting("toggle_3d", Settings::values.toggle_3d, false);
WriteSetting("factor_3d", Settings::values.factor_3d, 0); WriteSetting("factor_3d", Settings::values.factor_3d.load(), 0);
WriteSetting("layout_option", static_cast<int>(Settings::values.layout_option)); WriteSetting("layout_option", static_cast<int>(Settings::values.layout_option));
WriteSetting("swap_screen", Settings::values.swap_screen, false); WriteSetting("swap_screen", Settings::values.swap_screen, false);
WriteSetting("custom_layout", Settings::values.custom_layout, false); WriteSetting("custom_layout", Settings::values.custom_layout, false);

View File

@ -163,8 +163,7 @@ void Module::UpdatePadCallback(u64 userdata, s64 cycles_late) {
// TODO(xperia64): How the 3D Slider is updated by the HID module needs to be RE'd // TODO(xperia64): How the 3D Slider is updated by the HID module needs to be RE'd
// and possibly moved to its own Core::Timing event. // and possibly moved to its own Core::Timing event.
system.Kernel().GetSharedPageHandler().Set3DSlider( system.Kernel().GetSharedPageHandler().Set3DSlider(Settings::values.factor_3d / 100.0f);
Settings::values.toggle_3d ? Settings::values.factor_3d / 100.0f : 0.0f);
// Reschedule recurrent event // Reschedule recurrent event
system.CoreTiming().ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event); system.CoreTiming().ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event);

View File

@ -5,6 +5,7 @@
#pragma once #pragma once
#include <array> #include <array>
#include <atomic>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include "common/common_types.h" #include "common/common_types.h"
@ -148,7 +149,7 @@ struct Values {
float bg_blue; float bg_blue;
bool toggle_3d; bool toggle_3d;
u8 factor_3d; std::atomic<u8> factor_3d;
// Audio // Audio
bool enable_dsp_lle; bool enable_dsp_lle;

View File

@ -179,7 +179,8 @@ TelemetrySession::TelemetrySession() {
Settings::values.use_shader_jit); Settings::values.use_shader_jit);
AddField(Telemetry::FieldType::UserConfig, "Renderer_UseVsync", Settings::values.use_vsync); AddField(Telemetry::FieldType::UserConfig, "Renderer_UseVsync", Settings::values.use_vsync);
AddField(Telemetry::FieldType::UserConfig, "Renderer_Toggle3d", Settings::values.toggle_3d); AddField(Telemetry::FieldType::UserConfig, "Renderer_Toggle3d", Settings::values.toggle_3d);
AddField(Telemetry::FieldType::UserConfig, "Renderer_Factor3d", Settings::values.factor_3d); AddField(Telemetry::FieldType::UserConfig, "Renderer_Factor3d",
Settings::values.factor_3d.load());
AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds", Settings::values.is_new_3ds); AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds", Settings::values.is_new_3ds);
AddField(Telemetry::FieldType::UserConfig, "System_RegionValue", Settings::values.region_value); AddField(Telemetry::FieldType::UserConfig, "System_RegionValue", Settings::values.region_value);
} }