This commit is contained in:
Siana Gearz
2011-10-04 16:26:11 +02:00
20 changed files with 120 additions and 109 deletions

View File

@@ -165,7 +165,7 @@ U8* LLImageBase::allocateData(S32 size)
{ {
deleteData(); // virtual deleteData(); // virtual
mBadBufferAllocation = FALSE ; mBadBufferAllocation = FALSE ;
mData = new U8[size]; mData = new (std::nothrow) U8[size];
if (!mData) if (!mData)
{ {
llwarns << "allocate image data: " << size << llendl; llwarns << "allocate image data: " << size << llendl;
@@ -186,7 +186,7 @@ U8* LLImageBase::reallocateData(S32 size)
return mData; return mData;
LLMemType mt1((LLMemType::EMemType)mMemType); LLMemType mt1((LLMemType::EMemType)mMemType);
U8 *new_datap = new U8[size]; U8 *new_datap = new (std::nothrow) U8[size];
if (!new_datap) if (!new_datap)
{ {
llwarns << "Out of memory in LLImageBase::reallocateData" << llendl; 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 U8 * LLImageRaw::getSubImage(U32 x_pos, U32 y_pos, U32 width, U32 height) const
{ {
LLMemType mt1((LLMemType::EMemType)mMemType); 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 // Should do some simple bounds checking
if (!data) if (!data)
@@ -433,7 +433,7 @@ void LLImageRaw::verticalFlip()
{ {
LLMemType mt1((LLMemType::EMemType)mMemType); LLMemType mt1((LLMemType::EMemType)mMemType);
S32 row_bytes = getWidth() * getComponents(); S32 row_bytes = getWidth() * getComponents();
U8* line_buffer = new U8[row_bytes]; U8* line_buffer = new (std::nothrow) U8[row_bytes];
if (!line_buffer ) if (!line_buffer )
{ {
llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl; llerrs << "Out of memory in LLImageRaw::verticalFlip()" << llendl;
@@ -578,7 +578,7 @@ void LLImageRaw::compositeScaled4onto3(LLImageRaw* src)
// Vertical: scale but no composite // Vertical: scale but no composite
S32 temp_data_size = src->getWidth() * dst->getHeight() * src->getComponents(); 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 ) if (!temp_buffer )
{ {
llerrs << "Out of memory in LLImageRaw::compositeScaled4onto3()" << llendl; llerrs << "Out of memory in LLImageRaw::compositeScaled4onto3()" << llendl;
@@ -835,7 +835,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src )
// Vertical // Vertical
S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents(); S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents();
llassert_always(temp_data_size > 0); 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 ) if (!temp_buffer )
{ {
llerrs << "Out of memory in LLImageRaw::copyScaled()" << llendl; 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_x -= 1.0f ;
ratio_y -= 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) ; llassert_always(new_data != NULL) ;
U8* old_data = getData() ; U8* old_data = getData() ;
@@ -923,7 +923,7 @@ BOOL LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data )
// Vertical // Vertical
S32 temp_data_size = old_width * new_height * getComponents(); S32 temp_data_size = old_width * new_height * getComponents();
llassert_always(temp_data_size > 0); 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 ) if (!temp_buffer )
{ {
llerrs << "Out of memory in LLImageRaw::scale()" << llendl; 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 // copy out existing image data
S32 temp_data_size = old_width * old_height * getComponents(); 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) if (!temp_buffer)
{ {
llwarns << "Out of memory in LLImageRaw::scale: old (w, h, c) = (" << old_width << ", " << old_height << ", " << (S32)getComponents() << llwarns << "Out of memory in LLImageRaw::scale: old (w, h, c) = (" << old_width << ", " << old_height << ", " << (S32)getComponents() <<

View File

@@ -435,7 +435,7 @@ bool LLImageDXT::convertToDXR()
S32 nmips = calcNumMips(width,height); S32 nmips = calcNumMips(width,height);
S32 total_bytes = getDataSize(); S32 total_bytes = getDataSize();
U8* olddata = getData(); U8* olddata = getData();
U8* newdata = new U8[total_bytes]; U8* newdata = new (std::nothrow) U8[total_bytes];
if (!newdata) if (!newdata)
{ {
llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl; llerrs << "Out of memory in LLImageDXT::convertToDXR()" << llendl;

View File

@@ -33,6 +33,7 @@
#define LL_LLIMAGEDXT_H #define LL_LLIMAGEDXT_H
#include "llimage.h" #include "llimage.h"
#include "llpointer.h"
// This class decodes and encodes LL DXT files (which may unclude uncompressed RGB or RGBA mipped data) // This class decodes and encodes LL DXT files (which may unclude uncompressed RGB or RGBA mipped data)

View File

@@ -43,6 +43,11 @@ LLImageDecodeThread::LLImageDecodeThread(bool threaded)
{ {
} }
//virtual
LLImageDecodeThread::~LLImageDecodeThread()
{
}
// MAIN THREAD // MAIN THREAD
// virtual // virtual
S32 LLImageDecodeThread::update(U32 max_time_ms) S32 LLImageDecodeThread::update(U32 max_time_ms)

View File

@@ -34,7 +34,8 @@
#define LL_LLIMAGEWORKER_H #define LL_LLIMAGEWORKER_H
#include "llimage.h" #include "llimage.h"
#include "llqueuedthread.h" #include "llpointer.h"
#include "llworkerthread.h"
class LLImageDecodeThread : public LLQueuedThread class LLImageDecodeThread : public LLQueuedThread
{ {
@@ -78,6 +79,8 @@ public:
public: public:
LLImageDecodeThread(bool threaded = true); LLImageDecodeThread(bool threaded = true);
virtual ~LLImageDecodeThread();
handle_t decodeImage(LLImageFormatted* image, handle_t decodeImage(LLImageFormatted* image,
U32 priority, S32 discard, BOOL needs_aux, U32 priority, S32 discard, BOOL needs_aux,
Responder* responder); Responder* responder);

View File

@@ -332,7 +332,6 @@ public:
child = getChild(i); child = getChild(i);
if (child->isInside(data->getPositionGroup())) if (child->isInside(data->getPositionGroup()))
{ {
llassert(child->getElementCount() <= gOctreeMaxCapacity);
child->insert(data); child->insert(data);
return false; return false;
} }

View File

@@ -179,8 +179,8 @@ LLSD LLHTTPAssetRequest::getFullDetails() const
double curl_total_time = -1.0f; double curl_total_time = -1.0f;
double curl_size_upload = -1.0f; double curl_size_upload = -1.0f;
double curl_size_download = -1.0f; double curl_size_download = -1.0f;
long curl_content_length_upload = -1; double curl_content_length_upload = -1.0f;
long curl_content_length_download = -1; double curl_content_length_download = -1.0f;
long curl_request_size = -1; long curl_request_size = -1;
const char* curl_content_type = NULL; const char* curl_content_type = NULL;
@@ -199,8 +199,8 @@ LLSD LLHTTPAssetRequest::getFullDetails() const
sd["curl_total_time"] = curl_total_time; sd["curl_total_time"] = curl_total_time;
sd["curl_size_upload"] = curl_size_upload; sd["curl_size_upload"] = curl_size_upload;
sd["curl_size_download"] = curl_size_download; sd["curl_size_download"] = curl_size_download;
sd["curl_content_length_upload"] = (int) curl_content_length_upload; sd["curl_content_length_upload"] = curl_content_length_upload;
sd["curl_content_length_download"] = (int) curl_content_length_download; sd["curl_content_length_download"] = curl_content_length_download;
sd["curl_request_size"] = (int) curl_request_size; sd["curl_request_size"] = (int) curl_request_size;
if (curl_content_type) if (curl_content_type)
{ {

View File

@@ -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); mDetail->mCurlRequest->setoptString(CURLOPT_PROXY, env_proxy);
} }

View File

@@ -37,7 +37,7 @@
#include "v3math.h" #include "v3math.h"
#include "xform.h" #include "xform.h"
#include "message.h" #include "message.h"
#include "llmemory.h" #include "llpointer.h"
#include "llvolume.h" #include "llvolume.h"
#include "lltextureentry.h" #include "lltextureentry.h"
#include "llprimtexturelist.h" #include "llprimtexturelist.h"

View File

@@ -39,7 +39,7 @@
#include <set> #include <set>
#include "llapr.h" #include "llapr.h"
#include "llmemory.h" // LLPointer #include "llpointer.h"
#include "llqueuedthread.h" #include "llqueuedthread.h"
//============================================================================ //============================================================================

View File

@@ -55,7 +55,6 @@
#include "llmoveview.h" #include "llmoveview.h"
#include "llchatbar.h" #include "llchatbar.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llnotify.h"
#include "llparcel.h" #include "llparcel.h"
#include "llrendersphere.h" #include "llrendersphere.h"
#include "llsdutil.h" #include "llsdutil.h"

View File

@@ -1111,29 +1111,27 @@ void LLAgentCamera::cameraPanUp(F32 meters)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y) void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y)
{ {
LLVOAvatar *pAvatar = gAgentAvatarp; // bleh
static LLVector3 last_at_axis; static LLVector3 last_at_axis;
if (!isAgentAvatarValid()) return; if (!isAgentAvatarValid()) return;
LLQuaternion av_inv_rot = ~pAvatar->mRoot.getWorldRotation(); LLQuaternion av_inv_rot = ~gAgentAvatarp->mRoot.getWorldRotation();
LLVector3 root_at = LLVector3::x_axis * pAvatar->mRoot.getWorldRotation(); LLVector3 root_at = LLVector3::x_axis * gAgentAvatarp->mRoot.getWorldRotation();
if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) && if ((gViewerWindow->getMouseVelocityStat()->getCurrent() < 0.01f) &&
(root_at * last_at_axis > 0.95f)) (root_at * last_at_axis > 0.95f))
{ {
LLVector3 vel = pAvatar->getVelocity(); LLVector3 vel = gAgentAvatarp->getVelocity();
if (vel.magVecSquared() > 4.f) if (vel.magVecSquared() > 4.f)
{ {
setLookAt(LOOKAT_TARGET_IDLE, pAvatar, vel * av_inv_rot); setLookAt(LOOKAT_TARGET_IDLE, gAgentAvatarp, vel * av_inv_rot);
} }
else else
{ {
// *FIX: rotate mframeagent by sit object's rotation? // *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; 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; last_at_axis = root_at;
return; return;
@@ -1143,7 +1141,7 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y)
if (CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode()) 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 else
{ {
@@ -1160,9 +1158,9 @@ void LLAgentCamera::updateLookAt(const S32 mouse_x, const S32 mouse_y)
{ {
// range from -.5 to .5 // range from -.5 to .5
F32 x_from_center = 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 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.yaw( - x_from_center * gSavedSettings.getF32("YawFromMousePosition") * DEG_TO_RAD);
frameCamera.pitch( - y_from_center * gSavedSettings.getF32("PitchFromMousePosition") * 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(); headLookAxis = frameCamera.getAtAxis();
// RN: we use world-space offset for mouselook and freelook // RN: we use world-space offset for mouselook and freelook
//headLookAxis = headLookAxis * av_inv_rot; //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"); //static LLFastTimer::DeclareTimer ftm("Camera");
//LLFastTimer t(ftm); //LLFastTimer t(ftm);
LLVOAvatar *pAvatar = gAgentAvatarp;
// - changed camera_skyward to the new global "mCameraUpVector" // - changed camera_skyward to the new global "mCameraUpVector"
mCameraUpVector = LLVector3::z_axis; mCameraUpVector = LLVector3::z_axis;
@@ -1195,11 +1191,11 @@ void LLAgentCamera::updateCamera()
validateFocusObject(); validateFocusObject();
if (isAgentAvatarValid() && if (isAgentAvatarValid() &&
pAvatar->isSitting() && gAgentAvatarp->isSitting() &&
camera_mode == CAMERA_MODE_MOUSELOOK) camera_mode == CAMERA_MODE_MOUSELOOK)
{ {
//changed camera_skyward to the new global "mCameraUpVector" //changed camera_skyward to the new global "mCameraUpVector"
mCameraUpVector = mCameraUpVector * pAvatar->getRenderRotation(); mCameraUpVector = mCameraUpVector * gAgentAvatarp->getRenderRotation();
} }
if (cameraThirdPerson() && mFocusOnAvatar && LLFollowCamMgr::getActiveFollowCamParams()) 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. // (2) focus, and (3) upvector. They can then be queried elsewhere in llAgent.
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// *TODO: use combined rotation of frameagent and sit object // *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(); LLFollowCamParams* current_cam = LLFollowCamMgr::getActiveFollowCamParams();
if (current_cam) if (current_cam)
{ {
mFollowCam.copyParams(*current_cam); mFollowCam.copyParams(*current_cam);
mFollowCam.setSubjectPositionAndRotation( pAvatar->getRenderPosition(), avatarRotationForFollowCam ); mFollowCam.setSubjectPositionAndRotation( gAgentAvatarp->getRenderPosition(), avatarRotationForFollowCam );
mFollowCam.update(); mFollowCam.update();
LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true); LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
} }
@@ -1380,7 +1376,7 @@ void LLAgentCamera::updateCamera()
if (isAgentAvatarValid() && (mCameraMode != CAMERA_MODE_MOUSELOOK)) if (isAgentAvatarValid() && (mCameraMode != CAMERA_MODE_MOUSELOOK))
{ {
pAvatar->updateAttachmentVisibility(mCameraMode); gAgentAvatarp->updateAttachmentVisibility(mCameraMode);
} }
} }
else else
@@ -1476,40 +1472,40 @@ void LLAgentCamera::updateCamera()
} }
gAgent.setLastPositionGlobal(global_pos); 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 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() +
LLVector3(0.08f, 0.f, 0.05f) * pAvatar->mHeadp->getWorldRotation() + LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() +
LLVector3(0.1f, 0.f, 0.f) * pAvatar->mPelvisp->getWorldRotation(); LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation();
LLVector3 diff = mCameraPositionAgent - head_pos; LLVector3 diff = mCameraPositionAgent - head_pos;
diff = diff * ~pAvatar->mRoot.getWorldRotation(); diff = diff * ~gAgentAvatarp->mRoot.getWorldRotation();
LLJoint* torso_joint = pAvatar->mTorsop; LLJoint* torso_joint = gAgentAvatarp->mTorsop;
LLJoint* chest_joint = pAvatar->mChestp; LLJoint* chest_joint = gAgentAvatarp->mChestp;
LLVector3 torso_scale = torso_joint->getScale(); LLVector3 torso_scale = torso_joint->getScale();
LLVector3 chest_scale = chest_joint->getScale(); LLVector3 chest_scale = chest_joint->getScale();
// shorten avatar skeleton to avoid foot interpenetration // 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(); 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 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); 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)); 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(); 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); 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)); chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor));
diff.mV[VZ] = 0.f; 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(); for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != pAvatar->mAttachmentPoints.end(); ) iter != gAgentAvatarp->mAttachmentPoints.end(); )
{ {
LLVOAvatar::attachment_map_t::iterator curiter = iter++; LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second; LLViewerJointAttachment* attachment = curiter->second;
@@ -1770,7 +1766,6 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
gAgent.getPositionGlobal() : gAgent.getPositionGlobal() :
gAgent.getPosGlobalFromAgent(gAgentAvatarp->mRoot.getWorldPosition()); gAgent.getPosGlobalFromAgent(gAgentAvatarp->mRoot.getWorldPosition());
LLVOAvatar *pAvatar = gAgentAvatarp;
BOOL isConstrained = FALSE; BOOL isConstrained = FALSE;
LLVector3d head_offset; LLVector3d head_offset;
head_offset.setVec(mThirdPersonHeadOffset); head_offset.setVec(mThirdPersonHeadOffset);
@@ -1783,32 +1778,32 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
} }
else if (mCameraMode == CAMERA_MODE_MOUSELOOK) else if (mCameraMode == CAMERA_MODE_MOUSELOOK)
{ {
if (!isAgentAvatarValid() || pAvatar->mDrawable.isNull()) if (!isAgentAvatarValid() || gAgentAvatarp->mDrawable.isNull())
{ {
llwarns << "Null avatar drawable!" << llendl; llwarns << "Null avatar drawable!" << llendl;
return LLVector3d::zero; return LLVector3d::zero;
} }
head_offset.clearVec(); head_offset.clearVec();
if (pAvatar->isSitting() && pAvatar->getParent()) if (gAgentAvatarp->isSitting() && gAgentAvatarp->getParent())
{ {
pAvatar->updateHeadOffset(); gAgentAvatarp->updateHeadOffset();
head_offset.mdV[VX] = pAvatar->mHeadOffset.mV[VX]; head_offset.mdV[VX] = gAgentAvatarp->mHeadOffset.mV[VX];
head_offset.mdV[VY] = pAvatar->mHeadOffset.mV[VY]; head_offset.mdV[VY] = gAgentAvatarp->mHeadOffset.mV[VY];
head_offset.mdV[VZ] = pAvatar->mHeadOffset.mV[VZ] + 0.1f; head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ] + 0.1f;
const LLMatrix4& mat = ((LLViewerObject*) pAvatar->getParent())->getRenderMatrix(); const LLMatrix4& mat = ((LLViewerObject*) gAgentAvatarp->getParent())->getRenderMatrix();
camera_position_global = gAgent.getPosGlobalFromAgent camera_position_global = gAgent.getPosGlobalFromAgent
((gAgentAvatarp->getPosition()+ ((gAgentAvatarp->getPosition()+
LLVector3(head_offset)*pAvatar->getRotation()) * mat); LLVector3(head_offset)*gAgentAvatarp->getRotation()) * mat);
} }
else else
{ {
head_offset.mdV[VZ] = pAvatar->mHeadOffset.mV[VZ]; head_offset.mdV[VZ] = gAgentAvatarp->mHeadOffset.mV[VZ];
if (pAvatar->isSitting()) if (gAgentAvatarp->isSitting())
{ {
head_offset.mdV[VZ] += 0.1; head_offset.mdV[VZ] += 0.1;
} }
camera_position_global = gAgent.getPosGlobalFromAgent(pAvatar->getRenderPosition());//frame_center_global; camera_position_global = gAgent.getPosGlobalFromAgent(gAgentAvatarp->getRenderPosition());//frame_center_global;
head_offset = head_offset * pAvatar->getRenderRotation(); head_offset = head_offset * gAgentAvatarp->getRenderRotation();
camera_position_global = camera_position_global + head_offset; camera_position_global = camera_position_global + head_offset;
} }
} }
@@ -1819,7 +1814,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
if (mSitCameraEnabled if (mSitCameraEnabled
&& isAgentAvatarValid() && isAgentAvatarValid()
&& pAvatar->isSitting() && gAgentAvatarp->isSitting()
&& mSitCameraReferenceObject.notNull()) && mSitCameraReferenceObject.notNull())
{ {
// sit camera // sit camera
@@ -1835,7 +1830,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); local_camera_offset = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale");
// are we sitting down? // are we sitting down?
if (isAgentAvatarValid() && pAvatar->getParent()) if (isAgentAvatarValid() && gAgentAvatarp->getParent())
{ {
LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation(); LLQuaternion parent_rot = ((LLViewerObject*)gAgentAvatarp->getParent())->getRenderRotation();
// slam agent coordinate frame to proper parent local version // 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 ); local_camera_offset = gAgent.getFrameAgent().rotateToAbsolute( local_camera_offset );
} }
if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !pAvatar->isSitting())) if (!mCameraCollidePlane.isExactlyZero() && (!isAgentAvatarValid() || !gAgentAvatarp->isSitting()))
{ {
LLVector3 plane_normal; LLVector3 plane_normal;
plane_normal.setVec(mCameraCollidePlane.mV); plane_normal.setVec(mCameraCollidePlane.mV);
@@ -1904,7 +1899,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
// set the global camera position // set the global camera position
LLVector3d camera_offset; 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_offset.setVec( local_camera_offset );
camera_position_global = frame_center_global + head_offset + 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(); LLVector3 vel = gAgent.getVelocity();
// lag by appropriate amount for flying // lag by appropriate amount for flying
F32 time_in_air = pAvatar->mTimeInAir.getElapsedTimeF32(); F32 time_in_air = gAgentAvatarp->mTimeInAir.getElapsedTimeF32();
if(!mCameraAnimating && pAvatar->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME) if(!mCameraAnimating && gAgentAvatarp->mInAir && time_in_air > GROUND_TO_AIR_CAMERA_TRANSITION_START_TIME)
{ {
LLVector3 frame_at_axis = gAgent.getFrameAgent().getAtAxis(); LLVector3 frame_at_axis = gAgent.getFrameAgent().getAtAxis();
frame_at_axis -= projected_vec(frame_at_axis, gAgent.getReferenceUpVector()); frame_at_axis -= projected_vec(frame_at_axis, gAgent.getReferenceUpVector());
@@ -1929,7 +1924,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
lag_interp *= u; 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 // disable camera lag when using mouse-directed steering
target_lag.clearVec(); target_lag.clearVec();

View File

@@ -895,6 +895,7 @@ bool LLAppViewer::init()
LLViewerJoystick::getInstance()->init(false); LLViewerJoystick::getInstance()->init(false);
gGLActive = FALSE;
return true; return true;
} }
@@ -1894,8 +1895,18 @@ bool LLAppViewer::initConfiguration()
gSavedSettings.setString("VersionChannelName", LL_CHANNEL); gSavedSettings.setString("VersionChannelName", LL_CHANNEL);
#ifndef LL_RELEASE_FOR_DOWNLOAD #ifndef LL_RELEASE_FOR_DOWNLOAD
gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); // provide developer build only overrides for these control variables that are not
gSavedSettings.setBOOL("AllowMultipleViewers", TRUE); // 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 #endif
//*FIX:Mani - Set default to disabling watchdog mainloop //*FIX:Mani - Set default to disabling watchdog mainloop
@@ -1952,10 +1963,8 @@ bool LLAppViewer::initConfiguration()
if(!initParseCommandLine(clp)) if(!initParseCommandLine(clp))
{ {
llwarns llwarns << "Error parsing command line options. Command Line options ignored." << llendl;
<< "Error parsing command line options. Command Line options ignored."
<< llendl;
llinfos << "Command line usage:\n" << clp << llendl; llinfos << "Command line usage:\n" << clp << llendl;
std::ostringstream msg; std::ostringstream msg;
@@ -3464,7 +3473,7 @@ void LLAppViewer::saveFinalSnapshot()
snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += gDirUtilp->getDirDelimiter();
snap_filename += SCREEN_LAST_FILENAME; snap_filename += SCREEN_LAST_FILENAME;
// use full pixel dimensions of viewer window (not post-scale dimensions) // 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; mSavedFinalSnapshot = TRUE;
} }
} }

View File

@@ -1028,8 +1028,8 @@ BOOL LLDrawable::isVisible() const
{ {
return TRUE; 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. //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. //should be safe to just always ask the spatial group for visibility.
if (isActive()) if (isActive())

View File

@@ -393,7 +393,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
else else
{ {
LLWearableType::EType wear_type = LLWearableType::typeNameToType(type); 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)); LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(LLWearableType::getAssetType(wear_type));
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(folder_type); LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(folder_type);

View File

@@ -2004,7 +2004,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
} }
// If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps // 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() ); LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() );
} }

View File

@@ -207,11 +207,14 @@ const LLColor4 DUMMY_COLOR = LLColor4(0.5,0.5,0.5,1.0);
const F32 DERUTHING_TIMEOUT_SECONDS = 30.f; 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 enum ERenderName
{ {
RENDER_NAME_NEVER, RENDER_NAME_NEVER,
RENDER_NAME_ALWAYS, RENDER_NAME_FADE,
RENDER_NAME_FADE RENDER_NAME_ALWAYS
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -316,10 +316,8 @@ void validate_framebuffer_object();
bool addDeferredAttachments(LLRenderTarget& target) bool addDeferredAttachments(LLRenderTarget& target)
{ {
bool ret1 = target.addColorAttachment(GL_RGBA); return target.addColorAttachment(GL_RGBA) && //specular
bool ret2 = target.addColorAttachment(GL_RGBA); target.addColorAttachment(GL_RGBA); //normal+z
return ret1 && //specular
ret2; //normal+z
} }
LLPipeline::LLPipeline() : LLPipeline::LLPipeline() :
@@ -2390,7 +2388,8 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
llassert(vobj); // trying to catch a bad assumption llassert(vobj); // trying to catch a bad assumption
if (vobj) // this test may not be needed, see above 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; return;
} }
@@ -2839,6 +2838,7 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD) if (LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD)
{ {
llassert_always(drawablep->isVisible());
/*LLSpatialGroup* group = drawablep->getSpatialGroup(); /*LLSpatialGroup* group = drawablep->getSpatialGroup();
if (!group || group->changeLOD()) if (!group || group->changeLOD())
{ {
@@ -4962,7 +4962,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
light->setAmbient(LLColor4::black); light->setAmbient(LLColor4::black);
light->setSpecular(LLColor4::black); light->setSpecular(LLColor4::black);
} }
if (isAgentAvatarValid() && if (gAgentAvatarp &&
gAgentAvatarp->mSpecialRenderMode == 3) gAgentAvatarp->mSpecialRenderMode == 3)
{ {
LLColor4 light_color = LLColor4::white; LLColor4 light_color = LLColor4::white;
@@ -5066,16 +5066,13 @@ void LLPipeline::enableLightsDynamic()
U32 mask = 0xff & (~2); // Local lights U32 mask = 0xff & (~2); // Local lights
enableLights(mask); enableLights(mask);
if (isAgentAvatarValid() && getLightingDetail() <= 0)
LLVOAvatar* avatarp = gAgentAvatarp;
if (avatarp && getLightingDetail() <= 0)
{ {
if (avatarp->mSpecialRenderMode == 0) // normal if (gAgentAvatarp->mSpecialRenderMode == 0) // normal
{ {
gPipeline.enableLightsAvatar(); 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)); 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) if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{ {
LLVOAvatar* agent = gAgentAvatarp; BOOL skip_avatar_update = FALSE;
if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) 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(); LLVertexBuffer::unbind();
@@ -7969,9 +7966,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
//LLGLState::checkTextureChannels(); //LLGLState::checkTextureChannels();
//LLGLState::checkClientArrays(); //LLGLState::checkClientArrays();
if (agent) if (!skip_avatar_update)
{ {
agent->updateAttachmentVisibility(gAgentCamera.getCameraMode()); gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
} }
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;

View File

@@ -739,7 +739,7 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const
if ( (getCompositeInfo(idItem, &strComposite, &pFolder)) && (cstrItemType != strComposite) ) if ( (getCompositeInfo(idItem, &strComposite, &pFolder)) && (cstrItemType != strComposite) )
{ {
LLUUID idCompositeItem; LLUUID idCompositeItem;
if ((type = LLWearable::typeNameToType(strComposite)) != LLWearableType::WT_INVALID) if ((type = LLWearable::typeNameToType(strComposite)) != LLWearableType::WT_NONE)
{ {
idCompositeItem = gAgentWearables.getWearableItemID(type); 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=<channel> if <layer> is invalid while we just return failure) // (Compatibility: RLV-1.16.1 will execute @getoutfit=<channel> if <layer> is invalid while we just return failure)
LLWearableType::EType wtType = LLWearableType::typeNameToType(rlvCmd.getOption()); 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; return RLV_RET_FAILED_OPTION;
const LLWearableType::EType wtRlvTypes[] = 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 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 // 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) // (nor do we hide a layer if the issuing object is the only one that has this layer locked)

View File

@@ -188,7 +188,7 @@ RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption)
if (!(m_fEmpty = strOption.empty())) // <option> could be an empty string if (!(m_fEmpty = strOption.empty())) // <option> could be an empty string
{ {
if ((wtType = LLWearableType::typeNameToType(strOption)) != LLWearableType::WT_INVALID) if ((wtType = LLWearableType::typeNameToType(strOption)) != LLWearableType::WT_NONE)
m_varOption = wtType; // ... or specify a clothing layer m_varOption = wtType; // ... or specify a clothing layer
else if ((pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption)) != NULL) else if ((pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption)) != NULL)
m_varOption = pAttachPt; // ... or specify an attachment point m_varOption = pAttachPt; // ... or specify an attachment point