Innitial commit. Majority of texture baking moved into LLVOAvatarSelf. Very WIP. Not advisable to build off of this, although it does compile and mostly work.
This commit is contained in:
@@ -98,13 +98,11 @@ void LLPrefsAscentVan::onCommitClientTag(LLUICtrl* ctrl, void* userdata)
|
||||
gSavedSettings.setString("AscentReportClientUUID", client_uuid);
|
||||
gSavedSettings.setU32("AscentReportClientIndex", client_index);
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
|
||||
if (avatar)
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
// Slam pending upload count to "unstick" things
|
||||
bool slam_for_debug = true;
|
||||
avatar->forceBakeAllTextures(slam_for_debug);
|
||||
gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,8 +360,7 @@ void LLCOFMgr::onLinkAttachmentComplete(const LLUUID& idItem)
|
||||
|
||||
void LLCOFMgr::updateAttachments()
|
||||
{
|
||||
/*const*/ LLVOAvatar* pAvatar = gAgentAvatarp;
|
||||
if (!pAvatar)
|
||||
if (!isAgentAvatarValid())
|
||||
return;
|
||||
|
||||
const LLUUID idCOF = getCOF();
|
||||
@@ -375,7 +374,7 @@ void LLCOFMgr::updateAttachments()
|
||||
while (itPendingAttachLink != m_PendingAttachLinks.end())
|
||||
{
|
||||
const LLUUID& idItem = *itPendingAttachLink;
|
||||
if ( (!pAvatar->isWearingAttachment(idItem)) || (isLinkInCOF(idItem)) )
|
||||
if ( (!gAgentAvatarp->isWearingAttachment(idItem)) || (isLinkInCOF(idItem)) )
|
||||
{
|
||||
itPendingAttachLink = m_PendingAttachLinks.erase(itPendingAttachLink);
|
||||
continue;
|
||||
@@ -389,7 +388,7 @@ void LLCOFMgr::updateAttachments()
|
||||
}
|
||||
|
||||
// Don't remove attachments until avatar is fully loaded (should reduce random attaching/detaching/reattaching at log-on)
|
||||
LLAgentWearables::userUpdateAttachments(items, !pAvatar->isFullyLoaded());
|
||||
LLAgentWearables::userUpdateAttachments(items, !gAgentAvatarp->isFullyLoaded());
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -670,8 +670,7 @@ void LocalAssetBrowser::PerformTimedActions(void)
|
||||
// one of the layer bitmaps has been updated, we need to rebake.
|
||||
if ( mLayerUpdated )
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if (avatar) { avatar->forceBakeAllTextures(SLAM_FOR_DEBUG); }
|
||||
if (isAgentAvatarValid()) { gAgentAvatarp->forceBakeAllTextures(SLAM_FOR_DEBUG); }
|
||||
|
||||
mLayerUpdated = false;
|
||||
}
|
||||
|
||||
@@ -2392,7 +2392,7 @@ void LLAgentCamera::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL came
|
||||
gFocusMgr.setKeyboardFocus( NULL );
|
||||
gFocusMgr.setMouseCapture( NULL );
|
||||
|
||||
LLVOAvatar::onCustomizeStart();
|
||||
LLVOAvatarSelf::onCustomizeStart();
|
||||
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
|
||||
@@ -918,8 +918,7 @@ void LLAgentWearables::onInitialWearableAssetArrived( LLWearable* wearable, void
|
||||
LLUUID item_id = wearable_data->second;
|
||||
delete wearable_data;
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( !avatar )
|
||||
if( !isAgentAvatarValid() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -931,11 +930,11 @@ void LLAgentWearables::onInitialWearableAssetArrived( LLWearable* wearable, void
|
||||
gAgentWearables.setWearable(type,wearable);
|
||||
|
||||
// disable composites if initial textures are baked
|
||||
avatar->setupComposites();
|
||||
gAgentAvatarp->setupComposites();
|
||||
gAgentWearables.queryWearableCache();
|
||||
|
||||
wearable->writeToAvatar( FALSE );
|
||||
avatar->setCompositeUpdatesEnabled(TRUE);
|
||||
gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
|
||||
gInventory.addChangedMask( LLInventoryObserver::LABEL, item_id );
|
||||
}
|
||||
else
|
||||
@@ -969,7 +968,7 @@ void LLAgentWearables::onInitialWearableAssetArrived( LLWearable* wearable, void
|
||||
// If there are any, schedule them to be uploaded as soon as the layer textures they depend on arrive.
|
||||
if( !gAgentCamera.cameraCustomizeAvatar() )
|
||||
{
|
||||
avatar->requestLayerSetUploads();
|
||||
gAgentAvatarp->requestLayerSetUploads();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,8 +763,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLUICtrl* ctrl, void* userdata)
|
||||
{
|
||||
LLPanelEditWearable* self = (LLPanelEditWearable*) userdata;
|
||||
LLCheckBoxCtrl* checkbox_ctrl = (LLCheckBoxCtrl*) ctrl;
|
||||
LLVOAvatar *avatar = gAgentAvatarp;
|
||||
if (!avatar)
|
||||
if (!isAgentAvatarValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -775,13 +774,13 @@ void LLPanelEditWearable::onInvisibilityCommit(LLUICtrl* ctrl, void* userdata)
|
||||
if (new_invis_state)
|
||||
{
|
||||
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(IMG_INVISIBLE);
|
||||
const LLTextureEntry* current_te = avatar->getTE(te);
|
||||
const LLTextureEntry* current_te = gAgentAvatarp->getTE(te);
|
||||
if (current_te)
|
||||
{
|
||||
self->mPreviousTextureList[(S32)te] = current_te->getID();
|
||||
}
|
||||
avatar->setLocTexTE(te, image, TRUE);
|
||||
avatar->wearableUpdated(self->mType, FALSE);
|
||||
gAgentAvatarp->setLocalTextureTE(te, image, TRUE);
|
||||
gAgentAvatarp->wearableUpdated(self->mType, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -794,8 +793,8 @@ void LLPanelEditWearable::onInvisibilityCommit(LLUICtrl* ctrl, void* userdata)
|
||||
if (prev_id.notNull())
|
||||
{
|
||||
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(prev_id);
|
||||
avatar->setLocTexTE(te, image, TRUE);
|
||||
avatar->wearableUpdated(self->mType, FALSE);
|
||||
gAgentAvatarp->setLocalTextureTE(te, image, TRUE);
|
||||
gAgentAvatarp->wearableUpdated(self->mType, FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -813,23 +812,24 @@ void LLPanelEditWearable::onColorCommit( LLUICtrl* ctrl, void* userdata )
|
||||
LLPanelEditWearable* self = (LLPanelEditWearable*) userdata;
|
||||
LLColorSwatchCtrl* color_ctrl = (LLColorSwatchCtrl*) ctrl;
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( self && color_ctrl && avatar )
|
||||
if(!isAgentAvatarValid())
|
||||
return;
|
||||
if( self && color_ctrl)
|
||||
{
|
||||
std::map<std::string, S32>::const_iterator cl_itr = self->mColorList.find(ctrl->getName());
|
||||
if(cl_itr != self->mColorList.end())
|
||||
{
|
||||
ETextureIndex te = (ETextureIndex)cl_itr->second;
|
||||
|
||||
LLColor4 old_color = avatar->getClothesColor( te );
|
||||
LLColor4 old_color = gAgentAvatarp->getClothesColor( te );
|
||||
const LLColor4& new_color = color_ctrl->get();
|
||||
if( old_color != new_color )
|
||||
{
|
||||
// Set the new version
|
||||
avatar->setClothesColor( te, new_color, TRUE );
|
||||
gAgentAvatarp->setClothesColor( te, new_color, TRUE );
|
||||
|
||||
LLVisualParamHint::requestHintUpdates();
|
||||
avatar->wearableUpdated(self->mType, FALSE);
|
||||
gAgentAvatarp->wearableUpdated(self->mType, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -893,8 +893,7 @@ void LLPanelEditWearable::onTextureCommit( LLUICtrl* ctrl, void* userdata )
|
||||
LLPanelEditWearable* self = (LLPanelEditWearable*) userdata;
|
||||
LLTextureCtrl* texture_ctrl = (LLTextureCtrl*) ctrl;
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( avatar )
|
||||
if( isAgentAvatarValid() )
|
||||
{
|
||||
ETextureIndex te = (ETextureIndex)(self->mTextureList[ctrl->getName()]);
|
||||
|
||||
@@ -907,8 +906,8 @@ void LLPanelEditWearable::onTextureCommit( LLUICtrl* ctrl, void* userdata )
|
||||
self->mTextureList[ctrl->getName()] = te;
|
||||
if (gAgentWearables.getWearable(self->mType))
|
||||
{
|
||||
avatar->setLocTexTE(te, image, TRUE);
|
||||
avatar->wearableUpdated(self->mType, FALSE);
|
||||
gAgentAvatarp->setLocalTextureTE(te, image, TRUE);
|
||||
gAgentAvatarp->wearableUpdated(self->mType, FALSE);
|
||||
}
|
||||
if (self->mType == LLWearableType::WT_ALPHA && image->getID() != IMG_INVISIBLE)
|
||||
{
|
||||
@@ -1989,12 +1988,11 @@ void LLFloaterCustomize::onBtnOk( void* userdata )
|
||||
LLFloaterCustomize* floater = (LLFloaterCustomize*) userdata;
|
||||
gAgentWearables.saveAllWearables();
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if ( avatar )
|
||||
if ( isAgentAvatarValid() )
|
||||
{
|
||||
avatar->invalidateAll();
|
||||
gAgentAvatarp->invalidateAll();
|
||||
|
||||
avatar->requestLayerSetUploads();
|
||||
gAgentAvatarp->requestLayerSetUploads();
|
||||
|
||||
gAgent.sendAgentSetAppearance();
|
||||
}
|
||||
|
||||
@@ -1623,8 +1623,7 @@ BOOL LLFolderBridge::isItemRemovable()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( !avatar )
|
||||
if( !isAgentAvatarValid() )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1667,7 +1666,7 @@ BOOL LLFolderBridge::isItemRemovable()
|
||||
}
|
||||
else if (item->getType() == LLAssetType::AT_OBJECT && !item->getIsLinkType())
|
||||
{
|
||||
if( avatar->isWearingAttachment( item->getUUID() ) )
|
||||
if( gAgentAvatarp->isWearingAttachment( item->getUUID() ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -4028,17 +4027,16 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
|
||||
LLInventoryItem* item = gInventory.getItem(mUUID);
|
||||
if(item)
|
||||
{
|
||||
LLVOAvatar::detachAttachmentIntoInventory(item->getLinkedUUID());
|
||||
LLVOAvatarSelf::detachAttachmentIntoInventory(item->getLinkedUUID());
|
||||
}
|
||||
}
|
||||
else if ("edit" == action)
|
||||
{
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_EDIT))
|
||||
return;
|
||||
LLVOAvatar* avatarp = gAgentAvatarp;
|
||||
if (!avatarp)
|
||||
if (!isAgentAvatarValid())
|
||||
return;
|
||||
LLViewerObject* objectp = avatarp->getWornAttachment(mUUID);
|
||||
LLViewerObject* objectp = gAgentAvatarp->getWornAttachment(mUUID);
|
||||
if (!objectp)
|
||||
return;
|
||||
|
||||
@@ -4085,12 +4083,11 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model
|
||||
|
||||
void LLObjectBridge::openItem()
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if (!avatar)
|
||||
if (!isAgentAvatarValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (avatar->isWearingAttachment(mUUID))
|
||||
if (gAgentAvatarp->isWearingAttachment(mUUID))
|
||||
{
|
||||
// [RLVa:KB]
|
||||
if ( !(rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(getItem())))
|
||||
@@ -4105,12 +4102,11 @@ void LLObjectBridge::openItem()
|
||||
|
||||
std::string LLObjectBridge::getLabelSuffix() const
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( avatar && avatar->isWearingAttachment( mUUID ) )
|
||||
if( isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment( mUUID ) )
|
||||
{
|
||||
std::string attachment_point_name = avatar->getAttachedPointName(mUUID);
|
||||
std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID);
|
||||
LLStringUtil::toLower(attachment_point_name);
|
||||
LLViewerObject* pObj = (rlv_handler_t::isEnabled()) ? avatar->getWornAttachment( mUUID ) : NULL;
|
||||
LLViewerObject* pObj = (rlv_handler_t::isEnabled()) ? gAgentAvatarp->getWornAttachment( mUUID ) : NULL;
|
||||
// [RLVa:KB]
|
||||
if ( pObj && (gRlvAttachmentLocks.isLockedAttachment(pObj) ||
|
||||
gRlvAttachmentLocks.isLockedAttachmentPoint(RlvAttachPtLookup::getAttachPointIndex(pObj),RLV_LOCK_REMOVE)))
|
||||
@@ -4123,10 +4119,10 @@ std::string LLObjectBridge::getLabelSuffix() const
|
||||
else
|
||||
{
|
||||
// <edit> testzone attachpt
|
||||
if(avatar)
|
||||
if(isAgentAvatarValid())
|
||||
{
|
||||
std::map<S32, std::pair<LLUUID,LLUUID> >::iterator iter = avatar->mUnsupportedAttachmentPoints.begin();
|
||||
std::map<S32, std::pair<LLUUID,LLUUID> >::iterator end = avatar->mUnsupportedAttachmentPoints.end();
|
||||
std::map<S32, std::pair<LLUUID,LLUUID> >::iterator iter = gAgentAvatarp->mUnsupportedAttachmentPoints.begin();
|
||||
std::map<S32, std::pair<LLUUID,LLUUID> >::iterator end = gAgentAvatarp->mUnsupportedAttachmentPoints.end();
|
||||
for( ; iter != end; ++iter)
|
||||
if((*iter).second.first == mUUID)
|
||||
{
|
||||
@@ -4247,8 +4243,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
LLInventoryItem* item = getItem();
|
||||
if(item)
|
||||
{
|
||||
LLVOAvatar *avatarp = gAgentAvatarp;
|
||||
if( !avatarp )
|
||||
if( !isAgentAvatarValid() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4266,7 +4261,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
}
|
||||
else
|
||||
// <edit> testzone attachpt
|
||||
if( avatarp->isWearingUnsupportedAttachment( mUUID ) )
|
||||
if( gAgentAvatarp->isWearingUnsupportedAttachment( mUUID ) )
|
||||
{
|
||||
items.push_back(std::string("Detach From Yourself"));
|
||||
}
|
||||
@@ -4278,7 +4273,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
items.push_back(std::string("Object Wear"));
|
||||
if (gHippoGridManager->getConnectedGrid()->supportsInvLinks())
|
||||
items.push_back(std::string("Object Add"));
|
||||
if (!avatarp->canAttachMoreObjects())
|
||||
if (!gAgentAvatarp->canAttachMoreObjects())
|
||||
{
|
||||
disabled_items.push_back(std::string("Object Add"));
|
||||
}
|
||||
@@ -4287,7 +4282,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
// commented out for DEV-32347 - AND Commented back in for non-morons. -HgB
|
||||
items.push_back(std::string("Restore to Last Position"));
|
||||
|
||||
if (!avatarp->canAttachMoreObjects())
|
||||
if (!gAgentAvatarp->canAttachMoreObjects())
|
||||
{
|
||||
disabled_items.push_back(std::string("Object Wea"));
|
||||
disabled_items.push_back(std::string("Object Add"));
|
||||
@@ -4310,11 +4305,10 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
if (attach_menu
|
||||
&& (attach_menu->getChildCount() == 0)
|
||||
&& attach_hud_menu
|
||||
&& (attach_hud_menu->getChildCount() == 0)
|
||||
&& avatarp)
|
||||
&& (attach_hud_menu->getChildCount() == 0))
|
||||
{
|
||||
for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
|
||||
iter != avatarp->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;
|
||||
@@ -4374,10 +4368,9 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name)
|
||||
model->updateItem(new_item);
|
||||
model->notifyObservers();
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( avatar )
|
||||
if( isAgentAvatarValid() )
|
||||
{
|
||||
LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() );
|
||||
LLViewerObject* obj = gAgentAvatarp->getWornAttachment( item->getUUID() );
|
||||
if( obj )
|
||||
{
|
||||
LLSelectMgr::getInstance()->deselectAll();
|
||||
@@ -5148,7 +5141,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata)
|
||||
LLViewerInventoryItem *obj_item = obj_item_array.get(i);
|
||||
if (get_is_item_worn(obj_item->getUUID()))
|
||||
{
|
||||
LLVOAvatar::detachAttachmentIntoInventory(obj_item->getLinkedUUID());
|
||||
LLVOAvatarSelf::detachAttachmentIntoInventory(obj_item->getLinkedUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3647,7 +3647,6 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* ite
|
||||
return false;
|
||||
|
||||
bool allowed = false;
|
||||
LLVOAvatar* my_avatar = NULL;
|
||||
|
||||
switch(item->getType())
|
||||
{
|
||||
@@ -3656,8 +3655,7 @@ bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(LLInventoryItem* ite
|
||||
break;
|
||||
|
||||
case LLAssetType::AT_OBJECT:
|
||||
my_avatar = gAgentAvatarp;
|
||||
if(my_avatar && !my_avatar->isWearingAttachment(item->getUUID()))
|
||||
if(isAgentAvatarValid() && !gAgentAvatarp->isWearingAttachment(item->getUUID()))
|
||||
{
|
||||
allowed = true;
|
||||
}
|
||||
|
||||
@@ -91,15 +91,14 @@ void LLMorphView::initialize()
|
||||
mCameraYaw = 0.f;
|
||||
mCameraDist = -1.f;
|
||||
|
||||
LLVOAvatar *avatarp = gAgentAvatarp;
|
||||
if (!avatarp || avatarp->isDead())
|
||||
if (!isAgentAvatarValid())
|
||||
{
|
||||
gAgentCamera.changeCameraToDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
avatarp->stopMotion( ANIM_AGENT_BODY_NOISE );
|
||||
avatarp->mSpecialRenderMode = 3;
|
||||
gAgentAvatarp->stopMotion( ANIM_AGENT_BODY_NOISE );
|
||||
gAgentAvatarp->mSpecialRenderMode = 3;
|
||||
|
||||
// set up camera for close look at avatar
|
||||
mOldCameraNearClip = LLViewerCamera::getInstance()->getNear();
|
||||
@@ -111,13 +110,12 @@ void LLMorphView::initialize()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLMorphView::shutdown()
|
||||
{
|
||||
LLVOAvatar::onCustomizeEnd();
|
||||
LLVOAvatarSelf::onCustomizeEnd();
|
||||
|
||||
LLVOAvatar *avatarp = gAgentAvatarp;
|
||||
if(avatarp && !avatarp->isDead())
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
avatarp->startMotion( ANIM_AGENT_BODY_NOISE );
|
||||
avatarp->mSpecialRenderMode = 0;
|
||||
gAgentAvatarp->startMotion( ANIM_AGENT_BODY_NOISE );
|
||||
gAgentAvatarp->mSpecialRenderMode = 0;
|
||||
// reset camera
|
||||
LLViewerCamera::getInstance()->setNear(mOldCameraNearClip);
|
||||
}
|
||||
@@ -167,14 +165,10 @@ void LLMorphView::updateCamera()
|
||||
if (!mCameraTargetJoint)
|
||||
{
|
||||
setCameraTargetJoint(gAgentAvatarp->getJoint("mHead"));
|
||||
}
|
||||
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( !avatar )
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLJoint* root_joint = avatar->getRootJoint();
|
||||
}
|
||||
if (!isAgentAvatarValid()) return;
|
||||
|
||||
LLJoint* root_joint = gAgentAvatarp->getRootJoint();
|
||||
if( !root_joint )
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -231,10 +231,9 @@ void LLPreview::onCommit()
|
||||
// update the object itself.
|
||||
if( item->getType() == LLAssetType::AT_OBJECT )
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( avatar )
|
||||
if( isAgentAvatarValid() )
|
||||
{
|
||||
LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() );
|
||||
LLViewerObject* obj = gAgentAvatarp->getWornAttachment( item->getUUID() );
|
||||
if( obj )
|
||||
{
|
||||
LLSelectMgr::getInstance()->deselectAll();
|
||||
|
||||
@@ -3440,7 +3440,7 @@ void register_viewer_callbacks(LLMessageSystem* msg)
|
||||
msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation);
|
||||
msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance);
|
||||
msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse);
|
||||
msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatar::processRebakeAvatarTextures);
|
||||
msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures);
|
||||
msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint);
|
||||
msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response);
|
||||
msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties);
|
||||
|
||||
@@ -71,7 +71,7 @@ S32 LLTexLayerSetBuffer::sGLByteCount = 0;
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLBakedUploadData()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLBakedUploadData::LLBakedUploadData( LLVOAvatar* avatar,
|
||||
LLBakedUploadData::LLBakedUploadData( LLVOAvatarSelf* avatar,
|
||||
LLTexLayerSet* layerset,
|
||||
LLTexLayerSetBuffer* layerset_buffer,
|
||||
const LLUUID & id ) :
|
||||
@@ -218,12 +218,14 @@ void LLTexLayerSetBuffer::popProjection()
|
||||
|
||||
BOOL LLTexLayerSetBuffer::needsRender()
|
||||
{
|
||||
LLVOAvatar* avatar = mTexLayerSet->getAvatar();
|
||||
llassert(mTexLayerSet->getAvatar() == gAgentAvatarp);
|
||||
if (!isAgentAvatarValid()) return FALSE;
|
||||
|
||||
BOOL upload_now = needsUploadNow();
|
||||
BOOL needs_update = (mNeedsUpdate || upload_now) && !avatar->getIsAppearanceAnimating();
|
||||
BOOL needs_update = (mNeedsUpdate || upload_now) && !gAgentAvatarp->getIsAppearanceAnimating();
|
||||
if (needs_update)
|
||||
{
|
||||
BOOL invalid_skirt = avatar->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !avatar->isWearingWearableType(LLWearableType::WT_SKIRT);
|
||||
BOOL invalid_skirt = gAgentAvatarp->getBakedTE(mTexLayerSet) == TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT);
|
||||
if (invalid_skirt)
|
||||
{
|
||||
// we were trying to create a skirt texture
|
||||
@@ -233,7 +235,7 @@ BOOL LLTexLayerSetBuffer::needsRender()
|
||||
}
|
||||
else
|
||||
{
|
||||
needs_update &= (avatar->isSelf() || (avatar->isVisible() && !avatar->isCulled()));
|
||||
needs_update &= ((gAgentAvatarp->isVisible() && !gAgentAvatarp->isCulled()));
|
||||
needs_update &= mTexLayerSet->isLocalTextureDataAvailable();
|
||||
}
|
||||
}
|
||||
@@ -296,12 +298,8 @@ BOOL LLTexLayerSetBuffer::render()
|
||||
{
|
||||
mUploadPending = FALSE;
|
||||
mNeedsUpload = FALSE;
|
||||
LLVOAvatar* avatar = mTexLayerSet->getAvatar();
|
||||
if (avatar)
|
||||
{
|
||||
avatar->setNewBakedTexture(avatar->getBakedTE(mTexLayerSet), IMG_INVISIBLE);
|
||||
llinfos << "Invisible baked texture set for " << mTexLayerSet->getBodyRegion() << llendl;
|
||||
}
|
||||
mTexLayerSet->getAvatar()->setNewBakedTexture(mTexLayerSet->getAvatar()->getBakedTE(mTexLayerSet), IMG_INVISIBLE);
|
||||
llinfos << "Invisible baked texture set for " << mTexLayerSet->getBodyRegion() << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -612,7 +610,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node)
|
||||
|
||||
BOOL LLTexLayerSet::sHasCaches = FALSE;
|
||||
|
||||
LLTexLayerSet::LLTexLayerSet( LLVOAvatar* avatar )
|
||||
LLTexLayerSet::LLTexLayerSet( LLVOAvatarSelf* avatar )
|
||||
:
|
||||
mComposite( NULL ),
|
||||
mAvatar( avatar ),
|
||||
|
||||
@@ -260,7 +260,7 @@ class LLTexLayerSet
|
||||
{
|
||||
friend class LLTexLayerSetBuffer;
|
||||
public:
|
||||
LLTexLayerSet( LLVOAvatar* avatar );
|
||||
LLTexLayerSet( LLVOAvatarSelf* avatar );
|
||||
~LLTexLayerSet();
|
||||
|
||||
//BOOL parseData(LLXmlTreeNode* node);
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
void requestUpdate();
|
||||
void requestUpload();
|
||||
void cancelUpload();
|
||||
LLVOAvatar* getAvatar() { return mAvatar; }
|
||||
LLVOAvatarSelf* getAvatar() { return mAvatar; }
|
||||
void updateComposite();
|
||||
BOOL isLocalTextureDataAvailable();
|
||||
BOOL isLocalTextureDataFinal();
|
||||
@@ -301,7 +301,7 @@ protected:
|
||||
layer_list_t mMaskLayerList;
|
||||
LLPointer<LLTexLayerSetBuffer> mComposite;
|
||||
// Backlink only; don't make this an LLPointer.
|
||||
LLVOAvatar* mAvatar;
|
||||
LLVOAvatarSelf* mAvatar;
|
||||
BOOL mUpdatesEnabled;
|
||||
BOOL mIsVisible;
|
||||
|
||||
@@ -442,7 +442,7 @@ public:
|
||||
BOOL setInfo(LLTexGlobalColorInfo *info);
|
||||
|
||||
void requstUpdate();
|
||||
LLVOAvatar* getAvatar() { return mAvatar; }
|
||||
LLVOAvatar* getAvatar() { return mAvatar; }
|
||||
LLColor4 getColor();
|
||||
const std::string& getName() { return mInfo->mName; }
|
||||
|
||||
@@ -540,11 +540,11 @@ public:
|
||||
class LLBakedUploadData
|
||||
{
|
||||
public:
|
||||
LLBakedUploadData( LLVOAvatar* avatar, LLTexLayerSet* layerset, LLTexLayerSetBuffer* layerset_buffer, const LLUUID & id);
|
||||
LLBakedUploadData( LLVOAvatarSelf* avatar, LLTexLayerSet* layerset, LLTexLayerSetBuffer* layerset_buffer, const LLUUID & id);
|
||||
~LLBakedUploadData() {}
|
||||
|
||||
LLUUID mID;
|
||||
LLVOAvatar* mAvatar; // just backlink, don't LLPointer
|
||||
LLVOAvatarSelf* mAvatar; // just backlink, don't LLPointer
|
||||
LLTexLayerSet* mTexLayerSet;
|
||||
LLTexLayerSetBuffer* mLayerSetBuffer;
|
||||
LLUUID mWearableAssets[LLWearableType::WT_COUNT];
|
||||
|
||||
@@ -2029,7 +2029,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
|
||||
// gAgent.getGroupID())
|
||||
// && (obj->mPermModify || obj->mFlagAllowInventoryAdd));
|
||||
BOOL worn = FALSE;
|
||||
LLVOAvatar* my_avatar = NULL;
|
||||
LLVOAvatarSelf* my_avatar = NULL;
|
||||
switch(item->getType())
|
||||
{
|
||||
case LLAssetType::AT_OBJECT:
|
||||
@@ -2858,7 +2858,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject(
|
||||
// cannot give away no-transfer objects
|
||||
return ACCEPT_NO;
|
||||
}
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
LLVOAvatarSelf* avatar = gAgentAvatarp;
|
||||
if(avatar && avatar->isWearingAttachment( item->getUUID() ) )
|
||||
{
|
||||
// You can't give objects that are attached to you
|
||||
|
||||
@@ -151,16 +151,14 @@ BOOL LLVisualParamHint::needsRender()
|
||||
|
||||
void LLVisualParamHint::preRender(BOOL clear_depth)
|
||||
{
|
||||
LLVOAvatar* avatarp = gAgentAvatarp;
|
||||
|
||||
mLastParamWeight = avatarp->getVisualParamWeight(mVisualParam);
|
||||
avatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight);
|
||||
avatarp->setVisualParamWeight("Blink_Left", 0.f);
|
||||
avatarp->setVisualParamWeight("Blink_Right", 0.f);
|
||||
avatarp->updateComposites();
|
||||
avatarp->updateVisualParams();
|
||||
avatarp->updateGeometry(avatarp->mDrawable);
|
||||
avatarp->updateLOD();
|
||||
mLastParamWeight = gAgentAvatarp->getVisualParamWeight(mVisualParam);
|
||||
gAgentAvatarp->setVisualParamWeight(mVisualParam, mVisualParamWeight);
|
||||
gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f);
|
||||
gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f);
|
||||
gAgentAvatarp->updateComposites();
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
gAgentAvatarp->updateGeometry(gAgentAvatarp->mDrawable);
|
||||
gAgentAvatarp->updateLOD();
|
||||
|
||||
LLViewerDynamicTexture::preRender(clear_depth);
|
||||
}
|
||||
@@ -171,7 +169,6 @@ void LLVisualParamHint::preRender(BOOL clear_depth)
|
||||
BOOL LLVisualParamHint::render()
|
||||
{
|
||||
LLVisualParamReset::sDirty = TRUE;
|
||||
LLVOAvatar* avatarp = gAgentAvatarp;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
@@ -199,7 +196,7 @@ BOOL LLVisualParamHint::render()
|
||||
const std::string& cam_target_mesh_name = mVisualParam->getCameraTargetName();
|
||||
if( !cam_target_mesh_name.empty() )
|
||||
{
|
||||
cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint( cam_target_mesh_name );
|
||||
cam_target_joint = (LLViewerJointMesh*)gAgentAvatarp->getJoint( cam_target_mesh_name );
|
||||
}
|
||||
if( !cam_target_joint )
|
||||
{
|
||||
@@ -207,11 +204,11 @@ BOOL LLVisualParamHint::render()
|
||||
}
|
||||
if( !cam_target_joint )
|
||||
{
|
||||
cam_target_joint = (LLViewerJointMesh*)avatarp->getJoint("mHead");
|
||||
cam_target_joint = (LLViewerJointMesh*)gAgentAvatarp->getJoint("mHead");
|
||||
}
|
||||
|
||||
LLQuaternion avatar_rotation;
|
||||
LLJoint* root_joint = avatarp->getRootJoint();
|
||||
LLJoint* root_joint = gAgentAvatarp->getRootJoint();
|
||||
if( root_joint )
|
||||
{
|
||||
avatar_rotation = root_joint->getWorldRotation();
|
||||
@@ -233,23 +230,23 @@ BOOL LLVisualParamHint::render()
|
||||
|
||||
LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / (F32)mFullHeight);
|
||||
LLViewerCamera::getInstance()->setOriginAndLookAt(
|
||||
camera_pos, // camera
|
||||
LLVector3(0.f, 0.f, 1.f), // up
|
||||
target_pos ); // point of interest
|
||||
camera_pos, // camera
|
||||
LLVector3::z_axis, // up
|
||||
target_pos ); // point of interest
|
||||
|
||||
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
|
||||
|
||||
if (avatarp->mDrawable.notNull())
|
||||
if (gAgentAvatarp->mDrawable.notNull())
|
||||
{
|
||||
LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
|
||||
LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)gAgentAvatarp->mDrawable->getFace(0)->getPool();
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_ALWAYS);
|
||||
gGL.setSceneBlendType(LLRender::BT_REPLACE);
|
||||
avatarPoolp->renderAvatars(avatarp); // renders only one avatar
|
||||
avatarPoolp->renderAvatars(gAgentAvatarp); // renders only one avatar
|
||||
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
|
||||
}
|
||||
avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
|
||||
gAgentAvatarp->setVisualParamWeight(mVisualParam, mLastParamWeight);
|
||||
gGL.color4f(1,1,1,1);
|
||||
mGLTexturep->setGLTextureCreated(true);
|
||||
return TRUE;
|
||||
@@ -304,10 +301,9 @@ BOOL LLVisualParamReset::render()
|
||||
{
|
||||
if (sDirty)
|
||||
{
|
||||
LLVOAvatar* avatarp = gAgentAvatarp;
|
||||
avatarp->updateComposites();
|
||||
avatarp->updateVisualParams();
|
||||
avatarp->updateGeometry(avatarp->mDrawable);
|
||||
gAgentAvatarp->updateComposites();
|
||||
gAgentAvatarp->updateVisualParams();
|
||||
gAgentAvatarp->updateGeometry(gAgentAvatarp->mDrawable);
|
||||
sDirty = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ static bool handleAvatarBoobXYInfluence(const LLSD& newvalue)
|
||||
|
||||
static bool handleSetSelfInvisible( const LLSD& newvalue)
|
||||
{
|
||||
LLVOAvatar::onChangeSelfInvisible( newvalue.asBoolean() );
|
||||
LLVOAvatarSelf::onChangeSelfInvisible( newvalue.asBoolean() );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "lldrawable.h"
|
||||
#include "llgl.h"
|
||||
#include "llrender.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llvolume.h"
|
||||
#include "pipeline.h"
|
||||
#include "llspatialpartition.h"
|
||||
@@ -182,7 +182,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object)
|
||||
object->markDead();
|
||||
|
||||
// If this happens to be attached to self, then detach.
|
||||
LLVOAvatar::detachAttachmentIntoInventory(object->getAttachmentItemID());
|
||||
LLVOAvatarSelf::detachAttachmentIntoInventory(object->getAttachmentItemID());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -592,8 +592,8 @@ void handle_mesh_load_obj(void*);
|
||||
void handle_morph_save_obj(void*);
|
||||
void handle_morph_load_obj(void*);
|
||||
void handle_debug_avatar_textures(void*);
|
||||
void handle_grab_texture(void*);
|
||||
BOOL enable_grab_texture(void*);
|
||||
void handle_grab_baked_texture(void*);
|
||||
BOOL enable_grab_baked_texture(void*);
|
||||
void handle_dump_region_object_cache(void*);
|
||||
|
||||
BOOL menu_ui_enabled(void *user_data);
|
||||
@@ -1654,12 +1654,12 @@ void init_debug_avatar_menu(LLMenuGL* menu)
|
||||
|
||||
void init_debug_baked_texture_menu(LLMenuGL* menu)
|
||||
{
|
||||
menu->append(new LLMenuItemCallGL("Iris", handle_grab_texture, enable_grab_texture, (void*) TEX_EYES_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Head", handle_grab_texture, enable_grab_texture, (void*) TEX_HEAD_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_texture, enable_grab_texture, (void*) TEX_UPPER_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_texture, enable_grab_texture, (void*) TEX_LOWER_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Skirt", handle_grab_texture, enable_grab_texture, (void*) TEX_SKIRT_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Hair", handle_grab_texture, enable_grab_texture, (void*) TEX_HAIR_BAKED));
|
||||
menu->append(new LLMenuItemCallGL("Iris", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_EYES));
|
||||
menu->append(new LLMenuItemCallGL("Head", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_HEAD));
|
||||
menu->append(new LLMenuItemCallGL("Upper Body", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_UPPER));
|
||||
menu->append(new LLMenuItemCallGL("Lower Body", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_LOWER));
|
||||
menu->append(new LLMenuItemCallGL("Skirt", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_SKIRT));
|
||||
menu->append(new LLMenuItemCallGL("Hair", handle_grab_baked_texture, enable_grab_baked_texture, (void*) BAKED_HAIR));
|
||||
menu->createJumpKeys();
|
||||
}
|
||||
|
||||
@@ -3052,9 +3052,9 @@ class LLAvatarDebug : public view_listener_t
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
|
||||
if( avatar )
|
||||
if( avatar == gAgentAvatarp )
|
||||
{
|
||||
avatar->dumpLocalTextures();
|
||||
gAgentAvatarp->dumpLocalTextures();
|
||||
// <edit> hell no don't tell them about that
|
||||
/*
|
||||
llinfos << "Dumping temporary asset data to simulator logs for avatar " << avatar->getID() << llendl;
|
||||
@@ -8274,10 +8274,9 @@ void slow_mo_animations(void*)
|
||||
|
||||
void handle_dump_avatar_local_textures(void*)
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if( avatar )
|
||||
if( isAgentAvatarValid() )
|
||||
{
|
||||
avatar->dumpLocalTextures();
|
||||
gAgentAvatarp->dumpLocalTextures();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8701,106 +8700,79 @@ void handle_debug_avatar_textures(void*)
|
||||
// </edit>
|
||||
}
|
||||
|
||||
void handle_grab_texture(void* data)
|
||||
void handle_grab_baked_texture(void* data)
|
||||
{
|
||||
ETextureIndex index = (ETextureIndex)((intptr_t)data);
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if ( avatar )
|
||||
EBakedTextureIndex baked_tex_index = (EBakedTextureIndex)((intptr_t)data);
|
||||
if (!isAgentAvatarValid()) return;
|
||||
|
||||
const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index);
|
||||
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
|
||||
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
|
||||
const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));
|
||||
if(folder_id.notNull())
|
||||
{
|
||||
const LLUUID& asset_id = avatar->grabLocalTexture(index);
|
||||
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
|
||||
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
|
||||
LLUUID folder_id(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE));
|
||||
if(folder_id.notNull())
|
||||
{
|
||||
std::string name = "Baked ";
|
||||
switch (index)
|
||||
std::string name;
|
||||
name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_tex_index)->mNameCapitalized + " Texture";
|
||||
|
||||
LLUUID item_id;
|
||||
item_id.generate();
|
||||
LLPermissions perm;
|
||||
perm.init(gAgentID,
|
||||
gAgentID,
|
||||
LLUUID::null,
|
||||
LLUUID::null);
|
||||
U32 next_owner_perm = PERM_MOVE | PERM_TRANSFER;
|
||||
perm.initMasks(PERM_ALL,
|
||||
PERM_ALL,
|
||||
PERM_NONE,
|
||||
PERM_NONE,
|
||||
next_owner_perm);
|
||||
time_t creation_date_now = time_corrected();
|
||||
LLPointer<LLViewerInventoryItem> item
|
||||
= new LLViewerInventoryItem(item_id,
|
||||
folder_id,
|
||||
perm,
|
||||
asset_id,
|
||||
asset_type,
|
||||
inv_type,
|
||||
name,
|
||||
LLStringUtil::null,
|
||||
LLSaleInfo::DEFAULT,
|
||||
LLInventoryItemFlags::II_FLAGS_NONE,
|
||||
creation_date_now);
|
||||
|
||||
item->updateServer(TRUE);
|
||||
gInventory.updateItem(item);
|
||||
gInventory.notifyObservers();
|
||||
|
||||
LLInventoryView* view = LLInventoryView::getActiveInventory();
|
||||
|
||||
// Show the preview panel for textures to let
|
||||
// user know that the image is now in inventory.
|
||||
if(view)
|
||||
{
|
||||
case TEX_EYES_BAKED:
|
||||
name.append("Iris");
|
||||
break;
|
||||
case TEX_HEAD_BAKED:
|
||||
name.append("Head");
|
||||
break;
|
||||
case TEX_UPPER_BAKED:
|
||||
name.append("Upper Body");
|
||||
break;
|
||||
case TEX_LOWER_BAKED:
|
||||
name.append("Lower Body");
|
||||
break;
|
||||
case TEX_SKIRT_BAKED:
|
||||
name.append("Skirt");
|
||||
break;
|
||||
case TEX_HAIR_BAKED:
|
||||
name.append("Hair");
|
||||
break;
|
||||
default:
|
||||
name.append("Unknown");
|
||||
break;
|
||||
}
|
||||
name.append(" Texture");
|
||||
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
|
||||
|
||||
LLUUID item_id;
|
||||
item_id.generate();
|
||||
LLPermissions perm;
|
||||
perm.init(gAgentID,
|
||||
gAgentID,
|
||||
LLUUID::null,
|
||||
LLUUID::null);
|
||||
U32 next_owner_perm = PERM_MOVE | PERM_TRANSFER;
|
||||
perm.initMasks(PERM_ALL,
|
||||
PERM_ALL,
|
||||
PERM_NONE,
|
||||
PERM_NONE,
|
||||
next_owner_perm);
|
||||
time_t creation_date_now = time_corrected();
|
||||
LLPointer<LLViewerInventoryItem> item
|
||||
= new LLViewerInventoryItem(item_id,
|
||||
folder_id,
|
||||
perm,
|
||||
asset_id,
|
||||
asset_type,
|
||||
inv_type,
|
||||
name,
|
||||
LLStringUtil::null,
|
||||
LLSaleInfo::DEFAULT,
|
||||
LLInventoryItemFlags::II_FLAGS_NONE,
|
||||
creation_date_now);
|
||||
|
||||
item->updateServer(TRUE);
|
||||
gInventory.updateItem(item);
|
||||
gInventory.notifyObservers();
|
||||
|
||||
LLInventoryView* view = LLInventoryView::getActiveInventory();
|
||||
|
||||
// Show the preview panel for textures to let
|
||||
// user know that the image is now in inventory.
|
||||
if(view)
|
||||
{
|
||||
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
|
||||
|
||||
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
|
||||
view->getPanel()->openSelected();
|
||||
//LLInventoryView::dumpSelectionInformation((void*)view);
|
||||
// restore keyboard focus
|
||||
gFocusMgr.setKeyboardFocus(focus_ctrl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Can't find a folder to put it in" << llendl;
|
||||
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
|
||||
view->getPanel()->openSelected();
|
||||
//LLInventoryView::dumpSelectionInformation((void*)view);
|
||||
// restore keyboard focus
|
||||
gFocusMgr.setKeyboardFocus(focus_ctrl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "Can't find a folder to put it in" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL enable_grab_texture(void* data)
|
||||
BOOL enable_grab_baked_texture(void* data)
|
||||
{
|
||||
ETextureIndex index = (ETextureIndex)((intptr_t)data);
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if ( avatar )
|
||||
EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data);
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
return avatar->canGrabLocalTexture(index);
|
||||
return gAgentAvatarp->canGrabBakedTexture(index);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -9038,12 +9010,11 @@ void handle_buy_currency_test(void*)
|
||||
|
||||
void handle_rebake_textures(void*)
|
||||
{
|
||||
LLVOAvatar* avatar = gAgentAvatarp;
|
||||
if (!avatar) return;
|
||||
if (!isAgentAvatarValid()) return;
|
||||
|
||||
// Slam pending upload count to "unstick" things
|
||||
bool slam_for_debug = true;
|
||||
avatar->forceBakeAllTextures(slam_for_debug);
|
||||
gAgentAvatarp->forceBakeAllTextures(slam_for_debug);
|
||||
}
|
||||
|
||||
void toggle_visibility(void* user_data)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include "lldebugview.h"
|
||||
#include "llfasttimerview.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llviewerwindow.h" // *TODO: remove, only used for width/height
|
||||
#include "llworld.h"
|
||||
#include "llfeaturemanager.h"
|
||||
@@ -526,11 +526,11 @@ void output_statistics(void*)
|
||||
llinfos << "--------------------------------" << llendl;
|
||||
llinfos << "Avatar Memory (partly overlaps with above stats):" << llendl;
|
||||
gTexStaticImageList.dumpByteCount();
|
||||
LLVOAvatar::dumpScratchTextureByteCount();
|
||||
LLVOAvatarSelf::dumpScratchTextureByteCount();
|
||||
LLTexLayerSetBuffer::dumpTotalByteCount();
|
||||
LLVOAvatar::dumpTotalLocalTextureByteCount();
|
||||
LLVOAvatarSelf::dumpTotalLocalTextureByteCount();
|
||||
LLTexLayerParamAlpha::dumpCacheByteCount();
|
||||
LLVOAvatar::dumpBakedStatus();
|
||||
LLVOAvatarSelf::dumpBakedStatus();
|
||||
|
||||
llinfos << llendl;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -237,6 +237,7 @@ public:
|
||||
void idleUpdateLoadingEffect();
|
||||
void idleUpdateWindEffect();
|
||||
void idleUpdateNameTag(const LLVector3& root_pos_last);
|
||||
LLVector3 idleUpdateNameTagPosition(const LLVector3& root_pos_last);
|
||||
void clearNameTag();
|
||||
static void invalidateNameTag(const LLUUID& agent_id);
|
||||
// force all name tags to rebuild, useful when display names turned on/off
|
||||
@@ -244,8 +245,6 @@ public:
|
||||
void idleUpdateRenderCost();
|
||||
void idleUpdateBelowWater();
|
||||
void idleUpdateBoobEffect(); //Emerald
|
||||
|
||||
void updateAttachmentVisibility(U32 camera_mode); //Agent only
|
||||
|
||||
LLFrameTimer mIdleTimer;
|
||||
std::string getIdleTime();
|
||||
@@ -282,8 +281,12 @@ public:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL isFullyLoaded() const;
|
||||
bool visualParamWeightsAreDefault();
|
||||
protected:
|
||||
virtual BOOL getIsCloud();
|
||||
//BOOL isReallyFullyLoaded();
|
||||
BOOL updateIsFullyLoaded();
|
||||
BOOL processFullyLoadedChange(bool loading);
|
||||
protected:
|
||||
bool sendAvatarTexturesRequest();
|
||||
void updateRuthTimer(bool loading);
|
||||
@@ -484,6 +487,15 @@ public:
|
||||
private:
|
||||
static S32 sFreezeCounter;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Constants
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
virtual LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLViewerTexture::BOOST_AVATAR; }
|
||||
virtual LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLViewerTexture::BOOST_AVATAR_BAKED; }
|
||||
virtual S32 getTexImageSize() const;
|
||||
virtual S32 getTexImageArea() const { return getTexImageSize()*getTexImageSize(); }
|
||||
|
||||
/** Rendering
|
||||
** **
|
||||
*******************************************************************************/
|
||||
@@ -497,8 +509,8 @@ private:
|
||||
// Loading status
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL isTextureDefined(U8 te) const;
|
||||
BOOL isTextureVisible(U8 te) const;
|
||||
BOOL isTextureDefined(LLVOAvatarDefines::ETextureIndex type) const;
|
||||
BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type) const;
|
||||
|
||||
protected:
|
||||
BOOL isFullyBaked();
|
||||
@@ -533,8 +545,9 @@ protected:
|
||||
// Local Textures
|
||||
//--------------------------------------------------------------------
|
||||
protected:
|
||||
void setLocalTexture(LLVOAvatarDefines::ETextureIndex i, LLViewerFetchedTexture* tex, BOOL baked_version_exits);
|
||||
void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex i, LLViewerTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
|
||||
virtual void setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits);
|
||||
virtual void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex type, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Layers
|
||||
//--------------------------------------------------------------------
|
||||
@@ -548,6 +561,9 @@ protected:
|
||||
public:
|
||||
virtual void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
|
||||
virtual void invalidateAll();
|
||||
virtual void setCompositeUpdatesEnabled(bool b) {}
|
||||
virtual void setCompositeUpdatesEnabled(U32 index, bool b) {}
|
||||
virtual bool isCompositeUpdateEnabled(U32 index) { return false; }
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Static texture/mesh/baked dictionary
|
||||
@@ -572,71 +588,14 @@ private:
|
||||
|
||||
|
||||
//Most this stuff is Agent only
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Textures and Layers
|
||||
//--------------------------------------------------------------------
|
||||
protected:
|
||||
void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i);
|
||||
|
||||
|
||||
LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const;
|
||||
S32 getLocalDiscardLevel(LLVOAvatarDefines::ETextureIndex index);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Other public functions
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static void dumpTotalLocalTextureByteCount();
|
||||
protected:
|
||||
void getLocalTextureByteCount( S32* gl_byte_count );
|
||||
|
||||
public:
|
||||
void dumpLocalTextures();
|
||||
const LLUUID& grabLocalTexture(LLVOAvatarDefines::ETextureIndex index);
|
||||
BOOL canGrabLocalTexture(LLVOAvatarDefines::ETextureIndex index);
|
||||
|
||||
void setCompositeUpdatesEnabled(BOOL b);
|
||||
|
||||
void setNameFromChat(const std::string &text);
|
||||
void clearNameFromChat();
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// texture compositing (used only by the LLTexLayer series of classes)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL isLocalTextureDataAvailable( const LLTexLayerSet* layerset );
|
||||
BOOL isLocalTextureDataFinal( const LLTexLayerSet* layerset );
|
||||
LLVOAvatarDefines::ETextureIndex getBakedTE( LLTexLayerSet* layerset );
|
||||
void updateComposites();
|
||||
//BOOL getLocalTextureRaw( LLVOAvatarDefines::ETextureIndex index, LLImageRaw* image_raw_pp );
|
||||
BOOL getLocalTextureGL( LLVOAvatarDefines::ETextureIndex index, LLViewerTexture** image_gl_pp );
|
||||
const LLUUID& getLocalTextureID( LLVOAvatarDefines::ETextureIndex index );
|
||||
LLGLuint getScratchTexName( LLGLenum format, U32* texture_bytes );
|
||||
BOOL bindScratchTexture( LLGLenum format );
|
||||
void forceBakeAllTextures(bool slam_for_debug = false);
|
||||
static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
|
||||
void setNewBakedTexture( LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid );
|
||||
void setCachedBakedTexture( LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid );
|
||||
void requestLayerSetUploads();
|
||||
void requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i);
|
||||
bool hasPendingBakedUploads();
|
||||
static void onLocalTextureLoaded( BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata );
|
||||
static void onChangeSelfInvisible(BOOL newvalue);
|
||||
void setInvisible(BOOL newvalue);
|
||||
|
||||
void wearableUpdated(LLWearableType::EType type, BOOL upload_result = TRUE);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// texture compositing
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void setLocTexTE( U8 te, LLViewerTexture* image, BOOL set_by_user );
|
||||
void setupComposites();
|
||||
|
||||
/** Textures
|
||||
** **
|
||||
*******************************************************************************/
|
||||
@@ -683,7 +642,6 @@ public:
|
||||
void processAvatarAppearance(LLMessageSystem* mesgsys);
|
||||
void hideSkirt();
|
||||
void startAppearanceAnimation(BOOL set_by_user, BOOL play_sound);
|
||||
LLPolyMesh* getMesh(LLPolyMeshSharedData* shared_data);
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Appearance morphing
|
||||
@@ -701,12 +659,12 @@ public:
|
||||
typedef std::map<std::string, lod_mesh_map_t> mesh_info_t;
|
||||
|
||||
static void getMeshInfo(mesh_info_t* mesh_info);
|
||||
|
||||
LLPolyMesh* getMesh( LLPolyMeshSharedData *shared_data );
|
||||
//--------------------------------------------------------------------
|
||||
// Clothing colors (convenience functions to access visual parameters)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void setClothesColor( LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL set_by_user );
|
||||
void setClothesColor(LLVOAvatarDefines::ETextureIndex te, const LLColor4& new_color, BOOL upload_bake);
|
||||
LLColor4 getClothesColor(LLVOAvatarDefines::ETextureIndex te);
|
||||
static BOOL teToColorParams( LLVOAvatarDefines::ETextureIndex te, const char* param_name[3] );
|
||||
|
||||
@@ -715,7 +673,7 @@ public:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLColor4 getGlobalColor(const std::string& color_name ) const;
|
||||
void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL set_by_user );
|
||||
void onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL upload_bake);
|
||||
private:
|
||||
LLTexGlobalColor* mTexSkinColor;
|
||||
LLTexGlobalColor* mTexHairColor;
|
||||
@@ -730,13 +688,6 @@ public:
|
||||
U32 getVisibilityRank() const { return mVisibilityRank; } // unused
|
||||
static S32 sNumVisibleAvatars; // Number of instances of this class
|
||||
static LLColor4 getDummyColor();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Customize
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static void onCustomizeStart();
|
||||
static void onCustomizeEnd();
|
||||
/** Appearance
|
||||
** **
|
||||
*******************************************************************************/
|
||||
@@ -747,19 +698,19 @@ public:
|
||||
**/
|
||||
|
||||
public:
|
||||
BOOL isWearingWearableType( LLWearableType::EType type ) const;
|
||||
virtual BOOL isWearingWearableType(LLWearableType::EType type ) const;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Attachments
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void clampAttachmentPositions();
|
||||
BOOL attachObject(LLViewerObject *viewer_object);
|
||||
BOOL detachObject(LLViewerObject *viewer_object);
|
||||
virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object);
|
||||
virtual BOOL detachObject(LLViewerObject *viewer_object);
|
||||
#if MESH_ENABLED
|
||||
void cleanupAttachedMesh( LLViewerObject* pVO );
|
||||
#endif //MESH_ENABLED
|
||||
static LLVOAvatar* findAvatarFromAttachment( LLViewerObject* obj );
|
||||
static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj);
|
||||
protected:
|
||||
// [RLVa:KB] - Checked: 2009-12-18 (RLVa-1.1.0i) | Added: RLVa-1.1.0i
|
||||
LLViewerJointAttachment* getTargetAttachmentPoint(const LLViewerObject* viewer_object) const;
|
||||
@@ -776,7 +727,8 @@ public:
|
||||
S32 getAttachmentCount(); // Warning: order(N) not order(1) // currently used only by -self
|
||||
typedef std::map<S32, LLViewerJointAttachment*> attachment_map_t;
|
||||
attachment_map_t mAttachmentPoints;
|
||||
std::vector<LLPointer<LLViewerObject> > mPendingAttachment;
|
||||
std::vector<LLPointer<LLViewerObject> > mPendingAttachment;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// HUD functions
|
||||
//--------------------------------------------------------------------
|
||||
@@ -789,25 +741,6 @@ public:
|
||||
protected:
|
||||
U32 getNumAttachments() const; // O(N), not O(1)
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Old/nonstandard/Agent-only functions
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static BOOL detachAttachmentIntoInventory(const LLUUID& item_id);
|
||||
BOOL isWearingAttachment( const LLUUID& inv_item_id );
|
||||
// <edit> testzone attachpt
|
||||
BOOL isWearingUnsupportedAttachment( const LLUUID& inv_item_id );
|
||||
// </edit>
|
||||
LLViewerObject* getWornAttachment( const LLUUID& inv_item_id );
|
||||
// [RLVa:KB] - Checked: 2010-03-14 (RLVa-1.2.0a) | Added: RLVa-1.1.0i
|
||||
LLViewerJointAttachment* getWornAttachmentPoint(const LLUUID& inv_item_id) const;
|
||||
// [/RLVa:KB]
|
||||
const std::string getAttachedPointName(const LLUUID& inv_item_id);
|
||||
|
||||
// <edit>
|
||||
std::map<S32, std::pair<LLUUID/*inv*/,LLUUID/*object*/> > mUnsupportedAttachmentPoints;
|
||||
// </edit>
|
||||
|
||||
/** Wearables
|
||||
** **
|
||||
*******************************************************************************/
|
||||
@@ -1073,7 +1006,6 @@ private:
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static void dumpArchetypeXML(void*);
|
||||
static void dumpScratchTextureByteCount(); //Agent only
|
||||
static void dumpBakedStatus();
|
||||
const std::string getBakedStatusForPrintout() const;
|
||||
void dumpAvatarTEs(const std::string& context) const;
|
||||
@@ -1086,7 +1018,6 @@ protected:
|
||||
S32 getUnbakedPixelAreaRank();
|
||||
BOOL mHasGrey;
|
||||
private:
|
||||
LLUUID mSavedTE[ LLVOAvatarDefines::TEX_NUM_INDICES ];
|
||||
BOOL mHasBakedHair;
|
||||
F32 mMinPixelArea;
|
||||
F32 mMaxPixelArea;
|
||||
@@ -1248,15 +1179,15 @@ private:
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// Inlines
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
inline BOOL LLVOAvatar::isTextureDefined(U8 te) const
|
||||
inline BOOL LLVOAvatar::isTextureDefined(LLVOAvatarDefines::ETextureIndex type) const
|
||||
{
|
||||
return (getTEImage(te)->getID() != IMG_DEFAULT_AVATAR && getTEImage(te)->getID() != IMG_DEFAULT);
|
||||
return (getTEImage(type)->getID() != IMG_DEFAULT_AVATAR && getTEImage(type)->getID() != IMG_DEFAULT);
|
||||
}
|
||||
|
||||
inline BOOL LLVOAvatar::isTextureVisible(U8 te) const
|
||||
inline BOOL LLVOAvatar::isTextureVisible(LLVOAvatarDefines::ETextureIndex type) const
|
||||
{
|
||||
return ((isTextureDefined(te) || isSelf())
|
||||
&& (getTEImage(te)->getID() != IMG_INVISIBLE
|
||||
return ((isTextureDefined(type) || isSelf())
|
||||
&& (getTEImage(type)->getID() != IMG_INVISIBLE
|
||||
|| LLDrawPoolAlpha::sShowDebugAlpha));
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -83,6 +83,7 @@ public:
|
||||
|
||||
void resetJointPositions( void );
|
||||
|
||||
/*virtual*/ void updateVisualParams();
|
||||
|
||||
|
||||
/** Initialization
|
||||
@@ -104,6 +105,11 @@ public:
|
||||
/*virtual*/ BOOL updateCharacter(LLAgent &agent);
|
||||
/*virtual*/ void idleUpdateTractorBeam();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Loading state
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/ BOOL getIsCloud();
|
||||
|
||||
|
||||
private:
|
||||
@@ -129,12 +135,102 @@ private:
|
||||
LLPointer<LLHUDEffectSpiral> mBeam;
|
||||
LLFrameTimer mBeamTimer;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// LLVOAvatar Constants
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/ LLViewerTexture::EBoostLevel getAvatarBoostLevel() const { return LLViewerTexture::BOOST_AVATAR_SELF; }
|
||||
/*virtual*/ LLViewerTexture::EBoostLevel getAvatarBakedBoostLevel() const { return LLViewerTexture::BOOST_AVATAR_BAKED_SELF; }
|
||||
/*virtual*/ S32 getTexImageSize() const { return LLVOAvatar::getTexImageSize()*4; }
|
||||
|
||||
/** Rendering
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** TEXTURES
|
||||
**/
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Loading status
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/*virtual*/ bool hasPendingBakedUploads() const;
|
||||
S32 getLocalDiscardLevel(LLVOAvatarDefines::ETextureIndex type) const;
|
||||
bool areTexturesCurrent() const;
|
||||
BOOL isLocalTextureDataAvailable(const LLTexLayerSet* layerset) const;
|
||||
BOOL isLocalTextureDataFinal(const LLTexLayerSet* layerset) const;
|
||||
//--------------------------------------------------------------------
|
||||
// Local Textures
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL getLocalTextureGL(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture** image_gl_pp) const;
|
||||
const LLUUID& getLocalTextureID(LLVOAvatarDefines::ETextureIndex type) const;
|
||||
void setLocalTextureTE( U8 te, LLViewerTexture* image, BOOL set_by_user );
|
||||
void setLocalTexture( LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits );
|
||||
protected:
|
||||
void localTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
|
||||
void getLocalTextureByteCount(S32* gl_byte_count) const;
|
||||
/*virtual*/ void addLocalTextureStats(LLVOAvatarDefines::ETextureIndex i, LLViewerFetchedTexture* imagep, F32 texel_area_ratio, BOOL rendered, BOOL covered_by_baked);
|
||||
private:
|
||||
static void onLocalTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
|
||||
//--------------------------------------------------------------------
|
||||
// Baked textures
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLVOAvatarDefines::ETextureIndex getBakedTE(const LLTexLayerSet* layerset ) const;
|
||||
void setNewBakedTexture(LLVOAvatarDefines::EBakedTextureIndex i, const LLUUID &uuid);
|
||||
void setNewBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid);
|
||||
void setCachedBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid);
|
||||
void forceBakeAllTextures(bool slam_for_debug = false);
|
||||
static void processRebakeAvatarTextures(LLMessageSystem* msg, void**);
|
||||
BOOL isUsingBakedTextures() const; // e.g. false if in appearance edit mode
|
||||
protected:
|
||||
/*virtual*/ void removeMissingBakedTextures();
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Layers
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void requestLayerSetUploads();
|
||||
void requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i);
|
||||
void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i);
|
||||
LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Composites
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
/* virtual */ void invalidateComposite(LLTexLayerSet* layerset, BOOL upload_result);
|
||||
/* virtual */ void invalidateAll();
|
||||
/* virtual */ void setCompositeUpdatesEnabled(bool b); // only works for self
|
||||
/* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b);
|
||||
/* virtual */ bool isCompositeUpdateEnabled(U32 index);
|
||||
void setupComposites();
|
||||
void updateComposites();
|
||||
|
||||
const LLUUID& grabBakedTexture(LLVOAvatarDefines::EBakedTextureIndex baked_index) const;
|
||||
BOOL canGrabBakedTexture(LLVOAvatarDefines::EBakedTextureIndex baked_index) const;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Scratch textures (used for compositing)
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL bindScratchTexture(LLGLenum format);
|
||||
static void deleteScratchTextures();
|
||||
protected:
|
||||
LLGLuint getScratchTexName(LLGLenum format, S32& components, U32* texture_bytes);
|
||||
private:
|
||||
static S32 sScratchTexBytes;
|
||||
static LLMap< LLGLenum, LLGLuint*> sScratchTexNames;
|
||||
static LLMap< LLGLenum, F32*> sScratchTexLastBindTime;
|
||||
|
||||
/** Textures
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** MESHES
|
||||
@@ -146,15 +242,74 @@ protected:
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** WEARABLES
|
||||
**/
|
||||
|
||||
public:
|
||||
/*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type) const;
|
||||
void wearableUpdated(LLWearableType::EType type, BOOL upload_result);
|
||||
protected:
|
||||
U32 getNumWearables(LLVOAvatarDefines::ETextureIndex i) const;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// HUDs
|
||||
// Attachments
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
void updateAttachmentVisibility(U32 camera_mode);
|
||||
BOOL isWearingAttachment(const LLUUID& inv_item_id) const;
|
||||
LLViewerObject* getWornAttachment(const LLUUID& inv_item_id);
|
||||
const std::string getAttachedPointName(const LLUUID& inv_item_id) const;
|
||||
/*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object);
|
||||
/*virtual*/ BOOL detachObject(LLViewerObject *viewer_object);
|
||||
static BOOL detachAttachmentIntoInventory(const LLUUID& item_id);
|
||||
// <edit> testzone attachpt
|
||||
BOOL isWearingUnsupportedAttachment( const LLUUID& inv_item_id );
|
||||
std::map<S32, std::pair<LLUUID/*inv*/,LLUUID/*object*/> > mUnsupportedAttachmentPoints;
|
||||
// [RLVa:KB] - Checked: 2010-03-14 (RLVa-1.2.0a) | Added: RLVa-1.1.0i
|
||||
LLViewerJointAttachment* getWornAttachmentPoint(const LLUUID& inv_item_id) const;
|
||||
// [/RLVa:KB]
|
||||
private:
|
||||
|
||||
LLViewerJoint* mScreenp; // special purpose joint for HUD attachments
|
||||
|
||||
/** Attachments
|
||||
** **
|
||||
*******************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
** **
|
||||
** APPEARANCE
|
||||
**/
|
||||
|
||||
public:
|
||||
static void onCustomizeStart();
|
||||
static void onCustomizeEnd();
|
||||
|
||||
|
||||
/** Appearance
|
||||
** **
|
||||
*******************************************************************************/
|
||||
// General
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
static void dumpTotalLocalTextureByteCount();
|
||||
void dumpLocalTextures() const;
|
||||
static void dumpScratchTextureByteCount();
|
||||
public:
|
||||
struct LLAvatarTexData
|
||||
{
|
||||
LLAvatarTexData(const LLUUID& id, LLVOAvatarDefines::ETextureIndex index) :
|
||||
mAvatarID(id),
|
||||
mIndex(index)
|
||||
{}
|
||||
LLUUID mAvatarID;
|
||||
LLVOAvatarDefines::ETextureIndex mIndex;
|
||||
};
|
||||
//Spechul schtuff.
|
||||
static void onChangeSelfInvisible(BOOL newvalue);
|
||||
void setInvisible(BOOL newvalue);
|
||||
};
|
||||
|
||||
extern LLVOAvatarSelf *gAgentAvatarp;
|
||||
|
||||
@@ -650,7 +650,7 @@ void LLWearable::writeToAvatar( BOOL set_by_user )
|
||||
{
|
||||
const LLUUID& image_id = get_if_there(mTEMap, te, LLVOAvatarDictionary::getDefaultTextureImageID((ETextureIndex) te ) );
|
||||
LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture( image_id );
|
||||
gAgentAvatarp->setLocTexTE( te, image, set_by_user );
|
||||
gAgentAvatarp->setLocalTextureTE( te, image, set_by_user );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ void LLWearable::removeFromAvatar( LLWearableType::EType type, BOOL upload_bake
|
||||
{
|
||||
if( LLVOAvatarDictionary::getTEWearableType((ETextureIndex) te ) == type )
|
||||
{
|
||||
gAgentAvatarp->setLocTexTE( te, image, upload_bake );
|
||||
gAgentAvatarp->setLocalTextureTE( te, image, upload_bake );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1502,7 +1502,7 @@ ERlvCmdRet RlvHandler::processForceCommand(const RlvCommand& rlvCmd) const
|
||||
const LLViewerObject* pAttachObj = gObjectList.findObject(rlvCmd.getObjectID());
|
||||
if ( (pAttachObj) && (pAttachObj->isAttachment()) )
|
||||
{
|
||||
LLVOAvatar::detachAttachmentIntoInventory(pAttachObj->getAttachmentItemID());
|
||||
LLVOAvatarSelf::detachAttachmentIntoInventory(pAttachObj->getAttachmentItemID());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -355,8 +355,7 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
|
||||
LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded");
|
||||
return;
|
||||
}
|
||||
LLVOAvatar* pAvatar = gAgentAvatarp;
|
||||
if (!pAvatar)
|
||||
if (!isAgentAvatarValid())
|
||||
return;
|
||||
|
||||
// Grab a list of all the items we'll be wearing/attaching
|
||||
@@ -439,7 +438,7 @@ void RlvForceWear::forceFolder(const LLViewerInventoryCategory* pFolder, EWearAc
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLViewerObject* pAttachObj = pAvatar->getWornAttachment(pItem->getUUID());
|
||||
const LLViewerObject* pAttachObj = gAgentAvatarp->getWornAttachment(pItem->getUUID());
|
||||
if ( (pAttachObj) && (isForceDetachable(pAttachObj, false)) )
|
||||
remAttachment(pAttachObj);
|
||||
}
|
||||
|
||||
@@ -364,9 +364,14 @@ void RlvRenameOnWearObserver::done()
|
||||
// Checked: 2010-03-14 (RLVa-1.1.3a) | Added: RLVa-1.2.0a
|
||||
void RlvRenameOnWearObserver::doneIdle()
|
||||
{
|
||||
const LLViewerInventoryCategory* pRlvRoot = NULL; LLVOAvatar* pAvatar = gAgentAvatarp;
|
||||
const LLViewerInventoryCategory* pRlvRoot = NULL;
|
||||
if(!isAgentAvatarValid())
|
||||
{
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
if ( (RlvSettings::getEnableSharedWear()) || (!RlvSettings::getSharedInvAutoRename()) || (LLStartUp::getStartupState() < STATE_STARTED) ||
|
||||
(!pAvatar) || ((pRlvRoot = RlvInventory::instance().getSharedRoot()) == NULL) )
|
||||
((pRlvRoot = RlvInventory::instance().getSharedRoot()) == NULL) )
|
||||
{
|
||||
delete this;
|
||||
return;
|
||||
@@ -387,7 +392,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
||||
if (items.empty())
|
||||
continue;
|
||||
|
||||
if ( ((pAttachPt = pAvatar->getWornAttachmentPoint(idAttachItem)) == NULL) ||
|
||||
if ( ((pAttachPt = gAgentAvatarp->getWornAttachmentPoint(idAttachItem)) == NULL) ||
|
||||
((idxAttachPt = RlvAttachPtLookup::getAttachPointIndex(pAttachPt)) == 0) )
|
||||
{
|
||||
// RLV_ASSERT(false);
|
||||
|
||||
Reference in New Issue
Block a user