diff options
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r-- | indra/newview/llagent.cpp | 68 |
1 files changed, 29 insertions, 39 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c4336758ac..c8b0adbaf8 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -355,6 +355,20 @@ bool LLAgent::isMicrophoneOn(const LLSD& sdname) return LLVoiceClient::getInstance()->getUserPTTState(); } +//static +void LLAgent::toggleHearMediaSoundFromAvatar() +{ + const S32 mediaSoundsEarLocation = gSavedSettings.getS32("MediaSoundsEarLocation"); + gSavedSettings.setS32("MediaSoundsEarLocation", !mediaSoundsEarLocation); +} + +//static +void LLAgent::toggleHearVoiceFromAvatar() +{ + const S32 voiceEarLocation = gSavedSettings.getS32("VoiceEarLocation"); + gSavedSettings.setS32("VoiceEarLocation", !voiceEarLocation); +} + // ************************************************************ // Enabled this definition to compile a 'hacked' viewer that // locally believes the end user has godlike powers. @@ -425,8 +439,6 @@ LLAgent::LLAgent() : mIsDoNotDisturb(false), mControlFlags(0x00000000), - mbFlagsDirty(false), - mbFlagsNeedReset(false), mAutoPilot(false), mAutoPilotFlyOnStop(false), @@ -922,8 +934,6 @@ void LLAgent::setFlying(bool fly, bool fail_sound) // Update Movement Controls according to Fly mode LLFloaterMove::setFlyingMode(fly); - - mbFlagsDirty = true; } @@ -1054,7 +1064,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp) { regionp->setCapabilitiesReceivedCallback(LLAgent::capabilityReceivedCallback); } - } else { @@ -1542,7 +1551,6 @@ U32 LLAgent::getControlFlags() void LLAgent::setControlFlags(U32 mask) { mControlFlags |= mask; - mbFlagsDirty = true; } @@ -1551,28 +1559,7 @@ void LLAgent::setControlFlags(U32 mask) //----------------------------------------------------------------------------- void LLAgent::clearControlFlags(U32 mask) { - U32 old_flags = mControlFlags; mControlFlags &= ~mask; - if (old_flags != mControlFlags) - { - mbFlagsDirty = true; - } -} - -//----------------------------------------------------------------------------- -// controlFlagsDirty() -//----------------------------------------------------------------------------- -bool LLAgent::controlFlagsDirty() const -{ - return mbFlagsDirty; -} - -//----------------------------------------------------------------------------- -// enableControlFlagReset() -//----------------------------------------------------------------------------- -void LLAgent::enableControlFlagReset() -{ - mbFlagsNeedReset = true; } //----------------------------------------------------------------------------- @@ -1580,14 +1567,9 @@ void LLAgent::enableControlFlagReset() //----------------------------------------------------------------------------- void LLAgent::resetControlFlags() { - if (mbFlagsNeedReset) - { - mbFlagsNeedReset = false; - mbFlagsDirty = false; - // reset all of the ephemeral flags - // some flags are managed elsewhere - mControlFlags &= AGENT_CONTROL_AWAY | AGENT_CONTROL_FLY | AGENT_CONTROL_MOUSELOOK; - } + // reset all of the ephemeral flags + // some flags are managed elsewhere + mControlFlags &= AGENT_CONTROL_AWAY | AGENT_CONTROL_FLY | AGENT_CONTROL_MOUSELOOK; } //----------------------------------------------------------------------------- @@ -2071,11 +2053,19 @@ void LLAgent::propagate(const F32 dt) } // handle rotation based on keyboard levels - const F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second - yaw(YAW_RATE * gAgentCamera.getYawKey() * dt); + constexpr F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second + F32 angle = YAW_RATE * gAgentCamera.getYawKey() * dt; + if (fabs(angle) > 0.0f) + { + yaw(angle); + } - const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second - pitch(PITCH_RATE * gAgentCamera.getPitchKey() * dt); + constexpr F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second + angle = PITCH_RATE * gAgentCamera.getPitchKey() * dt; + if (fabs(angle) > 0.0f) + { + pitch(angle); + } // handle auto-land behavior if (isAgentAvatarValid()) |