diff options
Diffstat (limited to 'linden/indra/newview/llviewerobject.cpp')
-rw-r--r-- | linden/indra/newview/llviewerobject.cpp | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 102b135..51908a5 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -989,7 +990,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
989 | if (!mText) | 990 | if (!mText) |
990 | { | 991 | { |
991 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); | 992 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); |
992 | mText->setFont(LLFontGL::sSansSerif); | 993 | mText->setFont(LLFontGL::getFontSansSerif()); |
993 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); | 994 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); |
994 | mText->setMaxLines(-1); | 995 | mText->setMaxLines(-1); |
995 | mText->setSourceObject(this); | 996 | mText->setSourceObject(this); |
@@ -1410,10 +1411,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1410 | } | 1411 | } |
1411 | 1412 | ||
1412 | // Setup object text | 1413 | // Setup object text |
1413 | if (!mText) | 1414 | if (!mText && (value & 0x4)) |
1414 | { | 1415 | { |
1415 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); | 1416 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); |
1416 | mText->setFont(LLFontGL::sSansSerif); | 1417 | mText->setFont(LLFontGL::getFontSansSerif()); |
1417 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); | 1418 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); |
1418 | mText->setMaxLines(-1); // Set to match current agni behavior. | 1419 | mText->setMaxLines(-1); // Set to match current agni behavior. |
1419 | mText->setSourceObject(this); | 1420 | mText->setSourceObject(this); |
@@ -1438,7 +1439,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1438 | 1439 | ||
1439 | setChanged(TEXTURE); | 1440 | setChanged(TEXTURE); |
1440 | } | 1441 | } |
1441 | else | 1442 | else if(mText.notNull()) |
1442 | { | 1443 | { |
1443 | mText->markDead(); | 1444 | mText->markDead(); |
1444 | mText = NULL; | 1445 | mText = NULL; |
@@ -1899,7 +1900,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1899 | 1900 | ||
1900 | if ( gShowObjectUpdates ) | 1901 | if ( gShowObjectUpdates ) |
1901 | { | 1902 | { |
1902 | if (!((mPrimitiveCode == LL_PCODE_LEGACY_AVATAR) && (((LLVOAvatar *) this)->mIsSelf)) | 1903 | if (!((mPrimitiveCode == LL_PCODE_LEGACY_AVATAR) && (((LLVOAvatar *) this)->isSelf())) |
1903 | && mRegionp) | 1904 | && mRegionp) |
1904 | { | 1905 | { |
1905 | LLViewerObject* object = gObjectList.createObjectViewer(LL_PCODE_LEGACY_TEXT_BUBBLE, mRegionp); | 1906 | LLViewerObject* object = gObjectList.createObjectViewer(LL_PCODE_LEGACY_TEXT_BUBBLE, mRegionp); |
@@ -2452,7 +2453,11 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data) | |||
2452 | msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum); | 2453 | msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum); |
2453 | LLFilenameAndTask* ft = new LLFilenameAndTask; | 2454 | LLFilenameAndTask* ft = new LLFilenameAndTask; |
2454 | ft->mTaskID = task_id; | 2455 | ft->mTaskID = task_id; |
2455 | msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, ft->mFilename); | 2456 | |
2457 | std::string unclean_filename; | ||
2458 | msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, unclean_filename); | ||
2459 | ft->mFilename = LLDir::getScrubbedFileName(unclean_filename); | ||
2460 | |||
2456 | if(ft->mFilename.empty()) | 2461 | if(ft->mFilename.empty()) |
2457 | { | 2462 | { |
2458 | lldebugs << "Task has no inventory" << llendl; | 2463 | lldebugs << "Task has no inventory" << llendl; |
@@ -2755,7 +2760,7 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) | |||
2755 | F32 mid_scale = getMidScale(); | 2760 | F32 mid_scale = getMidScale(); |
2756 | F32 min_scale = getMinScale(); | 2761 | F32 min_scale = getMinScale(); |
2757 | 2762 | ||
2758 | // IW: esitmate - when close to large objects, computing range based on distance from center is no good | 2763 | // IW: estimate - when close to large objects, computing range based on distance from center is no good |
2759 | // to try to get a min distance from face, subtract min_scale/2 from the range. | 2764 | // to try to get a min distance from face, subtract min_scale/2 from the range. |
2760 | // This means we'll load too much detail sometimes, but that's better than not enough | 2765 | // This means we'll load too much detail sometimes, but that's better than not enough |
2761 | // I don't think there's a better way to do this without calculating distance per-poly | 2766 | // I don't think there's a better way to do this without calculating distance per-poly |
@@ -3740,11 +3745,10 @@ S32 LLViewerObject::setTEColor(const U8 te, const LLColor4& color) | |||
3740 | else if (color != tep->getColor()) | 3745 | else if (color != tep->getColor()) |
3741 | { | 3746 | { |
3742 | retval = LLPrimitive::setTEColor(te, color); | 3747 | retval = LLPrimitive::setTEColor(te, color); |
3743 | setChanged(TEXTURE); | ||
3744 | if (mDrawable.notNull() && retval) | 3748 | if (mDrawable.notNull() && retval) |
3745 | { | 3749 | { |
3746 | // These should only happen on updates which are not the initial update. | 3750 | // These should only happen on updates which are not the initial update. |
3747 | gPipeline.markTextured(mDrawable); | 3751 | dirtyMesh(); |
3748 | } | 3752 | } |
3749 | } | 3753 | } |
3750 | return retval; | 3754 | return retval; |
@@ -3787,6 +3791,22 @@ S32 LLViewerObject::setTETexGen(const U8 te, const U8 texgen) | |||
3787 | return retval; | 3791 | return retval; |
3788 | } | 3792 | } |
3789 | 3793 | ||
3794 | S32 LLViewerObject::setTEMediaTexGen(const U8 te, const U8 media) | ||
3795 | { | ||
3796 | S32 retval = 0; | ||
3797 | const LLTextureEntry *tep = getTE(te); | ||
3798 | if (!tep) | ||
3799 | { | ||
3800 | llwarns << "No texture entry for te " << (S32)te << ", object " << mID << llendl; | ||
3801 | } | ||
3802 | else if (media != tep->getMediaTexGen()) | ||
3803 | { | ||
3804 | retval = LLPrimitive::setTEMediaTexGen(te, media); | ||
3805 | setChanged(TEXTURE); | ||
3806 | } | ||
3807 | return retval; | ||
3808 | } | ||
3809 | |||
3790 | S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny) | 3810 | S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny) |
3791 | { | 3811 | { |
3792 | S32 retval = 0; | 3812 | S32 retval = 0; |
@@ -4067,7 +4087,7 @@ void LLViewerObject::setDebugText(const std::string &utf8text) | |||
4067 | if (!mText) | 4087 | if (!mText) |
4068 | { | 4088 | { |
4069 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); | 4089 | mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); |
4070 | mText->setFont(LLFontGL::sSansSerif); | 4090 | mText->setFont(LLFontGL::getFontSansSerif()); |
4071 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); | 4091 | mText->setVertAlignment(LLHUDText::ALIGN_VERT_TOP); |
4072 | mText->setMaxLines(-1); | 4092 | mText->setMaxLines(-1); |
4073 | mText->setSourceObject(this); | 4093 | mText->setSourceObject(this); |
@@ -4379,8 +4399,13 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow | |||
4379 | { | 4399 | { |
4380 | mAudioSourcep->play(LLUUID::null); | 4400 | mAudioSourcep->play(LLUUID::null); |
4381 | } | 4401 | } |
4382 | //llinfos << "Playing attached sound " << audio_uuid << llendl; | 4402 | |
4383 | mAudioSourcep->play(audio_uuid); | 4403 | // Play this sound if region maturity permits |
4404 | if( gAgent.canAccessMaturityAtGlobal(this->getPositionGlobal()) ) | ||
4405 | { | ||
4406 | //llinfos << "Playing attached sound " << audio_uuid << llendl; | ||
4407 | mAudioSourcep->play(audio_uuid); | ||
4408 | } | ||
4384 | } | 4409 | } |
4385 | } | 4410 | } |
4386 | 4411 | ||