diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 9adeb27c8f..db6bb03a52 100644
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -24,7 +24,12 @@ endif (NOT CMAKE_BUILD_TYPE)
option(OPENSIM "OpenSim support" OFF)
if (OPENSIM)
add_definitions(-DOPENSIM=1)
- message("compiling with OpenSim support")
+ if (SINGLEGRID)
+ add_definitions(-DSINGLEGRID=1 -DSINGLEGRID_URI=\"${SINGLEGRID_URI}\")
+ message("compiling with OpenSim support - Single Grid version (${SINGLEGRID_URI})")
+ else (SINGLEGRID)
+ message("compiling with OpenSim support")
+ endif (SINGLEGRID)
else (OPENSIM)
message("compiling without OpenSim support")
endif (OPENSIM)
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index bd708a95d8..b9961040ee 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -950,6 +950,7 @@ namespace LLError
namespace
{
+ /* Hide the log sanitize function so gcc doesnt complain.
void addEscapedMessage(std::ostream& out, const std::string& message)
{
size_t written_out = 0;
@@ -987,7 +988,7 @@ namespace
// write whatever was left
out << message.substr(written_out, std::string::npos);
}
- }
+ } */
void writeToRecorders(const LLError::CallSite& site, const std::string& escaped_message, bool show_location = true, bool show_time = true, bool show_tags = true, bool show_level = true, bool show_function = true)
{
@@ -1259,7 +1260,10 @@ namespace LLError
}
}
- addEscapedMessage(message_stream, message);
+ // Fix log output - we don't need an escaped output
+ //addEscapedMessage(message_stream, message);
+ message_stream << message;
+ //
std::string message_line(message_stream.str());
writeToRecorders(site, message_line);
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index 6b166769c1..69d05afafd 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -386,7 +386,9 @@ boolean LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )
{
self->setLastError("Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )");
LLTHROW(LLContinueError("Out of memory in LLImageJPEG::encodeEmptyOutputBuffer( j_compress_ptr cinfo )"));
- return false;
+ // Fix unreachable code
+ // return false;
+ //
}
memcpy( new_buffer, self->mOutputBuffer, self->mOutputBufferSize ); /* Flawfinder: ignore */
delete[] self->mOutputBuffer;
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5ed735e7eb..e19701e9bb 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -24769,6 +24769,17 @@ Change of this parameter will affect the layout of buttons in notification toast
Value
1
+ FSUseReadOfflineMsgsCap
+
diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp
index 4d14e46566..befe182bda 100644
--- a/indra/newview/fsgridhandler.cpp
+++ b/indra/newview/fsgridhandler.cpp
@@ -179,16 +179,20 @@ void LLGridManager::initGrids()
{
mGridList = LLSD();
+#ifndef SINGLEGRID
std::string grid_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "grids.xml");
std::string grid_user_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids.user.xml");
std::string grid_remote_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids.remote.xml");
mGridFile = grid_user_file;
+#endif
initSystemGrids();
+#ifndef SINGLEGRID
initGridList(grid_file, FINISH);
initGridList(grid_remote_file, FINISH);
initGridList(grid_user_file, FINISH);
+#endif
if(!mCommandLineDone)
{
@@ -263,6 +267,7 @@ void LLGridManager::initCmdLineGrids()
// set it as the 'selected' grid.
std::string grid;
+#ifndef SINGLEGRID
std::string cmd_line_grid = gSavedSettings.getString("CmdLineGridChoice");
if (!cmd_line_grid.empty())
{
@@ -294,7 +299,8 @@ void LLGridManager::initCmdLineGrids()
grid = gSavedSettings.getString("CurrentGrid");
LL_DEBUGS("GridManager") << "Setting grid from last selection " << grid << LL_ENDL;
}
-
+#endif
+
if (grid.empty())
{
// no grid was specified so default to maingrid
@@ -1290,6 +1296,7 @@ void LLGridManager::saveGridList()
LLSDSerialize::toPrettyXML(output_grid_list, llsd_xml);
llsd_xml.close();
}
+
//
std::string LLGridManager::trimHypergrid(const std::string& trim)
{
diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h
index 330e11bfa3..1b1e8ad21f 100644
--- a/indra/newview/fsgridhandler.h
+++ b/indra/newview/fsgridhandler.h
@@ -30,6 +30,7 @@
#define FS_GRIDHANDLER_H
#include "../llxml/llxmlnode.h"
+#include "llsingleton.h"
#include
#include
diff --git a/indra/newview/fspanellogin.cpp b/indra/newview/fspanellogin.cpp
index 61b698c746..f262733a71 100644
--- a/indra/newview/fspanellogin.cpp
+++ b/indra/newview/fspanellogin.cpp
@@ -227,6 +227,9 @@ FSPanelLogin::FSPanelLogin(const LLRect &rect,
LLComboBox* server_choice_combo = getChild("server_combo");
server_choice_combo->setCommitCallback(boost::bind(&FSPanelLogin::onSelectServer, this));
+#ifdef SINGLEGRID
+ server_choice_combo->setEnabled(FALSE);
+#endif
updateServer();
if(LLStartUp::getStartSLURL().getType() != LLSLURL::LOCATION)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index dd8835fc31..2da5396914 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3470,6 +3470,12 @@ void LLAppViewer::initStrings()
// translation strings into this one.
LLTrans::setDefaultArg(brackets, LLTrans::getString(nobrackets));
}
+
+ // Set version number in VIEWER_GENERATION default substitute automatically
+ LLStringUtil:: format_map_t gen_args;
+ gen_args["[VERSION]"] = llformat("%d", LLVersionInfo::getMajor());
+ LLTrans::setDefaultArg("[VIEWER_GENERATION]", LLTrans::getString("VIEWER_GENERATION", gen_args));
+ //
}
//
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 74b5c68814..480675389b 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -726,7 +726,7 @@ BOOL LLFloaterPreference::postBuild()
// [/SL:KB]
//
-#ifndef OPENSIM//
+#if !defined(OPENSIM) || defined(SINGLEGRID)//
// Hide the opensim tab if opensim isn't enabled
LLTabContainer* tab_container = getChild("pref core");
if (tab_container)
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index aedf31f2cf..c990437e9f 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -2120,6 +2120,7 @@ void LLIMProcessing::requestOfflineMessages()
// to build a correct name. Likewise, inventory offers from
// muted avatars require the mute list to properly mute.
if (cap_url.empty()
+ || gSavedSettings.getBOOL("FSUseReadOfflineMsgsCap") // Optional legacy offline messages
|| gAgent.getRegionCapability("AcceptFriendship").empty()
|| gAgent.getRegionCapability("AcceptGroupInvite").empty())
{
diff --git a/indra/newview/llphysicsshapebuilderutil.cpp b/indra/newview/llphysicsshapebuilderutil.cpp
index 3aff67b90b..676f79f3a5 100644
--- a/indra/newview/llphysicsshapebuilderutil.cpp
+++ b/indra/newview/llphysicsshapebuilderutil.cpp
@@ -29,7 +29,10 @@
#include "llphysicsshapebuilderutil.h"
/* static */
-void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut )
+// FIRE-23053 - analysed mesh physics is not correctly displayed for thin meshes
+//void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut )
+void LLPhysicsShapeBuilderUtil::determinePhysicsShape(const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, bool hasDecomp, PhysicsShapeSpecification& specOut)
+//
{
const LLProfileParams& profile_params = volume_params.getProfileParams();
const LLPathParams& path_params = volume_params.getPathParams();
@@ -203,7 +206,9 @@ void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumePara
{
// [BUG-134006] Viewer code is not aligned to server code when calculating physics shape for thin objects.
specOut.mType = PhysicsShapeSpecification::INVALID;
- if (volume_params.isMeshSculpt()){
+ // FIRE-23053 - add decomp check analysed mesh physics is not correctly displayed for thin meshes
+ // if (volume_params.isMeshSculpt()){
+ if (volume_params.isMeshSculpt() && !hasDecomp){
static const float SHAPE_BUILDER_CONVEXIFICATION_SIZE_MESH = 0.5;
// it's a mesh and only one size is smaller than min.
for (S32 i = 0; i < 3; ++i)
diff --git a/indra/newview/llphysicsshapebuilderutil.h b/indra/newview/llphysicsshapebuilderutil.h
index bd5b7d799c..59375b866e 100644
--- a/indra/newview/llphysicsshapebuilderutil.h
+++ b/indra/newview/llphysicsshapebuilderutil.h
@@ -133,8 +133,10 @@ public:
// Offset of shape from origin of primitive's reference frame
LLVector3 mCenter;
};
-
- static void determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut );
+ // FIRE-23053 - analysed mesh physics is not correctly displayed for thin meshes
+ // static void determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut );
+ static void determinePhysicsShape(const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, bool hasDecomp, PhysicsShapeSpecification& specOut);
+ //
};
#endif //LL_PHYSICS_SHAPE_BUILDER_H
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 0014d7a620..990a146e1a 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2378,7 +2378,22 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
physics_type == LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec;
- LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, volume->getScale(), physics_spec);
+
+ // FIRE-23053 Physics shape display fixes
+ // LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, volume->getScale(), physics_spec);
+ LLUUID mesh_id;
+ LLModel::Decomposition* decomp = nullptr;
+ bool hasConvexDecomp = FALSE;
+
+ // If we are a mesh and the mesh has a hul decomp (is analysed) then set hasDecomp to true
+ if (volume->isMesh()){
+ mesh_id = volume_params.getSculptID();
+ decomp = gMeshRepo.getDecomposition(mesh_id);
+ if (decomp && !decomp->mHull.empty()){ hasConvexDecomp = TRUE; }
+ }
+
+ LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, volume->getScale(), hasConvexDecomp, physics_spec);
+ //
U32 type = physics_spec.getType();
@@ -2390,9 +2405,11 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
{
- LLUUID mesh_id = volume->getVolume()->getParams().getSculptID();
- LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
-
+ // FIRE-23053 Physics shape display fixes
+ //LLUUID mesh_id = volume->getVolume()->getParams().getSculptID();
+ //LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
+ //
+
if (decomp)
{ //render a physics based mesh
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 30bf125e12..cd3adf262d 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -893,6 +893,7 @@ bool idle_startup()
//
//
+#ifndef SINGLEGRID
if(!gSavedSettings.getBOOL("GridListDownload"))
{
sGridListRequestReady = true;
@@ -912,6 +913,10 @@ bool idle_startup()
std::string url = gSavedSettings.getString("GridListDownloadURL");
FSCoreHttpUtil::callbackHttpGet(url, last_modified, boost::bind(downloadGridlistComplete, _1), boost::bind(downloadGridlistError, _1, url));
}
+#else
+ sGridListRequestReady = true;
+#endif
+
#ifdef OPENSIM //
// Fetch grid infos as needed
LLGridManager::getInstance()->initGrids();
@@ -1654,7 +1659,7 @@ bool idle_startup()
// This call to LLLoginInstance::connect() starts the
// authentication process.
login->connect(gUserCredential);
-#ifdef OPENSIM //
+#if defined(OPENSIM) && !defined(SINGLEGRID) //
//
LLGridManager::getInstance()->saveGridList();
//
diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h
index a335f2b48a..02de79b263 100644
--- a/indra/newview/llviewernetwork.h
+++ b/indra/newview/llviewernetwork.h
@@ -32,7 +32,11 @@ const std::string SECOND_LIFE_MAIN_LABEL = "Second Life";
const std::string SECOND_LIFE_BETA_LABEL = "Second Life Beta";
// @TODO this really should be private, but is used in llslurl
+#if defined(OPENSIM) && defined(SINGLEGRID)
+const std::string MAINGRID = SINGLEGRID_URI;
+#else
const std::string MAINGRID = "util.agni.lindenlab.com";
+#endif
//
#ifdef OPENSIM
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 1625f9e88d..9b82eeda11 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4193,8 +4193,7 @@ void renderHullPhysics(LLModel::PhysicsMesh& mesh, const LLColor4& color, const
// Draw a physics shape with the edges highlighted in 'line_color'
void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_color, LLVolume* vol, LLModel::Decomposition * decomp)
{
- // TODO: Didn't we already disable this in the outer scope?
- //Need to because crash on ATI 3800 (and similar cards) MAINT-5018
+// Not required here, we already disable this in the outer scope
// LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
@@ -4321,6 +4320,140 @@ void renderMeshPhysicsTriangles(const LLColor4& color, const LLColor4& line_colo
}
}
+void renderNonMeshHullPhysics(LLVOVolume* vovolume, LLVolume* volume, LLColor4 color, LLColor4 line_color, LLVector3 center, LLVector3 size)
+{
+ LLVolumeParams volume_params = volume->getParams();
+ S32 detail = get_physics_detail(volume_params, vovolume->getScale());
+
+ LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
+
+ if (!phys_volume->mHullPoints)
+ { //build convex hull
+ std::vector pos;
+ std::vector index;
+
+ S32 index_offset = 0;
+ // Build a vector of vertices in the visible LOD model determined by 'detail'
+ for (S32 i = 0; i < phys_volume->getNumVolumeFaces(); ++i)
+ {
+ const LLVolumeFace& face = phys_volume->getVolumeFace(i);
+ if (index_offset + face.mNumVertices > 65535)
+ {
+ continue;
+ }
+
+ for (S32 j = 0; j < face.mNumVertices; ++j)
+ {
+ pos.push_back(LLVector3(face.mPositions[j].getF32ptr()));
+ }
+
+ for (S32 j = 0; j < face.mNumIndices; ++j)
+ {
+ index.push_back(face.mIndices[j] + index_offset);
+ }
+
+ index_offset += face.mNumVertices;
+ }
+ // use the array of vertices to construct a single hull based
+ if (!pos.empty() && !index.empty() && LLConvexDecomposition::getInstance()) // ND: FIRE-3427
+ {
+ LLCDMeshData mesh;
+ mesh.mIndexBase = &index[0];
+ mesh.mVertexBase = pos[0].mV;
+ mesh.mNumVertices = pos.size();
+ mesh.mVertexStrideBytes = 12;
+ mesh.mIndexStrideBytes = 6;
+ mesh.mIndexType = LLCDMeshData::INT_16;
+
+ mesh.mNumTriangles = index.size() / 3;
+
+ LLCDMeshData res;
+ LLCDResult retval;
+ if ((retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res)))
+ {
+ LL_WARNS() << "ConvexDecomp Failed (generateSingleHullMeshFromMesh): " << retval << LL_ENDL;
+ }
+
+ //copy res into phys_volume
+ phys_volume->mHullPoints = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices);
+ phys_volume->mNumHullPoints = res.mNumVertices;
+
+ S32 idx_size = (res.mNumTriangles * 3 * 2 + 0xF) & ~0xF;
+ phys_volume->mHullIndices = (U16*)ll_aligned_malloc_16(idx_size);
+ phys_volume->mNumHullIndices = res.mNumTriangles * 3;
+
+ const F32* v = res.mVertexBase;
+
+ for (S32 i = 0; i < res.mNumVertices; ++i)
+ {
+ F32* p = (F32*)((U8*)v + i*res.mVertexStrideBytes);
+ phys_volume->mHullPoints[i].load3(p);
+ }
+
+ if (res.mIndexType == LLCDMeshData::INT_16)
+ {
+ for (S32 i = 0; i < res.mNumTriangles; ++i)
+ {
+ U16* idx = (U16*)(((U8*)res.mIndexBase) + i*res.mIndexStrideBytes);
+
+ phys_volume->mHullIndices[i * 3 + 0] = idx[0];
+ phys_volume->mHullIndices[i * 3 + 1] = idx[1];
+ phys_volume->mHullIndices[i * 3 + 2] = idx[2];
+ }
+ }
+ else
+ {
+ for (S32 i = 0; i < res.mNumTriangles; ++i)
+ {
+ U32* idx = (U32*)(((U8*)res.mIndexBase) + i*res.mIndexStrideBytes);
+
+ phys_volume->mHullIndices[i * 3 + 0] = (U16)idx[0];
+ phys_volume->mHullIndices[i * 3 + 1] = (U16)idx[1];
+ phys_volume->mHullIndices[i * 3 + 2] = (U16)idx[2];
+ }
+ }
+ }
+ }
+ //pragma endregion Build the mesh data for a convex hull for a PRIM that is explcitly in CONVEX_HULL mode
+ // Now that we've got the hulldecomp let's draw it
+
+ // Crash fix due to invalid calls to drawElements by Drake Arconis
+ //if (phys_volume->mHullPoints)
+ if (phys_volume->mHullPoints && phys_volume->mHullIndices && phys_volume->mNumHullPoints > 0 && phys_volume->mNumHullIndices > 0)
+ //pragma region ConvexPrimDrawHull
+ //
+ {
+ //render hull
+ // TODO: (BEQ) Find out why is this not a call to render_hull? it probably could be if the data is in the right form
+
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ gGL.diffuseColor4fv(line_color.mV);
+ LLVertexBuffer::unbind();
+
+ llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
+
+ // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
+ //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+ LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+
+ gGL.diffuseColor4fv(color.mV);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
+ //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+ LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
+
+ }
+ else
+ {
+ // if we don't have a physics convex model then draw a magenta box
+ gGL.diffuseColor4f(1, 0, 1, 1);
+ drawBoxOutline(center, size);
+ }
+ //pragma endregion
+ LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
+}
+
void renderOnePhysicsShape(LLViewerObject* objectp)
{
// sanity check this we have a drawable.
@@ -4357,9 +4490,20 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
// Set physics_spec to cache the info about the physics shape of our volume.
LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification physics_spec;
- LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, vovolume->getScale(), physics_spec);
+ LLUUID mesh_id;
+ LLModel::Decomposition* decomp = nullptr;
+ bool hasConvexDecomp = FALSE;
- U32 type = physics_spec.getType();
+ // If we are a mesh and the mesh has a hul decomp (is analysed) then set hasDecomp to true
+ if (vovolume->isMesh()){
+ mesh_id = volume_params.getSculptID();
+ decomp = gMeshRepo.getDecomposition(mesh_id);
+ if (decomp && !decomp->mHull.empty()){ hasConvexDecomp = TRUE; }
+ }
+
+ LLPhysicsShapeBuilderUtil::determinePhysicsShape(physics_params, vovolume->getScale(), hasConvexDecomp, physics_spec);
+
+ U32 physicsShapeType = physics_spec.getType();
/*
Primitive types
BOX,
@@ -4385,7 +4529,6 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix);
}
- //gGL.pushMatrix();
gGL.multMatrix((F32*)vovolume->getRelativeXform().mMatrix);
//pragma region PhysicsRenderSettings
@@ -4419,26 +4562,19 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
LLVector3 center(0, 0, 0);
LLVector3 size(0.25f, 0.25f, 0.25f);
- if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
-//pragma region PhysicsShapeUserMesh
+ if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_MESH)
{
- // USER_MESH, A user mesh. May or may not contain a convex decomposition.
- LLUUID mesh_id = volume_params.getSculptID();
- LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
-
+ // USER_MESH, A user mesh. May or may not contain a convex decomposition.
// do we have a Mesh physics loaded yet?
if (decomp)
- {
-// TODO: REMOVE gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-
- if (!decomp->mHull.empty())
-//pragma region PhysicsShapeUserMeshHulls
- {
+ {
+ if (hasConvexDecomp) // analysed mesh - we will build a mesh representation and cache it in the mMesh vector
+ {
// This Model contains a hull based physics. This equates to "analysed" mesh physics in the uploader.
if (decomp->mMesh.empty())
{
// build a mesh representation of the hulls (does nothing if Havok not present)
- gMeshRepo.buildPhysicsMesh(*decomp);
+ gMeshRepo.buildPhysicsMesh(*decomp);
}
for (U32 i = 0; i < decomp->mMesh.size(); ++i)
@@ -4446,18 +4582,14 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
renderHullPhysics(decomp->mMesh[i], color, line_color);
}
}
-//pragma endregion Physics mesh is analysed into hulls
else if (!decomp->mPhysicsShapeMesh.empty())
-//pragma region PhysicsShapeUserMeshTriangles
{
// This model has triangular mesh (non-analysed)
renderMeshPhysicsTriangles(color, line_color, volume, decomp);
}
-//pragma endregion Physics mesh is non-analysed
else
- //no mesh or decomposition, render base hull
-//pragma region PhysicsShapeUserMeshBaseHull
- {
+ {
+ //no mesh or decomposition, render base hull
renderMeshBaseHullPhysics(vovolume, data_mask, color, line_color);
if (decomp->mPhysicsShapeMesh.empty())
@@ -4466,169 +4598,31 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
gMeshRepo.fetchPhysicsShape(mesh_id);
}
}
-//pragma endregion No physics mesh is defined so use the default base convex hull
}
else
-// No physics when expected, probably Havok broken/missing or asset still downloading
-//pragma region PhysicsShapeUserMeshMissingData
{
- // all else fails then orange wireframe box.
+ // No physics when expected, probably Havok broken/missing or asset still downloading
+ // all else fails then ORANGE wireframe box.
// This typically means you are running without Havok
gGL.diffuseColor3f(1, 1, 0);
drawBoxOutline(center, size);
}
-//pragma endregion No physics when expected, probably Havok broken/missing or asset still downloading
}
-//pragma endregion Object has a user provided mesh for physics and is not in CONVEX_HULL mode.
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_CONVEX ||
- type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
-//pragma region PhysicsShapeConvex
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::USER_CONVEX ||
+ physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
{
+ // the owner of the object has selected convex, or we have forced it convex for other reasons
if (vovolume->isMesh())
-//pragma region PhysicsShapeConvexMesh
{
renderMeshBaseHullPhysics(vovolume, data_mask, color, line_color);
}
-//pragma endregion This is a mesh object but the user has set it to Convex, so lets draw the base hull
else
-//pragma region PhysicsShapeConvexPrim
{
- LLVolumeParams volume_params = volume->getParams();
- S32 detail = get_physics_detail(volume_params, vovolume->getScale());
- LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
-//pragma region ConvexPrimBuildHull
- if (!phys_volume->mHullPoints)
- { //build convex hull
- std::vector pos;
- std::vector index;
-
- S32 index_offset = 0;
- // Build a vector of vertices in the visible LOD model determined by 'detail'
- for (S32 i = 0; i < phys_volume->getNumVolumeFaces(); ++i)
- {
- const LLVolumeFace& face = phys_volume->getVolumeFace(i);
- if (index_offset + face.mNumVertices > 65535)
- {
- continue;
- }
-
- for (S32 j = 0; j < face.mNumVertices; ++j)
- {
- pos.push_back(LLVector3(face.mPositions[j].getF32ptr()));
- }
-
- for (S32 j = 0; j < face.mNumIndices; ++j)
- {
- index.push_back(face.mIndices[j] + index_offset);
- }
-
- index_offset += face.mNumVertices;
- }
- // use the array of vertices to construct a single hull based
- if (!pos.empty() && !index.empty() && LLConvexDecomposition::getInstance()) // ND: FIRE-3427
- {
- LLCDMeshData mesh;
- mesh.mIndexBase = &index[0];
- mesh.mVertexBase = pos[0].mV;
- mesh.mNumVertices = pos.size();
- mesh.mVertexStrideBytes = 12;
- mesh.mIndexStrideBytes = 6;
- mesh.mIndexType = LLCDMeshData::INT_16;
-
- mesh.mNumTriangles = index.size() / 3;
-
- LLCDMeshData res;
- LLCDResult retval;
- if ((retval = LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh(&mesh, &res)))
- {
- LL_WARNS() << "ConvexDecomp Failed (generateSingleHullMeshFromMesh): " << retval << LL_ENDL;
- }
-
- //copy res into phys_volume
- phys_volume->mHullPoints = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices);
- phys_volume->mNumHullPoints = res.mNumVertices;
-
- S32 idx_size = (res.mNumTriangles * 3 * 2 + 0xF) & ~0xF;
- phys_volume->mHullIndices = (U16*)ll_aligned_malloc_16(idx_size);
- phys_volume->mNumHullIndices = res.mNumTriangles * 3;
-
- const F32* v = res.mVertexBase;
-
- for (S32 i = 0; i < res.mNumVertices; ++i)
- {
- F32* p = (F32*)((U8*)v + i*res.mVertexStrideBytes);
- phys_volume->mHullPoints[i].load3(p);
- }
-
- if (res.mIndexType == LLCDMeshData::INT_16)
- {
- for (S32 i = 0; i < res.mNumTriangles; ++i)
- {
- U16* idx = (U16*)(((U8*)res.mIndexBase) + i*res.mIndexStrideBytes);
-
- phys_volume->mHullIndices[i * 3 + 0] = idx[0];
- phys_volume->mHullIndices[i * 3 + 1] = idx[1];
- phys_volume->mHullIndices[i * 3 + 2] = idx[2];
- }
- }
- else
- {
- for (S32 i = 0; i < res.mNumTriangles; ++i)
- {
- U32* idx = (U32*)(((U8*)res.mIndexBase) + i*res.mIndexStrideBytes);
-
- phys_volume->mHullIndices[i * 3 + 0] = (U16)idx[0];
- phys_volume->mHullIndices[i * 3 + 1] = (U16)idx[1];
- phys_volume->mHullIndices[i * 3 + 2] = (U16)idx[2];
- }
- }
- }
- }
-//pragma endregion Build the mesh data for a convex hull for a PRIM that is explcitly in CONVEX_HULL mode
- // Now that we've got the hulldecomp let's draw it
-
- // Crash fix due to invalid calls to drawElements by Drake Arconis
- //if (phys_volume->mHullPoints)
- if (phys_volume->mHullPoints && phys_volume->mHullIndices && phys_volume->mNumHullPoints > 0 && phys_volume->mNumHullIndices > 0)
-//pragma region ConvexPrimDrawHull
- //
- {
- //render hull
- // TODO: (BEQ) Find out why is this not a call to render_hull? it probably could be if the data is in the right form
-
- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-
- gGL.diffuseColor4fv(line_color.mV);
- LLVertexBuffer::unbind();
-
- llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0);
-
- // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
- //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
- LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
-
- gGL.diffuseColor4fv(color.mV);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
- //LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
- LLVertexBuffer::drawElements(LLRender::TRIANGLES, phys_volume->mNumHullPoints, phys_volume->mHullPoints, NULL, phys_volume->mNumHullIndices, phys_volume->mHullIndices);
-
- }
- else
- {
- // if we don't have a physics convex model then draw a magenta box
- gGL.diffuseColor4f(1, 0, 1, 1);
- drawBoxOutline(center, size);
- }
-//pragma endregion
- LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
+ renderNonMeshHullPhysics(vovolume, volume, color, line_color, center, size);
}
-//pragma endregion The physics shape is a convex hull for a prim
}
-//pragma endregion The physics shape is a convex hull (mesh or prim)
-
-//pragma region PhysicsShapePrimHavokNative
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX)
+ // vvvv Physics shape is a Havok primitive, either box, sphere or cylinder (object must be a prim)
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::BOX)
{
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -4641,7 +4635,7 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
gGL.diffuseColor4fv(color.mV);
drawBox(center, scale);
}
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE)
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SPHERE)
{
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -4659,7 +4653,7 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
pushVerts(sphere);
LLPrimitive::sVolumeManager->unrefVolume(sphere);
}
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER)
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::CYLINDER)
{
LLGLEnable offset(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
@@ -4677,9 +4671,8 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
pushVerts(cylinder);
LLPrimitive::sVolumeManager->unrefVolume(cylinder);
}
-//pragma endregion Physics shape is a Havok primitive, either box, sphere or cylinder (object must be a prim)
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_MESH)
-//pragma region PhysicsShapePrimTriangles
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_MESH)
+ //PhysicsShapePrimTriangles - Physics shape for this prim is triangular mesh (typically when prim is cut/hollow etc)
{
LLVolumeParams volume_params = volume->getParams();
// TODO: (Beq) refactor? detail is reused, we ought to be able to pull this out in a wider scope.
@@ -4704,9 +4697,8 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
}
LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
}
-//pragma endregion Physics shape for this prim is triangular mesh (typically when prim is cut/hollow etc)
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
-//pragma region PhysicsShapePrimConvex
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::PRIM_CONVEX)
+ // PhysicsShapePrimConvex - Physics shape for prim is inherently convex or convexified due to scale
{
LLVolumeParams volume_params = volume->getParams();
S32 detail = get_physics_detail(volume_params, vovolume->getScale());
@@ -4714,7 +4706,7 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
LLVolume* phys_volume = LLPrimitive::sVolumeManager->refVolume(volume_params, detail);
if (phys_volume->mHullPoints && phys_volume->mHullIndices)
- // We have the huill details so just draw them
+ // We have the hull details so just draw them
{
// TODO: (Beq) refactor this!! yet another flavour of drawing the same crap. Can we ratioanlise the arguments
// Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr
@@ -4756,20 +4748,18 @@ void renderOnePhysicsShape(LLViewerObject* objectp)
}
LLPrimitive::sVolumeManager->unrefVolume(phys_volume);
}
-//pragma endregion Physics shape for prim is inherently convex or convexified due to scale
-//pragma region PhysicsShapeSculpt
- else if (type == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SCULPT)
+ // PhysicsShapeSculpt - Sculpts are not supported at present (what happened to "you must render something"?)
+ else if (physicsShapeType == LLPhysicsShapeBuilderUtil::PhysicsShapeSpecification::SCULPT)
{
//TODO: implement sculpted prim physics display
}
-//pragma endregion Sculpts are not supported at present (what happened to "you must render something"?)
else
{
LL_ERRS() << "Unhandled type" << LL_ENDL;
}
}
-//pragma endregion Firestorm additions that add the ability to visualise the physics shape in edit mode.
+// End Firestorm additions that add the ability to visualise the physics shape in edit mode.
// Physics display in edit mode changes
// Draws the selection outlines for the currently selected objects
@@ -4830,6 +4820,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
if (showPhysicsShapeInEdit)
{
+ // setup opengl common parameters before we iterate over each object
gGL.pushMatrix();
//Need to because crash on ATI 3800 (and similar cards) MAINT-5018
LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
@@ -4838,9 +4829,9 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
{
gDebugProgram.bind();
}
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- glClearColor(0, 0, 0, 0);
- gGL.setColorMask(true, true);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // no textures needed
+ glClearColor(0, 0, 0, 0); // bg black
+ gGL.setColorMask(true, true); // write color and alpha info
gGL.color4f(1.f, 1.f, 1.f, 0.5);
gGL.matrixMode(LLRender::MM_MODELVIEW);
LLGLEnable gls_blend(GL_BLEND);
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index ad86917a10..74d91ed87b 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -13,7 +13,7 @@
Second Life Support Portal
https://www.firestormviewer.org/downloads
- Viewer 5
+ Viewer [VERSION]
Detecting hardware...
diff --git a/indra/newview/skins/default/xui/pl/menu_people_nearby_view.xml b/indra/newview/skins/default/xui/pl/menu_people_nearby_view.xml
index 21adabd62e..31598f9b5a 100644
--- a/indra/newview/skins/default/xui/pl/menu_people_nearby_view.xml
+++ b/indra/newview/skins/default/xui/pl/menu_people_nearby_view.xml
@@ -3,6 +3,7 @@
+
diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml
index 2214bd372c..f6764e56e9 100644
--- a/indra/newview/skins/default/xui/pl/notifications.xml
+++ b/indra/newview/skins/default/xui/pl/notifications.xml
@@ -3304,6 +3304,9 @@ Zostaną zablokowane na kilka sekund dla bezpieczeństwa.
Błąd podczas zapisywania ustawienia [NAME].
+
+ Nie można zastąpić domyślnego ustawienia.
+
Błąd podczas usuwania ustawienia [NAME].