mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02: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;
|
bool shouldRecenter = false;
|
||||||
|
|
||||||
if (_flags & SuppressedByHead) {
|
if (_suppressedByHead) {
|
||||||
if (isAtRest) {
|
if (isAtRest) {
|
||||||
_flags &= ~SuppressedByHead;
|
_suppressedByHead = false;
|
||||||
shouldRecenter = true;
|
shouldRecenter = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (_hmdMode && headOutsideOverlay()) {
|
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) {
|
if (targetVisible != currentVisible) {
|
||||||
offscreenUi->setPinned(!targetVisible);
|
offscreenUi->setPinned(!targetVisible);
|
||||||
}
|
}
|
||||||
if (shouldRecenter && !_flags) {
|
if (shouldRecenter && !_suppressedByHead) {
|
||||||
centerUI();
|
centerUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ private:
|
||||||
SuppressedByHead = 0x01
|
SuppressedByHead = 0x01
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t _flags { SuppressedByHead };
|
bool _suppressedByHead { false };
|
||||||
bool _hmdMode { false };
|
bool _hmdMode { false };
|
||||||
|
|
||||||
// used by updateAvatarIsAtRest
|
// used by updateAvatarIsAtRest
|
||||||
|
|
Loading…
Reference in a new issue