diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 0f8c0cd53..ebe961aa8 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -165,7 +165,7 @@ U8* LLImageBase::allocateData(S32 size) { deleteData(); // virtual mBadBufferAllocation = FALSE ; - mData = new U8[size]; + mData = new (std::nothrow) U8[size]; if (!mData) { llwarns << "allocate image data: " << size << llendl; @@ -186,7 +186,7 @@ U8* LLImageBase::reallocateData(S32 size) return mData; LLMemType mt1((LLMemType::EMemType)mMemType); - U8 *new_datap = new U8[size]; + U8 *new_datap = new (std::nothrow) U8[size]; if (!new_datap) { llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; @@ -349,7 +349,7 @@ BOOL LLImageRaw::resize(U16 width, U16 height, S8 components) U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const { LLMemType mt1((LLMemType::EMemType)mMemType); - U8 *data = new U8[width*height*getComponents()]; + U8 *data = new (std::nothrow) U8[width*height*getComponents()]; // Should do some simple bounds checking if (!data) @@ -433,7 +433,7 @@ void LLImageRaw::verticalFlip() { LLMemType mt1((LLMemType::EMemType)mMemType); S32 row_bytes = getWidth() * getComponents(); - U8* line_buffer = new U8[row_bytes]; + U8* line_buffer = new (std::nothrow) U8[row_bytes]; if (!line_buffer ) { llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl; @@ -578,7 +578,7 @@ void LLImageRaw::compositeScaled4onto3(LLImageRaw* src) // Vertical: scale but no composite S32 temp_data_size = src->getWidth() * dst->getHeight() * src->getComponents(); - U8* temp_buffer = new U8[ temp_data_size ]; + U8* temp_buffer = new (std::nothrow) U8[ temp_data_size ]; if (!temp_buffer ) { llerrs << "Out of memory in LLImageRaw::compositeScaled4onto3()" << llendl; @@ -835,7 +835,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) // Vertical S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents(); llassert_always(temp_data_size > 0); - U8* temp_buffer = new U8[ temp_data_size ]; + U8* temp_buffer = new (std::nothrow) U8[ temp_data_size ]; if (!temp_buffer ) { llerrs << "Out of memory in LLImageRaw::copyScaled()" << llendl; @@ -880,7 +880,7 @@ BOOL LLImageRaw::scaleDownWithoutBlending( S32 new_width, S32 new_height) ratio_x -= 1.0f ; ratio_y -= 1.0f ; - U8* new_data = new U8[new_data_size] ; + U8* new_data = new (std::nothrow) U8[new_data_size] ; llassert_always(new_data != NULL) ; U8* old_data = getData() ; @@ -923,7 +923,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) // Vertical S32 temp_data_size = old_width * new_height * getComponents(); llassert_always(temp_data_size > 0); - U8* temp_buffer = new U8[ temp_data_size ]; + U8* temp_buffer = new (std::nothrow) U8[ temp_data_size ]; if (!temp_buffer ) { llerrs << "Out of memory in LLImageRaw::scale()" << llendl; @@ -951,7 +951,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { // copy out existing image data S32 temp_data_size = old_width * old_height * getComponents(); - U8* temp_buffer = new U8[ temp_data_size ]; + U8* temp_buffer = new (std::nothrow) U8[ temp_data_size ]; if (!temp_buffer) { llwarns << "Out of memory in LLImageRaw::scale: old (w, h, c) = (" << old_width << ", " << old_height << ", " << (S32)getComponents() << diff --git a/indra/llimage/llimagedxt.cpp b/indra/llimage/llimagedxt.cpp index 0aa6840ff..e2de614e1 100644 --- a/indra/llimage/llimagedxt.cpp +++ b/indra/llimage/llimagedxt.cpp @@ -435,7 +435,7 @@ bool LLImageDXT::convertToDXR() S32 nmips = calcNumMips(width,height); S32 total_bytes = getDataSize(); U8* olddata = getData(); - U8* newdata = new U8[total_bytes]; + U8* newdata = new (std::nothrow) U8[total_bytes]; if (!newdata) { llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl; diff --git a/indra/llimage/llimagedxt.h b/indra/llimage/llimagedxt.h index bc2d6522d..1a297536b 100644 --- a/indra/llimage/llimagedxt.h +++ b/indra/llimage/llimagedxt.h @@ -33,6 +33,7 @@ #define LL_LLIMAGEDXT_H #include "llimage.h" +#include "llpointer.h" // This class decodes and encodes LL DXT files (which may unclude uncompressed RGB or RGBA mipped data) diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 79353d55b..752ec0ea9 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -43,6 +43,11 @@ LLImageDecodeThread::LLImageDecodeThread(bool threaded) { } +//virtual +LLImageDecodeThread::~LLImageDecodeThread() +{ +} + // MAIN THREAD // virtual S32 LLImageDecodeThread::update(U32 max_time_ms) diff --git a/indra/llimage/llimageworker.h b/indra/llimage/llimageworker.h index 2703af497..061627eba 100644 --- a/indra/llimage/llimageworker.h +++ b/indra/llimage/llimageworker.h @@ -34,7 +34,8 @@ #define LL_LLIMAGEWORKER_H #include "llimage.h" -#include "llqueuedthread.h" +#include "llpointer.h" +#include "llworkerthread.h" class LLImageDecodeThread : public LLQueuedThread { @@ -78,6 +79,8 @@ public: public: LLImageDecodeThread(bool threaded = true); + virtual ~LLImageDecodeThread(); + handle_t decodeImage(LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, Responder* responder); diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index f49c657c0..8a941909b 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -332,7 +332,6 @@ public: child = getChild(i); if (child->isInside(data->getPositionGroup())) { - llassert(child->getElementCount() <= gOctreeMaxCapacity); child->insert(data); return false; } diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 49dbdbd56..242bccde7 100644 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -179,8 +179,8 @@ LLSD LLHTTPAssetRequest::getFullDetails() const double curl_total_time = -1.0f; double curl_size_upload = -1.0f; double curl_size_download = -1.0f; - long curl_content_length_upload = -1; - long curl_content_length_download = -1; + double curl_content_length_upload = -1.0f; + double curl_content_length_download = -1.0f; long curl_request_size = -1; const char* curl_content_type = NULL; @@ -199,8 +199,8 @@ LLSD LLHTTPAssetRequest::getFullDetails() const sd["curl_total_time"] = curl_total_time; sd["curl_size_upload"] = curl_size_upload; sd["curl_size_download"] = curl_size_download; - sd["curl_content_length_upload"] = (int) curl_content_length_upload; - sd["curl_content_length_download"] = (int) curl_content_length_download; + sd["curl_content_length_upload"] = curl_content_length_upload; + sd["curl_content_length_download"] = curl_content_length_download; sd["curl_request_size"] = (int) curl_request_size; if (curl_content_type) { diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 9bd21f65f..e204eaf2f 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -211,9 +211,9 @@ void LLURLRequest::useProxy(bool use_proxy) } } - lldebugs << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = \"" << env_proxy << "\"" << llendl; + LL_DEBUGS("Proxy") << "use_proxy = " << (use_proxy?'Y':'N') << ", env_proxy = " << (!env_proxy.empty() ? env_proxy : "(null)") << LL_ENDL; - if (use_proxy) + if (use_proxy && !env_proxy.empty()) { mDetail->mCurlRequest->setoptString(CURLOPT_PROXY, env_proxy); } diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 6c60e507d..fcd577a7d 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -37,7 +37,7 @@ #include "v3math.h" #include "xform.h" #include "message.h" -#include "llmemory.h" +#include "llpointer.h" #include "llvolume.h" #include "lltextureentry.h" #include "llprimtexturelist.h" diff --git a/indra/llvfs/lllfsthread.h b/indra/llvfs/lllfsthread.h index 9b2b542d2..313969330 100644 --- a/indra/llvfs/lllfsthread.h +++ b/indra/llvfs/lllfsthread.h @@ -39,7 +39,7 @@ #include #include "llapr.h" -#include "llmemory.h" // LLPointer +#include "llpointer.h" #include "llqueuedthread.h" //============================================================================ diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 1847965e6..5d733fd8b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -55,7 +55,6 @@ #include "llmoveview.h" #include "llchatbar.h" #include "llnotificationsutil.h" -#include "llnotify.h" #include "llparcel.h" #include "llrendersphere.h" #include "llsdutil.h" diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 67cec1003..59325ab3c 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1111,29 +1111,27 @@ void LLAgentCamera::cameraPanUp(F32 meters) //----------------------------------------------------------------------------- void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) { - LLVOAvatar *pAvatar = gAgentAvatarp; // bleh - static LLVector3 last_at_axis; if (!isAgentAvatarValid()) return; - LLQuaternion av_inv_rot = ~pAvatar->mRoot.getWorldRotation(); - LLVector3 root_at = LLVector3::x_axis * pAvatar->mRoot.getWorldRotation(); + LLQuaternion av_inv_rot = ~gAgentAvatarp->mRoot.getWorldRotation(); + LLVector3 root_at = LLVector3::x_axis * gAgentAvatarp->mRoot.getWorldRotation(); if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) && (root_at * last_at_axis > 0.95f)) { - LLVector3 vel = pAvatar->getVelocity(); + LLVector3 vel = gAgentAvatarp->getVelocity(); if (vel.magVecSquared() > 4.f) { - setLookAt(LOOKAT_TARGET_IDLE, pAvatar, vel * av_inv_rot); + setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatarp, vel * av_inv_rot); } else { // *FIX: rotate mframeagent by sit object's rotation? - LLQuaternion look_rotation = pAvatar->isSitting() ? pAvatar->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); // use camera's current rotation + LLQuaternion look_rotation = gAgentAvatarp->isSitting() ? gAgentAvatarp->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); // use camera's current rotation LLVector3 look_offset = LLVector3(2.f, 0.f, 0.f) * look_rotation * av_inv_rot; - setLookAt(LOOKAT_TARGET_IDLE, pAvatar, look_offset); + setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatarp, look_offset); } last_at_axis = root_at; return; @@ -1143,7 +1141,7 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) if (CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode()) { - setLookAt(LOOKAT_TARGET_NONE, pAvatar, LLVector3(-2.f, 0.f, 0.f)); + setLookAt(LOOKAT_TARGET_NONE, gAgentAvatarp, LLVector3(-2.f, 0.f, 0.f)); } else { @@ -1160,9 +1158,9 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) { // range from -.5 to .5 F32 x_from_center = - ((F32) mouse_x / (F32) gViewerWindow->getWindowWidth() ) - 0.5f; + ((F32) mouse_x / (F32) gViewerWindow->getWorldViewWidthScaled() ) - 0.5f; F32 y_from_center = - ((F32) mouse_y / (F32) gViewerWindow->getWindowHeight() ) - 0.5f; + ((F32) mouse_y / (F32) gViewerWindow->getWorldViewHeightScaled() ) - 0.5f; frameCamera.yaw( - x_from_center * gSavedSettings.getF32("YawFromMousePosition") * DEG_TO_RAD); frameCamera.pitch( - y_from_center * gSavedSettings.getF32("PitchFromMousePosition") * DEG_TO_RAD); @@ -1172,7 +1170,7 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) headLookAxis = frameCamera.getAtAxis(); // RN: we use world-space offset for mouselook and freelook //headLookAxis = headLookAxis * av_inv_rot; - setLookAt(lookAtType, pAvatar, headLookAxis); + setLookAt(lookAtType, gAgentAvatarp, headLookAxis); } } @@ -1183,8 +1181,6 @@ void LLAgentCamera::updateCamera() { //static LLFastTimer::DeclareTimer ftm("Camera"); //LLFastTimer t(ftm); - - LLVOAvatar *pAvatar = gAgentAvatarp; // - changed camera_skyward to the new global "mCameraUpVector" mCameraUpVector = LLVector3::z_axis; @@ -1195,11 +1191,11 @@ void LLAgentCamera::updateCamera() validateFocusObject(); if (isAgentAvatarValid() && - pAvatar->isSitting() && + gAgentAvatarp->isSitting() && camera_mode == CAMERA_MODE_MOUSELOOK) { //changed camera_skyward to the new global "mCameraUpVector" - mCameraUpVector = mCameraUpVector * pAvatar->getRenderRotation(); + mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation(); } if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) @@ -1298,13 +1294,13 @@ void LLAgentCamera::updateCamera() // (2) focus, and (3) upvector. They can then be queried elsewhere in llAgent. //-------------------------------------------------------------------------------- // *TODO: use combined rotation of frameagent and sit object - LLQuaternion avatarRotationForFollowCam = pAvatar->isSitting() ? pAvatar->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); + LLQuaternion avatarRotationForFollowCam = gAgentAvatarp->isSitting() ? gAgentAvatarp->getRenderRotation() : gAgent.getFrameAgent().getQuaternion(); LLFollowCamParams* current_cam = LLFollowCamMgr::getActiveFollowCamParams(); if (current_cam) { mFollowCam.copyParams(*current_cam); - mFollowCam.setSubjectPositionAndRotation( pAvatar->getRenderPosition(), avatarRotationForFollowCam ); + mFollowCam.setSubjectPositionAndRotation( gAgentAvatarp->getRenderPosition(), avatarRotationForFollowCam ); mFollowCam.update(); LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true); } @@ -1380,7 +1376,7 @@ void LLAgentCamera::updateCamera() if (isAgentAvatarValid() && (mCameraMode != CAMERA_MODE_MOUSELOOK)) { - pAvatar->updateAttachmentVisibility(mCameraMode); + gAgentAvatarp->updateAttachmentVisibility(mCameraMode); } } else @@ -1476,40 +1472,40 @@ void LLAgentCamera::updateCamera() } gAgent.setLastPositionGlobal(global_pos); - if (LLVOAvatar::sVisibleInFirstPerson && isAgentAvatarValid() && !pAvatar->isSitting() && cameraMouselook()) + if (LLVOAvatar::sVisibleInFirstPerson && isAgentAvatarValid() && !gAgentAvatarp->isSitting() && cameraMouselook()) { - LLVector3 head_pos = pAvatar->mHeadp->getWorldPosition() + - LLVector3(0.08f, 0.f, 0.05f) * pAvatar->mHeadp->getWorldRotation() + - LLVector3(0.1f, 0.f, 0.f) * pAvatar->mPelvisp->getWorldRotation(); + LLVector3 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() + + LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() + + LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation(); LLVector3 diff = mCameraPositionAgent - head_pos; - diff = diff * ~pAvatar->mRoot.getWorldRotation(); + diff = diff * ~gAgentAvatarp->mRoot.getWorldRotation(); - LLJoint* torso_joint = pAvatar->mTorsop; - LLJoint* chest_joint = pAvatar->mChestp; + LLJoint* torso_joint = gAgentAvatarp->mTorsop; + LLJoint* chest_joint = gAgentAvatarp->mChestp; LLVector3 torso_scale = torso_joint->getScale(); LLVector3 chest_scale = chest_joint->getScale(); // shorten avatar skeleton to avoid foot interpenetration - if (!pAvatar->mInAir) + if (!gAgentAvatarp->mInAir) { LLVector3 chest_offset = LLVector3(0.f, 0.f, chest_joint->getPosition().mV[VZ]) * torso_joint->getWorldRotation(); F32 z_compensate = llclamp(-diff.mV[VZ], -0.2f, 1.f); F32 scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / chest_offset.mV[VZ]), 0.5f, 1.2f); torso_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); - LLJoint* neck_joint = pAvatar->mNeckp; + LLJoint* neck_joint = gAgentAvatarp->mNeckp; LLVector3 neck_offset = LLVector3(0.f, 0.f, neck_joint->getPosition().mV[VZ]) * chest_joint->getWorldRotation(); scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / neck_offset.mV[VZ]), 0.5f, 1.2f); chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); diff.mV[VZ] = 0.f; } - pAvatar->mPelvisp->setPosition(pAvatar->mPelvisp->getPosition() + diff); + gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff); - pAvatar->mRoot.updateWorldMatrixChildren(); + gAgentAvatarp->mRoot.updateWorldMatrixChildren(); - for (LLVOAvatar::attachment_map_t::iterator iter = pAvatar->mAttachmentPoints.begin(); - iter != pAvatar->mAttachmentPoints.end(); ) + for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); + iter != gAgentAvatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLViewerJointAttachment* attachment = curiter->second; @@ -1770,7 +1766,6 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) gAgent.getPositionGlobal() : gAgent.getPosGlobalFromAgent(gAgentAvatarp->mRoot.getWorldPosition()); - LLVOAvatar *pAvatar = gAgentAvatarp; BOOL isConstrained = FALSE; LLVector3d head_offset; head_offset.setVec(mThirdPersonHeadOffset); @@ -1783,32 +1778,32 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else if (mCameraMode == CAMERA_MODE_MOUSELOOK) { - if (!isAgentAvatarValid() || pAvatar->mDrawable.isNull()) + if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull()) { llwarns << "Null avatar drawable!" << llendl; return LLVector3d::zero; } head_offset.clearVec(); - if (pAvatar->isSitting() && pAvatar->getParent()) + if (gAgentAvatarp->isSitting() && gAgentAvatarp->getParent()) { - pAvatar->updateHeadOffset(); - head_offset.mdV[VX] = pAvatar->mHeadOffset.mV[VX]; - head_offset.mdV[VY] = pAvatar->mHeadOffset.mV[VY]; - head_offset.mdV[VZ] = pAvatar->mHeadOffset.mV[VZ] + 0.1f; - const LLMatrix4& mat = ((LLViewerObject*) pAvatar->getParent())->getRenderMatrix(); + gAgentAvatarp->updateHeadOffset(); + head_offset.mdV[VX] = gAgentAvatarp->mHeadOffset.mV[VX]; + head_offset.mdV[VY] = gAgentAvatarp->mHeadOffset.mV[VY]; + head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ] + 0.1f; + const LLMatrix4& mat = ((LLViewerObject*) gAgentAvatarp->getParent())->getRenderMatrix(); camera_position_global = gAgent.getPosGlobalFromAgent ((gAgentAvatarp->getPosition()+ - LLVector3(head_offset)*pAvatar->getRotation()) * mat); + LLVector3(head_offset)*gAgentAvatarp->getRotation()) * mat); } else { - head_offset.mdV[VZ] = pAvatar->mHeadOffset.mV[VZ]; - if (pAvatar->isSitting()) + head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ]; + if (gAgentAvatarp->isSitting()) { head_offset.mdV[VZ] += 0.1; } - camera_position_global = gAgent.getPosGlobalFromAgent(pAvatar->getRenderPosition());//frame_center_global; - head_offset = head_offset * pAvatar->getRenderRotation(); + camera_position_global = gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition());//frame_center_global; + head_offset = head_offset * gAgentAvatarp->getRenderRotation(); camera_position_global = camera_position_global + head_offset; } } @@ -1819,7 +1814,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mSitCameraEnabled && isAgentAvatarValid() - && pAvatar->isSitting() + && gAgentAvatarp->isSitting() && mSitCameraReferenceObject.notNull()) { // sit camera @@ -1835,7 +1830,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); // are we sitting down? - if (isAgentAvatarValid() && pAvatar->getParent()) + if (isAgentAvatarValid() && gAgentAvatarp->getParent()) { LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); // slam agent coordinate frame to proper parent local version @@ -1851,7 +1846,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) local_camera_offset = gAgent.getFrameAgent().rotateToAbsolute( local_camera_offset ); } - if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !pAvatar->isSitting())) + if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !gAgentAvatarp->isSitting())) { LLVector3 plane_normal; plane_normal.setVec(mCameraCollidePlane.mV); @@ -1904,7 +1899,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // set the global camera position LLVector3d camera_offset; - LLVector3 av_pos = !isAgentAvatarValid() ? LLVector3::zero : pAvatar->getRenderPosition(); + LLVector3 av_pos = !isAgentAvatarValid() ? LLVector3::zero : gAgentAvatarp->getRenderPosition(); camera_offset.setVec( local_camera_offset ); camera_position_global = frame_center_global + head_offset + camera_offset; @@ -1916,8 +1911,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3 vel = gAgent.getVelocity(); // lag by appropriate amount for flying - F32 time_in_air = pAvatar->mTimeInAir.getElapsedTimeF32(); - if(!mCameraAnimating && pAvatar->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME) + F32 time_in_air = gAgentAvatarp->mTimeInAir.getElapsedTimeF32(); + if(!mCameraAnimating && gAgentAvatarp->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME) { LLVector3 frame_at_axis = gAgent.getFrameAgent().getAtAxis(); frame_at_axis -= projected_vec(frame_at_axis, gAgent.getReferenceUpVector()); @@ -1929,7 +1924,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) lag_interp *= u; - if (gViewerWindow->getLeftMouseDown() && gViewerWindow->getLastPick().mObjectID == pAvatar->getID()) + if (gViewerWindow->getLeftMouseDown() && gViewerWindow->getLastPick().mObjectID == gAgentAvatarp->getID()) { // disable camera lag when using mouse-directed steering target_lag.clearVec(); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a9ae29aef..11fb33c26 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -895,6 +895,7 @@ bool LLAppViewer::init() LLViewerJoystick::getInstance()->init(false); + gGLActive = FALSE; return true; } @@ -1894,8 +1895,18 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setString("VersionChannelName", LL_CHANNEL); #ifndef LL_RELEASE_FOR_DOWNLOAD - gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); - gSavedSettings.setBOOL("AllowMultipleViewers", TRUE); + // provide developer build only overrides for these control variables that are not + // persisted to settings.xml + LLControlVariable* c = gSavedSettings.getControl("ShowConsoleWindow"); + if (c) + { + c->setValue(true, false); + } + c = gSavedSettings.getControl("AllowMultipleViewers"); + if (c) + { + c->setValue(true, false); + } #endif //*FIX:Mani - Set default to disabling watchdog mainloop @@ -1952,10 +1963,8 @@ bool LLAppViewer::initConfiguration() if(!initParseCommandLine(clp)) { - llwarns - << "Error parsing command line options. Command Line options ignored." - << llendl; - + llwarns << "Error parsing command line options. Command Line options ignored." << llendl; + llinfos << "Command line usage:\n" << clp << llendl; std::ostringstream msg; @@ -3464,7 +3473,7 @@ void LLAppViewer::saveFinalSnapshot() snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += SCREEN_LAST_FILENAME; // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); mSavedFinalSnapshot = TRUE; } } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index f5754505d..0946a4ecc 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1028,8 +1028,8 @@ BOOL LLDrawable::isVisible() const { return TRUE; } - -#if 0 + +#if 1 //disabling this code fixes DEV-20105. Leaving in place in case some other bug pops up as a a result. //should be safe to just always ask the spatial group for visibility. if (isActive()) diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index ba54e25f1..1858c1871 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -393,7 +393,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, else { LLWearableType::EType wear_type = LLWearableType::typeNameToType(type); - if(wear_type != LLWearableType::WT_INVALID) + if(wear_type != LLWearableType::WT_NONE) { LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(LLWearableType::getAssetType(wear_type)); LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(folder_type); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ba0002048..6b1710b48 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2004,7 +2004,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, } // If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps - if ( isAvatar() && gAgentAvatarp == this && (mag_sqr > 0.25f) ) + if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) ) { LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() ); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 814312ec2..514030756 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -207,11 +207,14 @@ const LLColor4 DUMMY_COLOR = LLColor4(0.5,0.5,0.5,1.0); const F32 DERUTHING_TIMEOUT_SECONDS = 30.f; +//Singu note: FADE and ALWAYS are swapped around from LL's source to match our preference panel. +// Changing the "RenderName" order would cause confusion when 'always' setting suddenly gets +// interpreted as 'fade', and vice versa. enum ERenderName { RENDER_NAME_NEVER, - RENDER_NAME_ALWAYS, - RENDER_NAME_FADE + RENDER_NAME_FADE, + RENDER_NAME_ALWAYS }; //----------------------------------------------------------------------------- diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3c8b1c7a6..2612bf1e2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -316,10 +316,8 @@ void validate_framebuffer_object(); bool addDeferredAttachments(LLRenderTarget& target) { - bool ret1 = target.addColorAttachment(GL_RGBA); - bool ret2 = target.addColorAttachment(GL_RGBA); - return ret1 && //specular - ret2; //normal+z + return target.addColorAttachment(GL_RGBA) && //specular + target.addColorAttachment(GL_RGBA); //normal+z } LLPipeline::LLPipeline() : @@ -2390,7 +2388,8 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) llassert(vobj); // trying to catch a bad assumption if (vobj) // this test may not be needed, see above { - if (vobj->isAvatar() && ((LLVOAvatar*)vobj)->isImpostor()) + const LLVOAvatar* av = vobj->asAvatar(); + if (av && av->isImpostor()) { return; } @@ -2839,6 +2838,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) { + llassert_always(drawablep->isVisible()); /*LLSpatialGroup* group = drawablep->getSpatialGroup(); if (!group || group->changeLOD()) { @@ -4962,7 +4962,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) light->setAmbient(LLColor4::black); light->setSpecular(LLColor4::black); } - if (isAgentAvatarValid() && + if (gAgentAvatarp && gAgentAvatarp->mSpecialRenderMode == 3) { LLColor4 light_color = LLColor4::white; @@ -5066,16 +5066,13 @@ void LLPipeline::enableLightsDynamic() U32 mask = 0xff & (~2); // Local lights enableLights(mask); - - LLVOAvatar* avatarp = gAgentAvatarp; - - if (avatarp && getLightingDetail() <= 0) + if (isAgentAvatarValid() && getLightingDetail() <= 0) { - if (avatarp->mSpecialRenderMode == 0) // normal + if (gAgentAvatarp->mSpecialRenderMode == 0) // normal { gPipeline.enableLightsAvatar(); } - else if (avatarp->mSpecialRenderMode >= 1) // anim preview + else if (gAgentAvatarp->mSpecialRenderMode >= 1) // anim preview { gPipeline.enableLightsAvatarEdit(LLColor4(0.7f, 0.6f, 0.3f, 1.f)); } @@ -7735,15 +7732,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { - LLVOAvatar* agent = gAgentAvatarp; + BOOL skip_avatar_update = FALSE; if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) { - agent = NULL; + skip_avatar_update = TRUE; } - if (agent) + if (!skip_avatar_update) { - agent->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); + gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); } LLVertexBuffer::unbind(); @@ -7969,9 +7966,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) //LLGLState::checkTextureChannels(); //LLGLState::checkClientArrays(); - if (agent) + if (!skip_avatar_update) { - agent->updateAttachmentVisibility(gAgentCamera.getCameraMode()); + gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); } LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index ca0d69455..2bd383487 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -739,7 +739,7 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const if ( (getCompositeInfo(idItem, &strComposite, &pFolder)) && (cstrItemType != strComposite) ) { LLUUID idCompositeItem; - if ((type = LLWearable::typeNameToType(strComposite)) != LLWearableType::WT_INVALID) + if ((type = LLWearable::typeNameToType(strComposite)) != LLWearableType::WT_NONE) { idCompositeItem = gAgentWearables.getWearableItemID(type); } @@ -1989,7 +1989,7 @@ ERlvCmdRet RlvHandler::onGetOutfit(const RlvCommand& rlvCmd, std::string& strRep // (Compatibility: RLV-1.16.1 will execute @getoutfit= if is invalid while we just return failure) LLWearableType::EType wtType = LLWearableType::typeNameToType(rlvCmd.getOption()); - if ( (LLWearableType::WT_INVALID == wtType) && (!rlvCmd.getOption().empty()) ) + if ( (LLWearableType::WT_NONE == wtType) && (!rlvCmd.getOption().empty()) ) return RLV_RET_FAILED_OPTION; const LLWearableType::EType wtRlvTypes[] = @@ -1998,9 +1998,9 @@ ERlvCmdRet RlvHandler::onGetOutfit(const RlvCommand& rlvCmd, std::string& strRep LLWearableType::WT_UNDERPANTS, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_SKIN, LLWearableType::WT_EYES, LLWearableType::WT_HAIR, LLWearableType::WT_SHAPE, LLWearableType::WT_ALPHA, LLWearableType::WT_TATTOO, LLWearableType::WT_PHYSICS }; - for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(LLWearableType::EType); idxType < cntType; idxType++) + for (int idxType = 0; idxType < sizeof(wtRlvTypes) / sizeof(wtRlvTypes[0]); ++idxType) { - if ( (LLWearableType::WT_INVALID == wtType) || (wtRlvTypes[idxType] == wtType) ) + if ( (LLWearableType::WT_NONE == wtType) || (wtRlvTypes[idxType] == wtType) ) { // We never hide body parts, even if they're "locked" and we're hiding locked layers // (nor do we hide a layer if the issuing object is the only one that has this layer locked) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 4c3eb398e..dba0db371 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -188,7 +188,7 @@ RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption) if (!(m_fEmpty = strOption.empty())) //