Merge git://github.com/Shyotl/SingularityViewer

This commit is contained in:
Siana Gearz
2011-05-06 13:50:20 +02:00
7 changed files with 56 additions and 61 deletions

View File

@@ -7733,6 +7733,7 @@ void LLAgent::sendAgentSetAppearance()
} }
const bool wearing_physics = !!getWearable(WT_PHYSICS);
S32 transmitted_params = 0; S32 transmitted_params = 0;
for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam(); for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam();
param; param;
@@ -7746,6 +7747,11 @@ void LLAgent::sendAgentSetAppearance()
const F32 param_value = param->getWeight(); const F32 param_value = param->getWeight();
const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight());
msg->addU8Fast(_PREHASH_ParamValue, new_weight ); 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++; transmitted_params++;
} }
} }

View File

@@ -44,9 +44,7 @@
#include "llquaternion.h" #include "llquaternion.h"
#include "xform.h" #include "xform.h"
#include "llmemtype.h" #include "llmemtype.h"
#include "llprimitive.h"
#include "lldarray.h" #include "lldarray.h"
#include "llstat.h"
#include "llviewerobject.h" #include "llviewerobject.h"
#include "llrect.h" #include "llrect.h"
#include "llappviewer.h" // for gFrameTimeSeconds #include "llappviewer.h" // for gFrameTimeSeconds
@@ -55,6 +53,7 @@ class LLCamera;
class LLDrawPool; class LLDrawPool;
class LLDrawable; class LLDrawable;
class LLFace; class LLFace;
class LLFacePool;
class LLSpatialGroup; class LLSpatialGroup;
class LLSpatialBridge; class LLSpatialBridge;
class LLSpatialPartition; class LLSpatialPartition;

View File

@@ -113,7 +113,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glPushMatrix(); glPushMatrix();
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
gGL.pushMatrix();
LLUI::pushMatrix(); LLUI::pushMatrix();
gViewerWindow->setup2DRender(); 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); font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x);
LLUI::popMatrix(); LLUI::popMatrix();
gGL.popMatrix();
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glPopMatrix(); glPopMatrix();

View File

@@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL
U32 LLViewerPart::sNextPartID = 1; 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; desired_size /= 4;
return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2); 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()); LLViewerPartSim::checkParticleCount(mParticles.size());
LLViewerCamera* camera = LLViewerCamera::getInstance();
LLViewerRegion *regionp = getRegion(); LLViewerRegion *regionp = getRegion();
S32 end = (S32) mParticles.size(); S32 end = (S32) mParticles.size();
for (S32 i = 0 ; i < (S32)mParticles.size();) for (S32 i = 0 ; i < (S32)mParticles.size();)
@@ -395,7 +396,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
} }
else 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)) if (!posInGroup(part->mPosAgent, desired_size))
{ {
// Transfer particles between groups // Transfer particles between groups
@@ -558,7 +559,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
} }
else 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(); S32 count = (S32) mViewerPartGroups.size();
for (S32 i = 0; i < count; i++) for (S32 i = 0; i < count; i++)

View File

