diff --git a/.hgtags b/.hgtags index cd0c4c5af0..45ce8e01c5 100755 --- a/.hgtags +++ b/.hgtags @@ -561,3 +561,4 @@ b41e1e7c7876f7656c505f552b5888b4e478f92b 5.0.0-release c9ce2295012995e3cf5c57bcffcb4870b94c649f 5.0.1-release cea1632c002c065985ebea15eeeb4aac90f50545 5.0.2-release 02c24e9f4f7d8aa0de75f27817dda098582f4936 5.0.3-release +022709ef76a331cac1ba6ef1a6da8a5e9ef63f5a 5.0.4-release diff --git a/README_BUILD_FIRESTORM_WIN64.txt b/README_BUILD_FIRESTORM_WIN64.txt index aa44b24907..923a869cb2 100755 --- a/README_BUILD_FIRESTORM_WIN64.txt +++ b/README_BUILD_FIRESTORM_WIN64.txt @@ -11,11 +11,7 @@ Make sure you're not building from a Visual Studio command prompt, or parts of t chain might accidentally pick up a 32 bit compiler, resulting in x86<>x64 mismatch. Configure/build is nearly the same as building a 32 bit version. -autobuild -m64 configure -c ReleaseFS -- --chan --package -DFS_UPGRADECODES=',' +autobuild -m64 configure -c ReleaseFS -- --chan --package autobuild -m64 build -c ReleaseFS --no-configure The resulting installer/exe gets created in build-vc120_x64/newview/Release - -GUIDs for the installer can be generated by either GuidGen, or a service like https://www.guidgenerator.com/ -make sure MSI_UPGRADE_CODE and EXE_UPGRADE_CODE are different. - diff --git a/autobuild.xml b/autobuild.xml index 8f48a6c18d..c49a9786b3 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1275,11 +1275,11 @@ archive hash - c79d090128279a73822ad894cb3448f6 + 94fc457c46e1fb94b31251bd4747d10f hash_algorithm md5 url - http://downloads.phoenixviewer.com/glod-1.0pre4.201505182056-r82-darwin-201505182056-r82.tar.bz2 + http://downloads.phoenixviewer.com/glod-1.0pre3.171101143-darwin64-171101143.tar.bz2 name darwin @@ -1289,9 +1289,11 @@ archive hash - 017ef34ddf14293099a90c6eaa3615ca + f62e7cff14feb646babaa19b7ea14ed3 + hash_algorithm + md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1626/3627/glod-1.0pre3.501614-darwin64-501614.tar.bz2 + http://downloads.phoenixviewer.com/glod-1.0pre3.201704302344-linux-201704302344.tar.bz2 name darwin64 @@ -1301,11 +1303,11 @@ archive hash - 58113bcbbacbaeb2d278f745867ae6f0 + e3659aa7b670a8fbdfb1b820254abb44 hash_algorithm md5 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-glod/rev/314201/arch/Linux/installer/glod-1.0pre4.314201-linux-314201.tar.bz2 + http://downloads.phoenixviewer.com/glod-1.0pre3.201703081158-windows-201703081158.tar.bz2 name linux @@ -1315,9 +1317,9 @@ archive hash - 30a8b171ddc22acdc01488a4611b8abf + fea16abf8c2b7f38fc33a2142bfbfe18 url - http://downloads.phoenixviewer.com/glod-1.0pre4.201505150221-r81-linux-x64-201505150221-r81.tar.bz2 + http://downloads.phoenixviewer.com/glod-1.0pre3.201704302331-linux64-201704302331.tar.bz2 name linux64 diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index c5218e1e60..441b72b8ba 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1577,7 +1577,16 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } alpha_data = new U8[width * height]; mAlphaCache[cache_index] = alpha_data; - glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); + // Format GL_ALPHA is invalid for glReadPixels + //glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); + U8* alpha_buffer = new U8[width * height * 4]; + glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, alpha_buffer); + for (S32 i = 0; i < width * height; ++i) + { + alpha_data[i] = alpha_buffer[i * 4 + 3]; + } + delete[] alpha_buffer; + // } getTexLayerSet()->getAvatarAppearance()->dirtyMesh(); diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 77d7200fad..47f5b7d693 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -841,6 +841,28 @@ void LLAvatarNameCache::insert(const LLUUID& agent_id, const LLAvatarName& av_na sCache[agent_id] = av_name; } +LLUUID LLAvatarNameCache::findIdByName(const std::string& name) +{ + std::map::iterator it; + std::map::iterator end = sCache.end(); + for (it = sCache.begin(); it != end; ++it) + { + if (it->second.getUserName() == name) + { + return it->first; + } + } + + // Legacy method + LLUUID id; + if (gCacheName->getUUID(name, id)) + { + return id; + } + + return LLUUID::null; +} + #if 0 F64 LLAvatarNameCache::nameExpirationFromHeaders(LLCore::HttpHeaders *headers) { diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index a37f86c04d..304c2cd7ea 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -90,7 +90,15 @@ namespace LLAvatarNameCache void erase(const LLUUID& agent_id); - /// Provide some fallback for agents that return errors. + // A way to find agent id by UUID, very slow, also unreliable + // since it doesn't request names, just serch exsisting ones + // that are likely not in cache. + // + // Todo: Find a way to remove this. + // Curently this method is used for chat history and in some cases notices. + LLUUID findIdByName(const std::string& name); + + /// Provide some fallback for agents that return errors. void handleAgentError(const LLUUID& agent_id); // Force a re-fetch of the most recent data, but keep the current diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index dc5672e043..7b2d9f60eb 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -546,18 +546,34 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const } LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Fetch Associated", - boost::bind(&LLExperienceCache::fetchAssociatedExperienceCoro, this, _1, objectId, itemId, fn)); + boost::bind(&LLExperienceCache::fetchAssociatedExperienceCoro, this, _1, objectId, itemId, std::string(), fn)); } -void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID objectId, LLUUID itemId, ExperienceGetFn_t fn) +void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn) +{ + if (mCapability.empty()) + { + LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; + return; + } + + LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Fetch Associated", + boost::bind(&LLExperienceCache::fetchAssociatedExperienceCoro, this, _1, objectId, itemId, url, fn)); +} + +void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID objectId, LLUUID itemId, std::string url, ExperienceGetFn_t fn) { LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); - std::string url = mCapability("GetMetadata"); if (url.empty()) { - LL_WARNS("ExperienceCache") << "No Metadata capability." << LL_ENDL; - return; + url = mCapability("GetMetadata"); + + if (url.empty()) + { + LL_WARNS("ExperienceCache") << "No Metadata capability." << LL_ENDL; + return; + } } LLSD fields; diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 8ee7080d38..f9ff69c2b6 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -64,6 +64,7 @@ public: //------------------------------------------- void fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, ExperienceGetFn_t fn); + void fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn); void findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn); void getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn); @@ -148,7 +149,7 @@ private: void requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, std::string, RequestQueue_t); void requestExperiences(); - void fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLUUID, LLUUID, ExperienceGetFn_t); + void fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLUUID, LLUUID, std::string, ExperienceGetFn_t); void findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, std::string, int, ExperienceGetFn_t); void getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLUUID , ExperienceGetFn_t); void regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, CapabilityQuery_t regioncaps, bool update, LLSD experiences, ExperienceGetFn_t fn); diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index e6a09a8a3b..9b70e3b9e2 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -618,6 +618,7 @@ char const* const _PREHASH_GroupAccountSummaryRequest = LLMessageStringTable::ge char const* const _PREHASH_GroupVoteHistoryRequest = LLMessageStringTable::getInstance()->getString("GroupVoteHistoryRequest"); char const* const _PREHASH_ParamValue = LLMessageStringTable::getInstance()->getString("ParamValue"); char const* const _PREHASH_MaxAgents = LLMessageStringTable::getInstance()->getString("MaxAgents"); +char const* const _PREHASH_HardMaxAgents = LLMessageStringTable::getInstance()->getString("HardMaxAgents"); char const* const _PREHASH_CreateNewOutfitAttachments = LLMessageStringTable::getInstance()->getString("CreateNewOutfitAttachments"); char const* const _PREHASH_RegionHandle = LLMessageStringTable::getInstance()->getString("RegionHandle"); char const* const _PREHASH_TeleportProgress = LLMessageStringTable::getInstance()->getString("TeleportProgress"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 4d85bca3d4..0b7b38d47d 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -618,6 +618,7 @@ extern char const* const _PREHASH_GroupAccountSummaryRequest; extern char const* const _PREHASH_GroupVoteHistoryRequest; extern char const* const _PREHASH_ParamValue; extern char const* const _PREHASH_MaxAgents; +extern char const* const _PREHASH_HardMaxAgents; extern char const* const _PREHASH_CreateNewOutfitAttachments; extern char const* const _PREHASH_RegionHandle; extern char const* const _PREHASH_TeleportProgress; diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index a7a41842e2..6bebb1ca40 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -180,10 +180,7 @@ LLPrimitive::~LLPrimitive() { clearTextureList(); // Cleanup handled by volume manager - - // During shutdown sVolumeManager can be 0 - // if (mVolumep) - if ( mVolumep && sVolumeManager ) + if (mVolumep && sVolumeManager) { sVolumeManager->unrefVolume(mVolumep); } diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 4f4d8e89f3..0d6cf90c33 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -257,9 +257,14 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons const LLFontGlyphInfo* next_glyph = NULL; const S32 GLYPH_BATCH_SIZE = 30; - LLVector3 vertices[GLYPH_BATCH_SIZE * 4]; - LLVector2 uvs[GLYPH_BATCH_SIZE * 4]; - LLColor4U colors[GLYPH_BATCH_SIZE * 4]; + // Remove QUADS rendering mode + //LLVector3 vertices[GLYPH_BATCH_SIZE * 4]; + //LLVector2 uvs[GLYPH_BATCH_SIZE * 4]; + //LLColor4U colors[GLYPH_BATCH_SIZE * 4]; + LLVector3 vertices[GLYPH_BATCH_SIZE * 6]; + LLVector2 uvs[GLYPH_BATCH_SIZE * 6]; + LLColor4U colors[GLYPH_BATCH_SIZE * 6]; + // LLColor4U text_color(color); @@ -288,11 +293,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // otherwise the queued glyphs will be taken from wrong textures. if (glyph_count > 0) { - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { - gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 6); } gGL.end(); + // glyph_count = 0; } @@ -321,11 +333,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (glyph_count >= GLYPH_BATCH_SIZE) { - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { - gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 6); } gGL.end(); + // glyph_count = 0; } @@ -355,11 +374,18 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons cur_render_y = cur_y; } - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { - gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 4); + gGL.vertexBatchPreTransformed(vertices, uvs, colors, glyph_count * 6); } gGL.end(); + // if (right_x) @@ -1184,7 +1210,31 @@ LLFontGL &LLFontGL::operator=(const LLFontGL &source) return *this; } -void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const +// Remove QUADS rendering mode +//void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const +//{ +// S32 index = 0; +// +// vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mTop, 0.f); +// uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); +// colors_out[index] = color; +// index++; +// +// vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 0.f); +// uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop); +// colors_out[index] = color; +// index++; +// +// vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 0.f); +// uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom); +// colors_out[index] = color; +// index++; +// +// vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 0.f); +// uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom); +// colors_out[index] = color; +//} +void LLFontGL::renderTriangle(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const { S32 index = 0; @@ -1203,10 +1253,22 @@ void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* c colors_out[index] = color; index++; + + vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mTop, 0.f); + uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); + colors_out[index] = color; + index++; + + vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 0.f); + uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom); + colors_out[index] = color; + index++; + vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 0.f); uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom); colors_out[index] = color; } +// void LLFontGL::drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, U8 style, ShadowType shadow, F32 drop_shadow_strength) const { @@ -1222,7 +1284,10 @@ void LLFontGL::drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_ LLRectf screen_rect_offset = screen_rect; screen_rect_offset.translate((F32)(pass * BOLD_OFFSET), 0.f); - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, color, slant_offset); + // Remove QUADS rendering mode + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect_offset, uv_rect, color, slant_offset); + // glyph_count++; } } @@ -1253,10 +1318,16 @@ void LLFontGL::drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_ break; } - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, shadow_color, slant_offset); + // Remove QUADS rendering mode + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_offset, uv_rect, shadow_color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect_offset, uv_rect, shadow_color, slant_offset); + // glyph_count++; } - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + // Remove QUADS rendering mode + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect, uv_rect, color, slant_offset); + // glyph_count++; } else if (shadow == DROP_SHADOW) @@ -1265,14 +1336,22 @@ void LLFontGL::drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_ shadow_color.mV[VALPHA] = U8(color.mV[VALPHA] * drop_shadow_strength); LLRectf screen_rect_shadow = screen_rect; screen_rect_shadow.translate(1.f, -1.f); - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_shadow, uv_rect, shadow_color, slant_offset); + // Remove QUADS rendering mode + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect_shadow, uv_rect, shadow_color, slant_offset); + //glyph_count++; + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect_shadow, uv_rect, shadow_color, slant_offset); glyph_count++; - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect, uv_rect, color, slant_offset); + // glyph_count++; } else // normal rendering { - renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + // Remove QUADS rendering mode + //renderQuad(&vertex_out[glyph_count * 4], &uv_out[glyph_count * 4], &colors_out[glyph_count * 4], screen_rect, uv_rect, color, slant_offset); + renderTriangle(&vertex_out[glyph_count * 6], &uv_out[glyph_count * 6], &colors_out[glyph_count * 6], screen_rect, uv_rect, color, slant_offset); + // glyph_count++; } } diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index a10e0d64e9..25034acf9e 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -225,7 +225,10 @@ private: LLFontDescriptor mFontDescriptor; LLPointer mFontFreetype; - void renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const; + // Remove QUADS rendering mode + //void renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const; + void renderTriangle(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, F32 slant_amt) const; + // void drawGlyph(S32& glyph_count, LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* colors_out, const LLRectf& screen_rect, const LLRectf& uv_rect, const LLColor4U& color, U8 style, ShadowType shadow, F32 drop_shadow_fade) const; // Registry holds all instantiated fonts. diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 9aa4de2a9b..1a3e139a50 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -988,8 +988,10 @@ void LLGLManager::initExtensions() mHasSync = ExtensionExists("GL_ARB_sync", gGLHExts.mSysExts); mHasMapBufferRange = ExtensionExists("GL_ARB_map_buffer_range", gGLHExts.mSysExts); mHasFlushBufferRange = ExtensionExists("GL_APPLE_flush_buffer_range", gGLHExts.mSysExts); - //mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts); - mHasDepthClamp = FALSE; + // Fix void and region water flickr by Drake Arconis (Alchemy viewer) + mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts); + //mHasDepthClamp = FALSE; + // // mask out FBO support when packed_depth_stencil isn't there 'cause we need it for LLRenderTarget -Brad #ifdef GL_ARB_framebuffer_object mHasFramebufferObject = ExtensionExists("GL_ARB_framebuffer_object", gGLHExts.mSysExts); diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index 722dd9050b..c3f65df7ef 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -813,6 +813,12 @@ extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB; // Note that they also must not be called on 10.3.9. This should be taken care of by a runtime check for the existence of the GL extension. #include +// Workaround to get a OSX version to compile (until someone with a Mac makes including gl3.h work) +#ifndef GL_TEXTURE_RECTANGLE + #define GL_TEXTURE_RECTANGLE GL_TEXTURE_RECTANGLE_ARB +#endif +// + //GL_EXT_blend_func_separate extern void glBlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) ; diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index b50d76eb07..d3e85fbfa2 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -352,6 +352,11 @@ void LLGLSLShader::unloadInternal() for (GLsizei i = 0; i < count; i++) { glDetachObjectARB(mProgramObject, obj[i]); +// OpenGL error: glDeleteObjectARB - GL_INVALID_VALUE +#if !LL_DARWIN + if (glIsProgramARB(obj[i])) +#endif +// glDeleteObjectARB(obj[i]); } diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index b6ea5aa7f1..f2f7dfca67 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -391,7 +391,10 @@ void LLPostProcess::doEffects(void) void LLPostProcess::copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height) { gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture); - glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0); + // Replace GL_TEXTURE_RECTANGLE_ARB with GL_TEXTURE_RECTANGLE + //glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0); + glCopyTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, 0, 0, width, height, 0); + // } void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadType type) @@ -503,7 +506,10 @@ void LLPostProcess::createTexture(LLPointer& texture, unsigned int wi if(texture->createGLTexture()) { gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture->getTexName()); - glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0, + // Replace GL_TEXTURE_RECTANGLE_ARB with GL_TEXTURE_RECTANGLE + //glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0, + glTexImage2D(GL_TEXTURE_RECTANGLE, 0, 4, width, height, 0, + // GL_RGBA, GL_UNSIGNED_BYTE, &data[0]); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR); gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 3aafa8e0b8..1f72150905 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -56,7 +56,10 @@ static const U32 LL_NUM_LIGHT_UNITS = 8; static const GLenum sGLTextureType[] = { GL_TEXTURE_2D, - GL_TEXTURE_RECTANGLE_ARB, + // Replace GL_TEXTURE_RECTANGLE_ARB with GL_TEXTURE_RECTANGLE + //GL_TEXTURE_RECTANGLE_ARB, + GL_TEXTURE_RECTANGLE, + // GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_2D_MULTISAMPLE }; @@ -1028,7 +1031,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction) LLRender::LLRender() : mDirty(false), mCount(0), - mQuadCycle(0), + //mQuadCycle(0), // Remove QUADS rendering mode mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0), mMaxAnisotropy(0.f) @@ -1088,11 +1091,14 @@ void LLRender::init() llassert_always(mBuffer.isNull()) ; stop_glerror(); - mBuffer = new LLVertexBuffer(immediate_mask, 0); - mBuffer->allocateBuffer(4096, 0, TRUE); - mBuffer->getVertexStrider(mVerticesp); - mBuffer->getTexCoord0Strider(mTexcoordsp); - mBuffer->getColorStrider(mColorsp); + // Reset VB during TP + //mBuffer = new LLVertexBuffer(immediate_mask, 0); + //mBuffer->allocateBuffer(4096, 0, TRUE); + //mBuffer->getVertexStrider(mVerticesp); + //mBuffer->getTexCoord0Strider(mTexcoordsp); + //mBuffer->getColorStrider(mColorsp); + initVB(); + // stop_glerror(); } @@ -1111,9 +1117,29 @@ void LLRender::shutdown() delete mLightState[i]; } mLightState.clear(); - mBuffer = NULL ; + // Reset VB during TP + //mBuffer = NULL ; + destroyVB(); + // } +// Reset VB during TP +void LLRender::initVB() +{ + mBuffer = new LLVertexBuffer(immediate_mask, 0); + mBuffer->allocateBuffer(4096, 0, TRUE); + mBuffer->getVertexStrider(mVerticesp); + mBuffer->getTexCoord0Strider(mTexcoordsp); + mBuffer->getColorStrider(mColorsp); +} + +void LLRender::destroyVB() +{ + mBuffer = NULL; +} +// + + void LLRender::refreshState(void) { mDirty = true; @@ -1808,12 +1834,14 @@ void LLRender::begin(const GLuint& mode) { if (mode != mMode) { - if (mode == LLRender::QUADS) - { - mQuadCycle = 1; - } + // Remove QUADS rendering mode + //if (mode == LLRender::QUADS) + //{ + // mQuadCycle = 1; + //} + // - if (mMode == LLRender::QUADS || + if (//mMode == LLRender::QUADS || // Remove QUADS rendering mode mMode == LLRender::LINES || mMode == LLRender::TRIANGLES || mMode == LLRender::POINTS) @@ -1837,7 +1865,7 @@ void LLRender::end() //IMM_ERRS << "GL begin and end called with no vertices specified." << LL_ENDL; } - if ((mMode != LLRender::QUADS && + if ((//mMode != LLRender::QUADS && // Remove QUADS rendering mode mMode != LLRender::LINES && mMode != LLRender::TRIANGLES && mMode != LLRender::POINTS) || @@ -1859,14 +1887,16 @@ void LLRender::flush() //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) U32 count = mCount; - if (mMode == LLRender::QUADS && !sGLCoreProfile) - { - if (mCount%4 != 0) - { - count -= (mCount % 4); - LL_WARNS() << "Incomplete quad requested." << LL_ENDL; - } - } + // Remove QUADS rendering mode + //if (mMode == LLRender::QUADS && !sGLCoreProfile) + //{ + // if (mCount%4 != 0) + // { + // count -= (mCount % 4); + // LL_WARNS() << "Incomplete quad requested." << LL_ENDL; + // } + //} + // if (mMode == LLRender::TRIANGLES) { @@ -1898,12 +1928,14 @@ void LLRender::flush() mBuffer->flush(); mBuffer->setBuffer(immediate_mask); - if (mMode == LLRender::QUADS && sGLCoreProfile) - { - mBuffer->drawArrays(LLRender::TRIANGLES, 0, count); - mQuadCycle = 1; - } - else + // Remove QUADS rendering mode + //if (mMode == LLRender::QUADS && sGLCoreProfile) + //{ + // mBuffer->drawArrays(LLRender::TRIANGLES, 0, count); + // mQuadCycle = 1; + //} + //else + // { mBuffer->drawArrays(mMode, 0, count); } @@ -1925,7 +1957,8 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) { case LLRender::POINTS: flush(); break; case LLRender::TRIANGLES: if (mCount%3==0) flush(); break; - case LLRender::QUADS: if(mCount%4 == 0) flush(); break; + // Remove QUADS rendering mode + //case LLRender::QUADS: if(mCount%4 == 0) flush(); break; case LLRender::LINES: if (mCount%2 == 0) flush(); break; } } @@ -1946,24 +1979,26 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) mVerticesp[mCount] = vert; } - if (mMode == LLRender::QUADS && LLRender::sGLCoreProfile) - { - mQuadCycle++; - if (mQuadCycle == 4) - { //copy two vertices so fourth quad element will add a triangle - mQuadCycle = 0; - - mCount++; - mVerticesp[mCount] = mVerticesp[mCount-3]; - mColorsp[mCount] = mColorsp[mCount-3]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-3]; + // Remove QUADS rendering mode + //if (mMode == LLRender::QUADS && LLRender::sGLCoreProfile) + //{ + // mQuadCycle++; + // if (mQuadCycle == 4) + // { //copy two vertices so fourth quad element will add a triangle + // mQuadCycle = 0; + // + // mCount++; + // mVerticesp[mCount] = mVerticesp[mCount-3]; + // mColorsp[mCount] = mColorsp[mCount-3]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-3]; - mCount++; - mVerticesp[mCount] = mVerticesp[mCount-2]; - mColorsp[mCount] = mColorsp[mCount-2]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-2]; - } - } + // mCount++; + // mVerticesp[mCount] = mVerticesp[mCount-2]; + // mColorsp[mCount] = mColorsp[mCount-2]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-2]; + // } + //} + // mCount++; mVerticesp[mCount] = mVerticesp[mCount-1]; @@ -1979,41 +2014,43 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count) return; } - if (sGLCoreProfile && mMode == LLRender::QUADS) - { //quads are deprecated, convert to triangle list - S32 i = 0; - - while (i < vert_count) - { - //read first three - mVerticesp[mCount++] = verts[i++]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // Remove QUADS rendering mode + //if (sGLCoreProfile && mMode == LLRender::QUADS) + //{ //quads are deprecated, convert to triangle list + // S32 i = 0; + // + // while (i < vert_count) + // { + // //read first three + // mVerticesp[mCount++] = verts[i++]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount++] = verts[i++]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // mVerticesp[mCount++] = verts[i++]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount++] = verts[i++]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // mVerticesp[mCount++] = verts[i++]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; - //copy two - mVerticesp[mCount++] = verts[i-3]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // //copy two + // mVerticesp[mCount++] = verts[i-3]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount++] = verts[i-1]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; - - //copy last one - mVerticesp[mCount++] = verts[i++]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; - } - } - else + // mVerticesp[mCount++] = verts[i-1]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; + // + // //copy last one + // mVerticesp[mCount++] = verts[i++]; + // mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; + // } + //} + //else + // { for (S32 i = 0; i < vert_count; i++) { @@ -2037,41 +2074,43 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 v return; } - if (sGLCoreProfile && mMode == LLRender::QUADS) - { //quads are deprecated, convert to triangle list - S32 i = 0; + // Remove QUADS rendering mode + //if (sGLCoreProfile && mMode == LLRender::QUADS) + //{ //quads are deprecated, convert to triangle list + // S32 i = 0; - while (i < vert_count) - { - //read first three - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount++] = uvs[i++]; - mColorsp[mCount] = mColorsp[mCount-1]; + // while (i < vert_count) + // { + // //read first three + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount++] = uvs[i++]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount++] = uvs[i++]; - mColorsp[mCount] = mColorsp[mCount-1]; + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount++] = uvs[i++]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount++] = uvs[i++]; - mColorsp[mCount] = mColorsp[mCount-1]; + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount++] = uvs[i++]; + // mColorsp[mCount] = mColorsp[mCount-1]; - //copy last two - mVerticesp[mCount] = verts[i-3]; - mTexcoordsp[mCount++] = uvs[i-3]; - mColorsp[mCount] = mColorsp[mCount-1]; + // //copy last two + // mVerticesp[mCount] = verts[i-3]; + // mTexcoordsp[mCount++] = uvs[i-3]; + // mColorsp[mCount] = mColorsp[mCount-1]; - mVerticesp[mCount] = verts[i-1]; - mTexcoordsp[mCount++] = uvs[i-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + // mVerticesp[mCount] = verts[i-1]; + // mTexcoordsp[mCount++] = uvs[i-1]; + // mColorsp[mCount] = mColorsp[mCount-1]; - //copy last one - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount++] = uvs[i++]; - mColorsp[mCount] = mColorsp[mCount-1]; - } - } - else + // //copy last one + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount++] = uvs[i++]; + // mColorsp[mCount] = mColorsp[mCount-1]; + // } + //} + //else + // { for (S32 i = 0; i < vert_count; i++) { @@ -2099,41 +2138,43 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol } - if (sGLCoreProfile && mMode == LLRender::QUADS) - { //quads are deprecated, convert to triangle list - S32 i = 0; + // Remove QUADS rendering mode + //if (sGLCoreProfile && mMode == LLRender::QUADS) + //{ //quads are deprecated, convert to triangle list + // S32 i = 0; - while (i < vert_count) - { - //read first three - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount] = uvs[i]; - mColorsp[mCount++] = colors[i++]; + // while (i < vert_count) + // { + // //read first three + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount] = uvs[i]; + // mColorsp[mCount++] = colors[i++]; - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount] = uvs[i]; - mColorsp[mCount++] = colors[i++]; + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount] = uvs[i]; + // mColorsp[mCount++] = colors[i++]; - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount] = uvs[i]; - mColorsp[mCount++] = colors[i++]; + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount] = uvs[i]; + // mColorsp[mCount++] = colors[i++]; - //copy last two - mVerticesp[mCount] = verts[i-3]; - mTexcoordsp[mCount] = uvs[i-3]; - mColorsp[mCount++] = colors[i-3]; + // //copy last two + // mVerticesp[mCount] = verts[i-3]; + // mTexcoordsp[mCount] = uvs[i-3]; + // mColorsp[mCount++] = colors[i-3]; - mVerticesp[mCount] = verts[i-1]; - mTexcoordsp[mCount] = uvs[i-1]; - mColorsp[mCount++] = colors[i-1]; + // mVerticesp[mCount] = verts[i-1]; + // mTexcoordsp[mCount] = uvs[i-1]; + // mColorsp[mCount++] = colors[i-1]; - //copy last one - mVerticesp[mCount] = verts[i]; - mTexcoordsp[mCount] = uvs[i]; - mColorsp[mCount++] = colors[i++]; - } - } - else + // //copy last one + // mVerticesp[mCount] = verts[i]; + // mTexcoordsp[mCount] = uvs[i]; + // mColorsp[mCount++] = colors[i++]; + // } + //} + //else + // { for (S32 i = 0; i < vert_count; i++) { diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index a67fb8da52..f89258ce9f 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -277,7 +277,8 @@ public: POINTS, LINES, LINE_STRIP, - QUADS, + // Remove QUADS rendering mode + //QUADS, LINE_LOOP, NUM_MODES } eGeomModes; @@ -338,6 +339,10 @@ public: ~LLRender(); void init() ; void shutdown(); + // Reset VB during TP + void initVB(); + void destroyVB(); + // // Refreshes renderer state to the cached values // Needed when the render context has changed and invalidated the current state @@ -451,7 +456,8 @@ private: LLColor4 mAmbientLightColor; bool mDirty; - U32 mQuadCycle; + // Remove QUADS rendering mode + //U32 mQuadCycle; U32 mCount; U32 mMode; U32 mCurrTextureUnitIndex; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 4e2ebfd51e..8c5e43b88e 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -125,12 +125,25 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) // Counterclockwise quad will face the viewer if( filled ) { - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + // gGL.vertex2i(left, top); + // gGL.vertex2i(left, bottom); + // gGL.vertex2i(right, bottom); + // gGL.vertex2i(right, top); + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); + { gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); + + gGL.vertex2i(left, top); + gGL.vertex2i(right, bottom); gGL.vertex2i(right, top); + } gGL.end(); + // } else { @@ -201,7 +214,10 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st LLColor4 end_color = start_color; end_color.mV[VALPHA] = 0.f; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // // Right edge, CCW faces screen gGL.color4fv(start_color.mV); @@ -209,6 +225,12 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st gGL.vertex2i(right, bottom); gGL.color4fv(end_color.mV); gGL.vertex2i(right+lines, bottom); + // Remove QUADS rendering mode + gGL.color4fv(start_color.mV); + gGL.vertex2i(right, top-lines); + gGL.color4fv(end_color.mV); + gGL.vertex2i(right+lines, bottom); + // gGL.vertex2i(right+lines, top-lines); // Bottom edge, CCW faces screen @@ -217,6 +239,12 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st gGL.vertex2i(left+lines, bottom); gGL.color4fv(end_color.mV); gGL.vertex2i(left+lines, bottom-lines); + // Remove QUADS rendering mode + gGL.color4fv(start_color.mV); + gGL.vertex2i(right, bottom); + gGL.color4fv(end_color.mV); + gGL.vertex2i(left+lines, bottom-lines); + // gGL.vertex2i(right, bottom-lines); // bottom left Corner @@ -226,6 +254,12 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st gGL.vertex2i(left, bottom); // make the bottom left corner not sharp gGL.vertex2i(left+1, bottom-lines+1); + // Remove QUADS rendering mode + gGL.color4fv(start_color.mV); + gGL.vertex2i(left+lines, bottom); + gGL.color4fv(end_color.mV); + gGL.vertex2i(left+1, bottom-lines+1); + // gGL.vertex2i(left+lines, bottom-lines); // bottom right corner @@ -235,6 +269,12 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st gGL.vertex2i(right, bottom-lines); // make the rightmost corner not sharp gGL.vertex2i(right+lines-1, bottom-lines+1); + // Remove QUADS rendering mode + gGL.color4fv(start_color.mV); + gGL.vertex2i(right, bottom); + gGL.color4fv(end_color.mV); + gGL.vertex2i(right+lines-1, bottom-lines+1); + // gGL.vertex2i(right+lines, bottom); // top right corner @@ -244,6 +284,12 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st gGL.vertex2i( right+lines, top-lines ); // make the corner not sharp gGL.vertex2i( right+lines-1, top-1 ); + // Remove QUADS rendering mode + gGL.color4fv(start_color.mV); + gGL.vertex2i( right, top-lines ); + gGL.color4fv(end_color.mV); + gGL.vertex2i( right+lines-1, top-1 ); + // gGL.vertex2i( right, top ); gGL.end(); @@ -484,13 +530,19 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.color4fv(color.mV); - const S32 NUM_VERTICES = 9 * 4; // 9 quads + // Remove QUADS rendering mode + //const S32 NUM_VERTICES = 9 * 4; // 9 quads + const S32 NUM_VERTICES = 9 * 6; // 9 quads + // LLVector2 uv[NUM_VERTICES]; LLVector3 pos[NUM_VERTICES]; S32 index = 0; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // { // draw bottom left uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mBottom); @@ -505,6 +557,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; + // + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom); pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f); index++; @@ -522,6 +584,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); index++; @@ -539,6 +611,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); index++; @@ -556,6 +638,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop); pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f); index++; @@ -573,6 +665,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); index++; @@ -590,6 +692,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mBottom); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mBottom, 0.f); + index++; + + uv[index] = LLVector2(uv_outer_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_center_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); index++; @@ -607,6 +719,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_outer_rect.mLeft, uv_outer_rect.mTop); pos[index] = LLVector3(draw_outer_rect.mLeft, draw_outer_rect.mTop, 0.f); index++; @@ -624,6 +746,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mLeft, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mLeft, draw_center_rect.mTop, 0.f); + index++; + + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mLeft, uv_outer_rect.mTop); pos[index] = LLVector3(draw_center_rect.mLeft, draw_outer_rect.mTop, 0.f); index++; @@ -641,6 +773,16 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mTop, 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_center_rect.mRight, uv_center_rect.mTop); + pos[index] = LLVector3(draw_center_rect.mRight, draw_center_rect.mTop, 0.f); + index++; + + uv[index] = LLVector2(uv_outer_rect.mRight, uv_outer_rect.mTop); + pos[index] = LLVector3(draw_outer_rect.mRight, draw_outer_rect.mTop, 0.f); + index++; + // + uv[index] = LLVector2(uv_center_rect.mRight, uv_outer_rect.mTop); pos[index] = LLVector3(draw_center_rect.mRight, draw_outer_rect.mTop, 0.f); index++; @@ -691,11 +833,17 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre if (degrees == 0.f) { - const S32 NUM_VERTICES = 4; // 9 quads + // Remove QUADS rendering mode + //const S32 NUM_VERTICES = 4; // 9 quads + const S32 NUM_VERTICES = 6; // 9 quads + // LLVector2 uv[NUM_VERTICES]; LLVector3 pos[NUM_VERTICES]; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // { LLVector3 ui_scale = gGL.getUIScale(); LLVector3 ui_translation = gGL.getUITranslation(); @@ -718,6 +866,16 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY], 0.f); index++; + // Remove QUADS rendering mode + uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop); + pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f); + index++; + + uv[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom); + pos[index] = LLVector3(ui_translation.mV[VX], ui_translation.mV[VY], 0.f); + index++; + // + uv[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom); pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY], 0.f); index++; @@ -749,27 +907,56 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre gGL.color4fv(color.mV); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // LLVector3 v; + + // v = LLVector3(offset_x, offset_y, 0.f) * quat; + // gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); + // gGL.vertex2f(v.mV[0], v.mV[1] ); + + // v = LLVector3(-offset_x, offset_y, 0.f) * quat; + // gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); + // gGL.vertex2f(v.mV[0], v.mV[1] ); + + // v = LLVector3(-offset_x, -offset_y, 0.f) * quat; + // gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); + // gGL.vertex2f(v.mV[0], v.mV[1] ); + + // v = LLVector3(offset_x, -offset_y, 0.f) * quat; + // gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); + // gGL.vertex2f(v.mV[0], v.mV[1] ); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { - LLVector3 v; + LLVector3 v1 = LLVector3(offset_x, offset_y, 0.f) * quat; + LLVector3 v2 = LLVector3(-offset_x, offset_y, 0.f) * quat; + LLVector3 v3 = LLVector3(-offset_x, -offset_y, 0.f) * quat; + LLVector3 v4 = LLVector3(offset_x, -offset_y, 0.f) * quat; - v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2f(v1.mV[0], v1.mV[1] ); - v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2f(v2.mV[0], v2.mV[1] ); - v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2f(v3.mV[0], v3.mV[1] ); + + + gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); + gGL.vertex2f(v1.mV[0], v1.mV[1] ); + + gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); + gGL.vertex2f(v3.mV[0], v3.mV[1] ); - v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2f(v4.mV[0], v4.mV[1] ); } gGL.end(); + // gGL.popUIMatrix(); } } @@ -1058,8 +1245,24 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, void gl_rect_2d_simple_tex( S32 width, S32 height ) { - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2i(width, height); + + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2i(0, height); + + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(0, 0); + + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2i(width, 0); + // + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); + { gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(width, height); @@ -1069,20 +1272,41 @@ void gl_rect_2d_simple_tex( S32 width, S32 height ) gGL.texCoord2f(0.f, 0.f); gGL.vertex2i(0, 0); + + gGL.texCoord2f(1.f, 1.f); + gGL.vertex2i(width, height); + + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2i(0, 0); + gGL.texCoord2f(1.f, 0.f); gGL.vertex2i(width, 0); - + } gGL.end(); + // } void gl_rect_2d_simple( S32 width, S32 height ) { - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + // gGL.vertex2i(width, height); + // gGL.vertex2i(0, height); + // gGL.vertex2i(0, 0); + // gGL.vertex2i(width, 0); + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); + { gGL.vertex2i(width, height); gGL.vertex2i(0, height); gGL.vertex2i(0, 0); + + gGL.vertex2i(width, height); + gGL.vertex2i(0, 0); gGL.vertex2i(width, 0); + } gGL.end(); + // } static LLTrace::BlockTimerStatHandle FTM_RENDER_SEGMENTED_RECT ("Render segmented rectangle"); @@ -1123,7 +1347,10 @@ void gl_segmented_rect_2d_tex(const S32 left, LLVector2 width_vec((F32)width, 0.f); LLVector2 height_vec(0.f, (F32)height); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // { // draw bottom left gGL.texCoord2f(0.f, 0.f); @@ -1135,6 +1362,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((border_width_left + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2f(0.f, 0.f); + + gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((border_width_left + border_height_bottom).mV); + // + gGL.texCoord2f(0.f, border_uv_scale.mV[VY]); gGL.vertex2fv(border_height_bottom.mV); @@ -1148,6 +1383,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec - border_width_right + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], 0.f); + gGL.vertex2fv(border_width_left.mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec - border_width_right + border_height_bottom).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((border_width_left + border_height_bottom).mV); @@ -1161,6 +1404,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f, border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 0.f); + gGL.vertex2fv((width_vec - border_width_right).mV); + + gGL.texCoord2f(1.f, border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec + border_height_bottom).mV); + // + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec - border_width_right + border_height_bottom).mV); @@ -1174,6 +1425,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((border_width_left + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(0.f, border_uv_scale.mV[VY]); + gGL.vertex2fv(border_height_bottom.mV); + + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((border_width_left + height_vec - border_height_top).mV); + // + gGL.texCoord2f(0.f, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((height_vec - border_height_top).mV); @@ -1187,6 +1446,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec - border_width_right + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((border_width_left + border_height_bottom).mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec - border_width_right + height_vec - border_height_top).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((border_width_left + height_vec - border_height_top).mV); @@ -1200,6 +1467,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec - border_width_right + border_height_bottom).mV); + + gGL.texCoord2f(1.f, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec + height_vec - border_height_top).mV); + // + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((width_vec - border_width_right + height_vec - border_height_top).mV); @@ -1213,6 +1488,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((border_width_left + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(0.f, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((height_vec - border_height_top).mV); + + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f); + gGL.vertex2fv((border_width_left + height_vec).mV); + // + gGL.texCoord2f(0.f, 1.f); gGL.vertex2fv((height_vec).mV); @@ -1226,6 +1509,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((width_vec - border_width_right + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((border_width_left + height_vec - border_height_top).mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f); + gGL.vertex2fv((width_vec - border_width_right + height_vec).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((border_width_left + height_vec).mV); @@ -1239,6 +1530,14 @@ void gl_segmented_rect_2d_tex(const S32 left, gGL.texCoord2f(1.f, 1.f); gGL.vertex2fv((width_vec + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((width_vec - border_width_right + height_vec - border_height_top).mV); + + gGL.texCoord2f(1.f, 1.f); + gGL.vertex2fv((width_vec + height_vec).mV); + // + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((width_vec - border_width_right + height_vec).mV); } @@ -1293,7 +1592,10 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, LLVector2 x_min; LLVector2 x_max; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // { if (start_fragment < middle_start) { @@ -1312,6 +1614,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, 0.f); + gGL.vertex2fv(x_min.mV); + + gGL.texCoord2f(u_max, border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + border_height_bottom).mV); + // + gGL.texCoord2f(u_min, border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + border_height_bottom).mV); @@ -1325,6 +1635,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + border_height_bottom).mV); + + gGL.texCoord2f(u_max, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // + gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + height_vec - border_height_top).mV); @@ -1338,6 +1656,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, 1.f); gGL.vertex2fv((x_max + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + height_vec - border_height_top).mV); + + gGL.texCoord2f(u_max, 1.f); + gGL.vertex2fv((x_max + height_vec).mV); + // + gGL.texCoord2f(u_min, 1.f); gGL.vertex2fv((x_min + height_vec).mV); } @@ -1357,6 +1683,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], 0.f); + gGL.vertex2fv(x_min.mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + border_height_bottom).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + border_height_bottom).mV); @@ -1370,6 +1704,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + border_height_bottom).mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + height_vec - border_height_top).mV); @@ -1383,6 +1725,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((x_max + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + height_vec - border_height_top).mV); + + gGL.texCoord2f(1.f - border_uv_scale.mV[VX], 1.f); + gGL.vertex2fv((x_max + height_vec).mV); + // + gGL.texCoord2f(border_uv_scale.mV[VX], 1.f); gGL.vertex2fv((x_min + height_vec).mV); } @@ -1404,6 +1754,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + border_height_bottom).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, 0.f); + gGL.vertex2fv((x_min).mV); + + gGL.texCoord2f(u_max, border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + border_height_bottom).mV); + // + gGL.texCoord2f(u_min, border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + border_height_bottom).mV); @@ -1417,6 +1775,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + border_height_bottom).mV); + + gGL.texCoord2f(u_max, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_max + height_vec - border_height_top).mV); + // + gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]); gGL.vertex2fv((x_min + height_vec - border_height_top).mV); @@ -1430,6 +1796,14 @@ void gl_segmented_rect_2d_fragment_tex(const LLRect& rect, gGL.texCoord2f(u_max, 1.f); gGL.vertex2fv((x_max + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(u_min, 1.f - border_uv_scale.mV[VY]); + gGL.vertex2fv((x_min + height_vec - border_height_top).mV); + + gGL.texCoord2f(u_max, 1.f); + gGL.vertex2fv((x_max + height_vec).mV); + // + gGL.texCoord2f(u_min, 1.f); gGL.vertex2fv((x_min + height_vec).mV); } @@ -1444,7 +1818,10 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv { LL_RECORD_BLOCK_TIME(FTM_RENDER_SEGMENTED_RECT); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // { // draw bottom left gGL.texCoord2f(clip_rect.mLeft, clip_rect.mBottom); @@ -1456,6 +1833,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(clip_rect.mLeft, clip_rect.mBottom); + gGL.vertex3f(0.f, 0.f, 0.f); + + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV); + // + gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom); gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV); @@ -1469,6 +1854,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom); gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec).mV); + + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV); @@ -1482,6 +1875,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom); gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mRight * width_vec).mV); + + gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom); + gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom); gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV); @@ -1495,6 +1896,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV); + + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV); + // + gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop); gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV); @@ -1508,6 +1917,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop); gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV); + + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop); + gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV); @@ -1521,6 +1938,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop); gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom); + gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV); + + gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop); + gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop); gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV); @@ -1534,6 +1959,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop); + gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV); + + gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV); + // + gGL.texCoord2f(clip_rect.mLeft, clip_rect.mTop); gGL.vertex3fv((height_vec).mV); @@ -1547,6 +1980,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop); gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop); + gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV); + + gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop); + gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop); gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV); @@ -1560,6 +2001,14 @@ void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv gGL.texCoord2f(clip_rect.mRight, clip_rect.mTop); gGL.vertex3fv((width_vec + height_vec).mV); + // Remove QUADS rendering mode + gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop); + gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV); + + gGL.texCoord2f(clip_rect.mRight, clip_rect.mTop); + gGL.vertex3fv((width_vec + height_vec).mV); + // + gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop); gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV); } diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 68e60964c5..c0ae04536a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -118,7 +118,8 @@ bool LLVertexBuffer::sMapped = false; bool LLVertexBuffer::sUseStreamDraw = true; bool LLVertexBuffer::sUseVAO = false; bool LLVertexBuffer::sPreferStreamDraw = false; - +// Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr +LLVertexBuffer* LLVertexBuffer::sUtilityBuffer = NULL; U32 LLVBOPool::genBuffer() { @@ -368,7 +369,7 @@ U32 LLVertexBuffer::sGLMode[LLRender::NUM_MODES] = GL_POINTS, GL_LINES, GL_LINE_STRIP, - GL_QUADS, + //GL_QUADS, // Remove QUADS rendering mode GL_LINE_LOOP, }; @@ -582,41 +583,76 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector& pos, con return; } - unbind(); - - setupClientArrays(MAP_VERTEX | MAP_NORMAL); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //unbind(); + // + //setupClientArrays(MAP_VERTEX | MAP_NORMAL); - LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + //LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; - if (shader) + //if (shader) + //{ + // S32 loc = LLVertexBuffer::TYPE_VERTEX; + // if (loc > -1) + // { + // glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[0].mV); + // } + // loc = LLVertexBuffer::TYPE_NORMAL; + // if (loc > -1) + // { + // glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[0].mV); + // } + //} + //else + //{ + // glVertexPointer(3, GL_FLOAT, 0, pos[0].mV); + // glNormalPointer(GL_FLOAT, 0, norm[0].mV); + //} + //LLGLSLShader::startProfile(); + //glDrawArrays(sGLMode[mode], 0, count); + //LLGLSLShader::stopProfile(count, mode); + if (!sUtilityBuffer) { - S32 loc = LLVertexBuffer::TYPE_VERTEX; - if (loc > -1) - { - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, pos[0].mV); - } - loc = LLVertexBuffer::TYPE_NORMAL; - if (loc > -1) - { - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 0, norm[0].mV); - } + sUtilityBuffer = new LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0, GL_STREAM_DRAW); + sUtilityBuffer->allocateBuffer(count, count, true); } - else + if (sUtilityBuffer->getNumVerts() < (S32) count) { - glVertexPointer(3, GL_FLOAT, 0, pos[0].mV); - glNormalPointer(GL_FLOAT, 0, norm[0].mV); + sUtilityBuffer->resizeBuffer(count, count); } + + LLStrider vertex_strider; + LLStrider normal_strider; + sUtilityBuffer->getVertexStrider(vertex_strider); + sUtilityBuffer->getNormalStrider(normal_strider); + for (U32 i = 0; i < count; ++i) + { + *(vertex_strider++) = pos[i]; + *(normal_strider++) = norm[i]; + } + + sUtilityBuffer->setBuffer(MAP_VERTEX | MAP_NORMAL); LLGLSLShader::startProfile(); - glDrawArrays(sGLMode[mode], 0, count); + sUtilityBuffer->drawArrays(mode, 0, pos.size()); LLGLSLShader::stopProfile(count, mode); + // } //static -void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp) +// Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr +//void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp) +void LLVertexBuffer::drawElements(U32 mode, const S32 num_vertices, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp) +// { llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL); // Crash fix due to invalid calls to drawElements by Drake Arconis + if (num_vertices <= 0) + { + LL_WARNS() << "Called drawElements with 0 vertices" << LL_ENDL; + return; + } + if (num_indices <= 0) { LL_WARNS() << "Called drawElements with 0 indices" << LL_ENDL; @@ -626,36 +662,70 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto gGL.syncMatrices(); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + if (!sUtilityBuffer) + { + sUtilityBuffer = new LLVertexBuffer(MAP_VERTEX | MAP_NORMAL | MAP_TEXCOORD0, GL_STREAM_DRAW); + sUtilityBuffer->allocateBuffer(num_vertices, num_indices, true); + } + if (sUtilityBuffer->getNumVerts() < num_vertices || sUtilityBuffer->getNumIndices() < num_indices) + { + sUtilityBuffer->resizeBuffer(llmax(sUtilityBuffer->getNumVerts(), num_vertices), llmax(sUtilityBuffer->getNumIndices(), num_indices)); + } + // + U32 mask = LLVertexBuffer::MAP_VERTEX; + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + LLStrider index_strider; + LLStrider vertex_strider; + sUtilityBuffer->getIndexStrider(index_strider); + sUtilityBuffer->getVertexStrider(vertex_strider); + const S32 index_size = ((num_indices * sizeof(U16)) + 0xF) & ~0xF; + const S32 vertex_size = ((num_vertices * 4 * sizeof(F32)) + 0xF) & ~0xF; + LLVector4a::memcpyNonAliased16((F32*)index_strider.get(), (F32*)indicesp, index_size); + LLVector4a::memcpyNonAliased16((F32*)vertex_strider.get(), (F32*)pos, vertex_size); + // if (tc) { mask = mask | LLVertexBuffer::MAP_TEXCOORD0; + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + LLStrider tc_strider; + sUtilityBuffer->getTexCoord0Strider(tc_strider); + const S32 tc_size = ((num_vertices * 2 * sizeof(F32)) + 0xF) & ~0xF; + LLVector4a::memcpyNonAliased16((F32*)tc_strider.get(), (F32*)tc, tc_size); + // } - unbind(); - - setupClientArrays(mask); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //unbind(); + // + //setupClientArrays(mask); - if (LLGLSLShader::sNoFixedFunction) - { - S32 loc = LLVertexBuffer::TYPE_VERTEX; - glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 16, pos); + //if (LLGLSLShader::sNoFixedFunction) + //{ + // S32 loc = LLVertexBuffer::TYPE_VERTEX; + // glVertexAttribPointerARB(loc, 3, GL_FLOAT, GL_FALSE, 16, pos); - if (tc) - { - loc = LLVertexBuffer::TYPE_TEXCOORD0; - glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, 0, tc); - } - } - else - { - glTexCoordPointer(2, GL_FLOAT, 0, tc); - glVertexPointer(3, GL_FLOAT, 16, pos); - } + // if (tc) + // { + // loc = LLVertexBuffer::TYPE_TEXCOORD0; + // glVertexAttribPointerARB(loc, 2, GL_FLOAT, GL_FALSE, 0, tc); + // } + //} + //else + //{ + // glTexCoordPointer(2, GL_FLOAT, 0, tc); + // glVertexPointer(3, GL_FLOAT, 16, pos); + //} + //LLGLSLShader::startProfile(); + //glDrawElements(sGLMode[mode], num_indices, GL_UNSIGNED_SHORT, indicesp); + //LLGLSLShader::stopProfile(num_indices, mode); + sUtilityBuffer->setBuffer(mask); LLGLSLShader::startProfile(); - glDrawElements(sGLMode[mode], num_indices, GL_UNSIGNED_SHORT, indicesp); + sUtilityBuffer->draw(mode, num_indices, 0); LLGLSLShader::stopProfile(num_indices, mode); + // } void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_offset) const @@ -917,6 +987,11 @@ void LLVertexBuffer::cleanupClass() sDynamicVBOPool.cleanup(); sDynamicCopyVBOPool.cleanup(); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + delete sUtilityBuffer; + sUtilityBuffer = NULL; + // + if(sPrivatePoolp) { LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp); @@ -2137,15 +2212,26 @@ bool LLVertexBuffer::getWeightStrider(LLStrider& strider, S32 index, S32 co return VertexBufferStrider::get(*this, strider, index, count, map_range); } -bool LLVertexBuffer::getWeight4Strider(LLStrider& strider, S32 index, S32 count, bool map_range) +// Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis +//bool LLVertexBuffer::getWeight4Strider(LLStrider& strider, S32 index, S32 count, bool map_range) +//{ +// return VertexBufferStrider::get(*this, strider, index, count, map_range); +//} +// +//bool LLVertexBuffer::getClothWeightStrider(LLStrider& strider, S32 index, S32 count, bool map_range) +//{ +// return VertexBufferStrider::get(*this, strider, index, count, map_range); +//} +bool LLVertexBuffer::getWeight4Strider(LLStrider& strider, S32 index, S32 count, bool map_range) { - return VertexBufferStrider::get(*this, strider, index, count, map_range); + return VertexBufferStrider::get(*this, strider, index, count, map_range); } -bool LLVertexBuffer::getClothWeightStrider(LLStrider& strider, S32 index, S32 count, bool map_range) +bool LLVertexBuffer::getClothWeightStrider(LLStrider& strider, S32 index, S32 count, bool map_range) { - return VertexBufferStrider::get(*this, strider, index, count, map_range); + return VertexBufferStrider::get(*this, strider, index, count, map_range); } +// //---------------------------------------------------------------------------- @@ -2274,9 +2360,12 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { U32 unsatisfied_mask = (required_mask & ~data_mask); - U32 i = 0; + // Infinite loop fix by Drake Arconis + //U32 i = 0; - while (i < TYPE_MAX) + //while (i < TYPE_MAX) + for (U32 i = 0; i < TYPE_MAX; i++) + // { U32 unsatisfied_flag = unsatisfied_mask & (1 << i); switch (unsatisfied_flag) @@ -2397,8 +2486,10 @@ void LLVertexBuffer::setBuffer(U32 data_mask) sGLRenderIndices = mGLIndices; } } - - if (!mGLArray) + // Need to setup (activate/deactivate) client arrays with VAOs too + // if( !mGLArray ) + if (!sUseVAO && !mGLArray) + // { setupClientArrays(data_mask); } diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 74c8d09b1f..f7989349be 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -145,7 +145,9 @@ public: static void setupClientArrays(U32 data_mask); static void pushPositions(U32 mode, const LLVector4a* pos, U32 count); static void drawArrays(U32 mode, const std::vector& pos, const std::vector& norm); - static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //static void drawElements(U32 mode, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp); + static void drawElements(U32 mode, const S32 num_vertices, const LLVector4a* pos, const LLVector2* tc, S32 num_indices, const U16* indicesp); static void unbind(); //unbind any bound vertex buffer @@ -258,8 +260,12 @@ public: bool getTextureIndexStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); bool getEmissiveStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); bool getWeightStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); - bool getWeight4Strider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); - bool getClothWeightStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //bool getWeight4Strider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); + //bool getClothWeightStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); + bool getWeight4Strider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); + bool getClothWeightStrider(LLStrider& strider, S32 index=0, S32 count = -1, bool map_range = false); + // bool useVBOs() const; @@ -355,6 +361,11 @@ public: static U32 sIndexCount; static U32 sBindCount; static U32 sSetCount; + +// Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr +private: + static LLVertexBuffer* sUtilityBuffer; +// }; diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index 42726de0ad..b521924016 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -202,16 +202,28 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons ll_round(y) + height); LLVector3 vertices[4]; - vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); - vertices[1] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 1.0f); + // Remove QUADS rendering mode + //vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); + //vertices[1] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 1.0f); + //vertices[2] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 1.0f); + //vertices[3] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 1.0f); + // + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertexBatchPreTransformed(vertices, 4); + //} + //gGL.end(); + vertices[0] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 1.0f); + vertices[1] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); vertices[2] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 1.0f); vertices[3] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 1.0f); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.vertexBatchPreTransformed(vertices, 4); } gGL.end(); + // gGL.popUIMatrix(); } diff --git a/indra/llui/lleditmenuhandler.h b/indra/llui/lleditmenuhandler.h index 0932f094ef..cd4fea8c52 100644 --- a/indra/llui/lleditmenuhandler.h +++ b/indra/llui/lleditmenuhandler.h @@ -58,9 +58,6 @@ public: virtual void deselect() {}; virtual BOOL canDeselect() const { return FALSE; } - - virtual void duplicate() {}; - virtual BOOL canDuplicate() const { return FALSE; } // TODO: Instead of being a public data member, it would be better to hide it altogether // and have a "set" method and then a bunch of static versions of the cut, copy, paste diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 8bb6673351..62d21f1dd2 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3364,6 +3364,12 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) return TRUE; } + if (result && !getHighlightedItem() && LLMenuGL::sMenuContainer->hasVisibleMenu()) + { + // close menus originating from other menu bars + LLMenuGL::sMenuContainer->hideMenus(); + } + return result; } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 34afcef81d..5309f9683d 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2010,12 +2010,12 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) registrar.add("Url.ShowProfile", boost::bind(&LLScrollListCtrl::showProfile, id, is_group)); registrar.add("Url.SendIM", boost::bind(&LLScrollListCtrl::sendIM, id)); registrar.add("Url.AddFriend", boost::bind(&LLScrollListCtrl::addFriend, id)); + registrar.add("Url.RemoveFriend", boost::bind(&LLScrollListCtrl::removeFriend, id)); registrar.add("Url.Execute", boost::bind(&LLScrollListCtrl::showNameDetails, id, is_group)); registrar.add("Url.CopyLabel", boost::bind(&LLScrollListCtrl::copyNameToClipboard, id, is_group)); registrar.add("Url.CopyUrl", boost::bind(&LLScrollListCtrl::copySLURLToClipboard, id, is_group)); // Additional convenience options - registrar.add("Url.RemoveFriend", boost::bind(&LLScrollListCtrl::removeFriend, id)); registrar.add("FS.ZoomIn", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/zoom", true)); registrar.add("FS.TeleportToTarget", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/teleportto", true)); registrar.add("FS.OfferTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/offerteleport", true)); @@ -2082,14 +2082,11 @@ void LLScrollListCtrl::addFriend(std::string id) LLUrlAction::addFriend(slurl); } -// Add remove friend option void LLScrollListCtrl::removeFriend(std::string id) { - // add resident to friends list std::string slurl = "secondlife:///app/agent/" + id + "/about"; LLUrlAction::removeFriend(slurl); } -// void LLScrollListCtrl::showNameDetails(std::string id, bool is_group) { diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index c23b164d3b..c156038282 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -462,9 +462,7 @@ private: static void showProfile(std::string id, bool is_group); static void sendIM(std::string id); static void addFriend(std::string id); - // Add remove friend option static void removeFriend(std::string id); - // static void showNameDetails(std::string id, bool is_group); static void copyNameToClipboard(std::string id, bool is_group); static void copySLURLToClipboard(std::string id, bool is_group); diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index fe5e442fc3..08e1b2b703 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -519,7 +519,10 @@ void LLStatBar::draw() max_value = 0.f; gGL.color4f(1.f, 0.f, 0.f, 1.f); - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + gGL.begin( LLRender::TRIANGLES ); + // const S32 max_frame = llmin(num_frames, num_values); U32 num_samples = 0; for (S32 i = 1; i <= max_frame; i++) @@ -559,17 +562,35 @@ void LLStatBar::draw() F32 max = llmax(min + 1, (max_value - mCurMinBar) * value_scale); if (mOrientation == HORIZONTAL) { + // Remove QUADS rendering mode + //gGL.vertex2f((F32)bar_rect.mRight - offset, max); + //gGL.vertex2f((F32)bar_rect.mRight - offset, min); + //gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min); + //gGL.vertex2f((F32)bar_rect.mRight - offset - 1, max); gGL.vertex2f((F32)bar_rect.mRight - offset, max); gGL.vertex2f((F32)bar_rect.mRight - offset, min); gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min); + + gGL.vertex2f((F32)bar_rect.mRight - offset, max); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min); gGL.vertex2f((F32)bar_rect.mRight - offset - 1, max); + // } else { + // Remove QUADS rendering mode + //gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1); + //gGL.vertex2f(min, (F32)bar_rect.mBottom + offset); + //gGL.vertex2f(max, (F32)bar_rect.mBottom + offset); + //gGL.vertex2f(max, (F32)bar_rect.mBottom + offset + 1 ); gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1); gGL.vertex2f(min, (F32)bar_rect.mBottom + offset); gGL.vertex2f(max, (F32)bar_rect.mBottom + offset); + + gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1); + gGL.vertex2f(max, (F32)bar_rect.mBottom + offset); gGL.vertex2f(max, (F32)bar_rect.mBottom + offset + 1 ); + // } } gGL.end(); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index b1959c7be4..f5b69cf015 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1617,8 +1617,8 @@ void LLTextBase::reflow() segment_set_t::iterator seg_iter = mSegments.begin(); S32 seg_offset = 0; S32 line_start_index = 0; - const S32 text_available_width = mVisibleTextRect.getWidth() - mHPad; // reserve room for margin - S32 remaining_pixels = text_available_width; + const F32 text_available_width = mVisibleTextRect.getWidth() - mHPad; // reserve room for margin + F32 remaining_pixels = text_available_width; S32 line_count = 0; // find and erase line info structs starting at start_index and going to end of document @@ -1644,14 +1644,15 @@ void LLTextBase::reflow() S32 cur_index = segment->getStart() + seg_offset; // ask segment how many character fit in remaining space - S32 character_count = segment->getNumChars(getWordWrap() ? llmax(0, remaining_pixels) : S32_MAX, + S32 character_count = segment->getNumChars(getWordWrap() ? llmax(0, ll_round(remaining_pixels)) : S32_MAX, seg_offset, cur_index - line_start_index, S32_MAX, line_count - seg_line_offset); - S32 segment_width, segment_height; - bool force_newline = segment->getDimensions(seg_offset, character_count, segment_width, segment_height); + F32 segment_width; + S32 segment_height; + bool force_newline = segment->getDimensionsF32(seg_offset, character_count, segment_width, segment_height); // grow line height as necessary based on reported height of this segment line_height = llmax(line_height, segment_height); remaining_pixels -= segment_width; @@ -1660,11 +1661,13 @@ void LLTextBase::reflow() S32 last_segment_char_on_line = segment->getStart() + seg_offset; - S32 text_actual_width = text_available_width - remaining_pixels; + // Note: make sure text will fit in width - use ceil, but also make sure + // ceil is used only once per line + S32 text_actual_width = llceil(text_available_width - remaining_pixels); S32 text_left = getLeftOffset(text_actual_width); LLRect line_rect(text_left, cur_top, - text_left + text_actual_width, + text_left + text_actual_width, cur_top - line_height); // if we didn't finish the current segment... @@ -3304,7 +3307,15 @@ boost::signals2::connection LLTextBase::setIsObjectBlockedCallback(const is_bloc LLTextSegment::~LLTextSegment() {} -bool LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { width = 0; height = 0; return false;} +bool LLTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { width = 0; height = 0; return false; } +bool LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +{ + F32 fwidth = 0; + bool result = getDimensionsF32(first_char, num_chars, fwidth, height); + width = ll_round(fwidth); + return result; +} + S32 LLTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const { return 0; } S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const { return 0; } void LLTextSegment::updateLayout(const LLTextBase& editor) {} @@ -3552,7 +3563,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) mTooltip = tooltip; } -bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLNormalTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { height = 0; width = 0; @@ -3561,7 +3572,7 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt height = mFontHeight; const LLWString &text = getWText(); // if last character is a newline, then return true, forcing line break - width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); + width = mStyle->getFont()->getWidthF32(text.c_str(), mStart + first_char, num_chars); } return false; } @@ -3742,7 +3753,7 @@ LLInlineViewSegment::~LLInlineViewSegment() mView->die(); } -bool LLInlineViewSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLInlineViewSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { if (first_char == 0 && num_chars == 0) { @@ -3829,7 +3840,7 @@ LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLT LLLineBreakTextSegment::~LLLineBreakTextSegment() { } -bool LLLineBreakTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLLineBreakTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { width = 0; height = mFontHeight; @@ -3858,7 +3869,7 @@ LLImageTextSegment::~LLImageTextSegment() static const S32 IMAGE_HPAD = 3; -bool LLImageTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLImageTextSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { width = 0; height = mStyle->getFont()->getLineHeight(); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 0b8a80fbda..aca45ca7dd 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -61,8 +61,9 @@ public: mEnd(end) {} virtual ~LLTextSegment(); + bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; - virtual bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + virtual bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; /** @@ -126,7 +127,7 @@ public: LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible = TRUE); virtual ~LLNormalTextSegment(); - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); @@ -212,7 +213,7 @@ public: LLInlineViewSegment(const Params& p, S32 start, S32 end); ~LLInlineViewSegment(); - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; /*virtual*/ void updateLayout(const class LLTextBase& editor); /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); @@ -236,7 +237,7 @@ public: LLLineBreakTextSegment(LLStyleConstSP style,S32 pos); LLLineBreakTextSegment(S32 pos); ~LLLineBreakTextSegment(); - bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); @@ -249,7 +250,7 @@ class LLImageTextSegment : public LLTextSegment public: LLImageTextSegment(LLStyleConstSP style,S32 pos,class LLTextBase& editor); ~LLImageTextSegment(); - bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 char_offset, S32 max_chars, S32 line_ind) const; F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 8f9a2be345..90d56dd750 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1558,6 +1558,10 @@ void LLTextEditor::pasteHelper(bool is_primary) // Clean up string (replace tabs and remove characters that our fonts don't support). void LLTextEditor::cleanStringForPaste(LLWString & clean_string) { + std::string clean_string_utf = wstring_to_utf8str(clean_string); + std::replace( clean_string_utf.begin(), clean_string_utf.end(), '\r', '\n'); + clean_string = utf8str_to_wstring(clean_string_utf); + LLWStringUtil::replaceTabsWithSpaces(clean_string, SPACES_PER_TAB); if( mAllowEmbeddedItems ) { diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 25e8b7bcc1..4c3156f13c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -310,6 +310,7 @@ set(viewer_SOURCE_FILES llfloaterautoreplacesettings.cpp llfloateravatar.cpp llfloateravatarpicker.cpp + llfloateravatarrendersettings.cpp llfloateravatartextures.cpp llfloaterbeacons.cpp llfloaterbigpreview.cpp @@ -343,6 +344,7 @@ set(viewer_SOURCE_FILES llfloatergesture.cpp llfloatergodtools.cpp llfloatergotoline.cpp + llfloatergridstatus.cpp llfloatergroupbulkban.cpp llfloatergroupinvite.cpp llfloatergroups.cpp @@ -1058,6 +1060,7 @@ set(viewer_HEADER_FILES llfloaterautoreplacesettings.h llfloateravatar.h llfloateravatarpicker.h + llfloateravatarrendersettings.h llfloateravatartextures.h llfloaterbeacons.h llfloaterbigpreview.h @@ -1091,6 +1094,7 @@ set(viewer_HEADER_FILES llfloatergesture.h llfloatergodtools.h llfloatergotoline.h + llfloatergridstatus.h llfloatergroupbulkban.h llfloatergroupinvite.h llfloatergroups.h diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 2d6c0bcf19..ab0fa336dd 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -5.0.4 +5.0.5 diff --git a/indra/newview/animationexplorer.cpp b/indra/newview/animationexplorer.cpp index 072a8ff7b1..c68ec11ef8 100644 --- a/indra/newview/animationexplorer.cpp +++ b/indra/newview/animationexplorer.cpp @@ -240,7 +240,7 @@ void AnimationExplorer::draw() gGL.color3f(1.0f, 1.0f, 1.0f); gGL.getTexUnit(0)->bind(mAnimationPreview); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); { gGL.texCoord2f(0.0f, 1.0f); gGL.vertex2i(r.mLeft, r.mTop); @@ -248,6 +248,11 @@ void AnimationExplorer::draw() gGL.vertex2i(r.mLeft, r.mBottom); gGL.texCoord2f(1.0f, 0.0f); gGL.vertex2i(r.mRight, r.mBottom); + + gGL.texCoord2f(0.0f, 1.0f); + gGL.vertex2i(r.mLeft, r.mTop); + gGL.texCoord2f(1.0f, 0.0f); + gGL.vertex2i(r.mRight, r.mBottom); gGL.texCoord2f(1.0f, 1.0f); gGL.vertex2i(r.mRight, r.mTop); } diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 14808863cb..9b6d8069c2 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -295,6 +295,17 @@ is_running_function="Floater.IsOpen" is_running_parameters="reporter" /> + Backup 0 + GridStatusRSS + + Comment + URL that points to SL Grid Status RSS + Persist + 1 + Type + String + Value + https://secondlife-status.statuspage.io/history.atom + + GridStatusUpdateDelay + + Comment + Timer delay for updating Grid Status RSS. + Persist + 1 + Type + F32 + Value + 60.0 + + TestGridStatusRSSFromFile + + Comment + For testing only: Don't update rss xml file from server. + Persist + 1 + Type + Boolean + Value + 0 + LagMeterShrunk Comment @@ -10819,6 +10852,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + AlwaysRenderFriends + + Comment + Always render friends regardless of max complexity + Persist + 1 + Type + Boolean + Value + 0 + RenderAvatar Comment @@ -19044,6 +19088,22 @@ Change of this parameter will affect the layout of buttons in notification toast 0 + GridStatusFloaterRect + + Comment + Web profile floater dimensions + Persist + 1 + Type + Rect + Value + + 0 + 520 + 625 + 0 + + HelpFloaterOpen Comment diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl index d4d2f5f571..a99373d072 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -33,7 +33,9 @@ uniform float minimum_alpha; uniform sampler2D diffuseMap; +#if !DEPTH_CLAMP // Fix void and region water flickr by Drake Arconis (Alchemy viewer) VARYING vec4 post_pos; +#endif // Fix void and region water flickr by Drake Arconis (Alchemy viewer) VARYING vec2 vary_texcoord0; void main() @@ -47,5 +49,7 @@ void main() frag_color = vec4(1,1,1,1); +#if !DEPTH_CLAMP // Fix void and region water flickr by Drake Arconis (Alchemy viewer) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +#endif // Fix void and region water flickr by Drake Arconis (Alchemy viewer) } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl index e472a75304..ca9cb35316 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl @@ -29,7 +29,9 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; ATTRIBUTE vec2 texcoord0; +#if !DEPTH_CLAMP // Fix void and region water flickr by Drake Arconis (Alchemy viewer) VARYING vec4 post_pos; +#endif // Fix void and region water flickr by Drake Arconis (Alchemy viewer) VARYING vec2 vary_texcoord0; void main() @@ -37,9 +39,15 @@ void main() //transform vertex vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); +#if !DEPTH_CLAMP // Fix void and region water flickr by Drake Arconis (Alchemy viewer) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); +// Fix void and region water flickr by Drake Arconis (Alchemy viewer) +#else + gl_Position = pos; +#endif +// Fix void and region water flickr by Drake Arconis (Alchemy viewer) vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; } diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 3ce1c3e413..9429097a79 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -526,6 +526,16 @@ void invrepair() gInventory.collectDescendents(gInventory.getRootFolderID(), cats, items, FALSE); } +void key_to_name_callback(const LLUUID& id, const LLAvatarName& av_name) +{ + std::string name = av_name.getCompleteName(); + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, id)) + { + name = RlvStrings::getAnonym(name); + } + report_to_nearby_chat(llformat("%s: (%s)", id.asString().c_str(), name.c_str())); +} + bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_gesture) { static LLCachedControl sFSCmdLine(gSavedSettings, "FSCmdLine"); @@ -701,13 +711,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge LLUUID target_key; if (i >> target_key) { - std::string object_name; - gCacheName->getFullName(target_key, object_name); - if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, target_key)) - { - object_name = RlvStrings::getAnonym(object_name); - } - report_to_nearby_chat(llformat("%s: (%s)", target_key.asString().c_str(), object_name.c_str())); + LLAvatarNameCache::get(target_key, boost::bind(&key_to_name_callback, _1, _2)); } return false; } diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index c9f3a9f7f3..9c061107f9 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -744,8 +744,8 @@ bool DAESaver::saveDAE(std::string filename) // File creator std::string author = "Unknown"; - if (gCacheName) - gCacheName->getFullName(gAgentID, author); + if (!gAgentUsername.empty()) + author = gAgentUsername; daeElement* contributor = asset->add("contributor"); contributor->add("author")->setCharData(author); diff --git a/indra/newview/exopostprocess.cpp b/indra/newview/exopostprocess.cpp index 4703aeb19c..063dc398e1 100644 --- a/indra/newview/exopostprocess.cpp +++ b/indra/newview/exopostprocess.cpp @@ -71,10 +71,15 @@ void exoPostProcess::ExodusRenderPostUpdate() etc1.setVec(0.f, 0.f); etc2.setVec((F32) gPipeline.mScreen.getWidth(), (F32) gPipeline.mScreen.getHeight()); + initVB(); +} + +void exoPostProcess::initVB() +{ if (!gPipeline.sRenderDeferred) { // Destroy our old buffer, and create a new vertex buffer for the screen (shamelessly ganked from pipeline.cpp). - mExoPostBuffer = NULL; + destroyVB(); mExoPostBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1, 0); mExoPostBuffer->allocateBuffer(3,0,TRUE); @@ -102,7 +107,7 @@ void exoPostProcess::ExodusRenderPostUpdate() } else { - mExoPostBuffer = NULL; + destroyVB(); mExoPostBuffer = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1, 0); mExoPostBuffer->allocateBuffer(8, 0, true); @@ -119,6 +124,11 @@ void exoPostProcess::ExodusRenderPostUpdate() } } +void exoPostProcess::destroyVB() +{ + mExoPostBuffer = NULL; +} + void exoPostProcess::ExodusRenderPost(LLRenderTarget* src, LLRenderTarget* dst, S32 type) { if (type == EXODUS_RENDER_VIGNETTE_POST) @@ -188,3 +198,4 @@ void exoShader::BindRenderTarget(LLRenderTarget* tgt, LLGLSLShader* shader, S32 } shader->uniform2f(sScreen_Res, tgt->getWidth(), tgt->getHeight()); } + diff --git a/indra/newview/exopostprocess.h b/indra/newview/exopostprocess.h index 232d299a9d..909a6d3ed1 100644 --- a/indra/newview/exopostprocess.h +++ b/indra/newview/exopostprocess.h @@ -43,36 +43,41 @@ private: static exoPostProcess *postProcess; public: - enum ExodusRenderPostType - { - //EXODUS_RENDER_GAMMA_POST = 1, - //EXODUS_RENDER_GAMMA_PRE = 2, - //EXODUS_RENDER_COLOR_GRADE = 4, - //EXODUS_RENDER_TONE_LINEAR = 8, - //EXODUS_RENDER_TONE_REINHARD = 10, - //EXODUS_RENDER_TONE_FILMIC = 20, - //EXODUS_RENDER_COLOR_GRADE_LEGACY = 40, - EXODUS_RENDER_VIGNETTE_POST = 80, - //EXODUS_RENDER_TONE_FILMIC_ADV = 100 - }; + enum ExodusRenderPostType + { + //EXODUS_RENDER_GAMMA_POST = 1, + //EXODUS_RENDER_GAMMA_PRE = 2, + //EXODUS_RENDER_COLOR_GRADE = 4, + //EXODUS_RENDER_TONE_LINEAR = 8, + //EXODUS_RENDER_TONE_REINHARD = 10, + //EXODUS_RENDER_TONE_FILMIC = 20, + //EXODUS_RENDER_COLOR_GRADE_LEGACY = 40, + EXODUS_RENDER_VIGNETTE_POST = 80, + //EXODUS_RENDER_TONE_FILMIC_ADV = 100 + }; void ExodusSetPostAttribute(U32 attribute, void* value = NULL); void ExodusRenderPostStack(LLRenderTarget* src, LLRenderTarget* dst); - void ExodusRenderPost(LLRenderTarget* src, LLRenderTarget* dst, S32 type); - void ExodusRenderVignette(LLRenderTarget* src, LLRenderTarget* dst); - void ExodusRenderPostUpdate(); + void ExodusRenderPost(LLRenderTarget* src, LLRenderTarget* dst, S32 type); + void ExodusRenderVignette(LLRenderTarget* src, LLRenderTarget* dst); + void ExodusRenderPostUpdate(); void ExodusRenderPostSettingsUpdate(); - - BOOL multisample; - U32 mGammaFunc; + + void initVB(); + void destroyVB(); + + BOOL multisample; + U32 mGammaFunc; U32 mInvGammaFunc; + private: - LLVector2 etc1; - LLVector2 etc2; + LLVector2 etc1; + LLVector2 etc2; LLPointer mExoPostBuffer; protected: LLRenderTarget mTex2DTargetBuffer; // Need this for texture2Dlod functionality. + public: // Cached settings. static LLVector3 sExodusRenderVignette; diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index be86cf5803..79613daf1a 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -62,7 +62,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 -RenderCompressTextures 1 0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -360,8 +360,8 @@ RenderVBOEnable 1 1 // // VRAM > 512MB // -//list VRAMGT512 -//RenderCompressTextures 1 0 +list VRAMGT512 +RenderCompressTextures 1 0 // // No Pixel Shaders available diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index 2efcad49c8..8d1a61da79 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -62,7 +62,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 -RenderCompressTextures 1 0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -359,8 +359,8 @@ RenderVBOEnable 1 1 // // VRAM > 512MB // -//list VRAMGT512 -//RenderCompressTextures 1 0 +list VRAMGT512 +RenderCompressTextures 1 0 // // No Pixel Shaders available diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index c3fd72d9d2..53f8bfe7f3 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -62,7 +62,7 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 -RenderCompressTextures 1 0 +RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -386,8 +386,8 @@ RenderShadowDetail 0 0 // // VRAM > 512MB // -//list VRAMGT512 -//RenderCompressTextures 1 0 +list VRAMGT512 +RenderCompressTextures 1 0 // // "Default" setups for safe, low, medium, high diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index 4833a5d7b9..d1b0e1752e 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -29,6 +29,7 @@ #include "fsareasearch.h" +#include "llavatarnamecache.h" #include "llscrolllistctrl.h" #include "lllineeditor.h" #include "lltextbox.h" @@ -1076,17 +1077,41 @@ void FSAreaSearch::updateObjectCosts(const LLUUID& object_id, F32 object_cost, F void FSAreaSearch::getNameFromUUID(LLUUID& id, std::string& name, BOOL group, bool& name_requested) { - BOOL is_group; - - if(!gCacheName->getIfThere(id, name, is_group)) + if (group) { - if(std::find(mNamesRequested.begin(), mNamesRequested.end(), id) == mNamesRequested.end()) + BOOL is_group; + if(!gCacheName->getIfThere(id, name, is_group)) { - mNamesRequested.push_back(id); - gCacheName->get(id, group, boost::bind(&FSAreaSearch::callbackLoadFullName, this, _1, _2)); + if(std::find(mNamesRequested.begin(), mNamesRequested.end(), id) == mNamesRequested.end()) + { + mNamesRequested.push_back(id); + gCacheName->get(id, group, boost::bind(&FSAreaSearch::callbackLoadFullName, this, _1, _2)); + } + name_requested = true; } - name_requested = true; } + else + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(id, &av_name)) + { + name = av_name.getUserName(); + } + else + { + if(std::find(mNamesRequested.begin(), mNamesRequested.end(), id) == mNamesRequested.end()) + { + mNamesRequested.push_back(id); + LLAvatarNameCache::get(id, boost::bind(&FSAreaSearch::avatarNameCacheCallback, this, _1, _2)); + } + name_requested = true; + } + } +} + +void FSAreaSearch::avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name) +{ + callbackLoadFullName(id, av_name.getUserName()); } void FSAreaSearch::callbackLoadFullName(const LLUUID& id, const std::string& full_name) diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index d308f26ab6..98fe81808e 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -37,6 +37,7 @@ #include #include "llscrolllistcolumn.h" +class LLAvatarName; class LLTextBox; class LLViewerRegion; class LLCheckBoxCtrl; @@ -112,6 +113,7 @@ public: virtual void draw(); virtual void onOpen(const LLSD& key); + void avatarNameCacheCallback(const LLUUID& id, const LLAvatarName& av_name); void callbackLoadFullName(const LLUUID& id, const std::string& full_name); void processObjectProperties(LLMessageSystem* msg); void updateObjectCosts(const LLUUID& object_id, F32 object_cost, F32 link_cost, F32 physics_cost, F32 link_physics_cost); diff --git a/indra/newview/fsblocklistmenu.cpp b/indra/newview/fsblocklistmenu.cpp index 9cfe3d3ba2..b83bed109f 100644 --- a/indra/newview/fsblocklistmenu.cpp +++ b/indra/newview/fsblocklistmenu.cpp @@ -39,7 +39,9 @@ LLContextMenu* FSBlockListMenu::createMenu() LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; registrar.add("Block.Action", boost::bind(&FSBlockListMenu::onContextMenuItemClick, this, _2)); + enable_registrar.add("Block.Check", boost::bind(&FSBlockListMenu::onContextMenuItemCheck, this, _2)); enable_registrar.add("Block.Enable", boost::bind(&FSBlockListMenu::onContextMenuItemEnable, this, _2)); + enable_registrar.add("Block.Visible", boost::bind(&FSBlockListMenu::onContextMenuItemVisible, this, _2)); return createFromFile("menu_fs_block_list.xml"); } @@ -62,6 +64,20 @@ void FSBlockListMenu::onContextMenuItemClick(const LLSD& userdata) } } +bool FSBlockListMenu::onContextMenuItemCheck(const LLSD& userdata) +{ + if (mSpawningCtrl) + { + FSPanelBlockList* blocklist = mSpawningCtrl->getParentByType(); + if (blocklist) + { + return blocklist->isActionChecked(userdata); + } + } + + return false; +} + bool FSBlockListMenu::onContextMenuItemEnable(const LLSD& userdata) { if (mSpawningCtrl) @@ -75,3 +91,17 @@ bool FSBlockListMenu::onContextMenuItemEnable(const LLSD& userdata) return false; } + +bool FSBlockListMenu::onContextMenuItemVisible(const LLSD& userdata) +{ + if (mSpawningCtrl) + { + FSPanelBlockList* blocklist = mSpawningCtrl->getParentByType(); + if (blocklist) + { + return blocklist->isActionVisible(userdata); + } + } + + return false; +} diff --git a/indra/newview/fsblocklistmenu.h b/indra/newview/fsblocklistmenu.h index ef6879f002..34b9a0f32c 100644 --- a/indra/newview/fsblocklistmenu.h +++ b/indra/newview/fsblocklistmenu.h @@ -44,7 +44,9 @@ public: private: void onContextMenuItemClick(const LLSD& userdata); + bool onContextMenuItemCheck(const LLSD& userdata); bool onContextMenuItemEnable(const LLSD& userdata); + bool onContextMenuItemVisible(const LLSD& userdata); LLView* mSpawningCtrl; }; diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index 1e832201b3..c74c2371d7 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -306,9 +306,9 @@ public: void mute(const LLUUID& participant_id, U32 flags) { BOOL is_muted = LLMuteList::getInstance()->isMuted(participant_id, flags); - std::string name; - gCacheName->getFullName(participant_id, name); - LLMute mute(participant_id, name, LLMute::AGENT); + LLAvatarName av_name; + LLAvatarNameCache::get(participant_id, &av_name); + LLMute mute(participant_id, av_name.getUserName(), LLMute::AGENT); if (!is_muted) { diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 1359a794ec..0468d08681 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -86,6 +86,18 @@ FSData::FSData() : mFSDataURL = mBaseURL + "/" + "data.xml"; } +FSData::~FSData() +{ + for (avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.begin(); it != mAvatarNameCacheConnections.end(); ++it) + { + if (it->second.connected()) + { + it->second.disconnect(); + } + } + mAvatarNameCacheConnections.clear(); +} + void FSData::processResponder(const LLSD& content, const std::string& url, bool save_to_file, const LLDate& last_modified) { if (url == mFSDataURL) @@ -783,6 +795,21 @@ bool FSData::isAgentFlag(const LLUUID& agent_id, flags_t flag) return (iter->second & flag); } +void FSData::onNameCache(const LLUUID& av_id, const LLAvatarName& av_name) +{ + avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(av_id); + if (it != mAvatarNameCacheConnections.end()) + { + if (it->second.connected()) + { + it->second.disconnect(); + } + mAvatarNameCacheConnections.erase(it); + } + LLMute mute(av_id, av_name.getUserName(), LLMute::EXTERNAL); + LLMuteList::getInstance()->add(mute); +} + // this is called in two different places due to can recieved .xml before gCacheName is created and vice versa. void FSData::addAgents() { @@ -796,10 +823,18 @@ void FSData::addAgents() if (iter->second & NO_SPAM) { LLUUID id = iter->first; - std::string name; - gCacheName->getFullName(id, name); - LLMute mute(id, name, LLMute::EXTERNAL); - LLMuteList::getInstance()->add(mute); + avatar_name_cache_connection_map_t::iterator it = mAvatarNameCacheConnections.find(id); + if (it != mAvatarNameCacheConnections.end()) + { + if (it->second.connected()) + { + it->second.disconnect(); + } + mAvatarNameCacheConnections.erase(it); + } + + LLAvatarNameCache::callback_connection_t cb = LLAvatarNameCache::get(id, boost::bind(&FSData::onNameCache, this, _1, _2)); + mAvatarNameCacheConnections.insert(std::make_pair(id, cb)); } } } diff --git a/indra/newview/fsdata.h b/indra/newview/fsdata.h index 16bb3dbf32..45c13ebca1 100644 --- a/indra/newview/fsdata.h +++ b/indra/newview/fsdata.h @@ -30,12 +30,14 @@ #include "llinstantmessage.h" #include "llsingleton.h" +#include "llavatarnamecache.h" class FSData : public LLSingleton { LOG_CLASS(FSData); LLSINGLETON(FSData); + virtual ~FSData(); public: @@ -90,6 +92,7 @@ private: void processData(const LLSD& fs_data); void processClientTags(const LLSD& tags); void updateClientTagsLocal(); + void onNameCache(const LLUUID& av_id, const LLAvatarName& av_name); std::map mSupportAgents; std::map mBlockedVersions; @@ -114,6 +117,9 @@ private: bool mLegacySearch; bool mFSDataDone; bool mAgentsDone; + + typedef std::map avatar_name_cache_connection_map_t; + avatar_name_cache_connection_map_t mAvatarNameCacheConnections; }; #endif // FS_DATA_H diff --git a/indra/newview/fsfloaterexport.cpp b/indra/newview/fsfloaterexport.cpp index 7ba7f6c62e..40baea6dd9 100644 --- a/indra/newview/fsfloaterexport.cpp +++ b/indra/newview/fsfloaterexport.cpp @@ -300,8 +300,9 @@ bool FSFloaterObjectExport::exportSelection() mTextureChecked.clear(); std::string author = "Unknown"; - if (gCacheName) - gCacheName->getFullName(gAgentID, author); + if (!gAgentUsername.empty()) + author = gAgentUsername; + time_t rawtime; time(&rawtime); struct tm* utc_time = gmtime(&rawtime); diff --git a/indra/newview/fsfloaternearbychat.cpp b/indra/newview/fsfloaternearbychat.cpp index b8572105c3..3d49ae820c 100644 --- a/indra/newview/fsfloaternearbychat.cpp +++ b/indra/newview/fsfloaternearbychat.cpp @@ -564,8 +564,8 @@ void FSFloaterNearbyChat::loadHistory() } std::string legacy_name = gCacheName->buildLegacyName(from); - gCacheName->getUUID(legacy_name, from_id); - } + from_id = LLAvatarNameCache::findIdByName(legacy_name); + } LLChat chat; chat.mFromName = from; diff --git a/indra/newview/fsnearbychathub.cpp b/indra/newview/fsnearbychathub.cpp index eeb1177ffb..6bfbc2c722 100644 --- a/indra/newview/fsnearbychathub.cpp +++ b/indra/newview/fsnearbychathub.cpp @@ -35,6 +35,7 @@ #include "fsnearbychatcontrol.h" #include "llagent.h" // gAgent #include "llanimationstates.h" // ANIM_AGENT_WHISPER, ANIM_AGENT_TALK, ANIM_AGENT_SHOUT +#include "llavatarnamecache.h" #include "llchatentry.h" #include "llcommandhandler.h" #include "llgesturemgr.h" @@ -752,8 +753,10 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 * // Look for a match while (iter != avatar_ids.end() && !found) { - if (gCacheName->getFullName(*iter++, name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(*iter++, &av_name)) { + name = av_name.getUserName(); if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { name = RlvStrings::getAnonym(name); @@ -778,8 +781,10 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 * // Look for a match while (iter != avatar_ids.end() && !found) { - if (gCacheName->getFullName(*iter++, name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(*iter++, &av_name)) { + name = av_name.getUserName(); if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { name = RlvStrings::getAnonym(name); @@ -794,7 +799,16 @@ void FSNearbyChat::handleChatBarKeystroke(LLUICtrl* source, S32 channel /* = 0 * if (found) { std::string first_name, last_name; - gCacheName->getFirstLastName(*(iter - 1), first_name, last_name); + LLAvatarName av_name; + LLAvatarNameCache::get(*(iter - 1), &av_name); + std::string username = av_name.getLegacyName(); + size_t delim_pos = username.find(' '); + first_name = username.substr(0, delim_pos); + if (delim_pos + 1 < username.length()) + { + last_name = username.substr(delim_pos + 1, std::string::npos); + } + std::string rest_of_match; std::string replaced_text; if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) diff --git a/indra/newview/fspanelblocklist.cpp b/indra/newview/fspanelblocklist.cpp index 359214ed5a..adc1c8cc73 100644 --- a/indra/newview/fspanelblocklist.cpp +++ b/indra/newview/fspanelblocklist.cpp @@ -65,6 +65,7 @@ FSPanelBlockList::FSPanelBlockList() mCommitCallbackRegistrar.add("Block.Action", boost::bind(&FSPanelBlockList::onCustomAction, this, _2)); mEnableCallbackRegistrar.add("Block.Check", boost::bind(&FSPanelBlockList::isActionChecked, this, _2)); mEnableCallbackRegistrar.add("Block.Enable", boost::bind(&FSPanelBlockList::isActionEnabled, this, _2)); + mEnableCallbackRegistrar.add("Block.Visible", boost::bind(&FSPanelBlockList::isActionVisible, this, _2)); } void FSPanelBlockList::removePicker() @@ -92,7 +93,7 @@ BOOL FSPanelBlockList::postBuild() mBlockedList->setDoubleClickCallback(boost::bind(&FSPanelBlockList::showProfile, this)); mBlockedList->setSearchColumn(mBlockedList->getColumn("item_name")->mIndex); mBlockedList->setContextMenu(&gFSBlockListMenu); - mBlockedList->setFilterColumn(0); + mBlockedList->setFilterColumn(COL_NAME); mBlockedList->setSortChangedCallback(boost::bind(&FSPanelBlockList::onSortChanged, this)); getChild("unblock_btn")->setCommitCallback(boost::bind(&FSPanelBlockList::removeMutes, this)); @@ -210,8 +211,8 @@ void FSPanelBlockList::removeMutes() std::vector selected_items = mBlockedList->getAllSelected(); for (std::vector::iterator it = selected_items.begin(); it != selected_items.end(); it++) { - std::string name = (*it)->getColumn(0)->getValue().asString(); - LLUUID id = (*it)->getColumn(3)->getValue().asUUID(); + std::string name = (*it)->getColumn(COL_NAME)->getValue().asString(); + LLUUID id = (*it)->getColumn(COL_UUID)->getValue().asUUID(); LLMute mute(id, name); LLMuteList::getInstance()->remove(mute); } @@ -273,49 +274,129 @@ void FSPanelBlockList::onCustomAction(const LLSD& userdata) { showProfile(); } + else if ("block_voice" == command_name) + { + toggleMute(LLMute::flagVoiceChat); + } + else if ("block_text" == command_name) + { + toggleMute(LLMute::flagTextChat); + } + else if ("block_particles" == command_name) + { + toggleMute(LLMute::flagParticles); + } + else if ("block_obj_sounds" == command_name) + { + toggleMute(LLMute::flagObjectSounds); + } } bool FSPanelBlockList::isActionChecked(const LLSD& userdata) { - std::string item = userdata.asString(); + std::string command_name = userdata.asString(); U32 sort_order = gSavedSettings.getU32("BlockPeopleSortOrder"); - if ("sort_by_name" == item) + if ("sort_by_name" == command_name) { return E_SORT_BY_NAME_ASC == sort_order; } - else if ("sort_by_type" == item) + else if ("sort_by_type" == command_name) { return E_SORT_BY_TYPE_ASC == sort_order; } - else if ("sort_by_name_desc" == item) + else if ("sort_by_name_desc" == command_name) { return E_SORT_BY_NAME_DESC == sort_order; } - else if ("sort_by_type_desc" == item) + else if ("sort_by_type_desc" == command_name) { return E_SORT_BY_TYPE_DESC == sort_order; } + else + { + if (!mBlockedList->getFirstSelected()) + { + return false; + } + + LLUUID blocked_id = mBlockedList->getFirstSelected()->getColumn(COL_UUID)->getValue().asUUID(); + + if ("block_voice" == command_name) + { + return LLMuteList::getInstance()->isMuted(blocked_id, LLMute::flagVoiceChat); + } + else if ("block_text" == command_name) + { + return LLMuteList::getInstance()->isMuted(blocked_id, LLMute::flagTextChat); + } + else if ("block_particles" == command_name) + { + return LLMuteList::getInstance()->isMuted(blocked_id, LLMute::flagParticles); + } + else if ("block_obj_sounds" == command_name) + { + return LLMuteList::getInstance()->isMuted(blocked_id, LLMute::flagObjectSounds); + } + } return false; } bool FSPanelBlockList::isActionEnabled(const LLSD& userdata) { - std::string item = userdata.asString(); - if ("unblock_item" == item) + std::string command_name = userdata.asString(); + if ("unblock_item" == command_name) { return (mBlockedList->getNumSelected() > 0); } - else if ("profile_item" == item) + else if ("profile_item" == command_name + || "block_voice" == command_name + || "block_text" == command_name + || "block_particles" == command_name + || "block_obj_sounds" == command_name) { return (mBlockedList->getNumSelected() == 1 && - (LLMute::EType)mBlockedList->getFirstSelected()->getColumn(2)->getValue().asInteger() == LLMute::AGENT); + (LLMute::EType)mBlockedList->getFirstSelected()->getColumn(COL_TYPE)->getValue().asInteger() == LLMute::AGENT); } return false; } +bool FSPanelBlockList::isActionVisible(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + + if ("block_voice" == command_name + || "block_text" == command_name + || "block_particles" == command_name + || "block_obj_sounds" == command_name) + { + return mBlockedList->getNumSelected() == 1 && (LLMute::AGENT == (LLMute::EType)mBlockedList->getFirstSelected()->getColumn(COL_TYPE)->getValue().asInteger()); + } + + return false; +} + +void FSPanelBlockList::toggleMute(U32 flags) +{ + LLScrollListItem* item = mBlockedList->getFirstSelected(); + if (!item) + { + return; + } + + LLMute mute(item->getColumn(COL_UUID)->getValue().asUUID(), item->getColumn(COL_NAME)->getValue().asString(), (LLMute::EType)item->getColumn(COL_TYPE)->getValue().asInteger()); + + if (!LLMuteList::getInstance()->isMuted(item->getColumn(COL_UUID)->getValue().asUUID(), flags)) + { + LLMuteList::getInstance()->add(mute, flags); + } + else + { + LLMuteList::getInstance()->remove(mute, flags); + } +} void FSPanelBlockList::blockResidentByName() { @@ -350,9 +431,9 @@ void FSPanelBlockList::onSelectionChanged() void FSPanelBlockList::showProfile() { if (mBlockedList->getNumSelected() == 1 && - (LLMute::EType)mBlockedList->getFirstSelected()->getColumn(2)->getValue().asInteger() == LLMute::AGENT) + (LLMute::EType)mBlockedList->getFirstSelected()->getColumn(COL_TYPE)->getValue().asInteger() == LLMute::AGENT) { - LLAvatarActions::showProfile(mBlockedList->getFirstSelected()->getColumn(3)->getValue().asUUID()); + LLAvatarActions::showProfile(mBlockedList->getFirstSelected()->getColumn(COL_UUID)->getValue().asUUID()); } } diff --git a/indra/newview/fspanelblocklist.h b/indra/newview/fspanelblocklist.h index 0d81a55a02..2910132236 100644 --- a/indra/newview/fspanelblocklist.h +++ b/indra/newview/fspanelblocklist.h @@ -65,13 +65,24 @@ public: /* virtual */ void onChange() { refreshBlockedList();} private: - typedef enum e_sort_oder{ + typedef enum e_sort_oder + { E_SORT_BY_NAME_ASC = 0, E_SORT_BY_TYPE_ASC = 1, E_SORT_BY_NAME_DESC = 2, E_SORT_BY_TYPE_DESC = 3 } ESortOrder; + + typedef enum e_column_names + { + COL_NAME = 0, + COL_TYPENAME, + COL_TYPE, + COL_UUID + } EColumnNames; + + void refreshBlockedList(); void updateButtons(); void removePicker(); @@ -82,6 +93,7 @@ private: void blockResidentByName(); void blockObjectByName(); void showProfile(); + void toggleMute(U32 flags); void onSelectionChanged(); void onFilterEdit(std::string search_string); @@ -90,6 +102,7 @@ private: void onCustomAction(const LLSD& userdata); bool isActionChecked(const LLSD& userdata); bool isActionEnabled(const LLSD& userdata); + bool isActionVisible(const LLSD& userdata); void callbackBlockPicked(const uuid_vec_t& ids, const std::vector names); void callbackBlockByName(const std::string& text); diff --git a/indra/newview/fspanelprofile.cpp b/indra/newview/fspanelprofile.cpp index f388ed32a4..cda2b4e05d 100644 --- a/indra/newview/fspanelprofile.cpp +++ b/indra/newview/fspanelprofile.cpp @@ -589,8 +589,9 @@ void FSPanelProfileSecondLife::unfreeze() void FSPanelProfileSecondLife::csr() { - std::string name; - gCacheName->getFullName(getAvatarId(), name); + LLAvatarName av_name; + LLAvatarNameCache::get(getAvatarId(), &av_name); + std::string name = av_name.getUserName(); LLAvatarActions::csr(getAvatarId(), name); } diff --git a/indra/newview/lggbeamcolormapfloater.cpp b/indra/newview/lggbeamcolormapfloater.cpp index 265d5e0bea..78e251bcd1 100644 --- a/indra/newview/lggbeamcolormapfloater.cpp +++ b/indra/newview/lggbeamcolormapfloater.cpp @@ -66,7 +66,7 @@ void lggBeamColorMapFloater::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLE_STRIP); { F32 r = bColor.mV[0]; F32 g = bColor.mV[1]; @@ -74,31 +74,24 @@ void lggBeamColorMapFloater::draw() gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); + gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); - gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - - gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); } diff --git a/indra/newview/lggbeammapfloater.cpp b/indra/newview/lggbeammapfloater.cpp index d77c50b013..7bb796ca05 100644 --- a/indra/newview/lggbeammapfloater.cpp +++ b/indra/newview/lggbeammapfloater.cpp @@ -43,35 +43,28 @@ void lggBeamMapFloater::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 48e86f01ca..268cd3e577 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2059,7 +2059,7 @@ void LLAgent::stopAutoPilot(BOOL user_cancel) if (user_cancel && !mAutoPilotBehaviorName.empty()) { if (mAutoPilotBehaviorName == "Sit") - LLNotificationsUtil::add("CancelledSit"); + LL_INFOS("Agent") << "Autopilot-Sit was canceled by user action" << LL_ENDL; else if (mAutoPilotBehaviorName == "Attach") LLNotificationsUtil::add("CancelledAttach"); else diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 0dcb83bce6..d10e7e58c3 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1607,6 +1607,14 @@ LLVector3d LLAgentCamera::calcFocusPositionTargetGlobal() } else if (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR) { + if (mFocusOnAvatar) + { + LLVector3 focus_target = isAgentAvatarValid() + ? gAgentAvatarp->mHeadp->getWorldPosition() + : gAgent.getPositionAgent(); + LLVector3d focus_target_global = gAgent.getPosGlobalFromAgent(focus_target); + mFocusTargetGlobal = focus_target_global; + } return mFocusTargetGlobal; } else if (!mFocusOnAvatar) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 76a11f0237..51c9e25b35 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -661,7 +661,10 @@ static void settings_to_globals() LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); - LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + // Vertex Array Objects are required in OpenGL core profile + //LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + LLVertexBuffer::sUseVAO = LLRender::sGLCoreProfile ? TRUE : gSavedSettings.getBOOL("RenderUseVAO"); + // LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); @@ -3937,7 +3940,12 @@ LLSD LLAppViewer::getViewerInfo() const // http://wiki.phoenixviewer.com/firestorm_change_log_x.y.z.rev //if (! LLStringUtil::endsWith(url, "/")) // url += "/"; - //url += LLURI::escape(LLVersionInfo::getChannel()) + "/"; + //std::string channel = LLVersionInfo::getChannel(); + //if (LLStringUtil::endsWith(boost::to_lower_copy(channel), " edu")) // Release Notes url shouldn't include the EDU parameter + //{ + // boost::erase_tail(channel, 4); + //} + //url += LLURI::escape(channel) + "/"; // url += LLURI::escape(LLVersionInfo::getVersion()); @@ -6479,6 +6487,8 @@ void LLAppViewer::forceErrorBreakpoint() LL_WARNS() << "Forcing a deliberate breakpoint" << LL_ENDL; #ifdef LL_WINDOWS DebugBreak(); +#else + asm ("int $3"); #endif return; } diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 24893eee70..33461ef21e 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -645,15 +645,14 @@ void LLAvatarActions::kick(const LLUUID& id) // static void LLAvatarActions::freezeAvatar(const LLUUID& id) { - std::string fullname; - gCacheName->getFullName(id, fullname); + LLAvatarName av_name; LLSD payload; payload["avatar_id"] = id; - if (!fullname.empty()) + if (LLAvatarNameCache::get(id, &av_name)) { LLSD args; - args["AVATAR_NAME"] = fullname; + args["AVATAR_NAME"] = av_name.getUserName(); LLNotificationsUtil::add("FreezeAvatarFullname", args, payload, handleFreezeAvatar); } else @@ -665,15 +664,15 @@ void LLAvatarActions::freezeAvatar(const LLUUID& id) // static void LLAvatarActions::ejectAvatar(const LLUUID& id, bool ban_enabled) { - std::string fullname; - gCacheName->getFullName(id, fullname); + LLAvatarName av_name; LLSD payload; payload["avatar_id"] = id; payload["ban_enabled"] = ban_enabled; LLSD args; - if (!fullname.empty()) + bool has_name = LLAvatarNameCache::get(id, &av_name); + if (has_name) { - args["AVATAR_NAME"] = fullname; + args["AVATAR_NAME"] = av_name.getUserName(); } if (ban_enabled) @@ -682,7 +681,7 @@ void LLAvatarActions::ejectAvatar(const LLUUID& id, bool ban_enabled) } else { - if (!fullname.empty()) + if (has_name) { LLNotificationsUtil::add("EjectAvatarFullnameNoBan", args, payload, handleEjectAvatar); } @@ -1229,10 +1228,10 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL // static void LLAvatarActions::toggleBlock(const LLUUID& id) { - std::string name; + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); - gCacheName->getFullName(id, name); // needed for mute - LLMute mute(id, name, LLMute::AGENT); + LLMute mute(id, av_name.getUserName(), LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { @@ -1247,13 +1246,13 @@ void LLAvatarActions::toggleBlock(const LLUUID& id) // static void LLAvatarActions::toggleMuteVoice(const LLUUID& id) { - std::string name; - gCacheName->getFullName(id, name); // needed for mute + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); LLMuteList* mute_list = LLMuteList::getInstance(); bool is_muted = mute_list->isMuted(id, LLMute::flagVoiceChat); - LLMute mute(id, name, LLMute::AGENT); + LLMute mute(id, av_name.getUserName(), LLMute::AGENT); if (!is_muted) { mute_list->add(mute, LLMute::flagVoiceChat); @@ -1673,9 +1672,9 @@ bool LLAvatarActions::isFriend(const LLUUID& id) // static bool LLAvatarActions::isBlocked(const LLUUID& id) { - std::string name; - gCacheName->getFullName(id, name); // needed for mute - return LLMuteList::getInstance()->isMuted(id, name); + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); + return LLMuteList::getInstance()->isMuted(id, av_name.getUserName()); } // static @@ -1687,8 +1686,10 @@ bool LLAvatarActions::isVoiceMuted(const LLUUID& id) // static bool LLAvatarActions::canBlock(const LLUUID& id) { - std::string full_name; - gCacheName->getFullName(id, full_name); // needed for mute + LLAvatarName av_name; + LLAvatarNameCache::get(id, &av_name); + + std::string full_name = av_name.getUserName(); bool is_linden = (full_name.find("Linden") != std::string::npos); bool is_self = id == gAgentID; return !is_self && !is_linden; diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp index a90d64a9fb..3f96f8cda8 100644 --- a/indra/newview/llblocklist.cpp +++ b/indra/newview/llblocklist.cpp @@ -55,7 +55,9 @@ LLBlockList::LLBlockList(const Params& p) registrar.add ("Block.Action", boost::bind(&LLBlockList::onCustomAction, this, _2)); enable_registrar.add("Block.Enable", boost::bind(&LLBlockList::isActionEnabled, this, _2)); - + enable_registrar.add("Block.Check", boost::bind(&LLBlockList::isMenuItemChecked, this, _2)); + enable_registrar.add("Block.Visible", boost::bind(&LLBlockList::isMenuItemVisible, this, _2)); + LLToggleableMenu* context_menu = LLUICtrlFactory::getInstance()->createFromFile( "menu_people_blocked_gear.xml", gMenuHolder, @@ -128,7 +130,14 @@ BOOL LLBlockList::handleRightMouseDown(S32 x, S32 y, MASK mask) void LLBlockList::removeListItem(const LLMute* mute) { - removeItemByUUID(mute->mID); + if (mute->mID.notNull()) + { + removeItemByUUID(mute->mID); + } + else + { + removeItemByValue(mute->mName); + } } void LLBlockList::hideListItem(LLBlockedListItem* item, bool show) @@ -176,7 +185,14 @@ void LLBlockList::addNewItem(const LLMute* mute) { item->highlightName(mNameFilter); } - addItem(item, item->getUUID(), ADD_BOTTOM); + if (item->getUUID().notNull()) + { + addItem(item, item->getUUID(), ADD_BOTTOM); + } + else + { + addItem(item, item->getName(), ADD_BOTTOM); + } } void LLBlockList::refresh() @@ -184,7 +200,8 @@ void LLBlockList::refresh() bool have_filter = !mNameFilter.empty(); // save selection to restore it after list rebuilt - LLUUID selected = getSelectedUUID(), next_selected; + LLSD selected = getSelectedValue(); + LLSD next_selected; if(mShouldAddAll) // creating list of blockers { @@ -202,14 +219,15 @@ void LLBlockList::refresh() } else if(mActionType == REMOVE) { - if(selected == mute.mID) + if ((mute.mID.notNull() && selected.isUUID() && selected.asUUID() == mute.mID) + || (mute.mID.isNull() && selected.isString() && selected.asString() == mute.mName)) { // we are going to remove currently selected item, so select next item and save the selection to restore it - if (!selectNextItemPair(false, true)) - { - selectNextItemPair(true, true); - } - next_selected = getSelectedUUID(); + if (!selectNextItemPair(false, true)) + { + selectNextItemPair(true, true); + } + next_selected = getSelectedValue(); } removeListItem(&mute); } @@ -235,15 +253,18 @@ void LLBlockList::refresh() } mPrevNameFilter = mNameFilter; - if (getItemPair(selected)) + if (selected.isDefined()) { - // restore previously selected item - selectItemPair(getItemPair(selected), true); - } - else if (getItemPair(next_selected)) - { - // previously selected item was removed, so select next item - selectItemPair(getItemPair(next_selected), true); + if (getItemPair(selected)) + { + // restore previously selected item + selectItemPair(getItemPair(selected), true); + } + else if (next_selected.isDefined() && getItemPair(next_selected)) + { + // previously selected item was removed, so select next item + selectItemPair(getItemPair(next_selected), true); + } } mMuteListSize = LLMuteList::getInstance()->getMutes().size(); @@ -272,7 +293,11 @@ bool LLBlockList::isActionEnabled(const LLSD& userdata) const std::string command_name = userdata.asString(); - if ("profile_item" == command_name) + if ("profile_item" == command_name + || "block_voice" == command_name + || "block_text" == command_name + || "block_particles" == command_name + || "block_obj_sounds" == command_name) { // Blocklist multi selection //LLBlockedListItem* item = getBlockedItem(); @@ -346,6 +371,83 @@ void LLBlockList::onCustomAction(const LLSD& userdata) break; } } + else if ("block_voice" == command_name) + { + toggleMute(LLMute::flagVoiceChat); + } + else if ("block_text" == command_name) + { + toggleMute(LLMute::flagTextChat); + } + else if ("block_particles" == command_name) + { + toggleMute(LLMute::flagParticles); + } + else if ("block_obj_sounds" == command_name) + { + toggleMute(LLMute::flagObjectSounds); + } +} + +bool LLBlockList::isMenuItemChecked(const LLSD& userdata) +{ + LLBlockedListItem* item = getBlockedItem(); + if (!item) + { + return false; + } + + const std::string command_name = userdata.asString(); + + if ("block_voice" == command_name) + { + return LLMuteList::getInstance()->isMuted(item->getUUID(), LLMute::flagVoiceChat); + } + else if ("block_text" == command_name) + { + return LLMuteList::getInstance()->isMuted(item->getUUID(), LLMute::flagTextChat); + } + else if ("block_particles" == command_name) + { + return LLMuteList::getInstance()->isMuted(item->getUUID(), LLMute::flagParticles); + } + else if ("block_obj_sounds" == command_name) + { + return LLMuteList::getInstance()->isMuted(item->getUUID(), LLMute::flagObjectSounds); + } + + return false; +} + +bool LLBlockList::isMenuItemVisible(const LLSD& userdata) +{ + LLBlockedListItem* item = getBlockedItem(); + const std::string command_name = userdata.asString(); + + if ("block_voice" == command_name + || "block_text" == command_name + || "block_particles" == command_name + || "block_obj_sounds" == command_name) + { + return item && (LLMute::AGENT == item->getType()); + } + + return false; +} + +void LLBlockList::toggleMute(U32 flags) +{ + LLBlockedListItem* item = getBlockedItem(); + LLMute mute(item->getUUID(), item->getName(), item->getType()); + + if (!LLMuteList::getInstance()->isMuted(item->getUUID(), flags)) + { + LLMuteList::getInstance()->add(mute, flags); + } + else + { + LLMuteList::getInstance()->remove(mute, flags); + } } bool LLBlockListItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h index 96af8d898e..ac0729c610 100644 --- a/indra/newview/llblocklist.h +++ b/indra/newview/llblocklist.h @@ -79,6 +79,9 @@ private: bool isActionEnabled(const LLSD& userdata); void onCustomAction (const LLSD& userdata); + bool isMenuItemChecked(const LLSD& userdata); + bool isMenuItemVisible(const LLSD& userdata); + void toggleMute(U32 flags); void createList(); BlockListActionType getCurrentMuteListActionType(); diff --git a/indra/newview/llbox.cpp b/indra/newview/llbox.cpp index faf82695fe..42b11e6a15 100644 --- a/indra/newview/llbox.cpp +++ b/indra/newview/llbox.cpp @@ -76,17 +76,37 @@ void LLBox::renderface(S32 which_face) {7, 4, 0, 3} }; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // //gGL.normal3fv(&normals[which_face][0]); + // gGL.texCoord2f(1,0); + // gGL.vertex3fv(&mVertex[ faces[which_face][0] ][0]); + // gGL.texCoord2f(1,1); + // gGL.vertex3fv(&mVertex[ faces[which_face][1] ][0]); + // gGL.texCoord2f(0,1); + // gGL.vertex3fv(&mVertex[ faces[which_face][2] ][0]); + // gGL.texCoord2f(0,0); + // gGL.vertex3fv(&mVertex[ faces[which_face][3] ][0]); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { //gGL.normal3fv(&normals[which_face][0]); - gGL.texCoord2f(1,0); + gGL.texCoord2f(1.f, 0.f); gGL.vertex3fv(&mVertex[ faces[which_face][0] ][0]); - gGL.texCoord2f(1,1); + gGL.texCoord2f(1.f, 1.f); gGL.vertex3fv(&mVertex[ faces[which_face][1] ][0]); - gGL.texCoord2f(0,1); + gGL.texCoord2f(0.f, 1.f); gGL.vertex3fv(&mVertex[ faces[which_face][2] ][0]); - gGL.texCoord2f(0,0); + + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3fv(&mVertex[ faces[which_face][0] ][0]); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3fv(&mVertex[ faces[which_face][2] ][0]); + gGL.texCoord2f(0.f, 0.f); gGL.vertex3fv(&mVertex[ faces[which_face][3] ][0]); + } gGL.end(); + // } void LLBox::render() diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 3ac3cc172f..753a78fefd 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -251,7 +251,6 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) using namespace std; U32 new_buddy_count = 0; - std::string full_name; LLUUID agent_id; for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) { @@ -261,8 +260,11 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) { ++new_buddy_count; mBuddyInfo[agent_id] = (*itr).second; - // IDEVO: is this necessary? name is unused? - gCacheName->getFullName(agent_id, full_name); + + // pre-request name for notifications? + LLAvatarName av_name; + LLAvatarNameCache::get(agent_id, &av_name); + addChangedMask(LLFriendObserver::ADD, agent_id); LL_DEBUGS() << "Added buddy " << agent_id << ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline") @@ -1045,7 +1047,9 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getFullName(buddy_id, mFullName); + LLAvatarName av_name; + LLAvatarNameCache::get(buddy_id, &av_name); + mFullName = av_name.getUserName(); buddy_map_t::value_type value(buddy_id, mFullName); if(buddy->isOnline()) { diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 9b8feba76e..034aaf4526 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -284,9 +284,9 @@ public: void mute(const LLUUID& participant_id, U32 flags) { BOOL is_muted = LLMuteList::getInstance()->isMuted(participant_id, flags); - std::string name; - gCacheName->getFullName(participant_id, name); - LLMute mute(participant_id, name, LLMute::AGENT); + LLAvatarName av_name; + LLAvatarNameCache::get(participant_id, &av_name); + LLMute mute(participant_id, av_name.getUserName(), LLMute::AGENT); if (!is_muted) { diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c167e75f71..6ccf62a6ca 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -604,12 +604,12 @@ bool LLConversationItemParticipant::isVoiceMuted() void LLConversationItemParticipant::muteVoice(bool mute_voice) { - std::string name; - gCacheName->getFullName(mUUID, name); + LLAvatarName av_name; + LLAvatarNameCache::get(mUUID, &av_name); LLMuteList * mute_listp = LLMuteList::getInstance(); - bool voice_already_muted = mute_listp->isMuted(mUUID, name); + bool voice_already_muted = mute_listp->isMuted(mUUID, av_name.getUserName()); - LLMute mute(mUUID, name, LLMute::AGENT); + LLMute mute(mUUID, av_name.getUserName(), LLMute::AGENT); if (voice_already_muted && !mute_voice) { mute_listp->remove(mute); diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 3a1f9fe484..42d14017a6 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -617,29 +617,38 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, S32 pass) (!params.mParticle || params.mHasGlow)) // { - // LL materials support merge error LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_GLOW); // install glow-accumulating blend mode gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE, // don't touch color LLRender::BF_ONE, LLRender::BF_ONE); // add to alpha (glow) - // LL materials support merge error - //emissive_shader->bind(); - // - //params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); - params.mVertexBuffer->setBuffer(mask | LLVertexBuffer::MAP_EMISSIVE); + // Performance fix when not using OpenGL core profile + if (LLRender::sGLCoreProfile) + { // + emissive_shader->bind(); + + params.mVertexBuffer->setBuffer((mask & ~LLVertexBuffer::MAP_COLOR) | LLVertexBuffer::MAP_EMISSIVE); // do the actual drawing, again params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); // restore our alpha blend mode - // LL materials support merge error - //gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); + gGL.blendFunc(mColorSFactor, mColorDFactor, mAlphaSFactor, mAlphaDFactor); - //current_shader->bind(); + current_shader->bind(); + // Performance fix when not using OpenGL core profile + } + else + { + params.mVertexBuffer->setBuffer(mask | LLVertexBuffer::MAP_EMISSIVE); + + // do the actual drawing, again + params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset); + gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode); + } // } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 934254db80..f0e2ee392a 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -2373,10 +2373,11 @@ void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) else { // Additional debugging code - //LL_ERRS() << "Face reference data corrupt for rigged type " << i << LL_ENDL; - std::string cause = (index >= mRiggedFace[i].size() ? "Index out of bounds" : "Index incorrect"); - LL_WARNS() << "Face reference data corrupt for rigged type " << i << ": " << cause << LL_ENDL; + //LL_ERRS() << "Face reference data corrupt for rigged type " << i + LL_WARNS() << "Face reference data corrupt for rigged type " << i // + << ((mRiggedFace[i].size() <= index) ? "; wrong index (out of bounds)" : (mRiggedFace[i][index] != facep) ? "; wrong face pointer" : "") + << LL_ENDL; } } } diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 314b859cea..711a87dc99 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -44,7 +44,7 @@ public: mExpanderLabel(more_text) {} - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { // more label always spans width of text box if (num_chars == 0) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index c6d64ae50f..3d5563c627 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -503,7 +503,10 @@ U16 LLFace::getGeometryAvatar( LLStrider &normals, LLStrider &tex_coords, LLStrider &vertex_weights, - LLStrider &clothing_weights) + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider &clothing_weights) + LLStrider &clothing_weights) + // { if (mVertexBuffer.notNull()) { @@ -594,16 +597,27 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) glPolygonOffset(-1.f, -1.f); gGL.multMatrix((F32*) volume->getRelativeXform().mMatrix); const LLVolumeFace& vol_face = rigged->getVolumeFace(getTEOffset()); - LLVertexBuffer::unbind(); - glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); - if (vol_face.mTexCoords) + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + if (LLGLSLShader::sNoFixedFunction) { - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, vol_face.mTexCoords, vol_face.mNumIndices, vol_face.mIndices); } - gGL.syncMatrices(); - glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + else + { + // + LLVertexBuffer::unbind(); + glVertexPointer(3, GL_FLOAT, 16, vol_face.mPositions); + if (vol_face.mTexCoords) + { + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glTexCoordPointer(2, GL_FLOAT, 8, vol_face.mTexCoords); + } + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, vol_face.mNumIndices, GL_UNSIGNED_SHORT, vol_face.mIndices); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } + // } } } @@ -1189,11 +1203,15 @@ void LLFace::cacheFaceInVRAM(const LLVolumeFace& vf) if (vf.mWeights) { - LLStrider f_wght; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider f_wght; + LLStrider f_wght; buff->getWeight4Strider(f_wght); for (U32 i = 0; i < vf.mNumVertices; ++i) { - (*f_wght++).set(vf.mWeights[i].getF32ptr()); + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //(*f_wght++).set(vf.mWeights[i].getF32ptr()); + (*f_wght++) = vf.mWeights[i]; } } @@ -1316,7 +1334,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, LLStrider colors; LLStrider tangent; LLStrider indicesp; - LLStrider wght; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider wght; + LLStrider wght; BOOL full_rebuild = force_rebuild || mDrawablep->isState(LLDrawable::REBUILD_VOLUME); @@ -2185,8 +2205,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, { LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_WEIGHTS); mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range); - F32* weights = (F32*) wght.get(); - LLVector4a::memcpyNonAliased16(weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32)); + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //F32* weights = (F32*) wght.get(); + //LLVector4a::memcpyNonAliased16(weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32)); + for (S32 i = 0; i < num_vertices; ++i) + { + *(wght++) = vf.mWeights[i]; + } + // if (map_range) { mVertexBuffer->flush(); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 35cfdc1f8b..5e3a83bcfd 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -174,7 +174,9 @@ public: LLStrider &normals, LLStrider &texCoords, LLStrider &vertex_weights, - LLStrider &clothing_weights); + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider &clothing_weights); + LLStrider &clothing_weights); // For volumes, etc. U16 getGeometry(LLStrider &vertices, diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 639a516397..844e825228 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -409,7 +409,16 @@ F32 gpu_benchmark(); bool LLFeatureManager::loadGPUClass() { //get memory bandwidth from benchmark - F32 gbps = gpu_benchmark(); + + // Allow to skip gpu_benchmark with -noprobe. + // This can make sense for some Intel GPUs which can take 15+ Minutes or crash during gpu_benchmark + + // F32 gbps = gpu_benchmark(); + F32 gbps = -1.0f; + if( !gSavedSettings.getBOOL( "NoHardwareProbe" ) ) + gbps = gpu_benchmark(); + + // if (gbps < 0.f) { //couldn't bench, use GLVersion @@ -766,10 +775,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("MapBufferRange"); } - //if (gGLManager.mVRAM > 512) - //{ - // maskFeatures("VRAMGT512"); - //} + if (gGLManager.mVRAM > 512) + { + maskFeatures("VRAMGT512"); + } #if LL_DARWIN const LLOSInfo& osInfo = LLAppViewer::instance()->getOSInfo(); diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index f2af9b5300..e67a6a2b77 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -37,6 +37,7 @@ LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) : mWearableList(list) , mCollector(collector) +, mListStale(true) { llassert(mWearableList); gInventory.addObserver(this); @@ -64,7 +65,16 @@ void LLFilteredWearableListManager::changed(U32 mask) return; } - populateList(); + if (mWearableList->isInVisibleChain() || mWearableList->getForceRefresh()) + { + // Todo: current populateList() is time consuming and changed() is time-sensitive, + // either move from here or optimize + populateList(); + } + else + { + mListStale = true; + } } void LLFilteredWearableListManager::setFilterCollector(LLInventoryCollectFunctor* collector) @@ -73,13 +83,31 @@ void LLFilteredWearableListManager::setFilterCollector(LLInventoryCollectFunctor populateList(); } +void LLFilteredWearableListManager::populateIfNeeded() +{ + if (mListStale) + { + populateList(); + } +} + +LLTrace::BlockTimerStatHandle FTM_MANAGER_LIST_POPULATION("Manager List Population"); + void LLFilteredWearableListManager::populateList() { + LL_RECORD_BLOCK_TIME(FTM_MANAGER_LIST_POPULATION); + LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; if(mCollector) { + // Too slow with large inventory! + // Consider refactoring into "request once, append ids on changed()", since + // Inventory observer provides ids of changed items this should be possible, + // but will likely require modifying LLInventoryItemsList to avoid code-repeats. + // Or make something like "gather everything and filter manually on idle" + mListStale = false; gInventory.collectDescendentsIf( gInventory.getRootFolderID(), cat_array, diff --git a/indra/newview/llfilteredwearablelist.h b/indra/newview/llfilteredwearablelist.h index f44ab1466f..197302f41d 100644 --- a/indra/newview/llfilteredwearablelist.h +++ b/indra/newview/llfilteredwearablelist.h @@ -52,9 +52,9 @@ public: void setFilterCollector(LLInventoryCollectFunctor* collector); /** - * Populates wearable list with filtered data. - */ - void populateList(); + * Populates wearable list with filtered data in case there were any updates. + */ + void populateIfNeeded(); /** * Drop operation @@ -62,8 +62,14 @@ public: void holdProgress(); private: + /** + * Populates wearable list with filtered data. + */ + void populateList(); + LLInventoryItemsList* mWearableList; LLInventoryCollectFunctor* mCollector; + bool mListStale; }; #endif //LL_LLFILTEREDWEARABLELIST_H diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a9f7d30f3f..4624274559 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -531,37 +531,63 @@ void LLFloaterAvatarPicker::drawFrustum() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); - gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); - - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); - gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); + // } if (gFocusMgr.childHasMouseCapture(getDragHandle())) diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp new file mode 100644 index 0000000000..37073be838 --- /dev/null +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -0,0 +1,289 @@ +/** + * @file llfloateravatarrendersettings.cpp + * @brief Shows the list of avatars with non-default rendering settings + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#if 0 // [FS Persisted Avatar Render Settings] + +#include "llfloateravatarrendersettings.h" + +#include "llavatarnamecache.h" +#include "llfloateravatarpicker.h" +#include "llfiltereditor.h" +#include "llfloaterreg.h" +#include "llnamelistctrl.h" +#include "llmenugl.h" +#include "llviewerobjectlist.h" +#include "llvoavatar.h" + +class LLSettingsContextMenu : public LLListContextMenu + +{ +public: + LLSettingsContextMenu(LLFloaterAvatarRenderSettings* floater_settings) + : mFloaterSettings(floater_settings) + {} +protected: + LLContextMenu* createMenu() + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + registrar.add("Settings.SetRendering", boost::bind(&LLFloaterAvatarRenderSettings::onCustomAction, mFloaterSettings, _2, mUUIDs.front())); + enable_registrar.add("Settings.IsSelected", boost::bind(&LLFloaterAvatarRenderSettings::isActionChecked, mFloaterSettings, _2, mUUIDs.front())); + LLContextMenu* menu = createFromFile("menu_avatar_rendering_settings.xml"); + + return menu; + } + + LLFloaterAvatarRenderSettings* mFloaterSettings; +}; + +class LLAvatarRenderMuteListObserver : public LLMuteListObserver +{ + /* virtual */ void onChange() { LLFloaterAvatarRenderSettings::setNeedsUpdate();} +}; + +static LLAvatarRenderMuteListObserver sAvatarRenderMuteListObserver; + +LLFloaterAvatarRenderSettings::LLFloaterAvatarRenderSettings(const LLSD& key) +: LLFloater(key), + mAvatarSettingsList(NULL), + mNeedsUpdate(false) +{ + mContextMenu = new LLSettingsContextMenu(this); + LLRenderMuteList::getInstance()->addObserver(&sAvatarRenderMuteListObserver); + mCommitCallbackRegistrar.add("Settings.AddNewEntry", boost::bind(&LLFloaterAvatarRenderSettings::onClickAdd, this, _2)); +} + +LLFloaterAvatarRenderSettings::~LLFloaterAvatarRenderSettings() +{ + delete mContextMenu; + LLRenderMuteList::getInstance()->removeObserver(&sAvatarRenderMuteListObserver); +} + +BOOL LLFloaterAvatarRenderSettings::postBuild() +{ + LLFloater::postBuild(); + mAvatarSettingsList = getChild("render_settings_list"); + mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3)); + this->setVisibleCallback(boost::bind(&LLFloaterAvatarRenderSettings::removePicker, this)); + getChild("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2)); + + return TRUE; +} + +void LLFloaterAvatarRenderSettings::removePicker() +{ + if(mPicker.get()) + { + mPicker.get()->closeFloater(); + } +} + +void LLFloaterAvatarRenderSettings::draw() +{ + if(mNeedsUpdate) + { + updateList(); + mNeedsUpdate = false; + } + + LLFloater::draw(); +} + +void LLFloaterAvatarRenderSettings::onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y) +{ + LLNameListCtrl* list = dynamic_cast(ctrl); + if (!list) return; + list->selectItemAt(x, y, MASK_NONE); + uuid_vec_t selected_uuids; + + if(list->getCurrentID().notNull()) + { + selected_uuids.push_back(list->getCurrentID()); + mContextMenu->show(ctrl, selected_uuids, x, y); + } +} + +void LLFloaterAvatarRenderSettings::onOpen(const LLSD& key) +{ + updateList(); +} + +void LLFloaterAvatarRenderSettings::updateList() +{ + mAvatarSettingsList->deleteAllItems(); + LLAvatarName av_name; + LLNameListCtrl::NameItem item_params; + for (std::map::iterator iter = LLRenderMuteList::getInstance()->sVisuallyMuteSettingsMap.begin(); iter != LLRenderMuteList::getInstance()->sVisuallyMuteSettingsMap.end(); iter++) + { + item_params.value = iter->first; + LLAvatarNameCache::get(iter->first, &av_name); + if(!isHiddenRow(av_name.getCompleteName())) + { + item_params.columns.add().value(av_name.getCompleteName()).column("name"); + std::string setting = getString(iter->second == 1 ? "av_never_render" : "av_always_render"); + item_params.columns.add().value(setting).column("setting"); + mAvatarSettingsList->addNameItemRow(item_params); + } + } +} + +void LLFloaterAvatarRenderSettings::onFilterEdit(const std::string& search_string) +{ + std::string filter_upper = search_string; + LLStringUtil::toUpper(filter_upper); + if (mNameFilter != filter_upper) + { + mNameFilter = filter_upper; + mNeedsUpdate = true; + } +} + +bool LLFloaterAvatarRenderSettings::isHiddenRow(const std::string& av_name) +{ + if (mNameFilter.empty()) return false; + std::string upper_name = av_name; + LLStringUtil::toUpper(upper_name); + return std::string::npos == upper_name.find(mNameFilter); +} + +static LLVOAvatar* find_avatar(const LLUUID& id) +{ + LLViewerObject *obj = gObjectList.findObject(id); + while (obj && obj->isAttachment()) + { + obj = (LLViewerObject *)obj->getParent(); + } + + if (obj && obj->isAvatar()) + { + return (LLVOAvatar*)obj; + } + else + { + return NULL; + } +} + + +void LLFloaterAvatarRenderSettings::onCustomAction (const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 new_setting = 0; + if ("default" == command_name) + { + new_setting = S32(LLVOAvatar::AV_RENDER_NORMALLY); + } + else if ("never" == command_name) + { + new_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER); + } + else if ("always" == command_name) + { + new_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER); + } + + LLVOAvatar *avatarp = find_avatar(av_id); + if (avatarp) + { + avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(new_setting)); + } + else + { + LLRenderMuteList::getInstance()->saveVisualMuteSetting(av_id, new_setting); + } +} + + +bool LLFloaterAvatarRenderSettings::isActionChecked(const LLSD& userdata, const LLUUID& av_id) +{ + const std::string command_name = userdata.asString(); + + S32 visual_setting = LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(av_id); + if ("default" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_RENDER_NORMALLY)); + } + else if ("never" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_DO_NOT_RENDER)); + } + else if ("always" == command_name) + { + return (visual_setting == S32(LLVOAvatar::AV_ALWAYS_RENDER)); + } + return false; +} + +void LLFloaterAvatarRenderSettings::setNeedsUpdate() +{ + LLFloaterAvatarRenderSettings* instance = LLFloaterReg::getTypedInstance("avatar_render_settings"); + if(!instance) return; + instance->mNeedsUpdate = true; +} + +void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata) +{ + const std::string command_name = userdata.asString(); + S32 visual_setting = 0; + if ("never" == command_name) + { + visual_setting = S32(LLVOAvatar::AV_DO_NOT_RENDER); + } + else if ("always" == command_name) + { + visual_setting = S32(LLVOAvatar::AV_ALWAYS_RENDER); + } + + LLView * button = findChild("plus_btn", TRUE); + LLFloater* root_floater = gFloaterView->getParentFloater(this); + LLFloaterAvatarPicker * picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterAvatarRenderSettings::callbackAvatarPicked, this, _1, visual_setting), + FALSE, TRUE, FALSE, root_floater->getName(), button); + + if (root_floater) + { + root_floater->addDependentFloater(picker); + } + + mPicker = picker->getHandle(); +} + +void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting) +{ + if (ids.empty()) return; + + LLVOAvatar *avatarp = find_avatar(ids[0]); + if (avatarp) + { + avatarp->setVisualMuteSettings(LLVOAvatar::VisualMuteSettings(visual_setting)); + } + else + { + LLRenderMuteList::getInstance()->saveVisualMuteSetting(ids[0], visual_setting); + } +} +#endif \ No newline at end of file diff --git a/indra/newview/llfloateravatarrendersettings.h b/indra/newview/llfloateravatarrendersettings.h new file mode 100644 index 0000000000..6f22fe9875 --- /dev/null +++ b/indra/newview/llfloateravatarrendersettings.h @@ -0,0 +1,75 @@ +/** + * @file llfloateravatarrendersettings.h + * @brief Shows the list of avatars with non-default rendering settings + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#if 0 // [FS Persisted Avatar Render Settings] + +#ifndef LL_LLFLOATERAVATARRENDERSETTINGS_H +#define LL_LLFLOATERAVATARRENDERSETTINGS_H + +#include "llfloater.h" +#include "lllistcontextmenu.h" +#include "llmutelist.h" + +class LLNameListCtrl; + +class LLFloaterAvatarRenderSettings : public LLFloater +{ +public: + + LLFloaterAvatarRenderSettings(const LLSD& key); + virtual ~LLFloaterAvatarRenderSettings(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void draw(); + + void onAvatarListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + + void updateList(); + void onFilterEdit(const std::string& search_string); + void onCustomAction (const LLSD& userdata, const LLUUID& av_id); + bool isActionChecked(const LLSD& userdata, const LLUUID& av_id); + void onClickAdd(const LLSD& userdata); + + static void setNeedsUpdate(); + +private: + bool isHiddenRow(const std::string& av_name); + void callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting); + void removePicker(); + + bool mNeedsUpdate; + LLListContextMenu* mContextMenu; + LLNameListCtrl* mAvatarSettingsList; + LLHandle mPicker; + + std::string mNameFilter; +}; + + +#endif //LL_LLFLOATERAVATARRENDERSETTINGS_H + +#endif \ No newline at end of file diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index ad2fc3fa4c..7d15480091 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -43,6 +43,7 @@ #include "llviewermenu.h" #include "llviewerobjectlist.h" +#include "llavatarnamecache.h" #include "fsradar.h" #include "fsscrolllistctrl.h" #include "llclipboard.h" @@ -417,8 +418,9 @@ bool FSBumpListMenu::onContextMenuItemEnable(const LLSD& userdata) { if (!gMeanCollisionList.empty() && mUUIDs.size() == 1) { - std::string name; - gCacheName->getFullName(mUUIDs.front(), name); + LLAvatarName av_name; + LLAvatarNameCache::get(mUUIDs.front(), &av_name); + std::string name = av_name.getUserName(); return LLMuteList::getInstance()->isMuted(mUUIDs.front(), name); } else diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 7889227153..5e0c343051 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -529,7 +529,20 @@ void LLFloaterBvhPreview::draw() // gGL.color3f(1.f, 1.f, 1.f); gGL.getTexUnit(0)->bind(mAnimPreview); - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + //{ + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); + //} + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(0.f, 1.f); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); @@ -537,10 +550,16 @@ void LLFloaterBvhPreview::draw() gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(1.f, 0.f); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); } gGL.end(); + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Preview on own avatar //LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index f4a5bb5d5d..7bba967af7 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -506,37 +506,63 @@ void LLFloaterColorPicker::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); + // gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + // gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); + // gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); + // gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom); - gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); + // } if (gFocusMgr.childHasMouseCapture(getDragHandle())) diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 1da21099d1..e31613045f 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -25,6 +25,7 @@ #include "llviewerprecompiledheaders.h" +#include "llavatarnamecache.h" #include "llconversationlog.h" #include "llfloaterconversationpreview.h" #include "llimview.h" @@ -239,7 +240,7 @@ void LLFloaterConversationPreview::showHistory() else { std::string legacy_name = gCacheName->buildLegacyName(from); - gCacheName->getUUID(legacy_name, from_id); + from_id = LLAvatarNameCache::findIdByName(legacy_name); } LLChat chat; diff --git a/indra/newview/llfloaterexperiencepicker.cpp b/indra/newview/llfloaterexperiencepicker.cpp index bb54c57baf..0245aefabd 100644 --- a/indra/newview/llfloaterexperiencepicker.cpp +++ b/indra/newview/llfloaterexperiencepicker.cpp @@ -85,37 +85,63 @@ void LLFloaterExperiencePicker::drawFrustum() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + + // gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + // gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); + // gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); + gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(origin_rect.mRight, origin_rect.mTop); - gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); - - gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity); - gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom); - gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); + // } if (gFocusMgr.childHasMouseCapture(getDragHandle())) diff --git a/indra/newview/llfloatergridstatus.cpp b/indra/newview/llfloatergridstatus.cpp new file mode 100644 index 0000000000..c47ff1c1d9 --- /dev/null +++ b/indra/newview/llfloatergridstatus.cpp @@ -0,0 +1,184 @@ +/** + * @file llfloatergridstatus.cpp + * @brief Grid status floater - uses an embedded web browser to show Grid status info + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatergridstatus.h" + +#include "llcallbacklist.h" +#include "llcorehttputil.h" +#include "llfloaterreg.h" +#include "llhttpconstants.h" +#include "llmediactrl.h" +#include "llsdserialize.h" +#include "lltoolbarview.h" +#include "llviewercontrol.h" +#include "llxmltree.h" + +std::map LLFloaterGridStatus::sItemsMap; +const std::string DEFAULT_GRID_STATUS_URL = "http://secondlife-status.statuspage.io/"; + +LLFloaterGridStatus::LLFloaterGridStatus(const Params& key) : + LLFloaterWebContent(key), + mIsFirstUpdate(TRUE) +{ +} + +BOOL LLFloaterGridStatus::postBuild() +{ + LLFloaterWebContent::postBuild(); + mWebBrowser->addObserver(this); + + return TRUE; +} + +void LLFloaterGridStatus::onOpen(const LLSD& key) +{ + Params p(key); + p.trusted_content = true; + p.allow_address_entry = false; + + LLFloaterWebContent::onOpen(p); + applyPreferredRect(); + if (mWebBrowser) + { + mWebBrowser->navigateTo(DEFAULT_GRID_STATUS_URL, HTTP_CONTENT_TEXT_HTML); + } +} + +void LLFloaterGridStatus::startGridStatusTimer() +{ + checkGridStatusRSS(); + doPeriodically(boost::bind(&LLFloaterGridStatus::checkGridStatusRSS), gSavedSettings.getF32("GridStatusUpdateDelay")); +} + +bool LLFloaterGridStatus::checkGridStatusRSS() +{ + if(gToolBarView->hasCommand(LLCommandId("gridstatus"))) + { + LLCoros::instance().launch("LLFloaterGridStatus::getGridStatusRSSCoro", + boost::bind(&LLFloaterGridStatus::getGridStatusRSSCoro)); + } + return false; +} + +void LLFloaterGridStatus::getGridStatusRSSCoro() +{ + + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getGridStatusRSSCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + + httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); + std::string url = gSavedSettings.getString("GridStatusRSS"); + + LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders); + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + if (!status) + { + return; + } + + const LLSD::Binary &rawBody = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary(); + std::string body(rawBody.begin(), rawBody.end()); + + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"grid_status_rss.xml"); + if(!gSavedSettings.getBOOL("TestGridStatusRSSFromFile")) + { + llofstream custom_file_out(fullpath.c_str(), std::ios::trunc); + if (custom_file_out.is_open()) + { + custom_file_out << body; + custom_file_out.close(); + } + } + LLXmlTree grid_status_xml; + if (!grid_status_xml.parseFile(fullpath)) + { + return ; + } + bool new_entries = false; + LLXmlTreeNode* rootp = grid_status_xml.getRoot(); + for (LLXmlTreeNode* item = rootp->getChildByName( "entry" ); item; item = rootp->getNextNamedChild()) + { + LLXmlTreeNode* id_node = item->getChildByName("id"); + LLXmlTreeNode* updated_node = item->getChildByName("updated"); + if (!id_node || !updated_node) + { + continue; + } + std::string guid = id_node->getContents(); + std::string date = updated_node->getContents(); + if(sItemsMap.find( guid ) == sItemsMap.end()) + { + new_entries = true; + } + else + { + if(sItemsMap[guid] != date) + { + new_entries = true; + } + } + sItemsMap[guid] = date; + } + if(new_entries && !getInstance()->isFirstUpdate()) + { + gToolBarView->flashCommand(LLCommandId("gridstatus"), true); + } + getInstance()->setFirstUpdate(FALSE); +} + +// virtual +void LLFloaterGridStatus::handleReshape(const LLRect& new_rect, bool by_user) +{ + if (by_user && !isMinimized()) + { + gSavedSettings.setRect("GridStatusFloaterRect", new_rect); + } + + LLFloaterWebContent::handleReshape(new_rect, by_user); +} + +void LLFloaterGridStatus::applyPreferredRect() +{ + const LLRect preferred_rect = gSavedSettings.getRect("GridStatusFloaterRect"); + + LLRect new_rect = getRect(); + new_rect.setLeftTopAndSize( + new_rect.mLeft, new_rect.mTop, + preferred_rect.getWidth(), preferred_rect.getHeight()); + setShape(new_rect); +} + +LLFloaterGridStatus* LLFloaterGridStatus::getInstance() +{ + return LLFloaterReg::getTypedInstance("grid_status"); +} diff --git a/indra/newview/llfloatergridstatus.h b/indra/newview/llfloatergridstatus.h new file mode 100644 index 0000000000..0c3deb7d4c --- /dev/null +++ b/indra/newview/llfloatergridstatus.h @@ -0,0 +1,71 @@ +/** + * @file llfloatergridstatus.h + * @brief Grid status floater - uses an embedded web browser to show Grid status info + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERGRIDSTATUS_H +#define LL_LLFLOATERGRIDSTATUS_H + +#include "llfloaterwebcontent.h" +#include "llviewermediaobserver.h" + +#include + +class LLMediaCtrl; + + +class LLFloaterGridStatus : + public LLFloaterWebContent +{ +public: + typedef LLSDParamAdapter<_Params> Params; + + LLFloaterGridStatus(const Params& key); + + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); + + static bool checkGridStatusRSS(); + static void getGridStatusRSSCoro(); + + void startGridStatusTimer(); + BOOL isFirstUpdate() { return mIsFirstUpdate; } + void setFirstUpdate(BOOL first_update) { mIsFirstUpdate = first_update; } + + static LLFloaterGridStatus* getInstance(); + + +private: + /*virtual*/ BOOL postBuild(); + + void applyPreferredRect(); + + static std::map sItemsMap; + + LLFrameTimer mGridStatusTimer; + BOOL mIsFirstUpdate; +}; + +#endif // LL_LLFLOATERGRIDSTATUS_H + diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 0dd826f4e4..13c9e54f4c 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -283,7 +283,20 @@ void LLFloaterImagePreview::draw() } gGL.color3f(1.f, 1.f, 1.f); - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + //{ + // gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + // gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mBottom); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + //} + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); @@ -291,10 +304,16 @@ void LLFloaterImagePreview::draw() gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + + gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); + gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom); + gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); } gGL.end(); + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -315,7 +334,20 @@ void LLFloaterImagePreview::draw() gGL.getTexUnit(0)->bind(mAvatarPreview); } - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + //{ + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); + //} + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(0.f, 1.f); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); @@ -323,10 +355,16 @@ void LLFloaterImagePreview::draw() gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); gGL.texCoord2f(1.f, 0.f); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD); } gGL.end(); + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 5a10955f4b..7e9f9e0de5 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -2100,9 +2100,10 @@ void LLFloaterIMContainer::toggleAllowTextChat(const LLUUID& participant_uuid) void LLFloaterIMContainer::toggleMute(const LLUUID& participant_id, U32 flags) { BOOL is_muted = LLMuteList::getInstance()->isMuted(participant_id, flags); - std::string name; - gCacheName->getFullName(participant_id, name); - LLMute mute(participant_id, name, LLMute::AGENT); + + LLAvatarName av_name; + LLAvatarNameCache::get(participant_id, &av_name); + LLMute mute(participant_id, av_name.getUserName(), LLMute::AGENT); if (!is_muted) { diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 6853feba37..71a9226f3d 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -228,7 +228,7 @@ void LLFloaterIMNearbyChat::loadHistory() else { std::string legacy_name = gCacheName->buildLegacyName(from); - gCacheName->getUUID(legacy_name, from_id); + from_id = LLAvatarNameCache::findIdByName(legacy_name); } LLChat chat; diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 3887efb0a3..49bb439a24 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -604,6 +604,7 @@ void LLFloaterMarketplaceListings::updateView() text = LLTrans::getString("InventoryMarketplaceError", subs); title = LLTrans::getString("InventoryOutboxErrorTitle"); tooltip = LLTrans::getString("InventoryOutboxErrorTooltip"); + LL_WARNS() << "Marketplace status code: " << mkt_status << LL_ENDL; } mInventoryText->setValue(text); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 5a18776833..f1df59ff99 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -88,7 +88,6 @@ // #include "llworld.h" // -#include "nd/ndboolswitch.h" // To toggle LLRender::sGLCoreProfile #include "glod/glod.h" #include @@ -757,7 +756,20 @@ void LLFloaterModelPreview::draw() mPreviewRect = preview_panel->getRect(); } - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + //{ + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop-1); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mTop-1); + //} + //gGL.end(); + gGL.begin( LLRender::TRIANGLES ); { gGL.texCoord2f(0.f, 1.f); gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop-1); @@ -765,10 +777,16 @@ void LLFloaterModelPreview::draw() gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom); gGL.texCoord2f(1.f, 0.f); gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom); - gGL.texCoord2f(1.f, 1.f); - gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mTop-1); + + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom); + gGL.texCoord2f( 1.f, 1.f ); + gGL.vertex2i( mPreviewRect.mRight - 1, mPreviewRect.mTop - 1 ); + gGL.texCoord2f( 0.f, 1.f ); + gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop-1); } gGL.end(); + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } @@ -2507,7 +2525,43 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim U32 num_indices = mVertexBuffer[5][mdl][i]->getNumIndices(); if (num_indices > 2) { - glodInsertElements(mObject[mdl], i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT, (U8*) mVertexBuffer[5][mdl][i]->getIndicesPointer(), 0, 0.f); + // Fix glod so it works when just using the opengl core profile + LLStrider vertex_strider; + LLStrider normal_strider; + LLStrider tc_strider; + + LLStrider< U16 > index_strider; + buff->getIndexStrider( index_strider ); + + glodVBO vbo = {}; + + if( buff->hasDataType( LLVertexBuffer::TYPE_VERTEX ) ) + { + buff->getVertexStrider( vertex_strider ); + vbo.mV.p = vertex_strider.get(); + vbo.mV.size = 3; + vbo.mV.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_VERTEX ]; + vbo.mV.type = GL_FLOAT; + } + if( buff->hasDataType( LLVertexBuffer::TYPE_NORMAL ) ) + { + buff->getNormalStrider( normal_strider ); + vbo.mN.p = normal_strider.get(); + vbo.mN.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_NORMAL ]; + vbo.mN.type = GL_FLOAT; + } + if( buff->hasDataType( LLVertexBuffer::TYPE_TEXCOORD0 ) ) + { + buff->getTexCoord0Strider( tc_strider ); + vbo.mT.p = tc_strider.get(); + vbo.mT.size = 2; + vbo.mT.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_TEXCOORD0 ]; + vbo.mT.type = GL_FLOAT; + } + + glodInsertElements( mObject[ mdl ], i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT, (U8*)index_strider.get(), 0, 0.f, &vbo ); + // glodInsertElements( mObject[ mdl ], i, GL_TRIANGLES, num_indices, GL_UNSIGNED_SHORT, (U8*)mVertexBuffer[ 5 ][ mdl ][ i ]->getIndicesPointer(), 0, 0.f ); + // } tri_count += num_indices/3; stop_gloderror(); @@ -2629,28 +2683,65 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { type_mask = mVertexBuffer[5][base][i]->getTypeMask(); - // Make sure LLRender::sGLCoreProfile is off, so we get a buffer we can pass into GLOD - nd::utils::boolSwitch switchCoreProfile ( &LLRender::sGLCoreProfile, false ); - // - LLPointer buff = new LLVertexBuffer(type_mask, 0); - // And reset LLRender::sGLCoreProfile again - switchCoreProfile.reset(); - // - if (sizes[i*2+1] > 0 && sizes[i*2] > 0) { buff->allocateBuffer(sizes[i*2+1], sizes[i*2], true); buff->setBuffer(type_mask); - glodFillElements(mObject[base], names[i], GL_UNSIGNED_SHORT, (U8*) buff->getIndicesPointer()); + + // Fix glod so it works when just using the opengl core profile + LLStrider vertex_strider; + LLStrider normal_strider; + LLStrider tc_strider; + + LLStrider< U16 > index_strider; + buff->getIndexStrider( index_strider ); + + glodVBO vbo = {}; + + if( buff->hasDataType( LLVertexBuffer::TYPE_VERTEX ) ) + { + buff->getVertexStrider( vertex_strider ); + vbo.mV.p = vertex_strider.get(); + vbo.mV.size = 3; + vbo.mV.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_VERTEX ]; + vbo.mV.type = GL_FLOAT; + } + if( buff->hasDataType( LLVertexBuffer::TYPE_NORMAL ) ) + { + buff->getNormalStrider( normal_strider ); + vbo.mN.p = normal_strider.get(); + vbo.mN.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_NORMAL ]; + vbo.mN.type = GL_FLOAT; + } + if( buff->hasDataType( LLVertexBuffer::TYPE_TEXCOORD0 ) ) + { + buff->getTexCoord0Strider( tc_strider ); + vbo.mT.p = tc_strider.get(); + vbo.mT.size = 2; + vbo.mT.stride = LLVertexBuffer::sTypeSize[ LLVertexBuffer::TYPE_TEXCOORD0 ]; + vbo.mT.type = GL_FLOAT; + } + + glodFillElements( mObject[ base ], names[ i ], GL_UNSIGNED_SHORT, (U8*)index_strider.get(), &vbo ); + // glodFillElements(mObject[base], names[i], GL_UNSIGNED_SHORT, (U8*) buff->getIndicesPointer()); + // + stop_gloderror(); } else { //this face was eliminated, create a dummy triangle (one vertex, 3 indices, all 0) buff->allocateBuffer(1, 3, true); memset((U8*) buff->getMappedData(), 0, buff->getSize()); - memset((U8*) buff->getIndicesPointer(), 0, buff->getIndicesSize()); + + // Fix when running with opengl core profile + LLStrider< U16 > index_strider; + buff->getIndexStrider( index_strider ); + + memset( (U8*)index_strider.get(), 0, buff->getIndicesSize() ); + // memset( (U8*)buff->getIndicesPointer(), 0, buff->getIndicesSize() ); + // } buff->validateRange(0, buff->getNumVerts()-1, buff->getNumIndices(), 0); @@ -2733,6 +2824,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim { shader->bind(); } + refresh(); // refresh once to make sure render gets called with the updated vbos } void LLModelPreview::updateStatusMessages() @@ -3393,23 +3485,17 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) mask |= LLVertexBuffer::MAP_WEIGHT4; } - // Make sure LLRender::sGLCoreProfile is off, so we get a buffer we can pass into GLOD - nd::utils::boolSwitch switchCoreProfile ( &LLRender::sGLCoreProfile, false ); - // - vb = new LLVertexBuffer(mask, 0); - // And reset LLRender::sGLCoreProfile again - switchCoreProfile.reset(); - // - vb->allocateBuffer(num_vertices, num_indices, TRUE); LLStrider vertex_strider; LLStrider normal_strider; LLStrider tc_strider; LLStrider index_strider; - LLStrider weights_strider; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider weights_strider; + LLStrider weights_strider; vb->getVertexStrider(vertex_strider); vb->getIndexStrider(index_strider); @@ -3455,7 +3541,9 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) //should not cause floating point precision issues. } - *(weights_strider++) = w; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //*(weights_strider++) = w; + (*(weights_strider++)).loadua(w.mV); } } @@ -3605,19 +3693,20 @@ void LLModelPreview::addEmptyFace( LLModel* pTarget ) { U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; - // Make sure LLRender::sGLCoreProfile is off, so we get a buffer we can pass into GLOD - nd::utils::boolSwitch switchCoreProfile ( &LLRender::sGLCoreProfile, false ); - // - LLPointer buff = new LLVertexBuffer(type_mask, 0); - // And reset LLRender::sGLCoreProfile again - switchCoreProfile.reset(); - // - buff->allocateBuffer(1, 3, true); memset( (U8*) buff->getMappedData(), 0, buff->getSize() ); - memset( (U8*) buff->getIndicesPointer(), 0, buff->getIndicesSize() ); + + // Fix when running with opengl core profile + { + LLStrider< U16 > index_strider; + buff->getIndexStrider( index_strider ); + + memset( (U8*)index_strider.get(), 0, buff->getIndicesSize() ); + } + //memset( (U8*) buff->getIndicesPointer(), 0, buff->getIndicesSize() ); + // buff->validateRange( 0, buff->getNumVerts()-1, buff->getNumIndices(), 0 ); @@ -4167,7 +4256,9 @@ BOOL LLModelPreview::render() LLStrider position; buffer->getVertexStrider(position); - LLStrider weight; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider weight; + LLStrider weight; buffer->getWeight4Strider(weight); //quick 'n dirty software vertex skinning @@ -4185,7 +4276,10 @@ BOOL LLModelPreview::render() for (U32 j = 0; j < buffer->getNumVerts(); ++j) { LLMatrix4a final_mat; - F32 *wptr = weight[j].mV; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //F32 *wptr = weight[j].mV; + F32 *wptr = weight[j].getF32ptr(); + // LLSkinningUtil::getPerVertexSkinMatrix(wptr, mat, true, final_mat, max_joints); //VECTORIZE THIS diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 074dfd3805..06c5685112 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -509,6 +509,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); + mCommitCallbackRegistrar.add("Pref.RenderExceptions", boost::bind(&LLFloaterPreference::onClickRenderExceptions, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable", boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity", boost::bind(&LLFloaterPreference::updateMaxComplexity, this)); @@ -539,7 +540,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) gSavedSettings.getControl("NameTagShowUsernames")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); - + gSavedSettings.getControl("AppearanceCameraMovement")->getCommitSignal()->connect(boost::bind(&handleAppearanceCameraMovementChanged, _2)); LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); @@ -1243,10 +1244,12 @@ void LLFloaterPreference::onOpen(const LLSD& key) //LLButton* load_btn = findChild("PrefLoadButton"); //LLButton* save_btn = findChild("PrefSaveButton"); //LLButton* delete_btn = findChild("PrefDeleteButton"); + //LLButton* exceptions_btn = findChild("RenderExceptionsButton"); //load_btn->setEnabled(started); //save_btn->setEnabled(started); //delete_btn->setEnabled(started); + //exceptions_btn->setEnabled(started); // // Hook up and init for filtering @@ -3334,6 +3337,11 @@ void LLFloaterPreference::onClickSpellChecker() LLFloaterReg::showInstance("prefs_spellchecker"); } +void LLFloaterPreference::onClickRenderExceptions() +{ + LLFloaterReg::showInstance("avatar_render_settings"); +} + void LLFloaterPreference::onClickAdvanced() { LLFloaterReg::showInstance("prefs_graphics_advanced"); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 76f08efa2a..8bbcb6229a 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -255,6 +255,7 @@ public: void onClickPermsDefault(); void onClickAutoReplace(); void onClickSpellChecker(); + void onClickRenderExceptions(); void onClickAdvanced(); void applyUIColor(LLUICtrl* ctrl, const LLSD& param); void getUIColor(LLUICtrl* ctrl, const LLSD& param); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index e3a468167f..7951d83f7f 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -30,6 +30,7 @@ #include #include #include "llcachename.h" +#include "llavatarnamecache.h" #include "lldbstrings.h" #include "llfloaterreg.h" @@ -302,12 +303,13 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) if (item->getCreatorUUID().notNull()) { - std::string name; - gCacheName->getFullName(item->getCreatorUUID(), name); + LLAvatarName av_name; + LLAvatarNameCache::get(item->getCreatorUUID(), &av_name); getChildView("BtnCreator")->setEnabled(TRUE); getChildView("LabelCreatorTitle")->setEnabled(TRUE); getChildView("LabelCreatorName")->setEnabled(TRUE); // [RLVa:KB] - Checked: RLVa-2.0.1 + std::string name = av_name.getUserName(); // If the object creator matches the object owner we need to anonymize the creator field as well if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getCreatorUUID())) && ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) @@ -315,8 +317,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetEnabled("BtnCreator", FALSE); name = RlvStrings::getAnonym(name); } -// [/RLVa:KB] getChild("LabelCreatorName")->setValue(name); +// [/RLVa:KB] +// getChild("LabelCreatorName")->setValue(av_name.getUserName()); } else { @@ -341,7 +344,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } else { - gCacheName->getFullName(perm.getOwner(), name); + LLAvatarName av_name; + LLAvatarNameCache::get(perm.getOwner(), &av_name); + name = av_name.getUserName(); // [RLVa:KB] - Checked: RLVa-2.0.1 if (RlvActions::isRlvEnabled()) { diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d35751962a..672f5cece2 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -375,6 +375,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) std::string sim_type = LLTrans::getString("land_type_unknown"); U64 region_flags; U8 agent_limit; + S32 hard_agent_limit; F32 object_bonus_factor; U8 sim_access; F32 water_height; @@ -384,6 +385,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) F32 sun_hour; msg->getString("RegionInfo", "SimName", sim_name); msg->getU8("RegionInfo", "MaxAgents", agent_limit); + msg->getS32("RegionInfo2", "HardMaxAgents", hard_agent_limit); msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor); msg->getU8("RegionInfo", "SimAccess", sim_access); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height); @@ -430,6 +432,8 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild("object_bonus_spin")->setValue(LLSD(object_bonus_factor) ); panel->getChild("access_combo")->setValue(LLSD(sim_access) ); + panel->getChild("agent_limit_spin")->setMaxValue(hard_agent_limit); + LLPanelRegionGeneralInfo* panel_general = LLFloaterRegionInfo::getPanelGeneral(); if (panel) { diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index c14bb4e7ae..5f0587a286 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -390,6 +390,14 @@ void LLPanelScriptLimitsRegionMemory::setErrorStatus(S32 status, const std::stri LL_WARNS() << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<getFullName(owner_id, owner_buf); // username + LLAvatarName av_name; + name_is_cached = LLAvatarNameCache::get(owner_id, &av_name); + owner_buf = av_name.getUserName(); owner_buf = LLCacheName::buildUsername(owner_buf); } if(!name_is_cached) @@ -511,9 +521,18 @@ void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content) if(std::find(names_requested.begin(), names_requested.end(), owner_id) == names_requested.end()) { names_requested.push_back(owner_id); - gCacheName->get(owner_id, is_group_owned, // username - boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, - this, _1, _2)); + if (is_group_owned) + { + gCacheName->getGroup(owner_id, + boost::bind(&LLPanelScriptLimitsRegionMemory::onNameCache, + this, _1, _2)); + } + else + { + LLAvatarNameCache::get(owner_id, + boost::bind(&LLPanelScriptLimitsRegionMemory::onAvatarNameCache, + this, _1, _2)); + } } } } diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h index 2ac3862b4f..16450c6527 100644 --- a/indra/newview/llfloaterscriptlimits.h +++ b/indra/newview/llfloaterscriptlimits.h @@ -38,6 +38,7 @@ class LLPanelScriptLimitsInfo; class LLTabContainer; +class LLAvatarName; class LLPanelScriptLimitsRegionMemory; @@ -116,6 +117,8 @@ public: void checkButtonsEnabled(); private: + void onAvatarNameCache(const LLUUID& id, + const LLAvatarName& av_name); void onNameCache(const LLUUID& id, const std::string& name); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index a6c0b068e3..ba1916d4ba 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -746,11 +746,7 @@ void LLFloaterSnapshot::Impl::setFinished(bool finished, bool ok, const std::str LLUICtrl* finished_lbl = mFloater->getChild(ok ? "succeeded_lbl" : "failed_lbl"); std::string result_text = mFloater->getString(msg + "_" + (ok ? "succeeded_str" : "failed_str")); finished_lbl->setValue(result_text); - // Don't return to target selection after taking a snapshot - //LLSideTrayPanelContainer* panel_container = mFloater->getChild("panel_container"); - //panel_container->openPreviousPanel(); - //panel_container->getCurrentPanel()->onOpen(LLSD()); LLPanelSnapshot* panel = getActivePanel(mFloater); if (panel) { diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 1062e1ae78..278497ff72 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -36,6 +36,7 @@ #include "llagentdata.h" #include "llagentui.h" #include "llagentwearables.h" +#include "llavatarnamecache.h" #include "llfloatertools.h" // for gFloaterTool #include "llhudeffecttrail.h" #include "llhudmanager.h" @@ -316,16 +317,18 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, ////////////////////////////////////////////////////////////////////////// //static -void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id) +void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im_session_id, const std::string& item_name, bool is_folder) { // compute id of possible IM session with agent that has "to_agent" id LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, to_agent); // If this item was given by drag-and-drop into an IM panel, log this action in the IM panel chat. LLSD args; args["user_id"] = to_agent; + args["ITEM_NAME"] = item_name; + std::string message_name = is_folder ? "inventory_folder_offered" : "inventory_item_offered"; if (im_session_id.notNull()) { - gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); + gIMMgr->addSystemMessage(im_session_id, message_name, args); } // [RLVa:KB] - Checked: RLVa-1.2.0 else if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) && (RlvUtil::isNearbyAgent(to_agent)) && (!RlvUIEnabler::hasOpenProfile(to_agent)) ) @@ -343,18 +346,19 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im // If this item was given by drag-and-drop on avatar while IM panel was open, log this action in the IM panel chat. else if (LLIMModel::getInstance()->findIMSession(session_id)) { - gIMMgr->addSystemMessage(session_id, "inventory_item_offered", args); + gIMMgr->addSystemMessage(session_id, message_name, args); } // If this item was given by drag-and-drop on avatar while IM panel wasn't open, log this action to IM history. else { - std::string full_name; - if (gCacheName->getFullName(to_agent, full_name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(to_agent, &av_name)) { // Build a new format username or firstname_lastname for legacy names // to use it for a history log filename. // [Legacy IM logfile names] - //full_name = LLCacheName::buildUsername(full_name); + //std::string full_name = LLCacheName::buildUsername(av_name.getUserName()); + std::string full_name = av_name.getUserName(); if (gSavedSettings.getBOOL("UseLegacyIMLogNames")) { full_name = full_name.substr(0, full_name.find(" Resident"));; @@ -364,7 +368,9 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im full_name = LLCacheName::buildUsername(full_name); } // [Legacy IM logfile names] - LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, LLTrans::getString("inventory_item_offered-im")); + LLUIString message = LLTrans::getString(message_name + "-im"); + message.setArgs(args); + LLIMModel::instance().logToFile(full_name, LLTrans::getString("SECOND_LIFE"), im_session_id, message.getString()); } } } @@ -418,6 +424,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, { if (!item) return; std::string name; + std::string item_name = item->getName(); LLAgentUI::buildFullname(name); LLUUID transaction_id; transaction_id.generate(); @@ -432,7 +439,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, gAgentSessionID, to_agent, name, - item->getName(), + item_name, IM_ONLINE, IM_INVENTORY_OFFERED, transaction_id, @@ -458,7 +465,7 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); - logInventoryOffer(to_agent, im_session_id); + logInventoryOffer(to_agent, im_session_id, item_name); // add buddy to recent people list // LLRecentPeople::instance().add(to_agent); @@ -554,7 +561,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, items, LLInventoryModel::EXCLUDE_TRASH, giveable); - + std::string cat_name = cat->getName(); bool give_successful = true; // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < // MTUBYTES or 18 * count < 1200 => count < 1200/18 => @@ -612,7 +619,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, gAgent.getSessionID(), to_agent, name, - cat->getName(), + cat_name, IM_ONLINE, IM_INVENTORY_OFFERED, transaction_id, @@ -639,7 +646,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); - logInventoryOffer(to_agent, im_session_id); + logInventoryOffer(to_agent, im_session_id, cat_name, true); } return give_successful; diff --git a/indra/newview/llgiveinventory.h b/indra/newview/llgiveinventory.h index 85bc1ed49c..20e6df76e5 100644 --- a/indra/newview/llgiveinventory.h +++ b/indra/newview/llgiveinventory.h @@ -78,7 +78,9 @@ private: * logs "Inventory item offered" to IM */ static void logInventoryOffer(const LLUUID& to_agent, - const LLUUID &im_session_id = LLUUID::null); + const LLUUID &im_session_id = LLUUID::null, + const std::string& item_name = std::string(), + bool is_folder = false); static void commitGiveInventoryItem(const LLUUID& to_agent, const LLInventoryItem* item, diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 822016942c..e8dbb420a3 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -409,29 +409,45 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global, gGL.end(); gGL.color4f(1.f, 1.f, 0.f, 0.2f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); - gGL.vertex3f(west, north, nw_bottom); - gGL.vertex3f(west, north, nw_top); - gGL.vertex3f(east, north, ne_top); - gGL.vertex3f(east, north, ne_bottom); + //gGL.vertex3f(west, north, nw_bottom); + //gGL.vertex3f(west, north, nw_top); + //gGL.vertex3f(east, north, ne_top); + //gGL.vertex3f(east, north, ne_bottom); - gGL.vertex3f(east, north, ne_bottom); - gGL.vertex3f(east, north, ne_top); - gGL.vertex3f(east, south, se_top); - gGL.vertex3f(east, south, se_bottom); + //gGL.vertex3f(east, north, ne_bottom); + //gGL.vertex3f(east, north, ne_top); + //gGL.vertex3f(east, south, se_top); + //gGL.vertex3f(east, south, se_bottom); - gGL.vertex3f(east, south, se_bottom); - gGL.vertex3f(east, south, se_top); - gGL.vertex3f(west, south, sw_top); - gGL.vertex3f(west, south, sw_bottom); + //gGL.vertex3f(east, south, se_bottom); + //gGL.vertex3f(east, south, se_top); + //gGL.vertex3f(west, south, sw_top); + //gGL.vertex3f(west, south, sw_bottom); - gGL.vertex3f(west, south, sw_bottom); - gGL.vertex3f(west, south, sw_top); - gGL.vertex3f(west, north, nw_top); - gGL.vertex3f(west, north, nw_bottom); + //gGL.vertex3f(west, south, sw_bottom); + //gGL.vertex3f(west, south, sw_top); + //gGL.vertex3f(west, north, nw_top); + //gGL.vertex3f(west, north, nw_bottom); + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); + { + gGL.vertex3f(west, north, nw_bottom); + gGL.vertex3f(west, north, nw_top); + gGL.vertex3f(east, north, ne_bottom); + gGL.vertex3f(east, north, ne_top); + gGL.vertex3f(east, south, se_bottom); + gGL.vertex3f(east, south, se_top); + gGL.vertex3f(west, south, sw_top); + gGL.vertex3f(west, south, sw_bottom); + gGL.vertex3f(west, north, nw_top); + gGL.vertex3f(west, north, nw_bottom); + } gGL.end(); + // LLUI::setLineWidth(1.f); } @@ -573,6 +589,11 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei gGL.vertex3f(x2, y2, z2); + // Remove QUADS rendering mode + gGL.vertex3f(x1, y1, z); + gGL.vertex3f(x2, y2, z2); + // + // FIRE-10546: Show parcel boundary up to max. build level //z = z2+height; z = absolute_height ? height : z2+height; @@ -620,6 +641,14 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei gGL.texCoord2f(tex_coord2*0.5f+0.5f, z*0.5f); gGL.vertex3f(x2, y2, z); + // Remove QUADS rendering mode + gGL.texCoord2f(tex_coord1*0.5f+0.5f, z1*0.5f); + gGL.vertex3f(x1, y1, z1); + + gGL.texCoord2f(tex_coord2*0.5f+0.5f, z*0.5f); + gGL.vertex3f(x2, y2, z); + // + gGL.texCoord2f(tex_coord1*0.5f+0.5f, z*0.5f); gGL.vertex3f(x1, y1, z); } @@ -668,7 +697,10 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi if (!has_segments) { has_segments = true; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // } // FIRE-10546: Show parcel boundary up to max. build level //renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, SOUTH_MASK, regionp); @@ -687,7 +719,10 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi if (!has_segments) { has_segments = true; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // } // FIRE-10546: Show parcel boundary up to max. build level //renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, WEST_MASK, regionp); @@ -746,7 +781,10 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV gGL.getTexUnit(0)->bind(mBlockedImage); } - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + // for (y = 0; y < STRIDE; y++) { diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index fb00a32d63..3706396d8d 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -49,6 +49,7 @@ #include "llappviewer.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llui.h" #include "message.h" #include "roles_constants.h" @@ -838,9 +839,9 @@ void LLGroupMgrGroupData::banMemberById(const LLUUID& participant_uuid) LLGroupMgr::getInstance()->sendGroupMemberEjects(mID, ids); LLGroupMgr::getInstance()->sendGroupMembersRequest(mID); LLSD args; - std::string name; - gCacheName->getFullName(participant_uuid, name); - args["AVATAR_NAME"] = name; + LLAvatarName av_name; + LLAvatarNameCache::get(participant_uuid, &av_name); + args["AVATAR_NAME"] = av_name.getUserName(); args["GROUP_NAME"] = mName; LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args)); } diff --git a/indra/newview/llhudeffectblob.cpp b/indra/newview/llhudeffectblob.cpp index c909551b51..d96a869a27 100644 --- a/indra/newview/llhudeffectblob.cpp +++ b/indra/newview/llhudeffectblob.cpp @@ -78,16 +78,35 @@ void LLHUDEffectBlob::render() LLVector3 u_scale = pixel_right * (F32)mPixelSize; LLVector3 v_scale = pixel_up * (F32)mPixelSize; - { gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //{ gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex3fv((v_scale - u_scale).mV); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex3fv((-v_scale - u_scale).mV); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex3fv((-v_scale + u_scale).mV); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex3fv((v_scale + u_scale).mV); + //} gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex3fv((v_scale - u_scale).mV); gGL.texCoord2f(0.f, 0.f); gGL.vertex3fv((-v_scale - u_scale).mV); gGL.texCoord2f(1.f, 0.f); gGL.vertex3fv((-v_scale + u_scale).mV); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3fv((v_scale - u_scale).mV); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3fv((-v_scale + u_scale).mV); gGL.texCoord2f(1.f, 1.f); gGL.vertex3fv((v_scale + u_scale).mV); - } gGL.end(); + } + gGL.end(); + // } gGL.popMatrix(); } diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 8ba311216e..c546ae316b 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -168,7 +168,20 @@ void LLHUDIcon::renderIcon(BOOL for_select) gGL.getTexUnit(0)->bind(mImagep); } - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex3fv(upper_left.mV); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex3fv(lower_left.mV); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex3fv(lower_right.mV); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex3fv(upper_right.mV); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.texCoord2f(0.f, 1.f); gGL.vertex3fv(upper_left.mV); @@ -176,10 +189,16 @@ void LLHUDIcon::renderIcon(BOOL for_select) gGL.vertex3fv(lower_left.mV); gGL.texCoord2f(1.f, 0.f); gGL.vertex3fv(lower_right.mV); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3fv(upper_left.mV); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3fv(lower_right.mV); gGL.texCoord2f(1.f, 1.f); gGL.vertex3fv(upper_right.mV); } gGL.end(); + // } void LLHUDIcon::setImage(LLViewerTexture* imagep) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 85676c0455..213a163bfe 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -788,6 +788,7 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES std::string you_joined_call = LLTrans::getString("you_joined_call"); std::string you_started_call = LLTrans::getString("you_started_call"); std::string other_avatar_name = ""; + LLAvatarName av_name; std::string message; @@ -797,7 +798,8 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES // no text notifications break; case P2P_SESSION: - gCacheName->getFullName(mOtherParticipantID, other_avatar_name); // voice + LLAvatarNameCache::get(mOtherParticipantID, &av_name); + other_avatar_name = av_name.getUserName(); if(direction == LLVoiceChannel::INCOMING_CALL) { @@ -948,7 +950,7 @@ void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list& histo { // convert it to a legacy name if we have a complete name std::string legacy_name = gCacheName->buildLegacyName(from); - gCacheName->getUUID(legacy_name, from_id); + from_id = LLAvatarNameCache::findIdByName(legacy_name); } std::string timestamp = msg[LL_IM_TIME]; @@ -3218,10 +3220,10 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess else { // FIRE-15138: Sharing inventory item sometimes doesn't obey UseLegacyIMLogNames setting - //std::string session_name; + //LLAvatarName av_name; //// since we select user to share item with - his name is already in cache - //gCacheName->getFullName(args["user_id"], session_name); - //session_name = LLCacheName::buildUsername(session_name); + //LLAvatarNameCache::get(args["user_id"], &av_name); + //std::string session_name = LLCacheName::buildUsername(av_name.getUserName()); //LLIMModel::instance().logToFile(session_name, SYSTEM_FROM, LLUUID::null, message.getString()); LLAvatarNameCache::get(args["user_id"].asUUID(), boost::bind(&add_system_message_name_cb, _2, message.getString())); // @@ -3564,8 +3566,8 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->get(caller_id, false, // voice - boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2, _3)); + LLAvatarNameCache::get(caller_id, + boost::bind(&LLIMMgr::onInviteNameLookup, payload, _1, _2)); } else { @@ -3584,9 +3586,9 @@ void LLIMMgr::inviteToSession( } } -void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group) +void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const LLAvatarName& av_name) { - payload["caller_name"] = name; + payload["caller_name"] = av_name.getUserName(); payload["session_name"] = payload["caller_name"].asString(); std::string notify_box_type = payload["notify_box_type"].asString(); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 737bd25bee..f39e449333 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -521,7 +521,7 @@ private: void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); - static void onInviteNameLookup(LLSD payload, const LLUUID& id, const std::string& name, bool is_group); + static void onInviteNameLookup(LLSD payload, const LLUUID& id, const LLAvatarName& name); void notifyObserverSessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, bool has_offline_msg); //Triggers when a session has already been added diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 22e8bbf828..c8a32f83c3 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -50,6 +50,7 @@ // Undo CHUI-90 and make avatar inspector useful again #include "llagentdata.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" #include "llfloaterreporter.h" #include "llfloaterworldmap.h" @@ -798,8 +799,9 @@ void LLInspectAvatar::onClickKick() void LLInspectAvatar::onClickCSR() { - std::string name; - gCacheName->getFullName(mAvatarID, name); + LLAvatarName av_name; + LLAvatarNameCache::get(mAvatarID, &av_name); + std::string name = av_name.getUserName(); LLAvatarActions::csr(mAvatarID, name); closeFloater(); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6aa1594eee..c6d7a8db3f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -298,8 +298,10 @@ BOOL LLInvFVBridge::cutToClipboard() if (cut_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(mUUID) || LLMarketplaceData::instance().isListedAndActive(mUUID))) { - // Prompt the user if cutting from a marketplace active listing - LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2)); + LLUUID parent_uuid = obj->getParentUUID(); + BOOL result = perform_cutToClipboard(); + gInventory.addChangedMask(LLInventoryObserver::STRUCTURE, parent_uuid); + return result; } else { @@ -326,11 +328,7 @@ BOOL LLInvFVBridge::callback_cutToClipboard(const LLSD& notification, const LLSD S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) // YES { - const LLInventoryObject* obj = gInventory.getObject(mUUID); - LLUUID parent_uuid = obj->getParentUUID(); - BOOL result = perform_cutToClipboard(); - gInventory.addChangedMask(LLInventoryObserver::STRUCTURE, parent_uuid); - return result; + return perform_cutToClipboard(); } return FALSE; } @@ -744,41 +742,6 @@ void hide_context_entries(LLMenuGL& menu, } } -// Inventory Links Replace -void LLInvFVBridge::checkInventoryLinkReplace(menuentry_vec_t& items, menuentry_vec_t& disables_items) -{ - const LLInventoryObject* obj = getInventoryObject(); - - if (isAgentInventory() && obj && obj->getType() != LLAssetType::AT_CATEGORY && obj->getType() != LLAssetType::AT_LINK_FOLDER) - { - items.push_back(std::string("Replace Links")); - - if (mRoot->getSelectedCount() != 1) - { - disables_items.push_back(std::string("Replace Links")); - } - } -} -// - -// Move to default folder -void LLInvFVBridge::checkMoveToDefaultFolder(menuentry_vec_t& items, menuentry_vec_t& disables_items) -{ - const LLInventoryObject* obj = getInventoryObject(); - - if (isAgentInventory() && !isProtectedFolder(true) && obj && - obj->getActualType() != LLAssetType::AT_CATEGORY && - obj->getActualType() != LLAssetType::AT_LINK_FOLDER && - obj->getActualType() != LLAssetType::AT_LINK && - (!RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY) || - RlvFolderLocks::instance().canMoveItem(obj->getUUID(), getInventoryModel()->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(obj->getActualType()) ) )) - ) - { - items.push_back(std::string("Move to Default Folder")); - } -} -// - // Helper for commonly-used entries void LLInvFVBridge::getClipboardEntries(bool show_asset_id, menuentry_vec_t &items, @@ -964,10 +927,10 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -1169,6 +1132,40 @@ void LLInvFVBridge::addMarketplaceContextMenuOptions(U32 flags, items.push_back(std::string("Marketplace Listings Separator")); } +// Inventory Links Replace +void LLInvFVBridge::addLinkReplaceMenuOption(menuentry_vec_t& items, menuentry_vec_t& disabled_items) +{ + const LLInventoryObject* obj = getInventoryObject(); + + if (isAgentInventory() && obj && obj->getType() != LLAssetType::AT_CATEGORY && obj->getType() != LLAssetType::AT_LINK_FOLDER) + { + items.push_back(std::string("Replace Links")); + + if (mRoot->getSelectedCount() != 1) + { + disabled_items.push_back(std::string("Replace Links")); + } + } +} +// + +// Move to default folder +void LLInvFVBridge::addMoveToDefaultFolderMenuOption(menuentry_vec_t& items) +{ + const LLInventoryObject* obj = getInventoryObject(); + + if (isAgentInventory() && !isProtectedFolder(true) && obj && + obj->getActualType() != LLAssetType::AT_CATEGORY && + obj->getActualType() != LLAssetType::AT_LINK_FOLDER && + obj->getActualType() != LLAssetType::AT_LINK && + (!RlvFolderLocks::instance().hasLockedFolder(RLV_LOCK_ANY) || + RlvFolderLocks::instance().canMoveItem(obj->getUUID(), getInventoryModel()->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(obj->getActualType()) ) )) + ) + { + items.push_back(std::string("Move to Default Folder")); + } +} +// // *TODO: remove this BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const @@ -1296,14 +1293,14 @@ BOOL LLInvFVBridge::isProtectedFolder(bool ignore_setting /*= false*/) const return FALSE; } - if ((mUUID == FSLSLBridge::instance().getBridgeFolder() + if ((mUUID == FSLSLBridge::instance().getBridgeFolder() || model->isObjectDescendentOf(mUUID, FSLSLBridge::instance().getBridgeFolder())) && (gSavedPerAccountSettings.getBOOL("ProtectBridgeFolder") || ignore_setting)) { return TRUE; } - if ((mUUID == AOEngine::instance().getAOFolder() + if ((mUUID == AOEngine::instance().getAOFolder() || model->isObjectDescendentOf(mUUID, AOEngine::instance().getAOFolder())) && (gSavedPerAccountSettings.getBOOL("ProtectAOFolders") || ignore_setting)) { @@ -3786,7 +3783,24 @@ void LLFolderBridge::pasteFromClipboard() const LLUUID &marketplacelistings_id = model->findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); const BOOL paste_into_marketplacelistings = model->isObjectDescendentOf(mUUID, marketplacelistings_id); - if (paste_into_marketplacelistings && !LLMarketplaceData::instance().isListed(mUUID) && LLMarketplaceData::instance().isInActiveFolder(mUUID)) + BOOL cut_from_marketplacelistings = FALSE; + if (LLClipboard::instance().isCutMode()) + { + //Items are not removed from folder on "cut", so we need update listing folder on "paste" operation + std::vector objects; + LLClipboard::instance().pasteFromClipboard(objects); + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + if(gInventory.isObjectDescendentOf(item_id, marketplacelistings_id) && (LLMarketplaceData::instance().isInActiveFolder(item_id) || + LLMarketplaceData::instance().isListedAndActive(item_id))) + { + cut_from_marketplacelistings = TRUE; + break; + } + } + } + if (cut_from_marketplacelistings || (paste_into_marketplacelistings && !LLMarketplaceData::instance().isListed(mUUID) && LLMarketplaceData::instance().isInActiveFolder(mUUID))) { // Prompt the user if pasting in a marketplace active version listing (note that pasting right under the listing folder root doesn't need a prompt) LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_pasteFromClipboard, this, _1, _2)); @@ -3805,7 +3819,20 @@ void LLFolderBridge::callback_pasteFromClipboard(const LLSD& notification, const S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) // YES { + std::vector objects; + std::set parent_folders; + LLClipboard::instance().pasteFromClipboard(objects); + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLInventoryObject* obj = gInventory.getObject(*iter); + parent_folders.insert(obj->getParentUUID()); + } perform_pasteFromClipboard(); + for (std::set::const_iterator iter = parent_folders.begin(); iter != parent_folders.end(); ++iter) + { + gInventory.addChangedMask(LLInventoryObserver::STRUCTURE, *iter); + } + } } @@ -4270,6 +4297,37 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Move to Lost And Found")); } // [/SL:KB] + else + { + // Mark wearables and allow copy from library + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + const LLInventoryCategory* category = model->getCategory(mUUID); + if (!category) return; + LLFolderType::EType type = category->getPreferredType(); + const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); + + LLFindWearables is_wearable; + LLIsType is_object(LLAssetType::AT_OBJECT); + LLIsType is_gesture(LLAssetType::AT_GESTURE); + + if (checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture)) + { + mWearables = TRUE; + } + + if (!is_system_folder) + { + items.push_back(std::string("Copy")); + if (!isItemCopyable()) + { + // For some reason there are items in library that can't be copied directly + disabled_items.push_back(std::string("Copy")); + } + } + } // Preemptively disable system folder removal if more than one item selected. if ((flags & FIRST_SELECTED_ITEM) == 0) @@ -4278,8 +4336,8 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } // Don't offer sharing of trash folder (FIRE-1642, FIRE-6547) - // if (!isMarketplaceListingsFolder()) - if (!isMarketplaceListingsFolder() && mUUID != trash_id) + //if (isAgentInventory() && !isMarketplaceListingsFolder()) + if (isAgentInventory() && !isMarketplaceListingsFolder() && mUUID != trash_id) { items.push_back(std::string("Share")); if (!canShare()) @@ -4287,6 +4345,9 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items disabled_items.push_back(std::string("Share")); } } + + + // Add menu items that are dependent on the contents of the folder. LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); if (category && (marketplace_listings_id != mUUID)) @@ -4324,7 +4385,6 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); if (trash_id == mUUID) return; if (isItemInTrash()) return; - if (!isAgentInventory()) return; if (!isItemRemovable()) { @@ -4337,12 +4397,13 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); + const bool is_agent_inventory = isAgentInventory(); // [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.4) const bool is_outfit = (type == LLFolderType::FT_OUTFIT); // [/SL:KB] // Only enable calling-card related options for non-system folders. - if (!is_system_folder) + if (!is_system_folder && is_agent_inventory) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) @@ -4354,7 +4415,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } #ifndef LL_RELEASE_FOR_DOWNLOAD - if (LLFolderType::lookupIsProtectedType(type)) + if (LLFolderType::lookupIsProtectedType(type) && is_agent_inventory) { items.push_back(std::string("Delete System Folder")); } @@ -4371,8 +4432,6 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& checkFolderForContentsOfType(model, is_object) || checkFolderForContentsOfType(model, is_gesture) ) { - items.push_back(std::string("Folder Wearables Separator")); - // Only enable add/replace outfit for non-system folders. if (!is_system_folder) { @@ -4390,36 +4449,41 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& } items.push_back(std::string("Replace Outfit")); - } - if (is_ensemble) - { - items.push_back(std::string("Wear As Ensemble")); - } - items.push_back(std::string("Remove From Outfit")); - if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) - { - disabled_items.push_back(std::string("Remove From Outfit")); - } -// if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) + + if (is_agent_inventory) + { + items.push_back(std::string("Folder Wearables Separator")); + if (is_ensemble) + { + items.push_back(std::string("Wear As Ensemble")); + } + items.push_back(std::string("Remove From Outfit")); + if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) + { + disabled_items.push_back(std::string("Remove From Outfit")); + } + } +// if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) // [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.4) - if ( ((is_outfit) && (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))) || - ((!is_outfit) && (gAgentWearables.isCOFChangeInProgress())) ) + if ( ((is_outfit) && (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))) || + ((!is_outfit) && (gAgentWearables.isCOFChangeInProgress())) ) // [/SL:KB] - { - disabled_items.push_back(std::string("Replace Outfit")); - } + { + disabled_items.push_back(std::string("Replace Outfit")); + } // [RLVa:KB] - Checked: RLVa-2.0.3 - // Block "Replace Current Outfit" if the user can't wear the new folder - if ( (RlvActions::isRlvEnabled()) && (RlvFolderLocks::instance().isLockedFolder(mUUID, RLV_LOCK_ADD)) ) - { - disabled_items.push_back(std::string("Replace Outfit")); - } + // Block "Replace Current Outfit" if the user can't wear the new folder + if ( (RlvActions::isRlvEnabled()) && (RlvFolderLocks::instance().isLockedFolder(mUUID, RLV_LOCK_ADD)) ) + { + disabled_items.push_back(std::string("Replace Outfit")); + } // [/RLVa:KB] - if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID)) - { - disabled_items.push_back(std::string("Add To Outfit")); + if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID)) + { + disabled_items.push_back(std::string("Add To Outfit")); + } + items.push_back(std::string("Outfit Separator")); } - items.push_back(std::string("Outfit Separator")); } } @@ -4675,9 +4739,18 @@ void LLFolderBridge::modifyOutfit(BOOL append) return; } - LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append ); + if (isAgentInventory()) + { + LLAppearanceMgr::instance().wearInventoryCategory(cat, FALSE, append); + } + else + { + // Library, we need to copy content first + LLAppearanceMgr::instance().wearInventoryCategory(cat, TRUE, append); + } } + // +=================================================+ // | LLMarketplaceFolderBridge | // +=================================================+ @@ -5575,10 +5648,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -5653,10 +5726,10 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -5747,10 +5820,10 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -6075,10 +6148,10 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -6351,10 +6424,10 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -6414,10 +6487,10 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -6877,10 +6950,10 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -7145,10 +7218,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -7323,7 +7396,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); hide_context_entries(menu, items, disabled_items); } @@ -7377,10 +7450,10 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } // Inventory Links Replace - checkInventoryLinkReplace(items, disabled_items); + addLinkReplaceMenuOption(items, disabled_items); // Move to default folder - checkMoveToDefaultFolder(items, disabled_items); + addMoveToDefaultFolderMenuOption(items); hide_context_entries(menu, items, disabled_items); } @@ -7923,8 +7996,12 @@ std::string LLInvFVBridge::getSearchableCreator( void ) const std::string strCreator; if(pItem) { - if( gCacheName->getFullName( pItem->getCreatorUUID(), strCreator ) ) + LLAvatarName av_name; + if (LLAvatarNameCache::get(pItem->getCreatorUUID(), &av_name)) + { + strCreator = av_name.getUserName(); LLStringUtil::toUpper( strCreator ); + } } return strCreator; diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 97f32b5bbb..74c10a403e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -151,6 +151,12 @@ protected: virtual void addMarketplaceContextMenuOptions(U32 flags, menuentry_vec_t &items, menuentry_vec_t &disabled_items); + // Inventory Links Replace + virtual void addLinkReplaceMenuOption(menuentry_vec_t& items, + menuentry_vec_t& disabled_items); + // Move to default folder + virtual void addMoveToDefaultFolderMenuOption(menuentry_vec_t& items); + protected: LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid); @@ -161,22 +167,18 @@ protected: BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory? BOOL isAgentInventory() const; // false if lost or in the inventory library + BOOL isCOFFolder() const; // true if COF or descendant of + BOOL isInboxFolder() const; // true if COF or descendant of marketplace inbox + + BOOL isMarketplaceListingsFolder() const; // true if descendant of Marketplace listings folder + // [SL:KB] - Patch: Inventory-Misc | Checked: 2011-05-28 (Catznip-2.6.0a) | Added: Catznip-2.6.0a BOOL isLibraryInventory() const; BOOL isLostInventory() const; // [/SL:KB] - BOOL isCOFFolder() const; // true if COF or descendent of // Client LSL Bridge BOOL isProtectedFolder(bool ignore_setting = false) const; // - BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox - BOOL isMarketplaceListingsFolder() const; // true if descendant of Marketplace listings folder - - // Inventory Links Replace - void checkInventoryLinkReplace(menuentry_vec_t& items, menuentry_vec_t& disables_items); - - // Move to default folder - void checkMoveToDefaultFolder(menuentry_vec_t& items, menuentry_vec_t& disables_items); virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index fe05c2ed7c..ce41105f98 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -61,6 +61,11 @@ public: */ void setForceRefresh(bool force_refresh){ mForceRefresh = force_refresh; } + /** + * If refreshes when invisible. + */ + bool getForceRefresh(){ return mForceRefresh; } + virtual bool selectItemByValue(const LLSD& value, bool select = true); void updateSelection(); diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 9621933b5f..7bf121d4be 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -182,10 +182,10 @@ void LLPanelInventoryListItemBase::setValue(const LLSD& value) mSelected = value["selected"]; } -void LLPanelInventoryListItemBase::onMouseEnter(S32 x, S32 y, MASK mask) +BOOL LLPanelInventoryListItemBase::handleHover(S32 x, S32 y, MASK mask) { mHovered = true; - LLPanel::onMouseEnter(x, y, mask); + return LLPanel::handleHover(x, y, mask); } void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index b1ef6c74ee..d4dd212cc3 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -129,8 +129,8 @@ public: */ /*virtual*/ S32 notify(const LLSD& info); - /* Highlights item */ - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); + /* Highlights item */ + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /* Removes item highlight */ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); @@ -153,6 +153,7 @@ public: LLViewerInventoryItem* getItem() const; void setSeparatorVisible(bool visible) { mSeparatorVisible = visible; } + void resetHighlight() { mHovered = FALSE; } virtual ~LLPanelInventoryListItemBase(){} diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b1e6364cbf..105fb7766b 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -34,6 +34,7 @@ #include "llagent.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llavatarnamecache.h" #include "llclipboard.h" #include "llinventorypanel.h" #include "llinventorybridge.h" @@ -1133,19 +1134,19 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) { // Valid UUID; set the item UUID and rename it new_item->setCreator(id); - std::string avatar_name; + LLAvatarName av_name; - if (gCacheName->getFullName(id, avatar_name)) + if (LLAvatarNameCache::get(id, &av_name)) { - new_item->rename(avatar_name); + new_item->rename(av_name.getUserName()); mask |= LLInventoryObserver::LABEL; } else { // Fetch the current name - gCacheName->get(id, FALSE, + LLAvatarNameCache::get(id, boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), - _1, _2, _3)); + _1, _2)); } } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 3ac24fe6b4..95066b3df1 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -523,9 +523,12 @@ void LLInventoryModelBackgroundFetch::incrFetchCount(S32 fetching) } } +static LLTrace::BlockTimerStatHandle FTM_BULK_FETCH("Bulk Fetch"); + // Bundle up a bunch of requests to send all at once. void LLInventoryModelBackgroundFetch::bulkFetch() { + LL_RECORD_BLOCK_TIME(FTM_BULK_FETCH); //Background fetch is called from gIdleCallbacks in a loop until background fetch is stopped. //If there are items in mFetchQueue, we want to check the time since the last bulkFetch was //sent. If it exceeds our retry time, go ahead and fire off another batch. diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 6574031afe..294aa01179 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -583,7 +583,26 @@ void LLJoystickCameraRotate::drawRotatedImage( LLPointer image, S32 r gGL.color4fv(UI_VERTEX_COLOR.mV); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // S32 scaledWidth = getLocalRect().getWidth(); + // S32 scaledHeight = getLocalRect().getHeight(); + + // gGL.texCoord2fv( uv[ (rotations + 0) % 4]); + // gGL.vertex2i(scaledWidth, scaledHeight ); + + // gGL.texCoord2fv( uv[ (rotations + 1) % 4]); + // gGL.vertex2i(0, scaledHeight ); + + // gGL.texCoord2fv( uv[ (rotations + 2) % 4]); + // gGL.vertex2i(0, 0); + + // gGL.texCoord2fv( uv[ (rotations + 3) % 4]); + // gGL.vertex2i(scaledWidth, 0); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { S32 scaledWidth = getLocalRect().getWidth(); S32 scaledHeight = getLocalRect().getHeight(); @@ -597,10 +616,18 @@ void LLJoystickCameraRotate::drawRotatedImage( LLPointer image, S32 r gGL.texCoord2fv( uv[ (rotations + 2) % 4]); gGL.vertex2i(0, 0); + + gGL.texCoord2fv( uv[ (rotations + 0) % 4]); + gGL.vertex2i(scaledWidth, scaledHeight ); + + gGL.texCoord2fv( uv[ (rotations + 2) % 4]); + gGL.vertex2i(0, 0); + gGL.texCoord2fv( uv[ (rotations + 3) % 4]); gGL.vertex2i(scaledWidth, 0); } gGL.end(); + // } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 7e15a26a7e..7bd82a1517 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -628,45 +628,65 @@ void LLManipScale::renderFaces( const LLBBox& bbox ) { gGL.color4fv( default_normal_color.mV ); LLGLDepthTest gls_depth(GL_FALSE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // // Face 0 + // gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); + // gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); + // gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); + + // // Face 1 + // gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); + // gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); + + // // Face 2 + // gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); + // gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); + + // // Face 3 + // gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); + // gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); + // gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); + // gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); + + // // Face 4 + // gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); + // gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); + + // // Face 5 + // gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); + // gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); + // gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { - // Face 0 - gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); - gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); - gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); - gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); - - // Face 1 - gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); - gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); - gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); - gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); - - // Face 2 gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); - gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); - gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); - - // Face 3 - gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); - gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); - gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); - gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); - - // Face 4 - gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); - - // Face 5 - gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); - gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); gGL.vertex3f(max.mV[VX], max.mV[VY], min.mV[VZ]); - gGL.vertex3f(max.mV[VX], min.mV[VY], min.mV[VZ]); + gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); + gGL.vertex3f(min.mV[VX], max.mV[VY], min.mV[VZ]); + gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); + gGL.vertex3f(min.mV[VX], min.mV[VY], min.mV[VZ]); + gGL.vertex3f(min.mV[VX], min.mV[VY], max.mV[VZ]); + gGL.vertex3f(max.mV[VX], min.mV[VY], max.mV[VZ]); + gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); + gGL.vertex3f(max.mV[VX], max.mV[VY], max.mV[VZ]); } gGL.end(); + // } // Find nearest vertex diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 86bf06d4a1..d2a5b14f05 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -122,7 +122,6 @@ namespace { { // Prompt the user with the warning (so they know why things are failing) LLSD subs; - subs["[ERROR_REASON]"] = reason; // We do show long descriptions in the alert (unlikely to be readable). The description string will be in the log though. std::string description; if (result.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_CONTENT)) @@ -146,6 +145,16 @@ namespace { { description = result.asString(); } + std::string reason_lc = reason; + LLStringUtil::toLower(reason_lc); + if (!description.empty() && reason_lc.find("unknown") != std::string::npos) + { + subs["[ERROR_REASON]"] = ""; + } + else + { + subs["[ERROR_REASON]"] = "'" + reason +"'\n"; + } subs["[ERROR_DESCRIPTION]"] = description; LLNotificationsUtil::add("MerchantTransactionFailed", subs); } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 924ed377c2..35aa962a28 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -879,7 +879,10 @@ void LLMediaCtrl::draw() // #endif // draw the browser - gGL.begin( LLRender::QUADS ); + // Remove QUADS rendering mode + //gGL.begin( LLRender::QUADS ); + gGL.begin( LLRender::TRIANGLES ); + // if (! media_plugin->getTextureCoordsOpenGL()) { // render using web browser reported width and height, instead of trying to invert GL scale @@ -892,6 +895,14 @@ void LLMediaCtrl::draw() gGL.texCoord2f( 0.f, max_v ); gGL.vertex2i( x_offset, y_offset ); + // Remove QUADS rendering mode + gGL.texCoord2f( max_u, 0.f ); + gGL.vertex2i( x_offset + width, y_offset + height ); + + gGL.texCoord2f( 0.f, max_v ); + gGL.vertex2i( x_offset, y_offset ); + // + gGL.texCoord2f( max_u, max_v ); gGL.vertex2i( x_offset + width, y_offset ); } @@ -907,6 +918,14 @@ void LLMediaCtrl::draw() gGL.texCoord2f( 0.f, 0.f ); gGL.vertex2i( x_offset, y_offset ); + // Remove QUADS rendering mode + gGL.texCoord2f( max_u, max_v ); + gGL.vertex2i( x_offset + width, y_offset + height ); + + gGL.texCoord2f( 0.f, 0.f ); + gGL.vertex2i( x_offset, y_offset ); + // + gGL.texCoord2f( max_u, 0.f ); gGL.vertex2i( x_offset + width, y_offset ); } diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 08e54871db..1ddf9f5138 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -800,10 +800,16 @@ void LLPanelStandStopFlying::updatePosition() // panel_ssf_container->setOrigin(0, y_pos); // } // -// S32 x_pos = bottom_tb_center-getRect().getWidth()/2 - left_tb_width; -// -// setOrigin( x_pos, 0); - return; +// if (gToolBarView != NULL && gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)->hasButtons()) +// { +// S32 x_pos = bottom_tb_center - getRect().getWidth() / 2 - left_tb_width; +// setOrigin( x_pos, 0); +// } +// else +// { +// S32 x_pos = bottom_tb_center - getRect().getWidth() / 2; +// setOrigin( x_pos, 0); +// } // } diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index e6a2d4ab66..b8402ca699 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -53,6 +53,7 @@ #include "llxfermanager.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llviewergenericmessage.h" // for gGenericDispatcher #include "llworld.h" //for particle system banning #include "llimview.h" @@ -276,6 +277,9 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) } else { + // FIRE-15746: Show block report in nearby chat + bool show_message = false; + // Need a local (non-const) copy to set up flags properly. LLMute localmute = mute; @@ -288,11 +292,17 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) mMutes.erase(it); // Don't need to call notifyObservers() here, since it will happen after the entry has been re-added below. + + // FIRE-15746: Show block report in nearby chat + show_message = false; } else { // There was no entry in the list previously. Fake things up by making it look like the previous entry had all properties unmuted. localmute.mFlags = LLMute::flagAll; + + // FIRE-15746: Show block report in nearby chat + show_message = true; } if(flags) @@ -312,7 +322,10 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) if (result.second) { LL_INFOS() << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL; - updateAdd(localmute); + // FIRE-15746: Show block report in nearby chat + //updateAdd(localmute); + updateAdd(localmute, show_message); + // notifyObservers(); notifyObserversDetailed(localmute); if(!(localmute.mFlags & LLMute::flagParticles)) @@ -343,7 +356,10 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) return FALSE; } -void LLMuteList::updateAdd(const LLMute& mute) +// FIRE-15746: Show block report in nearby chat +//void LLMuteList::updateAdd(const LLMute& mute) +void LLMuteList::updateAdd(const LLMute& mute, bool show_message /* = true */) +// { // External mutes (e.g. Avaline callers) are local only, don't send them to the server. if (mute.mType == LLMute::EXTERNAL) @@ -367,7 +383,7 @@ void LLMuteList::updateAdd(const LLMute& mute) mIsLoaded = TRUE; // why is this here? -MG // FIRE-15746: Show block report in nearby chat - if (gSavedSettings.getBOOL("FSReportBlockToNearbyChat")) + if (show_message && gSavedSettings.getBOOL("FSReportBlockToNearbyChat")) { LLStringUtil::format_map_t args; args["NAME"] = mute.mName; @@ -421,7 +437,10 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) { // Flags were updated, the mute entry needs to be retransmitted to the server and re-added to the list. mMutes.insert(localmute); - updateAdd(localmute); + // FIRE-15746: Show block report in nearby chat + ////updateAdd(localmute); + updateAdd(localmute, false); + // LL_INFOS() << "Updating mute entry " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL; } @@ -483,7 +502,7 @@ void LLMuteList::updateRemove(const LLMute& mute) // } -void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason) +void notify_automute_callback(const LLUUID& agent_id, const LLAvatarName& full_name, LLMuteList::EAutoReason reason) { std::string notif_name; switch (reason) @@ -501,7 +520,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& full_na } LLSD args; - args["NAME"] = full_name; + args["NAME"] = full_name.getUserName(); LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args, LLSD()); if (notif_ptr) @@ -526,17 +545,17 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason) removed = TRUE; remove(automute); - std::string full_name; - if (gCacheName->getFullName(agent_id, full_name)) - { - // name in cache, call callback directly - notify_automute_callback(agent_id, full_name, false, reason); - } - else - { - // not in cache, lookup name from cache - gCacheName->get(agent_id, false, - boost::bind(¬ify_automute_callback, _1, _2, _3, reason)); + LLAvatarName av_name; + if (LLAvatarNameCache::get(agent_id, &av_name)) + { + // name in cache, call callback directly + notify_automute_callback(agent_id, av_name, reason); + } + else + { + // not in cache, lookup name from cache + LLAvatarNameCache::get(agent_id, + boost::bind(¬ify_automute_callback, _1, _2, reason)); } } @@ -854,3 +873,101 @@ void LLMuteList::notifyObserversDetailed(const LLMute& mute) it = mObservers.upper_bound(observer); } } + +#if 0 // [FS Persisted Avatar Render Settings] +LLRenderMuteList::LLRenderMuteList() +{} + +bool LLRenderMuteList::saveToFile() +{ + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "render_mute_settings.txt"); + LLFILE* fp = LLFile::fopen(filename, "wb"); + if (!fp) + { + LL_WARNS() << "Couldn't open render mute list file: " << filename << LL_ENDL; + return false; + } + for (std::map::iterator it = sVisuallyMuteSettingsMap.begin(); it != sVisuallyMuteSettingsMap.end(); ++it) + { + if (it->second != 0) + { + std::string id_string; + it->first.toString(id_string); + fprintf(fp, "%d %s\n", (S32)it->second, id_string.c_str()); + } + } + fclose(fp); + return true; +} + +bool LLRenderMuteList::loadFromFile() +{ + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "render_mute_settings.txt"); + LLFILE* fp = LLFile::fopen(filename, "rb"); + if (!fp) + { + LL_WARNS() << "Couldn't open render mute list file: " << filename << LL_ENDL; + return false; + } + + char id_buffer[MAX_STRING]; + char buffer[MAX_STRING]; + while (!feof(fp) && fgets(buffer, MAX_STRING, fp)) + { + id_buffer[0] = '\0'; + S32 setting = 0; + sscanf(buffer, " %d %254s\n", &setting, id_buffer); + sVisuallyMuteSettingsMap[LLUUID(id_buffer)] = setting; + } + fclose(fp); + return true; +} + +void LLRenderMuteList::saveVisualMuteSetting(const LLUUID& agent_id, S32 setting) +{ + if(setting == 0) + { + sVisuallyMuteSettingsMap.erase(agent_id); + } + else + { + sVisuallyMuteSettingsMap[agent_id] = setting; + } + saveToFile(); + notifyObservers(); +} + +S32 LLRenderMuteList::getSavedVisualMuteSetting(const LLUUID& agent_id) +{ + std::map::iterator iter = sVisuallyMuteSettingsMap.find(agent_id); + if (iter != sVisuallyMuteSettingsMap.end()) + { + return iter->second; + } + + return 0; +} + +void LLRenderMuteList::addObserver(LLMuteListObserver* observer) +{ + mObservers.insert(observer); +} + +void LLRenderMuteList::removeObserver(LLMuteListObserver* observer) +{ + mObservers.erase(observer); +} + +void LLRenderMuteList::notifyObservers() +{ + for (observer_set_t::iterator it = mObservers.begin(); + it != mObservers.end(); + ) + { + LLMuteListObserver* observer = *it; + observer->onChange(); + // In case onChange() deleted an entry. + it = mObservers.upper_bound(observer); + } +} +#endif diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 4ceddc97fd..97a805583f 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -123,7 +123,10 @@ private: void notifyObservers(); void notifyObserversDetailed(const LLMute &mute); - void updateAdd(const LLMute& mute); + // FIRE-15746: Show block report in nearby chat + //void updateAdd(const LLMute& mute); + void updateAdd(const LLMute& mute, bool show_message = true); + // void updateRemove(const LLMute& mute); // TODO: NULL out mute_id in database @@ -175,5 +178,26 @@ public: virtual void onChangeDetailed(const LLMute& ) { } }; +#if 0 // [FS Persisted Avatar Render Settings] +class LLRenderMuteList : public LLSingleton +{ + LLSINGLETON(LLRenderMuteList); +public: + bool loadFromFile(); + bool saveToFile(); + S32 getSavedVisualMuteSetting(const LLUUID& agent_id); + void saveVisualMuteSetting(const LLUUID& agent_id, S32 setting); + + void addObserver(LLMuteListObserver* observer); + void removeObserver(LLMuteListObserver* observer); + + std::map sVisuallyMuteSettingsMap; + +private: + void notifyObservers(); + typedef std::set observer_set_t; + observer_set_t mObservers; +}; +#endif #endif //LL_MUTELIST_H diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 1099316a19..8d32fb1d5c 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -35,6 +35,7 @@ #include "lluuid.h" #include "llcachename.h" +#include "llavatarnamecache.h" // statics std::set LLNameBox::sInstances; @@ -67,7 +68,9 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) if (!is_group) { - got_name = gCacheName->getFullName(name_id, name); + LLAvatarName av_name; + got_name = LLAvatarNameCache::get(name_id, &av_name); + name = av_name.getUserName(); } else { diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index b3b1ff7c06..055754f270 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -28,6 +28,7 @@ #include "llnameeditor.h" #include "llcachename.h" +#include "llavatarnamecache.h" #include "llfontgl.h" @@ -65,7 +66,9 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group) if (!is_group) { - gCacheName->getFullName(name_id, name); + LLAvatarName av_name; + LLAvatarNameCache::get(name_id, &av_name); + name = av_name.getUserName(); } else { diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 97c8638da5..63df2c8831 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -437,15 +437,22 @@ void LLNetMap::draw() if (pRegionImage && pRegionImage->hasGLTexture()) { gGL.getTexUnit(0)->bind(pRegionImage); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(local_left, local_top); gGL.texCoord2f(0.f, 0.f); gGL.vertex2f(local_left, local_bottom); gGL.texCoord2f(1.f, 0.f); gGL.vertex2f(local_right, local_bottom); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(local_left, local_top); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(local_right, local_bottom); gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(local_right, local_top); + } gGL.end(); pRegionImage->setBoostLevel(LLViewerTexture::BOOST_MAP_VISIBLE); @@ -461,16 +468,35 @@ void LLNetMap::draw() // [/SL:KB] // Draw using texture. gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture()); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2f(left, top); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2f(left, bottom); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2f(right, bottom); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2f(right, top); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(left, top); gGL.texCoord2f(0.f, 0.f); gGL.vertex2f(left, bottom); gGL.texCoord2f(1.f, 0.f); gGL.vertex2f(right, bottom); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(left, top); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(right, bottom); gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(right, top); + } gGL.end(); + // // Draw water gGL.setAlphaRejectSettings(LLRender::CF_GREATER, ABOVE_WATERLINE_ALPHA / 255.f); @@ -478,16 +504,35 @@ void LLNetMap::draw() if (regionp->getLand().getWaterTexture()) { gGL.getTexUnit(0)->bind(regionp->getLand().getWaterTexture()); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2f(left, top); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2f(left, bottom); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2f(right, bottom); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2f(right, top); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(left, top); gGL.texCoord2f(0.f, 0.f); gGL.vertex2f(left, bottom); gGL.texCoord2f(1.f, 0.f); gGL.vertex2f(right, bottom); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(left, top); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(right, bottom); gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(right, top); + } gGL.end(); + // } } gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); @@ -578,16 +623,33 @@ void LLNetMap::draw() gGL.color4f(1.f, 1.f, 1.f, 1.f); gGL.getTexUnit(0)->bind(mObjectImagep); // [/SL:KB] - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, map_center_agent.mV[VY] - image_half_height); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); gGL.texCoord2f(0.f, 0.f); gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, map_center_agent.mV[VY] - image_half_height); gGL.texCoord2f(1.f, 0.f); gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]); gGL.end(); + // // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3) } // [/SL:KB] @@ -601,13 +663,18 @@ void LLNetMap::draw() gGL.color4f(1.f, 1.f, 1.f, 1.f); gGL.getTexUnit(0)->bind(mParcelImagep); - gGL.begin(LLRender::QUADS); + gGL.begin(LLRender::TRIANGLES); gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); gGL.texCoord2f(0.f, 0.f); gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, map_center_agent.mV[VY] - image_half_height); gGL.texCoord2f(1.f, 0.f); gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex2f(image_half_width + map_center_agent.mV[VX], map_center_agent.mV[VY] - image_half_height); gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]); gGL.end(); diff --git a/indra/newview/llnotificationhandlerutil.cpp b/indra/newview/llnotificationhandlerutil.cpp index 2c976a57f1..ece4281d04 100644 --- a/indra/newview/llnotificationhandlerutil.cpp +++ b/indra/newview/llnotificationhandlerutil.cpp @@ -162,11 +162,11 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type, } } -void log_name_callback(const std::string& full_name, const std::string& from_name, +void log_name_callback(const LLAvatarName& av_name, const std::string& from_name, const std::string& message, const LLUUID& from_id) { - LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, full_name, from_name, message, + LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, av_name.getUserName(), from_name, message, from_id, LLUUID()); } @@ -189,11 +189,11 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi if(to_file_only) { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); + LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, "", notification->getMessage(), LLUUID())); } else { - gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); + LLAvatarNameCache::get(from_id, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id)); } } @@ -222,9 +222,18 @@ void LLHandlerUtil::logGroupNoticeToIMGroup( const std::string group_name = groupData.mName; const std::string sender_name = payload["sender_name"].asString(); - // we can't retrieve sender id from group notice system message, so try to lookup it from cache LLUUID sender_id; - gCacheName->getUUID(sender_name, sender_id); + if (payload.has("sender_id")) + { + sender_id = payload["sender_id"].asUUID(); + } + + if (sender_id.notNull()) + { + // Legacy support and fallback method + // if we can't retrieve sender id from group notice system message, try to lookup it from cache + sender_id = LLAvatarNameCache::findIdByName(sender_name); + } // Better group notices to IM log if (gSavedSettings.getBOOL("FSBetterGroupNoticesToIMLog")) @@ -303,7 +312,12 @@ std::string LLHandlerUtil::getSubstitutionName(const LLNotificationPtr& notifica { from_id = notification->getPayload()["from_id"]; } - if(!gCacheName->getFullName(from_id, res)) + LLAvatarName av_name; + if(LLAvatarNameCache::get(from_id, &av_name)) + { + res = av_name.getUserName(); + } + else { res = ""; } diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index cba1f5db7f..d6f1402c56 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1212,11 +1212,11 @@ void LLPanelGroupMembersSubTab::confirmEjectMembers() { LLSD args; // FIRE-19529: Group eject dialog doesn't show avatar name - //std::string fullname; - //gCacheName->getFullName(mMembersList->getValue(), fullname); - std::string fullname = LLSLURL("agent", mMembersList->getValue().asUUID(), "completename").getSLURLString(); + //LLAvatarName av_name; + //LLAvatarNameCache::get(mMembersList->getValue(), &av_name); + //args["AVATAR_NAME"] = av_name.getUserName(); + args["AVATAR_NAME"] = LLSLURL("agent", mMembersList->getValue().asUUID(), "completename").getSLURLString(); // - args["AVATAR_NAME"] = fullname; LLSD payload; LLNotificationsUtil::add("EjectGroupMemberWarning", args, @@ -1277,8 +1277,6 @@ void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, c for (uuid_vec_t::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i) { LLSD args; - // Always show complete name in rights confirmation dialogs - //args["AVATAR_NAME"] = LLSLURL("agent", *i, "displayname").getSLURLString(); args["AVATAR_NAME"] = LLSLURL("agent", *i, "completename").getSLURLString(); args["GROUP_NAME"] = group_data->mName; @@ -1927,9 +1925,9 @@ void LLPanelGroupMembersSubTab::confirmBanMembers() if (selection_count == 1) { LLSD args; - std::string fullname; - gCacheName->getFullName(mMembersList->getValue(), fullname); - args["AVATAR_NAME"] = fullname; + LLAvatarName av_name; + LLAvatarNameCache::get(mMembersList->getValue(), &av_name); + args["AVATAR_NAME"] = av_name.getUserName(); LLSD payload; LLNotificationsUtil::add("BanGroupMemberWarning", args, diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index e138468acf..c0399b8700 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -589,7 +589,6 @@ void LLPanelOutfitEdit::onOpen(const LLSD& key) // *TODO: this method is called even panel is not visible to user because its parent layout panel is hidden. // So, we can defer initializing a bit. mWearableListManager = new LLFilteredWearableListManager(mWearableItemsList, mListViewItemTypes[LVIT_ALL]->collector); - mWearableListManager->populateList(); displayCurrentOutfit(); mInitialized = true; } @@ -647,6 +646,10 @@ void LLPanelOutfitEdit::showAddWearablesPanel(bool show_add_wearables) // Reset mWearableItemsList position to top. See EXT-8180. mWearableItemsList->goToTop(); } + else + { + mWearableListManager->populateIfNeeded(); + } //switching button bars getChildView("no_add_wearables_button_bar")->setVisible( !show_add_wearables); @@ -676,6 +679,7 @@ void LLPanelOutfitEdit::showWearablesListView() { updateWearablesPanelVerbButtons(); updateFiltersVisibility(); + mWearableListManager->populateIfNeeded(); } mListViewBtn->setToggleState(TRUE); } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index c41b971856..10840de168 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -402,9 +402,9 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) LLAvatarPicks* avatar_picks = static_cast(data); if(avatar_picks && getAvatarId() == avatar_picks->target_id) { - std::string full_name; - gCacheName->getFullName(getAvatarId(), full_name); - getChild("pick_title")->setTextArg("[NAME]", full_name); + LLAvatarName av_name; + LLAvatarNameCache::get(getAvatarId(), &av_name); + getChild("pick_title")->setTextArg("[NAME]", av_name.getUserName()); // Save selection, to be able to edit same item after saving changes. See EXT-3023. LLUUID selected_id = mPicksList->getSelectedValue()[PICK_ID]; diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp index 73e5c43d46..31f3f5623d 100644 --- a/indra/newview/llpanelsnapshotlocal.cpp +++ b/indra/newview/llpanelsnapshotlocal.cpp @@ -194,7 +194,7 @@ void LLPanelSnapshotLocal::onSaveFlyoutCommit(LLUICtrl* ctrl) //} //else //{ - // cancel(); + // floater->notify(LLSD().with("set-finished", LLSD().with("ok", false).with("msg", "local"))); //} floater->saveLocal(boost::bind(&LLPanelSnapshotLocal::saveLocalCallback, this, _1)); // diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp index 8988669abb..5e430286ac 100644 --- a/indra/newview/llpanelsnapshotpostcard.cpp +++ b/indra/newview/llpanelsnapshotpostcard.cpp @@ -117,15 +117,13 @@ BOOL LLPanelSnapshotPostcard::postBuild() // virtual void LLPanelSnapshotPostcard::onOpen(const LLSD& key) { - // Fill "From" field - LLLineEditor* from = getChild("name_form"); - if (from->getText().empty()) + LLUICtrl* name_form = getChild("name_form"); + if (name_form && name_form->getValue().asString().empty()) { std::string name_string; LLAgentUI::buildFullname(name_string); - from->setText(name_string); + getChild("name_form")->setValue(LLSD(name_string)); } - // // For OpenSim compatibility // pick up the user's up-to-date email address diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 812282565b..9d4a798e61 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2563,8 +2563,14 @@ void LLLiveLSLEditor::loadAsset() if(item) { - LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), - boost::bind(&LLLiveLSLEditor::setAssociatedExperience, getDerivedHandle(), _1)); + LLViewerRegion* region = object->getRegion(); + std::string url = std::string(); + if(region) + { + url = region->getCapability("GetMetadata"); + } + LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), url, + boost::bind(&LLLiveLSLEditor::setAssociatedExperience, getDerivedHandle(), _1)); bool isGodlike = gAgent.isGodlike(); bool copyManipulate = gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE); diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index 25c576468b..25d7be831f 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -40,6 +40,7 @@ void LLRegionInfoModel::reset() { mSimAccess = 0; mAgentLimit = 0; + mHardAgentLimit = 100; mRegionFlags = 0; mEstateID = 0; @@ -143,6 +144,7 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, mParentEstateID); msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_SimAccess, mSimAccess); msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_MaxAgents, mAgentLimit); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, mObjectBonusFactor); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, mBillableFactor); msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, mWaterHeight); @@ -158,6 +160,8 @@ void LLRegionInfoModel::update(LLMessageSystem* msg) msg->getF32(_PREHASH_RegionInfo, _PREHASH_SunHour, mSunHour); LL_DEBUGS("Windlight Sync") << "Got region sun hour: " << mSunHour << LL_ENDL; + msg->getS32Fast(_PREHASH_RegionInfo2, _PREHASH_HardMaxAgents, mHardAgentLimit); + if (msg->has(_PREHASH_RegionInfo3)) { msg->getU64Fast(_PREHASH_RegionInfo3, _PREHASH_RegionFlagsExtended, mRegionFlags); diff --git a/indra/newview/llregioninfomodel.h b/indra/newview/llregioninfomodel.h index ea9640efda..baeff82fef 100644 --- a/indra/newview/llregioninfomodel.h +++ b/indra/newview/llregioninfomodel.h @@ -53,6 +53,8 @@ public: U8 mSimAccess; U8 mAgentLimit; + S32 mHardAgentLimit; + U64 mRegionFlags; U32 mEstateID; U32 mParentEstateID; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 78da8e03b4..3572c65116 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -33,6 +33,7 @@ // library includes #include "llcachename.h" +#include "llavatarnamecache.h" #include "lldbstrings.h" #include "lleconomy.h" #include "llgl.h" @@ -637,6 +638,12 @@ bool LLSelectMgr::linkObjects() return true; } + if (!LLSelectMgr::getInstance()->selectGetSameRegion()) + { + LLNotificationsUtil::add("CannotLinkAcrossRegions"); + return true; + } + LLSelectMgr::getInstance()->sendLink(); return true; @@ -2854,6 +2861,35 @@ BOOL LLSelectMgr::selectGetRootsModify() return TRUE; } +//----------------------------------------------------------------------------- +// selectGetSameRegion() - return TRUE if all objects are in same region +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetSameRegion() +{ + if (getSelection()->isEmpty()) + { + return TRUE; + } + LLViewerObject* object = getSelection()->getFirstObject(); + if (!object) + { + return FALSE; + } + LLViewerRegion* current_region = object->getRegion(); + + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++) + { + LLSelectNode* node = *iter; + object = node->getObject(); + if (!node->mValid || !object || current_region != object->getRegion()) + { + return FALSE; + } + } + + return TRUE; +} //----------------------------------------------------------------------------- // selectGetNonPermanentEnforced() - return TRUE if all objects are not @@ -5540,9 +5576,9 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use LLFloaterReporter *reporterp = LLFloaterReg::findTypedInstance("reporter"); if (reporterp) { - std::string fullname; - gCacheName->getFullName(owner_id, fullname); - reporterp->setPickedObjectProperties(name, fullname, owner_id); + LLAvatarName av_name; + LLAvatarNameCache::get(owner_id, &av_name); + reporterp->setPickedObjectProperties(name, av_name.getUserName(), owner_id); } } else if (request_flags & OBJECT_PAY_REQUEST) @@ -5953,7 +5989,8 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getFocusedObjectID(); - for (S32 pass = 0; pass < 2; pass++) + // Improve selection silhouette rendering speed by Drake Arconis + //for (S32 pass = 0; pass < 2; pass++) { for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); iter != mSelectedObjects->end(); iter++) @@ -6404,7 +6441,9 @@ void pushWireframe(LLDrawable* drawable) for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { const LLVolumeFace& face = volume->getVolumeFace(i); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices); } } @@ -6468,13 +6507,20 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) } else { - LLGLEnable fog(GL_FOG); - glFogi(GL_FOG_MODE, GL_LINEAR); - float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); - LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); - glFogf(GL_FOG_START, d); - glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); - glFogfv(GL_FOG_COLOR, fogCol.mV); + // Don't use fixed functions when using shader renderer; found by Drake Arconis + if (!LLGLSLShader::sNoFixedFunction) + { + // + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + // Don't use fixed functions when using shader renderer; found by Drake Arconis + } + // gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); { @@ -6596,13 +6642,20 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &aColor) { gGL.flush(); gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); - LLGLEnable fog(GL_FOG); - glFogi(GL_FOG_MODE, GL_LINEAR); - float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); - LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); - glFogf(GL_FOG_START, d); - glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); - glFogfv(GL_FOG_COLOR, fogCol.mV); + // Don't use fixed functions when using shader renderer; found by Drake Arconis + if (!LLGLSLShader::sNoFixedFunction) + { + // + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgentCamera.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + // Don't use fixed functions when using shader renderer; found by Drake Arconis + } + // LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); @@ -6791,7 +6844,7 @@ void LLSelectMgr::updateSelectionCenter() mSelectedObjects->mSelectType = getSelectTypeForObject(object); // Chalice Yao's pause agent on attachment selection - //if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && isAgentAvatarValid()) + //if (mSelectedObjects->mSelectType == SELECT_TYPE_ATTACHMENT && isAgentAvatarValid() && object->getParent() != NULL) //{ // mPauseRequest = gAgentAvatarp->requestPause(); //} diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 3e383d457d..c527a9dc6b 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -701,6 +701,9 @@ public: BOOL selectGetRootsModify(); BOOL selectGetModify(); + // returns TRUE if all objects are in same region + BOOL selectGetSameRegion(); + // returns TRUE if is all objects are non-permanent-enforced BOOL selectGetRootsNonPermanentEnforced(); BOOL selectGetNonPermanentEnforced(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index d97bfbde40..e202ac7412 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -392,7 +392,7 @@ void LLSidepanelAppearance::toggleWearableEditPanel(BOOL visible, LLViewerWearab return; } - if (mEditWearable->getVisible() == visible && (!visible || mEditWearable->getWearable() != wearable)) + if (mEditWearable->getVisible() == visible && (!visible || mEditWearable->getWearable() == wearable)) { // visibility isn't changing and panel doesn't need an update, hence nothing to do return; diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index bc44785134..ec6fa2f30d 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -46,6 +46,7 @@ #include "llviewerobjectlist.h" #include "llexperiencecache.h" #include "lltrans.h" +#include "llviewerregion.h" // [RLVa:KB] - Checked: RLVa-2.0.1 #include "rlvactions.h" #include "rlvcommon.h" @@ -330,9 +331,13 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) LLTextBox* tb = getChild("LabelItemExperience"); tb->setText(getString("loading_experience")); tb->setVisible(TRUE); - - LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), - boost::bind(&LLSidepanelItemInfo::setAssociatedExperience, getDerivedHandle(), _1)); + std::string url = std::string(); + if(object && object->getRegion()) + { + url = object->getRegion()->getCapability("GetMetadata"); + } + LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), url, + boost::bind(&LLSidepanelItemInfo::setAssociatedExperience, getDerivedHandle(), _1)); } ////////////////////// diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index c3c00361e3..d35d4e3ebb 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -298,7 +298,23 @@ void LLSnapshotLivePreview::draw() gGL.pushMatrix(); { gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.texCoord2f(uv_width, uv_height); + // gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + + // gGL.texCoord2f(0.f, uv_height); + // gGL.vertex2i(0, rect.getHeight() ); + + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(0, 0); + + // gGL.texCoord2f(uv_width, 0.f); + // gGL.vertex2i(rect.getWidth(), 0); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.texCoord2f(uv_width, uv_height); gGL.vertex2i(rect.getWidth(), rect.getHeight() ); @@ -309,10 +325,18 @@ void LLSnapshotLivePreview::draw() gGL.texCoord2f(0.f, 0.f); gGL.vertex2i(0, 0); + + gGL.texCoord2f(uv_width, uv_height); + gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2i(0, 0); + gGL.texCoord2f(uv_width, 0.f); gGL.vertex2i(rect.getWidth(), 0); } gGL.end(); + // } gGL.popMatrix(); @@ -359,23 +383,53 @@ void LLSnapshotLivePreview::draw() S32 y2 = gViewerWindow->getWindowHeightScaled(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.color4f(1.f, 1.f, 1.f, 0.f); + // gGL.vertex2i(x1, y1); + // gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2); + // gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + // gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); + // gGL.vertex2i(x2, y1); + + // gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + // gGL.vertex2i(x2, y1); + // gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); + // gGL.color4f(1.f, 1.f, 1.f, 0.f); + // gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2); + // gGL.vertex2i(x3, y1); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.color4f(1.f, 1.f, 1.f, 0.f); gGL.vertex2i(x1, y1); gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2); gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); + + gGL.color4f(1.f, 1.f, 1.f, 0.f); + gGL.vertex2i(x1, y1); + gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); gGL.vertex2i(x2, y1); + gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); gGL.vertex2i(x2, y1); gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); gGL.color4f(1.f, 1.f, 1.f, 0.f); gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2); + + gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + gGL.vertex2i(x2, y1); + gGL.color4f(1.f, 1.f, 1.f, 0.f); + gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2); gGL.vertex2i(x3, y1); } gGL.end(); + // } // if we're at the end of the animation, stop @@ -391,29 +445,45 @@ void LLSnapshotLivePreview::draw() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f(1.f, 1.f, 1.f, 1.f); const LLRect& outline_rect = getImageRect(); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + // gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + // gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); + // gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); + + // gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); + // gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); + // gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + // gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + + // gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); + // gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); + // gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + // gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + + // gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); + // gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); + // gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + // gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); - - gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - - gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); - gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - - gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); } gGL.end(); + // } // draw old image dropping away @@ -438,7 +508,23 @@ void LLSnapshotLivePreview::draw() LLRect& rect = mImageRect[old_image_index]; gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.texCoord2f(uv_width, uv_height); + // gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + + // gGL.texCoord2f(0.f, uv_height); + // gGL.vertex2i(0, rect.getHeight() ); + + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex2i(0, 0); + + // gGL.texCoord2f(uv_width, 0.f); + // gGL.vertex2i(rect.getWidth(), 0); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.texCoord2f(uv_width, uv_height); gGL.vertex2i(rect.getWidth(), rect.getHeight() ); @@ -449,10 +535,17 @@ void LLSnapshotLivePreview::draw() gGL.texCoord2f(0.f, 0.f); gGL.vertex2i(0, 0); + gGL.texCoord2f(uv_width, uv_height); + gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2i(0, 0); + gGL.texCoord2f(uv_width, 0.f); gGL.vertex2i(rect.getWidth(), 0); } gGL.end(); + // } gGL.popMatrix(); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 28b1ed506c..f970c05474 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -53,6 +53,8 @@ #include "lltextureatlas.h" #include "llviewershadermgr.h" +#include "llvotree.h" + static LLTrace::BlockTimerStatHandle FTM_FRUSTUM_CULL("Frustum Culling"); static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound Partition"); @@ -888,6 +890,9 @@ void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* c void LLSpatialGroup::destroyGL(bool keep_occlusion) { + // Reset VB during TP + bool is_tree_group = getSpatialPartition()->mPartitionType == LLViewerRegion::PARTITION_TREE; + setState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::IMAGE_DIRTY); if (!keep_occlusion) @@ -906,7 +911,6 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion) releaseOcclusionQueryObjectNames(); } - for (LLSpatialGroup::element_iter i = getDataBegin(); i != getDataEnd(); ++i) { LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable(); @@ -922,6 +926,13 @@ void LLSpatialGroup::destroyGL(bool keep_occlusion) facep->clearVertexBuffer(); } } + + // Reset VB during TP + if (is_tree_group && drawable->getVObj()) + { + ((LLVOTree*)drawable->getVObj().get())->destroyVB(); + } + // } } @@ -1576,7 +1587,9 @@ void pushVerts(LLVolume* volume) for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) { const LLVolumeFace& face = volume->getVolumeFace(i); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices); } } @@ -2522,11 +2535,15 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); gGL.diffuseColor4fv(color.mV); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); } else @@ -2601,17 +2618,34 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) if (phys_volume->mHullPoints && phys_volume->mHullIndices) { - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); - LLVertexBuffer::unbind(); - glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); - gGL.diffuseColor4fv(line_color.mV); - gGL.syncMatrices(); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); - - gGL.diffuseColor4fv(color.mV); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + if (LLGLSLShader::sNoFixedFunction) + { + gGL.diffuseColor4fv(line_color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + + gGL.diffuseColor4fv(color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices); + } + else + { + // + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); + LLVertexBuffer::unbind(); + glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); + gGL.diffuseColor4fv(line_color.mV); + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); + + gGL.diffuseColor4fv(color.mV); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } + // } else { @@ -3125,11 +3159,23 @@ void renderRaycast(LLDrawable* drawablep) { //render face positions - LLVertexBuffer::unbind(); - gGL.diffuseColor4f(0,1,1,0.5f); - glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); - gGL.syncMatrices(); - glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + if (LLGLSLShader::sNoFixedFunction) + { + gGL.diffuseColor4f(0.f, 1.f, 1.f, 0.5f); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mNumVertices, face.mPositions, NULL, face.mNumIndices, face.mIndices); + } + else + { + // + LLVertexBuffer::unbind(); + gGL.diffuseColor4f(0,1,1,0.5f); + glVertexPointer(3, GL_FLOAT, sizeof(LLVector4a), face.mPositions); + gGL.syncMatrices(); + glDrawElements(GL_TRIANGLES, face.mNumIndices, GL_UNSIGNED_SHORT, face.mIndices); + // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr + } + // } if (!volume->isUnique()) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 43ce735a46..ca773d8c1a 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -29,6 +29,7 @@ #include "llspeakers.h" #include "llagent.h" +#include "llavatarnamecache.h" #include "llappviewer.h" #include "llimview.h" #include "llgroupmgr.h" @@ -81,13 +82,13 @@ void LLSpeaker::lookupName() if(!gCacheName) return; // - gCacheName->get(mID, false, boost::bind(&LLSpeaker::onNameCache, this, _1, _2, _3)); + LLAvatarNameCache::get(mID, boost::bind(&LLSpeaker::onNameCache, this, _1, _2)); // todo: can be group??? } } -void LLSpeaker::onNameCache(const LLUUID& id, const std::string& full_name, bool is_group) +void LLSpeaker::onNameCache(const LLUUID& id, const LLAvatarName& av_name) { - mDisplayName = full_name; + mDisplayName = av_name.getUserName(); } bool LLSpeaker::isInVoiceChannel() diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 617bae3984..d1dbf72fe9 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -34,6 +34,7 @@ #include "llcoros.h" class LLSpeakerMgr; +class LLAvatarName; // data for a given participant in a voice channel class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider, public boost::signals2::trackable @@ -61,7 +62,7 @@ public: ~LLSpeaker() {}; void lookupName(); - void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); + void onNameCache(const LLUUID& id, const LLAvatarName& full_name); bool isInVoiceChannel(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 40cbfca5d6..7e63a0e8bd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -56,6 +56,7 @@ #include "llerrorcontrol.h" #include "llfloaterreg.h" #include "llfocusmgr.h" +#include "llfloatergridstatus.h" #include "llfloaterimsession.h" #include "lllocationhistory.h" #include "llimageworker.h" @@ -1442,6 +1443,9 @@ bool idle_startup() // Load media plugin cookies LLViewerMedia::loadCookieFile(); + // [FS Persisted Avatar Render Settings] + //LLRenderMuteList::getInstance()->loadFromFile(); + //------------------------------------------------- // Handle startup progress screen //------------------------------------------------- @@ -2573,6 +2577,8 @@ bool idle_startup() LLFloaterReg::showInitialVisibleInstances(); + LLFloaterGridStatus::getInstance()->startGridStatusTimer(); + display_startup(); // [FS Login Panel] diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 6ae7428e35..ae6f335fb8 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -445,38 +445,64 @@ void LLFloaterTexturePicker::draw() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + // gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); + // gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + // gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); + // gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); + + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mTop); + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + // gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); + // gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); + + + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + // gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + // gGL.vertex2i(local_rect.mRight, local_rect.mBottom); + // gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + // gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); + // gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); + gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); + gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); + gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); + gGL.vertex2i(local_rect.mLeft, local_rect.mTop); } gGL.end(); + // } } diff --git a/indra/newview/lltoastscripttextbox.cpp b/indra/newview/lltoastscripttextbox.cpp index dce5e11477..cbd387ef68 100644 --- a/indra/newview/lltoastscripttextbox.cpp +++ b/indra/newview/lltoastscripttextbox.cpp @@ -28,38 +28,24 @@ #include "lltoastscripttextbox.h" -#include "llfocusmgr.h" - -#include "llbutton.h" +#include "lllslconstants.h" #include "llnotifications.h" +#include "llstyle.h" +#include "lluiconstants.h" #include "llviewertexteditor.h" -#include "llavatarnamecache.h" -#include "lluiconstants.h" -#include "llui.h" -#include "llviewercontrol.h" -#include "lltrans.h" -#include "llstyle.h" - -#include "llglheaders.h" -#include "llagent.h" +const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT= 14; #include "lldbstrings.h" -const S32 LLToastScriptTextbox::DEFAULT_MESSAGE_MAX_LINE_COUNT= 7; - LLToastScriptTextbox::LLToastScriptTextbox(const LLNotificationPtr& notification) : LLToastPanel(notification) { buildFromFile( "panel_notify_textbox.xml"); - - LLTextEditor* text_editorp = getChild("text_editor_box"); - + mInfoText = getChild("text_editor_box"); const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE; - - text_editorp->setMaxTextLength(MAX_LENGTH); - text_editorp->setValue(notification->getMessage()); - + mInfoText->setMaxTextLength(MAX_LENGTH); + mInfoText->setValue(notification->getMessage()); getChild("ignore_btn")->setClickedCallback(boost::bind(&LLToastScriptTextbox::onClickIgnore, this)); @@ -80,13 +66,7 @@ LLToastScriptTextbox::LLToastScriptTextbox(const LLNotificationPtr& notification pSubmitBtn->setClickedCallback((boost::bind(&LLToastScriptTextbox::onClickSubmit, this))); setDefaultBtn(pSubmitBtn); - S32 maxLinesCount; - std::istringstream ss( getString("message_max_lines_count") ); - if (!(ss >> maxLinesCount)) - { - maxLinesCount = DEFAULT_MESSAGE_MAX_LINE_COUNT; - } - //snapToMessageHeight(pMessageText, maxLinesCount); + snapToMessageHeight(); } // virtual @@ -99,7 +79,6 @@ void LLToastScriptTextbox::close() die(); } -#include "lllslconstants.h" void LLToastScriptTextbox::onClickSubmit() { LLViewerTextEditor* pMessageText = getChild("message"); @@ -126,3 +105,29 @@ void LLToastScriptTextbox::onClickIgnore() mNotification->respond(response); close(); } + +void LLToastScriptTextbox::snapToMessageHeight() +{ + LLPanel* info_pan = getChild("info_panel"); + if (!info_pan) + { + return; + } + + S32 maxLinesCount; + std::istringstream ss( getString("message_max_lines_count") ); + if (!(ss >> maxLinesCount)) + { + maxLinesCount = DEFAULT_MESSAGE_MAX_LINE_COUNT; + } + + + S32 maxTextHeight = (mInfoText->getFont()->getLineHeight() * maxLinesCount); + S32 oldTextHeight = mInfoText->getRect().getHeight(); + S32 newTextHeight = llmin(mInfoText->getTextBoundingRect().getHeight(), maxTextHeight); + + S32 heightDelta = newTextHeight - oldTextHeight; + + reshape( getRect().getWidth(), llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT)); + info_pan->reshape(info_pan->getRect().getWidth(),newTextHeight); +} diff --git a/indra/newview/lltoastscripttextbox.h b/indra/newview/lltoastscripttextbox.h index 7d33446248..7aee02dd00 100644 --- a/indra/newview/lltoastscripttextbox.h +++ b/indra/newview/lltoastscripttextbox.h @@ -48,9 +48,12 @@ public: private: + LLTextBox* mInfoText; + void onClickSubmit(); void onClickIgnore(); + void snapToMessageHeight(); static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT; }; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 9bd97327e6..922fd817ef 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1623,12 +1623,12 @@ static void show_object_sharing_confirmation(const std::string name, } static void get_name_cb(const LLUUID& id, - const std::string& full_name, + const LLAvatarName& av_name, LLInventoryObject* inv_obj, const LLSD& dest, const LLUUID& dest_agent) { - show_object_sharing_confirmation(full_name, + show_object_sharing_confirmation(av_name.getUserName(), inv_obj, dest, id, @@ -1673,17 +1673,17 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ // If no IM session found get the destination agent's name by id. if (NULL == session) { - std::string fullname; + LLAvatarName av_name; // If destination agent's name is found in cash proceed to showing the confirmation dialog. // Otherwise set up a callback to show the dialog when the name arrives. - if (gCacheName->getFullName(dest_agent, fullname)) + if (LLAvatarNameCache::get(dest_agent, &av_name)) { - show_object_sharing_confirmation(fullname, inv_obj, dest, dest_agent, LLUUID::null); + show_object_sharing_confirmation(av_name.getUserName(), inv_obj, dest, dest_agent, LLUUID::null); } else { - gCacheName->get(dest_agent, false, boost::bind(&get_name_cb, _1, _2, inv_obj, dest, dest_agent)); + LLAvatarNameCache::get(dest_agent, boost::bind(&get_name_cb, _1, _2, inv_obj, dest, dest_agent)); } return true; diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index cd6a292b5f..02e8e4d391 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -280,7 +280,20 @@ void LLVisualParamHint::draw(F32 alpha) gGL.color4f(1.f, 1.f, 1.f, alpha); LLGLSUIDefault gls_ui; - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.texCoord2i(0, 1); + // gGL.vertex2i(0, mFullHeight); + // gGL.texCoord2i(0, 0); + // gGL.vertex2i(0, 0); + // gGL.texCoord2i(1, 0); + // gGL.vertex2i(mFullWidth, 0); + // gGL.texCoord2i(1, 1); + // gGL.vertex2i(mFullWidth, mFullHeight); + //} + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.texCoord2i(0, 1); gGL.vertex2i(0, mFullHeight); @@ -288,10 +301,16 @@ void LLVisualParamHint::draw(F32 alpha) gGL.vertex2i(0, 0); gGL.texCoord2i(1, 0); gGL.vertex2i(mFullWidth, 0); + + gGL.texCoord2i(0, 1); + gGL.vertex2i(0, mFullHeight); + gGL.texCoord2i(1, 0); + gGL.vertex2i(mFullWidth, 0); gGL.texCoord2i(1, 1); gGL.vertex2i(mFullWidth, mFullHeight); } gGL.end(); + // gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 415293aa41..77fc41467e 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -979,14 +979,19 @@ BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg) line.append(LLTrans::getString("RetrievingData")); } } - else if(gCacheName->getFullName(owner, name)) - { - line.append(name); - } - else - { - line.append(LLTrans::getString("RetrievingData")); - } + else + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(owner, &av_name)) + { + name = av_name.getUserName(); + line.append(name); + } + else + { + line.append(LLTrans::getString("RetrievingData")); + } + } } else { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 661403a4d2..f684764e6b 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -38,6 +38,7 @@ #include "llfloaterautoreplacesettings.h" #include "llfloateravatar.h" #include "llfloateravatarpicker.h" +//#include "llfloateravatarrendersettings.h" // [FS Persisted Avatar Render Settings] #include "llfloateravatartextures.h" #include "llfloaterbigpreview.h" #include "llfloaterbeacons.h" @@ -70,6 +71,7 @@ #include "llfloaterfonttest.h" #include "llfloatergesture.h" #include "llfloatergodtools.h" +#include "llfloatergridstatus.h" #include "llfloatergroups.h" #include "llfloaterhelpbrowser.h" #include "llfloaterhoverheight.h" @@ -238,6 +240,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar", "floater_avatar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + // [FS Persisted Avatar Render Settings] + //LLFloaterReg::add("avatar_render_settings", "floater_avatar_render_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_textures", "floater_avatar_textures.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("beacons", "floater_beacons.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -279,6 +283,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("gestures", "floater_gesture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("god_tools", "floater_god_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("grid_status", "floater_grid_status.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("group_picker", "floater_choose_group.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("help_browser", "floater_help_browser.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f3dcc76ed0..5caa6e9c41 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1226,12 +1226,12 @@ void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id, void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent /*= LLUUID::null*/, LLPointer cb/*=NULL*/) { std::string item_desc = avatar_id.asString(); - std::string item_name; - gCacheName->getFullName(avatar_id, item_name); + LLAvatarName av_name; + LLAvatarNameCache::get(avatar_id, &av_name); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), // Must provide a parent LLUUID; Default to calling card folder - //parent, LLTransactionID::tnull, item_name, item_desc, LLAssetType::AT_CALLINGCARD, - (parent.isNull() ? gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD) : parent), LLTransactionID::tnull, item_name, item_desc, LLAssetType::AT_CALLINGCARD, + //parent, LLTransactionID::tnull, av_name.getUserName(), item_desc, LLAssetType::AT_CALLINGCARD, + (parent.isNull() ? gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD) : parent), LLTransactionID::tnull, av_name.getUserName(), item_desc, LLAssetType::AT_CALLINGCARD, // LLInventoryType::IT_CALLINGCARD, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb); } @@ -2440,9 +2440,9 @@ PermissionMask LLViewerInventoryItem::getPermissionMask() const //---------- -void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group) +void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const LLAvatarName& name) { - rename(name); + rename(name.getUserName()); gInventory.addChangedMask(LLInventoryObserver::LABEL, getUUID()); gInventory.notifyObservers(); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 3744f3096d..4ebb885cb9 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -39,6 +39,7 @@ class LLFolderView; class LLFolderBridge; class LLViewerInventoryCategory; class LLInventoryCallback; +class LLAvatarName; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLViewerInventoryItem @@ -158,7 +159,7 @@ public: PermissionMask getPermissionMask() const; // callback - void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group); + void onCallingCardNameLookup(const LLUUID& id, const LLAvatarName& name); // If this is a broken link, try to fix it and any other identical link. BOOL regenerateLink(); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index c673b22ef1..d86929d732 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -90,13 +90,26 @@ U32 LLViewerJointAttachment::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_ LLGLDisable cull_face(GL_CULL_FACE); gGL.color4f(1.f, 1.f, 1.f, 1.f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //{ + // gGL.vertex3f(-0.1f, 0.1f, 0.f); + // gGL.vertex3f(-0.1f, -0.1f, 0.f); + // gGL.vertex3f(0.1f, -0.1f, 0.f); + // gGL.vertex3f(0.1f, 0.1f, 0.f); + //}gGL.end(); + gGL.begin(LLRender::TRIANGLES); { gGL.vertex3f(-0.1f, 0.1f, 0.f); gGL.vertex3f(-0.1f, -0.1f, 0.f); gGL.vertex3f(0.1f, -0.1f, 0.f); + + gGL.vertex3f(-0.1f, 0.1f, 0.f); + gGL.vertex3f(0.1f, -0.1f, 0.f); gGL.vertex3f(0.1f, 0.1f, 0.f); - }gGL.end(); + } + gGL.end(); + // } return 0; } diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 43a81ada49..f858ed7afb 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -405,7 +405,9 @@ void LLViewerJointMesh::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_w LLStrider normalsp; LLStrider tex_coordsp; LLStrider vertex_weightsp; - LLStrider clothing_weightsp; + // Vectorized Weight4Strider and ClothWeightStrider by Drake Arconis + //LLStrider clothing_weightsp; + LLStrider clothing_weightsp; LLStrider indicesp; // Copy data into the faces from the polymesh data. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index fb7c727616..e647ea0e7e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5309,27 +5309,6 @@ class LLViewToggleUI : public view_listener_t } }; -class LLEditDuplicate : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - if(LLEditMenuHandler::gEditMenuHandler) - { - LLEditMenuHandler::gEditMenuHandler->duplicate(); - } - return true; - } -}; - -class LLEditEnableDuplicate : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); - return new_value; - } -}; - void handle_duplicate_in_place(void*) { LL_INFOS() << "handle_duplicate_in_place" << LL_ENDL; @@ -8094,7 +8073,7 @@ class LLMuteParticle : public view_listener_t // Blocklist sometimes shows "(waiting)" as avatar name when blocking particle owners void onAvatarNameCache(const LLUUID& av_id, const LLAvatarName& av_name) { - LLMute mute(av_id, av_name.getLegacyName(), LLMute::AGENT); + LLMute mute(av_id, av_name.getUserName(), LLMute::AGENT); if (LLMuteList::getInstance()->isMuted(mute.mID)) { LLMuteList::getInstance()->remove(mute); @@ -8114,10 +8093,10 @@ class LLMuteParticle : public view_listener_t if (id.notNull()) { // Blocklist sometimes shows "(waiting)" as avatar name when blocking particle owners - //std::string name; - //gCacheName->getFullName(id, name); + //LLAvatarName av_name; + //LLAvatarNameCache::get(id, &av_name); - //LLMute mute(id, name, LLMute::AGENT); + //LLMute mute(id, av_name.getUserName(), LLMute::AGENT); //if (LLMuteList::getInstance()->isMuted(mute.mID)) //{ // LLMuteList::getInstance()->remove(mute); @@ -10493,6 +10472,15 @@ class LLToolsSelectTool : public view_listener_t { LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(5); } + + // Note: if floater is not visible LLViewerWindow::updateLayout() will + // attempt to open it, but it won't bring it to front or de-minimize. + if (gFloaterTools && (gFloaterTools->isMinimized() || !gFloaterTools->isShown() || !gFloaterTools->isFrontmost())) + { + gFloaterTools->setMinimized(FALSE); + gFloaterTools->openFloater(); + gFloaterTools->setVisibleAndFrontmost(TRUE); + } return true; } }; @@ -10721,7 +10709,12 @@ public: void handle_voice_morphing_subscribe() { - LLWeb::loadURLExternal(LLTrans::getString("voice_morphing_url")); + LLWeb::loadURL(LLTrans::getString("voice_morphing_url")); +} + +void handle_premium_voice_morphing_subscribe() +{ + LLWeb::loadURL(LLTrans::getString("premium_voice_morphing_url")); } class LLToggleUIHints : public view_listener_t @@ -10907,7 +10900,6 @@ void initialize_edit_menu() view_listener_t::addMenu(new LLEditDelete(), "Edit.Delete"); view_listener_t::addMenu(new LLEditSelectAll(), "Edit.SelectAll"); view_listener_t::addMenu(new LLEditDeselect(), "Edit.Deselect"); - view_listener_t::addMenu(new LLEditDuplicate(), "Edit.Duplicate"); view_listener_t::addMenu(new LLEditTakeOff(), "Edit.TakeOff"); view_listener_t::addMenu(new LLEditEnableUndo(), "Edit.EnableUndo"); view_listener_t::addMenu(new LLEditEnableRedo(), "Edit.EnableRedo"); @@ -10917,7 +10909,6 @@ void initialize_edit_menu() view_listener_t::addMenu(new LLEditEnableDelete(), "Edit.EnableDelete"); view_listener_t::addMenu(new LLEditEnableSelectAll(), "Edit.EnableSelectAll"); view_listener_t::addMenu(new LLEditEnableDeselect(), "Edit.EnableDeselect"); - view_listener_t::addMenu(new LLEditEnableDuplicate(), "Edit.EnableDuplicate"); } @@ -11111,6 +11102,8 @@ void initialize_menus() // Communicate > Voice morphing > Subscribe... commit.add("Communicate.VoiceMorphing.Subscribe", boost::bind(&handle_voice_morphing_subscribe)); + // Communicate > Voice morphing > Premium perk... + commit.add("Communicate.VoiceMorphing.PremiumPerk", boost::bind(&handle_premium_voice_morphing_subscribe)); LLVivoxVoiceClient * voice_clientp = LLVivoxVoiceClient::getInstance(); enable.add("Communicate.VoiceMorphing.NoVoiceMorphing.Check" , boost::bind(&LLVivoxVoiceClient::onCheckVoiceEffect, voice_clientp, "NoVoiceMorphing")); @@ -11464,6 +11457,7 @@ void initialize_menus() view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar"); view_listener_t::addMenu(new LLObjectAttachToAvatar(false), "Object.AttachAddToAvatar"); view_listener_t::addMenu(new LLObjectReturn(), "Object.Return"); + commit.add("Object.Duplicate", boost::bind(&LLSelectMgr::duplicate, LLSelectMgr::getInstance())); view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse"); view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); view_listener_t::addMenu(new LLObjectDerender(), "Object.Derender"); @@ -11494,6 +11488,7 @@ void initialize_menus() enable.add("Object.EnableSit", boost::bind(&enable_object_sit, _1)); view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn"); + enable.add("Object.EnableDuplicate", boost::bind(&LLSelectMgr::canDuplicate, LLSelectMgr::getInstance())); view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); enable.add("Avatar.EnableMute", boost::bind(&enable_object_mute)); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 781fedfbf2..4e20922adf 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1522,6 +1522,14 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, gSavedSettings.getString("NotificationChannelUUID")), OfferMatcher(blocked_id)); } + +void inventory_offer_mute_avatar_callback(const LLUUID& blocked_id, + const LLAvatarName& av_name) +{ + inventory_offer_mute_callback(blocked_id, av_name.getUserName(), false); +} + + std::string LLOfferInfo::mResponderType = "offer_info"; LLOfferInfo::LLOfferInfo() @@ -1704,7 +1712,14 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& { if (notification_ptr != NULL) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback, _1, _2, _3)); + if (mFromGroup) + { + gCacheName->getGroup(mFromID, boost::bind(&inventory_offer_mute_callback, _1, _2, _3)); + } + else + { + LLAvatarNameCache::get(mFromID, boost::bind(&inventory_offer_mute_avatar_callback, _1, _2)); + } } } @@ -1923,7 +1938,14 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const llassert(notification_ptr != NULL); if (notification_ptr != NULL) { - gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback, _1, _2, _3)); + if (mFromGroup) + { + gCacheName->getGroup(mFromID, boost::bind(&inventory_offer_mute_callback, _1, _2, _3)); + } + else + { + LLAvatarNameCache::get(mFromID, boost::bind(&inventory_offer_mute_avatar_callback, _1, _2)); + } } } @@ -1973,12 +1995,12 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const else { /* - std::string full_name; - if (gCacheName->getFullName(mFromID, full_name)) + LLAvatarName av_name; + if (LLAvatarNameCache::get(mFromID, &av_name)) { from_string = LLTrans::getString("InvOfferAnObjectNamed") + " "+ LLTrans::getString("'") + mFromName - + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + full_name; - chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + full_name; + + LLTrans::getString("'")+" " + LLTrans::getString("InvOfferOwnedBy") + av_name.getUserName(); + chatHistory_string = mFromName + " " + LLTrans::getString("InvOfferOwnedBy") + " " + av_name.getUserName(); } else { @@ -3314,9 +3336,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { original_name = original_name.substr(0, index); } + std::string legacy_name = gCacheName->buildLegacyName(original_name); - LLUUID agent_id; - gCacheName->getUUID(legacy_name, agent_id); + LLUUID agent_id = LLAvatarNameCache::findIdByName(legacy_name); if (agent_id.isNull()) { @@ -3380,6 +3402,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["subject"] = subj; payload["message"] = mes; payload["sender_name"] = name; + payload["sender_id"] = agent_id; payload["group_id"] = group_id; payload["inventory_name"] = item_name; payload["received_time"] = LLDate::now(); @@ -3863,13 +3886,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } -// else if (is_do_not_disturb) -// [RLVa:KB] - Checked: RLVa-1.4.9 - else if ( (is_do_not_disturb) && (!fRlvAutoAccept) ) -// [/RLVa:KB] - { - send_do_not_disturb_message(msg, from_id); - } + // FIRE-1245: Option to block/reject teleport offers //else if (gSavedSettings.getBOOL("VoiceCallsFriendsOnly") && (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL)) //{ @@ -3882,6 +3899,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // else { +// if (is_do_not_disturb) +// [RLVa:KB] - Checked: RLVa-1.4.9 + if ( (is_do_not_disturb) && (!fRlvAutoAccept) ) +// [/RLVa:KB] + { + send_do_not_disturb_message(msg, from_id); + } + LLVector3 pos, look_at; U64 region_handle(0); U8 region_access(SIM_ACCESS_MIN); @@ -8003,7 +8028,7 @@ void handle_show_mean_events(void *) //LLFloaterBump::showInstance(); } -void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_group) +void mean_name_callback(const LLUUID &id, const LLAvatarName& av_name) { static const U32 max_collision_list_size = 20; if (gMeanCollisionList.size() > max_collision_list_size) @@ -8020,7 +8045,7 @@ void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_ LLMeanCollisionData *mcd = *iter; if (mcd->mPerp == id) { - mcd->mFullName = full_name; + mcd->mFullName = av_name.getUserName(); } } // Instant bump list floater update @@ -8131,7 +8156,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use { LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag); gMeanCollisionList.push_front(mcd); - gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3)); + LLAvatarNameCache::get(perp, boost::bind(&mean_name_callback, _1, _2)); } // Instant bump list floater update else @@ -9054,16 +9079,13 @@ void send_lures(const LLSD& notification, const LLSD& response) // [RLVa:KB] - Checked: RLVa-2.0.1 bool fRlvCanShowName = (!notification["payload"].has("rlv_shownames")) ? true : !notification["payload"]["rlv_shownames"].asBoolean(); // [/RLVa:KB] - // Show complete name for TP lures - //std::string target_name; - //gCacheName->getFullName(target_id, target_name); // for im log filenames + LLAvatarName av_name; + LLAvatarNameCache::get(target_id, &av_name); // for im log filenames LLSD args; - //args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; // [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) args["TO_NAME"] = LLSLURL("agent", target_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();; // [/RLVa:KB] // args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString(); - // LLSD payload; @@ -9173,10 +9195,10 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response) return false; } - std::string from_name; - gCacheName->getFullName(from_id, from_name); + LLAvatarName av_name; + LLAvatarNameCache::get(from_id, &av_name); - if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(from_name)) + if(LLMuteList::getInstance()->isMuted(from_id) && !LLMuteList::getInstance()->isLinden(av_name.getUserName())) { return false; } @@ -9472,8 +9494,7 @@ bool callback_load_url(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", callback_load_url); - -// We've got the name of the person who owns the object hurling the url. +// We've got the name of the person or group that owns the object hurling the url. // Display confirmation dialog. void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool is_group) { @@ -9515,6 +9536,12 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool } } +// We've got the name of the person who owns the object hurling the url. +void callback_load_url_avatar_name(const LLUUID& id, const LLAvatarName& av_name) +{ + callback_load_url_name(id, av_name.getUserName(), false); +} + void process_load_url(LLMessageSystem* msg, void**) { LLUUID object_id; @@ -9559,8 +9586,14 @@ void process_load_url(LLMessageSystem* msg, void**) // Add to list of pending name lookups gLoadUrlList.push_back(payload); - gCacheName->get(owner_id, owner_is_group, - boost::bind(&callback_load_url_name, _1, _2, _3)); + if (owner_is_group) + { + gCacheName->getGroup(owner_id, boost::bind(&callback_load_url_name, _1, _2, _3)); + } + else + { + LLAvatarNameCache::get(owner_id, boost::bind(&callback_load_url_avatar_name, _1, _2)); + } } diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 789f5dc8ec..bfd15c5102 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1413,6 +1413,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredTreeShadowProgram.mShaderFiles.push_back(make_pair("deferred/treeShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredTreeShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredTreeShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) success = gDeferredTreeShadowProgram.createShader(NULL, NULL); } @@ -1814,7 +1815,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) success = gDeferredShadowProgram.createShader(NULL, NULL); } @@ -1824,7 +1825,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowCubeProgram.mShaderFiles.clear(); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) gDeferredShadowCubeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowCubeProgram.createShader(NULL, NULL); } @@ -1836,7 +1837,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) gDeferredShadowAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); } @@ -1848,7 +1849,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.clear(); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarShadowProgram.createShader(NULL, NULL); } @@ -1860,7 +1861,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mShaderFiles.clear(); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", /*gGLManager.mHasDepthClamp ? "1" :*/ "0"); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) gDeferredAttachmentShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 6a4a73f7d7..3d5e02c4b2 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -214,7 +214,7 @@ public: mToolTip = inv_item->getName() + '\n' + inv_item->getDescription(); } - /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const + /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const { if (num_chars == 0) { @@ -223,7 +223,7 @@ public: } else { - width = EMBEDDED_ITEM_LABEL_PADDING + mImage->getWidth() + mStyle->getFont()->getWidth(mLabel.c_str()); + width = EMBEDDED_ITEM_LABEL_PADDING + mImage->getWidth() + mStyle->getFont()->getWidthF32(mLabel.c_str()); height = llmax(mImage->getHeight(), mStyle->getFont()->getLineHeight()); } return false; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6cdb561a84..cf4be375e2 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3134,8 +3134,16 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) return TRUE; } - if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) - ||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))) + if (gAgent.isInitialized() + && (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE || gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL) + && gMenuBarView + && gMenuBarView->handleAcceleratorKey(key, mask)) + { + LLViewerEventRecorder::instance().logKeyEvent(key, mask); + return TRUE; + } + + if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)) { LLViewerEventRecorder::instance().logKeyEvent(key,mask); return TRUE; @@ -3322,8 +3330,16 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // [FS Communication UI] // give menus a chance to handle unmodified accelerator keys - if ((gMenuBarView && gMenuBarView->handleAcceleratorKey(key, mask)) - ||(gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))) + if (gAgent.isInitialized() + && (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE || gAgent.getTeleportState() == LLAgent::TELEPORT_LOCAL) + && gMenuBarView + && gMenuBarView->handleAcceleratorKey(key, mask)) + { + LLViewerEventRecorder::instance().logKeyEvent(key, mask); + return TRUE; + } + + if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask)) { return TRUE; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8759503bed..212f1254c6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -709,9 +709,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mMeshTexturesDirty = FALSE; mHeadp = NULL; - // Load persisted avatar render settings - mVisuallyMuteSetting = FSAvatarRenderPersistence::instance().getAvatarRenderSettings(id); - // set up animation variables mSpeed = 0.f; setAnimationData("Speed", &mSpeed); @@ -757,6 +754,10 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, { LLSceneMonitor::getInstance()->freezeAvatar((LLCharacter*)this); } + + // [FS Persisted Avatar Render Settings] + //mVisuallyMuteSetting = LLVOAvatar::VisualMuteSettings(LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(getID())); + mVisuallyMuteSetting = FSAvatarRenderPersistence::instance().getAvatarRenderSettings(id); } std::string LLVOAvatar::avString() const @@ -5080,16 +5081,35 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.color4ubv(color.mV); gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); - gGL.begin(LLRender::QUADS); - gGL.texCoord2f(0,0); - gGL.vertex3fv((pos+left-up).mV); - gGL.texCoord2f(1,0); - gGL.vertex3fv((pos-left-up).mV); - gGL.texCoord2f(1,1); - gGL.vertex3fv((pos-left+up).mV); - gGL.texCoord2f(0,1); - gGL.vertex3fv((pos+left+up).mV); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //gGL.texCoord2f(0,0); + //gGL.vertex3fv((pos+left-up).mV); + //gGL.texCoord2f(1,0); + //gGL.vertex3fv((pos-left-up).mV); + //gGL.texCoord2f(1,1); + //gGL.vertex3fv((pos-left+up).mV); + //gGL.texCoord2f(0,1); + //gGL.vertex3fv((pos+left+up).mV); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { + gGL.texCoord2f(0.f, 0.f); + gGL.vertex3fv((pos + left - up).mV); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3fv((pos - left - up).mV); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex3fv((pos - left + up).mV); + + gGL.texCoord2f(0.f, 0.f); + gGL.vertex3fv((pos + left - up).mV); + gGL.texCoord2f(1.f, 1.f); + gGL.vertex3fv((pos - left + up).mV); + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3fv((pos + left + up).mV); + } gGL.end(); + // gGL.flush(); return 6; @@ -7844,7 +7864,13 @@ BOOL LLVOAvatar::isFullyLoaded() const bool LLVOAvatar::isTooComplex() const { bool too_complex; - if (isSelf() || mVisuallyMuteSetting == AV_ALWAYS_RENDER) + // Performance improvement + //bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && gSavedSettings.getBOOL("AlwaysRenderFriends")); + static LLCachedControl alwaysRenderFriends(gSavedSettings, "AlwaysRenderFriends"); + bool render_friend = (LLAvatarTracker::instance().isBuddy(getID()) && alwaysRenderFriends); + // + + if (isSelf() || render_friend || mVisuallyMuteSetting == AV_ALWAYS_RENDER) { too_complex = false; } @@ -10128,11 +10154,11 @@ void LLVOAvatar::setVisualMuteSettings(VisualMuteSettings set) { mVisuallyMuteSetting = set; mNeedsImpostorUpdate = TRUE; - // Load persisted avatar render settings - FSAvatarRenderPersistence::instance().setAvatarRenderSettings(getID(), set); + // [FS Persisted Avatar Render Settings] + //LLRenderMuteList::getInstance()->saveVisualMuteSetting(getID(), S32(set)); + FSAvatarRenderPersistence::instance().setAvatarRenderSettings(getID(), set); } - void LLVOAvatar::calcMutedAVColor() { LLColor4 new_color(mMutedAVColor); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4bc91f635b..b84ed40e40 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1008,6 +1008,13 @@ void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time) { LLVOAvatar::idleUpdate(agent, time); idleUpdateTractorBeam(); + + // Make sure to definitely stop typing + if ((gAgent.getTypingTime() > LLAgent::TYPING_TIMEOUT_SECS) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) + { + gAgent.stopTyping(); + } + // } } diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 1b66add14f..5e0255e55e 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -77,6 +77,8 @@ public: void updateMesh(); + void destroyVB() { mReferenceBuffer = NULL; } + void appendMesh(LLStrider& vertices, LLStrider& normals, LLStrider& tex_coords, diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4bb7def6f2..2e4a2b3dbe 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -105,11 +105,13 @@ static LLTrace::BlockTimerStatHandle FTM_VOLUME_TEXTURES("Volume Textures"); extern BOOL gGLDebugLoggingEnabled; +// NaCl - Graphics crasher protection static bool enableVolumeSAPProtection() { - static LLCachedControl protect(gSavedSettings,"RenderVolumeSAProtection"); + static LLCachedControl protect(gSavedSettings, "RenderVolumeSAProtection"); return protect; } +// NaCl End // Implementation class of LLMediaDataClientObject. See llmediadataclient.h class LLMediaDataClientObjectImpl : public LLMediaDataClientObject @@ -216,7 +218,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re : LLViewerObject(id, pcode, regionp), // NaCl - Graphics crasher protection mVolumeImpl(NULL), - mVolumeSurfaceArea(-1.0) + mVolumeSurfaceArea(-1.f) // NaCl End { mTexAnimMode = 0; @@ -1769,8 +1771,10 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) res = mVolumeImpl->doUpdateGeometry(drawable); } // NaCl - Graphics crasher protection - if( enableVolumeSAPProtection() ) + if (enableVolumeSAPProtection()) + { mVolumeSurfaceArea = getVolume()->getSurfaceArea(); + } // NaCl End updateFaceFlags(); return res; @@ -1831,8 +1835,10 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) genBBoxes(FALSE); } // NaCl - Graphics crasher protection - if( enableVolumeSAPProtection() ) + if (enableVolumeSAPProtection()) + { mVolumeSurfaceArea = getVolume()->getSurfaceArea(); + } // NaCl End // Update face flags updateFaceFlags(); @@ -4897,26 +4903,24 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) llassert_always(vobj); - // AO: Z's protection auto-derender code - if (enableVolumeSAPProtection()) - { - // NaCl - Graphics crasher protection - static LLCachedControl volume_sa_thresh(gSavedSettings,"RenderVolumeSAThreshold"); - static LLCachedControl sculpt_sa_thresh(gSavedSettings, "RenderSculptSAThreshold"); - static LLCachedControl volume_sa_max_frame(gSavedSettings, "RenderVolumeSAFrameMax"); - F32 max_for_this_vol = (vobj->isSculpted()) ? sculpt_sa_thresh : volume_sa_thresh; - - if (vobj->mVolumeSurfaceArea > max_for_this_vol) + // Z's protection auto-derender code + if (enableVolumeSAPProtection()) { - LLPipeline::sVolumeSAFrame += vobj->mVolumeSurfaceArea; - if(LLPipeline::sVolumeSAFrame > volume_sa_max_frame) + static LLCachedControl volume_sa_thresh(gSavedSettings, "RenderVolumeSAThreshold"); + static LLCachedControl sculpt_sa_thresh(gSavedSettings, "RenderSculptSAThreshold"); + static LLCachedControl volume_sa_max_frame(gSavedSettings, "RenderVolumeSAFrameMax"); + F32 max_for_this_vol = (vobj->isSculpted()) ? sculpt_sa_thresh : volume_sa_thresh; + + if (vobj->mVolumeSurfaceArea > max_for_this_vol) { - continue; + LLPipeline::sVolumeSAFrame += vobj->mVolumeSurfaceArea; + if (LLPipeline::sVolumeSAFrame > volume_sa_max_frame) + { + continue; + } } } - // NaCl End - } - // + // vobj->updateTextureVirtualSize(true); vobj->preRebuild(); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 569dcd566e..e84d86c3fd 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -426,12 +426,25 @@ void LLWorldMapView::draw() gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.vertex2f(left, top); + // gGL.vertex2f(left, bottom); + // gGL.vertex2f(right, bottom); + // gGL.vertex2f(right, top); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.vertex2f(left, top); gGL.vertex2f(left, bottom); gGL.vertex2f(right, bottom); + + gGL.vertex2f(left, top); + gGL.vertex2f(right, bottom); gGL.vertex2f(right, top); + } gGL.end(); + // } // As part of the AO project, we no longer want to draw access indicators; // it's too complicated to get all the rules straight and will only @@ -480,16 +493,35 @@ void LLWorldMapView::draw() gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); gGL.getTexUnit(0)->bind(overlayimage); gGL.color4f(1.f, 1.f, 1.f, 1.f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex3f(left, top, -0.5f); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex3f(left, bottom, -0.5f); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex3f(right, bottom, -0.5f); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex3f(right, top, -0.5f); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex3f(left, top, -0.5f); gGL.texCoord2f(0.f, 0.f); gGL.vertex3f(left, bottom, -0.5f); gGL.texCoord2f(1.f, 0.f); gGL.vertex3f(right, bottom, -0.5f); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3f(left, top, -0.5f); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3f(right, bottom, -0.5f); gGL.texCoord2f(1.f, 1.f); gGL.vertex3f(right, top, -0.5f); + } gGL.end(); + // } } } @@ -776,16 +808,35 @@ bool LLWorldMapView::drawMipmapLevel(S32 width, S32 height, S32 level, bool load gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.color4f(1.f, 1.0f, 1.0f, 1.0f); - gGL.begin(LLRender::QUADS); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + // gGL.texCoord2f(0.f, 1.f); + // gGL.vertex3f(left, top, 0.f); + // gGL.texCoord2f(0.f, 0.f); + // gGL.vertex3f(left, bottom, 0.f); + // gGL.texCoord2f(1.f, 0.f); + // gGL.vertex3f(right, bottom, 0.f); + // gGL.texCoord2f(1.f, 1.f); + // gGL.vertex3f(right, top, 0.f); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { gGL.texCoord2f(0.f, 1.f); gGL.vertex3f(left, top, 0.f); gGL.texCoord2f(0.f, 0.f); gGL.vertex3f(left, bottom, 0.f); gGL.texCoord2f(1.f, 0.f); gGL.vertex3f(right, bottom, 0.f); + + gGL.texCoord2f(0.f, 1.f); + gGL.vertex3f(left, top, 0.f); + gGL.texCoord2f(1.f, 0.f); + gGL.vertex3f(right, bottom, 0.f); gGL.texCoord2f(1.f, 1.f); gGL.vertex3f(right, top, 0.f); + } gGL.end(); + // #if DEBUG_DRAW_TILE drawTileOutline(level, top, left, bottom, right); #endif // DEBUG_DRAW_TILE diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index affcab46a2..90ec683504 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -495,7 +495,10 @@ void LLPipeline::init() sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); - LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + // Vertex Array Objects are required in OpenGL core profile + //LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + LLVertexBuffer::sUseVAO = LLRender::sGLCoreProfile ? TRUE : gSavedSettings.getBOOL("RenderUseVAO"); + // LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw"); sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); @@ -584,9 +587,17 @@ void LLPipeline::init() mCubeVB = ll_create_cube_vb(LLVertexBuffer::MAP_VERTEX, GL_STATIC_DRAW_ARB); } - mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); - mDeferredVB->allocateBuffer(8, 0, true); + // Reset VB during TP + //mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); + //mDeferredVB->allocateBuffer(8, 0, true); + initDeferredVB(); + // setLightingDetail(-1); + + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + initAuxiliaryVB(); + // + // // Update all settings to trigger a cached settings refresh @@ -759,6 +770,9 @@ void LLPipeline::cleanup() mInitialized = false; + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + mAuxiliaryVB = NULL; + mDeferredVB = NULL; mCubeVB = NULL; @@ -7447,6 +7461,11 @@ void LLPipeline::doResetVertexBuffers(bool forced) mCubeVB = NULL; + mDeferredVB = NULL; + mAuxiliaryVB = NULL; + exoPostProcess::instance().destroyVB(); // Will be re-created via updateRenderDeferred() + gGL.destroyVB(); + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -7495,11 +7514,14 @@ void LLPipeline::doResetVertexBuffers(bool forced) LLVertexBuffer::unbind(); updateRenderBump(); - updateRenderDeferred(); + //updateRenderDeferred(); // Moved further down because of exoPostProcess creating a new VB sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips"); LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO"); - LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + // Vertex Array Objects are required in OpenGL core profile + //LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); + LLVertexBuffer::sUseVAO = LLRender::sGLCoreProfile ? TRUE : gSavedSettings.getBOOL("RenderUseVAO"); + // LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw"); LLVertexBuffer::sEnableVBOs = gSavedSettings.getBOOL("RenderVBOEnable"); LLVertexBuffer::sDisableVBOMapping = LLVertexBuffer::sEnableVBOs && gSavedSettings.getBOOL("RenderVBOMappingDisable") ; @@ -7510,6 +7532,15 @@ void LLPipeline::doResetVertexBuffers(bool forced) LLVertexBuffer::initClass(LLVertexBuffer::sEnableVBOs, LLVertexBuffer::sDisableVBOMapping); LLVOPartGroup::restoreGL(); + + // Reset VB during TP + updateRenderDeferred(); // Moved further down because of exoPostProcess creating a new VB + + gGL.initVB(); + + initDeferredVB(); + initAuxiliaryVB(); + // } void LLPipeline::renderObjects(U32 type, U32 mask, bool texture, bool batch_texture) @@ -7668,17 +7699,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) gGL.color4f(1,1,1,1); gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); - - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); - - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); - - gGL.end(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); + // + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); + // + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); + // + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // gGL.getTexUnit(0)->unbind(mScreen.getUsage()); @@ -7732,17 +7766,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) gGlowProgram.uniform2f(LLShaderMgr::GLOW_DELTA, 0, delta); } - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); - - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); - - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); - - gGL.end(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); + // + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); + // + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); + // + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // mGlow[i%2].flush(); } @@ -7911,17 +7948,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); - gGL.end(); + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // unbindDeferredShader(*shader); mDeferredLight.flush(); @@ -7946,17 +7986,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) shader->uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); shader->uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); - gGL.end(); + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // unbindDeferredShader(*shader); mScreen.flush(); @@ -8000,17 +8043,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) shader->uniform1f(LLShaderMgr::DOF_WIDTH, dof_width-1); shader->uniform1f(LLShaderMgr::DOF_HEIGHT, dof_height-1); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); - gGL.end(); + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // unbindDeferredShader(*shader); @@ -8043,17 +8089,20 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) shader->uniform1f(LLShaderMgr::GLOBAL_GAMMA, 1.0f); } - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); - gGL.end(); + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // unbindDeferredShader(*shader); @@ -8083,13 +8132,16 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) mDeferredLight.bindTexture(0, channel); } - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.vertex2f(-1,-1); - gGL.vertex2f(-1,3); - gGL.vertex2f(3,-1); - gGL.end(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.vertex2f(-1,-1); + //gGL.vertex2f(-1,3); + //gGL.vertex2f(3,-1); + //gGL.end(); - gGL.flush(); + //gGL.flush(); + drawAuxiliaryVB(); + // shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mDeferredLight.getUsage()); shader->unbind(); @@ -8119,13 +8171,16 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT, -0.5f/width*scale_x, -0.5f/height*scale_y, 0.5f/width*scale_x, 0.5f/height*scale_y); shader->uniform4f(LLShaderMgr::FXAA_RCP_FRAME_OPT2, -2.f/width*scale_x, -2.f/height*scale_y, 2.f/width*scale_x, 2.f/height*scale_y); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.vertex2f(-1,-1); - gGL.vertex2f(-1,3); - gGL.vertex2f(3,-1); - gGL.end(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.vertex2f(-1,-1); + //gGL.vertex2f(-1,3); + //gGL.vertex2f(3,-1); + //gGL.end(); - gGL.flush(); + //gGL.flush(); + drawAuxiliaryVB(); + // shader->unbind(); } } @@ -8211,22 +8266,25 @@ void LLPipeline::renderBloom(bool for_snapshot, F32 zoom_factor, int subfield) (F32) gViewerWindow->getWorldViewHeightRaw()*2); LLGLEnable blend(GL_BLEND); - gGL.color4f(1,1,1,0.75f); + //gGL.color4f(1,1,1,0.75f); // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics gGL.getTexUnit(0)->bind(&mPhysicsDisplay); - gGL.begin(LLRender::TRIANGLES); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); - - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); - - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); - - gGL.end(); - gGL.flush(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLES); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); + // + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); + // + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); + // + //gGL.end(); + //gGL.flush(); + drawAuxiliaryVB(tc1, tc2, LLColor4(1.f, 1.f, 1.f, 0.75f)); + // if (LLGLSLShader::sNoFixedFunction) { @@ -9028,17 +9086,20 @@ void LLPipeline::renderDeferredLighting() gDeferredPostGammaCorrectProgram.uniform1f(LLShaderMgr::DISPLAY_GAMMA, (gamma > 0.1f) ? 1.0f / gamma : (1.0f/2.2f)); - gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); - gGL.vertex2f(-1,-1); - - gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); - gGL.vertex2f(-1,3); - - gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); - gGL.vertex2f(3,-1); - - gGL.end(); + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + //gGL.begin(LLRender::TRIANGLE_STRIP); + //gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); + //gGL.vertex2f(-1,-1); + // + //gGL.texCoord2f(tc1.mV[0], tc2.mV[1]); + //gGL.vertex2f(-1,3); + // + //gGL.texCoord2f(tc2.mV[0], tc1.mV[1]); + //gGL.vertex2f(3,-1); + // + //gGL.end(); + drawAuxiliaryVB(tc1, tc2); + // gGL.getTexUnit(channel)->unbind(mScreen.getUsage()); gDeferredPostGammaCorrectProgram.unbind(); @@ -10238,7 +10299,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLGLEnable cull(GL_CULL_FACE); //enable depth clamping if available - LLGLEnable depth_clamp(gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP : 0); + LLGLEnable depth_clamp(/*gGLManager.mHasDepthClamp ? GL_DEPTH_CLAMP :*/ 0); // Fix void and region water flickr by Drake Arconis (Alchemy viewer) if (use_shader) { @@ -11701,12 +11762,25 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) } { - gGL.begin(LLRender::QUADS); - gGL.vertex3f(-1, -1, clip_plane); - gGL.vertex3f(1, -1, clip_plane); - gGL.vertex3f(1, 1, clip_plane); - gGL.vertex3f(-1, 1, clip_plane); + // Remove QUADS rendering mode + //gGL.begin(LLRender::QUADS); + //gGL.vertex3f(-1, -1, clip_plane); + //gGL.vertex3f(1, -1, clip_plane); + //gGL.vertex3f(1, 1, clip_plane); + //gGL.vertex3f(-1, 1, clip_plane); + //gGL.end(); + gGL.begin(LLRender::TRIANGLES); + { + gGL.vertex3f(-1.f, -1.f, clip_plane); + gGL.vertex3f(1.f, -1.f, clip_plane); + gGL.vertex3f(1.f, 1.f, clip_plane); + + gGL.vertex3f(-1.f, -1.f, clip_plane); + gGL.vertex3f(1.f, 1.f, clip_plane); + gGL.vertex3f(-1.f, 1.f, clip_plane); + } gGL.end(); + // gGL.flush(); } @@ -12066,3 +12140,53 @@ void LLPipeline::disableDeferredOnLowMemory() } } // + +// Reset VB during TP +void LLPipeline::initDeferredVB() +{ + mDeferredVB = new LLVertexBuffer(DEFERRED_VB_MASK, 0); + mDeferredVB->allocateBuffer(8, 0, true); +} +// + +// FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics +void LLPipeline::initAuxiliaryVB() +{ + mAuxiliaryVB = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR, 0); + mAuxiliaryVB->allocateBuffer(3, 0, true); + + LLStrider verts; + mAuxiliaryVB->getVertexStrider(verts); + verts[0].set(-1.f, -1.f, 0.f); + verts[1].set(-1.f, 3.f, 0.f); + verts[2].set(3.f, -1.f, 0.f); +} + +void LLPipeline::drawAuxiliaryVB(U32 mask /*= 0*/) +{ + mAuxiliaryVB->setBuffer(LLVertexBuffer::MAP_VERTEX | mask); + mAuxiliaryVB->drawArrays(LLRender::TRIANGLES, 0, 3); +} + +void LLPipeline::drawAuxiliaryVB(const LLVector2& tc1, const LLVector2& tc2, U32 mask /*= 0*/) +{ + LLStrider tc; + mAuxiliaryVB->getTexCoord0Strider(tc); + tc[0].set(tc1.mV[0], tc1.mV[1]); + tc[1].set(tc1.mV[0], tc2.mV[1]); + tc[2].set(tc2.mV[0], tc1.mV[1]); + + drawAuxiliaryVB(LLVertexBuffer::MAP_TEXCOORD0 | mask); +} + +void LLPipeline::drawAuxiliaryVB(const LLVector2& tc1, const LLVector2& tc2, const LLColor4& color) +{ + LLStrider col; + mAuxiliaryVB->getColorStrider(col); + col[0].set(color); + col[1].set(color); + col[2].set(color); + + drawAuxiliaryVB(tc1, tc2, LLVertexBuffer::MAP_COLOR); +} +// diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 928056ef08..b5ad293f76 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -424,6 +424,16 @@ private: void connectRefreshCachedSettingsSafe(const std::string name); void hideDrawable( LLDrawable *pDrawable ); void unhideDrawable( LLDrawable *pDrawable ); + + // Reset VB during TP + void initDeferredVB(); + + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + void initAuxiliaryVB(); + void drawAuxiliaryVB(U32 mask = 0); + void drawAuxiliaryVB(const LLVector2& tc1, const LLVector2& tc2, U32 mask = 0); + void drawAuxiliaryVB(const LLVector2& tc1, const LLVector2& tc2, const LLColor4& color); + public: enum {GPU_CLASS_MAX = 3 }; @@ -618,6 +628,9 @@ public: //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] LLPointer mCubeVB; + // FIRE-16829: Visual Artifacts with ALM enabled on AMD graphics + LLPointer mAuxiliaryVB; + //sun shadow map LLRenderTarget mShadow[6]; LLRenderTarget mShadowOcclusion[6]; diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4407112364..eb37919523 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -142,6 +142,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/textures/toolbar_icons/grid_status.png b/indra/newview/skins/default/textures/toolbar_icons/grid_status.png new file mode 100644 index 0000000000..b92b93cfb4 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/grid_status.png differ diff --git a/indra/newview/skins/default/xui/de/floater_flickr.xml b/indra/newview/skins/default/xui/de/floater_flickr.xml index 1e74e2e5ed..9c7092030a 100644 --- a/indra/newview/skins/default/xui/de/floater_flickr.xml +++ b/indra/newview/skins/default/xui/de/floater_flickr.xml @@ -1,5 +1,5 @@ - + diff --git a/indra/newview/skins/default/xui/de/floater_tos.xml b/indra/newview/skins/default/xui/de/floater_tos.xml index 9446adadc9..5dbff878f3 100644 --- a/indra/newview/skins/default/xui/de/floater_tos.xml +++ b/indra/newview/skins/default/xui/de/floater_tos.xml @@ -13,9 +13,6 @@ Lesen Sie die folgenden Servicebedingungen und Datenbestimmungen sorgfältig durch. Sie müssen den Servicebedingungen zustimmen, um sich bei [CURRENT_GRID] anmelden zu können. - Sie müssen auf my.secondlife.com gehen und sich einloggen, um den Servicebedingungen zuzustimmen, bevor Sie fortfahren können. Vielen Dank! - - - Sie müssen sich auf my.secondlife.com anmelden und die Servicebedingungen akzeptieren, bevor Sie fortfahren können. Vielen Dank! + Sie müssen sich unter https://my.secondlife.com anmelden und die Servicebedingungen akzeptieren, bevor Sie fortfahren können. Vielen Dank! diff --git a/indra/newview/skins/default/xui/de/menu_edit.xml b/indra/newview/skins/default/xui/de/menu_edit.xml index 37f68d68d5..23d5edc3ba 100644 --- a/indra/newview/skins/default/xui/de/menu_edit.xml +++ b/indra/newview/skins/default/xui/de/menu_edit.xml @@ -6,7 +6,6 @@ - diff --git a/indra/newview/skins/default/xui/de/menu_fs_block_list.xml b/indra/newview/skins/default/xui/de/menu_fs_block_list.xml index d50ef957ff..052193f120 100644 --- a/indra/newview/skins/default/xui/de/menu_fs_block_list.xml +++ b/indra/newview/skins/default/xui/de/menu_fs_block_list.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/indra/newview/skins/default/xui/de/menu_gesture_gear.xml b/indra/newview/skins/default/xui/de/menu_gesture_gear.xml index 0f0218193e..c3e6e94e51 100644 --- a/indra/newview/skins/default/xui/de/menu_gesture_gear.xml +++ b/indra/newview/skins/default/xui/de/menu_gesture_gear.xml @@ -1,6 +1,6 @@ - + diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml index eea33af60b..84a68d7048 100644 --- a/indra/newview/skins/default/xui/de/menu_inventory.xml +++ b/indra/newview/skins/default/xui/de/menu_inventory.xml @@ -42,7 +42,7 @@ - + @@ -83,7 +83,6 @@ - diff --git a/indra/newview/skins/default/xui/de/menu_people_blocked_gear.xml b/indra/newview/skins/default/xui/de/menu_people_blocked_gear.xml index f69a453e58..703f568dab 100644 --- a/indra/newview/skins/default/xui/de/menu_people_blocked_gear.xml +++ b/indra/newview/skins/default/xui/de/menu_people_blocked_gear.xml @@ -1,5 +1,9 @@ - + + + + + diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index 04dc887e6f..93e358bef4 100644 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -70,6 +70,7 @@ + @@ -137,6 +138,7 @@ + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 2d165e9111..13f02aaa7e 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -144,8 +144,7 @@ Marktplatzinitialisierung aufgrund eines System- oder Netzwerkfehlers fehlgeschl Marktplatztransaktion fehlgeschlagen mit Fehler: - Grund: „[ERROR_REASON]“ - [ERROR_DESCRIPTION] + [ERROR_REASON][ERROR_DESCRIPTION] @@ -777,6 +776,9 @@ Stellen Sie sicher, dass kein Objekt gesperrt ist und alle Objekte Ihnen gehöre Objekte können nicht über Regionsgrenzen hinweg verknüpft werden. + + Objekte können nicht über Regionsgrenzen hinweg verknüpft werden. + Verknüpfung nicht möglich, da nicht alle Objekte denselben Eigentümer haben. @@ -1817,7 +1819,6 @@ Diese Gruppe verlassen? Nicht-stören-Modus ist aktiviert: Sie erhalten keine Benachrichtigung über eingehende Kommunikation. - Andere Einwohner erhalten Ihre Nicht-stören-Antwort (festgelegt in Einstellungen > Privatsphäre > Automatische Antwort). -- Teleport-Angebote werden abgelehnt. - Voice-Anrufe werden abgelehnt. @@ -2668,9 +2669,6 @@ Von einer Webseite zu diesem Formular linken, um anderen leichten Zugang zu dies Abgebrochen - - Sitzen beendet - Anhängen abgebrochen @@ -4113,7 +4111,7 @@ Sie ist voll oder startet in Kürze neu. Objekt „[O]“ kann nicht nach -[P] in Region [R] verschoben werden, da ein unbekannter Fehler vorliegt. ([FAILURE_TYPE]) +[P] in Region [R] verschoben werden, da ein unbekannter Fehler vorliegt. ([F]) Ihnen fehlt die Berechtigung zum Modifizieren dieses Objekts. diff --git a/indra/newview/skins/default/xui/de/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/de/panel_block_list_sidetray.xml index c105a5b8a3..5c399280df 100644 --- a/indra/newview/skins/default/xui/de/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/de/panel_block_list_sidetray.xml @@ -7,5 +7,8 @@ + @@ -1217,6 +1224,16 @@ function="Floater.Toggle" parameter="fs_avatar_render_settings" /> + + + + @@ -1430,9 +1447,9 @@ name="Duplicate" shortcut="control|D"> + function="Object.Duplicate" /> + function="Object.EnableDuplicate" /> --> - - - + + - + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 8c362bbdec..d132e7f7ea 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -342,8 +342,7 @@ Initialization with the Marketplace failed because of a system or network error. type="alertmodal"> The transaction with the Marketplace failed with the following error : - Reason : '[ERROR_REASON]' - [ERROR_DESCRIPTION] + [ERROR_REASON][ERROR_DESCRIPTION] fail + +Objects cannot be linked across region boundaries. + fail + + - -Cancelled Sit. - - - + - + - + left="0" + name="textbox_panel" + top_pad="5" + width="305"> + + + width="370" + word_wrap="true"/> + width="370" + word_wrap="true"/> + width="370" + word_wrap="true"/> + width="370" + word_wrap="true"/> -This feature is currently in Beta. Please add your name to this [http://goo.gl/forms/FCQ7UXkakz Google form] if you would like to participate. +An error occurred while opening Marketplace Listings. +If you continue to receive this message, please contact Second Life support for assistance at http://support.secondlife.com Your Marketplace Listings folder is empty. @@ -2112,7 +2113,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Conference with [AGENT_NAME] - Inventory item offered + Inventory item '[ITEM_NAME]' offered + + + Inventory folder '[ITEM_NAME]' offered Inventory item offered to [NAME] @@ -2225,7 +2229,8 @@ If the message does not appear in the next few minutes, it may have been dropped Home position set. - http://secondlife.com/landing/voicemorphing + https://secondlife.com/destination/voice-island + https://secondlife.com/destination/voice-morphing-premium [NAME] paid you L$[AMOUNT] [REASON]. @@ -2370,7 +2375,7 @@ Abuse Report Despite our best efforts, something unexpected has gone wrong. -Please check status.secondlifegrid.net to see if there is a known problem with the service. +Please check http://status.secondlifegrid.net to see if there is a known problem with the service. If you continue to experience problems, please check your network and firewall setup. @@ -2562,6 +2567,7 @@ Try enclosing path to the editor with double quotes. Facebook Flickr Gestures + Grid status How to Inventory Map @@ -2624,6 +2630,7 @@ Try enclosing path to the editor with double quotes. Post to Facebook Upload to Flickr Gestures for your avatar (CTRL+G) + Show current Grid status How to do common tasks View and use your belongings (CTRL+I) Map of the world (CTRL+M) diff --git a/indra/newview/skins/default/xui/es/floater_flickr.xml b/indra/newview/skins/default/xui/es/floater_flickr.xml index 7f95d948fe..e254d8ba77 100644 --- a/indra/newview/skins/default/xui/es/floater_flickr.xml +++ b/indra/newview/skins/default/xui/es/floater_flickr.xml @@ -1,5 +1,5 @@ - + diff --git a/indra/newview/skins/default/xui/es/floater_tos.xml b/indra/newview/skins/default/xui/es/floater_tos.xml index 48b0facf59..e047a5f9e3 100644 --- a/indra/newview/skins/default/xui/es/floater_tos.xml +++ b/indra/newview/skins/default/xui/es/floater_tos.xml @@ -13,6 +13,6 @@ Por favor, lee detenidamente las siguientes Condiciones del servicio y Política de privacidad. Debes aceptar el acuerdo para poder iniciar sesión en [CURRENT_GRID]. - Para poder proseguir, debes iniciar sesión en my.secondlife.com y aceptar las Condiciones del servicio. Gracias. + Para poder proseguir, debes iniciar sesión en https://my.secondlife.com y aceptar las Condiciones del servicio. Gracias. diff --git a/indra/newview/skins/default/xui/es/menu_inventory.xml b/indra/newview/skins/default/xui/es/menu_inventory.xml index b074bd46c6..fa826c2b8f 100644 --- a/indra/newview/skins/default/xui/es/menu_inventory.xml +++ b/indra/newview/skins/default/xui/es/menu_inventory.xml @@ -42,6 +42,12 @@ + + + + + + @@ -61,6 +67,7 @@ + @@ -74,7 +81,6 @@ - @@ -98,7 +104,6 @@ - diff --git a/indra/newview/skins/default/xui/es/menu_login.xml b/indra/newview/skins/default/xui/es/menu_login.xml index d9f8f23576..4ab6bc84a3 100644 --- a/indra/newview/skins/default/xui/es/menu_login.xml +++ b/indra/newview/skins/default/xui/es/menu_login.xml @@ -2,6 +2,7 @@ + @@ -32,7 +33,6 @@ - diff --git a/indra/newview/skins/default/xui/es/menu_people_blocked_gear.xml b/indra/newview/skins/default/xui/es/menu_people_blocked_gear.xml index 8bbde9b38c..9189f92ce7 100644 --- a/indra/newview/skins/default/xui/es/menu_people_blocked_gear.xml +++ b/indra/newview/skins/default/xui/es/menu_people_blocked_gear.xml @@ -1,5 +1,8 @@ + + + diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 31c26bd8d6..57d60009c3 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -145,8 +145,7 @@ La inicialización del mercado ha fallado por un error del sistema o de la red. La transacción con el Mercado ha fallado por el siguiente error: - Motivo: '[ERROR_REASON]' - [ERROR_DESCRIPTION] + [ERROR_REASON][ERROR_DESCRIPTION] @@ -783,6 +782,9 @@ Por favor, asegúrate de que no hay ninguno bloqueado y de que eres el propietar No se pueden vincular objetos a través de límites de región. + + No se pueden vincular objetos a través de límites de región. + Imposible enlazarlos porque hay objetos de distintos propietarios. @@ -1813,7 +1815,6 @@ visita [[INFO_URL] detalles sobre esta actualización] Se ha activado el modo No disponible. No obtendrás un aviso cuando recibas comunicaciones. - Los otros residentes recibirán tu respuesta de No disponible (configurada en Preferencias > Privacidad > Autorrespuesta). -- Se rehusarán los ofrecimientos de teleporte. - Se rechazarán las llamadas de voz. @@ -2712,9 +2713,6 @@ URL: [AUDIOURL] Cancelado - - Cancelado el sentarte - Cancelada la anexión @@ -4181,32 +4179,32 @@ Prueba otra vez dentro de un minuto. Error al expulsar: no tienes permiso de administrador en esa parcela. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] en la región [REGION_NAME] porque la parcela está llena. + + No se puede mover el objeto '[O]' a +[P] de la región [R] porque la parcela está llena. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] de la región [REGION_NAME] porque tus objetos no están permitidos en esta parcela. + + No se puede mover el objeto '[O]' a +[P] de la región [R] porque tus objetos no están permitidos en esta parcela. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] de la región [REGION_NAME] porque no hay suficientes recursos para este objeto en esta parcela. + + No se puede mover el objeto '[O]' a +[P] de la región [R] porque no hay suficientes recursos para este objeto en esta parcela. Error al copiar: no tienes acceso a esa parcela. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] de la región [REGION_NAME] porque la otra región ejecuta una versión más antigua que no admite la recepción de este objeto atravesando regiones. + + No se puede mover el objeto '[O]' a +[P] de la región [R] porque la otra región ejecuta una versión más antigua que no admite la recepción de este objeto atravesando regiones. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] en la región [REGION_NAME] porque no puedes modificar el navmesh a través de límites de región. + + No se puede mover el objeto '[O]' a +[P] de la región [R] porque no puedes modificar el navmesh a través de límites de región. - - No se puede mover el objeto '[OBJECT_NAME]' a -[OBJ_POSITION] en la región [REGION_NAME] por un motivo desconocido. ([FAILURE_TYPE]) + + No se puede mover el objeto '[O]' a +[P] de la región [R] por un motivo desconocido. ([F]) No tienes permiso para modificar ese objeto diff --git a/indra/newview/skins/default/xui/es/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/es/panel_block_list_sidetray.xml index 8de2562112..024312bb55 100644 --- a/indra/newview/skins/default/xui/es/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/es/panel_block_list_sidetray.xml @@ -7,5 +7,8 @@