Permalink
Browse files

Merge branch 'master' of https://github.com/singularity-viewer/Singul…

…arityViewer

# Conflicts:
#	indra/newview/llvoavatar.cpp
Also Reverted reversion of removal of before() wrapper in llstl.h
  • Loading branch information...
Lirusaito committed May 2, 2016
2 parents cd66c61 + 9e35480 commit 39b3f58e1356b5f79c4fe0736b744e1f28878347
Showing 1,477 changed files with 12,562 additions and 16,605 deletions.
View
@@ -2658,11 +2658,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b41376a689fb4c9e9846d838283fdc5d</string>
<string>7a619778a2ea5c3113549529dd4f7288</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://depot.alchemyviewer.org/pub/windows/lib-vc14/xmlrpc_epi-0.54.2-windows-201601151034.tar.bz2</string>
<string>http://depot.alchemyviewer.org/pub/windows/lib-vc14/xmlrpc_epi-0.54.2-windows-201603261505.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
View
@@ -14,6 +14,9 @@ set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
"The root project/makefile/solution name. Defaults to Singularity.")
project(${ROOT_PROJECT_NAME})
string(REPLACE " " "" VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL})
set(VIEWER_CHANNEL_NOSPACE ${VIEWER_CHANNEL_NOSPACE} CACHE STRING "Prefix used for resulting artifacts.")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables)
View
@@ -36,6 +36,9 @@ else (STANDALONE)
set(Boost_THREAD_LIBRARY
optimized libboost_thread-mt
debug libboost_thread-mt-gd)
set(Boost_CHRONO_LIBRARY
optimized libboost_chrono-mt
debug libboost_chrono-mt-gd)
elseif (LINUX)
set(Boost_CONTEXT_LIBRARY
optimized boost_context-mt
@@ -58,6 +61,9 @@ else (STANDALONE)
set(Boost_THREAD_LIBRARY
optimized boost_thread-mt
debug boost_thread-mt-d)
set(Boost_CHRONO_LIBRARY
optimized libboost_chrono-mt
debug libboost_chrono-mt-d)
elseif (DARWIN)
set(Boost_CONTEXT_LIBRARY
optimized boost_context-mt
@@ -80,5 +86,8 @@ else (STANDALONE)
set(Boost_THREAD_LIBRARY
optimized boost_thread-mt
debug boost_thread-mt-d)
set(Boost_CHRONO_LIBRARY
optimized libboost_chrono-mt
debug libboost_chrono-mt-d)
endif (WINDOWS)
endif (STANDALONE)
@@ -172,6 +172,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_OSX_ARCHITECTURES i386)
set(ARCH i386)
set(WORD_SIZE 32)
set(AUTOBUILD_PLATFORM_NAME "darwin")
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
@@ -489,25 +489,6 @@ void LLAvatarAppearance::computeBodySize()
mAvatarOffset.mV[VX] = 0.0f;
mAvatarOffset.mV[VY] = 0.0f;
// Certain configurations of avatars can force the overall height (with offset) to go negative.
// Enforce a constraint to make sure we don't go below 0.1 meters.
// Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f)
{
mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail.
llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f);
if (mWearableData && isSelf())
{
LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);
if (shape)
{
shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false);
}
}
}
if (new_body_size != mBodySize || old_offset != mAvatarOffset)
{
mBodySize = new_body_size;
@@ -595,8 +576,6 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
info->mRot.mV[VZ], LLQuaternion::XYZ));
joint->setScale(info->mScale);
joint->setDefaultFromCurrentXform();
if (info->mIsJoint)
{
joint->setSkinOffset( info->mPivot );
@@ -696,6 +675,42 @@ void LLAvatarAppearance::clearSkeleton()
mSkeleton.clear();
}
//------------------------------------------------------------------------
// addPelvisFixup
//------------------------------------------------------------------------
void LLAvatarAppearance::addPelvisFixup( F32 fixup, const LLUUID& mesh_id )
{
LLVector3 pos(0.0,0.0,fixup);
mPelvisFixups.add(mesh_id,pos);
}
//------------------------------------------------------------------------
// addPelvisFixup
//------------------------------------------------------------------------
void LLAvatarAppearance::removePelvisFixup( const LLUUID& mesh_id )
{
mPelvisFixups.remove(mesh_id);
}
//------------------------------------------------------------------------
// hasPelvisFixup
//------------------------------------------------------------------------
bool LLAvatarAppearance::hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const
{
LLVector3 pos;
if (mPelvisFixups.findActiveOverride(mesh_id,pos))
{
fixup = pos[2];
return true;
}
return false;
}
bool LLAvatarAppearance::hasPelvisFixup( F32& fixup ) const
{
LLUUID mesh_id;
return hasPelvisFixup( fixup, mesh_id );
}
//-----------------------------------------------------------------------------
// LLAvatarAppearance::buildCharacter()
// Deferred initialization and rebuild of the avatar.
@@ -159,11 +159,17 @@ class LLAvatarAppearance : public LLCharacter
BOOL mIsBuilt; // state of deferred character building
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
avatar_joint_list_t mSkeleton;
LLPosOverrideMap mPelvisFixups;
//--------------------------------------------------------------------
// Pelvis height adjustment members.
//--------------------------------------------------------------------
public:
void addPelvisFixup( F32 fixup, const LLUUID& mesh_id );
void removePelvisFixup( const LLUUID& mesh_id );
bool hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const;
bool hasPelvisFixup( F32& fixup ) const;
LLVector3 mBodySize;
LLVector3 mAvatarOffset;
protected:
@@ -212,6 +212,7 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
LLWearableType::EType t = (LLWearableType::EType)va_arg(argp,int);
mWearables.push_back(t);
}
va_end(argp);
}
// static
@@ -85,8 +85,6 @@ LLSkinJoint::~LLSkinJoint()
//-----------------------------------------------------------------------------
void LLSkinJoint::setupSkinJoint( LLJoint *joint)
{
mRootToJointSkinOffset.clearVec();
mRootToParentJointSkinOffset.clearVec();
// find the named joint
if (!(mJoint = joint))
@@ -96,6 +94,9 @@ void LLSkinJoint::setupSkinJoint( LLJoint *joint)
}
// compute the inverse root skin matrix
mRootToJointSkinOffset.clearVec();
mRootToParentJointSkinOffset.clearVec();
do
{
mRootToJointSkinOffset -= joint->getSkinOffset();
@@ -680,8 +680,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
if (!mMorphData)
{
const std::string driven_tag = "_Driven";
U32 pos = morph_param_name.find(driven_tag);
if (pos > 0)
size_t pos = morph_param_name.find(driven_tag);
if (pos != std::string::npos)
{
morph_param_name = morph_param_name.substr(0,pos);
mMorphData = mMesh->getMorphData(morph_param_name);
@@ -1557,13 +1557,13 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
U32 cache_index = alpha_mask_crc.getCRC();
U8* alpha_data = NULL;//get_if_there(mAlphaCache,cache_index,(U8*)NULL);
U8* alpha_data = NULL;
// We believe we need to generate morph masks, do not assume that the cached version is accurate.
// We can get bad morph masks during login, on minimize, and occasional gl errors.
// We should only be doing this when we believe something has changed with respect to the user's appearance.
//if (!alpha_data)
{
// clear out a slot if we have filled our cache
LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL;
// clear out a slot if we have filled our cache
S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1;
while ((S32)mAlphaCache.size() >= max_cache_entries)
{
@@ -1573,8 +1573,12 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
mAlphaCache.erase(iter2);
}
alpha_data = new U8[width * height];
U8* pixels_tmp = new U8[width * height * 4];
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels_tmp);
for (int i = 0; i < width * height; ++i)
alpha_data[i] = pixels_tmp[i * 4 + 3];
delete[] pixels_tmp;
mAlphaCache[cache_index] = alpha_data;
glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data);
}
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();
@@ -1783,13 +1787,11 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
/*virtual*/ void LLTexLayerTemplate::gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
{
U32 num_wearables = updateWearableCache();
for (U32 i = 0; i < num_wearables; i++)
U32 i = num_wearables - 1; // For rendering morph masks, we only want to use the top wearable
LLTexLayer *layer = getLayer(i);
if (layer)
{
LLTexLayer *layer = getLayer(i);
if (layer)
{
layer->addAlphaMask(data, originX, originY, width, height);
}
layer->addAlphaMask(data, originX, originY, width, height);
}
}
@@ -178,8 +178,9 @@ bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a
}
wearableentry_vec_t& wearable_vec = wearable_iter->second;
if (0 > index_a || index_a >= wearable_vec.size()) return false;
if (0 > index_b || index_b >= wearable_vec.size()) return false;
// removed 0 > index_a and index_b comparisions - can never be true
if (index_a >= wearable_vec.size()) return false;
if (index_b >= wearable_vec.size()) return false;
LLWearable* wearable = wearable_vec[index_a];
wearable_vec[index_a] = wearable_vec[index_b];
Oops, something went wrong.

0 comments on commit 39b3f58

Please sign in to comment.