summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-19 11:48:33 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-19 11:48:33 -0400
commit8342d68ea9d668162bffb6e821c9d8f8d5683c10 (patch)
tree6450afad234b66c08e6e314a847edee1fb77bff2 /indra/newview
parent8c40e6f0a9e211ec22331385dc66b5ff5233859c (diff)
parent6d842ac0af814a088c56f437dc885e4ce58b61a8 (diff)
Merge branch 'develop' into frame-profile-json
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/gltfscenemanager.cpp59
-rw-r--r--indra/newview/llface.cpp8
-rw-r--r--indra/newview/llfloaterimagepreview.cpp28
-rw-r--r--indra/newview/llglsandbox.cpp120
-rw-r--r--indra/newview/llimprocessing.cpp2
-rw-r--r--indra/newview/llphysicsshapebuilderutil.cpp53
-rw-r--r--indra/newview/llphysicsshapebuilderutil.h2
-rw-r--r--indra/newview/llviewermedia.cpp14
-rw-r--r--indra/newview/llvoicewebrtc.cpp6
9 files changed, 128 insertions, 164 deletions
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index ce54fa4c12..ed66753267 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -371,43 +371,46 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id)
//static
void GLTFSceneManager::onGLTFBinLoadComplete(const LLUUID& id, LLAssetType::EType asset_type, void* user_data, S32 status, LLExtStat ext_status)
{
- LLViewerObject* obj = (LLViewerObject*)user_data;
- llassert(asset_type == LLAssetType::AT_GLTF_BIN);
-
- if (status == LL_ERR_NOERR)
- {
- if (obj)
+ LLAppViewer::instance()->postToMainCoro([=]()
{
- // find the Buffer with the given id in the asset
- if (obj->mGLTFAsset)
- {
- obj->mGLTFAsset->mPendingBuffers--;
-
+ LLViewerObject* obj = (LLViewerObject*)user_data;
+ llassert(asset_type == LLAssetType::AT_GLTF_BIN);
- if (obj->mGLTFAsset->mPendingBuffers == 0)
+ if (status == LL_ERR_NOERR)
+ {
+ if (obj)
{
- if (obj->mGLTFAsset->prep())
+ // find the Buffer with the given id in the asset
+ if (obj->mGLTFAsset)
{
- GLTFSceneManager& mgr = GLTFSceneManager::instance();
- if (std::find(mgr.mObjects.begin(), mgr.mObjects.end(), obj) == mgr.mObjects.end())
+ obj->mGLTFAsset->mPendingBuffers--;
+
+
+ if (obj->mGLTFAsset->mPendingBuffers == 0)
{
- GLTFSceneManager::instance().mObjects.push_back(obj);
+ if (obj->mGLTFAsset->prep())
+ {
+ GLTFSceneManager& mgr = GLTFSceneManager::instance();
+ if (std::find(mgr.mObjects.begin(), mgr.mObjects.end(), obj) == mgr.mObjects.end())
+ {
+ GLTFSceneManager::instance().mObjects.push_back(obj);
+ }
+ }
+ else
+ {
+ LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL;
+ obj->mGLTFAsset = nullptr;
+ }
}
}
- else
- {
- LL_WARNS("GLTF") << "Failed to prepare GLTF asset: " << id << LL_ENDL;
- obj->mGLTFAsset = nullptr;
- }
}
}
- }
- }
- else
- {
- LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
- obj->unref();
- }
+ else
+ {
+ LL_WARNS("GLTF") << "Failed to load GLTF asset: " << id << LL_ENDL;
+ obj->unref();
+ }
+ });
}
//static
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index ce68474211..297661effd 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -2268,6 +2268,14 @@ bool LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
center.mul(0.5f);
size.setSub(mRiggedExtents[1], mRiggedExtents[0]);
}
+ else if (mDrawablep && mVObjp.notNull() && mVObjp->getPartitionType() == LLViewerRegion::PARTITION_PARTICLE && mDrawablep->getSpatialGroup())
+ { // use box of spatial group for particles (over approximates size, but we don't actually have a good size per particle)
+ LLSpatialGroup* group = mDrawablep->getSpatialGroup();
+ const LLVector4a* extents = group->getExtents();
+ size.setSub(extents[1], extents[0]);
+ center.setAdd(extents[1], extents[0]);
+ center.mul(0.5f);
+ }
else
{
center.load3(getPositionAgent().mV);
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 236725bd45..989e1d8d04 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -288,18 +288,18 @@ void LLFloaterImagePreview::draw()
gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mBottom);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
- gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mBottom);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+ gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(mPreviewImageRect.mRight, mPreviewImageRect.mTop);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
}
gGL.end();
@@ -325,18 +325,18 @@ void LLFloaterImagePreview::draw()
gGL.begin(LLRender::TRIANGLES);
{
gGL.texCoord2f(0.f, 1.f);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(0.f, 0.f);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
gGL.texCoord2f(1.f, 0.f);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
- gGL.texCoord2f(0.f, 1.f);
- gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop);
gGL.texCoord2f(1.f, 0.f);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mBottom);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
+ gGL.texCoord2f(0.f, 1.f);
+ gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
gGL.texCoord2f(1.f, 1.f);
- gGL.vertex2i(mPreviewRect.mRight, mPreviewRect.mTop);
+ gGL.vertex2i(r.getWidth() - PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT + PREVIEW_VPAD);
}
gGL.end();
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index b0f136fb93..112008172e 100644
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -68,7 +68,7 @@
#include <vector>
// Height of the yellow selection highlight posts for land
-const F32 PARCEL_POST_HEIGHT = 0.666f;
+constexpr F32 PARCEL_POST_HEIGHT = 0.666f;
// Returns true if you got at least one object
void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
@@ -178,27 +178,27 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
{
std::vector<LLDrawable*> potentials;
- for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
- iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
+ for (LLViewerRegion* region : LLWorld::getInstance()->getRegionList())
{
- LLViewerRegion* region = *iter;
for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++)
{
- LLSpatialPartition* part = region->getSpatialPartition(i);
- if (part)
+ if (LLSpatialPartition* part = region->getSpatialPartition(i))
{
part->cull(*LLViewerCamera::getInstance(), &potentials, true);
}
}
}
- for (std::vector<LLDrawable*>::iterator iter = potentials.begin();
- iter != potentials.end(); iter++)
+ for (LLDrawable* drawable : potentials)
{
- LLDrawable* drawable = *iter;
+ if (!drawable)
+ {
+ continue;
+ }
+
LLViewerObject* vobjp = drawable->getVObj();
- if (!drawable || !vobjp ||
+ if (!vobjp ||
vobjp->getPCode() != LL_PCODE_VOLUME ||
vobjp->isAttachment() ||
(deselect && !vobjp->isSelected()))
@@ -244,7 +244,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
gViewerWindow->setup3DRender();
}
-const F32 WIND_RELATIVE_ALTITUDE = 25.f;
+constexpr F32 WIND_RELATIVE_ALTITUDE = 25.f;
void LLWind::renderVectors()
{
@@ -266,14 +266,14 @@ void LLWind::renderVectors()
x = mVelX[i + j*mSize] * WIND_SCALE_HACK;
y = mVelY[i + j*mSize] * WIND_SCALE_HACK;
gGL.pushMatrix();
- gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0);
- gGL.color3f(0,1,0);
+ gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.f);
+ gGL.color3f(0.f, 1.f, 0.f);
gGL.begin(LLRender::POINTS);
- gGL.vertex3f(0,0,0);
+ gGL.vertex3f(0.f, 0.f, 0.f);
gGL.end();
- gGL.color3f(1,0,0);
+ gGL.color3f(1.f, 0.f, 0.f);
gGL.begin(LLRender::LINES);
- gGL.vertex3f(x * 0.1f, y * 0.1f ,0.f);
+ gGL.vertex3f(x * 0.1f, y * 0.1f, 0.f);
gGL.vertex3f(x, y, 0.f);
gGL.end();
gGL.popMatrix();
@@ -287,7 +287,7 @@ void LLWind::renderVectors()
// Used by lltoolselectland
void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
- const LLVector3d &east_north_top_global )
+ const LLVector3d &east_north_top_global)
{
LLGLSUIDefault gls_ui;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
@@ -356,92 +356,6 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global,
LLUI::setLineWidth(1.f);
}
-/*
-void LLViewerParcelMgr::renderParcel(LLParcel* parcel )
-{
- S32 i;
- S32 count = parcel->getBoxCount();
- for (i = 0; i < count; i++)
- {
- const LLParcelBox& box = parcel->getBox(i);
-
- F32 west = box.mMin.mV[VX];
- F32 south = box.mMin.mV[VY];
-
- F32 east = box.mMax.mV[VX];
- F32 north = box.mMax.mV[VY];
-
- // HACK: At edge of last region of world, we need to make sure the region
- // resolves correctly so we can get a height value.
- const F32 FUDGE = 0.01f;
-
- F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) );
- F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) );
- F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) );
- F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) );
-
- // little hack to make nearby lines not Z-fight
- east -= 0.1f;
- north -= 0.1f;
-
- F32 sw_top = sw_bottom + POST_HEIGHT;
- F32 se_top = se_bottom + POST_HEIGHT;
- F32 ne_top = ne_bottom + POST_HEIGHT;
- F32 nw_top = nw_bottom + POST_HEIGHT;
-
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLGLDepthTest gls_depth(GL_TRUE);
-
- LLUI::setLineWidth(2.f);
- gGL.color4f(0.f, 1.f, 1.f, 1.f);
-
- // Cheat and give this the same pick-name as land
- gGL.begin(LLRender::LINES);
-
- gGL.vertex3f(west, north, nw_bottom);
- gGL.vertex3f(west, north, nw_top);
-
- gGL.vertex3f(east, north, ne_bottom);
- gGL.vertex3f(east, north, ne_top);
-
- gGL.vertex3f(east, south, se_bottom);
- gGL.vertex3f(east, south, se_top);
-
- gGL.vertex3f(west, south, sw_bottom);
- gGL.vertex3f(west, south, sw_top);
-
- gGL.end();
-
- gGL.color4f(0.f, 1.f, 1.f, 0.2f);
- gGL.begin(LLRender::QUADS);
-
- gGL.vertex3f(west, north, nw_bottom);
- gGL.vertex3f(west, north, nw_top);
- gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, north, ne_bottom);
-
- gGL.vertex3f(east, north, ne_bottom);
- gGL.vertex3f(east, north, ne_top);
- gGL.vertex3f(east, south, se_top);
- gGL.vertex3f(east, south, se_bottom);
-
- gGL.vertex3f(east, south, se_bottom);
- gGL.vertex3f(east, south, se_top);
- gGL.vertex3f(west, south, sw_top);
- gGL.vertex3f(west, south, sw_bottom);
-
- gGL.vertex3f(west, south, sw_bottom);
- gGL.vertex3f(west, south, sw_top);
- gGL.vertex3f(west, north, nw_top);
- gGL.vertex3f(west, north, nw_bottom);
-
- gGL.end();
-
- LLUI::setLineWidth(1.f);
- }
-}
-*/
-
// north = a wall going north/south. Need that info to set up texture
// coordinates correctly.
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index c1e68e0288..590cd09a31 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -488,7 +488,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
case IM_NOTHING_SPECIAL: // p2p IM
// Don't show dialog, just do IM
if (!gAgent.isGodlike()
- && gAgent.getRegion()->isPrelude()
+ && gAgent.inPrelude()
&& to_id.isNull())
{
// do nothing -- don't distract newbies in
diff --git a/indra/newview/llphysicsshapebuilderutil.cpp b/indra/newview/llphysicsshapebuilderutil.cpp
index 37534feadc..eb0df1194e 100644
--- a/indra/newview/llphysicsshapebuilderutil.cpp
+++ b/indra/newview/llphysicsshapebuilderutil.cpp
@@ -28,6 +28,26 @@
#include "llphysicsshapebuilderutil.h"
+#include "llmeshrepository.h"
+
+bool LLPhysicsVolumeParams::hasDecomposition() const
+ {
+ if (!isMeshSculpt())
+ {
+ return false;
+ }
+
+ LLUUID mesh_id = getSculptID();
+ if (mesh_id.isNull())
+ {
+ return false;
+ }
+
+ LLModel::Decomposition* decomp = gMeshRepo.getDecomposition(mesh_id);
+
+ return decomp != NULL;
+}
+
/* static */
void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumeParams& volume_params, const LLVector3& scale, PhysicsShapeSpecification& specOut)
{
@@ -200,19 +220,32 @@ void LLPhysicsShapeBuilderUtil::determinePhysicsShape( const LLPhysicsVolumePara
{
specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
}
- else if (volume_params.isMeshSculpt() &&
- // Check overall dimensions, not individual triangles.
- (scale.mV[0] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE ||
- scale.mV[1] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE ||
- scale.mV[2] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
- ) )
+ else if (volume_params.isMeshSculpt())
{
- // Server distinguishes between user-specified or default convex mesh, vs server's thin-triangle override, but we don't.
- specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
+ // Check overall dimensions, not individual triangles.
+ if (scale.mV[0] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ || scale.mV[1] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ || scale.mV[2] < SHAPE_BUILDER_USER_MESH_CONVEXIFICATION_SIZE
+ )
+ {
+ if (volume_params.hasDecomposition())
+ {
+ specOut.mType = PhysicsShapeSpecification::USER_MESH;
+ }
+ else
+ {
+ // Server distinguishes between user-specified or default convex mesh, vs server's thin-triangle override, but we don't.
+ specOut.mType = PhysicsShapeSpecification::PRIM_CONVEX;
+ }
+ }
+ else
+ {
+ specOut.mType = PhysicsShapeSpecification::USER_MESH;
+ }
}
- else if ( volume_params.isSculpt() ) // Is a sculpt of any kind (mesh or legacy)
+ else if ( volume_params.isSculpt() )
{
- specOut.mType = volume_params.isMeshSculpt() ? PhysicsShapeSpecification::USER_MESH : PhysicsShapeSpecification::SCULPT;
+ specOut.mType = PhysicsShapeSpecification::SCULPT;
}
else // Resort to mesh
{
diff --git a/indra/newview/llphysicsshapebuilderutil.h b/indra/newview/llphysicsshapebuilderutil.h
index 33c2d0a8b6..01c173523b 100644
--- a/indra/newview/llphysicsshapebuilderutil.h
+++ b/indra/newview/llphysicsshapebuilderutil.h
@@ -79,6 +79,8 @@ public:
bool shouldForceConvex() const { return mForceConvex; }
+ bool hasDecomposition() const;
+
private:
bool mForceConvex;
};
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 9739cac311..4e7416bb63 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -688,10 +688,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
static LLCachedControl<bool> inworld_media_enabled(gSavedSettings, "AudioStreamingMedia", true);
static LLCachedControl<bool> inworld_audio_enabled(gSavedSettings, "AudioStreamingMusic", true);
- U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal");
- U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal");
- U32 max_low = gSavedSettings.getU32("PluginInstancesLow");
- F32 max_cpu = gSavedSettings.getF32("PluginInstancesCPULimit");
+ static LLCachedControl<U32> max_instances(gSavedSettings, "PluginInstancesTotal", 8);
+ static LLCachedControl<U32> max_normal(gSavedSettings, "PluginInstancesNormal", 2);
+ static LLCachedControl<U32> max_low(gSavedSettings, "PluginInstancesLow", 4);
+ static LLCachedControl<F32> max_cpu(gSavedSettings, "PluginInstancesCPULimit", 0.9);
// Setting max_cpu to 0.0 disables CPU usage checking.
bool check_cpu_usage = (max_cpu != 0.0f);
@@ -829,7 +829,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
}
else
{
- if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
+ static LLCachedControl<bool> auto_play(gSavedSettings, "MediaTentativeAutoPlay", true);
+ if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && auto_play())
{
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
restore_parcel_audio = false;
@@ -880,7 +881,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
}
}
- if(gSavedSettings.getBOOL("MediaPerformanceManagerDebug"))
+ static LLCachedControl<bool> perf_debug(gSavedSettings, "MediaPerformanceManagerDebug", false);
+ if(perf_debug())
{
// Give impls the same ordering as the priority list
// they're already in the right order for this.
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 3d684e5a1b..ad8f6927ed 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -87,6 +87,8 @@ namespace {
const F32 SPEAKING_AUDIO_LEVEL = 0.30;
+ const uint32_t PEER_GAIN_CONVERSION_FACTOR = 220;
+
static const std::string REPORTED_VOICE_SERVER_TYPE = "Secondlife WebRTC Gateway";
// Don't send positional updates more frequently than this:
@@ -2443,7 +2445,7 @@ void LLVoiceWebRTCConnection::setSpeakerVolume(F32 volume)
void LLVoiceWebRTCConnection::setUserVolume(const LLUUID& id, F32 volume)
{
- boost::json::object root = {{"ug", {id.asString(), (uint32_t) (volume * 200)}}};
+ boost::json::object root = { { "ug", { { id.asString(), (uint32_t)(volume * PEER_GAIN_CONVERSION_FACTOR) } } } };
std::string json_data = boost::json::serialize(root);
if (mWebRTCDataInterface)
{
@@ -2453,7 +2455,7 @@ void LLVoiceWebRTCConnection::setUserVolume(const LLUUID& id, F32 volume)
void LLVoiceWebRTCConnection::setUserMute(const LLUUID& id, bool mute)
{
- boost::json::object root = {{"m", {id.asString(), mute}}};
+ boost::json::object root = { { "m", { { id.asString(), mute } } } };
std::string json_data = boost::json::serialize(root);
if (mWebRTCDataInterface)
{