Merge git://github.com/Shyotl/SingularityViewer
This commit is contained in:
@@ -7733,6 +7733,7 @@ void LLAgent::sendAgentSetAppearance()
|
||||
}
|
||||
|
||||
|
||||
const bool wearing_physics = !!getWearable(WT_PHYSICS);
|
||||
S32 transmitted_params = 0;
|
||||
for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam();
|
||||
param;
|
||||
@@ -7746,6 +7747,11 @@ void LLAgent::sendAgentSetAppearance()
|
||||
const F32 param_value = param->getWeight();
|
||||
const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
|
||||
msg->addU8Fast(_PREHASH_ParamValue, new_weight );
|
||||
//A hack to prevent ruthing on older viewers when phys wearables aren't being worn.
|
||||
if(!wearing_physics && param->getID() >= 10000)
|
||||
{
|
||||
break;
|
||||
}
|
||||
transmitted_params++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,7 @@
|
||||
#include "llquaternion.h"
|
||||
#include "xform.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llprimitive.h"
|
||||
#include "lldarray.h"
|
||||
#include "llstat.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llrect.h"
|
||||
#include "llappviewer.h" // for gFrameTimeSeconds
|
||||
@@ -55,6 +53,7 @@ class LLCamera;
|
||||
class LLDrawPool;
|
||||
class LLDrawable;
|
||||
class LLFace;
|
||||
class LLFacePool;
|
||||
class LLSpatialGroup;
|
||||
class LLSpatialBridge;
|
||||
class LLSpatialPartition;
|
||||
|
||||
@@ -113,7 +113,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
gGL.pushMatrix();
|
||||
LLUI::pushMatrix();
|
||||
|
||||
gViewerWindow->setup2DRender();
|
||||
@@ -126,6 +126,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
|
||||
|
||||
font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x);
|
||||
LLUI::popMatrix();
|
||||
gGL.popMatrix();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
|
||||
@@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL
|
||||
|
||||
U32 LLViewerPart::sNextPartID = 1;
|
||||
|
||||
F32 calc_desired_size(LLVector3 pos, LLVector2 scale)
|
||||
F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale)
|
||||
{
|
||||
F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec();
|
||||
F32 desired_size = (pos - camera->getOrigin()).magVec();
|
||||
desired_size /= 4;
|
||||
return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2);
|
||||
}
|
||||
@@ -274,6 +274,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
|
||||
|
||||
LLViewerPartSim::checkParticleCount(mParticles.size());
|
||||
|
||||
LLViewerCamera* camera = LLViewerCamera::getInstance();
|
||||
LLViewerRegion *regionp = getRegion();
|
||||
S32 end = (S32) mParticles.size();
|
||||
for (S32 i = 0 ; i < (S32)mParticles.size();)
|
||||
@@ -395,7 +396,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
|
||||
F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
|
||||
if (!posInGroup(part->mPosAgent, desired_size))
|
||||
{
|
||||
// Transfer particles between groups
|
||||
@@ -558,7 +559,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
|
||||
LLViewerCamera* camera = LLViewerCamera::getInstance();
|
||||
F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
|
||||
|
||||
S32 count = (S32) mViewerPartGroups.size();
|
||||
for (S32 i = 0; i < count; i++)
|
||||
|
||||
@@ -219,8 +219,10 @@ struct LLAvatarTexData
|
||||
|
||||
struct LLTextureMaskData
|
||||
{
|
||||
LLTextureMaskData( const LLUUID& id )
|
||||
: mAvatarID(id), mLastDiscardLevel(S32_MAX) {}
|
||||
LLTextureMaskData( const LLUUID& id ) :
|
||||
mAvatarID(id),
|
||||
mLastDiscardLevel(S32_MAX)
|
||||
{}
|
||||
LLUUID mAvatarID;
|
||||
S32 mLastDiscardLevel;
|
||||
};
|
||||
@@ -247,10 +249,9 @@ public:
|
||||
}
|
||||
BOOL parseXml(LLXmlTreeNode* node);
|
||||
|
||||
BOOL mIsJoint;
|
||||
|
||||
private:
|
||||
std::string mName;
|
||||
BOOL mIsJoint;
|
||||
LLVector3 mPos;
|
||||
LLVector3 mRot;
|
||||
LLVector3 mScale;
|
||||
@@ -770,16 +771,16 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
||||
mAppearanceAnimating(FALSE),
|
||||
mNameString(),
|
||||
mTitle(),
|
||||
mRenderedName(),
|
||||
mUsedNameSystem(),
|
||||
mClientName(),
|
||||
mNameAway(FALSE),
|
||||
mNameBusy(FALSE),
|
||||
mNameMute(FALSE),
|
||||
mNameAppearance(FALSE),
|
||||
mRenderedName(),
|
||||
mUsedNameSystem(),
|
||||
mClientName(),
|
||||
mRenderGroupTitles(sRenderGroupTitles),
|
||||
mNameFromChatOverride(false),
|
||||
mNameFromChatChanged(false),
|
||||
mNameAppearance(FALSE),
|
||||
mRenderTag(FALSE),
|
||||
mLastRegionHandle(0),
|
||||
mRegionCrossingCount(0),
|
||||
@@ -9388,11 +9389,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
|
||||
for( S32 i = 0; i < num_blocks; i++ )
|
||||
{
|
||||
|
||||
while( param && (!param->isTweakable()) )
|
||||
while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) ) // should not be any of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT
|
||||
{
|
||||
param = getNextVisualParam();
|
||||
}
|
||||
|
||||
|
||||
if( !param )
|
||||
{
|
||||
llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file for " << getFullname() << " (Too many)." << llendl;
|
||||
@@ -9407,7 +9408,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
|
||||
{
|
||||
mSupportsPhysics = true;
|
||||
}
|
||||
if(param->getID() == 507 && newWeight != getActualBoobGrav())
|
||||
else if(param->getID() == 507 && newWeight != getActualBoobGrav())
|
||||
{
|
||||
llwarns << "Boob Grav SET to " << newWeight << " for " << getFullname() << llendl;
|
||||
setActualBoobGrav(newWeight);
|
||||
@@ -9443,15 +9444,13 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
|
||||
}
|
||||
}
|
||||
|
||||
while( param && (!param->isTweakable()) )
|
||||
while( param && (param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) )
|
||||
{
|
||||
param = getNextVisualParam();
|
||||
}
|
||||
if( param )
|
||||
{
|
||||
if (param->getName() == "tattoo_red")
|
||||
llinfos << getFullname() << " does not have tattoo tinting." << llendl;
|
||||
else if(param->getName() == "breast_physics_leftright_spring")
|
||||
if(param->getName() == "breast_physics_mass")
|
||||
llinfos << getFullname() << " does not have avatar physics." << llendl;
|
||||
else
|
||||
llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file for " << getFullname() << " (Prematurely reached end of list at " << param->getName() << ")." << llendl;
|
||||
|
||||
@@ -219,11 +219,7 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
|
||||
{
|
||||
lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl;
|
||||
|
||||
LLTransactionID tid;
|
||||
LLAssetID new_asset_id;
|
||||
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
LLWearable* wearable = new LLWearable( tid );
|
||||
LLWearable* wearable = generateNewWearable();
|
||||
wearable->copyDataFrom( old_wearable );
|
||||
|
||||
wearable->setName( item->getName() );
|
||||
@@ -231,8 +227,6 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
|
||||
wearable->setPermissions( item->getPermissions() );
|
||||
wearable->setSaleInfo( item->getSaleInfo() );
|
||||
|
||||
mList[ new_asset_id ] = wearable;
|
||||
|
||||
// Send to the dataserver
|
||||
wearable->saveNewAsset();
|
||||
|
||||
@@ -242,22 +236,15 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
|
||||
LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name )
|
||||
{
|
||||
lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl;
|
||||
|
||||
LLTransactionID tid;
|
||||
LLAssetID new_asset_id;
|
||||
tid.generate();
|
||||
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
LLWearable* wearable = new LLWearable( tid );
|
||||
LLWearable* wearable = generateNewWearable();
|
||||
wearable->copyDataFrom( old_wearable );
|
||||
LLPermissions perm(old_wearable->getPermissions());
|
||||
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
|
||||
wearable->setPermissions(perm);
|
||||
wearable->readFromAvatar(); // update from the avatar
|
||||
|
||||
if (!new_name.empty()) wearable->setName(new_name);
|
||||
|
||||
mList[ new_asset_id ] = wearable;
|
||||
if (!new_name.empty()) wearable->setName(new_name);
|
||||
|
||||
// Send to the dataserver
|
||||
wearable->saveNewAsset();
|
||||
@@ -270,17 +257,13 @@ LLWearable* LLWearableList::createCopy( LLWearable* old_wearable )
|
||||
{
|
||||
lldebugs << "LLWearableList::createCopy()" << llendl;
|
||||
|
||||
LLTransactionID tid;
|
||||
LLAssetID new_asset_id;
|
||||
tid.generate();
|
||||
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
LLWearable* wearable = new LLWearable( tid );
|
||||
wearable->copyDataFrom( old_wearable );
|
||||
LLWearable *wearable = generateNewWearable();
|
||||
wearable->copyDataFrom(old_wearable);
|
||||
|
||||
LLPermissions perm(old_wearable->getPermissions());
|
||||
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
|
||||
wearable->setPermissions(perm);
|
||||
mList[ new_asset_id ] = wearable;
|
||||
|
||||
|
||||
// Send to the dataserver
|
||||
wearable->saveNewAsset();
|
||||
@@ -292,12 +275,7 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type )
|
||||
{
|
||||
lldebugs << "LLWearableList::createNewWearable()" << llendl;
|
||||
|
||||
LLTransactionID tid;
|
||||
LLAssetID new_asset_id;
|
||||
tid.generate();
|
||||
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
LLWearable* wearable = new LLWearable( tid );
|
||||
LLWearable *wearable = generateNewWearable();
|
||||
wearable->setType( type );
|
||||
|
||||
std::string name = "New ";
|
||||
@@ -310,14 +288,23 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type )
|
||||
wearable->setPermissions(perm);
|
||||
|
||||
// Description and sale info have default values.
|
||||
|
||||
wearable->setParamsToDefaults();
|
||||
wearable->setTexturesToDefaults();
|
||||
|
||||
mList[ new_asset_id ] = wearable;
|
||||
|
||||
// Send to the dataserver
|
||||
wearable->saveNewAsset();
|
||||
|
||||
|
||||
return wearable;
|
||||
}
|
||||
|
||||
LLWearable *LLWearableList::generateNewWearable()
|
||||
{
|
||||
LLTransactionID tid;
|
||||
tid.generate();
|
||||
LLAssetID new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
|
||||
|
||||
LLWearable* wearable = new LLWearable(tid);
|
||||
mList[new_asset_id] = wearable;
|
||||
return wearable;
|
||||
}
|
||||
|
||||
@@ -45,12 +45,11 @@ public:
|
||||
|
||||
S32 getLength() { return mList.size(); }
|
||||
|
||||
void getAsset(
|
||||
const LLAssetID& assetID,
|
||||
const std::string& wearable_name,
|
||||
LLAssetType::EType asset_type,
|
||||
void(*asset_arrived_callback)(LLWearable*, void* userdata),
|
||||
void* userdata );
|
||||
void getAsset(const LLAssetID& assetID,
|
||||
const std::string& wearable_name,
|
||||
LLAssetType::EType asset_type,
|
||||
void(*asset_arrived_callback)(LLWearable*, void* userdata),
|
||||
void* userdata);
|
||||
|
||||
LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item );
|
||||
LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() );
|
||||
@@ -61,6 +60,8 @@ public:
|
||||
static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);
|
||||
|
||||
protected:
|
||||
LLWearable* generateNewWearable(); // used for the create... functions
|
||||
private:
|
||||
std::map< LLUUID, LLWearable* > mList;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user