mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Don't use flags; use a bool
This commit is contained in:
parent
2347634d72
commit
8ba184db6a
2 changed files with 6 additions and 6 deletions
|
@ -93,22 +93,22 @@ void OverlayConductor::update(float dt) {
|
|||
|
||||
bool shouldRecenter = false;
|
||||
|
||||
if (_flags & SuppressedByHead) {
|
||||
if (_suppressedByHead) {
|
||||
if (isAtRest) {
|
||||
_flags &= ~SuppressedByHead;
|
||||
_suppressedByHead = false;
|
||||
shouldRecenter = true;
|
||||
}
|
||||
} else {
|
||||
if (_hmdMode && headOutsideOverlay()) {
|
||||
_flags |= SuppressedByHead;
|
||||
_suppressedByHead = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && (0 == (_flags & SuppressedByHead));
|
||||
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && !_suppressedByHead;
|
||||
if (targetVisible != currentVisible) {
|
||||
offscreenUi->setPinned(!targetVisible);
|
||||
}
|
||||
if (shouldRecenter && !_flags) {
|
||||
if (shouldRecenter && !_suppressedByHead) {
|
||||
centerUI();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ private:
|
|||
SuppressedByHead = 0x01
|
||||
};
|
||||
|
||||
uint8_t _flags { SuppressedByHead };
|
||||
bool _suppressedByHead { false };
|
||||
bool _hmdMode { false };
|
||||
|
||||
// used by updateAvatarIsAtRest
|
||||
|
|
Loading…
Reference in a new issue