diff --git a/.hgtags b/.hgtags index 171502899b..06a9f2ad09 100755 --- a/.hgtags +++ b/.hgtags @@ -38,6 +38,7 @@ ab632018105ccfdf8a9e5ea1a8302badd58b686e Firestorm_5.0.1_Release 6eb3eb572c053c7c7b83287b2a57dbb57442a011 Firestorm_5.1.7_Release 8888a131acad19c49fcff1ad2cf75c54c8a41bb8 Firestorm_6.0.1_Beta ba5e1592f3a79317a3ebac441ee5946a81b97fab Firestorm_6.0.2_Release +7b5a98fba31fa019bddb3ae900c6dd94604bc8be Firestorm_6.2.4_Release bb38ff1a763738609e1b3cada6d15fa61e5e84b9 2.1.1-release 003dd9461bfa479049afcc34545ab3431b147c7c v2start 52d96ad3d39be29147c5b2181b3bb46af6164f0e alpha-3 @@ -591,3 +592,5 @@ a3143db58a0f6b005232bf9018e7fef17ff9ec90 6.1.0-release 706bdc7e25c6e6b8fb56f4a13fcce2936e70a79c 6.2.1-release ec09daf1899c1c01c4ba0ba950fae572f2a612a8 6.2.2-release ab2ec5c5423b277d23fd0511ce50c15123ff2e03 6.2.3-release +67297f9902857e357570c44722ad84de3aff974e 6.2.4-release +9777aec6dc4a30a24537297ac040861ce16b82ae 6.3.0-release diff --git a/README_BUILD_FIRESTORM_LINUX.txt b/README_BUILD_FIRESTORM_LINUX.txt index 670903f1c3..29d7a3220f 100755 --- a/README_BUILD_FIRESTORM_LINUX.txt +++ b/README_BUILD_FIRESTORM_LINUX.txt @@ -23,8 +23,8 @@ To build firestorm: autobuild build -A64 -c ReleaseFS Other examples: - autobuild configure -A64 -c ReleaseFS # basic configuration step, don't build, just configure - autobuild configure -A64 -c ReleaseFS -- --clean # clean the output area first, then configure + autobuild configure -A64 -c ReleaseFS # basic configuration step, don't build, just configure + autobuild configure -A64 -c ReleaseFS -- --clean # clean the output area first, then configure autobuild configure -A64 -c ReleaseFS -- --chan Private-Yourname # configure with a custom channel autobuild build -A64 -c ReleaseFS --no-configure # default quick rebuild diff --git a/autobuild.xml b/autobuild.xml index 9b017301da..9f99261122 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1006,11 +1006,11 @@ archive hash - 46c6881c26c05d9ab0c2b3bb7c4697f8 + 0fcdc89c60271eda1fb37879b0c4a373 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.00.01-darwin-191591326.tar.bz2 + file:///opt/firestorm/fmodstudio-2.00.03-darwin-192401637.tar.bz2 name darwin @@ -1020,11 +1020,11 @@ archive hash - 9111641e2b915c64529ed9624c1e9eb7 + 09f22b6a3ac41739073418bb6b8544d6 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.00.01-linux64-191601723.tar.bz2 + file:///opt/firestorm/fmodstudio-2.00.03-linux64-192401637.tar.bz2 name linux64 @@ -1034,11 +1034,11 @@ archive hash - f44299c9cf9c4224c6aee350284c3175 + a0d1821154e7ce5c418e3cdc2f26f3fc hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.01-windows-191591202.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.03-windows-192171947.tar.bz2 name windows @@ -1048,18 +1048,18 @@ archive hash - fd45c9663bbd413f779b3bd5ad6f3567 + b98d2da1ed02f8ba218de414a83d0edc hash_algorithm md5 url - file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.01-windows64-191591204.tar.bz2 + file:///c:/cygwin/opt/firestorm/fmodstudio-2.00.03-windows64-192171948.tar.bz2 name windows64 version - 2.00.01 + 2.00.03 fmodex diff --git a/indra/edit-me-to-trigger-new-build.txt b/indra/edit-me-to-trigger-new-build.txt index 8b13789179..8d1c8b69c3 100644 --- a/indra/edit-me-to-trigger-new-build.txt +++ b/indra/edit-me-to-trigger-new-build.txt @@ -1 +1 @@ - + diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 434ce98c9b..68cfa0440f 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1504,6 +1504,21 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) param_name[0] = 1071; //"tattoo_red"; param_name[1] = 1072; //"tattoo_green"; param_name[2] = 1073; //"tattoo_blue"; + break; + case TEX_HEAD_UNIVERSAL_TATTOO: + case TEX_UPPER_UNIVERSAL_TATTOO: + case TEX_LOWER_UNIVERSAL_TATTOO: + case TEX_SKIRT_TATTOO: + case TEX_HAIR_TATTOO: + case TEX_EYES_TATTOO: + case TEX_LEFT_ARM_TATTOO: + case TEX_LEFT_LEG_TATTOO: + case TEX_AUX1_TATTOO: + case TEX_AUX2_TATTOO: + case TEX_AUX3_TATTOO: + param_name[0] = 1238; //"tattoo_universal_red"; + param_name[1] = 1239; //"tattoo_universal_green"; + param_name[2] = 1240; //"tattoo_universal_blue"; break; default: diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 918ac9003b..440e43320c 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -26,9 +26,10 @@ #include "linden_common.h" #include "llavatarappearancedefines.h" +#include "indra_constants.h" -const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 512; -const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 512; +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024; +const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024; const S32 LLAvatarAppearanceDefines::IMPOSTOR_PERIOD = 2; using namespace LLAvatarAppearanceDefines; @@ -65,12 +66,30 @@ LLAvatarAppearanceDictionary::Textures::Textures() addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_TATTOO)); + addEntry(TEX_HEAD_UNIVERSAL_TATTOO, new TextureEntry("head_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_UPPER_UNIVERSAL_TATTOO, new TextureEntry("upper_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LOWER_UNIVERSAL_TATTOO, new TextureEntry("lower_universal_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_SKIRT_TATTOO, new TextureEntry("skirt_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_HAIR_TATTOO, new TextureEntry("hair_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_EYES_TATTOO, new TextureEntry("eyes_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_ARM_TATTOO, new TextureEntry("leftarm_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_LEFT_LEG_TATTOO, new TextureEntry("leftleg_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX1_TATTOO, new TextureEntry("aux1_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX2_TATTOO, new TextureEntry("aux2_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + addEntry(TEX_AUX3_TATTOO, new TextureEntry("aux3_tattoo", TRUE, BAKED_NUM_INDICES, "", LLWearableType::WT_UNIVERSAL)); + + addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD, "head")); addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER, "upper")); addEntry(TEX_LOWER_BAKED, new TextureEntry("lower-baked", FALSE, BAKED_LOWER, "lower")); addEntry(TEX_EYES_BAKED, new TextureEntry("eyes-baked", FALSE, BAKED_EYES, "eyes")); addEntry(TEX_HAIR_BAKED, new TextureEntry("hair-baked", FALSE, BAKED_HAIR, "hair")); addEntry(TEX_SKIRT_BAKED, new TextureEntry("skirt-baked", FALSE, BAKED_SKIRT, "skirt")); + addEntry(TEX_LEFT_ARM_BAKED, new TextureEntry("leftarm-baked", FALSE, BAKED_LEFT_ARM, "leftarm")); + addEntry(TEX_LEFT_LEG_BAKED, new TextureEntry("leftleg-baked", FALSE, BAKED_LEFT_LEG, "leftleg")); + addEntry(TEX_AUX1_BAKED, new TextureEntry("aux1-baked", FALSE, BAKED_AUX1, "aux1")); + addEntry(TEX_AUX2_BAKED, new TextureEntry("aux2-baked", FALSE, BAKED_AUX2, "aux2")); + addEntry(TEX_AUX3_BAKED, new TextureEntry("aux3-baked", FALSE, BAKED_AUX3, "aux3")); } LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() @@ -78,35 +97,60 @@ LLAvatarAppearanceDictionary::BakedTextures::BakedTextures() // Baked textures addEntry(BAKED_HEAD, new BakedEntry(TEX_HEAD_BAKED, "head", "a4b9dc38-e13b-4df9-b284-751efb0566ff", - 3, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, - 5, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 4, TEX_HEAD_BODYPAINT, TEX_HEAD_TATTOO, TEX_HEAD_ALPHA, TEX_HEAD_UNIVERSAL_TATTOO, + 6, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_HAIR, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_UPPER, new BakedEntry(TEX_UPPER_BAKED, "upper_body", "5943ff64-d26c-4a90-a8c0-d61f56bd98d4", - 7, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, - TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, - 8, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 8, TEX_UPPER_SHIRT,TEX_UPPER_BODYPAINT, TEX_UPPER_JACKET, + TEX_UPPER_GLOVES, TEX_UPPER_UNDERSHIRT, TEX_UPPER_TATTOO, TEX_UPPER_ALPHA, TEX_UPPER_UNIVERSAL_TATTOO, + 9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_SHIRT, LLWearableType::WT_JACKET, LLWearableType::WT_GLOVES, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_LOWER, new BakedEntry(TEX_LOWER_BAKED, "lower_body", "2944ee70-90a7-425d-a5fb-d749c782ed7d", - 8, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS, - TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, - 9, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA)); + 9, TEX_LOWER_PANTS,TEX_LOWER_BODYPAINT,TEX_LOWER_SHOES, TEX_LOWER_SOCKS, + TEX_LOWER_JACKET, TEX_LOWER_UNDERPANTS, TEX_LOWER_TATTOO, TEX_LOWER_ALPHA, TEX_LOWER_UNIVERSAL_TATTOO, + 10, LLWearableType::WT_SHAPE, LLWearableType::WT_SKIN, LLWearableType::WT_PANTS, LLWearableType::WT_SHOES, LLWearableType::WT_SOCKS, LLWearableType::WT_JACKET, LLWearableType::WT_UNDERPANTS, LLWearableType::WT_TATTOO, LLWearableType::WT_ALPHA, LLWearableType::WT_UNIVERSAL)); addEntry(BAKED_EYES, new BakedEntry(TEX_EYES_BAKED, "eyes", "27b1bc0f-979f-4b13-95fe-b981c2ba9788", - 2, TEX_EYES_IRIS, TEX_EYES_ALPHA, - 2, LLWearableType::WT_EYES, LLWearableType::WT_ALPHA)); + 3, TEX_EYES_IRIS, TEX_EYES_TATTOO, TEX_EYES_ALPHA, + 3, LLWearableType::WT_EYES, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA)); addEntry(BAKED_SKIRT, new BakedEntry(TEX_SKIRT_BAKED, "skirt", "03e7e8cb-1368-483b-b6f3-74850838ba63", - 1, TEX_SKIRT, - 1, LLWearableType::WT_SKIRT)); + 2, TEX_SKIRT, TEX_SKIRT_TATTOO, + 2, LLWearableType::WT_SKIRT, LLWearableType::WT_UNIVERSAL )); addEntry(BAKED_HAIR, new BakedEntry(TEX_HAIR_BAKED, "hair", "a60e85a9-74e8-48d8-8a2d-8129f28d9b61", - 2, TEX_HAIR, TEX_HAIR_ALPHA, - 2, LLWearableType::WT_HAIR, LLWearableType::WT_ALPHA)); + 3, TEX_HAIR, TEX_HAIR_TATTOO, TEX_HAIR_ALPHA, + 3, LLWearableType::WT_HAIR, LLWearableType::WT_UNIVERSAL, LLWearableType::WT_ALPHA)); + + addEntry(BAKED_LEFT_ARM, new BakedEntry(TEX_LEFT_ARM_BAKED, + "leftarm", "9f39febf-22d7-0087-79d1-e9e8c6c9ed19", + 1, TEX_LEFT_ARM_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_LEFT_LEG, new BakedEntry(TEX_LEFT_LEG_BAKED, + "leftleg", "054a7a58-8ed5-6386-0add-3b636fb28b78", + 1, TEX_LEFT_LEG_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX1, new BakedEntry(TEX_AUX1_BAKED, + "aux1", "790c11be-b25c-c17e-b4d2-6a4ad786b752", + 1, TEX_AUX1_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX2, new BakedEntry(TEX_AUX2_BAKED, + "aux2", "d78c478f-48c7-5928-5864-8d99fb1f521e", + 1, TEX_AUX2_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); + + addEntry(BAKED_AUX3, new BakedEntry(TEX_AUX3_BAKED, + "aux3", "6a95dd53-edd9-aac8-f6d3-27ed99f3c3eb", + 1, TEX_AUX3_TATTOO, + 1, LLWearableType::WT_UNIVERSAL)); } LLAvatarAppearanceDictionary::MeshEntries::MeshEntries() @@ -267,3 +311,113 @@ LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIn { return getInstance()->getTexture(index)->mWearableType; } + +// static +BOOL LLAvatarAppearanceDictionary::isBakedImageId(const LLUUID& id) +{ + if ((id == IMG_USE_BAKED_EYES) || (id == IMG_USE_BAKED_HAIR) || (id == IMG_USE_BAKED_HEAD) || (id == IMG_USE_BAKED_LOWER) || (id == IMG_USE_BAKED_SKIRT) || (id == IMG_USE_BAKED_UPPER) + || (id == IMG_USE_BAKED_LEFTARM) || (id == IMG_USE_BAKED_LEFTLEG) || (id == IMG_USE_BAKED_AUX1) || (id == IMG_USE_BAKED_AUX2) || (id == IMG_USE_BAKED_AUX3) ) + { + return TRUE; + } + + return FALSE; +} + +// static +EBakedTextureIndex LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(const LLUUID& id) +{ + if (id == IMG_USE_BAKED_EYES) + { + return BAKED_EYES; + } + else if (id == IMG_USE_BAKED_HAIR) + { + return BAKED_HAIR; + } + else if (id == IMG_USE_BAKED_HEAD) + { + return BAKED_HEAD; + } + else if (id == IMG_USE_BAKED_LOWER) + { + return BAKED_LOWER; + } + else if (id == IMG_USE_BAKED_SKIRT) + { + return BAKED_SKIRT; + } + else if (id == IMG_USE_BAKED_UPPER) + { + return BAKED_UPPER; + } + else if (id == IMG_USE_BAKED_LEFTARM) + { + return BAKED_LEFT_ARM; + } + else if (id == IMG_USE_BAKED_LEFTLEG) + { + return BAKED_LEFT_LEG; + } + else if (id == IMG_USE_BAKED_AUX1) + { + return BAKED_AUX1; + } + else if (id == IMG_USE_BAKED_AUX2) + { + return BAKED_AUX2; + } + else if (id == IMG_USE_BAKED_AUX3) + { + return BAKED_AUX3; + } + + return BAKED_NUM_INDICES; +} + +//static +LLUUID LLAvatarAppearanceDictionary::localTextureIndexToMagicId(ETextureIndex t) +{ + LLUUID id = LLUUID::null; + + switch (t) + { + case LLAvatarAppearanceDefines::TEX_HEAD_BAKED: + id = IMG_USE_BAKED_HEAD; + break; + case LLAvatarAppearanceDefines::TEX_UPPER_BAKED: + id = IMG_USE_BAKED_UPPER; + break; + case LLAvatarAppearanceDefines::TEX_LOWER_BAKED: + id = IMG_USE_BAKED_LOWER; + break; + case LLAvatarAppearanceDefines::TEX_EYES_BAKED: + id = IMG_USE_BAKED_EYES; + break; + case LLAvatarAppearanceDefines::TEX_SKIRT_BAKED: + id = IMG_USE_BAKED_SKIRT; + break; + case LLAvatarAppearanceDefines::TEX_HAIR_BAKED: + id = IMG_USE_BAKED_HAIR; + break; + case LLAvatarAppearanceDefines::TEX_LEFT_ARM_BAKED: + id = IMG_USE_BAKED_LEFTARM; + break; + case LLAvatarAppearanceDefines::TEX_LEFT_LEG_BAKED: + id = IMG_USE_BAKED_LEFTLEG; + break; + case LLAvatarAppearanceDefines::TEX_AUX1_BAKED: + id = IMG_USE_BAKED_AUX1; + break; + case LLAvatarAppearanceDefines::TEX_AUX2_BAKED: + id = IMG_USE_BAKED_AUX2; + break; + case LLAvatarAppearanceDefines::TEX_AUX3_BAKED: + id = IMG_USE_BAKED_AUX3; + break; + default: + break; + } + + return id; +} diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h index d6223bb4d2..5663d24293 100644 --- a/indra/llappearance/llavatarappearancedefines.h +++ b/indra/llappearance/llavatarappearancedefines.h @@ -78,6 +78,22 @@ enum ETextureIndex TEX_HEAD_TATTOO, TEX_UPPER_TATTOO, TEX_LOWER_TATTOO, + TEX_HEAD_UNIVERSAL_TATTOO, + TEX_UPPER_UNIVERSAL_TATTOO, + TEX_LOWER_UNIVERSAL_TATTOO, + TEX_SKIRT_TATTOO, + TEX_HAIR_TATTOO, + TEX_EYES_TATTOO, + TEX_LEFT_ARM_TATTOO, + TEX_LEFT_LEG_TATTOO, + TEX_AUX1_TATTOO, + TEX_AUX2_TATTOO, + TEX_AUX3_TATTOO, + TEX_LEFT_ARM_BAKED, // Pre-composited + TEX_LEFT_LEG_BAKED, // Pre-composited + TEX_AUX1_BAKED, // Pre-composited + TEX_AUX2_BAKED, // Pre-composited + TEX_AUX3_BAKED, // Pre-composited TEX_NUM_INDICES }; @@ -89,6 +105,11 @@ enum EBakedTextureIndex BAKED_EYES, BAKED_SKIRT, BAKED_HAIR, + BAKED_LEFT_ARM, + BAKED_LEFT_LEG, + BAKED_AUX1, + BAKED_AUX2, + BAKED_AUX3, BAKED_NUM_INDICES }; @@ -223,6 +244,10 @@ public: // Given a texture entry, determine which wearable type owns it. static LLWearableType::EType getTEWearableType(ETextureIndex index); + static BOOL isBakedImageId(const LLUUID& id); + static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id); + static LLUUID localTextureIndexToMagicId(ETextureIndex t); + }; // End LLAvatarAppearanceDictionary } // End namespace LLAvatarAppearanceDefines diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index fc998313f9..2bfaf0ddbe 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -44,6 +44,7 @@ #include "llvertexbuffer.h" #include "llviewervisualparam.h" #include "llfasttimer.h" +#include "llrendertarget.h" // For copyContents //#include "../tools/imdebug/imdebug.h" @@ -1577,28 +1578,19 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } alpha_data = new U8[width * height]; mAlphaCache[cache_index] = alpha_data; - - // Tentative fix for BUG-225655/FIRE-24049. - // Using glReadPixels breaks the driver on 64 bit. - // Not sure yet why, as eg it works perfectly fine to capture the logout snapshot or for DebugShowColor. - // Disable this for now for review. as arguably having the risk for a wrong local (temporary) - // bake is better than not being able to login at all. - // No perfect solution though, but seems we're getting too close to release for a 100% perfect solution :( - bool skipReadPixels = LLRender::sNsightDebugSupport; -#if ADDRESS_SIZE == 64 - skipReadPixels = gGLManager.mIsIntel; -#endif - // nSight doesn't support use of glReadPixels - // if (!LLRender::sNsightDebugSupport) - if (!skipReadPixels) - // + if (!LLRender::sNsightDebugSupport) { // 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); + if (!LLRenderTarget::getCurrentBoundTarget()) + glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, alpha_buffer); + else + LLRenderTarget::getCurrentBoundTarget()->copyContents(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]; @@ -1606,7 +1598,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC delete[] alpha_buffer; // } - else{ memset( alpha_data, 0, width*height ); } // Maybe at least clear the buffer if not filling it? } getTexLayerSet()->getAvatarAppearance()->dirtyMesh(); diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 737ea37b70..f2afee6bdd 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -97,6 +97,7 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_SKIRT, new WearableEntry("skirt", "New Skirt", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_SKIRT, FALSE, TRUE)); addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE)); addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE)); + addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry("universal", "New Universal", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, FALSE, TRUE)); // [SL:KB] - Patch: Appearance-Misc | Checked: 2011-05-29 (Catznip-2.6) addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, FALSE)); diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 519d5b92a2..ac81376538 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -63,7 +63,8 @@ public: WT_ALPHA = 13, WT_TATTOO = 14, WT_PHYSICS = 15, - WT_COUNT = 16, + WT_UNIVERSAL = 16, + WT_COUNT = 17, WT_INVALID = 255, WT_NONE = -1, diff --git a/indra/llaudio/llaudioengine_fmodex.cpp b/indra/llaudio/llaudioengine_fmodex.cpp index 9000e1b99a..d5f5b11bf7 100644 --- a/indra/llaudio/llaudioengine_fmodex.cpp +++ b/indra/llaudio/llaudioengine_fmodex.cpp @@ -132,7 +132,7 @@ LLAudioEngine_FMODEX::LLAudioEngine_FMODEX(bool enable_profiler) mSystem = NULL; mEnableProfiler = enable_profiler; mWindDSPDesc = new FMOD_DSP_DESCRIPTION(); - mSelectedDeviceUUID == LLUUID::null; // Output device selection + mSelectedDeviceUUID = LLUUID::null; // Output device selection } diff --git a/indra/llcommon/indra_constants.cpp b/indra/llcommon/indra_constants.cpp index 7ea42a3fc0..e13176e8fa 100644 --- a/indra/llcommon/indra_constants.cpp +++ b/indra/llcommon/indra_constants.cpp @@ -72,3 +72,15 @@ const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // V const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER +const LLUUID IMG_USE_BAKED_HEAD ("5a9f4a74-30f2-821c-b88d-70499d3e7183"); +const LLUUID IMG_USE_BAKED_UPPER ("ae2de45c-d252-50b8-5c6e-19f39ce79317"); +const LLUUID IMG_USE_BAKED_LOWER ("24daea5f-0539-cfcf-047f-fbc40b2786ba"); +const LLUUID IMG_USE_BAKED_EYES ("52cc6bb6-2ee5-e632-d3ad-50197b1dcb8a"); +const LLUUID IMG_USE_BAKED_SKIRT ("43529ce8-7faa-ad92-165a-bc4078371687"); +const LLUUID IMG_USE_BAKED_HAIR ("09aac1fb-6bce-0bee-7d44-caac6dbb6c63"); +const LLUUID IMG_USE_BAKED_LEFTARM ("ff62763f-d60a-9855-890b-0c96f8f8cd98"); +const LLUUID IMG_USE_BAKED_LEFTLEG ("8e915e25-31d1-cc95-ae08-d58a47488251"); +const LLUUID IMG_USE_BAKED_AUX1 ("9742065b-19b5-297c-858a-29711d539043"); +const LLUUID IMG_USE_BAKED_AUX2 ("03642e83-2bd1-4eb9-34b4-4c47ed586d2d"); +const LLUUID IMG_USE_BAKED_AUX3 ("edd51b77-fc10-ce7a-4b3d-011dfc349e4f"); + diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fff2acc8d5..f52e6b6584 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -210,6 +210,18 @@ LL_COMMON_API extern const LLUUID TERRAIN_GRASS_DETAIL; LL_COMMON_API extern const LLUUID TERRAIN_MOUNTAIN_DETAIL; LL_COMMON_API extern const LLUUID TERRAIN_ROCK_DETAIL; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HEAD; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_UPPER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LOWER; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_EYES; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_SKIRT; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_HAIR; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTARM; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_LEFTLEG; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX1; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX2; +LL_COMMON_API extern const LLUUID IMG_USE_BAKED_AUX3; + LL_COMMON_API extern const LLUUID DEFAULT_WATER_NORMAL; diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index 891ab217fd..034cee5f45 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -101,6 +101,7 @@ public: ICONNAME_CLOTHING_SKIRT, ICONNAME_CLOTHING_ALPHA, ICONNAME_CLOTHING_TATTOO, + ICONNAME_CLOTHING_UNIVERSAL, ICONNAME_ANIMATION, ICONNAME_GESTURE, diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 99b18f8808..abad9eb7e1 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5287,6 +5287,28 @@ bool LLVolumeFace::cacheOptimize() llassert(!mOptimized); mOptimized = TRUE; + // FIRE-23370/BUG-8801/MAIN-5060 + // cacheOptimize will destroy triangles. This is due to LLVCacheVertexData pointing to vertices in the vector vertex_data. + // Once vertex_data is sorted (std::sort(triangle_data.begin(), triangle_data.end()) ) this will invalidate those pointers and + // LLVCacheVertexData suddenly does point to unrelated vertices. It is an interesting fact that this is no problem for the + // windows version. + // + // To solve the issue with the pointer invalidation it would make sense to use a std::vector< U16 > for triangle indices, sort this + // using + // std::sort( v.begin(), v.end(), [&triangle_data](U16 rhs, U16 lhs ){ return triangle_data[rhs].mScore > triangle_data[lhs].mScore; } + // Then access all LLVCacheTriangleData> via triangle_data[ v[ idx ] ]. + // + // This will help indeed with the destroyed triangles; but the result will still not be perfect and there are problems with alpha due to + // what looks like z order. + // + // It is peculiar that none of this happens when compiling with MSVC. + // Sadly for Linux it seems to be a decision between two evils + // - Disable cacheOptimize and have correct meshes but potentially a bit of less FPS. + // - Enable/fix cacheOptimize, potentially have a bit higher FPS but broken meshes. + // + // Having meshes correctly seems to be a bit of a lesser evil. Then do some wider testing on different systems to test for any other potential sideeffects. + +#ifndef LL_LINUX LLVCacheLRU cache; if (mNumVertices < 3) @@ -5512,6 +5534,8 @@ bool LLVolumeFace::cacheOptimize() //std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks); //LL_INFOS() << result << LL_ENDL; +#endif // + return true; } diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index fde66e2277..b848e1aea5 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1053,14 +1053,26 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } //assign exception faces to cur_ptr - if (exception_faces >= (0x1 << 7)) + if (exception_faces >= ((U64)0x1 << 7)) { - if (exception_faces >= (0x1 << 14)) + if (exception_faces >= ((U64)0x1 << 14)) { - if (exception_faces >= (0x1 << 21)) + if (exception_faces >= ((U64)0x1 << 21)) { - if (exception_faces >= (0x1 << 28)) + if (exception_faces >= ((U64)0x1 << 28)) { + if (exception_faces >= ((U64)0x1 << 35)) + { + if (exception_faces >= ((U64)0x1 << 42)) + { + if (exception_faces >= ((U64)0x1 << 49)) + { + *cur_ptr++ = (U8)(((exception_faces >> 49) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 42) & 0x7F) | 0x80); + } + *cur_ptr++ = (U8)(((exception_faces >> 35) & 0x7F) | 0x80); + } *cur_ptr++ = (U8)(((exception_faces >> 28) & 0x7F) | 0x80); } *cur_ptr++ = (U8)(((exception_faces >> 21) & 0x7F) | 0x80); @@ -1069,6 +1081,7 @@ S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_fa } *cur_ptr++ = (U8)(((exception_faces >> 7) & 0x7F) | 0x80); } + *cur_ptr++ = (U8)(exception_faces & 0x7F); @@ -1128,7 +1141,7 @@ S32 LLPrimitive::unpackTEField(U8 *cur_ptr, U8 *buffer_end, U8 *data_ptr, U8 dat // Includes information about image ID, color, scale S,T, offset S,T and rotation BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1214,7 +1227,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const { - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; U8 image_ids[MAX_TES*16]; U8 colors[MAX_TES*4]; @@ -1327,6 +1340,8 @@ S32 LLPrimitive::parseTEMessage(LLMessageSystem* mesgsys, char const* block_name mesgsys->getBinaryDataFast(block_name, _PREHASH_TextureEntry, tec.packed_buffer, 0, block_num, LLTEContents::MAX_TE_BUFFER); } + + tec.face_count = llmin((U32)getNumTEs(),(U32)LLTEContents::MAX_TES); U8 *cur_ptr = tec.packed_buffer; @@ -1399,6 +1414,8 @@ S32 LLPrimitive::applyParsedTEMessage(LLTEContents& tec) retval |= setTEColor(i, color); + + } return retval; @@ -1417,7 +1434,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) { // use a negative block_num to indicate a single-block read (a non-variable block) S32 retval = 0; - const U32 MAX_TES = 32; + const U32 MAX_TES = 45; // Avoid construction of 32 UUIDs per call static LLUUID image_ids[MAX_TES]; diff --git a/indra/llprimitive/llprimitive.h b/indra/llprimitive/llprimitive.h index 216fdba623..bd64dfbb8a 100644 --- a/indra/llprimitive/llprimitive.h +++ b/indra/llprimitive/llprimitive.h @@ -327,7 +327,7 @@ public: // - Vir struct LLTEContents { - static const U32 MAX_TES = 32; + static const U32 MAX_TES = 45; U8 image_data[MAX_TES*16]; U8 colors[MAX_TES*4]; diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index cd484b4fe9..c65b830b71 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -639,5 +639,133 @@ void LLRenderTarget::getViewport(S32* viewport) viewport[3] = mResY; } +// Determine version of intel driver. We know anything >= 24 is problematic with glReadPixels +#if LL_WINDOWS && ADDRESS_SIZE == 64 +U32 getIntelDriverVersionMajor() +{ + if (!gGLManager.mIsIntel) + return 0; + std::string strVersion = gGLManager.mDriverVersionVendorString; + auto i = strVersion.find("Build "); + if (i != std::string::npos) + { + i += sizeof("Build"); + while (isspace(strVersion[i]) && strVersion[i]) + ++i; + auto start = i; + while (strVersion[i] != '.' && strVersion[i]) + i++; + if( strVersion[i] ) + { + std::string strMajor(strVersion.begin() + start, strVersion.begin() + i); + U32 version = 0; + if (LLStringUtil::convertToU32(strMajor, version)) + return version; + } + } + + return 0; +} +#endif +//ND> +// Copy the contents of this FBO into memory +void LLRenderTarget::copyContents(S32 x, S32 y, S32 w, S32 h, U32 format, U32 type, U8 *buffer) +{ +#if LL_WINDOWS && ADDRESS_SIZE == 64 + // If not Intel or driver < 24.*, be done with it + if (!gGLManager.mIsIntel || getIntelDriverVersionMajor() < 24) + { + glReadPixels(x, y, w, h, (GLenum)format, (GLenum)type, buffer); + return; + } + + std::vector< GLenum > vErrors; + + // BUG-225655/FIRE-24049 some drivers (Intel 64 bit >= 24.* are behaving buggy when glReadPixels is called + if (mFBO) + { + // When a FBO is bound unbind/rebind it. + vErrors.push_back(glGetError()); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + vErrors.push_back(glGetError()); + glBindFramebuffer(GL_FRAMEBUFFER, mFBO); + vErrors.push_back(glGetError()); + + glReadPixels(x, y, w, h, (GLenum)format, (GLenum)type, buffer); + vErrors.push_back(glGetError()); + } + else + { + llassert_always(type == GL_UNSIGNED_BYTE); + llassert_always(format == GL_RGBA || format == GL_ALPHA); + + if (mUsage != LLTexUnit::TT_TEXTURE && mUsage != LLTexUnit::TT_RECT_TEXTURE ) + { + LL_WARNS() << "Expected type TT_TEXTURE or TT_RECT_TEXTURE got 0x" << std::setw(8) << std::setfill('0') << std::hex << LLTexUnit::getInternalType(mUsage) << + " internal type 0x" << std::setw(8) << std::setfill('0') << std::hex << mUsage << LL_ENDL; + } + + // When using no FBO and avoid glReadPixels altogether, instead bind the texture and call glGetTexImage + vErrors.push_back(glGetError()); + flush(); + vErrors.push_back(glGetError()); + gGL.getTexUnit(0)->bind(this); + vErrors.push_back(glGetError()); + + std::string sBuffer(mResX*mResY * 4, 0); + + // Would be nice if GL_ALPHA would be allowed for glGetTexImage + glGetTexImage(LLTexUnit::getInternalType(mUsage), 0, GL_RGBA, GL_UNSIGNED_BYTE, &sBuffer[0]); + vErrors.push_back(glGetError()); + + // Now copy out the data. + // n.b. in case of: + // format == GL_RGBA && x == 0 ** y == 0 and w == mResX && h == mResY + // would could safe all this and glGetTexImage right into buffer + U8 const *pBuffer = reinterpret_cast(sBuffer.c_str()); + pBuffer += (y * mResX * 4); // Adjust to skip to requested y coord + pBuffer += x * 4; // Skip to requested x coord + + if (format == GL_RGBA) + { + for (S32 i = y; i < h; ++i) + { + std::memcpy(buffer, pBuffer, w * 4); + pBuffer += mResX * 4; // Skip one full row, row is already x adjusted + buffer += w * 4; + } + } + else if (format == GL_ALPHA) + { + for (S32 i = y; i < h; ++i) + { + for (S32 j = 0; j < w; ++j) + { + *buffer = pBuffer[3]; + ++buffer; + pBuffer += 4; + } + pBuffer += (mResX - w) * 4; // Skip to end of row + pBuffer += x * 4; // Skip to requested x coordinate again + } + } + gGL.getTexUnit(0)->disable(); + vErrors.push_back(glGetError()); + } + + std::stringstream strm; + for (GLenum err : vErrors ) + strm << "0x" << std::hex << (U32)err << " "; + + if (vErrors.end() != std::find_if(vErrors.begin(), vErrors.end(), [](GLenum err){return err != GL_NO_ERROR; })) + { + LL_WARNS() << "GL error occured: " << strm.str() << LL_ENDL; + } +#else + // Every other OS just gets glReadPixels + glReadPixels(x, y, w, h, (GLenum)format, (GLenum)type, buffer); +#endif +} +// diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 6dc84d978d..184916e565 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -160,6 +160,10 @@ protected: LLTexUnit::eTextureType mUsage; static LLRenderTarget* sBoundTarget; + // Copy the contents of this FBO into memory +public: + void copyContents(S32 x, S32 y, S32 w, S32 h, U32 format, U32 type, U8 *buffer); + // }; #endif diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index d052056adb..d846628171 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -263,10 +263,14 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { - S32 screen_x, screen_y; - screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); - screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); - +#if defined(LL_DARWIN) + S32 screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / LLView::getWindow()->getSystemUISize()); + S32 screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / LLView::getWindow()->getSystemUISize()); +#else + S32 screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); + S32 screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); +#endif + LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index b6ddeda7a8..82f2a74830 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -524,9 +524,9 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const // LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL() { - mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com)" + mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com)" "|" - "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?))" + "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(:\\d{1,5})?))" "\\/\\S*", boost::regex::perl|boost::regex::icase); @@ -568,7 +568,7 @@ std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const // LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL() { - mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(?!\\S)", + mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(?!\\S)", boost::regex::perl|boost::regex::icase); mIcon = "Hand"; @@ -1358,6 +1358,25 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const return ::getStringAfterToken(url, "app/teleport/"); } +// Wear folder SLUrl +/// +/// FSUrlEntryWear Describes wear folder SLURL, e.g. +/// secondlife:///app/wear_folder/?folder_id=bedd047e-a3d7-23e6-57bc-1ef367d848e7 +/// +FSUrlEntryWear::FSUrlEntryWear() +{ + mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/wear_folder/\\S+", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_slapp.xml"; + mTooltip = LLTrans::getString("TooltipFSUrlEntryWear"); +} + +std::string FSUrlEntryWear::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + return LLTrans::getString("FSUrlEntryWearLabel"); +} +// + // // LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts // with secondlife:// (used as a catch-all for cases not matched above) diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index ebf6517e52..4e9b7cb066 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -499,6 +499,20 @@ public: /*virtual*/ std::string getLocation(const std::string &url) const; }; +// Wear folder SLUrl +/// +/// FSUrlEntryWear Describes wear folder SLURL, e.g. +/// secondlife:///app/wear_folder/?folder_id=bedd047e-a3d7-23e6-57bc-1ef367d848e7 +/// +class FSUrlEntryWear : public LLUrlEntryBase +{ +public: + FSUrlEntryWear(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +}; +// + + // FS Help SLUrl /// /// FSHelpDebugUrlEntrySL Describes a Firestorm Help SLURL, e.g. diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 543d9b1d14..568ac92a4c 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -41,7 +41,7 @@ LLUrlRegistry::LLUrlRegistry() { // mUrlEntry.reserve(20); // [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Added: RLVa-1.2.2a - mUrlEntry.reserve(27); + mUrlEntry.reserve(28); // [/RLVa:KB] // Urls are matched in the order that they were registered @@ -84,6 +84,9 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryInventory()); registerUrl(new LLUrlEntryExperienceProfile()); registerUrl(new FSHelpDebugUrlEntrySL()); // FS Help SLUrl + // Wear folder SLUrl + mUrlEntryWear = new FSUrlEntryWear(); + registerUrl(mUrlEntryWear); //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern, //so it should be registered in the end of list registerUrl(new LLUrlEntrySL()); @@ -268,6 +271,13 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL match_start = start; match_end = end; match_entry = url_entry; + + // Wear folder SLUrl + if (mUrlEntryWear == *it) + { + break; + } + // } } } diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 9ea7cfc981..fad69cdd9f 100644 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -98,6 +98,8 @@ private: LLUrlEntryBase* mUrlEntryNoLink; // Normalize only trusted URL LLUrlEntryBase* mUrlEntryTrustedUrl; + // Wear folder SLUrl + LLUrlEntryBase* mUrlEntryWear; }; #endif diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 6834373e73..8be4c20c3d 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -501,7 +501,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) dullahan::dullahan_settings settings; settings.accept_language_list = mHostLanguage; - settings.background_color = 0xff282828; + settings.background_color = 0xffffffff; settings.cache_enabled = true; settings.cache_path = mCachePath; settings.cookie_store_path = mCookiePath; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a1513b1a48..9725068cfc 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -218,9 +218,7 @@ set(viewer_SOURCE_FILES lggbeamscolors.cpp lggcontactsets.cpp lfsimfeaturehandler.cpp - llfloaterdisplayname.cpp llpanelopenregionsettings.cpp - llviewerdisplayname.cpp # [Legacy Bake] llagentwearablesfetch.cpp @@ -350,6 +348,7 @@ set(viewer_SOURCE_FILES llfloaterdeleteenvpreset.cpp llfloaterdeleteprefpreset.cpp llfloaterdestinations.cpp + llfloaterdisplayname.cpp llfloatereditdaycycle.cpp llfloatereditsky.cpp llfloatereditwater.cpp @@ -756,6 +755,7 @@ set(viewer_SOURCE_FILES llviewercontrol.cpp llviewercontrollistener.cpp llviewerdisplay.cpp + llviewerdisplayname.cpp llviewerfloaterreg.cpp llviewerfoldertype.cpp llviewergenericmessage.cpp @@ -978,8 +978,6 @@ set(viewer_HEADER_FILES lggbeamscolors.h lggcontactsets.h lfsimfeaturehandler.h - llfloaterdisplayname.h - llviewerdisplayname.h # [Legacy Bake] llagentwearablesfetch.h @@ -1110,6 +1108,7 @@ set(viewer_HEADER_FILES llfloaterdeleteprefpreset.h llfloaterdeleteenvpreset.h llfloaterdestinations.h + llfloaterdisplayname.h llfloatereditdaycycle.h llfloatereditsky.h llfloatereditwater.h @@ -1511,6 +1510,7 @@ set(viewer_HEADER_FILES llviewercontrol.h llviewercontrollistener.h llviewerdisplay.h + llviewerdisplayname.h llviewerfloaterreg.h llviewerfoldertype.h llviewergenericmessage.h diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index a6534bb333..dc0208aba8 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.2.5 +6.3.1 diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 727334c2f7..8646b4f165 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -191,15 +191,37 @@ void AOEngine::setLastOverriddenMotion(const LLUUID& motion) BOOL AOEngine::foreignAnimations(const LLUUID& seat) { + LL_DEBUGS("AOEngine") << "Checking for foreign animation on seat " << seat << LL_ENDL; + for (LLVOAvatar::AnimSourceIterator sourceIterator = gAgentAvatarp->mAnimationSources.begin(); sourceIterator != gAgentAvatarp->mAnimationSources.end(); ++sourceIterator) { + LL_DEBUGS("AOEngine") << "Source " << sourceIterator->first << " runs animation " << sourceIterator->second << LL_ENDL; + if (sourceIterator->first != gAgentID) { - if (seat.isNull() || sourceIterator->first == seat) + // special case when the AO gets disabled while sitting + if (seat.isNull()) { return TRUE; } + + // find the source object where the animation came from + LLViewerObject* source=gObjectList.findObject(sourceIterator->first); + + // proceed if it's not an attachment + if(!source->isAttachment()) + { + // get the source's root prim + LLViewerObject* sourceRoot=dynamic_cast(source->getRoot()); + + // if the root prim is the same as the animation source, report back as TRUE + if (sourceRoot && source->getID() == seat) + { + LL_DEBUGS("AOEngine") << "foreign animation " << sourceIterator->second << " found on seat." << LL_ENDL; + return TRUE; + } + } } } return FALSE; @@ -600,10 +622,6 @@ const LLUUID AOEngine::override(const LLUUID& pMotion, BOOL start) { stopAllSitVariants(); } - - LL_DEBUGS("AOEngine") << "stopping cycle timer for motion " << gAnimLibrary.animationName(motion) << - " using animation " << animation << - " in state " << state->mName << LL_ENDL; } return animation; @@ -1628,6 +1646,17 @@ void AOEngine::setSmart(AOSet* set, BOOL yes) { set->setSmart(yes); set->setDirty(TRUE); + + if (yes) + { + // make sure to restart the sit cancel timer to fix sit overrides when the object we are + // sitting on is playing its own animation + const LLViewerObject* agentRoot = dynamic_cast(gAgentAvatarp->getRoot()); + if (agentRoot && agentRoot->getID() != gAgentID) + { + mSitCancelTimer.oneShot(); + } + } } void AOEngine::setDisableStands(AOSet* set, BOOL yes) diff --git a/indra/newview/character/aux_base.tga b/indra/newview/character/aux_base.tga new file mode 100644 index 0000000000..dbcaaaf2b1 Binary files /dev/null and b/indra/newview/character/aux_base.tga differ diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index d5c5b05b27..0c3fa9d4a2 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -8949,6 +8949,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -10026,7 +10086,65 @@ render_pass="bump"> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -10203,7 +10321,65 @@ render_pass="bump"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -12417,6 +12711,417 @@ render_pass="bump"> domain="0" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15936,7 +16641,277 @@ render_pass="bump"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t_panel_profile_secondlife("panel_profile_secondlife"); -static LLPanelInjector t_panel_web("panel_profile_web"); -static LLPanelInjector t_panel_interests("panel_profile_interests"); -static LLPanelInjector t_panel_picks("panel_profile_picks"); -static LLPanelInjector t_panel_firstlife("panel_profile_firstlife"); -static LLPanelInjector t_panel_notes("panel_profile_notes"); -static LLPanelInjector t_panel_profile("panel_profile"); +static LLPanelInjector t_panel_fs_profile_secondlife("panel_fs_profile_secondlife"); +static LLPanelInjector t_panel_fs_web("panel_fs_profile_web"); +static LLPanelInjector t_panel_fs_interests("panel_fs_profile_interests"); +static LLPanelInjector t_panel_fs_picks("panel_fs_profile_picks"); +static LLPanelInjector t_panel_fs_firstlife("panel_fs_profile_firstlife"); +static LLPanelInjector t_panel_fs_notes("panel_fs_profile_notes"); +static LLPanelInjector t_panel_fs_profile("panel_fs_profile"); static const std::string PANEL_SECONDLIFE = "panel_profile_secondlife"; static const std::string PANEL_WEB = "panel_profile_web"; @@ -1179,7 +1179,7 @@ FSPanelPick::FSPanelPick() FSPanelPick* FSPanelPick::create() { FSPanelPick* panel = new FSPanelPick(); - panel->buildFromFile("panel_profile_pick.xml"); + panel->buildFromFile("panel_fs_profile_pick.xml"); return panel; } diff --git a/indra/newview/fspanelprofileclassifieds.cpp b/indra/newview/fspanelprofileclassifieds.cpp index 699dd04206..b709ed9d04 100644 --- a/indra/newview/fspanelprofileclassifieds.cpp +++ b/indra/newview/fspanelprofileclassifieds.cpp @@ -59,7 +59,7 @@ static const std::string CLASSIFIED_NAME("classified_name"); static FSDispatchClassifiedClickThrough sClassifiedClickThrough; -static LLPanelInjector t_panel_classifieds("panel_profile_classified"); +static LLPanelInjector t_panel_fs_classifieds("panel_fs_profile_classified"); ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6ffa8d0298..9fe6af4485 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -24,6 +24,7 @@ * $/LicenseInfo$ */ + #include "llviewerprecompiledheaders.h" #include "llagent.h" diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 96994b963e..46661da326 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1700,6 +1700,12 @@ void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, con { if (type == LLWearableType::WT_INVALID || type == LLWearableType::WT_NONE) return; + if (type == LLWearableType::WT_UNIVERSAL && !gAgent.getRegion()->bakesOnMeshEnabled()) + { + LL_WARNS("Inventory") << "Can't create WT_UNIVERSAL type " << LL_ENDL; + return; + } + LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); LLAssetType::EType asset_type = wearable->getAssetType(); LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9e72a6c9ce..9deaf52290 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1366,25 +1366,6 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) items = new_items; } -// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2015-06-30 (Catznip-3.7) -static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items) -{ - std::set idsAsset; - items.erase(std::remove_if(items.begin(), items.end(), - [&idsAsset](const LLViewerInventoryItem* pItem) - { - if (pItem->isWearableType()) - { - const LLUUID& idAsset = pItem->getAssetUUID(); - if ( (idAsset.notNull()) && (idsAsset.end() != idsAsset.find(idAsset)) ) - return true; - idsAsset.insert(idAsset); - } - return false; - }), items.end()); -} -// [/SL:KB] - //========================================================================= const std::string LLAppearanceMgr::sExpectedTextureName = "OutfitPreview"; @@ -2271,9 +2252,6 @@ void LLAppearanceMgr::updateCOF(LLInventoryModel::item_array_t& body_items_new, // [/RLVa:KB] // Reduce wearables to max of one per type. removeDuplicateItems(wear_items); -// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e - removeDuplicateWearableItemsByAssetID(wear_items); -// [/SL:KB] filterWearableItems(wear_items, 0, LLAgentWearables::MAX_CLOTHING_LAYERS); // - Attachments: include COF contents only if appending. @@ -2687,10 +2665,6 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, removeDuplicateItems(gest_items); filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_LAYERS, LLAgentWearables::MAX_CLOTHING_LAYERS); // [/SL:KB] -// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e - // Wearing two wearables that share the same asset causes some issues - removeDuplicateWearableItemsByAssetID(wear_items); -// [/SL:KB] dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); @@ -3219,13 +3193,6 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, // MULTI-WEARABLES: make sure we don't go over clothing limits remove_inventory_item(inv_item->getUUID(), cb); } -// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e - else if ( (vitem->getWearableType() == wearable_type) && (vitem->getAssetUUID() == inv_item->getAssetUUID()) ) - { - // Only allow one wearable per unique asset - linked_already = true; - } -// [/SL:KB] } } diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 4e89548416..d1c4daf42b 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -470,7 +470,7 @@ LLFloater* LLAvatarActions::getProfileFloater(const LLUUID& id) // if (!gSavedSettings.getBOOL("FSUseWebProfiles")) { - FSFloaterProfile* browser = LLFloaterReg::findTypedInstance("floater_profile", LLSD().with("id", id)); + FSFloaterProfile* browser = LLFloaterReg::findTypedInstance("fs_floater_profile", LLSD().with("id", id)); return browser; } // @@ -494,7 +494,7 @@ void LLAvatarActions::showProfileLegacy(const LLUUID& id) { if (id.notNull()) { - LLFloaterReg::showInstance("floater_profile", LLSD().with("id", id)); + LLFloaterReg::showInstance("fs_floater_profile", LLSD().with("id", id)); } } // @@ -743,7 +743,10 @@ void LLAvatarActions::share(const LLUUID& id) LLSD key; LLFloaterSidePanelContainer::showPanel("inventory", key); - LLFloaterReg::showInstance("im_container"); + // [FS Communication UI] + //LLFloaterReg::showInstance("im_container"); + LLFloaterReg::showInstance("fs_im_container"); + // [FS Communication UI] LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL,id); diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index 83a6e9f279..2e5b77a895 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,11 +125,16 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { + // changes to support higher resolution rendering in the preview + ////only images up to 512x512 are supported + //llassert(mFullHeight <= 512); + //llassert(mFullWidth <= 512); gPipeline.allocatePhysicsBuffer(); llassert(mFullWidth <= static_cast(gPipeline.mPhysicsDisplay.getWidth())); llassert(mFullHeight <= static_cast(gPipeline.mPhysicsDisplay.getHeight())); if (gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI) + // { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -216,9 +221,12 @@ BOOL LLViewerDynamicTexture::updateAllInstances() return TRUE; } + // changes to support higher resolution rendering in the preview + // bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI; if (use_fbo) { + // gPipeline.mWaterDis.bindTarget(); gPipeline.mPhysicsDisplay.bindTarget(); } // @@ -257,7 +265,10 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (use_fbo) { + // changes to support higher resolution rendering in the preview + // gPipeline.mWaterDis.flush(); gPipeline.mPhysicsDisplay.flush(); + // } return ret; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 354a6aa402..555674682d 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1125,7 +1125,7 @@ void LLFace::getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_po // Returns the necessary texture transform to align this face's TE to align_to's TE bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offset, - LLVector2* res_st_scale, F32* res_st_rot) const + LLVector2* res_st_scale, F32* res_st_rot, LLRender::eTexIndex map) const { if (!align_to) { @@ -1138,6 +1138,43 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs return false; } + F32 map_rot = 0.f, map_scaleS = 0.f, map_scaleT = 0.f, map_offsS = 0.f, map_offsT = 0.f; + + switch (map) + { + case LLRender::DIFFUSE_MAP: + map_rot = orig_tep->getRotation(); + map_scaleS = orig_tep->mScaleS; + map_scaleT = orig_tep->mScaleT; + map_offsS = orig_tep->mOffsetS; + map_offsT = orig_tep->mOffsetT; + break; + case LLRender::NORMAL_MAP: + if (orig_tep->getMaterialParams()->getNormalID().isNull()) + { + return false; + } + map_rot = orig_tep->getMaterialParams()->getNormalRotation(); + map_scaleS = orig_tep->getMaterialParams()->getNormalRepeatX(); + map_scaleT = orig_tep->getMaterialParams()->getNormalRepeatY(); + map_offsS = orig_tep->getMaterialParams()->getNormalOffsetX(); + map_offsT = orig_tep->getMaterialParams()->getNormalOffsetY(); + break; + case LLRender::SPECULAR_MAP: + if (orig_tep->getMaterialParams()->getSpecularID().isNull()) + { + return false; + } + map_rot = orig_tep->getMaterialParams()->getSpecularRotation(); + map_scaleS = orig_tep->getMaterialParams()->getSpecularRepeatX(); + map_scaleT = orig_tep->getMaterialParams()->getSpecularRepeatY(); + map_offsS = orig_tep->getMaterialParams()->getSpecularOffsetX(); + map_offsT = orig_tep->getMaterialParams()->getSpecularOffsetY(); + break; + default: /*make compiler happy*/ + break; + } + LLVector3 orig_pos, this_pos; LLQuaternion orig_face_rot, this_face_rot; F32 orig_proj_scale, this_proj_scale; @@ -1145,7 +1182,7 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs getPlanarProjectedParams(&this_face_rot, &this_pos, &this_proj_scale); // The rotation of "this face's" texture: - LLQuaternion orig_st_rot = LLQuaternion(orig_tep->getRotation(), LLVector3::z_axis) * orig_face_rot; + LLQuaternion orig_st_rot = LLQuaternion(map_rot, LLVector3::z_axis) * orig_face_rot; LLQuaternion this_st_rot = orig_st_rot * ~this_face_rot; F32 x_ang, y_ang, z_ang; this_st_rot.getEulerAngles(&x_ang, &y_ang, &z_ang); @@ -1153,10 +1190,10 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs // Offset and scale of "this face's" texture: LLVector3 centers_dist = (this_pos - orig_pos) * ~orig_st_rot; - LLVector3 st_scale(orig_tep->mScaleS, orig_tep->mScaleT, 1.f); + LLVector3 st_scale(map_scaleS, map_scaleT, 1.f); st_scale *= orig_proj_scale; centers_dist.scaleVec(st_scale); - LLVector2 orig_st_offset(orig_tep->mOffsetS, orig_tep->mOffsetT); + LLVector2 orig_st_offset(map_offsS, map_offsT); *res_st_offset = orig_st_offset + (LLVector2)centers_dist; res_st_offset->mV[VX] -= (S32)res_st_offset->mV[VX]; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index becf40ff26..b47e0face7 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -115,7 +115,7 @@ public: LLVector2 surfaceToTexture(LLVector2 surface_coord, const LLVector4a& position, const LLVector4a& normal); void getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_pos, F32* scale) const; bool calcAlignedPlanarTE(const LLFace* align_to, LLVector2* st_offset, - LLVector2* st_scale, F32* st_rot) const; + LLVector2* st_scale, F32* st_rot, LLRender::eTexIndex map = LLRender::DIFFUSE_MAP) const; U32 getState() const { return mState; } void setState(U32 state) { mState |= state; } diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 9b4d746dbd..c4ba9d9bbb 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -527,7 +527,7 @@ void LLFloaterPay::onGive(give_money_ptr info) // FIRE-16092: Make payment confirmation customizable //if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) - if (gSavedSettings.getBOOL("FSConfirmPayments") && amount > gSavedSettings.getS32("FSPaymentConfirmationThreshold") && gStatusBar && gStatusBar->getBalance() > amount) + if (gSavedSettings.getBOOL("FSConfirmPayments") && amount > gSavedSettings.getS32("FSPaymentConfirmationThreshold") && gStatusBar && gStatusBar->getBalance() >= amount) // { LLUUID payee_id = LLUUID::null; @@ -553,11 +553,26 @@ void LLFloaterPay::onGive(give_money_ptr info) payee_id = floater->mTargetUUID; } - LLSD args; - args["TARGET"] = LLSLURL(is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); - args["AMOUNT"] = amount; + // FIRE-24208: Skip notification if paying yourself + //LLSD args; + //args["TARGET"] = LLSLURL(is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); + //args["AMOUNT"] = amount; - LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); + //LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); + if (is_group || payee_id != gAgentID) + { + LLSD args; + args["TARGET"] = LLSLURL(is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); + args["AMOUNT"] = amount; + + LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); + } + else + { + floater->give(amount); + floater->closeFloater(); + } + // } else { diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ba0abf5641..d3bcc95f89 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1239,9 +1239,6 @@ void LLFloaterPreference::onOpen(const LLSD& key) getChild("client_tags_panel")->setVisible(in_opensim); // - // Force HTTP features on SL - getChild("TexturesHTTP")->setEnabled(in_opensim); - // Group mutes backup LLScrollListItem* groupmute_item = getChild("restore_per_account_files_list")->getItem(LLSD("groupmutes")); groupmute_item->setEnabled(in_opensim); diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 737c75fc7d..93fa43cd21 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -60,7 +60,7 @@ LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsDebug::onClickDefault, this)); mCommitCallbackRegistrar.add("UpdateFilter", boost::bind(&LLFloaterSettingsDebug::onUpdateFilter, this)); mCommitCallbackRegistrar.add("ClickCopy", boost::bind(&LLFloaterSettingsDebug::onCopyToClipboard, this)); - mCommitCallbackRegistrar.add("ClickSanityIcon", boost::bind(&LLFloaterSettingsDebug::onSanityCheck, this)); + mCommitCallbackRegistrar.add("ClickSanityIcon", boost::bind(&LLFloaterSettingsDebug::onClickSanityWarning, this)); // make sure that the first filter update succeeds mOldSearchTerm = std::string("---"); @@ -249,6 +249,13 @@ void LLFloaterSettingsDebug::onSanityCheck() SanityCheck::instance().onSanity(mCurrentControlVariable); } +void LLFloaterSettingsDebug::onClickSanityWarning() +{ + // pass "true" to tell the sanity checker to pop up the warning, even when + // it was shown before and would be suppressed otherwise + SanityCheck::instance().onSanity(mCurrentControlVariable, true); +} + void LLFloaterSettingsDebug::onCommitSettings() { if (!mCurrentControlVariable) diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h index 1c0c3ed3bf..f9d0a8af6d 100644 --- a/indra/newview/llfloatersettingsdebug.h +++ b/indra/newview/llfloatersettingsdebug.h @@ -60,6 +60,7 @@ public: void onClickDefault(); void onCopyToClipboard(); void onSanityCheck(); + void onClickSanityWarning(); static void showControl(const std::string& control); private: diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 711afc506a..508324e8c5 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -905,6 +905,7 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data) previewp->setSnapshotBufferType((LLSnapshotModel::ESnapshotLayerType)combobox->getCurrentIndex()); } view->impl->checkAutoSnapshot(previewp, TRUE); + previewp->updateSnapshot(TRUE, TRUE); } } diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index c1371d2401..25d841191f 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -510,14 +510,23 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec // } //} + + // FIRE-24175: Fix look at target clamping + bool isLookingAtSelf = false; + if(object){ + isLookingAtSelf = object->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)object)->isSelf(); + } static LLCachedControl s_EnableLimiter(gSavedSettings, "FSLookAtTargetLimitDistance"); bool lookAtShouldClamp = s_EnableLimiter && - (*mAttentions)[mTargetType].mName != "None" && - (*mAttentions)[mTargetType].mName != "Idle" && + //(*mAttentions)[mTargetType].mName != "None" && + //(*mAttentions)[mTargetType].mName != "Idle" && (*mAttentions)[mTargetType].mName != "Respond" && (*mAttentions)[mTargetType].mName != "Conversation" && - (*mAttentions)[mTargetType].mName != "Freelook" && - (*mAttentions)[mTargetType].mName != "AutoListen"; + //(*mAttentions)[mTargetType].mName != "FreeLook" && + //(*mAttentions)[mTargetType].mName != "AutoListen"; + (*mAttentions)[mTargetType].mName != "AutoListen" && + !isLookingAtSelf; + // FIRE-24175 if (!lookAtShouldClamp) //We do a similar but seperate calculation if we are doing limited distances { @@ -549,18 +558,20 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec { if (lookAtShouldClamp) { - if (mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()) - { - //We use this branch and mimic our mouse/first person look pose. - mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); - mTargetObject = NULL; - } - else - { + // FIRE-24175: Fix look at target clamping + //if (mTargetObject->isAvatar() && ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->isSelf()) + //{ + // //We use this branch and mimic our mouse/first person look pose. + // mTargetOffsetGlobal.setVec(gAgent.getPosGlobalFromAgent(gAgentAvatarp->mHeadp->getWorldPosition() + position)); + // mTargetObject = NULL; + //} + //else + //{ //Otherwise, mimic looking at the object. mTargetOffsetGlobal.setVec(object->getPositionGlobal() + (LLVector3d)(position * object->getRotationRegion())); mTargetObject = NULL; - } + //} + // FIRE-24175 } else { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8553f10f4f..b26b6c73fc 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -7397,10 +7397,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (LLWearableType::getAllowMultiwear(mWearableType)) { items.push_back(std::string("Wearable Add")); -// if (!gAgentWearables.canAddWearable(mWearableType)) -// [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2011-07-24 (Catznip-2.6.0e) | Added: Catznip-2.6.0e - if ( (!gAgentWearables.canAddWearable(mWearableType)) || (gAgentWearables.getWearableFromAssetID(item->getAssetUUID())) ) -// [/SL:KB] + if (!gAgentWearables.canAddWearable(mWearableType)) { disabled_items.push_back(std::string("Wearable Add")); } diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index 961d960cf7..e94f60c3e3 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -83,6 +83,7 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryType::ICONNAME_CLOTHING_SKIRT, new IconEntry("Inv_Skirt")); addEntry(LLInventoryType::ICONNAME_CLOTHING_ALPHA, new IconEntry("Inv_Alpha")); addEntry(LLInventoryType::ICONNAME_CLOTHING_TATTOO, new IconEntry("Inv_Tattoo")); + addEntry(LLInventoryType::ICONNAME_CLOTHING_UNIVERSAL, new IconEntry("Inv_Universal")); addEntry(LLInventoryType::ICONNAME_ANIMATION, new IconEntry("Inv_Animation")); addEntry(LLInventoryType::ICONNAME_GESTURE, new IconEntry("Inv_Gesture")); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index a418e327f6..e2887b5045 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -384,6 +384,7 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) updateUserLayers(old_id, new_id, LLWearableType::WT_SKIRT); updateUserLayers(old_id, new_id, LLWearableType::WT_SOCKS); updateUserLayers(old_id, new_id, LLWearableType::WT_TATTOO); + updateUserLayers(old_id, new_id, LLWearableType::WT_UNIVERSAL); updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERPANTS); updateUserLayers(old_id, new_id, LLWearableType::WT_UNDERSHIRT); } @@ -758,7 +759,7 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex( case LLWearableType::WT_TATTOO: { - switch(baked_texind) + switch (baked_texind) { case LLAvatarAppearanceDefines::BAKED_HEAD: { @@ -776,6 +777,75 @@ LLAvatarAppearanceDefines::ETextureIndex LLLocalBitmap::getTexIndex( result = LLAvatarAppearanceDefines::TEX_UPPER_TATTOO; break; } + default: + { + break; + } + } + break; + + } + case LLWearableType::WT_UNIVERSAL: + { + switch (baked_texind) + { + + case LLAvatarAppearanceDefines::BAKED_SKIRT: + { + result = LLAvatarAppearanceDefines::TEX_SKIRT_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_EYES: + { + result = LLAvatarAppearanceDefines::TEX_EYES_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_HAIR: + { + result = LLAvatarAppearanceDefines::TEX_HAIR_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_ARM: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_ARM_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LEFT_LEG: + { + result = LLAvatarAppearanceDefines::TEX_LEFT_LEG_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX1: + { + result = LLAvatarAppearanceDefines::TEX_AUX1_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX2: + { + result = LLAvatarAppearanceDefines::TEX_AUX2_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_AUX3: + { + result = LLAvatarAppearanceDefines::TEX_AUX3_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_UPPER: + { + result = LLAvatarAppearanceDefines::TEX_UPPER_UNIVERSAL_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_LOWER: + { + result = LLAvatarAppearanceDefines::TEX_LOWER_UNIVERSAL_TATTOO; + break; + } + case LLAvatarAppearanceDefines::BAKED_HEAD: + { + result = LLAvatarAppearanceDefines::TEX_HEAD_UNIVERSAL_TATTOO; + break; + } + default: { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 791fe1977f..a9a10339ca 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -819,7 +819,18 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content, for (; mav_errors_it != mav_errors.end(); ++mav_errors_it) { std::string mav_details = "Mav_Details_" + *mav_errors_it; - details << "Message: '" << *mav_errors_it << "': " << LLTrans::getString(mav_details) << std::endl << std::endl; + // Details error can be some message already. + //details << "Message: '" << *mav_errors_it << "': " << LLTrans::getString(mav_details) << std::endl << std::endl; + std::string translated_details; + if (LLTrans::findString(translated_details, mav_details)) + { + details << "Message: '" << *mav_errors_it << "': " << translated_details << std::endl << std::endl; + } + else + { + details << "Message: '" << *mav_errors_it << "'" << std::endl << std::endl; + } + // } std::string details_str = details.str(); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index de679ae91e..de35f4adf9 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -102,6 +102,7 @@ enum ESubpart { SUBPART_SKIRT, SUBPART_ALPHA, SUBPART_TATTOO, + SUBPART_UNIVERSAL, SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, @@ -246,7 +247,8 @@ LLEditWearableDictionary::Wearables::Wearables() addEntry(LLWearableType::WT_SKIRT, new WearableEntry(LLWearableType::WT_SKIRT,"edit_skirt_title","skirt_desc_text", texture_vec_t{TEX_SKIRT}, texture_vec_t{TEX_SKIRT}, subpart_vec_t{SUBPART_SKIRT})); addEntry(LLWearableType::WT_ALPHA, new WearableEntry(LLWearableType::WT_ALPHA,"edit_alpha_title","alpha_desc_text", texture_vec_t(), texture_vec_t{TEX_LOWER_ALPHA, TEX_UPPER_ALPHA, TEX_HEAD_ALPHA, TEX_EYES_ALPHA, TEX_HAIR_ALPHA}, subpart_vec_t{SUBPART_ALPHA})); addEntry(LLWearableType::WT_TATTOO, new WearableEntry(LLWearableType::WT_TATTOO,"edit_tattoo_title","tattoo_desc_text", texture_vec_t{TEX_HEAD_TATTOO}, texture_vec_t{TEX_LOWER_TATTOO, TEX_UPPER_TATTOO, TEX_HEAD_TATTOO}, subpart_vec_t{SUBPART_TATTOO})); - addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text", texture_vec_t(), texture_vec_t(), subpart_vec_t{SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED})); + addEntry(LLWearableType::WT_UNIVERSAL, new WearableEntry(LLWearableType::WT_UNIVERSAL, "edit_universal_title", "universal_desc_text", texture_vec_t{ TEX_HEAD_UNIVERSAL_TATTOO }, texture_vec_t{ TEX_HEAD_UNIVERSAL_TATTOO, TEX_UPPER_UNIVERSAL_TATTOO, TEX_LOWER_UNIVERSAL_TATTOO, TEX_SKIRT_TATTOO, TEX_HAIR_TATTOO, TEX_EYES_TATTOO, TEX_LEFT_ARM_TATTOO, TEX_LEFT_LEG_TATTOO, TEX_AUX1_TATTOO, TEX_AUX2_TATTOO, TEX_AUX3_TATTOO }, subpart_vec_t{ SUBPART_UNIVERSAL })); + addEntry(LLWearableType::WT_PHYSICS, new WearableEntry(LLWearableType::WT_PHYSICS,"edit_physics_title","physics_desc_text", texture_vec_t(), texture_vec_t(), subpart_vec_t{SUBPART_PHYSICS_BREASTS_UPDOWN, SUBPART_PHYSICS_BREASTS_INOUT, SUBPART_PHYSICS_BREASTS_LEFTRIGHT, SUBPART_PHYSICS_BELLY_UPDOWN, SUBPART_PHYSICS_BUTT_UPDOWN, SUBPART_PHYSICS_BUTT_LEFTRIGHT, SUBPART_PHYSICS_ADVANCED})); } LLEditWearableDictionary::WearableEntry::WearableEntry(LLWearableType::EType type, @@ -297,13 +299,15 @@ LLEditWearableDictionary::Subparts::Subparts() addEntry(SUBPART_GLOVES, new SubpartEntry(SUBPART_GLOVES, "mTorso", "gloves", "gloves_main_param_list", "gloves_main_tab", LLVector3d(0.f, 0.f, 0.f), LLVector3d(-1.f, 0.15f, 0.f),SEX_BOTH)); addEntry(SUBPART_UNDERSHIRT, new SubpartEntry(SUBPART_UNDERSHIRT, "mTorso", "undershirt", "undershirt_main_param_list", "undershirt_main_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(-1.f, 0.15f, 0.3f),SEX_BOTH)); addEntry(SUBPART_UNDERPANTS, new SubpartEntry(SUBPART_UNDERPANTS, "mPelvis", "underpants", "underpants_main_param_list", "underpants_main_tab", LLVector3d(0.f, 0.f, -0.5f), LLVector3d(-1.6f, 0.15f, -0.5f),SEX_BOTH)); - // Alpha and tattoo don't adhere to the usual panel layout and don't have a param list and main tab + // Alpha, tattoo and universal don't adhere to the usual panel layout and don't have a param list and main tab //addEntry(SUBPART_ALPHA, new SubpartEntry(SUBPART_ALPHA, "mPelvis", "alpha", "alpha_main_param_list", "alpha_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); //addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", "tattoo_main_param_list", "tattoo_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); + //addEntry(SUBPART_UNIVERSAL, new SubpartEntry(SUBPART_UNIVERSAL, "mPelvis", "universal", "universal_main_param_list", "universal_main_tab", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH)); addEntry(SUBPART_ALPHA, new SubpartEntry(SUBPART_ALPHA, "mPelvis", "alpha", "", "", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); addEntry(SUBPART_TATTOO, new SubpartEntry(SUBPART_TATTOO, "mPelvis", "tattoo", "", "", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f),SEX_BOTH)); + addEntry(SUBPART_UNIVERSAL, new SubpartEntry(SUBPART_UNIVERSAL, "mPelvis", "universal", "", "", LLVector3d(0.f, 0.f, 0.1f), LLVector3d(-2.5f, 0.5f, 0.8f), SEX_BOTH)); // - addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); + addEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, new SubpartEntry(SUBPART_PHYSICS_BREASTS_UPDOWN, "mTorso", "physics_breasts_updown", "physics_breasts_updown_param_list", "physics_breasts_updown_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_INOUT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_INOUT, "mTorso", "physics_breasts_inout", "physics_breasts_inout_param_list", "physics_breasts_inout_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); addEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, new SubpartEntry(SUBPART_PHYSICS_BREASTS_LEFTRIGHT, "mTorso", "physics_breasts_leftright", "physics_breasts_leftright_param_list", "physics_breasts_leftright_tab", LLVector3d(0.f, 0.f, 0.3f), LLVector3d(0.f, 0.f, 0.f),SEX_FEMALE)); // Fix XUI warning @@ -348,6 +352,7 @@ LLEditWearableDictionary::ColorSwatchCtrls::ColorSwatchCtrls() addEntry ( TEX_UPPER_UNDERSHIRT, new PickerControlEntry (TEX_UPPER_UNDERSHIRT, "Color/Tint" )); addEntry ( TEX_LOWER_UNDERPANTS, new PickerControlEntry (TEX_LOWER_UNDERPANTS, "Color/Tint" )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry(TEX_HEAD_TATTOO, "Color/Tint" )); + addEntry (TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry(TEX_HEAD_UNIVERSAL_TATTOO, "Color/Tint")); } LLEditWearableDictionary::TextureCtrls::TextureCtrls() @@ -375,6 +380,17 @@ LLEditWearableDictionary::TextureCtrls::TextureCtrls() addEntry ( TEX_LOWER_TATTOO, new PickerControlEntry (TEX_LOWER_TATTOO, "Lower Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_UPPER_TATTOO, new PickerControlEntry (TEX_UPPER_TATTOO, "Upper Tattoo", LLUUID::null, TRUE )); addEntry ( TEX_HEAD_TATTOO, new PickerControlEntry (TEX_HEAD_TATTOO, "Head Tattoo", LLUUID::null, TRUE )); + addEntry ( TEX_LOWER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_LOWER_UNIVERSAL_TATTOO, "Lower Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_UPPER_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_UPPER_UNIVERSAL_TATTOO, "Upper Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_HEAD_UNIVERSAL_TATTOO, new PickerControlEntry( TEX_HEAD_UNIVERSAL_TATTOO, "Head Universal Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_SKIRT_TATTOO, new PickerControlEntry(TEX_SKIRT_TATTOO, "Skirt Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_HAIR_TATTOO, new PickerControlEntry(TEX_HAIR_TATTOO, "Hair Tattoo", LLUUID::null, TRUE)); + addEntry ( TEX_EYES_TATTOO, new PickerControlEntry(TEX_EYES_TATTOO, "Eyes Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_ARM_TATTOO, new PickerControlEntry(TEX_LEFT_ARM_TATTOO, "Left Arm Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_LEFT_LEG_TATTOO, new PickerControlEntry(TEX_LEFT_LEG_TATTOO, "Left Leg Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX1_TATTOO, new PickerControlEntry(TEX_AUX1_TATTOO, "Aux1 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX2_TATTOO, new PickerControlEntry(TEX_AUX2_TATTOO, "Aux2 Tattoo", LLUUID::null, TRUE)); + addEntry (TEX_AUX3_TATTOO, new PickerControlEntry(TEX_AUX3_TATTOO, "Aux3 Tattoo", LLUUID::null, TRUE)); } LLEditWearableDictionary::PickerControlEntry::PickerControlEntry(ETextureIndex tex_index, @@ -761,6 +777,7 @@ BOOL LLPanelEditWearable::postBuild() mPanelSkirt = getChild("edit_skirt_panel"); mPanelAlpha = getChild("edit_alpha_panel"); mPanelTattoo = getChild("edit_tattoo_panel"); + mPanelUniversal = getChild("edit_universal_panel"); mPanelPhysics = getChild("edit_physics_panel"); mTxtAvatarHeight = mPanelShape->getChild("avatar_height"); @@ -1575,6 +1592,10 @@ LLPanel* LLPanelEditWearable::getPanel(LLWearableType::EType type) case LLWearableType::WT_TATTOO: return mPanelTattoo; break; + + case LLWearableType::WT_UNIVERSAL: + return mPanelUniversal; + break; case LLWearableType::WT_PHYSICS: return mPanelPhysics; diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index f87003e7a4..9fb1495284 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -177,6 +177,7 @@ private: LLPanel *mPanelSkirt; LLPanel *mPanelAlpha; LLPanel *mPanelTattoo; + LLPanel *mPanelUniversal; LLPanel *mPanelPhysics; typedef std::map string_texture_index_map_t; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index c38a7c2bd4..4d855c4266 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -84,6 +84,8 @@ const S32 ALPHAMODE_MASK = 2; // Alpha masking mode const S32 BUMPY_TEXTURE = 18; // use supplied normal map const S32 SHINY_TEXTURE = 4; // use supplied specular map +BOOST_STATIC_ASSERT(MATTYPE_DIFFUSE == LLRender::DIFFUSE_MAP && MATTYPE_NORMAL == LLRender::NORMAL_MAP && MATTYPE_SPECULAR == LLRender::SPECULAR_MAP); + // // "Use texture" label for normal/specular type comboboxes // Filled in at initialization from translated strings @@ -253,6 +255,7 @@ BOOL LLPanelFace::postBuild() // childSetAction("button align",&LLPanelFace::onClickAutoFix,this); + childSetAction("button align textures", &LLPanelFace::onAlignTexture, this); // Moved to the header so other functions can use them too. //LLTextureCtrl* mTextureCtrl; @@ -544,11 +547,28 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { BOOL valid; F32 value; - //LLSpinCtrl* ctrlTexScaleS = mPanel->getChild("TexScaleU"); - //LLSpinCtrl* ctrlTexScaleT = mPanel->getChild("TexScaleV"); - //LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild("TexOffsetU"); - //LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild("TexOffsetV"); - //LLSpinCtrl* ctrlTexRotation = mPanel->getChild("TexRot"); + + LLRadioGroup * radio_mat_type = mPanel->getChild("radio_material_type"); + std::string prefix; + switch (radio_mat_type->getSelectedIndex()) + { + case MATTYPE_DIFFUSE: + prefix = "Tex"; + break; + case MATTYPE_NORMAL: + prefix = "bumpy"; + break; + case MATTYPE_SPECULAR: + prefix = "shiny"; + break; + } + + LLSpinCtrl * ctrlTexScaleS = mPanel->getChild(prefix + "ScaleU"); + LLSpinCtrl * ctrlTexScaleT = mPanel->getChild(prefix + "ScaleV"); + LLSpinCtrl * ctrlTexOffsetS = mPanel->getChild(prefix + "OffsetU"); + LLSpinCtrl * ctrlTexOffsetT = mPanel->getChild(prefix + "OffsetV"); + LLSpinCtrl * ctrlTexRotation = mPanel->getChild(prefix + "Rot"); + LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); LLCheckBoxCtrl* cb_planar_align = mPanel->getChild("checkbox planar align"); bool align_planar = (cb_planar_align && cb_planar_align->get()); @@ -556,12 +576,12 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor llassert(comboTexGen); llassert(object); - if (mPanel->mCtrlTexScaleU) + if (ctrlTexScaleS) { - valid = !mPanel->mCtrlTexScaleU->getTentative(); + valid = !ctrlTexScaleS->getTentative(); if (valid || align_planar) { - value = mPanel->mCtrlTexScaleU->get(); + value = ctrlTexScaleS->get(); if (comboTexGen && comboTexGen->getCurrentIndex() == 1) { @@ -571,18 +591,18 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (align_planar) { - LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, value, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, value, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, value, te, object->getID()); } } } - if (mPanel->mCtrlTexScaleV) + if (ctrlTexScaleT) { - valid = !mPanel->mCtrlTexScaleV->getTentative(); + valid = !ctrlTexScaleT->getTentative(); if (valid || align_planar) { - value = mPanel->mCtrlTexScaleV->get(); + value = ctrlTexScaleT->get(); if (comboTexGen && comboTexGen->getCurrentIndex() == 1) { @@ -592,56 +612,56 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor if (align_planar) { - LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, value, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, value, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, value, te, object->getID()); } } } - if (mPanel->mCtrlTexOffsetU) + if (ctrlTexOffsetS) { - valid = !mPanel->mCtrlTexOffsetU->getTentative(); + valid = !ctrlTexOffsetS->getTentative(); if (valid || align_planar) { - value = mPanel->mCtrlTexOffsetU->get(); + value = ctrlTexOffsetS->get(); object->setTEOffsetS( te, value ); if (align_planar) { - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, value, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, value, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, value, te, object->getID()); } } } - if (mPanel->mCtrlTexOffsetV) + if (ctrlTexOffsetT) { - valid = !mPanel->mCtrlTexOffsetV->getTentative(); + valid = !ctrlTexOffsetT->getTentative(); if (valid || align_planar) { - value = mPanel->mCtrlTexOffsetV->get(); + value = ctrlTexOffsetT->get(); object->setTEOffsetT( te, value ); if (align_planar) { - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, value, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, value, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, value, te, object->getID()); } } } - if (mPanel->mCtrlTexRot) + if (ctrlTexRotation) { - valid = !mPanel->mCtrlTexRot->getTentative(); + valid = !ctrlTexRotation->getTentative(); if (valid || align_planar) { - value = mPanel->mCtrlTexRot->get() * DEG_TO_RAD; + value = ctrlTexRotation->get() * DEG_TO_RAD; object->setTERotation( te, value ); if (align_planar) { - LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, value, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, value, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, value, te, object->getID()); } } } @@ -713,6 +733,68 @@ private: LLFace* mCenterFace; }; +struct LLPanelFaceSetAlignedConcreteTEFunctor : public LLSelectedTEFunctor +{ + LLPanelFaceSetAlignedConcreteTEFunctor(LLPanelFace* panel, LLFace* center_face, LLRender::eTexIndex map) : + mPanel(panel), + mChefFace(center_face), + mMap(map) + {} + + virtual bool apply(LLViewerObject* object, S32 te) + { + LLFace* facep = object->mDrawable->getFace(te); + if (!facep) + { + return true; + } + + if (facep->getViewerObject()->getVolume()->getNumVolumeFaces() <= te) + { + return true; + } + + if (mChefFace != facep) + { + LLVector2 uv_offset, uv_scale; + F32 uv_rot; + if (facep->calcAlignedPlanarTE(mChefFace, &uv_offset, &uv_scale, &uv_rot, mMap)) + { + switch (mMap) + { + case LLRender::DIFFUSE_MAP: + object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]); + object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); + object->setTERotation(te, uv_rot); + break; + case LLRender::NORMAL_MAP: + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, uv_scale.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, uv_scale.mV[VY], te, object->getID()); + break; + case LLRender::SPECULAR_MAP: + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, uv_scale.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, uv_scale.mV[VY], te, object->getID()); + break; + default: /*make compiler happy*/ + break; + } + } + } + + return true; + } +private: + LLPanelFace* mPanel; + LLFace* mChefFace; + LLRender::eTexIndex mMap; +}; + // Functor that tests if a face is aligned to mCenterFace struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor { @@ -798,6 +880,17 @@ void LLPanelFace::sendTextureInfo() LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); } +void LLPanelFace::alignTestureLayer() +{ + LLFace* last_face = NULL; + bool identical_face = false; + LLSelectedTE::getFace(last_face, identical_face); + + LLRadioGroup * radio_mat_type = getChild("radio_material_type"); + LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast(radio_mat_type->getSelectedIndex())); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); +} + void LLPanelFace::getState() { updateUI(); @@ -1031,41 +1124,75 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) } updateAlphaControls(); - - if(mTextureCtrl) - { + + if (mTextureCtrl) + { if (identical_diffuse) { - mTextureCtrl->setTentative( FALSE ); - mTextureCtrl->setEnabled( editable ); - mTextureCtrl->setImageAssetID( id ); + mTextureCtrl->setTentative(FALSE); + mTextureCtrl->setEnabled(editable); + mTextureCtrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; + } + } + + mTextureCtrl->setBakeTextureEnabled(allAttachments); + } else if (id.isNull()) - { - // None selected - mTextureCtrl->setTentative( FALSE ); - mTextureCtrl->setEnabled( FALSE ); - mTextureCtrl->setImageAssetID( LLUUID::null ); - getChildView("combobox alphamode")->setEnabled( FALSE ); - getChildView("label alphamode")->setEnabled( FALSE ); - getChildView("maskcutoff")->setEnabled( FALSE); - getChildView("label maskcutoff")->setEnabled( FALSE ); - } - else - { - // Tentative: multiple selected with different textures - mTextureCtrl->setTentative( TRUE ); - mTextureCtrl->setEnabled( editable ); - mTextureCtrl->setImageAssetID( id ); + { + // None selected + mTextureCtrl->setTentative(FALSE); + mTextureCtrl->setEnabled(FALSE); + mTextureCtrl->setImageAssetID(LLUUID::null); + getChildView("combobox alphamode")->setEnabled(FALSE); + getChildView("label alphamode")->setEnabled(FALSE); + getChildView("maskcutoff")->setEnabled(FALSE); + getChildView("label maskcutoff")->setEnabled(FALSE); + + mTextureCtrl->setBakeTextureEnabled(false); + } + else + { + // Tentative: multiple selected with different textures + mTextureCtrl->setTentative(TRUE); + mTextureCtrl->setEnabled(editable); + mTextureCtrl->setImageAssetID(id); getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f); getChildView("label alphamode")->setEnabled(editable && mIsAlpha); getChildView("maskcutoff")->setEnabled(editable && mIsAlpha); getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha); + + bool allAttachments = true; + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end();iter++) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if (!object->isAttachment()) + { + allAttachments = false; + break; + } + } + + mTextureCtrl->setBakeTextureEnabled(allAttachments); } + } if (mShinyTextureCtrl) @@ -1093,6 +1220,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) bool enabled = (editable && isIdenticalPlanarTexgen()); childSetValue("checkbox planar align", align_planar && enabled); childSetEnabled("checkbox planar align", enabled); + childSetEnabled("button align textures", enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); if (align_planar && enabled) { @@ -2275,7 +2403,18 @@ void LLPanelFace::onCommitMaterialBumpyRot(LLUICtrl* ctrl, void* userdata) } else { - LLSelectedTEMaterial::setNormalRotation(self,self->getCurrentBumpyRot() * DEG_TO_RAD); + if ((bool)self->childGetValue("checkbox planar align").asBoolean()) + { + LLFace* last_face = NULL; + bool identical_face = false; + LLSelectedTE::getFace(last_face, identical_face); + LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); + } + else + { + LLSelectedTEMaterial::setNormalRotation(self, self->getCurrentBumpyRot() * DEG_TO_RAD); + } } } @@ -2292,7 +2431,18 @@ void LLPanelFace::onCommitMaterialShinyRot(LLUICtrl* ctrl, void* userdata) } else { - LLSelectedTEMaterial::setSpecularRotation(self,self->getCurrentShinyRot() * DEG_TO_RAD); + if ((bool)self->childGetValue("checkbox planar align").asBoolean()) + { + LLFace* last_face = NULL; + bool identical_face = false; + LLSelectedTE::getFace(last_face, identical_face); + LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); + } + else + { + LLSelectedTEMaterial::setSpecularRotation(self, self->getCurrentShinyRot() * DEG_TO_RAD); + } } } @@ -2549,6 +2699,11 @@ void LLPanelFace::onClickAutoFix(void* userdata) LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); } +void LLPanelFace::onAlignTexture(void* userdata) +{ + LLPanelFace* self = (LLPanelFace*)userdata; + self->alignTestureLayer(); +} // TODO: I don't know who put these in or what these are for??? @@ -2661,6 +2816,16 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) { LLUUID get(LLViewerObject* object, S32 te_index) { + LLTextureEntry *te = object->getTE(te_index); + if (te) + { + if ((te->getID() == IMG_USE_BAKED_EYES) || (te->getID() == IMG_USE_BAKED_HAIR) || (te->getID() == IMG_USE_BAKED_HEAD) || (te->getID() == IMG_USE_BAKED_LOWER) || (te->getID() == IMG_USE_BAKED_SKIRT) || (te->getID() == IMG_USE_BAKED_UPPER) + || (te->getID() == IMG_USE_BAKED_LEFTARM) || (te->getID() == IMG_USE_BAKED_LEFTLEG) || (te->getID() == IMG_USE_BAKED_AUX1) || (te->getID() == IMG_USE_BAKED_AUX2) || (te->getID() == IMG_USE_BAKED_AUX3)) + { + return te->getID(); + } + } + LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); if (image) @@ -2670,7 +2835,6 @@ void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical) if (!id.isNull() && LLViewerMedia::textureHasMedia(id)) { - LLTextureEntry *te = object->getTE(te_index); if (te) { LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID(), TEX_LIST_STANDARD) : NULL; diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index ff4eb365e6..7aae9ff3e1 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -128,6 +128,7 @@ protected: void sendFullbright(); // applies and sends full bright void sendGlow(); void sendMedia(); + void alignTestureLayer(); // this function is to return TRUE if the drag should succeed. static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item); @@ -204,6 +205,7 @@ protected: static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata); static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo); static void onClickAutoFix(void*); + static void onAlignTexture(void*); static F32 valueGlow(LLViewerObject* object, S32 face); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index b728488a56..a3aadf5cc6 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -474,6 +474,7 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("alpha"), new LLFindActualWearablesOfType(LLWearableType::WT_ALPHA))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("tattoo"), new LLFindActualWearablesOfType(LLWearableType::WT_TATTOO))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("physics"), new LLFindActualWearablesOfType(LLWearableType::WT_PHYSICS))); + mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("universal"), new LLFindActualWearablesOfType(LLWearableType::WT_UNIVERSAL))); mCurrentOutfitName = getChild("curr_outfit_name"); mStatus = getChild("status"); diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 0d9892784b..2bfce93ee9 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -98,6 +98,7 @@ public: LVIT_ALPHA, LVIT_TATTOO, LVIT_PHYSICS, + LVIT_UNIVERSAL, NUM_LIST_VIEW_ITEM_TYPES } EListViewItemType; diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 2283914d35..6179ba8ec4 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -383,6 +383,29 @@ void LLPanelVolume::getState( ) } } getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(enabled_animated_object_box); + + //refresh any bakes + if (root_volobjp) + { + root_volobjp->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = root_volobjp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + if (gAgentAvatarp) + { + gAgentAvatarp->updateMeshVisibility(); + } + } + // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); @@ -956,6 +979,28 @@ void LLPanelVolume::onCommitAnimatedMeshCheckbox(LLUICtrl *, void*) { volobjp->setExtendedMeshFlags(new_flags); } + + //refresh any bakes + if (volobjp) + { + volobjp->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = volobjp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + if (gAgentAvatarp) + { + gAgentAvatarp->updateMeshVisibility(); + } + } } void LLPanelVolume::onCommitIsFlexible(LLUICtrl *, void*) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e60cdd062b..a6667942c5 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -109,6 +109,7 @@ // Aurora Sim #include "fsareasearch.h" #include "llglheaders.h" +#include "llinventoryobserver.h" #include "fscommon.h" LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; @@ -1750,6 +1751,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) // * Can just apply the texture and be done with it. objectp->setTEImage(te, LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } + return true; } }; @@ -1949,6 +1951,7 @@ BOOL LLSelectMgr::selectionRevertTextures() else { object->setTEImage(te, LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + } } } @@ -6050,6 +6053,84 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.scalef(cur_zoom, cur_zoom, cur_zoom); } + bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; + F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); + + static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha); + static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha); + + auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor) + { + //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 + LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); + + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + if (shader) + { + gDebugProgram.bind(); + } + + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + + BOOL is_hud_object = objectp->isHUDAttachment(); + + if (!is_hud_object) + { + gGL.loadIdentity(); + gGL.multMatrix(gGLModelView); + } + + if (objectp->mDrawable->isActive()) + { + gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix); + } + else if (!is_hud_object) + { + LLVector3 trans = objectp->getRegion()->getOriginAgent(); + gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); + } + + bool bRenderHidenSelection = node->isTransient() ? false : LLSelectMgr::sRenderHiddenSelections; + + + LLVOVolume* vobj = objectp->mDrawable->getVOVolume(); + if (vobj) + { + LLVertexBuffer::unbind(); + gGL.pushMatrix(); + gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix); + + if (objectp->mDrawable->isState(LLDrawable::RIGGED)) + { + vobj->updateRiggedVolume(true); + } + } + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces + for (S32 te = 0; te < num_tes; ++te) + { + if (node->isTESelected(te)) + { + objectp->mDrawable->getFace(te)->renderOneWireframe(hlColor, fogCfx, wireframe_selection, bRenderHidenSelection, nullptr != shader); + } + } + + gGL.popMatrix(); + gGL.popMatrix(); + + glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + + if (shader) + { + shader->bind(); + } + }; + if (mSelectedObjects->getNumNodes()) { LLUUID inspect_item_id= LLUUID::null; @@ -6067,12 +6148,6 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } } - bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; - F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); - - static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha); - static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha); - LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getFocusedObjectID(); // Improve selection silhouette rendering speed by Drake Arconis //for (S32 pass = 0; pass < 2; pass++) @@ -6093,72 +6168,16 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) && objectp->mDrawable->getVOVolume() && objectp->mDrawable->getVOVolume()->isMesh()) { - //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 - LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); - - LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; - - if (shader) - { - gDebugProgram.bind(); - } - - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - - BOOL is_hud_object = objectp->isHUDAttachment(); - - if (objectp->mDrawable->isActive()) - { - gGL.loadMatrix(gGLModelView); - gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix); - } - else if (!is_hud_object) - { - gGL.loadIdentity(); - gGL.multMatrix(gGLModelView); - LLVector3 trans = objectp->getRegion()->getOriginAgent(); - gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); - } - LLColor4 hlColor = objectp->isRootEdit() ? sParentColor : sChildColor; - bool bRenderHidenSelection = node->isTransient() ? false : LLSelectMgr::sRenderHiddenSelections; - - - LLVOVolume* vobj = objectp->mDrawable->getVOVolume(); - if (vobj) + if (objectp->getID() == inspect_item_id) { - LLVertexBuffer::unbind(); - gGL.pushMatrix(); - gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix); - - if (objectp->mDrawable->isState(LLDrawable::RIGGED)) - { - vobj->updateRiggedVolume(); - } + hlColor = sHighlightInspectColor; } - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces - for (S32 te = 0; te < num_tes; ++te) + else if (node->isTransient()) { - if (node->isTESelected(te)) - { - objectp->mDrawable->getFace(te)->renderOneWireframe(hlColor, fogCfx, wireframe_selection, bRenderHidenSelection, nullptr != shader); - } - } - - gGL.popMatrix(); - gGL.popMatrix(); - - glLineWidth(1.f); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - if (shader) - { - shader->bind(); + hlColor = sContextSilhouetteColor; } + renderMeshSelection_f(node, objectp, hlColor); } else { @@ -6211,14 +6230,20 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) { continue; } - - if (subtracting_from_selection) + + LLColor4 highlight_color = objectp->isRoot() ? sHighlightParentColor : sHighlightChildColor; + if (objectp->mDrawable + && objectp->mDrawable->getVOVolume() + && objectp->mDrawable->getVOVolume()->isMesh()) + { + renderMeshSelection_f(node, objectp, subtracting_from_selection ? LLColor4::red : highlight_color); + } + else if (subtracting_from_selection) { node->renderOneSilhouette(LLColor4::red); } else if (!objectp->isSelected()) { - LLColor4 highlight_color = objectp->isRoot() ? sHighlightParentColor : sHighlightChildColor; node->renderOneSilhouette(highlight_color); } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8fad732e58..02e8dd0bca 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2628,7 +2628,10 @@ bool idle_startup() gSavedSettings.setBOOL("ShowStartLocation", TRUE); // Open Conversation floater on first login. - LLFloaterReg::toggleInstanceOrBringToFront("im_container"); + // [FS Communication UI] + //LLFloaterReg::toggleInstanceOrBringToFront("im_container"); + LLFloaterReg::toggleInstanceOrBringToFront("fs_im_container"); + // [FS Communication UI] } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index e762f8ac81..c5e389aa9f 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -32,6 +32,7 @@ #include "llrender.h" #include "llagent.h" #include "llviewertexturelist.h" +#include "llselectmgr.h" #include "llcheckboxctrl.h" #include "llcombobox.h" #include "llbutton.h" @@ -70,6 +71,8 @@ #include "lllocalbitmaps.h" #include "llerror.h" +#include "llavatarappearancedefines.h" + #include "fscommon.h" static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; @@ -122,6 +125,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mOnFloaterCloseCallback(NULL), mSetImageAssetIDCallback(NULL), mOnUpdateImageStatsCallback(NULL), + mBakeTextureEnabled(FALSE), mLocalBitmapsAddedCallbackConnection() // Threaded filepickers { buildFromFile("floater_texture_ctrl.xml"); @@ -149,54 +153,75 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selecti mNoCopyTextureSelected = FALSE; mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? mImageAssetID = image_id; - LLUUID item_id = findItemID(mImageAssetID, FALSE); - if (item_id.isNull()) + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) { - mInventoryPanel->getRootFolder()->clearSelection(); - // Clear out the UUID instead of keeping the last value - getChild("TextureKey")->setText(LLUUID::null.asString()); - // + if ( mBakeTextureEnabled && mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + onModeSelect(0,this); + } } else { - LLInventoryItem* itemp = gInventory.getItem(image_id); - // Texture UUID picker - //if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) - if (itemp) + if (mModeSelector->getSelectedIndex() == 2) { - BOOL copy = itemp->getPermissions().allowCopyBy(gAgent.getID()); - BOOL mod = itemp->getPermissions().allowModifyBy(gAgent.getID()); - BOOL xfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); - - if(!copy) + mModeSelector->setSelectedIndex(0, 0); + onModeSelect(0,this); + } + + LLUUID item_id = findItemID(mImageAssetID, FALSE); + if (item_id.isNull()) + { + mInventoryPanel->getRootFolder()->clearSelection(); + // Clear out the UUID instead of keeping the last value + getChild("TextureKey")->setText(LLUUID::null.asString()); + // + } + else + { + LLInventoryItem* itemp = gInventory.getItem(image_id); + // Texture UUID picker + //if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) + if (itemp) { - // no copy texture - getChild("apply_immediate_check")->setValue(FALSE); - mNoCopyTextureSelected = TRUE; - } - - //Verify permissions before revealing UUID. - //Replicates behaviour of "Copy UUID" on inventory. If you can't copy it there, you can't copy it here. - if(copy&&mod&&xfer) - { - getChild("TextureKey")->setText(image_id.asString()); + BOOL copy = itemp->getPermissions().allowCopyBy(gAgent.getID()); + BOOL mod = itemp->getPermissions().allowModifyBy(gAgent.getID()); + BOOL xfer = itemp->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); + + if(!copy) + { + // no copy texture + getChild("apply_immediate_check")->setValue(FALSE); + mNoCopyTextureSelected = TRUE; + } + + //Verify permissions before revealing UUID. + //Replicates behaviour of "Copy UUID" on inventory. If you can't copy it there, you can't copy it here. + if(copy&&mod&&xfer) + { + getChild("TextureKey")->setText(image_id.asString()); + } + else + { + getChild("TextureKey")->setText(LLUUID::null.asString()); + } } else { getChild("TextureKey")->setText(LLUUID::null.asString()); } + // } - else - { - getChild("TextureKey")->setText(LLUUID::null.asString()); - } - // - } - if (set_selection) - { - mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + if (set_selection) + { + mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO); + } } + + + } } @@ -394,6 +419,10 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel = getChild("inventory panel"); + mModeSelector = getChild("mode_selection"); + mModeSelector->setCommitCallback(onModeSelect, this); + mModeSelector->setSelectedIndex(0, 0); + if(mInventoryPanel) { U32 filter_types = 0x0; @@ -419,16 +448,15 @@ BOOL LLFloaterTexturePicker::postBuild() // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input - if(!mImageAssetID.isNull()) + + + + if (!mImageAssetID.isNull()) { mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); } } - mModeSelector = getChild("mode_selection"); - mModeSelector->setCommitCallback(onModeSelect, this); - mModeSelector->setSelectedIndex(0, 0); - childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this); childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this); childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this); @@ -460,6 +488,10 @@ BOOL LLFloaterTexturePicker::postBuild() LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); + getChild("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this); + getChild("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this); + + setBakeTextureEnabled(FALSE); return TRUE; } @@ -560,7 +592,24 @@ void LLFloaterTexturePicker::draw() mTexturep = NULL; if(mImageAssetID.notNull()) { - mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + LLPointer texture = NULL; + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (obj) + { + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + } + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID); + } + + mTexturep = texture; mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW); } @@ -804,6 +853,7 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) local_id = LLLocalBitmapMgr::getWorldID(temp_id); } } + if (self->mOnFloaterCommitCallback) { self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id); @@ -899,23 +949,82 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequemModeSelector->getSelectedIndex() == 0); + int mode = self->mModeSelector->getSelectedIndex(); - self->getChild("Default")->setVisible(mode); - self->getChild("Blank")->setVisible(mode); - self->getChild("Transparent")->setVisible(mode); // FIRE-5082: "Transparent" button in Texture Panel - self->getChild("None")->setVisible(mode); - self->getChild("Pipette")->setVisible(mode); - self->getChild("inventory search editor")->setVisible(mode); - self->getChild("inventory panel")->setVisible(mode); + self->getChild("Default")->setVisible(mode == 0); + self->getChild("Blank")->setVisible(mode == 0); + self->getChild("Transparent")->setVisible(mode == 0); // FIRE-5082: "Transparent" button in Texture Panel + self->getChild("None")->setVisible(mode == 0); + self->getChild("Pipette")->setVisible(mode == 0); + self->getChild("inventory search editor")->setVisible(mode == 0); + self->getChild("inventory panel")->setVisible(mode == 0); /*self->getChild("show_folders_check")->setVisible(mode); no idea under which conditions the above is even shown, needs testing. */ - self->getChild("l_add_btn")->setVisible(!mode); - self->getChild("l_rem_btn")->setVisible(!mode); - self->getChild("l_upl_btn")->setVisible(!mode); - self->getChild("l_name_list")->setVisible(!mode); + self->getChild("l_add_btn")->setVisible(mode == 1); + self->getChild("l_rem_btn")->setVisible(mode == 1); + self->getChild("l_upl_btn")->setVisible(mode == 1); + self->getChild("l_name_list")->setVisible(mode == 1); + + self->getChild("l_bake_use_texture_combo_box")->setVisible(mode == 2); + self->getChild("hide_base_mesh_region")->setVisible(false);// mode == 2); + + if (mode == 2) + { + self->stopUsingPipette(); + + S8 val = -1; + + LLUUID imageID = self->mImageAssetID; + if (imageID == IMG_USE_BAKED_HEAD) + { + val = 0; + } + else if (imageID == IMG_USE_BAKED_UPPER) + { + val = 1; + } + else if (imageID == IMG_USE_BAKED_LOWER) + { + val = 2; + } + else if (imageID == IMG_USE_BAKED_EYES) + { + val = 3; + } + else if (imageID == IMG_USE_BAKED_SKIRT) + { + val = 4; + } + else if (imageID == IMG_USE_BAKED_HAIR) + { + val = 5; + } + else if (imageID == IMG_USE_BAKED_LEFTARM) + { + val = 6; + } + else if (imageID == IMG_USE_BAKED_LEFTLEG) + { + val = 7; + } + else if (imageID == IMG_USE_BAKED_AUX1) + { + val = 8; + } + else if (imageID == IMG_USE_BAKED_AUX2) + { + val = 9; + } + else if (imageID == IMG_USE_BAKED_AUX3) + { + val = 10; + } + + + self->getChild("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE); + } } // static @@ -1051,6 +1160,86 @@ void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_da picker->commitIfImmediateSet(); } +//static +void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data) +{ + LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)user_data; + LLComboBox* combo_box = (LLComboBox*)ctrl; + + S8 type = combo_box->getValue().asInteger(); + + LLUUID imageID = self->mDefaultImageAssetID; + if (type == 0) + { + imageID = IMG_USE_BAKED_HEAD; + } + else if (type == 1) + { + imageID = IMG_USE_BAKED_UPPER; + } + else if (type == 2) + { + imageID = IMG_USE_BAKED_LOWER; + } + else if (type == 3) + { + imageID = IMG_USE_BAKED_EYES; + } + else if (type == 4) + { + imageID = IMG_USE_BAKED_SKIRT; + } + else if (type == 5) + { + imageID = IMG_USE_BAKED_HAIR; + } + else if (type == 6) + { + imageID = IMG_USE_BAKED_LEFTARM; + } + else if (type == 7) + { + imageID = IMG_USE_BAKED_LEFTLEG; + } + else if (type == 8) + { + imageID = IMG_USE_BAKED_AUX1; + } + else if (type == 9) + { + imageID = IMG_USE_BAKED_AUX2; + } + else if (type == 10) + { + imageID = IMG_USE_BAKED_AUX3; + } + + self->setImageID(imageID); + self->mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? + + if (!self->mPreviewSettingChanged) + { + self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview"); + } + else + { + self->mPreviewSettingChanged = false; + } + + if (self->mCanPreview) + { + // only commit intentional selections, not implicit ones + self->commitIfImmediateSet(); + } +} + +//static +void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *user_data) +{ + //LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data; + //LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl; +} + void LLFloaterTexturePicker::updateFilterPermMask() { //mInventoryPanel->setFilterPermMask( getFilterPermMask() ); Commented out due to no-copy texture loss. @@ -1106,6 +1295,28 @@ void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) mModeSelector->setIndexEnabled(1,enabled); } +void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled) +{ + BOOL changed = (enabled != mBakeTextureEnabled); + + mBakeTextureEnabled = enabled; + mModeSelector->setIndexEnabled(2, enabled); + + if (!mBakeTextureEnabled && (mModeSelector->getSelectedIndex() == 2)) + { + mModeSelector->setSelectedIndex(0, 0); + } + + if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + if (mModeSelector->getSelectedIndex() != 2) + { + mModeSelector->setSelectedIndex(2, 0); + } + } + onModeSelect(0, this); +} + void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); @@ -1159,6 +1370,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) mDefaultImageAssetID(p.default_image_id), mDefaultImageName(p.default_image_name), mFallbackImage(p.fallback_image), + mBakeTextureEnabled(FALSE), // Mask texture if desired mIsMasked(FALSE), // Mask texture if desired @@ -1364,6 +1576,10 @@ void LLTextureCtrl::showPicker(BOOL take_focus) { texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1)); } + if (texture_floaterp) + { + texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled); + } LLFloater* root_floater = gFloaterView->getParentFloater(this); if (root_floater) @@ -1558,6 +1774,16 @@ void LLTextureCtrl::setImageAssetID( const LLUUID& asset_id ) } } +void LLTextureCtrl::setBakeTextureEnabled(BOOL enabled) +{ + mBakeTextureEnabled = enabled; + LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get(); + if (floaterp) + { + floaterp->setBakeTextureEnabled(enabled); + } +} + BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, @@ -1615,7 +1841,23 @@ void LLTextureCtrl::draw() } else if (!mImageAssetID.isNull()) { - LLPointer texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES,LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLPointer texture = NULL; + + if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID)) + { + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); + if (obj) + { + LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID); + texture = viewerTexture ? dynamic_cast(viewerTexture) : NULL; + } + + } + + if (texture.isNull()) + { + texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } texture->setBoostLevel(LLGLTexture::BOOST_PREVIEW); texture->forceToSaveRawImage(0) ; diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 612110aa1f..24ec6f748f 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -201,6 +201,8 @@ public: LLViewerFetchedTexture* getTexture() { return mTexturep; } + void setBakeTextureEnabled(BOOL enabled); + // Mask texture if desired void setIsMasked(BOOL masked) { mIsMasked = masked; } @@ -240,6 +242,7 @@ private: BOOL mShowLoadingPlaceholder; std::string mLoadingPlaceholderString; S32 mLabelWidth; + BOOL mBakeTextureEnabled; // Texture preview mode BOOL mPreviewMode; @@ -342,7 +345,11 @@ public: static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata); void onLocalBitmapsAddedCallback(); // Threaded filepickers + static void onBakeTextureSelect(LLUICtrl* ctrl, void *userdata); + static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata); + void setLocalTextureEnabled(BOOL enabled); + void setBakeTextureEnabled(BOOL enabled); protected: LLPointer mTexturep; @@ -385,12 +392,15 @@ private: bool mCanPreview; bool mPreviewSettingChanged; + texture_selected_callback mTextureSelectedCallback; floater_close_callback mOnFloaterCloseCallback; floater_commit_callback mOnFloaterCommitCallback; set_image_asset_id_callback mSetImageAssetIDCallback; set_on_update_image_stats_callback mOnUpdateImageStatsCallback; + BOOL mBakeTextureEnabled; + boost::signals2::connection mLocalBitmapsAddedCallbackConnection; // Threaded filepickers }; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 4f44ecd8ce..c7d899e2f6 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2628,7 +2628,10 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image { mFetchDebugger = new LLTextureFetchDebugger(this, cache, imagedecodethread) ; mFetchSource = (e_tex_source)gSavedSettings.getS32("TextureFetchSource"); - if(mFetchSource < 0 && mFetchSource >= INVALID_SOURCE) + // && makes no sense at all (always false) + // if(mFetchSource < 0 && mFetchSource >= INVALID_SOURCE) + if(mFetchSource < 0 || mFetchSource >= INVALID_SOURCE) + // { mFetchSource = LLTextureFetch::FROM_ALL; gSavedSettings.setS32("TextureFetchSource", 0); diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 01be2ccfe3..3fb2aec547 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -58,30 +58,6 @@ namespace LLViewerDisplayName void doNothing() { } } -void LLViewerDisplayName::setDisplayNameCoro(const std::string& cap_url, const LLSD& body) -{ - LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("SetDisplayNameCoro", httpPolicy)); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - - // People API can return localized error messages. Indicate our - // language preference via header. - httpHeaders->append(HTTP_OUT_HEADER_ACCEPT_LANGUAGE, LLUI::getLanguage()); - - LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, body, httpHeaders); - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - LL_WARNS() << status.toString() << LL_ENDL; - LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD()); - LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); - } -} - void LLViewerDisplayName::set(const std::string& display_name, const set_name_slot_t& slot) { // TODO: simple validation here @@ -110,7 +86,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl LLSD change_array = LLSD::emptyArray(); change_array.append(av_name.getDisplayName()); change_array.append(display_name); - + LL_INFOS() << "Set name POST to " << cap_url << LL_ENDL; // Record our caller for when the server sends back a reply @@ -121,8 +97,33 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl // communicates with the back-end. LLSD body; body["display_name"] = change_array; + LLCoros::instance().launch("LLViewerDisplayName::SetDisplayNameCoro", + boost::bind(&LLViewerDisplayName::setDisplayNameCoro, cap_url, body)); +} - LLCoros::instance().launch("SetDisplayNameCoro", boost::bind(&LLViewerDisplayName::setDisplayNameCoro, cap_url, body)); +void LLViewerDisplayName::setDisplayNameCoro(const std::string& cap_url, const LLSD& body) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("SetDisplayNameCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + + // People API can return localized error messages. Indicate our + // language preference via header. + httpHeaders->append(HTTP_OUT_HEADER_ACCEPT_LANGUAGE, LLUI::getLanguage()); + + LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, body, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS() << "Unable to set display name. Status: " << status.toString() << LL_ENDL; + LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD()); + LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots(); + } } class LLSetDisplayNameReply : public LLHTTPNode diff --git a/indra/newview/llviewerdisplayname.h b/indra/newview/llviewerdisplayname.h index 602fcd3d6d..337aaa68b6 100644 --- a/indra/newview/llviewerdisplayname.h +++ b/indra/newview/llviewerdisplayname.h @@ -45,9 +45,9 @@ namespace LLViewerDisplayName // Sends an update to the server to change a display name // and call back when done. May not succeed due to service // unavailable or name not available. - void set(const std::string& display_name, const set_name_slot_t& slot); - - void setDisplayNameCoro(const std::string& cap_url, const LLSD& body); + void set(const std::string& display_name, const set_name_slot_t& slot); + + void setDisplayNameCoro(const std::string& cap_url, const LLSD& body); void addNameChangedCallback(const name_changed_signal_t::slot_type& cb); } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 3c4a2ceb05..f645afdef8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -459,7 +459,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("area_search", "floater_fs_area_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("export_collada", "floater_export_collada.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("delete_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("floater_profile", "floater_profile_view.xml",&LLFloaterReg::build); + LLFloaterReg::add("fs_floater_profile", "floater_fs_profile_view.xml", &LLFloaterReg::build); LLFloaterReg::add("fs_asset_blacklist", "floater_fs_asset_blacklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_avatar_render_settings", "floater_fs_avatar_render_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_blocklist", "floater_fs_blocklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 89714f0bf0..caf4316560 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -141,6 +141,7 @@ LLLocalizedInventoryItemsDictionary::LLLocalizedInventoryItemsDictionary() mInventoryItemsDict["New Skirt"] = LLTrans::getString("New Skirt"); mInventoryItemsDict["New Alpha"] = LLTrans::getString("New Alpha"); mInventoryItemsDict["New Tattoo"] = LLTrans::getString("New Tattoo"); + mInventoryItemsDict["New Universal"] = LLTrans::getString("New Universal"); mInventoryItemsDict["New Physics"] = LLTrans::getString("New Physics"); mInventoryItemsDict["Invalid Wearable"] = LLTrans::getString("Invalid Wearable"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e9f0afa7bc..776249a2ae 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -147,6 +147,7 @@ #include "fslightshare.h" // FIRE-5118 - Lightshare support #include "fslslbridge.h" #include "fsmoneytracker.h" +#include "llattachmentsmgr.h" #include "llfloaterbump.h" #include "llfloaterreg.h" #include "llfriendcard.h" @@ -185,6 +186,34 @@ const U8 AU_FLAGS_NONE = 0x00; const U8 AU_FLAGS_HIDETITLE = 0x01; const U8 AU_FLAGS_CLIENT_AUTOPILOT = 0x02; +// Trigger refresh attachments if attachments get detached after TP finished +class FSHelloToKokuaRefreshAttachmentsTimer : public LLEventTimer +{ +public: + FSHelloToKokuaRefreshAttachmentsTimer() : LLEventTimer(5.f) + { + mEventTimer.stop(); + } + + BOOL tick() + { + if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport")) + { + report_to_nearby_chat("Refreshing attachments..."); + } + mEventTimer.stop(); + LLAttachmentsMgr::instance().refreshAttachments(); + return FALSE; + } + + void triggerRefresh() + { + mEventTimer.start(); + } +}; +FSHelloToKokuaRefreshAttachmentsTimer gFSRefreshAttachmentsTimer; +// + void accept_friendship_coro(std::string url, LLSD notification) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -4562,24 +4591,29 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) objectp->permYouOwner()) { // Simply ignore the request and don't kill the object - this should work... + + std::string reason; + if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + { + reason = "tp"; + } + else if (gAgentAvatarp->isCrossingRegion()) + { + reason = "crossing"; + } + else + { + reason = "timer"; + gFSRefreshAttachmentsTimer.triggerRefresh(); + } + std::string message = "Region \"" + regionp->getName() + "\" tried to kill attachment: " + objectp->getAttachmentItemName() + " (" + reason + ") - Agent region: \"" + gAgent.getRegion()->getName() + "\""; + LL_WARNS("Messaging") << message << LL_ENDL; + if (gSavedSettings.getBOOL("FSExperimentalLostAttachmentsFixReport")) { - std::string reason; - if (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) - { - reason = "tp"; - } - else if (gAgentAvatarp->isCrossingRegion()) - { - reason = "crossing"; - } - else - { - reason = "timer"; - } - - report_to_nearby_chat("Region \"" + regionp->getName() + "\" tried to kill attachment: " + objectp->getAttachmentItemName() + " (" + reason + ") - Agent region: \"" + gAgent.getRegion()->getName() + "\""); + report_to_nearby_chat(message); } + continue; } // diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f5c2d6ee4d..35d2593aa0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2711,32 +2711,6 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim LLVector3d old_pos_global = mRegionp->getPosGlobalFromRegion(getPositionRegion()); new_pos_global = mRegionp->getPosGlobalFromRegion(new_pos); // Re-fetch in case it got clipped above - // FIRE-21915: Fix bogus avatar movement on region crossing - // Clip new_pos to current region. Moves across region boundaries should not be extrapolated. - // Extrapolation across region boundaries is almost always wrong, and if the region being - // entered is slow to respond, very wrong. - // Probably don't need edge of world check below any more since we are clipping the predictor to the region. - static LLCachedControl fsExperimentalRegionCrossingMovementFix(gSavedSettings, "FSExperimentalRegionCrossingMovementFix"); - if (fsExperimentalRegionCrossingMovementFix == 1) - { - bool clipped; // true if clipped at boundary - LLVector3d clip_pos_global_region = LLWorld::getInstance()->clipToRegion(mRegionp, old_pos_global, new_pos_global, clipped); - if (clipped) - { - // Was clipped, so we crossed a region boundary - //LL_INFOS() << "Beyond region edge, clipped predicted position to " << mRegionp->getPosRegionFromGlobal(clip_pos_global_region) - // << " from [" << getPositionRegion() << " .. " << new_pos << "]" << LL_ENDL; - new_pos = mRegionp->getPosRegionFromGlobal(clip_pos_global_region); - // Don't zero out velocity on the server. Telling the server affects scripts and audio. - //new_v.clear(); - //setAcceleration(LLVector3::zero); // stop linear acceleration - LLVector3 new_angv; - new_angv.clear(); - setAngularVelocity(new_angv); // stop rotation - } - } - // - // Clip the positions to known regions LLVector3d clip_pos_global = LLWorld::getInstance()->clipToVisibleRegions(old_pos_global, new_pos_global); if (clip_pos_global != new_pos_global) @@ -2754,6 +2728,11 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim } else { + // FIRE-24184: Replace previous region crossing movement fix with LL's version and add option to turn it off + static LLCachedControl fsExperimentalRegionCrossingMovementFix(gSavedSettings, "FSExperimentalRegionCrossingMovementFix"); + if (fsExperimentalRegionCrossingMovementFix == 1) + { + // // Check for how long we are crossing. // Note: theoretically we can find time from velocity, acceleration and // distance from border to new position, but it is not going to work @@ -2775,6 +2754,9 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim setAcceleration(LLVector3::zero); mRegionCrossExpire = 0; } + // FIRE-24184: Replace previous region crossing movement fix with LL's version and add option to turn it off + } + // } } else @@ -4852,30 +4834,111 @@ void LLViewerObject::sendTEUpdate() const msg->sendReliable( regionp->getHost() ); } +LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id) +{ + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + return NULL; + } + + LLViewerObject *root = getRootEdit(); + if (root && root->isAnimatedObject()) + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id); + LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex); + if (bakedTexture == NULL || bakedTexture->isMissingAsset()) + { + return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + else + { + return bakedTexture; + } + } + else + { + return LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + } + +} + +void LLViewerObject::updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id) +{ + if (id == old_id) + { + return; + } + + if (!LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(old_id) && !LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id)) + { + return; + } + + LLVOAvatar* avatar = getAvatar(); + if (avatar) + { + avatar->updateMeshVisibility(); + } +} + void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { + LLUUID old_image_id; + if (getTE(te)) + { + old_image_id = getTE(te)->getID(); + } + LLPrimitive::setTE(te, texture_entry); const LLUUID& image_id = getTEref(te).getID(); - mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + mTEImages[te] = bakedTexture ? bakedTexture : LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + + + updateAvatarMeshVisibility(image_id,old_image_id); if (getTEref(te).getMaterialParams().notNull()) { const LLUUID& norm_id = getTEref(te).getMaterialParams()->getNormalID(); mTENormalMaps[te] = LLViewerTextureManager::getFetchedTexture(norm_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); - + const LLUUID& spec_id = getTEref(te).getMaterialParams()->getSpecularID(); mTESpecularMaps[te] = LLViewerTextureManager::getFetchedTexture(spec_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_ALM, LLViewerTexture::LOD_TEXTURE); } } +void LLViewerObject::refreshBakeTexture() +{ + for (int face_index = 0; face_index < getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = getTE(face_index); + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + const LLUUID& image_id = tex_entry->getID(); + LLViewerTexture* bakedTexture = getBakedTextureForMagicId(image_id); + changeTEImage(face_index, bakedTexture); + } + } +} + void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) { if (mTEImages[te] != imagep) { - mTEImages[te] = imagep; - + LLUUID old_image_id = getTE(te) ? getTE(te)->getID() : LLUUID::null; + LLPrimitive::setTETexture(te, imagep->getID()); + + LLViewerTexture* baked_texture = getBakedTextureForMagicId(imagep->getID()); + mTEImages[te] = baked_texture ? baked_texture : imagep; + updateAvatarMeshVisibility(imagep->getID(), old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4886,13 +4949,16 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep) S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image) { + LLUUID old_image_id = getTEref(te).getID(); const LLUUID& uuid = image->getID(); S32 retval = 0; if (uuid != getTEref(te).getID() || uuid == LLUUID::null) { retval = LLPrimitive::setTETexture(te, uuid); - mTEImages[te] = image; + LLViewerTexture* baked_texture = getBakedTextureForMagicId(uuid); + mTEImages[te] = baked_texture ? baked_texture : image; + updateAvatarMeshVisibility(uuid,old_image_id); setChanged(TEXTURE); if (mDrawable.notNull()) { @@ -4983,7 +5049,7 @@ S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid) // Invalid host == get from the agent's sim LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture( uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost()); - return setTETextureCore(te,image); + return setTETextureCore(te, image); } S32 LLViewerObject::setTENormalMap(const U8 te, const LLUUID& uuid) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 40dc7b2297..0f34ea7326 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -601,6 +601,10 @@ public: friend class LLViewerObjectList; friend class LLViewerMediaList; +public: + LLViewerTexture* getBakedTextureForMagicId(const LLUUID& id); + void updateAvatarMeshVisibility(const LLUUID& id, const LLUUID& old_id); + void refreshBakeTexture(); public: static void unpackVector3(LLDataPackerBinaryBuffer* dp, LLVector3& value, std::string name); static void unpackUUID(LLDataPackerBinaryBuffer* dp, LLUUID& value, std::string name); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index aee18ab40e..12bd28cecd 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -3446,6 +3446,12 @@ bool LLViewerRegion::meshUploadEnabled() const mSimulatorFeatures["MeshUploadEnabled"].asBoolean()); } +bool LLViewerRegion::bakesOnMeshEnabled() const +{ + return (mSimulatorFeatures.has("BakesOnMeshEnabled") && + mSimulatorFeatures["BakesOnMeshEnabled"].asBoolean()); +} + bool LLViewerRegion::meshRezEnabled() const { return (mSimulatorFeatures.has("MeshRezEnabled") && diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 3c20eda8bf..3e807eabff 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -323,6 +323,8 @@ public: bool meshRezEnabled() const; bool meshUploadEnabled() const; + bool bakesOnMeshEnabled() const; + // has region received its simulator features list? Requires an additional query after caps received. void requestSimulatorFeatures(); void setSimulatorFeaturesReceived(bool); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index a42f2cdd04..555d574ed0 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -70,6 +70,8 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, mNeedsUpdate(TRUE), mNumLowresUpdates(0) { + mGLTexturep->setNeedsAlphaAndPickMask(FALSE); + LLViewerTexLayerSetBuffer::sGLByteCount += getSize(); // [Legacy Bake] mNeedsUploadTimer.start(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 367971b00a..5b306de9dc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5782,7 +5782,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if ((image_width <= gGLManager.mGLMaxTextureSize && image_height <= gGLManager.mGLMaxTextureSize) && (image_width > window_width || image_height > window_height) && LLPipeline::sRenderDeferred && !show_ui) { - if (scratch_space.allocate(image_width, image_height, GL_RGBA, true, true)) + if (scratch_space.allocate(image_width, image_height, GL_DEPTH_COMPONENT, true, true)) { original_width = gPipeline.mDeferredScreen.getWidth(); original_height = gPipeline.mDeferredScreen.getHeight(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3ba7819723..93fbfbb0ef 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -865,7 +865,8 @@ BOOL LLVOAvatar::isFullyBaked() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) - && ( (i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT) ) ) + && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)) + && (i != BAKED_LEFT_ARM) && (i != BAKED_LEFT_LEG) && (i != BAKED_AUX1) && (i != BAKED_AUX2) && (i != BAKED_AUX3)) { return FALSE; } @@ -2498,6 +2499,7 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU { result->setIsMissingAsset(false); } + } return result; } @@ -4159,6 +4161,7 @@ void LLVOAvatar::updateAppearanceMessageDebugText() debug_line += llformat(" %s", (isSitting() ? "S" : "T")); debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); } + LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); LLVector3 normal; LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; @@ -7779,6 +7782,22 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o LLSelectMgr::getInstance()->updatePointAt(); } + viewer_object->refreshBakeTexture(); + + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + updateMeshVisibility(); + return attachment; } @@ -7999,7 +8018,6 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) //----------------------------------------------------------------------------- BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) { - for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -8011,14 +8029,29 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment && attachment->isObjectAttached(viewer_object)) // { - updateVisualComplexity(); + updateVisualComplexity(); bool is_animated_object = viewer_object->isAnimatedObject(); - cleanupAttachedMesh( viewer_object ); + cleanupAttachedMesh(viewer_object); attachment->removeObject(viewer_object); if (!is_animated_object) { updateAttachmentOverrides(); } + viewer_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) + { + LLViewerObject* objectp = *iter1; + if (objectp) + { + objectp->refreshBakeTexture(); + } + } + + updateMeshVisibility(); + LL_DEBUGS() << "Detaching object " << viewer_object->mID << " from " << attachment->getName() << LL_ENDL; return TRUE; } @@ -8734,6 +8767,121 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) } } + +//----------------------------------------------------------------------------- +// updateMeshVisibility() +// Hide the mesh joints if attachments are using baked textures +//----------------------------------------------------------------------------- +void LLVOAvatar::updateMeshVisibility() +{ + bool bake_flag[BAKED_NUM_INDICES]; + memset(bake_flag, 0, BAKED_NUM_INDICES*sizeof(bool)); + + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + if (attachment) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject *objectp = (*attachment_iter); + if (objectp) + { + for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectp->getTE(face_index); + if (tex_entry) + { + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); + } + } + } + + LLViewerObject::const_child_list_t& child_list = objectp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter1 = child_list.begin(); + iter1 != child_list.end(); ++iter1) + { + LLViewerObject* objectchild = *iter1; + if (objectchild) + { + for (int face_index = 0; face_index < objectchild->getNumTEs(); face_index++) + { + LLTextureEntry* tex_entry = objectchild->getTE(face_index); + if (tex_entry) + { + bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD); + bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES); + bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR); + bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER); + bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER); + bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT); + bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM); + bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG); + bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1); + bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2); + bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3); + } + } + } + } + } + } + } + + //LL_INFOS() << "head " << bake_flag[BAKED_HEAD] << "eyes " << bake_flag[BAKED_EYES] << "hair " << bake_flag[BAKED_HAIR] << "lower " << bake_flag[BAKED_LOWER] << "upper " << bake_flag[BAKED_UPPER] << "skirt " << bake_flag[BAKED_SKIRT] << LL_ENDL; + + for (S32 i = 0; i < mMeshLOD.size(); i++) + { + LLAvatarJoint* joint = mMeshLOD[i]; + if (i == MESH_ID_HAIR) + { + joint->setVisible(!bake_flag[BAKED_HAIR], TRUE); + } + else if (i == MESH_ID_HEAD) + { + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); + } + else if (i == MESH_ID_SKIRT) + { + joint->setVisible(!bake_flag[BAKED_SKIRT], TRUE); + } + else if (i == MESH_ID_UPPER_BODY) + { + joint->setVisible(!bake_flag[BAKED_UPPER], TRUE); + } + else if (i == MESH_ID_LOWER_BODY) + { + joint->setVisible(!bake_flag[BAKED_LOWER], TRUE); + } + else if (i == MESH_ID_EYEBALL_LEFT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYEBALL_RIGHT) + { + joint->setVisible(!bake_flag[BAKED_EYES], TRUE); + } + else if (i == MESH_ID_EYELASH) + { + joint->setVisible(!bake_flag[BAKED_HEAD], TRUE); + } + } +} + //----------------------------------------------------------------------------- // updateMeshTextures() // Uses the current TE values to set the meshes' and layersets' textures. @@ -8951,6 +9099,39 @@ void LLVOAvatar::updateMeshTextures() removeMissingBakedTextures(); // May call back into this function if anything is removed call_remove_missing = true; } + + //refresh bakes on any attached objects + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && !attached_object->isDead()) + { + attached_object->refreshBakeTexture(); + + LLViewerObject::const_child_list_t& child_list = attached_object->getChildren(); + for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* objectp = *iter; + if (objectp && !objectp->isDead()) + { + objectp->refreshBakeTexture(); + } + } + } + } + } + + + } // virtual @@ -9651,7 +9832,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte { if (!isTextureDefined(mBakedTextureDatas[baked_index].mTextureIndex) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT - && baked_index != BAKED_SKIRT) + && baked_index != BAKED_SKIRT && baked_index != BAKED_LEFT_ARM && baked_index != BAKED_LEFT_LEG && baked_index != BAKED_AUX1 && baked_index != BAKED_AUX2 && baked_index != BAKED_AUX3) { // [Legacy Bake] //LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; @@ -9794,6 +9975,39 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte } updateMeshTextures(); + updateMeshVisibility(); + +} + +LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) +{ + if (te < 0 || te >= BAKED_NUM_INDICES) + { + return NULL; + } + + BOOL is_layer_baked = isTextureDefined(mBakedTextureDatas[te].mTextureIndex); + + LLViewerTexLayerSet* layerset = NULL; + layerset = getTexLayerSet(te); + + + if (!isEditingAppearance() && is_layer_baked) + { + LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture(getImage(mBakedTextureDatas[te].mTextureIndex, 0), TRUE); + return baked_img; + } + else if (layerset && isEditingAppearance()) + { + layerset->createComposite(); + layerset->setUpdatesEnabled(TRUE); + + return layerset->getViewerComposite(); + } + + return NULL; + + } // static @@ -10032,6 +10246,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) } } } + dirtyMesh(); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f65b6924c8..852c0d0d05 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -645,6 +645,7 @@ public: public: /*virtual*/ LLTexLayerSet* createTexLayerSet(); // Return LLViewerTexLayerSet void releaseComponentTextures(); // ! BACKWARDS COMPATIBILITY ! + protected: static void onBakedTextureMasksLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); static void onInitialBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); @@ -733,6 +734,9 @@ public: void updateSexDependentLayerSets(BOOL upload_bake); virtual void dirtyMesh(); // Dirty the avatar mesh void updateMeshData(); + void updateMeshVisibility(); + LLViewerTexture* getBakedTexture(const U8 te); + protected: void releaseMeshData(); virtual void restoreMeshData(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7527fe781b..b960e4e896 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -85,6 +85,7 @@ #include "llviewerinventory.h" #include "llcallstack.h" #include "llsculptidsize.h" +#include "llavatarappearancedefines.h" // [RLVa:KB] - Checked: RLVa-2.0.0 #include "rlvactions.h" #include "rlvlocks.h" @@ -2637,7 +2638,13 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: { //all of them modes available only for 32 bit textures - if(GL_RGBA != img_diffuse->getPrimaryFormat()) + LLTextureEntry* tex_entry = getTE(te); + bool bIsBakedImageId = false; + if (tex_entry && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(tex_entry->getID())) + { + bIsBakedImageId = true; + } + if (GL_RGBA != img_diffuse->getPrimaryFormat() && !bIsBakedImageId) { bSetDiffuseNone = true; } @@ -5838,6 +5845,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) U32 mask = mat->getShaderMask(alpha_mode); pool->addRiggedFace(facep, mask); } + + if(vobj->isAnimatedObject() && vobj->isRiggedMesh()) + { + pool->updateRiggedVertexBuffers(vobj->getAvatar()); + } } else if (mat) { diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 5643d96eb0..21363c11e4 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -530,6 +530,7 @@ clothing_to_string_map_t init_clothing_string_map() w_map.insert(std::make_pair(LLWearableType::WT_SKIRT, "skirt_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_ALPHA, "alpha_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_TATTOO, "tattoo_not_worn")); + w_map.insert(std::make_pair(LLWearableType::WT_UNIVERSAL, "universal_not_worn")); w_map.insert(std::make_pair(LLWearableType::WT_PHYSICS, "physics_not_worn")); return w_map; } diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 71aba2ad75..671b889323 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -353,14 +353,19 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) setStarBrightness((1 - weight) * (F32) src.getStarBrightness() + weight * (F32) dest.getStarBrightness()); - llassert(src.getSunAngle() >= - F_PI && - src.getSunAngle() <= 3 * F_PI); - llassert(dest.getSunAngle() >= - F_PI && - dest.getSunAngle() <= 3 * F_PI); - llassert(src.getEastAngle() >= 0 && - src.getEastAngle() <= 4 * F_PI); - llassert(dest.getEastAngle() >= 0 && - dest.getEastAngle() <= 4 * F_PI); + // FIXME: we have established that this assert fails + // frequently. Someone who understands the code needs to figure + // out if it matters. In the meantime, disabling the checks so we + // can stop interfering with other development. + + //llassert(src.getSunAngle() >= - F_PI && + // src.getSunAngle() <= 3 * F_PI); + //llassert(dest.getSunAngle() >= - F_PI && + // dest.getSunAngle() <= 3 * F_PI); + //llassert(src.getEastAngle() >= 0 && + // src.getEastAngle() <= 4 * F_PI); + //llassert(dest.getEastAngle() >= 0 && + // dest.getEastAngle() <= 4 * F_PI); // sun angle and east angle require some handling to make sure // they go in circles. Yes quaternions would work better. diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index c54ec7f897..c15cab4183 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -774,28 +774,10 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe } LLViewerRegion* regionp = getRegionFromPosGlobal(start_pos); -// FIRE-21915: Fix bogus avatar movement on region crossing - //if (!regionp) - //{ - // return start_pos; - //} - bool clipped = false; // sink, unused - return clipToRegion(regionp, start_pos, end_pos, clipped); // use common fn for clipping to region -} - -// Clip to region, using a point along the line start_pos .. end_pos. -// If start_pos is outside the region, use start_pos. -LLVector3d LLWorld::clipToRegion(const LLViewerRegion* regionp, const LLVector3d &start_pos, const LLVector3d &end_pos, bool &clipped) -{ - static LLCachedControl fsExperimentalRegionCrossingMovementFix(gSavedSettings, "FSExperimentalRegionCrossingMovementFix"); - - clipped = false; // no clipping yet - if (!regionp) // no region. We're lost + if (!regionp) { - clipped = true; // very bad return start_pos; } -// LLVector3d delta_pos = end_pos - start_pos; LLVector3d delta_pos_abs; @@ -803,22 +785,8 @@ LLVector3d LLWorld::clipToRegion(const LLViewerRegion* regionp, const LLVector3d delta_pos_abs.abs(); LLVector3 region_coord = regionp->getPosRegionFromGlobal(end_pos); - // FIRE-21915: Fix bogus avatar movement on region crossing - //F64 clip_factor = 1.0; - LLVector3 region_coord_start = regionp->getPosRegionFromGlobal(start_pos); - F64 clip_factor = 0.0; // zero means no cli - // + F64 clip_factor = 1.0; F32 region_width = regionp->getWidth(); - // FIRE-21915: Fix bogus avatar movement on region crossing - if (fsExperimentalRegionCrossingMovementFix == 1 && - (region_coord_start.mV[VX] < 0.f || region_coord_start.mV[VX] > region_width - || region_coord_start.mV[VY] < 0.f || region_coord_start.mV[VY] > region_width)) - { - clip_factor = 1.0; // start pos outside region, use start pos - } - else // clip to region along line from start pos to end po - { - // if (region_coord.mV[VX] < 0.f) { if (region_coord.mV[VY] < region_coord.mV[VX]) @@ -855,59 +823,15 @@ LLVector3d LLWorld::clipToRegion(const LLViewerRegion* regionp, const LLVector3d // clip along y + clip_factor = (region_coord.mV[VY] - region_width) / delta_pos_abs.mdV[VY]; } - // FIRE-21915: Fix bogus avatar movement on region crossing - if (!std::isfinite(clip_factor)) - { - clip_factor = 0.0; // avoid NaN problems - } - else - { - clip_factor = llclamp(clip_factor, 0.0, 1.0); // avoid overflow problem - } - } - // - // FIRE-21915: Fix bogus avatar movement on region crossing - //// clamp to within region dimensions - //LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); - //final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0, - // (F64)(region_width - F_ALMOST_ZERO)); - //final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0, - // (F64)(region_width - F_ALMOST_ZERO)); - //final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, - // (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO)); - - LLVector3d final_region_pos; - if (fsExperimentalRegionCrossingMovementFix == 1) - { - // True if clipped. Caller needs to know, because it will kill velocity if there's clipping - // Don't do this by comparing floating point numbers for equality. That has roundoff problems. - clipped = clip_factor > F_ALMOST_ZERO; // clipped in X or Y - final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); - clipped |= final_region_pos.mdV[VX] < -F_ALMOST_ZERO || final_region_pos.mdV[VX] > (F64)(region_width - F_ALMOST_ZERO); - clipped |= final_region_pos.mdV[VY] < -F_ALMOST_ZERO || final_region_pos.mdV[VY] > (F64)(region_width - F_ALMOST_ZERO); - clipped |= final_region_pos.mdV[VZ] < -F_ALMOST_ZERO || final_region_pos.mdV[VZ] > (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO); // if actually clipping - // Final sanity check - don't allow positions more than clamp_range out of region. - F64 clamp_range = region_width / 2.0; // half a region width - final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], -clamp_range, - (F64)(region_width + clamp_range)); - final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], -clamp_range, - (F64)(region_width + clamp_range)); - final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, - (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO)); - } - else - { - // clamp to within region dimensions - final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); - final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0, - (F64)(region_width - F_ALMOST_ZERO)); - final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0, - (F64)(region_width - F_ALMOST_ZERO)); - final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, - (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO)); - } - // + // clamp to within region dimensions + LLVector3d final_region_pos = LLVector3d(region_coord) - (delta_pos * clip_factor); + final_region_pos.mdV[VX] = llclamp(final_region_pos.mdV[VX], 0.0, + (F64)(region_width - F_ALMOST_ZERO)); + final_region_pos.mdV[VY] = llclamp(final_region_pos.mdV[VY], 0.0, + (F64)(region_width - F_ALMOST_ZERO)); + final_region_pos.mdV[VZ] = llclamp(final_region_pos.mdV[VZ], 0.0, + (F64)(LLWorld::getInstance()->getRegionMaxHeight() - F_ALMOST_ZERO)); return regionp->getPosGlobalFromRegion(LLVector3(final_region_pos)); } diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 43ba91b8c6..aff8e4aa45 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -84,7 +84,6 @@ public: LLViewerRegion* getRegionFromID(const LLUUID& region_id); BOOL positionRegionValidGlobal(const LLVector3d& pos); // true if position is in valid region LLVector3d clipToVisibleRegions(const LLVector3d &start_pos, const LLVector3d &end_pos); - LLVector3d clipToRegion(const LLViewerRegion* regionp, const LLVector3d &start_pos, const LLVector3d &end_pos, bool &clipped); // clip to specified region // FIRE-21915: Fix bogus avatar movement on region crossing void updateAgentOffset(const LLVector3d &offset); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 398f85a765..62b41bac04 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1062,7 +1062,6 @@ void LLWorldMapView::drawFrustum() F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * LLUI::getScaleFactor().mV[VX]); F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * LLUI::getScaleFactor().mV[VY]); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Since we don't rotate the map, we have to rotate the frustum. diff --git a/indra/newview/sanitycheck.cpp b/indra/newview/sanitycheck.cpp index 547503d7b0..6044e36bf4 100644 --- a/indra/newview/sanitycheck.cpp +++ b/indra/newview/sanitycheck.cpp @@ -22,11 +22,14 @@ #include "llviewerprecompiledheaders.h" #include "llcontrol.h" +#include "llnotifications.h" #include "llnotificationsutil.h" #include "lltrans.h" #include "llviewercontrol.h" #include "sanitycheck.h" +#define SANITY_CHECK "SanityCheck" // name of the notification we display + void SanityCheck::init() { struct f : public LLControlGroup::ApplyFunctor @@ -37,7 +40,7 @@ void SanityCheck::init() { if (control->getSanityType() != SANITY_TYPE_NONE) { - control->getSanitySignal()->connect(boost::bind(&SanityCheck::onSanity, _1)); + control->getSanitySignal()->connect(boost::bind(&SanityCheck::onSanity, _1, false)); SanityCheck::instance().onSanity(control); } } @@ -48,19 +51,28 @@ void SanityCheck::init() } // static -void SanityCheck::onSanity(LLControlVariable* controlp) +void SanityCheck::onSanity(LLControlVariable* controlp, bool disregardLastControl /*= false*/) { - static LLControlVariable* lastControl = NULL; + static LLControlVariable* lastControl = nullptr; if (controlp->isSane()) + { return; + } - if (controlp == lastControl) + if (disregardLastControl) + { + // clear "ignored" status for this control, so it can actually show up + LLNotifications::instance().setIgnored(SANITY_CHECK, false); + } + else if (controlp == lastControl) + { return; + } lastControl = controlp; - std::string checkType = "SanityCheck" + LLControlGroup::sanityTypeEnumToString(controlp->getSanityType()); + std::string checkType = SANITY_CHECK + LLControlGroup::sanityTypeEnumToString(controlp->getSanityType()); std::vector sanityValues = controlp->getSanityValues(); LLSD args; @@ -71,7 +83,7 @@ void SanityCheck::onSanity(LLControlVariable* controlp) args["SANITY_MESSAGE"] = LLTrans::getString(checkType, map); args["SANITY_COMMENT"] = controlp->getSanityComment(); args["CURRENT_VALUE"] = controlp->getValue().asString(); - LLNotificationsUtil::add("SanityCheck", args, LLSD(), boost::bind(SanityCheck::onFixIt, _1, _2, controlp)); + LLNotificationsUtil::add(SANITY_CHECK, args, LLSD(), boost::bind(SanityCheck::onFixIt, _1, _2, controlp)); } void SanityCheck::onFixIt(const LLSD& notification, const LLSD& response, LLControlVariable* controlp) diff --git a/indra/newview/sanitycheck.h b/indra/newview/sanitycheck.h index d2faf23ea8..c5c66b6cb3 100644 --- a/indra/newview/sanitycheck.h +++ b/indra/newview/sanitycheck.h @@ -34,7 +34,7 @@ class SanityCheck : public LLSingleton public: void init(); - static void onSanity(LLControlVariable* controlp); + static void onSanity(LLControlVariable* controlp, bool disregardLastControl = false); static void onFixIt(const LLSD& notification, const LLSD& response, LLControlVariable* controlp); }; diff --git a/indra/newview/skins/ansastorm/textures/textures.xml b/indra/newview/skins/ansastorm/textures/textures.xml index ad8fc4ce4a..4bb82bcb0b 100644 --- a/indra/newview/skins/ansastorm/textures/textures.xml +++ b/indra/newview/skins/ansastorm/textures/textures.xml @@ -31,6 +31,7 @@ + diff --git a/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml b/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml index ce9c792683..1d0b7b0648 100644 --- a/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml +++ b/indra/newview/skins/ansastorm/xui/de/panel_main_inventory.xml @@ -38,7 +38,8 @@ - + + diff --git a/indra/newview/skins/ansastorm/xui/en/panel_edit_tattoo.xml b/indra/newview/skins/ansastorm/xui/en/panel_edit_tattoo.xml index 88c97dba08..fce4f91d71 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_edit_tattoo.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_edit_tattoo.xml @@ -1,85 +1,95 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/ansastorm/xui/en/panel_edit_universal.xml b/indra/newview/skins/ansastorm/xui/en/panel_edit_universal.xml new file mode 100644 index 0000000000..7c482f5ec3 --- /dev/null +++ b/indra/newview/skins/ansastorm/xui/en/panel_edit_universal.xml @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/ansastorm/xui/en/panel_edit_wearable.xml b/indra/newview/skins/ansastorm/xui/en/panel_edit_wearable.xml index 8a7e3ee4b8..f9bcce6b85 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_edit_wearable.xml @@ -71,6 +71,10 @@ name="edit_tattoo_title"> Editing Tattoo + + Editing Universal + Editing Physics @@ -135,6 +139,10 @@ name="tattoo_desc_text"> Tattoo: + + Universal: + Physics: @@ -418,6 +426,16 @@ top="8" visible="false" width="410" /> + + + + diff --git a/indra/newview/skins/default/textures/icons/Inv_Universal.png b/indra/newview/skins/default/textures/icons/Inv_Universal.png new file mode 100644 index 0000000000..470febb9b5 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Universal.png differ diff --git a/indra/newview/skins/default/textures/legacy/inv_item_universal.tga b/indra/newview/skins/default/textures/legacy/inv_item_universal.tga new file mode 100644 index 0000000000..f14af8a3cc Binary files /dev/null and b/indra/newview/skins/default/textures/legacy/inv_item_universal.tga differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1dd5fe7d73..3cb7dae535 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -333,6 +333,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/xui/da/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/da/panel_edit_tattoo.xml index d4a12209db..9b97a4edab 100644 --- a/indra/newview/skins/default/xui/da/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/da/panel_edit_tattoo.xml @@ -1,9 +1,11 @@ - - - - - - + + + + + + + + diff --git a/indra/newview/skins/default/xui/de/floater_ban_duration.xml b/indra/newview/skins/default/xui/de/floater_ban_duration.xml index e7b2fbaa36..2c24b55a11 100644 --- a/indra/newview/skins/default/xui/de/floater_ban_duration.xml +++ b/indra/newview/skins/default/xui/de/floater_ban_duration.xml @@ -1,4 +1,4 @@ - + Verbannungsdauer: diff --git a/indra/newview/skins/default/xui/de/floater_profile_view.xml b/indra/newview/skins/default/xui/de/floater_fs_profile_view.xml similarity index 100% rename from indra/newview/skins/default/xui/de/floater_profile_view.xml rename to indra/newview/skins/default/xui/de/floater_fs_profile_view.xml diff --git a/indra/newview/skins/default/xui/de/menu_inventory.xml b/indra/newview/skins/default/xui/de/menu_inventory.xml index a3dba2c65d..f1af6dc732 100644 --- a/indra/newview/skins/default/xui/de/menu_inventory.xml +++ b/indra/newview/skins/default/xui/de/menu_inventory.xml @@ -34,6 +34,7 @@ + diff --git a/indra/newview/skins/default/xui/de/menu_inventory_add.xml b/indra/newview/skins/default/xui/de/menu_inventory_add.xml index 33cc7ac30e..95981478aa 100644 --- a/indra/newview/skins/default/xui/de/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/de/menu_inventory_add.xml @@ -23,8 +23,9 @@ - + + diff --git a/indra/newview/skins/default/xui/de/menu_outfit_gear.xml b/indra/newview/skins/default/xui/de/menu_outfit_gear.xml index fdbd8b974d..dc375b3070 100644 --- a/indra/newview/skins/default/xui/de/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/de/menu_outfit_gear.xml @@ -17,9 +17,10 @@ - + + diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index 88a0a483dd..5f519f7995 100644 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -626,6 +626,7 @@ + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index f4b3e8f6c8..2f9f1c3aad 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -5119,7 +5119,7 @@ Export unerwartet fehlgeschlagen. Siehe Log-Datei für weitergehende Details. -[OBJECT] erfolreich als [FILENAME] gespeichert. +[OBJECT] erfolgreich als [FILENAME] gespeichert. diff --git a/indra/newview/skins/default/xui/de/panel_edit_tattoo.xml b/indra/newview/skins/default/xui/de/panel_edit_tattoo.xml index 075a9d752a..3cf2d0f5ac 100644 --- a/indra/newview/skins/default/xui/de/panel_edit_tattoo.xml +++ b/indra/newview/skins/default/xui/de/panel_edit_tattoo.xml @@ -1,9 +1,19 @@ - - - - - - + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/de/panel_edit_universal.xml b/indra/newview/skins/default/xui/de/panel_edit_universal.xml new file mode 100644 index 0000000000..e2f819ceb6 --- /dev/null +++ b/indra/newview/skins/default/xui/de/panel_edit_universal.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/de/panel_edit_wearable.xml b/indra/newview/skins/default/xui/de/panel_edit_wearable.xml index bd1edda808..7f40f014ce 100644 --- a/indra/newview/skins/default/xui/de/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/de/panel_edit_wearable.xml @@ -45,6 +45,9 @@ Tätowierung bearbeiten + + Universal bearbeiten + Physik bearbeiten @@ -93,6 +96,9 @@ Tätowierung: + + Universal: + Physik: diff --git a/indra/newview/skins/default/xui/de/panel_profile_classified.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_classified.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_classified.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_classified.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_firstlife.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_firstlife.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_firstlife.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_firstlife.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_interests.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_interests.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_interests.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_interests.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_notes.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_notes.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_notes.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_notes.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_pick.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_pick.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_pick.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_pick.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_picks.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_picks.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_picks.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_picks.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_secondlife.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_secondlife.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_secondlife.xml diff --git a/indra/newview/skins/default/xui/de/panel_profile_web.xml b/indra/newview/skins/default/xui/de/panel_fs_profile_web.xml similarity index 100% rename from indra/newview/skins/default/xui/de/panel_profile_web.xml rename to indra/newview/skins/default/xui/de/panel_fs_profile_web.xml diff --git a/indra/newview/skins/default/xui/de/panel_tools_texture.xml b/indra/newview/skins/default/xui/de/panel_tools_texture.xml index da344ec6f2..25155022ac 100644 --- a/indra/newview/skins/default/xui/de/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/de/panel_tools_texture.xml @@ -118,6 +118,7 @@ -