@@ -219,8 +219,10 @@ struct LLAvatarTexData
struct LLTextureMaskData struct LLTextureMaskData
{ {
LLTextureMaskData( const LLUUID& id ) LLTextureMaskData( const LLUUID& id ) :
: mAvatarID(id), mLastDiscardLevel(S32_MAX) {} mAvatarID(id),
mLastDiscardLevel(S32_MAX)
{}
LLUUID mAvatarID; LLUUID mAvatarID;
S32 mLastDiscardLevel; S32 mLastDiscardLevel;
}; };
@@ -247,10 +249,9 @@ public:
} }
BOOL parseXml(LLXmlTreeNode* node); BOOL parseXml(LLXmlTreeNode* node);
BOOL mIsJoint;
private: private:
std::string mName; std::string mName;
BOOL mIsJoint;
LLVector3 mPos; LLVector3 mPos;
LLVector3 mRot; LLVector3 mRot;
LLVector3 mScale; LLVector3 mScale;
@@ -770,16 +771,16 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mAppearanceAnimating(FALSE), mAppearanceAnimating(FALSE),
mNameString(), mNameString(),
mTitle(), mTitle(),
mRenderedName(),
mUsedNameSystem(),
mClientName(),
mNameAway(FALSE), mNameAway(FALSE),
mNameBusy(FALSE), mNameBusy(FALSE),
mNameMute(FALSE), mNameMute(FALSE),
mNameAppearance(FALSE),
mRenderedName(),
mUsedNameSystem(),
mClientName(),
mRenderGroupTitles(sRenderGroupTitles), mRenderGroupTitles(sRenderGroupTitles),
mNameFromChatOverride(false), mNameFromChatOverride(false),
mNameFromChatChanged(false), mNameFromChatChanged(false),
mNameAppearance(FALSE),
mRenderTag(FALSE), mRenderTag(FALSE),
mLastRegionHandle(0), mLastRegionHandle(0),
mRegionCrossingCount(0), mRegionCrossingCount(0),
@@ -9388,11 +9389,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
for( S32 i = 0; i < num_blocks; i++ ) 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(); param = getNextVisualParam();
} }
if( !param ) if( !param )
{ {
llwarns << "Number of params in AvatarAppearance msg does not match number of params in avatar xml file for " << getFullname() << " (Too many)." << llendl; 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; mSupportsPhysics = true;
} }
if(param->getID() == 507 && newWeight != getActualBoobGrav()) else if(param->getID() == 507 && newWeight != getActualBoobGrav())
{ {
llwarns << "Boob Grav SET to " << newWeight << " for " << getFullname() << llendl; llwarns << "Boob Grav SET to " << newWeight << " for " << getFullname() << llendl;
setActualBoobGrav(newWeight); 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(); param = getNextVisualParam();
} }
if( param ) if( param )
{ {
if (param->getName() == "tattoo_red") if(param->getName() == "breast_physics_mass")
llinfos << getFullname() << " does not have tattoo tinting." << llendl;
else if(param->getName() == "breast_physics_leftright_spring")
llinfos << getFullname() << " does not have avatar physics." << llendl; llinfos << getFullname() << " does not have avatar physics." << llendl;
else 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; 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;

View File

@@ -219,11 +219,7 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
{ {
lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl; lldebugs << "LLWearableList::createWearableMatchedToInventoryItem()" << llendl;
LLTransactionID tid; LLWearable* wearable = generateNewWearable();
LLAssetID new_asset_id;
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LLWearable* wearable = new LLWearable( tid );
wearable->copyDataFrom( old_wearable ); wearable->copyDataFrom( old_wearable );
wearable->setName( item->getName() ); wearable->setName( item->getName() );
@@ -231,8 +227,6 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
wearable->setPermissions( item->getPermissions() ); wearable->setPermissions( item->getPermissions() );
wearable->setSaleInfo( item->getSaleInfo() ); wearable->setSaleInfo( item->getSaleInfo() );
mList[ new_asset_id ] = wearable;
// Send to the dataserver // Send to the dataserver
wearable->saveNewAsset(); wearable->saveNewAsset();
@@ -242,22 +236,15 @@ LLWearable* LLWearableList::createWearableMatchedToInventoryItem( LLWearable* ol
LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name ) LLWearable* LLWearableList::createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name )
{ {
lldebugs << "LLWearableList::createCopyFromAvatar()" << llendl; 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 ); wearable->copyDataFrom( old_wearable );
LLPermissions perm(old_wearable->getPermissions()); LLPermissions perm(old_wearable->getPermissions());
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
wearable->setPermissions(perm); wearable->setPermissions(perm);
wearable->readFromAvatar(); // update from the avatar 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 // Send to the dataserver
wearable->saveNewAsset(); wearable->saveNewAsset();
@@ -270,17 +257,13 @@ LLWearable* LLWearableList::createCopy( LLWearable* old_wearable )
{ {
lldebugs << "LLWearableList::createCopy()" << llendl; lldebugs << "LLWearableList::createCopy()" << llendl;
LLTransactionID tid; LLWearable *wearable = generateNewWearable();
LLAssetID new_asset_id; wearable->copyDataFrom(old_wearable);
tid.generate();
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LLWearable* wearable = new LLWearable( tid );
wearable->copyDataFrom( old_wearable );
LLPermissions perm(old_wearable->getPermissions()); LLPermissions perm(old_wearable->getPermissions());
perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true); perm.setOwnerAndGroup(LLUUID::null, gAgent.getID(), LLUUID::null, true);
wearable->setPermissions(perm); wearable->setPermissions(perm);
mList[ new_asset_id ] = wearable;
// Send to the dataserver // Send to the dataserver
wearable->saveNewAsset(); wearable->saveNewAsset();
@@ -292,12 +275,7 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type )
{ {
lldebugs << "LLWearableList::createNewWearable()" << llendl; lldebugs << "LLWearableList::createNewWearable()" << llendl;
LLTransactionID tid; LLWearable *wearable = generateNewWearable();
LLAssetID new_asset_id;
tid.generate();
new_asset_id = tid.makeAssetID(gAgent.getSecureSessionID());
LLWearable* wearable = new LLWearable( tid );
wearable->setType( type ); wearable->setType( type );
std::string name = "New "; std::string name = "New ";
@@ -310,14 +288,23 @@ LLWearable* LLWearableList::createNewWearable( EWearableType type )
wearable->setPermissions(perm); wearable->setPermissions(perm);
// Description and sale info have default values. // Description and sale info have default values.
wearable->setParamsToDefaults(); wearable->setParamsToDefaults();
wearable->setTexturesToDefaults(); wearable->setTexturesToDefaults();
mList[ new_asset_id ] = wearable;
// Send to the dataserver // Send to the dataserver
wearable->saveNewAsset(); 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; return wearable;
} }

View File

@@ -45,12 +45,11 @@ public:
S32 getLength() { return mList.size(); } S32 getLength() { return mList.size(); }
void getAsset( void getAsset(const LLAssetID& assetID,
const LLAssetID& assetID, const std::string& wearable_name,
const std::string& wearable_name, LLAssetType::EType asset_type,
LLAssetType::EType asset_type, void(*asset_arrived_callback)(LLWearable*, void* userdata),
void(*asset_arrived_callback)(LLWearable*, void* userdata), void* userdata);
void* userdata );
LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item ); LLWearable* createWearableMatchedToInventoryItem( LLWearable* old_wearable, LLViewerInventoryItem* item );
LLWearable* createCopyFromAvatar( LLWearable* old_wearable, const std::string& new_name = std::string() ); 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); static void processGetAssetReply(const char* filename, const LLAssetID& assetID, void* user_data, S32 status, LLExtStat ext_status);
protected: protected:
LLWearable* generateNewWearable(); // used for the create... functions
private:
std::map< LLUUID, LLWearable* > mList; std::map< LLUUID, LLWearable* > mList;
}; };