Commit Graph
933 Commits
Author SHA1 Message Date
Vasily c2dff4c863 Move internal settings headers into /internal/ dir
The additional headers are not intended to be public. To reinforce that
it is a bad idea to include these they are put into the /internal/
directory.
2019-12-10 08:28:41 +01:00
Vasily 1465c4a8bd Convert getSettingsController() to global static object
After looking at the assembly output it became apparent that the Windows
compiler did not compile out the `getSettingsController()` function
call.

This led to an unnecessary function call in order to get the
SettingsController. Turning it into a static object in the compilation
unit scope removes this function call and turns getSettings call into a
single instruction (not counting zeroing the register for comparison and
the jump instruction afterwards).

----

Adding the following code to the `main` function:
```cpp
f ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
{
        LOG( INFO ) << "Enabled";
}
else
{
        LOG( INFO ) << "Disabled";
}
```

Leads to this with the `getSettingsController` function:
```assembly
[...]
    47            if ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
0x7ff6c96819a0  <+ 1024>         call AdvancedSettings!settings::getSettingsController (00007ff6`c96cd280)
0x7ff6c96819a5  <+ 1029>         xorps   xmm0,xmm0
0x7ff6c96819a8  <+ 1032>         cmp     byte ptr [rax+5FCh],0
0x7ff6c96819af  <+ 1039>         je AdvancedSettings!main+0x4fd (00007ff6`c9681a9d)
    49                LOG( INFO ) << "Enabled";
0x7ff6c96819b5  <+ 1045>         mov     qword ptr
[rsp+288h],r15
0x7ff6c96819bd  <+ 1053>         mov     qword ptr
[rsp+290h],rsi
[...]
```

And this without the function:
```assembly
[...]
    47            if ( settings::getSetting( settings::BoolSetting::UTILITY_vrcDebug ) )
0x7ff7d97a19bb  <+ 1019>         xorps   xmm0,xmm0
0x7ff7d97a19be  <+ 1022>         cmp     byte ptr [AdvancedSettings!settings::settingController+0x5fc (00007ff7`d9854d4c)],0
0x7ff7d97a19c5  <+ 1029>         je AdvancedSettings!main+0x4f3 (00007ff7`d97a1ab3)
    49                LOG( INFO ) << "Enabled";
0x7ff7d97a19cb  <+ 1035>         mov     qword ptr
[rsp+288h],r15
0x7ff7d97a19d3  <+ 1043>         mov     qword ptr
[rsp+290h],rsi
[...]
```

Notice the missing `call AdvancedSettings![...]` without the function
and that the settings call literally cannot be made any faster.
2019-12-10 08:28:41 +01:00
Vasily 7cecc6ab69 Convert m_isOverlayMethodActive to new settings API 2019-12-10 08:28:41 +01:00
Vasily fb1cd0c93f Convert m_colorOverlayEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily 117b0f65eb Convert m_colorBlue to new settings API 2019-12-10 08:28:41 +01:00
Vasily 6e0b6d39f8 Convert m_colorGreen to new settings API 2019-12-10 08:28:41 +01:00
Vasily b0b1f44ae1 Remove color*New from settings
The color*New settings were a hotfix for 4.0.1 where wrong settings were
applied to the colors leading to a black headset screen.
The New postfix is to manually prevent the settings file from reading
the old values.
2019-12-10 08:28:41 +01:00
Vasily d474af9501 Convert m_colorRed to new settings API 2019-12-10 08:28:41 +01:00
Vasily 287a6139be Convert m_brightnessEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily 39ec5267f6 Convert m_colorOverlayOpacity to new settings API
The setColorOverlayEnabled function had a bug where the previous value
would be applied instead of the current value.
2019-12-10 08:28:41 +01:00
Vasily a13b901b88 Convert m_brightnessValue to new settings API 2019-12-10 08:28:41 +01:00
Vasily 0710432933 Convert m_brightnessOpacityValue to new settings API 2019-12-10 08:28:41 +01:00
Vasily ec73c54f3e Convert m_fadeDistanceRemembered to new settings API 2019-12-10 08:28:41 +01:00
Vasily 0c07f0c207 Convert m_chaperoneShowDashboardDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 292398fd98 Convert m_chaperoneAlarmSoundDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 13c8eabeb0 Convert m_chaperoneHapticFeedbackDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily 81bbec52b4 Convert m_chaperoneSwitchToBeginnerDistance to new settings API 2019-12-10 08:28:41 +01:00
Vasily d47c570537 Convert m_disableChaperone to new settings API 2019-12-10 08:28:41 +01:00
Vasily be6a21d321 Convert m_enableChaperoneShowDashboard to new settings API 2019-12-10 08:28:41 +01:00
Vasily b6f0e22770 Convert m_chaperoneAlarmSoundAdjustVolume to new settings API 2019-12-10 08:28:41 +01:00
Vasily 3632fc03d5 Convert m_chaperoneAlarmSoundLooping to new settings API 2019-12-10 08:28:41 +01:00
Vasily 54022e0438 Convert m_enableChaperoneAlarmSound to new settings API 2019-12-10 08:28:41 +01:00
Vasily 4011674b0f Convert m_enableChaperoneHapticFeedback to new settings API 2019-12-10 08:28:41 +01:00
Vasily ee32cf90b5 Convert m_chaperoneSwitchToBeginnerActive to new settings API 2019-12-10 08:28:41 +01:00
Vasily 71b8a336c2 Convert m_alarmTime to new settings API 2019-12-10 08:28:41 +01:00
Vasily 09fcf79e8b Convert keyboardShortcuts to new settings API 2019-12-10 08:28:41 +01:00
Vasily 3375ee4b1a Convert m_vrcDebug to new settings API 2019-12-10 08:28:41 +01:00
Vasily a272decd73 Convert m_alarmIsModal to new settings API 2019-12-10 08:28:41 +01:00
Vasily e38c72ef42 Convert m_alarmEnabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily a014de8368 Convert m_micReversePtt to new settings API 2019-12-10 08:28:41 +01:00
Vasily c96b531ee1 Convert m_micProximitySensorCanMute to new settings API
The `saveAudioSettings()` function lead to an infinite loop of
saving.
2019-12-10 08:28:41 +01:00
Vasily fd43c66878 Add micReversePtt to new settings API 2019-12-10 08:28:41 +01:00
Vasily 15d314024a Add m_micProximitySensorCanMute to new settings API 2019-12-10 08:28:41 +01:00
Vasily 2ab77e6584 Convert keyboardShortcut bindings to new settings API 2019-12-10 08:28:41 +01:00
Vasily 31982c54bf Add m_customTickRateMs to new settings API
The value is verified before saving and loading. It is the
responsibility of the function calling the settings API to verify data.
2019-12-10 08:28:41 +01:00
Vasily 87bf59fd31 Add m_debugState to new settings API 2019-12-10 08:28:41 +01:00
Vasily 598d77a0e7 Convert m_disableVersionCheck to new settings API 2019-12-10 08:28:41 +01:00
Vasily c8b271ad3e Add m_enableDebug to new settings API 2019-12-10 08:28:41 +01:00
Vasily bed0939ddf Add m_crashRecoveryDisabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily adc3a1e7b2 Convert m_previousShutdownSafe to new settings API 2019-12-10 08:28:41 +01:00
Vasily 4ae8bd8fb5 Add m_vsyncDisabled to new settings API 2019-12-10 08:28:41 +01:00
Vasily f945bd06bd Remove unnecessary code forcing keyboardShortcuts to appear in config
The settings API automatically makes settings appear on startup.
2019-12-10 08:28:41 +01:00
Vasily 4be96344da Convert m_flingStrength to new settings API
Casts inside the functions because it isn't feasible to change all
floats to double.
2019-12-10 08:28:41 +01:00
Vasily 4918ff2a37 Convert m_gravityStrength to new settings API
Casts inside the function because it's not feasible to change all floats
to double.
2019-12-10 08:28:41 +01:00
Vasily 58a92f4b2b Convert m_heightToggleOffset to new settings API
Casts inside the function because it's not feasible at the moment to
change all floats to doubles.
2019-12-10 08:28:41 +01:00
Vasily ed1190020c Convert m_turnComfortFactor to new settings API 2019-12-10 08:28:41 +01:00
Vasily 214e1d26ed Convert m_dragComfortFactor to new settings API and change sign
There was no reason for it to be unsigned. This has been changed to int
for internal consistency.
2019-12-10 08:28:41 +01:00
Vasily 7a6c3fc53e Convert m_smoothTurnRate to new settings API 2019-12-10 08:28:41 +01:00
Vasily 22b52d403c Convert m_snapTurnAngle to new settings API 2019-12-10 08:28:41 +01:00
Vasily 065c5da456 Convert m_simpleRecenter to new settings API 2019-12-10 08:28:41 +01:00