diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagentcamera.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llagentcamera.h | 6 | ||||
-rw-r--r-- | indra/newview/llnetmap.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lltracker.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 3 |
6 files changed, 29 insertions, 19 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index ed6c3c307f..84a41113be 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -210,9 +210,6 @@ void LLAgentCamera::init() mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPresetType"); - mCameraOffsetInitial = gSavedSettings.getControl("CameraOffsetRearView"); - mFocusOffsetInitial = gSavedSettings.getControl("FocusOffsetRearView"); - mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); mTargetCameraDistance = mCurrentCameraDistance; @@ -1672,8 +1669,8 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - focus_offset = convert_from_llsd<LLVector3d>(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); - return focus_offset * agent_rot; + static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); + return focus_offset_initial * agent_rot; } void LLAgentCamera::setupSitCamera() @@ -1810,8 +1807,9 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); - + static LLCachedControl<F32> camera_offset_scale(gSavedSettings, "CameraOffsetScale"); + local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * camera_offset_scale; + // are we sitting down? if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { @@ -2028,12 +2026,15 @@ bool LLAgentCamera::isJoystickCameraUsed() LLVector3 LLAgentCamera::getCameraOffsetInitial() { - return convert_from_llsd<LLVector3>(mCameraOffsetInitial->get(), TYPE_VEC3, ""); + // getCameraOffsetInitial and getFocusOffsetInitial can be called on update from idle before init() + static LLCachedControl<LLVector3> camera_offset_initial (gSavedSettings, "CameraOffsetRearView", LLVector3()); + return camera_offset_initial; } LLVector3d LLAgentCamera::getFocusOffsetInitial() { - return convert_from_llsd<LLVector3d>(mFocusOffsetInitial->get(), TYPE_VEC3D, ""); + static LLCachedControl<LLVector3d> focus_offset_initial(gSavedSettings, "FocusOffsetRearView", LLVector3d()); + return focus_offset_initial; } F32 LLAgentCamera::getCameraMaxZoomDistance() diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index ec1ed433d7..89680f95dc 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -131,12 +131,6 @@ private: /** Camera preset in Third Person Mode */ ECameraPreset mCameraPreset; - /** Initial camera offset */ - LLPointer<LLControlVariable> mCameraOffsetInitial; - - /** Initial focus offset */ - LLPointer<LLControlVariable> mFocusOffsetInitial; - LLQuaternion mInitSitRot; //-------------------------------------------------------------------- diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 937f36b6fc..1240ce7c0f 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -147,6 +147,10 @@ void LLNetMap::setScale( F32 scale ) void LLNetMap::draw() { + if (!LLWorld::instanceExists()) + { + return; + } LL_PROFILE_ZONE_SCOPED; static LLFrameTimer map_timer; static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 728d0c9417..ab4ad5817b 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -109,7 +109,16 @@ void LLTracker::stopTracking(bool clear_ui) // static virtual void LLTracker::drawHUDArrow() { - if (!gSavedSettings.getBOOL("RenderTrackerBeacon")) return; + if (!LLWorld::instanceExists()) + { + return; + } + + static LLCachedControl<bool> render_beacon(gSavedSettings, "RenderTrackerBeacon", true); + if (!render_beacon) + { + return; + } if (gViewerWindow->getProgressView()->getVisible()) return; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2d34e28b93..31035f666d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -619,6 +619,7 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; +LLPointer<LLViewerTexture> LLVOAvatar::sCloudTexture = NULL; //----------------------------------------------------------------------------- // Helper functions @@ -1136,6 +1137,7 @@ void LLVOAvatar::initClass() LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged); + sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); } @@ -3080,8 +3082,7 @@ void LLVOAvatar::idleUpdateLoadingEffect() particle_parameters.mPartData.mStartColor = LLColor4(1, 1, 1, 0.5f); particle_parameters.mPartData.mEndColor = LLColor4(1, 1, 1, 0.0f); particle_parameters.mPartData.mStartScale.mV[VX] = 0.8f; - LLViewerTexture* cloud = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c"); - particle_parameters.mPartImageID = cloud->getID(); + particle_parameters.mPartImageID = sCloudTexture->getID(); particle_parameters.mMaxAge = 0.f; particle_parameters.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE; particle_parameters.mInnerAngle = F_PI; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7c2d71802e..ba67007fa9 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -336,7 +336,8 @@ public: static F32 sLODFactor; // user-settable LOD factor static F32 sPhysicsLODFactor; // user-settable physics LOD factor static BOOL sJointDebug; // output total number of joints being touched for each avatar - static BOOL sDebugAvatarRotation; + + static LLPointer<LLViewerTexture> sCloudTexture; //-------------------------------------------------------------------- // Region state |