diff options
Diffstat (limited to 'indra/newview')
198 files changed, 2042 insertions, 1311 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index cbcc85cc1c..d4c2875c6c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -189,6 +189,7 @@ set(viewer_SOURCE_FILES llfloaterbigpreview.cpp llfloaterbuildoptions.cpp llfloaterbulkpermission.cpp + llfloaterbulkupload.cpp llfloaterbump.cpp llfloaterbuy.cpp llfloaterbuycontents.cpp @@ -852,6 +853,7 @@ set(viewer_HEADER_FILES llfloaterbigpreview.h llfloaterbuildoptions.h llfloaterbulkpermission.h + llfloaterbulkupload.h llfloaterbump.h llfloaterbuy.h llfloaterbuycontents.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 26c043ee97..4190719504 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1094,6 +1094,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>BulkUpload2KTextures</key> + <map> + <key>Comment</key> + <string>Bulk upload scales textures to 2K if true, to 1K if false</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>EnableButtonFlashing</key> <map> <key>Comment</key> @@ -7721,7 +7732,7 @@ <key>Comment</key> <string>Minimum of available physical memory in MB before textures get scaled down</string> <key>Persist</key> - <integer>1</integer> + <integer>0</integer> <key>Type</key> <string>U32</string> <key>Value</key> @@ -7760,6 +7771,17 @@ <key>Value</key> <integer>2048</integer> </map> + <key>RenderDownScaleMethod</key> + <map> + <key>Comment</key> + <string>Method to use to downscale images. 0 - FBO, 1 - PBO</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>1</integer> + </map> <key>RenderDebugTextureBind</key> <map> <key>Comment</key> @@ -11289,6 +11311,19 @@ <key>Value</key> <real>8.0</real> </map> + <key>TextureBiasUnimportantFactor</key> + <map> + <key>Comment</key> + <string>When biasing textures to lower resolution due to lack of vram, the importance threshold below which is considered unimportant and getting an extra bias.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>0.25</real> + <key>Backup</key> + <integer>0</integer> + </map> <key>TextureDecodeDisabled</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index 6d05d983f3..607a8c6ef6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -64,14 +64,14 @@ float getBumpValue(vec2 texcoord) void main() { - float c = getBumpValue(vary_texcoord0).r; + float c = getBumpValue(vary_texcoord0); float scaler = 512.0; - vec3 right = vec3(norm_scale, 0, (getBumpValue(vary_texcoord0+vec2(stepX, 0)).r-c)*scaler); - vec3 left = vec3(-norm_scale, 0, (getBumpValue(vary_texcoord0-vec2(stepX, 0)).r-c)*scaler); - vec3 up = vec3(0, -norm_scale, (getBumpValue(vary_texcoord0-vec2(0, stepY)).r-c)*scaler); - vec3 down = vec3(0, norm_scale, (getBumpValue(vary_texcoord0+vec2(0, stepY)).r-c)*scaler); + vec3 right = vec3(norm_scale, 0, (getBumpValue(vary_texcoord0+vec2(stepX, 0))-c)*scaler); + vec3 left = vec3(-norm_scale, 0, (getBumpValue(vary_texcoord0-vec2(stepX, 0))-c)*scaler); + vec3 up = vec3(0, -norm_scale, (getBumpValue(vary_texcoord0-vec2(0, stepY))-c)*scaler); + vec3 down = vec3(0, norm_scale, (getBumpValue(vary_texcoord0+vec2(0, stepY))-c)*scaler); vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right); diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 03849a0326..358fc2dfc8 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 60 +version 62 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -28,7 +28,6 @@ version 60 // list all RenderAnisotropic 1 1 -RenderAvatarCloth 0 0 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -65,7 +64,6 @@ RenderShaderLightingMaxLevel 1 3 RenderReflectionProbeLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 @@ -76,6 +74,11 @@ RenderGLMultiThreadedMedia 1 1 RenderReflectionProbeResolution 1 128 RenderScreenSpaceReflections 1 1 RenderMirrors 1 1 +RenderHeroProbeResolution 1 2048 +RenderHeroProbeDistance 1 16 +RenderHeroProbeUpdateRate 1 4 +RenderHeroProbeConservativeUpdateMultiplier 1 16 +RenderDownScaleMethod 1 1 // @@ -102,7 +105,6 @@ RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.125 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 0 @@ -138,7 +140,6 @@ RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 0 @@ -172,7 +173,6 @@ RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.25 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -208,7 +208,6 @@ RenderTerrainPBRPlanarSampleCount 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.375 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -244,7 +243,6 @@ RenderTerrainPBRPlanarSampleCount 1 3 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.5 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 1 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -280,7 +278,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.75 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -317,7 +314,6 @@ RenderVolumeLODFactor 1 2.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 RenderFSAASamples 1 2 RenderReflectionsEnabled 1 1 @@ -336,7 +332,6 @@ RenderHeroProbeConservativeUpdateMultiplier 1 4 list Unknown RenderShadowDetail 1 0 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderMirrors 1 0 // @@ -366,6 +361,7 @@ RenderAnisotropic 1 0 RenderFSAASamples 1 0 RenderGLContextCoreProfile 1 0 RenderGLMultiThreadedMedia 1 0 +RenderDownScaleMethod 1 0 list AMD RenderGLMultiThreadedTextures 1 1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 7aa8504eaa..581350d73c 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 57 +version 58 // The version number above should be incremented IF AND ONLY IF some // change has been made that is sufficiently important to justify // resetting the graphics preferences of all users to the recommended @@ -28,7 +28,6 @@ version 57 // list all RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxNonImpostors 1 16 @@ -62,7 +61,6 @@ RenderCompressTextures 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 RenderUseStreamVBO 1 1 RenderFSAASamples 1 16 @@ -75,6 +73,10 @@ RenderReflectionProbeDetail 1 2 RenderScreenSpaceReflections 1 1 RenderReflectionProbeLevel 1 3 RenderMirrors 1 1 +RenderHeroProbeResolution 1 2048 +RenderHeroProbeDistance 1 16 +RenderHeroProbeUpdateRate 1 4 +RenderHeroProbeConservativeUpdateMultiplier 1 16 // // Low Graphics Settings @@ -98,7 +100,6 @@ RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderVolumeLODFactor 1 1.125 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 0 @@ -134,7 +135,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.125 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 0 @@ -170,7 +170,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.25 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -206,7 +205,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.375 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -242,7 +240,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.5 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 1 WLSkyDetail 1 96 RenderFSAASamples 1 2 @@ -279,7 +276,6 @@ RenderTreeLODFactor 1 0.5 RenderVolumeLODFactor 1 1.75 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 -RenderUseAdvancedAtmospherics 1 0 WLSkyDetail 1 96 RenderFSAASamples 1 2 RenderReflectionsEnabled 1 1 @@ -315,7 +311,6 @@ RenderVolumeLODFactor 1 2.0 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 RenderDeferredSSAO 1 1 -RenderUseAdvancedAtmospherics 1 0 RenderShadowDetail 1 2 RenderFSAASamples 1 2 RenderReflectionsEnabled 1 1 @@ -334,7 +329,6 @@ RenderHeroProbeConservativeUpdateMultiplier 1 4 list Unknown RenderShadowDetail 1 0 RenderDeferredSSAO 1 0 -RenderUseAdvancedAtmospherics 1 0 RenderMirrors 1 0 @@ -355,7 +349,6 @@ RenderLocalLightCount 1 0 RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderDeferredSSAO 0 0 -RenderUseAdvancedAtmospherics 0 0 RenderShadowDetail 0 0 RenderMirrors 0 0 diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp index 2ef9237f2d..d1845605d4 100644 --- a/indra/newview/gltf/accessor.cpp +++ b/indra/newview/gltf/accessor.cpp @@ -104,7 +104,7 @@ namespace LL void Buffer::erase(Asset& asset, S32 offset, S32 length) { - S32 idx = this - &asset.mBuffers[0]; + S32 idx = (S32)(this - &asset.mBuffers[0]); mData.erase(mData.begin() + offset, mData.begin() + offset + length); @@ -197,7 +197,7 @@ bool Buffer::save(Asset& asset, const std::string& folder) { if (mName.empty()) { - S32 idx = this - &asset.mBuffers[0]; + S32 idx = (S32)(this - &asset.mBuffers[0]); mUri = llformat("buffer_%d.bin", idx); } else diff --git a/indra/newview/gltf/accessor.h b/indra/newview/gltf/accessor.h index ec68c5f624..85ea0f2967 100644 --- a/indra/newview/gltf/accessor.h +++ b/indra/newview/gltf/accessor.h @@ -36,8 +36,6 @@ namespace LL { namespace GLTF { - constexpr S32 INVALID_INDEX = -1; - class Buffer { public: diff --git a/indra/newview/gltf/animation.cpp b/indra/newview/gltf/animation.cpp index 3dff67d746..31549986af 100644 --- a/indra/newview/gltf/animation.cpp +++ b/indra/newview/gltf/animation.cpp @@ -127,8 +127,8 @@ void Animation::apply(Asset& asset, float time) bool Animation::Sampler::prep(Asset& asset) { Accessor& accessor = asset.mAccessors[mInput]; - mMinTime = accessor.mMin[0]; - mMaxTime = accessor.mMax[0]; + mMinTime = (F32)accessor.mMin[0]; + mMaxTime = (F32)accessor.mMax[0]; mFrameTimes.resize(accessor.mCount); diff --git a/indra/newview/gltf/asset.cpp b/indra/newview/gltf/asset.cpp index a454e68a92..5ba5951064 100644 --- a/indra/newview/gltf/asset.cpp +++ b/indra/newview/gltf/asset.cpp @@ -105,7 +105,7 @@ void Node::updateTransforms(Asset& asset, const mat4& parentMatrix) mAssetMatrixInv = glm::inverse(mAssetMatrix); - S32 my_index = this - &asset.mNodes[0]; + S32 my_index = (S32)(this - &asset.mNodes[0]); for (auto& childIndex : mChildren) { @@ -271,11 +271,11 @@ S32 Asset::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, local_end = p; // pointer math to get the node index - node_hit = &node - &mNodes[0]; + node_hit = (S32)(&node - &mNodes[0]); llassert(&mNodes[node_hit] == &node); //pointer math to get the primitive index - primitive_hit = &primitive - &mesh.mPrimitives[0]; + primitive_hit = (S32)(&primitive - &mesh.mPrimitives[0]); llassert(&mesh.mPrimitives[primitive_hit] == &primitive); } } @@ -476,6 +476,7 @@ void Asset::update() { // HACK - force texture to be loaded full rez // TODO: calculate actual vsize image.mTexture->addTextureStats(2048.f * 2048.f); + image.mTexture->setBoostLevel(LLViewerTexture::BOOST_HIGH); } } } @@ -1027,7 +1028,7 @@ bool Image::save(Asset& asset, const std::string& folder) const std::string& delim = gDirUtilp->getDirDelimiter(); if (name.empty()) { - S32 idx = this - asset.mImages.data(); + S32 idx = (S32)(this - asset.mImages.data()); name = llformat("image_%d", idx); } diff --git a/indra/newview/gltf/buffer_util.h b/indra/newview/gltf/buffer_util.h index 89cedf4a47..ef9bba8128 100644 --- a/indra/newview/gltf/buffer_util.h +++ b/indra/newview/gltf/buffer_util.h @@ -161,7 +161,7 @@ namespace LL template<> inline void copyVec3<U16, LLColor4U>(U16* src, LLColor4U& dst) { - dst.set(src[0], src[1], src[2], 255); + dst.set((U8)(src[0]), (U8)(src[1]), (U8)(src[2]), 255); } template<> @@ -193,13 +193,13 @@ namespace LL template<> inline void copyVec4<U16, LLColor4U>(U16* src, LLColor4U& dst) { - dst.set(src[0], src[1], src[2], src[3]); + dst.set((U8)(src[0]), (U8)(src[1]), (U8)(src[2]), ((U8)src[3])); } template<> inline void copyVec4<F32, LLColor4U>(F32* src, LLColor4U& dst) { - dst.set(src[0]*255, src[1]*255, src[2]*255, src[3]*255); + dst.set((U8)(src[0]*255.f), (U8)(src[1]*255.f), (U8)(src[2]*255.f), (U8)(src[3]*255.f)); } template<> @@ -902,7 +902,7 @@ namespace LL { if (src.is_int64()) { - dst = src.get_int64(); + dst = (U32)src.get_int64(); return true; } return false; @@ -957,7 +957,7 @@ namespace LL { if (src.is_int64()) { - dst = src.get_int64(); + dst = (U32)src.get_int64(); return true; } return false; diff --git a/indra/newview/gltf/common.h b/indra/newview/gltf/common.h index b9698d4017..742daff715 100644 --- a/indra/newview/gltf/common.h +++ b/indra/newview/gltf/common.h @@ -43,6 +43,8 @@ namespace LL { namespace GLTF { + constexpr S32 INVALID_INDEX = -1; + using Value = boost::json::value; using mat4 = glm::mat4; diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index b161ec8492..9bda70e643 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -345,6 +345,12 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id) llassert(obj->getVolume()->getParams().getSculptID() == gltf_id); llassert(obj->getVolume()->getParams().getSculptType() == LL_SCULPT_TYPE_GLTF); + if (obj->mGLTFAsset) + { // object already has a GLTF asset, don't reload it + llassert(std::find(mObjects.begin(), mObjects.end(), obj) != mObjects.end()); + return; + } + obj->ref(); gAssetStorage->getAssetData(gltf_id, LLAssetType::AT_GLTF, onGLTFLoadComplete, obj); } @@ -776,7 +782,7 @@ void GLTFSceneManager::bind(Asset& asset, Material& material) bindTexture(asset, TextureType::EMISSIVE, material.mEmissiveTexture, LLViewerFetchedTexture::sWhiteImagep); } - shader->uniform1i(LLShaderMgr::GLTF_MATERIAL_ID, &material - &asset.mMaterials[0]); + shader->uniform1i(LLShaderMgr::GLTF_MATERIAL_ID, (GLint)(&material - &asset.mMaterials[0])); } LLMatrix4a inverse(const LLMatrix4a& mat) diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index 82124b7412..54d8ceb85a 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -150,9 +150,9 @@ void LLAccountingCostManager::accountingCostCoro(std::string url, F32 networkCost = 0.0f; F32 simulationCost = 0.0f; - physicsCost = selected["physics"].asReal(); - networkCost = selected["streaming"].asReal(); - simulationCost = selected["simulation"].asReal(); + physicsCost = (F32)selected["physics"].asReal(); + networkCost = (F32)selected["streaming"].asReal(); + simulationCost = (F32)selected["simulation"].asReal(); SelectionCost selectionCost( physicsCost, networkCost, simulationCost); diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 2f5b0f04e3..c4336758ac 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2662,9 +2662,9 @@ void LLAgent::setStartPositionSuccess(const LLSD &result) (!result["HomeLocation"]["LocationPos"].has("Z"))) break; - agent_pos.mV[VX] = result["HomeLocation"]["LocationPos"]["X"].asInteger(); - agent_pos.mV[VY] = result["HomeLocation"]["LocationPos"]["Y"].asInteger(); - agent_pos.mV[VZ] = result["HomeLocation"]["LocationPos"]["Z"].asInteger(); + agent_pos.mV[VX] = (F32)result["HomeLocation"]["LocationPos"]["X"].asInteger(); + agent_pos.mV[VY] = (F32)result["HomeLocation"]["LocationPos"]["Y"].asInteger(); + agent_pos.mV[VZ] = (F32)result["HomeLocation"]["LocationPos"]["Z"].asInteger(); error = false; @@ -2778,7 +2778,7 @@ bool LLAgent::canAccessMaturityInRegion( U64 region_handle ) const bool LLAgent::canAccessMaturityAtGlobal( LLVector3d pos_global ) const { - U64 region_handle = to_region_handle_global( pos_global.mdV[0], pos_global.mdV[1] ); + U64 region_handle = to_region_handle_global((F32)pos_global.mdV[0], (F32)pos_global.mdV[1]); return canAccessMaturityInRegion( region_handle ); } diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 25e777191f..8eda754d4c 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2114,14 +2114,14 @@ void LLAgentCamera::handleScrollWheel(S32 clicks) F32 camera_offset_initial_mag = getCameraOffsetInitial().magVec(); F32 current_zoom_fraction = mTargetCameraDistance / (camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); - current_zoom_fraction *= 1.f - pow(ROOT_ROOT_TWO, clicks); + current_zoom_fraction *= 1.f - (F32)pow(ROOT_ROOT_TWO, clicks); cameraOrbitIn(current_zoom_fraction * camera_offset_initial_mag * gSavedSettings.getF32("CameraOffsetScale")); } else { F32 current_zoom_fraction = (F32)mCameraFocusOffsetTarget.magVec(); - cameraOrbitIn(current_zoom_fraction * (1.f - pow(ROOT_ROOT_TWO, clicks))); + cameraOrbitIn(current_zoom_fraction * (1.f - (F32)pow(ROOT_ROOT_TWO, clicks))); } } } diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 005a518910..0c120ae01d 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -156,9 +156,9 @@ void LLAgentListener::requestTeleport(LLSD const & event_data) const else { std::string url = LLSLURL(event_data["regionname"], - LLVector3(event_data["x"].asReal(), - event_data["y"].asReal(), - event_data["z"].asReal())).getSLURLString(); + LLVector3((F32)event_data["x"].asReal(), + (F32)event_data["y"].asReal(), + (F32)event_data["z"].asReal())).getSLURLString(); LLURLDispatcher::dispatch(url, LLCommandHandler::NAV_TYPE_CLICKED, NULL, false); } } @@ -344,7 +344,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data) F32 rotation_threshold = 0.03f; if (event_data.has("rotation_threshold")) { - rotation_threshold = event_data["rotation_threshold"].asReal(); + rotation_threshold = (F32)event_data["rotation_threshold"].asReal(); } bool allow_flying = true; @@ -357,7 +357,7 @@ void LLAgentListener::startAutoPilot(LLSD const & event_data) F32 stop_distance = 0.f; if (event_data.has("stop_distance")) { - stop_distance = event_data["stop_distance"].asReal(); + stop_distance = (F32)event_data["stop_distance"].asReal(); } // Clear follow target, this is doing a path @@ -446,7 +446,7 @@ void LLAgentListener::startFollowPilot(LLSD const & event_data) F32 stop_distance = 0.f; if (event_data.has("stop_distance")) { - stop_distance = event_data["stop_distance"].asReal(); + stop_distance = (F32)event_data["stop_distance"].asReal(); } if (target_id.notNull()) diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 40f1679663..0b5198bbd3 100644 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -145,7 +145,7 @@ void LLAgentPilot::loadXML(const std::string& filename) Action action; action.mTime = record["time"].asReal(); action.mType = (EActionType)record["type"].asInteger(); - action.mCameraView = record["camera_view"].asReal(); + action.mCameraView = (F32)record["camera_view"].asReal(); action.mTarget = ll_vector3d_from_sd(record["target"]); action.mCameraOrigin = ll_vector3_from_sd(record["camera_origin"]); action.mCameraXAxis = ll_vector3_from_sd(record["camera_xaxis"]); @@ -297,8 +297,8 @@ void LLAgentPilot::moveCamera() S32 start_index = llmax(mCurrentAction-1,0); S32 end_index = mCurrentAction; F32 t = 0.0; - F32 timedelta = mActions[end_index].mTime - mActions[start_index].mTime; - F32 tickelapsed = mTimer.getElapsedTimeF32()-mActions[start_index].mTime; + F32 timedelta = (F32)(mActions[end_index].mTime - mActions[start_index].mTime); + F32 tickelapsed = mTimer.getElapsedTimeF32()-(F32)mActions[start_index].mTime; if (timedelta > 0.0) { t = tickelapsed/timedelta; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9dd23a5319..a808c196c7 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3934,7 +3934,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LL_WARNS("Avatar") << "Bake retry count exceeded!" << LL_ENDL; break; } - F32 timeout = pow(BAKE_RETRY_TIMEOUT, static_cast<float>(retryCount)) - 1.0; + F32 timeout = pow(BAKE_RETRY_TIMEOUT, static_cast<float>(retryCount)) - 1.0f; LL_WARNS("Avatar") << "Bake retry #" << retryCount << " in " << timeout << " seconds." << LL_ENDL; @@ -4329,7 +4329,7 @@ LLAppearanceMgr::LLAppearanceMgr(): outfit_observer.addCOFSavedCallback(boost::bind( &LLAppearanceMgr::setOutfitLocked, this, false)); - mUnlockOutfitTimer.reset(new LLOutfitUnLockTimer(gSavedSettings.getS32( + mUnlockOutfitTimer.reset(new LLOutfitUnLockTimer((F32)gSavedSettings.getS32( "OutfitOperationsTimeout"))); gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 85ede793e2..a10ef451e1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -340,24 +340,23 @@ F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; S32 gPendingMetricsUploads = 0; -bool gDisconnected = false; +bool gDisconnected = false; -// used to restore texture state after a mode switch -LLFrameTimer gRestoreGLTimer; -bool gRestoreGL = false; -bool gUseWireframe = false; +// Used to restore texture state after a mode switch +LLFrameTimer gRestoreGLTimer; +bool gRestoreGL = false; +bool gUseWireframe = false; -LLMemoryInfo gSysMemory; U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp std::string gLastVersionChannel; -LLVector3 gWindVec(3.0, 3.0, 0.0); -LLVector3 gRelativeWindVec(0.0, 0.0, 0.0); +LLVector3 gWindVec(3.0, 3.0, 0.0); +LLVector3 gRelativeWindVec(0.0, 0.0, 0.0); -U32 gPacketsIn = 0; +U32 gPacketsIn = 0; -bool gPrintMessagesThisFrame = false; +bool gPrintMessagesThisFrame = false; bool gRandomizeFramerate = false; bool gPeriodicSlowFrame = false; @@ -456,7 +455,7 @@ void idle_afk_check() { // check idle timers F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); - F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); + F32 afk_timeout = (F32)gSavedSettings.getS32("AFKTimeout"); if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) { LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL; @@ -752,7 +751,9 @@ bool LLAppViewer::init() // inits from settings.xml and from strings.xml if (!initConfiguration()) - return false; + { + LL_ERRS("InitInfo") << "initConfiguration() failed." << LL_ENDL; + } LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ; @@ -760,7 +761,6 @@ bool LLAppViewer::init() initMaxHeapSize() ; LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize")); - // Although initLoggingAndGetLastDuration() is the right place to mess with // setFatalFunction(), we can't query gSavedSettings until after // initConfiguration(). @@ -783,14 +783,12 @@ bool LLAppViewer::init() LLMachineID::init(); + if (gSavedSettings.getBOOL("QAModeMetrics")) { - if (gSavedSettings.getBOOL("QAModeMetrics")) - { - app_metrics_qa_mode = true; - app_metrics_interval = METRICS_INTERVAL_QA; - } - LLViewerAssetStatsFF::init(); + app_metrics_qa_mode = true; + app_metrics_interval = METRICS_INTERVAL_QA; } + LLViewerAssetStatsFF::init(); initThreads(); LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ; @@ -906,10 +904,10 @@ bool LLAppViewer::init() // do any necessary set-up for accepting incoming SLURLs from apps initSLURLHandler(); - if(false == initHardwareTest()) + if (!initHardwareTest()) { // Early out from user choice. - return false; + LL_ERRS("InitInfo") << "initHardwareTest() failed." << LL_ENDL; } LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ; @@ -923,11 +921,9 @@ bool LLAppViewer::init() if (!initCache()) { - LL_WARNS("InitInfo") << "Failed to init cache" << LL_ENDL; - std::ostringstream msg; - msg << LLTrans::getString("MBUnableToAccessFile"); - OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK); - return 0; + std::string msg = LLTrans::getString("MBUnableToAccessFile"); + OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); + LL_ERRS("InitInfo") << "Failed to init cache" << LL_ENDL; } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; @@ -956,10 +952,11 @@ bool LLAppViewer::init() gGLManager.printGLInfoString(); // If we don't have the right GL requirements, exit. + // ? AG: It seems we never set mHasRequirements to false if (!gGLManager.mHasRequirements) { - // already handled with a MBVideoDrvErr - return 0; + // Already handled with a MBVideoDrvErr + LL_ERRS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL; } // Without SSE2 support we will crash almost immediately, warn here. @@ -967,15 +964,13 @@ bool LLAppViewer::init() { // can't use an alert here since we're exiting and // all hell breaks lose. - OSMessageBox( - LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"), - LLStringUtil::null, - OSMB_OK); - return 0; + std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"); + OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK); + LL_ERRS("InitInfo") << "SSE2 is not supported" << LL_ENDL; } // alert the user if they are using unsupported hardware - if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) + if (!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) { bool unsupported = false; LLSD args; @@ -991,19 +986,21 @@ bool LLAppViewer::init() U64Bytes minRAM; minRAMString >> minRAM; - if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN) + if (!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN) { minSpecs += LLNotifications::instance().getGlobalString("UnsupportedGPU"); minSpecs += "\n"; unsupported = true; } - if(gSysCPU.getMHz() < minCPU) + + if (gSysCPU.getMHz() < minCPU) { minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU"); minSpecs += "\n"; unsupported = true; } - if(gSysMemory.getPhysicalMemoryKB() < minRAM) + + if (gSysMemory.getPhysicalMemoryKB() < minRAM) { minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM"); minSpecs += "\n"; @@ -1015,15 +1012,14 @@ bool LLAppViewer::init() LLNotificationsUtil::add("UnknownGPU"); } - if(unsupported) + if (unsupported) { - if(!gSavedSettings.controlExists("WarnUnsupportedHardware") + if (!gSavedSettings.controlExists("WarnUnsupportedHardware") || gSavedSettings.getBOOL("WarnUnsupportedHardware")) { args["MINSPECS"] = minSpecs; LLNotificationsUtil::add("UnsupportedHardware", args ); } - } } @@ -1115,12 +1111,13 @@ bool LLAppViewer::init() LLViewerJoystick::getInstance()->init(false); } - try { + try + { initializeSecHandler(); } catch (LLProtectedDataException&) { - LLNotificationsUtil::add("CorruptedProtectedDataStore"); + LLNotificationsUtil::add("CorruptedProtectedDataStore"); } gGLActive = false; @@ -1227,7 +1224,7 @@ bool LLAppViewer::init() //datetime formatting functions didn't support some parameters such as "weekday". //Names for days and months localized in xml are also useful for Polish locale(STORM-107). std::string language = gSavedSettings.getString("Language"); - if(language == "ja" || language == "pl") + if (language == "ja" || language == "pl") { LLStringOps::setupWeekDaysNames(LLTrans::getString("dateTimeWeekdaysNames")); LLStringOps::setupWeekDaysShortNames(LLTrans::getString("dateTimeWeekdaysShortNames")); @@ -1431,13 +1428,13 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df mainloop") + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df mainloop"); // canonical per-frame event mainloop.post(newFrame); } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df suspend") + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df suspend"); // give listeners a chance to run llcoro::suspend(); // if one of our coroutines threw an uncaught exception, rethrow it now @@ -1447,7 +1444,7 @@ bool LLAppViewer::doFrame() if (!LLApp::isExiting()) { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df JoystickKeyboard" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); pingMainloopTimeout("Main:JoystickKeyboard"); // Scan keyboard for movement keys. Command keys and typing @@ -1470,7 +1467,7 @@ bool LLAppViewer::doFrame() // Update state based on messages, user input, object idle. { { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df pauseMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df pauseMainloopTimeout"); pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! } @@ -1481,7 +1478,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df resumeMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df resumeMainloopTimeout"); resumeMainloopTimeout(); } } @@ -1528,7 +1525,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df pauseMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df pauseMainloopTimeout"); pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1537,14 +1534,14 @@ bool LLAppViewer::doFrame() // Sleep and run background threads { //LL_RECORD_BLOCK_TIME(SLEEP2); - LL_PROFILE_ZONE_WARN( "Sleep2" ) + LL_PROFILE_ZONE_WARN("Sleep2"); // yield some time to the os based on command line option static LLCachedControl<S32> yield_time(gSavedSettings, "YieldTime", -1); if(yield_time >= 0) { LL_PROFILE_ZONE_NAMED_CATEGORY_APP("Yield"); - LL_PROFILE_ZONE_NUM( yield_time ) + LL_PROFILE_ZONE_NUM(yield_time); ms_sleep(yield_time); } @@ -1612,24 +1609,24 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df gMeshRepo" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df gMeshRepo"); gMeshRepo.update() ; } if(!total_work_pending) //pause texture fetching threads if nothing to process. { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df getTextureCache" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df getTextureCache"); LLAppViewer::getTextureCache()->pause(); LLAppViewer::getTextureFetch()->pause(); } if(!total_io_pending) //pause file threads if nothing to process. { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df LLVFSThread" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df LLVFSThread"); LLLFSThread::sLocal->pause(); } { - LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df resumeMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df resumeMainloopTimeout"); resumeMainloopTimeout(); } pingMainloopTimeout("Main:End"); @@ -1657,7 +1654,7 @@ bool LLAppViewer::doFrame() LL_INFOS() << "Exiting main_loop" << LL_ENDL; } }LLPerfStats::StatsRecorder::endFrame(); - LL_PROFILER_FRAME_END + LL_PROFILER_FRAME_END; return ! LLApp::isRunning(); } @@ -1942,7 +1939,7 @@ bool LLAppViewer::cleanup() LL_INFOS() << "Saving Data" << LL_ENDL; // Store the time of our current logoff - gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); + gSavedPerAccountSettings.setU32("LastLogoff", (U32)time_corrected()); if (LLEnvironment::instanceExists()) { @@ -2210,10 +2207,10 @@ bool LLAppViewer::initThreads() cores = llmin(cores, (S32) max_cores); } - // The only configurable thread count right now is ImageDecode - // The viewer typically starts around 8 threads not including image decode, - // so try to leave at least one core free - S32 image_decode_count = llclamp(cores - 9, 1, 8); + // always use at least 2 threads for image decoding to prevent + // a single texture blocking all other textures from decoding + S32 image_decode_count = llclamp(cores - 6, 2, 16); + threadCounts["ImageDecode"] = image_decode_count; gSavedSettings.setLLSD("ThreadPoolSizes", threadCounts); @@ -2315,7 +2312,7 @@ void LLAppViewer::initLoggingAndGetLastDuration() int log_stat_result = LLFile::stat(log_file, &log_file_stat); if (0 == start_stat_result && 0 == log_stat_result) { - int elapsed_seconds = log_file_stat.st_ctime - start_marker_stat.st_ctime; + int elapsed_seconds = (int)(log_file_stat.st_ctime - start_marker_stat.st_ctime); // only report a last run time if the last viewer was the same version // because this stat will be counted against this version if (markerIsSameVersion(start_marker_file_name)) @@ -2393,7 +2390,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string full_settings_path; if (file.file_name_setting.isProvided() - && gSavedSettings.controlExists(file.file_name_setting)) + && gSavedSettings.controlExists(file.file_name_setting())) { // try to find filename stored in file_name_setting control full_settings_path = gSavedSettings.getString(file.file_name_setting()); @@ -2513,7 +2510,7 @@ bool tempSetControl(const std::string& name, const std::string& value) bool LLAppViewer::initConfiguration() { - //Load settings files list + // Load settings files list std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); LLXMLNodePtr root; bool success = LLXMLNode::parseFile(settings_file_list, root, NULL); @@ -2560,7 +2557,7 @@ bool LLAppViewer::initConfiguration() // - load defaults bool set_defaults = true; - if(!loadSettingsFromDirectory("Default", set_defaults)) + if (!loadSettingsFromDirectory("Default", set_defaults)) { OSMessageBox( "Unable to load default settings file. The installation may be corrupted.", @@ -2577,13 +2574,12 @@ bool LLAppViewer::initConfiguration() #ifndef LL_RELEASE_FOR_DOWNLOAD // provide developer build only overrides for these control variables that are not // persisted to settings.xml - LLControlVariable* c = gSavedSettings.getControl("AllowMultipleViewers"); - if (c) + if (LLControlVariable* c = gSavedSettings.getControl("AllowMultipleViewers")) { c->setValue(true, false); } - gSavedSettings.setBOOL("QAMode", true ); + gSavedSettings.setBOOL("QAMode", true); gSavedSettings.setS32("WatchdogEnabled", 0); #endif @@ -2616,7 +2612,7 @@ bool LLAppViewer::initConfiguration() clp.configure(cmd_line_config, &gSavedSettings); - if(!initParseCommandLine(clp)) + if (!initParseCommandLine(clp)) { handleCommandLineError(clp); return false; @@ -2626,7 +2622,7 @@ bool LLAppViewer::initConfiguration() // If the user has specified a alternate settings file name. // Load it now before loading the user_settings/settings.xml - if(clp.hasOption("settings")) + if (clp.hasOption("settings")) { std::string user_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, @@ -2668,7 +2664,7 @@ bool LLAppViewer::initConfiguration() loadSettingsFromDirectory("UserSession"); // - apply command line settings - if (! clp.notify()) + if (!clp.notify()) { handleCommandLineError(clp); return false; @@ -2677,7 +2673,7 @@ bool LLAppViewer::initConfiguration() // Register the core crash option as soon as we can // if we want gdb post-mortem on cores we need to be up and running // ASAP or we might miss init issue etc. - if(gSavedSettings.getBOOL("DisableCrashLogger")) + if (gSavedSettings.getBOOL("DisableCrashLogger")) { LL_WARNS() << "Crashes will be handled by system, stack trace logs and crash logger are both disabled" << LL_ENDL; disableCrashlogger(); @@ -2691,7 +2687,7 @@ bool LLAppViewer::initConfiguration() initConsole(); } - if(clp.hasOption("help")) + if (clp.hasOption("help")) { std::ostringstream msg; msg << LLTrans::getString("MBCmdLineUsg") << "\n" << clp; @@ -2705,17 +2701,17 @@ bool LLAppViewer::initConfiguration() return false; } - if(clp.hasOption("set")) + if (clp.hasOption("set")) { const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); - if(0x1 & set_values.size()) + if (0x1 & set_values.size()) { LL_WARNS() << "Invalid '--set' parameter count." << LL_ENDL; } else { LLCommandLineParser::token_vector_t::const_iterator itr = set_values.begin(); - for(; itr != set_values.end(); ++itr) + for (; itr != set_values.end(); ++itr) { const std::string& name = *itr; const std::string& value = *(++itr); @@ -2727,12 +2723,13 @@ bool LLAppViewer::initConfiguration() } } - if (clp.hasOption("logevents")) { + if (clp.hasOption("logevents")) + { LLViewerEventRecorder::instance().setEventLoggingOn(); } std::string CmdLineChannel(gSavedSettings.getString("CmdLineChannel")); - if(! CmdLineChannel.empty()) + if (!CmdLineChannel.empty()) { LLVersionInfo::instance().resetChannel(CmdLineChannel); } @@ -2747,7 +2744,7 @@ bool LLAppViewer::initConfiguration() } std::string test_name(gSavedSettings.getString("LogMetrics")); - if (! test_name.empty()) + if (!test_name.empty()) { LLTrace::BlockTimer::sMetricLog = true; // '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test @@ -2789,7 +2786,7 @@ bool LLAppViewer::initConfiguration() } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); - if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) + if (skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) { // Examining "Language" may not suffice -- see LLUI::getLanguage() // logic. Unfortunately LLUI::getLanguage() doesn't yet do us much @@ -2823,7 +2820,6 @@ bool LLAppViewer::initConfiguration() llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); } - // Handle slurl use. NOTE: Don't let SL-55321 reappear. // This initial-SLURL logic, up through the call to // sendURLToOtherInstance(), must precede LLSplashScreen::show() -- @@ -2849,21 +2845,21 @@ bool LLAppViewer::initConfiguration() std::string starting_location; std::string cmd_line_login_location(gSavedSettings.getString("CmdLineLoginLocation")); - if(! cmd_line_login_location.empty()) + if (!cmd_line_login_location.empty()) { starting_location = cmd_line_login_location; } else { std::string default_login_location(gSavedSettings.getString("DefaultLoginLocation")); - if (! default_login_location.empty()) + if (!default_login_location.empty()) { starting_location = default_login_location; } } LLSLURL start_slurl; - if (! starting_location.empty()) + if (!starting_location.empty()) { start_slurl = starting_location; LLStartUp::setStartSLURL(start_slurl); @@ -2875,12 +2871,12 @@ bool LLAppViewer::initConfiguration() // NextLoginLocation is set as a side effect of LLStartUp::setStartSLURL() std::string nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); - if ( !nextLoginLocation.empty() ) + if (!nextLoginLocation.empty()) { LL_DEBUGS("AppInit")<<"set start from NextLoginLocation: "<<nextLoginLocation<<LL_ENDL; LLStartUp::setStartSLURL(LLSLURL(nextLoginLocation)); } - else if ( ( clp.hasOption("login") || clp.hasOption("autologin")) + else if ((clp.hasOption("login") || clp.hasOption("autologin")) && gSavedSettings.getString("CmdLineLoginLocation").empty()) { // If automatic login from command line with --login switch @@ -2936,7 +2932,7 @@ bool LLAppViewer::initConfiguration() #endif if (!gArgs.empty()) { - gWindowTitle += std::string(" ") + gArgs; + gWindowTitle += std::string(" ") + gArgs; } LLStringUtil::truncate(gWindowTitle, 255); @@ -2960,7 +2956,7 @@ bool LLAppViewer::initConfiguration() // but make sure the setting is *not* persisted. // Also see LLVivoxVoiceClient::voiceEnabled() LLControlVariable* enable_voice = gSavedSettings.getControl("EnableVoiceChat"); - if(enable_voice) + if (enable_voice) { const bool DO_NOT_PERSIST = false; enable_voice->setValue(LLSD(false), DO_NOT_PERSIST); @@ -3164,8 +3160,8 @@ bool LLAppViewer::initWindow() gSavedSettings.setBOOL("RenderInitError", false); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), true ); - //If we have a startup crash, it's usually near GL initialization, so simulate that. - if(gCrashOnStartup) + // If we have a startup crash, it's usually near GL initialization, so simulate that. + if (gCrashOnStartup) { LLAppViewer::instance()->forceErrorLLError(); } @@ -3418,7 +3414,7 @@ LLSD LLAppViewer::getViewerInfo() const info["LIBVLC_VERSION"] = "Undefined"; #endif - S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); + S32 packets_in = (S32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); if (packets_in > 0) { info["PACKETS_LOST"] = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); @@ -3990,11 +3986,11 @@ void LLAppViewer::requestQuit() LLViewerRegion* region = gAgent.getRegion(); - if( (LLStartUp::getStartupState() < STATE_STARTED) || !region ) + if ((LLStartUp::getStartupState() < STATE_STARTED) || !region) { // If we have a region, make some attempt to send a logout request first. // This prevents the halfway-logged-in avatar from hanging around inworld for a couple minutes. - if(region) + if (region) { sendLogoutRequest(); } @@ -4609,6 +4605,10 @@ void LLAppViewer::idle() LLGLTFMaterialList::flushUpdates(); + static LLCachedControl<U32> downscale_method(gSavedSettings, "RenderDownScaleMethod"); + gGLManager.mDownScaleMethod = downscale_method; + LLImageGL::updateClass(); + // Service the WorkQueue we use for replies from worker threads. // Use function statics for the timeslice setting so we only have to fetch // and convert MainWorkTime once. @@ -5039,9 +5039,6 @@ void LLAppViewer::idleShutdown() return; } - - - // ProductEngine: Try moving this code to where we shut down sTextureCache in cleanup() // *TODO: ugly static bool saved_teleport_history = false; @@ -5090,7 +5087,7 @@ void LLAppViewer::idleShutdown() } // All floaters are closed. Tell server we want to quit. - if( !logoutRequestSent() ) + if (!logoutRequestSent()) { sendLogoutRequest(); @@ -5102,8 +5099,8 @@ void LLAppViewer::idleShutdown() } // Make sure that we quit if we haven't received a reply from the server. - if( logoutRequestSent() - && gLogoutTimer.getElapsedTimeF32() > gLogoutMaxTime ) + if (logoutRequestSent() + && gLogoutTimer.getElapsedTimeF32() > gLogoutMaxTime) { forceQuit(); return; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 08fbbaa390..32d3df4f83 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -338,7 +338,7 @@ private: }; // consts from viewer.h -const S32 AGENT_UPDATES_PER_SECOND = 10; +const S32 AGENT_UPDATES_PER_SECOND = 125; // Value derived experimentally to avoid Input Delays with latest PBR-Capable Viewers when viewer FPS is highly volatile. const S32 AGENT_FORCE_UPDATES_PER_SECOND = 1; // Globals with external linkage. From viewer.h diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 3cdae041fc..c4c6dd3327 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -197,19 +197,6 @@ LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/) return 0; } -// *FIX:Mani - This hack is to fix a linker issue with libndofdev.lib -// The lib was compiled under VS2005 - in VS2003 we need to remap assert -#ifdef LL_DEBUG -#ifdef LL_MSVC7 -extern "C" { - void _wassert(const wchar_t * _Message, const wchar_t *_File, unsigned _Line) - { - LL_ERRS() << _Message << LL_ENDL; - } -} -#endif -#endif - const std::string LLAppViewerWin32::sWindowClass = "Second Life"; /* @@ -240,7 +227,7 @@ bool create_app_mutex() LPCWSTR unique_mutex_name = L"SecondLifeAppMutex"; HANDLE hMutex; hMutex = CreateMutex(NULL, TRUE, unique_mutex_name); - if(GetLastError() == ERROR_ALREADY_EXISTS) + if (GetLastError() == ERROR_ALREADY_EXISTS) { result = false; } @@ -464,7 +451,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, gDebugInfo["FoundOtherInstanceAtStartup"] = LLSD::Boolean(found_other_instance); bool ok = viewer_app_ptr->init(); - if(!ok) + if (!ok) { LL_WARNS() << "Application init failed." << LL_ENDL; return -1; diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 65e32610c3..299cc5ed64 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -695,7 +695,7 @@ bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAva if (it == mRequestTimestamps.end()) return false; // We found a request, check if it has timed out - U32 now = time(nullptr); + U32 now = (U32)time(nullptr); const U32 REQUEST_EXPIRE_SECS = 5; U32 expires = it->second + REQUEST_EXPIRE_SECS; @@ -709,7 +709,7 @@ bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAva void LLAvatarPropertiesProcessor::addPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) { timestamp_map_t::key_type key = std::make_pair(avatar_id, type); - U32 now = time(nullptr); + U32 now = (U32)time(nullptr); // Add or update existing (expired) request mRequestTimestamps[ key ] = now; } diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index b0befa62e6..3fd2b7fe5d 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -84,7 +84,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 // Going to request each 15 seconds either way, so don't wait // too long and don't repeat httpOpts->setRetries(0); - httpOpts->setTimeout(SECS_BETWEEN_REGION_REQUEST); + httpOpts->setTimeout((unsigned int)SECS_BETWEEN_REGION_REQUEST); LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts); diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 07a5c871ae..b40bcadabf 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -172,7 +172,7 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi // save current values for later use mLatestAgentsCount = agentcount > overLimit ? agentcount - 1 : agentcount; // subtract self mLatestOverLimitAgents = overLimit; - mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; + mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0f : 0.f; if (mAgentsCount == mLatestAgentsCount && mOverLimitAgents == mLatestOverLimitAgents) @@ -191,7 +191,7 @@ void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLi // default timeout before next notification static LLCachedControl<U32> pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); - mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + mPopUpDelayTimer.resetWithExpiry((F32)pop_up_delay); } } @@ -500,6 +500,6 @@ void LLHUDRenderNotifier::displayHUDNotification(EWarnLevel warn_type, LLUUID ob .name("HUDComplexityWarning") .expiry(expire_date) .substitutions(msg_args)); - mHUDPopUpDelayTimer.resetWithExpiry(pop_up_delay); + mHUDPopUpDelayTimer.resetWithExpiry((F32)pop_up_delay); } diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 039164cd6e..214b5f5cde 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -491,7 +491,7 @@ void LLAvatarTracker::notifyObservers() // new masks and ids will be processed later from idle. return; } - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; mIsNotifyObservers = true; observer_list_t observers(mObservers); @@ -678,7 +678,7 @@ void LLAvatarTracker::processChangeUserRights(LLMessageSystem* msg, void**) void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; S32 count = msg->getNumberOfBlocksFast(_PREHASH_AgentBlock); bool chat_notify = gSavedSettings.getBOOL("ChatOnlineNotification"); diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 060430862b..454991ab83 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -148,7 +148,7 @@ void LLChannelManager::onLoginCompleted() mStartUpChannel->setMouseDownCallback(boost::bind(&LLFloaterNotificationsTabbed::onStartUpToastClick, LLFloaterNotificationsTabbed::getInstance(), _2, _3, _4)); mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); - mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime")); + mStartUpChannel->createStartUpToast(away_notifications, (F32)gSavedSettings.getS32("StartUpToastLifeTime")); } } diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index fc50691ece..2b02aabc31 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -423,7 +423,7 @@ public: if (mTime > 0) // have frame time { time_t current_time = time_corrected(); - time_t message_time = current_time - LLFrameTimer::getElapsedSeconds() + mTime; + time_t message_time = (time_t)(current_time - LLFrameTimer::getElapsedSeconds() + mTime); time_string = "[" + LLTrans::getString("TimeMonth") + "]/[" + LLTrans::getString("TimeDay") + "]/[" diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index d517f5a19d..a5c26eff9c 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -135,7 +135,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification) std::string color_name = notification["text_color"].asString(); LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); - textColor.mV[VALPHA] =notification["color_alpha"].asReal(); + textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal(); S32 font_size = notification["font_size"].asInteger(); @@ -191,7 +191,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) std::string color_name = notification["text_color"].asString(); LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); - textColor.mV[VALPHA] =notification["color_alpha"].asReal(); + textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal(); S32 font_size = notification["font_size"].asInteger(); diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 246e2099f9..a0fbebb4cb 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -211,5 +211,5 @@ S32 LLDateUtil::secondsSinceEpochFromString(const std::string& format, const std // is calculated with no time zone corrections. time_duration diff = time_t_date - time_t_epoch; - return diff.total_seconds(); + return (S32)diff.total_seconds(); } diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 26fdf51485..d6ecd124c8 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -98,7 +98,7 @@ LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry) void LLDrawable::init(bool new_entry) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; // mXform mParent = NULL; @@ -305,7 +305,7 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep) LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLFace *face; { @@ -333,7 +333,7 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep) LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLFace *face; @@ -356,7 +356,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep) LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLFace *face; face = new LLFace(this, mVObjp); @@ -379,7 +379,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp, LLViewerTexture *specularp) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLFace *face; face = new LLFace(this, mVObjp); @@ -403,7 +403,7 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (newFaces == (S32)mFaces.size()) { @@ -428,7 +428,7 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2) { @@ -453,7 +453,7 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer void LLDrawable::mergeFaces(LLDrawable* src) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; auto face_count = mFaces.size() + src->mFaces.size(); @@ -488,7 +488,7 @@ void LLDrawable::updateMaterial() void LLDrawable::makeActive() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; #if !LL_RELEASE_FOR_DOWNLOAD if (mVObjp.notNull()) @@ -552,7 +552,7 @@ void LLDrawable::makeActive() void LLDrawable::makeStatic(bool warning_enabled) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (isState(ACTIVE) && !isState(ACTIVE_CHILD) && @@ -600,7 +600,7 @@ void LLDrawable::makeStatic(bool warning_enabled) // Returns "distance" between target destination and resulting xfrom F32 LLDrawable::updateXform(bool undamped) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; bool damped = !undamped; @@ -754,7 +754,7 @@ void LLDrawable::moveUpdatePipeline(bool moved) void LLDrawable::movePartition() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLSpatialPartition* part = getSpatialPartition(); if (part) @@ -800,7 +800,7 @@ bool LLDrawable::updateMoveUndamped() void LLDrawable::updatePartition() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (!getVOVolume()) { @@ -819,7 +819,7 @@ void LLDrawable::updatePartition() bool LLDrawable::updateMoveDamped() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; F32 dist_squared = updateXform(false); @@ -844,7 +844,7 @@ bool LLDrawable::updateMoveDamped() void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { @@ -1022,7 +1022,7 @@ const LLVector3& LLDrawable::getBounds(LLVector3& min, LLVector3& max) const void LLDrawable::updateSpatialExtents() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (mVObjp) { @@ -1158,7 +1158,7 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) */ LLSpatialPartition* LLDrawable::getSpatialPartition() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLSpatialPartition* retval = NULL; @@ -1295,7 +1295,7 @@ void LLSpatialBridge::destroyTree() void LLSpatialBridge::updateSpatialExtents() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0); @@ -1468,7 +1468,7 @@ public: void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, bool for_select) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (!gPipeline.hasRenderType(mDrawableType)) { @@ -1567,7 +1567,7 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE + LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE; if (mDrawable == NULL) { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 34da5b29d4..2d702ecf32 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -81,10 +81,6 @@ LLDrawPoolAlpha::~LLDrawPoolAlpha() void LLDrawPoolAlpha::prerender() { mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_OBJECT); - - // TODO: is this even necessay? These are probably set to never discard - LLViewerFetchedTexture::sFlatNormalImagep->addTextureStats(1024.f*1024.f); - LLViewerFetchedTexture::sWhiteImagep->addTextureStats(1024.f * 1024.f); } S32 LLDrawPoolAlpha::getNumPostDeferredPasses() diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 9afc705d3e..ec70c7ebc0 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -117,7 +117,7 @@ LLDrawPoolAvatar::~LLDrawPoolAvatar() // virtual bool LLDrawPoolAvatar::isDead() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (!LLFacePool::isDead()) { @@ -129,14 +129,14 @@ bool LLDrawPoolAvatar::isDead() S32 LLDrawPoolAvatar::getShaderLevel() const { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; return (S32) LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR); } void LLDrawPoolAvatar::prerender() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; mShaderLevel = LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_AVATAR); @@ -145,7 +145,7 @@ void LLDrawPoolAvatar::prerender() LLMatrix4& LLDrawPoolAvatar::getModelView() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; static LLMatrix4 ret; @@ -217,7 +217,7 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass) void LLDrawPoolAvatar::renderDeferred(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; render(pass); } @@ -229,7 +229,7 @@ S32 LLDrawPoolAvatar::getNumPostDeferredPasses() void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sSkipOpaque = true; sShaderLevel = mShaderLevel; @@ -245,7 +245,7 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass) void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = false; sSkipOpaque = false; @@ -257,7 +257,7 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass) void LLDrawPoolAvatar::renderPostDeferred(S32 pass) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; is_post_deferred_render = true; if (LLPipeline::sImpostorRender) @@ -489,7 +489,7 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass) void LLDrawPoolAvatar::beginImpostor() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (!LLPipeline::sReflectionRender) { @@ -506,7 +506,7 @@ void LLDrawPoolAvatar::beginImpostor() void LLDrawPoolAvatar::endImpostor() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; gImpostorProgram.unbind(); gPipeline.enableLightsDynamic(); @@ -514,7 +514,7 @@ void LLDrawPoolAvatar::endImpostor() void LLDrawPoolAvatar::beginRigid() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (gPipeline.shadersLoaded()) { @@ -534,7 +534,7 @@ void LLDrawPoolAvatar::beginRigid() void LLDrawPoolAvatar::endRigid() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sShaderLevel = mShaderLevel; if (sVertexProgram != NULL) @@ -545,7 +545,7 @@ void LLDrawPoolAvatar::endRigid() void LLDrawPoolAvatar::beginDeferredImpostor() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (!LLPipeline::sReflectionRender) { @@ -563,7 +563,7 @@ void LLDrawPoolAvatar::beginDeferredImpostor() void LLDrawPoolAvatar::endDeferredImpostor() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sShaderLevel = mShaderLevel; sVertexProgram->disableTexture(LLViewerShaderMgr::NORMAL_MAP); @@ -576,7 +576,7 @@ void LLDrawPoolAvatar::endDeferredImpostor() void LLDrawPoolAvatar::beginDeferredRigid() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sVertexProgram = &gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); @@ -586,7 +586,7 @@ void LLDrawPoolAvatar::beginDeferredRigid() void LLDrawPoolAvatar::endDeferredRigid() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sShaderLevel = mShaderLevel; sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); @@ -597,7 +597,7 @@ void LLDrawPoolAvatar::endDeferredRigid() void LLDrawPoolAvatar::beginSkinned() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // used for preview only @@ -611,7 +611,7 @@ void LLDrawPoolAvatar::beginSkinned() void LLDrawPoolAvatar::endSkinned() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done if (sShaderLevel > 0) @@ -637,7 +637,7 @@ void LLDrawPoolAvatar::endSkinned() void LLDrawPoolAvatar::beginDeferredSkinned() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; sShaderLevel = mShaderLevel; sVertexProgram = &gDeferredAvatarProgram; @@ -651,7 +651,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned() void LLDrawPoolAvatar::endDeferredSkinned() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done sRenderingSkinned = false; @@ -836,7 +836,7 @@ static LLTrace::BlockTimerStatHandle FTM_RIGGED_VBO("Rigged VBO"); //----------------------------------------------------------------------------- LLViewerTexture *LLDrawPoolAvatar::getDebugTexture() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (mReferences.empty()) { diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 71b82b77eb..0d4eaab488 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -215,7 +215,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass) LLViewerTexture* tex_a = mWaterNormp[0]; LLViewerTexture* tex_b = mWaterNormp[1]; - F32 blend_factor = pwater->getBlendFactor(); + F32 blend_factor = (F32)pwater->getBlendFactor(); gGL.getTexUnit(bumpTex)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(bumpTex2)->unbind(LLTexUnit::TT_TEXTURE); @@ -256,7 +256,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass) if (mShaderLevel == 1) { - fog_color.mV[VALPHA] = log(fog_density) / log(2); + fog_color.mV[VALPHA] = (F32)(log(fog_density) / log(2)); } F32 water_height = environment.getWaterHeight(); diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 047e9a8112..305215f541 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -242,7 +242,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLVector3& camPosLocal) const LLViewerTexture* tex_a = gSky.mVOSkyp->getBloomTex(); LLViewerTexture* tex_b = gSky.mVOSkyp->getBloomTexNext(); - F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor(); + F32 blend_factor = (F32)LLEnvironment::instance().getCurrentSky()->getBlendFactor(); if (tex_a && (!tex_b || (tex_a == tex_b))) { @@ -309,8 +309,8 @@ void LLDrawPoolWLSky::renderSkyCloudsDeferred(const LLVector3& camPosLocal, F32 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); - F32 cloud_variance = psky ? psky->getCloudVariance() : 0.0f; - F32 blend_factor = psky ? psky->getBlendFactor() : 0.0f; + F32 cloud_variance = psky ? (F32)psky->getCloudVariance() : 0.0f; + F32 blend_factor = psky ? (F32)psky->getBlendFactor() : 0.0f; if (psky->getCloudScrollRate().isExactlyZero()) { @@ -364,7 +364,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLFace * face = gSky.mVOSkyp->mFace[LLVOSky::FACE_SUN]; - F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor(); + F32 blend_factor = (F32)LLEnvironment::instance().getCurrentSky()->getBlendFactor(); bool can_use_vertex_shaders = gPipeline.shadersLoaded(); bool can_use_windlight_shaders = gPipeline.canUseWindLightShaders(); diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 8884905cf0..c12546f7eb 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -209,7 +209,7 @@ namespace mInitial = (*initial.first).second; mFinal = (*initial.second).second; - mBlendSpan = getSpanTime(initial); + mBlendSpan = (LLSettingsBase::TrackPosition)getSpanTime(initial); initializeTarget(now); setOnFinished([this](const LLSettingsBlender::ptr_t &){ onFinishedSpan(); }); @@ -237,7 +237,7 @@ namespace LLSettingsBase::BlendFactor blendf = calculateBlend(targetpos, targetspan); pendsetting->blend((*bounds.second).second, blendf); - reset(pstartsetting, pendsetting, LLEnvironment::TRANSITION_ALTITUDE); + reset(pstartsetting, pendsetting, (LLSettingsBase::TrackPosition)LLEnvironment::TRANSITION_ALTITUDE); } protected: @@ -304,7 +304,7 @@ namespace LLSettingsDay::TrackBound_t next = getBoundingEntries(adjusted_now); LLSettingsBase::Seconds nextspan = getSpanTime(next); - reset((*next.first).second, (*next.second).second, nextspan); + reset((*next.first).second, (*next.second).second, (LLSettingsBase::TrackPosition)nextspan); // Recalculate (reinitialize) position. Because: // - 'delta' from applyTimeDelta accumulates errors (probably should be fixed/changed to absolute time) @@ -695,7 +695,7 @@ namespace // Ideally we need to check for texture in injection, but // in this case user is setting value explicitly, potentially // with different transitions, don't ignore it - F64 result = lerp(value, injection->mValue.asReal(), mix); + F64 result = lerp((F32)value, (F32)injection->mValue.asReal(), (F32)mix); injection->mLastValue = LLSD::Real(result); this->mSettings[injection->mKeyName] = injection->mLastValue; } @@ -898,7 +898,7 @@ void LLEnvironment::initSingleton() gSavedSettings.getControl("RenderSkyAutoAdjustProbeAmbiance")->getSignal()->connect( [](LLControlVariable*, const LLSD& new_val, const LLSD& old_val) { - LLSettingsSky::sAutoAdjustProbeAmbiance = new_val.asReal(); + LLSettingsSky::sAutoAdjustProbeAmbiance = (F32)new_val.asReal(); } ); LLSettingsSky::sAutoAdjustProbeAmbiance = gSavedSettings.getF32("RenderSkyAutoAdjustProbeAmbiance"); @@ -967,11 +967,11 @@ LLSettingsWater::ptr_t LLEnvironment::getCurrentWater() const void LayerConfigToDensityLayer(const LLSD& layerConfig, DensityLayer& layerOut) { - layerOut.constant_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); - layerOut.exp_scale = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); - layerOut.exp_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - layerOut.linear_term = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); - layerOut.width = layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); + layerOut.constant_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); + layerOut.exp_scale = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); + layerOut.exp_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); + layerOut.linear_term = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); + layerOut.width = (F32)layerConfig[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); } void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky) @@ -1758,7 +1758,7 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con //_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL; break; case LLSD::TypeReal: - shader->uniform1f(it.second.getShaderKey(), value.asReal()); + shader->uniform1f(it.second.getShaderKey(), (F32)value.asReal()); //_WARNS("RIDER") << "pushing '" << (*it).first << "' as " << value << LL_ENDL; break; @@ -1928,8 +1928,8 @@ void LLEnvironment::adjustRegionOffset(F32 adjust) if (mEnvironments[ENV_REGION]) { - F32 day_length = mEnvironments[ENV_REGION]->getDayLength(); - F32 day_offset = mEnvironments[ENV_REGION]->getDayOffset(); + F32 day_length = (F32)mEnvironments[ENV_REGION]->getDayLength(); + F32 day_offset = (F32)mEnvironments[ENV_REGION]->getDayOffset(); F32 day_adjustment = adjust * day_length; @@ -2345,7 +2345,7 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL { for (int idx = 0; idx < 3; idx++) { - pinfo->mAltitudes[idx+1] = environment[KEY_TRACKALTS][idx].asReal(); + pinfo->mAltitudes[idx+1] = (F32)environment[KEY_TRACKALTS][idx].asReal(); } pinfo->mAltitudes[0] = 0; } @@ -2569,7 +2569,7 @@ void LLEnvironment::handleEnvironmentPush(LLSD &message) std::string action = message[KEY_ACTION].asString(); LLUUID experience_id = message[KEY_EXPERIENCEID].asUUID(); LLSD action_data = message[KEY_ACTIONDATA]; - F32 transition_time = action_data[KEY_TRANSITIONTIME].asReal(); + F32 transition_time = (F32)action_data[KEY_TRANSITIONTIME].asReal(); //TODO: Check here that the viewer thinks the experience is still valid. @@ -2601,7 +2601,7 @@ void LLEnvironment::handleEnvironmentPushFull(LLUUID experience_id, LLSD &messag { LLUUID asset_id(message[KEY_ASSETID].asUUID()); - setExperienceEnvironment(experience_id, asset_id, LLSettingsBase::Seconds(transition)); + setExperienceEnvironment(experience_id, asset_id, (F32)LLSettingsBase::Seconds(transition)); } void LLEnvironment::handleEnvironmentPushPartial(LLUUID experience_id, LLSD &message, F32 transition) @@ -2611,7 +2611,7 @@ void LLEnvironment::handleEnvironmentPushPartial(LLUUID experience_id, LLSD &mes if (settings.isUndefined()) return; - setExperienceEnvironment(experience_id, settings, LLSettingsBase::Seconds(transition)); + setExperienceEnvironment(experience_id, settings, (F32)LLSettingsBase::Seconds(transition)); } void LLEnvironment::clearExperienceEnvironment(LLUUID experience_id, LLSettingsBase::Seconds transition_time) @@ -2968,7 +2968,7 @@ void LLEnvironment::DayTransition::animate() // pause probe updates and reset reflection maps on sky change - gPipeline.mReflectionMapManager.pause(mTransitionTime); + gPipeline.mReflectionMapManager.pause((F32)mTransitionTime); gPipeline.mReflectionMapManager.reset(); mSky = mStartSky->buildClone(); @@ -3286,7 +3286,7 @@ void LLTrackBlenderLoopingManual::switchTrack(S32 trackno, const LLSettingsBase: { mTrackNo = trackno; - LLSettingsBase::TrackPosition useposition = (position < 0.0) ? mPosition : position; + LLSettingsBase::TrackPosition useposition = (position < 0.0) ? (LLSettingsBase::TrackPosition)mPosition : position; setPosition(useposition); } @@ -3297,7 +3297,7 @@ LLSettingsDay::TrackBound_t LLTrackBlenderLoopingManual::getBoundingEntries(F64 mEndMarker = wtrack.end(); - LLSettingsDay::TrackBound_t bounds = get_bounding_entries(wtrack, position); + LLSettingsDay::TrackBound_t bounds = get_bounding_entries(wtrack, (LLSettingsBase::TrackPosition)position); return bounds; } @@ -3571,7 +3571,7 @@ namespace mInjectedSky->setSource(target_sky); // clear reflection probes and pause updates during sky change - gPipeline.mReflectionMapManager.pause(transition); + gPipeline.mReflectionMapManager.pause((F32)transition); gPipeline.mReflectionMapManager.reset(); mBlenderSky = std::make_shared<LLSettingsBlenderTimeDelta>(target_sky, start_sky, psky, transition); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 4c105176b6..42fe8fc6e6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -54,7 +54,7 @@ public: } else { - width = mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad(); + width = (F32)(mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad()); height = mStyle->getFont()->getLineHeight(); } return true; @@ -86,7 +86,7 @@ public: LLFontGL::RIGHT, LLFontGL::TOP, 0, mStyle->getShadowType(), - end - start, draw_rect.getWidth(), + end - start, (S32)draw_rect.getWidth(), &right_x, mEditor.getUseEllipses(), mEditor.getUseColor()); return right_x; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 0e8e64af69..f73c530ff9 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -169,6 +169,8 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mImportanceToCamera = 0.f ; mBoundingSphereRadius = 0.0f ; + mTexExtents[0].set(0, 0); + mTexExtents[1].set(1, 1); mHasMedia = false ; mIsMediaAllowed = true; } @@ -234,7 +236,7 @@ void LLFace::setPool(LLFacePool* pool) void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; if (!new_pool) { @@ -315,7 +317,7 @@ void LLFace::setSpecularMap(LLViewerTexture* tex) void LLFace::dirtyTexture() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; LLDrawable* drawablep = getDrawable(); @@ -502,7 +504,7 @@ void LLFace::updateCenterAgent() void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; if (mDrawablep == NULL || mDrawablep->getSpatialGroup() == NULL) { @@ -576,7 +578,7 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) void renderFace(LLDrawable* drawable, LLFace *face) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; LLVOVolume* vobj = drawable->getVOVolume(); if (vobj) @@ -803,7 +805,7 @@ bool less_than_max_mag(const LLVector4a& vec) bool LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, const LLMatrix4& mat_vert_in, bool global_volume) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; //get bounding box if (mDrawablep->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED)) @@ -2047,10 +2049,12 @@ void LLFace::resetVirtualSize() F32 LLFace::getTextureVirtualSize() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + F32 radius; F32 cos_angle_to_view_dir; bool in_frustum = calcPixelArea(cos_angle_to_view_dir, radius); + if (mPixelArea < F_ALMOST_ZERO || !in_frustum) { setVirtualSize(0.f) ; @@ -2271,7 +2275,7 @@ F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area) { if(importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res. { - pixel_area = LLViewerTexture::sMinLargeImageSize ; + pixel_area = (F32)LLViewerTexture::sMinLargeImageSize ; } } } diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 67d55c53e4..8056983c7c 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -279,9 +279,9 @@ bool LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) // so we can create a new tooltip LLToolTipMgr::instance().unblockToolTips(); mHoverTimer = mHoverID; - mToolTipRect.set(mBarRect.mLeft + (hover_bar->mSelfStart / mTotalTimeDisplay) * mBarRect.getWidth(), + mToolTipRect.set((S32)(mBarRect.mLeft + (hover_bar->mSelfStart / mTotalTimeDisplay) * mBarRect.getWidth()), row.mTop, - mBarRect.mLeft + (hover_bar->mSelfEnd / mTotalTimeDisplay) * mBarRect.getWidth(), + (S32)(mBarRect.mLeft + (hover_bar->mSelfEnd / mTotalTimeDisplay) * mBarRect.getWidth()), row.mBottom); } } @@ -626,7 +626,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3fv(last_p.mV); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); - last_p.set((F32)i/(F32) base_times.size(), base_times[i]/max_time, 0.f); + last_p.set((F32)i/(F32) base_times.size(), (F32)(base_times[i]/max_time), 0.f); gGL.vertex3fv(last_p.mV); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.end(); @@ -645,7 +645,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.vertex3fv(last_p.mV); - last_p.set((F32) i / (F32) cur_times.size(), cur_times[i]/max_time, 0.f); + last_p.set((F32) i / (F32) cur_times.size(), (F32)(cur_times[i]/max_time), 0.f); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.vertex3fv(last_p.mV); gGL.end(); @@ -715,7 +715,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3fv(last_p.mV); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); - last_p.set((F32)count/(F32)total_count, *iter/max_execution, 0.f); + last_p.set((F32)count/(F32)total_count, (F32)(*iter/max_execution), 0.f); gGL.vertex3fv(last_p.mV); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.end(); @@ -735,7 +735,7 @@ void LLFastTimerView::exportCharts(const std::string& base, const std::string& t gGL.begin(LLRender::TRIANGLE_STRIP); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.vertex3fv(last_p.mV); - last_p.set((F32)count/(F32)total_count, *iter/max_execution, 0.f); + last_p.set((F32)count/(F32)total_count, (F32)(*iter/max_execution), 0.f); gGL.vertex3f(last_p.mV[0], 0.f, 0.f); gGL.vertex3fv(last_p.mV); gGL.end(); @@ -787,8 +787,8 @@ LLSD LLFastTimerView::analyzePerformanceLogDefault(std::istream& is) { LLSD::Integer samples = iter->second["Calls"].asInteger(); - time_stats[label].push(time); - sample_stats[label].push(samples); + time_stats[label].push((F32)time); + sample_stats[label].push((F32)samples); } } total_frames++; @@ -1112,7 +1112,7 @@ void LLFastTimerView::drawLineGraph() break; } gGL.vertex2f(x,y); - gGL.vertex2f(x,mGraphRect.mBottom); + gGL.vertex2f(x,(GLfloat)mGraphRect.mBottom); } gGL.end(); @@ -1432,7 +1432,7 @@ void LLFastTimerView::updateTotalTime() break; } - mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil(mTotalTimeDisplay.valueInUnits<LLUnits::Milliseconds>() / 20.f) * 20.f); + mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(llceil((F32)mTotalTimeDisplay.valueInUnits<LLUnits::Milliseconds>() / 20.f) * 20.f); } void LLFastTimerView::drawBars() @@ -1491,7 +1491,7 @@ void LLFastTimerView::drawBars() LLRect frame_bar_rect; frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft, bars_top, - ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), + (S32)ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), bar_height); mAverageTimerRow.mTop = frame_bar_rect.mTop; mAverageTimerRow.mBottom = frame_bar_rect.mBottom; @@ -1505,7 +1505,7 @@ void LLFastTimerView::drawBars() row.mTop = frame_bar_rect.mTop; row.mBottom = frame_bar_rect.mBottom; frame_bar_rect.mRight = frame_bar_rect.mLeft - + ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); + + (S32)ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()); drawBar(frame_bar_rect, row, image_width, image_height); frame_bar_rect.translate(0, -(bar_height + vpad)); @@ -1633,8 +1633,8 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, } LLRect children_rect; - children_rect.mLeft = ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; - children_rect.mRight = ll_round(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mLeft = (S32)ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; + children_rect.mRight = (S32)ll_round(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft; if (bar_rect.getHeight() > MIN_BAR_HEIGHT) { diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 367803b78a..b6f1eea802 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -94,7 +94,7 @@ void LLVolumeImplFlexible::updateClass() { LL_PROFILE_ZONE_SCOPED; - U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; + U64 virtual_frame_num = (U64)(LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME); for (std::vector<LLVolumeImplFlexible*>::iterator iter = sInstanceList.begin(); iter != sInstanceList.end(); ++iter) @@ -362,7 +362,7 @@ void LLVolumeImplFlexible::doIdleUpdate() update_period = llclamp(update_period, 1U, 32U); // We control how fast flexies update, buy splitting updates among frames - U64 virtual_frame_num = LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME; + U64 virtual_frame_num = (U64)(LLTimer::getElapsedSeconds() / SEC_PER_FLEXI_FRAME); if (visible) { diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 66796276a9..01a0525d56 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -488,7 +488,7 @@ void LLFloater360Capture::capture360Images() // 'GPano:InitialViewHeadingDegrees' field. // We need to convert from the angle getYaw() gives us into something // the XMP data field wants (N=0, E=90, S=180, W= 270 etc.) - mInitialHeadingDeg = (360 + 90 - (int)(camera->getYaw() * RAD_TO_DEG)) % 360; + mInitialHeadingDeg = (float)((360 + 90 - (int)(camera->getYaw() * RAD_TO_DEG)) % 360); LL_INFOS("360Capture") << "Recording a heading of " << (int)(mInitialHeadingDeg) << " Image size: " << (S32)mSourceImageSize << LL_ENDL; diff --git a/indra/newview/llfloaterbanduration.cpp b/indra/newview/llfloaterbanduration.cpp index c9141322e3..eb32e50901 100644 --- a/indra/newview/llfloaterbanduration.cpp +++ b/indra/newview/llfloaterbanduration.cpp @@ -82,7 +82,7 @@ void LLFloaterBanDuration::onClickBan() LLSpinCtrl* hours_spin = getChild<LLSpinCtrl>("ban_hours"); if (hours_spin) { - time = LLDate::now().secondsSinceEpoch() + (hours_spin->getValue().asInteger() * 3600); + time = (S32)(LLDate::now().secondsSinceEpoch() + (hours_spin->getValue().asInteger() * 3600)); } } mSelectionCallback(mAvatar_ids, time); diff --git a/indra/newview/llfloaterbulkupload.cpp b/indra/newview/llfloaterbulkupload.cpp new file mode 100644 index 0000000000..b898cb28b6 --- /dev/null +++ b/indra/newview/llfloaterbulkupload.cpp @@ -0,0 +1,136 @@ +/** + * @file llfloaterbulkupload.cpp + * @author Andrey Kleshchev + * @brief LLFloaterBulkUpload class implementation + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterbulkupload.h" + +#include "lltextbox.h" +#include "llviewercontrol.h" +#include "llviewermenufile.h" + +constexpr S32 MAX_HEIGH = 211; + +LLFloaterBulkUpload::LLFloaterBulkUpload(const LLSD& key) +: LLModalDialog(key, true) +{ + mUploadCost = key["upload_cost"].asInteger(); + mUploadCount = key["upload_count"].asInteger(); + mHas2kTextures = key["has_2k_textures"].asBoolean(); + if (key["files"].isArray()) + { + const LLSD& files = key["files"]; + for (LLSD::array_const_iterator it = files.beginArray(); + it != files.endArray(); + ++it) + { + mFiles.push_back(it->asString()); + } + } +} + +LLFloaterBulkUpload::~LLFloaterBulkUpload() +{ +} + +bool LLFloaterBulkUpload::postBuild() +{ + childSetAction("upload_btn", [this](void*) { onClickUpload(); }, this); + childSetAction("cancel_btn", [this](void*) { onClickCancel(); }, this); + + mCountLabel = getChild<LLTextBox>("number_of_items", true); + mCostLabel = getChild<LLTextBox>("upload_cost", true); + + mCheckboxPanel = getChild<LLPanel>("checkbox_panel", true); + mLinkPanel = getChild<LLPanel>("link_panel", true); + mWarningPanel = getChild<LLPanel>("warning_panel", true); + + mCheckboxUpload2K = getChild<LLUICtrl>("upload_2k"); + mCheckboxUpload2K->setCommitCallback([this](LLUICtrl* ctrl, const LLSD& data) { onUpload2KCheckBox(); }); + + mAllow2kTextures = gSavedSettings.getBOOL("BulkUpload2KTextures"); + mCheckboxUpload2K->setValue(!mAllow2kTextures); + + if (!mAllow2kTextures && mHas2kTextures) + { + // provided cost is for 2K textures, recalculate cost + S32 bvh_count; + S32 textures_2k_count; + get_bulk_upload_expected_cost(mFiles, mAllow2kTextures, mUploadCost, mUploadCount, bvh_count, textures_2k_count); + + update(); + } + + + update(); + + return LLModalDialog::postBuild(); +} + +void LLFloaterBulkUpload::update() +{ + mCountLabel->setTextArg("[COUNT]", llformat("%d", mUploadCount)); + mCostLabel->setTextArg("[COST]", llformat("%d", mUploadCost)); + + mCheckboxPanel->setVisible(mHas2kTextures); + mLinkPanel->setVisible(mHas2kTextures); + mWarningPanel->setVisible(mHas2kTextures); + + S32 new_height = MAX_HEIGH; + if (!mHas2kTextures) + { + new_height -= mCheckboxPanel->getRect().getHeight(); + new_height -= mLinkPanel->getRect().getHeight(); + new_height -= mWarningPanel->getRect().getHeight(); + } + reshape(getRect().getWidth(), new_height, false); +} + +void LLFloaterBulkUpload::onUpload2KCheckBox() +{ + mAllow2kTextures = !mCheckboxUpload2K->getValue().asBoolean(); + gSavedSettings.setBOOL("BulkUpload2KTextures", mAllow2kTextures); + + S32 bvh_count; + S32 textures_2k_count; + get_bulk_upload_expected_cost(mFiles, mAllow2kTextures, mUploadCost, mUploadCount, bvh_count, textures_2k_count); + // keep old value of mHas2kTextures to show checkbox + + update(); +} + +void LLFloaterBulkUpload::onClickUpload() +{ + do_bulk_upload(mFiles, mAllow2kTextures); + closeFloater(); +} + + +void LLFloaterBulkUpload::onClickCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloaterbulkupload.h b/indra/newview/llfloaterbulkupload.h new file mode 100644 index 0000000000..d07dc8eabe --- /dev/null +++ b/indra/newview/llfloaterbulkupload.h @@ -0,0 +1,66 @@ +/** + * @file llfloaterbulkupload.h + * @author Andrey Kleshchev + * @brief LLFloaterBulkUpload class definition + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERBULKUPLOAD_H +#define LL_LLFLOATERBULKUPLOAD_H + +#include "llmodaldialog.h" + +class LLTextBox; + +class LLFloaterBulkUpload : public LLModalDialog +{ +public: + LLFloaterBulkUpload(const LLSD& key); + ~LLFloaterBulkUpload(); + + bool postBuild() override; + + void update(); + +protected: + void onUpload2KCheckBox(); + + void onClickUpload(); + void onClickCancel(); + +private: + LLUICtrl* mCheckboxUpload2K = nullptr; + LLTextBox* mCountLabel = nullptr; + LLTextBox* mCostLabel = nullptr; + LLPanel* mCheckboxPanel = nullptr; + LLPanel* mLinkPanel = nullptr; + LLPanel* mWarningPanel = nullptr; + + std::vector<std::string> mFiles; + bool mAllow2kTextures = true; + bool mHas2kTextures = false; + S32 mUploadCost = 0; + S32 mUploadCount = 0; +}; + +#endif diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 5330518ba5..2cb930922a 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -1086,7 +1086,7 @@ bool LLPreviewAnimation::render() gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); gGL.loadIdentity(); - gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.ortho(0.0f, (F32)mFullWidth, 0.0f, (F32)mFullHeight, -1.0f, 1.0f); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 837aa858f5..6f5d81eda3 100644 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -111,8 +111,8 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>* messages, const std mCurrentPage = (mMessages->size() ? (static_cast<int>(mMessages->size()) - 1) / mPageSize : 0); mPageSpinner->setEnabled(true); - mPageSpinner->setMaxValue(mCurrentPage+1); - mPageSpinner->set(mCurrentPage+1); + mPageSpinner->setMaxValue((F32)(mCurrentPage+1)); + mPageSpinner->set((F32)(mCurrentPage+1)); std::string total_page_num = llformat("/ %d", mCurrentPage+1); getChild<LLTextBox>("page_num_label")->setValue(total_page_num); diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index ebccb2214c..60343a4e2a 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -313,7 +313,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) mDayLength.value(0); if (key.has(KEY_DAY_LENGTH)) { - mDayLength.value(key[KEY_DAY_LENGTH].asReal()); + mDayLength.value(key[KEY_DAY_LENGTH].asInteger()); } // Time&Percentage labels @@ -352,7 +352,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key) // Adjust Time&Percentage labels' location according to length LLRect label_rect = getChild<LLTextBox>("p0", true)->getRect(); - F32 slider_width = mFramesSlider->getRect().getWidth(); + F32 slider_width = (F32)mFramesSlider->getRect().getWidth(); for (int i = 1; i < max_elm; i++) { LLTextBox *pcnt_label = getChild<LLTextBox>("p" + llformat("%d", i), true); @@ -705,7 +705,7 @@ void LLFloaterEditExtDayCycle::onAddFrame() LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame while waiting for day(asset) to load." << LL_ENDL; return; } - if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) + if ((mEditDay->getSettingsNearKeyframe((LLSettingsBase::TrackPosition)frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) { LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL; return; @@ -722,17 +722,17 @@ void LLFloaterEditExtDayCycle::onAddFrame() // scratch water should always have the current water settings. LLSettingsWater::ptr_t water(mScratchWater->buildClone()); setting = water; - mEditDay->setWaterAtKeyframe( std::static_pointer_cast<LLSettingsWater>(setting), frame); + mEditDay->setWaterAtKeyframe( std::static_pointer_cast<LLSettingsWater>(setting), (LLSettingsBase::TrackPosition)frame); } else { // scratch sky should always have the current sky settings. LLSettingsSky::ptr_t sky(mScratchSky->buildClone()); setting = sky; - mEditDay->setSkyAtKeyframe(sky, frame, mCurrentTrack); + mEditDay->setSkyAtKeyframe(sky, (LLSettingsBase::TrackPosition)frame, mCurrentTrack); } setDirtyFlag(); - addSliderFrame(frame, setting); + addSliderFrame((F32)frame, setting); updateTabs(); } @@ -1316,7 +1316,7 @@ void LLFloaterEditExtDayCycle::removeCurrentSliderFrame() { LL_DEBUGS("ENVDAYEDIT") << "Removing frame from " << iter->second.mFrame << LL_ENDL; LLSettingsBase::Seconds seconds(iter->second.mFrame); - mEditDay->removeTrackKeyframe(mCurrentTrack, seconds); + mEditDay->removeTrackKeyframe(mCurrentTrack, (LLSettingsBase::TrackPosition)seconds); mSliderKeyMap.erase(iter); } @@ -1474,17 +1474,17 @@ void LLFloaterEditExtDayCycle::reblendSettings() { if ((mSkyBlender->getTrack() != mCurrentTrack) && (mCurrentTrack != LLSettingsDay::TRACK_WATER)) { - mSkyBlender->switchTrack(mCurrentTrack, position); + mSkyBlender->switchTrack(mCurrentTrack, (LLSettingsBase::TrackPosition)position); } else { - mSkyBlender->setPosition(position); + mSkyBlender->setPosition((LLSettingsBase::TrackPosition)position); } } if (mWaterBlender) { - mWaterBlender->setPosition(position); + mWaterBlender->setPosition((LLSettingsBase::TrackPosition)position); } } @@ -1517,7 +1517,7 @@ bool LLFloaterEditExtDayCycle::isAddingFrameAllowed() if (!mFramesSlider->getCurSlider().empty() || !mEditDay) return false; LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue()); - if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) + if ((mEditDay->getSettingsNearKeyframe((LLSettingsBase::TrackPosition)frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) { return false; } diff --git a/indra/newview/llfloateremojipicker.cpp b/indra/newview/llfloateremojipicker.cpp index d38f53eed6..30f58aaeec 100644 --- a/indra/newview/llfloateremojipicker.cpp +++ b/indra/newview/llfloateremojipicker.cpp @@ -101,7 +101,7 @@ public: LLScrollingPanel::draw(); F32 x = 4; // padding-left - F32 y = getRect().getHeight() / 2; + F32 y = (F32)(getRect().getHeight() / 2); LLFontGL::getFontSansSerif()->render( mText, // wstr 0, // begin_offset @@ -137,8 +137,8 @@ public: { LLScrollingPanel::draw(); - F32 x = getRect().getWidth() / 2; - F32 y = getRect().getHeight() / 2; + F32 x = (F32)(getRect().getWidth() / 2); + F32 y = (F32)(getRect().getHeight() / 2); LLFontGL::getFontEmojiLarge()->render( mChar, // wstr 0, // begin_offset @@ -206,7 +206,7 @@ public: static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f); LLColor4 textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor); S32 max_pixels = clientWidth - iconWidth; - drawName(iconWidth, centerY, max_pixels, textColor); + drawName((F32)iconWidth, centerY, max_pixels, textColor); } protected: @@ -229,7 +229,7 @@ protected: void drawName(F32 x, F32 y, S32 max_pixels, LLColor4& color) { F32 x0 = x; - F32 x1 = max_pixels; + F32 x1 = (F32)max_pixels; LLFontGL* font = LLFontGL::getFontEmojiLarge(); if (mBegin) { @@ -245,7 +245,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast<S32>(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels F32 dx = font->getWidthF32(text); x0 += dx; x1 -= dx; @@ -264,7 +264,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast<S32>(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels F32 dx = font->getWidthF32(text); x0 += dx; x1 -= dx; @@ -283,7 +283,7 @@ protected: LLFontGL::NORMAL, // style LLFontGL::DROP_SHADOW_SOFT, // shadow static_cast<S32>(text.size()), // max_chars - x1); // max_pixels + (S32)x1); // max_pixels } } @@ -849,8 +849,7 @@ void LLFloaterEmojiPicker::createEmojiIcon(const LLEmojiSearchResult& emoji, void LLFloaterEmojiPicker::showPreview(bool show) { - //mPreview->setIcon(nullptr); - mDummy->setVisible(show); + mDummy->setVisible(!show); mPreview->setVisible(show); } @@ -865,7 +864,7 @@ void LLFloaterEmojiPicker::onGroupButtonClick(LLUICtrl* ctrl) if (it == mGroupButtons.end()) return; - selectEmojiGroup(it - mGroupButtons.begin()); + selectEmojiGroup((U32)(it - mGroupButtons.begin())); } } diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 32c4f6205d..3b8a25b3a6 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -292,7 +292,7 @@ void LLFloaterEnvironmentAdjust::onHazeHorizonChanged() { if (!mLiveSky) return; - mLiveSky->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); + mLiveSky->setHazeHorizon((F32)getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); mLiveSky->update(); } @@ -300,7 +300,7 @@ void LLFloaterEnvironmentAdjust::onHazeDensityChanged() { if (!mLiveSky) return; - mLiveSky->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); + mLiveSky->setHazeDensity((F32)getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); mLiveSky->update(); } @@ -308,7 +308,7 @@ void LLFloaterEnvironmentAdjust::onSceneGammaChanged() { if (!mLiveSky) return; - mLiveSky->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); + mLiveSky->setGamma((F32)getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); mLiveSky->update(); } @@ -324,7 +324,7 @@ void LLFloaterEnvironmentAdjust::onCloudCoverageChanged() { if (!mLiveSky) return; - mLiveSky->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); + mLiveSky->setCloudShadow((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); mLiveSky->update(); } @@ -332,7 +332,7 @@ void LLFloaterEnvironmentAdjust::onCloudScaleChanged() { if (!mLiveSky) return; - mLiveSky->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); + mLiveSky->setCloudScale((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); mLiveSky->update(); } @@ -340,7 +340,7 @@ void LLFloaterEnvironmentAdjust::onGlowChanged() { if (!mLiveSky) return; - LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); + LLColor3 glow((F32)getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, (F32)getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); // takes 0 - 1.99 UI range -> 40 -> 0.2 range glow.mV[0] = (2.0f - glow.mV[0]) * SLIDER_SCALE_GLOW_R; @@ -354,7 +354,7 @@ void LLFloaterEnvironmentAdjust::onStarBrightnessChanged() { if (!mLiveSky) return; - mLiveSky->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); + mLiveSky->setStarBrightness((F32)getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); mLiveSky->update(); } @@ -375,8 +375,8 @@ void LLFloaterEnvironmentAdjust::onSunRotationChanged() void LLFloaterEnvironmentAdjust::onSunAzimElevChanged() { - F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); - F32 elevation = getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + F32 azimuth = (F32)getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = (F32)getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); LLQuaternion quat; azimuth *= DEG_TO_RAD; @@ -405,7 +405,7 @@ void LLFloaterEnvironmentAdjust::onSunScaleChanged() { if (!mLiveSky) return; - mLiveSky->setSunScale((getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal())); + mLiveSky->setSunScale((F32)(getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal())); mLiveSky->update(); } @@ -426,8 +426,8 @@ void LLFloaterEnvironmentAdjust::onMoonRotationChanged() void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged() { - F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); - F32 elevation = getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + F32 azimuth = (F32)getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = (F32)getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); LLQuaternion quat; azimuth *= DEG_TO_RAD; @@ -483,7 +483,7 @@ void LLFloaterEnvironmentAdjust::onSunColorChanged() void LLFloaterEnvironmentAdjust::onReflectionProbeAmbianceChanged() { if (!mLiveSky) return; - F32 ambiance = getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); + F32 ambiance = (F32)getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); mLiveSky->setReflectionProbeAmbiance(ambiance); updateGammaLabel(); diff --git a/indra/newview/llfloatergltfasseteditor.cpp b/indra/newview/llfloatergltfasseteditor.cpp index f21b8032d0..d2cf24f1dd 100644 --- a/indra/newview/llfloatergltfasseteditor.cpp +++ b/indra/newview/llfloatergltfasseteditor.cpp @@ -52,11 +52,9 @@ LLFloaterGLTFAssetEditor::LLFloaterGLTFAssetEditor(const LLSD& key) LLFloaterGLTFAssetEditor::~LLFloaterGLTFAssetEditor() { - gIdleCallbacks.deleteFunction(idle, this); - if (mScroller) { - removeChild(mScroller); + mItemListPanel->removeChild(mScroller); delete mScroller; mScroller = NULL; } @@ -120,7 +118,7 @@ void LLFloaterGLTFAssetEditor::initFolderRoot() // Insert that scroller into the panel widgets hierarchy mItemListPanel->addChild(mScroller); - // Create the root model and view for all conversation sessions + // Create the root model LLGLTFFolderItem* base_item = new LLGLTFFolderItem(mGLTFViewModel); LLFolderView::Params p(LLUICtrlFactory::getDefaultParams<LLFolderView>()); @@ -144,15 +142,32 @@ void LLFloaterGLTFAssetEditor::initFolderRoot() mFolderRoot->setOpen(true); mFolderRoot->setSelectCallback([this](const std::deque<LLFolderViewItem*>& items, bool user_action) { onFolderSelectionChanged(items, user_action); }); mScroller->setVisible(true); - - gIdleCallbacks.addFunction(idle, this); } void LLFloaterGLTFAssetEditor::onOpen(const LLSD& key) { + gIdleCallbacks.addFunction(idle, this); loadFromSelection(); } +void LLFloaterGLTFAssetEditor::onClose(bool app_quitting) +{ + gIdleCallbacks.deleteFunction(idle, this); + mAsset = nullptr; + mObject = nullptr; +} + +void LLFloaterGLTFAssetEditor::clearRoot() +{ + LLFolderViewFolder::folders_t::iterator folders_it = mFolderRoot->getFoldersBegin(); + while (folders_it != mFolderRoot->getFoldersEnd()) + { + (*folders_it)->destroyView(); + folders_it = mFolderRoot->getFoldersBegin(); + } + mNodeToItemMap.clear(); +} + void LLFloaterGLTFAssetEditor::idle(void* user_data) { LLFloaterGLTFAssetEditor* floater = (LLFloaterGLTFAssetEditor*)user_data; @@ -216,6 +231,8 @@ void LLFloaterGLTFAssetEditor::loadFromNode(S32 node_id, LLFolderViewFolder* par view->setVisible(true); view->setOpen(true); + mNodeToItemMap[node_id] = view; + for (S32& node_id : node.mChildren) { loadFromNode(node_id, view); @@ -246,8 +263,12 @@ void LLFloaterGLTFAssetEditor::loadFromNode(S32 node_id, LLFolderViewFolder* par void LLFloaterGLTFAssetEditor::loadFromSelection() { - if (!mFolderRoot || LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 1) + clearRoot(); + + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 1) { + mAsset = nullptr; + mObject = nullptr; return; } @@ -255,14 +276,19 @@ void LLFloaterGLTFAssetEditor::loadFromSelection() LLViewerObject* objectp = node->getObject(); if (!objectp) { + mAsset = nullptr; + mObject = nullptr; return; } - mAsset = objectp->mGLTFAsset; - if (!mAsset) + if (!objectp->mGLTFAsset) { + mAsset = nullptr; + mObject = nullptr; return; } + mAsset = objectp->mGLTFAsset; + mObject = objectp; if (node->mName.empty()) { @@ -289,7 +315,6 @@ void LLFloaterGLTFAssetEditor::loadFromSelection() LLGLTFFolderItem* listener = new LLGLTFFolderItem(i, name, LLGLTFFolderItem::TYPE_SCENE, mGLTFViewModel); - LLFolderViewFolder::Params p; p.name = name; p.root = mFolderRoot; @@ -316,6 +341,55 @@ void LLFloaterGLTFAssetEditor::loadFromSelection() mFolderRoot->update(); } +void LLFloaterGLTFAssetEditor::dirty() +{ + if (!mObject || !mAsset || !mFolderRoot) + { + return; + } + + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1) + { + if (getVisible()) + { + closeFloater(); + } + return; + } + + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(NULL); + if (!node) + { + // not yet updated? + // Todo: Subscribe to deletion in some way + return; + } + + LLViewerObject* objectp = node->getObject(); + if (mObject != objectp || !objectp->mGLTFAsset) + { + if (getVisible()) + { + closeFloater(); + } + return; + } + + if (mAsset != objectp->mGLTFAsset) + { + loadFromSelection(); + return; + } + + auto found = mNodeToItemMap.find(node->mSelectedGLTFNode); + if (found != mNodeToItemMap.end()) + { + LLFolderViewItem* itemp = found->second; + itemp->arrangeAndSet(true, false); + loadNodeTransforms(node->mSelectedGLTFNode); + } +} + void LLFloaterGLTFAssetEditor::onFolderSelectionChanged(const std::deque<LLFolderViewItem*>& items, bool user_action) { if (items.empty()) @@ -329,10 +403,30 @@ void LLFloaterGLTFAssetEditor::onFolderSelectionChanged(const std::deque<LLFolde switch (vmi->getType()) { + case LLGLTFFolderItem::TYPE_SCENE: + { + setTransformsEnabled(false); + LLSelectMgr::getInstance()->selectObjectOnly(mObject, SELECT_ALL_TES, -1, -1); + break; + } case LLGLTFFolderItem::TYPE_NODE: { setTransformsEnabled(true); loadNodeTransforms(vmi->getItemId()); + LLSelectMgr::getInstance()->selectObjectOnly(mObject, SELECT_ALL_TES, vmi->getItemId(), 0); + break; + } + case LLGLTFFolderItem::TYPE_MESH: + case LLGLTFFolderItem::TYPE_SKIN: + { + if (item->getParent()) // should be a node + { + LLFolderViewFolder* parent = item->getParentFolder(); + LLGLTFFolderItem* parent_vmi = static_cast<LLGLTFFolderItem*>(parent->getViewModelItem()); + LLSelectMgr::getInstance()->selectObjectOnly(mObject, SELECT_ALL_TES, parent_vmi->getItemId(), 0); + } + + setTransformsEnabled(false); break; } default: @@ -368,6 +462,7 @@ void LLFloaterGLTFAssetEditor::loadNodeTransforms(S32 node_id) } LL::GLTF::Node& node = mAsset->mNodes[node_id]; + node.makeTRSValid(); mCtrlPosX->set(node.mTranslation[0]); mCtrlPosY->set(node.mTranslation[1]); diff --git a/indra/newview/llfloatergltfasseteditor.h b/indra/newview/llfloatergltfasseteditor.h index e35ed30ed0..b0ba8941b9 100644 --- a/indra/newview/llfloatergltfasseteditor.h +++ b/indra/newview/llfloatergltfasseteditor.h @@ -42,6 +42,7 @@ namespace LL class LLSpinCtrl; class LLMenuButton; +class LLViewerObject; class LLFloaterGLTFAssetEditor : public LLFloater { @@ -51,6 +52,7 @@ public: bool postBuild() override; void onOpen(const LLSD& key) override; + void onClose(bool app_quitting) override; void initFolderRoot(); LLGLTFViewModel& getRootViewModel() { return mGLTFViewModel; } @@ -60,6 +62,8 @@ public: void loadFromNode(S32 node, LLFolderViewFolder* parent); void loadFromSelection(); + void dirty(); + protected: void onFolderSelectionChanged(const std::deque<LLFolderViewItem*>& items, bool user_action); void onCommitTransform(); @@ -69,8 +73,11 @@ protected: void setTransformsEnabled(bool val); void loadNodeTransforms(S32 id); + void clearRoot(); + private: + LLPointer<LLViewerObject> mObject; std::shared_ptr<LL::GLTF::Asset> mAsset; // Folder view related @@ -79,6 +86,7 @@ private: LLPanel* mItemListPanel = nullptr; LLFolderView* mFolderRoot = nullptr; LLScrollContainer* mScroller = nullptr; + std::map<S32, LLFolderViewItem*> mNodeToItemMap; // Transforms panel LLVector3 mLastEulerDegrees; diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index ea49c88755..a900e04707 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -671,7 +671,7 @@ bool LLImagePreviewAvatar::render() gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); gGL.loadIdentity(); - gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.ortho(0.0f, (F32)mFullWidth, 0.0f, (F32)mFullHeight, -1.0f, 1.0f); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -875,7 +875,7 @@ bool LLImagePreviewSculpted::render() gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); gGL.loadIdentity(); - gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.ortho(0.0f, (F32)mFullWidth, 0.0f, (F32)mFullHeight, -1.0f, 1.0f); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index ef7ec9e950..5cf02d1ec0 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -263,8 +263,8 @@ bool LLFloaterIMNearbyChatScreenChannel::createPoolToast() LLToast::Params p; p.panel = panel; - p.lifetime_secs = gSavedSettings.getS32("NearbyToastLifeTime"); - p.fading_time_secs = gSavedSettings.getS32("NearbyToastFadingTime"); + p.lifetime_secs = (F32)gSavedSettings.getS32("NearbyToastLifeTime"); + p.fading_time_secs = (F32)gSavedSettings.getS32("NearbyToastFadingTime"); LLToast* toast = new LLFloaterIMNearbyChatToast(p, this); @@ -643,8 +643,18 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, } } + std::string user_preferences; + if (chat_msg.mSourceType == CHAT_SOURCE_OBJECT) + { + user_preferences = gSavedSettings.getString("NotificationObjectIMOptions"); + } + else + { + user_preferences = gSavedSettings.getString("NotificationNearbyChatOptions"); + } + //Will show toast when chat preference is set - if((gSavedSettings.getString("NotificationNearbyChatOptions") == "toast") || !nearby_chat->isMessagePaneExpanded()) + if((user_preferences == "toast") || !nearby_chat->isMessagePaneExpanded()) { // Add a nearby chat toast. LLUUID id; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 9a794d1775..41b6025e0f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1706,7 +1706,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo object_count_str = llformat("%d", object_count); item_params.columns.add().value(object_count_str).font(FONT).column("count"); - item_params.columns.add().value(LLDate((time_t)most_recent_time)).font(FONT).column("mostrecent").type("date"); + item_params.columns.add().value(LLDate((double)most_recent_time)).font(FONT).column("mostrecent").type("date"); self->mOwnerList->addNameItemRow(item_params); LL_DEBUGS() << "object owner " << owner_id << " (" << (is_group_owned ? "group" : "agent") @@ -2527,7 +2527,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = time(NULL); + S32 now = (S32)time(NULL); S32 seconds = entry.mTime - now; if (seconds < 0) seconds = 0; prefix.assign(" ("); @@ -2576,7 +2576,7 @@ void LLPanelLandAccess::refresh() if (entry.mTime != 0) { LLStringUtil::format_map_t args; - S32 now = time(NULL); + S32 now = (S32)time(NULL); seconds = entry.mTime - now; if (seconds < 0) seconds = 0; diff --git a/indra/newview/llfloatermemleak.cpp b/indra/newview/llfloatermemleak.cpp index cd5bea1be4..b4bb45c864 100644 --- a/indra/newview/llfloatermemleak.cpp +++ b/indra/newview/llfloatermemleak.cpp @@ -60,7 +60,7 @@ LLFloaterMemLeak::LLFloaterMemLeak(const LLSD& key) bool LLFloaterMemLeak::postBuild(void) { F32 a, b ; - a = getChild<LLUICtrl>("leak_speed")->getValue().asReal(); + a = (F32)getChild<LLUICtrl>("leak_speed")->getValue().asReal(); if(a > (F32)(0xFFFFFFFF)) { sMemLeakingSpeed = 0xFFFFFFFF ; @@ -69,7 +69,7 @@ bool LLFloaterMemLeak::postBuild(void) { sMemLeakingSpeed = (U32)a ; } - b = getChild<LLUICtrl>("max_leak")->getValue().asReal(); + b = (F32)getChild<LLUICtrl>("max_leak")->getValue().asReal(); if(b > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -150,8 +150,7 @@ void LLFloaterMemLeak::idle() //---------------------- void LLFloaterMemLeak::onChangeLeakingSpeed() { - F32 tmp ; - tmp =getChild<LLUICtrl>("leak_speed")->getValue().asReal(); + F32 tmp = (F32)getChild<LLUICtrl>("leak_speed")->getValue().asReal(); if(tmp > (F32)0xFFFFFFFF) { @@ -161,14 +160,11 @@ void LLFloaterMemLeak::onChangeLeakingSpeed() { sMemLeakingSpeed = (U32)tmp ; } - } void LLFloaterMemLeak::onChangeMaxMemLeaking() { - - F32 tmp ; - tmp =getChild<LLUICtrl>("max_leak")->getValue().asReal(); + F32 tmp = (F32)getChild<LLUICtrl>("max_leak")->getValue().asReal(); if(tmp > (F32)0xFFF) { sMaxLeakedMem = 0xFFFFFFFF ; @@ -177,7 +173,6 @@ void LLFloaterMemLeak::onChangeMaxMemLeaking() { sMaxLeakedMem = ((U32)tmp) << 20 ; } - } void LLFloaterMemLeak::onClickStart() diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index a91cdba5c0..5ca727cf66 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1198,7 +1198,7 @@ void LLFloaterModelPreview::initDecompControls() else if (LLSpinCtrl* spinner = dynamic_cast<LLSpinCtrl*>(ctrl)) { bool is_retain_ctrl = "Retain%" == name; - double coefficient = is_retain_ctrl ? RETAIN_COEFFICIENT : 1.f; + float coefficient = is_retain_ctrl ? (F32)RETAIN_COEFFICIENT : 1.f; spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat * coefficient); spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat * coefficient); @@ -1238,10 +1238,10 @@ void LLFloaterModelPreview::initDecompControls() LLUICtrl* ctrl = getChild<LLUICtrl>(name); if (LLSliderCtrl* slider = dynamic_cast<LLSliderCtrl*>(ctrl)) { - slider->setMinValue(param[i].mDetails.mRange.mLow.mIntOrEnumValue); - slider->setMaxValue(param[i].mDetails.mRange.mHigh.mIntOrEnumValue); - slider->setIncrement(param[i].mDetails.mRange.mDelta.mIntOrEnumValue); - slider->setValue(param[i].mDefault.mIntOrEnumValue); + slider->setMinValue((F32)param[i].mDetails.mRange.mLow.mIntOrEnumValue); + slider->setMaxValue((F32)param[i].mDetails.mRange.mHigh.mIntOrEnumValue); + slider->setIncrement((F32)param[i].mDetails.mRange.mDelta.mIntOrEnumValue); + slider->setValue((F32)param[i].mDefault.mIntOrEnumValue); slider->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); } else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(ctrl)) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 85a07f23a4..5e5cfcecbf 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1101,7 +1101,7 @@ void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue) if (color_swatch) { LLColor4 new_color = color_swatch->get(); - color_swatch->set( new_color.setAlpha(newvalue.asReal()) ); + color_swatch->set(new_color.setAlpha((F32)newvalue.asReal())); } } @@ -1910,7 +1910,7 @@ void LLFloaterPreference::setCacheLocation(const LLStringExplicit& location) void LLFloaterPreference::selectPanel(const LLSD& name) { LLTabContainer * tab_containerp = getChild<LLTabContainer>("pref core"); - LLPanel * panel = tab_containerp->getPanelByName(name); + LLPanel * panel = tab_containerp->getPanelByName(name.asStringRef()); if (NULL != panel) { tab_containerp->selectTabPanel(panel); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index 082a77d741..d66c303c65 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -270,8 +270,6 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() { LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections"); LLTextBox* reflections_text = getChild<LLTextBox>("ReflectionsText"); - LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders"); LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); LLComboBox* ctrl_shadows = getChild<LLComboBox>("ShadowDetail"); @@ -336,45 +334,6 @@ void LLFloaterPreferenceGraphicsAdvanced::disableUnavailableSettings() ctrl_shadows->setValue(0); shadows_text->setEnabled(false); } - - // disabled reflections - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionDetail")) - { - ctrl_reflections->setEnabled(false); - ctrl_reflections->setValue(false); - reflections_text->setEnabled(false); - } - - // disabled av - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP")) - { - ctrl_avatar_vp->setEnabled(false); - ctrl_avatar_vp->setValue(false); - - ctrl_avatar_cloth->setEnabled(false); - ctrl_avatar_cloth->setValue(false); - - //deferred needs AvatarVP, disable deferred - ctrl_shadows->setEnabled(false); - ctrl_shadows->setValue(0); - shadows_text->setEnabled(false); - - ctrl_ssao->setEnabled(false); - ctrl_ssao->setValue(false); - - ctrl_dof->setEnabled(false); - ctrl_dof->setValue(false); - - ctrl_deferred->setEnabled(false); - ctrl_deferred->setValue(false); - } - - // disabled cloth - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarCloth")) - { - ctrl_avatar_cloth->setEnabled(false); - ctrl_avatar_cloth->setValue(false); - } } void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() @@ -392,23 +351,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() bool bumpshiny = LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); bumpshiny_ctrl->setEnabled(bumpshiny); - // Avatar Mode - // Enable Avatar Shaders - LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); - // Avatar Render Mode - LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); - - bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); - if (LLViewerShaderMgr::sInitialized) - { - S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; - avatar_vp_enabled = max_avatar_shader > 0; - } - - ctrl_avatar_vp->setEnabled(avatar_vp_enabled); - - ctrl_avatar_cloth->setEnabled(gSavedSettings.getBOOL("RenderAvatarVP")); - // Vertex Shaders, Global Shader Enable // SL-12594 Basic shaders are always enabled. DJH TODO clean up now-orphaned state handling code LLSliderCtrl* terrain_detail = getChild<LLSliderCtrl>("TerrainDetail"); // can be linked with control var diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index 47b3aa015b..8cb941cb12 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -244,8 +244,8 @@ void LLFloaterProfileTexture::updateDimensions() if (biggest_dim > MAX_DIMENTIONS) { F32 scale_down = MAX_DIMENTIONS / (F32)biggest_dim; - width *= scale_down; - height *= scale_down; + width = (S32)(width * scale_down); + height = (S32)(height * scale_down); } //reshape floater diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c019bd047d..41d1fcff82 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -519,7 +519,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->getChild<LLUICtrl>("object_bonus_spin")->setValue(LLSD(object_bonus_factor)); panel->getChild<LLUICtrl>("access_combo")->setValue(LLSD(sim_access)); - panel->getChild<LLSpinCtrl>("agent_limit_spin")->setMaxValue(hard_agent_limit); + panel->getChild<LLSpinCtrl>("agent_limit_spin")->setMaxValue((F32)hard_agent_limit); LLPanelRegionGeneralInfo* panel_general = LLFloaterRegionInfo::getPanelGeneral(); if (panel) @@ -1561,7 +1561,7 @@ bool LLPanelRegionTerrainInfo::postBuild() { mTextureDetailCtrl[i]->setBakeTextureEnabled(false); } - initAndSetCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i)); + initMaterialCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i), i); initAndSetCtrl(mMaterialScaleUCtrl[i], llformat("terrain%dScaleU", i)); initAndSetCtrl(mMaterialScaleVCtrl[i], llformat("terrain%dScaleV", i)); @@ -1931,11 +1931,11 @@ bool LLPanelRegionTerrainInfo::sendUpdate() for (U32 tt = 0; tt < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++tt) { LLGLTFMaterial::TextureTransform& transform = mat_override->mTextureTransform[tt]; - transform.mScale.mV[VX] = mMaterialScaleUCtrl[i]->getValue().asReal(); - transform.mScale.mV[VY] = mMaterialScaleVCtrl[i]->getValue().asReal(); - transform.mRotation = mMaterialRotationCtrl[i]->getValue().asReal() * DEG_TO_RAD; - transform.mOffset.mV[VX] = mMaterialOffsetUCtrl[i]->getValue().asReal(); - transform.mOffset.mV[VY] = mMaterialOffsetVCtrl[i]->getValue().asReal(); + transform.mScale.mV[VX] = (F32)mMaterialScaleUCtrl[i]->getValue().asReal(); + transform.mScale.mV[VY] = (F32)mMaterialScaleVCtrl[i]->getValue().asReal(); + transform.mRotation = (F32)mMaterialRotationCtrl[i]->getValue().asReal() * DEG_TO_RAD; + transform.mOffset.mV[VX] = (F32)mMaterialOffsetUCtrl[i]->getValue().asReal(); + transform.mOffset.mV[VY] = (F32)mMaterialOffsetVCtrl[i]->getValue().asReal(); } } @@ -1958,6 +1958,31 @@ bool LLPanelRegionTerrainInfo::sendUpdate() return true; } +void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index) +{ + ctrl = findChild<LLTextureCtrl>(name, true); + if (!ctrl) return; + + // consume cancel events, otherwise they will trigger commit callbacks + ctrl->setOnCancelCallback([](LLUICtrl* ctrl, const LLSD& param) {}); + ctrl->setCommitCallback( + [this, index](LLUICtrl* ctrl, const LLSD& param) + { + if (!mMaterialScaleUCtrl[index] + || !mMaterialScaleVCtrl[index] + || !mMaterialRotationCtrl[index] + || !mMaterialOffsetUCtrl[index] + || !mMaterialOffsetVCtrl[index]) return; + + mMaterialScaleUCtrl[index]->setValue(1.f); + mMaterialScaleVCtrl[index]->setValue(1.f); + mMaterialRotationCtrl[index]->setValue(0.f); + mMaterialOffsetUCtrl[index]->setValue(0.f); + mMaterialOffsetVCtrl[index]->setValue(0.f); + onChangeAnything(); + }); +} + bool LLPanelRegionTerrainInfo::callbackTextureHeights(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 5623bc20cb..60564435d7 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -273,6 +273,8 @@ public: protected: bool sendUpdate() override; + void initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index); + private: bool mConfirmedTextureHeights; bool mAskedTextureHeights; diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 17707e808e..525317304d 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -131,10 +131,10 @@ void LLFloaterSettingsDebug::onCommitSettings() controlp->set(vectord.getValue()); break; case TYPE_QUAT: - quat.mQ[VX] = getChild<LLUICtrl>("val_spinner_1")->getValue().asReal(); - quat.mQ[VY] = getChild<LLUICtrl>("val_spinner_2")->getValue().asReal(); - quat.mQ[VZ] = getChild<LLUICtrl>("val_spinner_3")->getValue().asReal(); - quat.mQ[VS] = getChild<LLUICtrl>("val_spinner_4")->getValue().asReal();; + quat.mQ[VX] = (F32)getChild<LLUICtrl>("val_spinner_1")->getValue().asReal(); + quat.mQ[VY] = (F32)getChild<LLUICtrl>("val_spinner_2")->getValue().asReal(); + quat.mQ[VZ] = (F32)getChild<LLUICtrl>("val_spinner_3")->getValue().asReal(); + quat.mQ[VS] = (F32)getChild<LLUICtrl>("val_spinner_4")->getValue().asReal();; controlp->set(quat.getValue()); break; case TYPE_RECT: diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 2f6d14d6b5..48547852c4 100644 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -113,7 +113,7 @@ LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater() return topmost_floater; } -LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) +LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name, const LLSD& params) { LLView* view = findChildView(panel_name, true); if (!view) @@ -144,7 +144,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na return panel; } -void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key) +void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) @@ -153,7 +153,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con } } -void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key) +void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); if (floaterp) @@ -162,7 +162,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con } } -LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, const std::string& panel_name) +LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, std::string_view panel_name) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name); @@ -174,7 +174,7 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, return NULL; } -LLPanel* LLFloaterSidePanelContainer::findPanel(const std::string& floater_name, const std::string& panel_name) +LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, std::string_view panel_name) { LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance<LLFloaterSidePanelContainer>(floater_name); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index d5d0c43cae..19d6c747cb 100644 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -55,17 +55,17 @@ public: void cleanup() { destroy(); } - LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); + LLPanel* openChildPanel(std::string_view panel_name, const LLSD& params); static LLFloater* getTopmostInventoryFloater(); - static void showPanel(const std::string& floater_name, const LLSD& key); + static void showPanel(std::string_view floater_name, const LLSD& key); - static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key); + static void showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key); - static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + static LLPanel* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName); - static LLPanel* findPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName); + static LLPanel* findPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName); /** * Gets the panel of given type T (doesn't show it or do anything else with it). @@ -75,7 +75,7 @@ public: * @returns a pointer to the panel of given type T. */ template <typename T> - static T* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName) + static T* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName) { T* panel = dynamic_cast<T*>(getPanel(floater_name, panel_name)); if (!panel) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 2bac7d6360..75b24a6bbc 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -168,10 +168,10 @@ void LLFloaterSnapshotBase::ImplBase::updateLayout(LLFloaterSnapshotBase* floate panel_width = 700.f; } - S32 floater_width = 224.f; + S32 floater_width{ 224 }; if(mAdvanced) { - floater_width = floater_width + panel_width; + floater_width = floater_width + (S32)panel_width; } LLUICtrl* thumbnail_placeholder = floaterp->getChild<LLUICtrl>("thumbnail_placeholder"); @@ -185,7 +185,7 @@ void LLFloaterSnapshotBase::ImplBase::updateLayout(LLFloaterSnapshotBase* floate } if (!mSkipReshaping) { - thumbnail_placeholder->reshape(panel_width, thumbnail_placeholder->getRect().getHeight()); + thumbnail_placeholder->reshape((S32)panel_width, thumbnail_placeholder->getRect().getHeight()); if (!floaterp->isMinimized()) { floaterp->reshape(floater_width, floaterp->getRect().getHeight()); @@ -283,7 +283,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) width_ctrl->setValue(w); if (getActiveSnapshotType(floater) == LLSnapshotModel::SNAPSHOT_TEXTURE) { - width_ctrl->setIncrement(w >> 1); + width_ctrl->setIncrement((F32)(w >> 1)); } } if (height_ctrl->getValue().asInteger() == 0) @@ -293,7 +293,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) height_ctrl->setValue(h); if (getActiveSnapshotType(floater) == LLSnapshotModel::SNAPSHOT_TEXTURE) { - height_ctrl->setIncrement(h >> 1); + height_ctrl->setIncrement((F32)(h >> 1)); } } @@ -303,9 +303,9 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater) S32 width = gViewerWindow->getWindowWidthRaw(); S32 height = gViewerWindow->getWindowHeightRaw(); - width_ctrl->setMaxValue(width); + width_ctrl->setMaxValue((F32)width); - height_ctrl->setMaxValue(height); + height_ctrl->setMaxValue((F32)height); if (width_ctrl->getValue().asInteger() > width) { @@ -761,8 +761,8 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, bool getHeightSpinner(view)->setValue(height); if (getActiveSnapshotType(view) == LLSnapshotModel::SNAPSHOT_TEXTURE) { - getWidthSpinner(view)->setIncrement(width >> 1); - getHeightSpinner(view)->setIncrement(height >> 1); + getWidthSpinner(view)->setIncrement((F32)(width >> 1)); + getHeightSpinner(view)->setIncrement((F32)(height >> 1)); } } @@ -882,8 +882,8 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshotBase* getHeightSpinner(view)->forceSetValue(height); if (getActiveSnapshotType(view) == LLSnapshotModel::SNAPSHOT_TEXTURE) { - getWidthSpinner(view)->setIncrement(width >> 1); - getHeightSpinner(view)->setIncrement(height >> 1); + getWidthSpinner(view)->setIncrement((F32)(width >> 1)); + getHeightSpinner(view)->setIncrement((F32)(height >> 1)); } } diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 64b22c4bb1..9bc8c63fa0 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -195,7 +195,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) { parcel_buf = parcel_name; script_memory = script_size; - total_memory += script_size; + total_memory += (U64)script_size; } } @@ -233,7 +233,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) columns[column_num]["column"] = "time"; columns[column_num]["type"] = "date"; - columns[column_num]["value"] = LLDate((time_t)time_stamp); + columns[column_num]["value"] = LLDate((double)time_stamp); columns[column_num++]["font"] = "SANSSERIF"; if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 6f526e1905..7c49db9c54 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -1598,7 +1598,7 @@ void LLOverlapPanel::draw() if(!LLView::sPreviewClickedElement) { - LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 + LLUI::translate(5.f, (F32)getRect().getHeight() - 20.f); // translate to top-5,left-5 LLView::sDrawPreviewHighlights = false; LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text, 0, 0, 0, text_color, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW); @@ -1614,7 +1614,7 @@ void LLOverlapPanel::draw() std::list<LLView*> overlappers = mOverlapMap[LLView::sPreviewClickedElement]; if(overlappers.size() == 0) { - LLUI::translate(5,getRect().getHeight()-20); // translate to top-5,left-5 + LLUI::translate(5.f, (F32)getRect().getHeight() - 20.f); // translate to top-5,left-5 LLView::sDrawPreviewHighlights = false; std::string current_selection = std::string(current_selection_text + LLView::sPreviewClickedElement->getName() + " (no elements overlap)"); S32 text_width = LLFontGL::getFontSansSerifSmall()->getWidth(current_selection) + 10; @@ -1679,14 +1679,14 @@ void LLOverlapPanel::draw() setRect(LLRect(rect.mLeft,rect.mTop,rect.mRight,rect.mTop-height_sum)); } - LLUI::translate(5,getRect().getHeight()-10); // translate to top left + LLUI::translate(5.f, (F32)getRect().getHeight() - 10.f); // translate to top left LLView::sDrawPreviewHighlights = false; // draw currently-selected element at top of overlappers - LLUI::translate(0,-mSpacing); + LLUI::translate(0.f, -(F32)mSpacing); LLFontGL::getFontSansSerifSmall()->renderUTF8(current_selection_text + LLView::sPreviewClickedElement->getName(), 0, 0, 0, text_color, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW); - LLUI::translate(0,-mSpacing-LLView::sPreviewClickedElement->getRect().getHeight()); // skip spacing distance + height + LLUI::translate(0.f, -(F32)mSpacing - (F32)LLView::sPreviewClickedElement->getRect().getHeight()); // skip spacing distance + height LLView::sPreviewClickedElement->draw(); for(std::list<LLView*>::iterator overlap_it = overlappers.begin(); overlap_it != overlappers.end(); ++overlap_it) @@ -1694,16 +1694,16 @@ void LLOverlapPanel::draw() LLView* viewp = *overlap_it; // draw separating line - LLUI::translate(0,-mSpacing); + LLUI::translate(0.f, -(F32)mSpacing); gl_line_2d(0,0,getRect().getWidth()-10,0,LLColor4(192.0f/255.0f,192.0f/255.0f,192.0f/255.0f)); // draw name - LLUI::translate(0,-mSpacing); + LLUI::translate(0.f, -(F32)mSpacing); LLFontGL::getFontSansSerifSmall()->renderUTF8(overlapper_text + viewp->getName(), 0, 0, 0, text_color, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW); // draw element - LLUI::translate(0,-mSpacing-viewp->getRect().getHeight()); // skip spacing distance + height + LLUI::translate(0.f, -(F32)mSpacing - (F32)viewp->getRect().getHeight()); // skip spacing distance + height viewp->draw(); } mLastClickedElement = LLView::sPreviewClickedElement; diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index f5b5b8293f..e1b6df6072 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -220,7 +220,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p) // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class()); if(instances.size() >= (size_t)browser_window_limit) { diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 08f8918e5d..19cb4d04e2 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -893,7 +893,7 @@ void LLSky::renderSunMoonBeacons(const LLVector3& pos_agent, const LLVector3& di { pos_end.mV[i] = pos_agent.mV[i] + (50 * direction.mV[i]); } - glLineWidth(LLPipeline::DebugBeaconLineWidth); + glLineWidth((GLfloat)LLPipeline::DebugBeaconLineWidth); gGL.begin(LLRender::LINES); color.mV[3] *= 0.5f; gGL.color4fv(color.mV); @@ -1190,8 +1190,8 @@ F32 gpu_benchmark() F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; F32 seconds = ms/1000.f; - F64 samples_drawn = gBenchmarkProgram.mSamplesDrawn; - F32 samples_sec = (samples_drawn/1000000000.0)/seconds; + F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; + F32 samples_sec = (F32)((samples_drawn/1000000000.0)/seconds); gbps = samples_sec*4; // 4 bytes per sample LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp index a198d1bdf4..06920734fe 100644 --- a/indra/newview/llgltfmaterialpreviewmgr.cpp +++ b/indra/newview/llgltfmaterialpreviewmgr.cpp @@ -462,7 +462,7 @@ bool LLGLTFPreviewTexture::render() // Set up camera and viewport const LLVector3 origin(0.0, 0.0, 0.0); camera.lookAt(origin, object_position); - camera.setAspect(mFullHeight / mFullWidth); + camera.setAspect((F32)(mFullHeight / mFullWidth)); const LLRect texture_rect(0, mFullHeight, mFullWidth, 0); camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 100aacb8ac..1057bc25e0 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -190,7 +190,7 @@ S32 LLGroupRoleData::getMembersInRole(uuid_vec_t members, in_role_end = std::set_intersection(mMemberIDs.begin(), mMemberIDs.end(), members.begin(), members.end(), in_role.begin()); - return in_role_end - in_role.begin(); + return (S32)(in_role_end - in_role.begin()); } void LLGroupRoleData::addMember(const LLUUID& member) @@ -1569,7 +1569,7 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap) { // LRU: Remove the oldest un-observed group from cache until group size is small enough - F32 oldest_access = LLFrameTimer::getTotalSeconds(); + F32 oldest_access = (F32)LLFrameTimer::getTotalSeconds(); group_map_t::iterator oldest_gi = mGroups.end(); for (group_map_t::iterator gi = mGroups.begin(); gi != mGroups.end(); ++gi ) diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index cbe1105024..91051f8235 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -98,7 +98,7 @@ void LLHeroProbeManager::update() if (mMipChain.empty()) { U32 res = mProbeResolution; - U32 count = log2((F32)res) + 0.5f; + U32 count = (U32)(log2((F32)res) + 0.5f); mMipChain.resize(count); for (U32 i = 0; i < count; ++i) @@ -341,7 +341,7 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool gGaussianProgram.unbind(); } - S32 mips = log2((F32)mProbeResolution) + 0.5f; + S32 mips = (S32)(log2((F32)mProbeResolution) + 0.5f); gReflectionMipProgram.bind(); S32 diffuseChannel = gReflectionMipProgram.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, LLTexUnit::TT_TEXTURE); @@ -431,7 +431,7 @@ void LLHeroProbeManager::generateRadiance(LLReflectionMap* probe) static LLStaticHashedString sStrength("probe_strength"); gHeroRadianceGenProgram.uniform1f(sRoughness, (F32) i / (F32) (mMipChain.size() - 1)); - gHeroRadianceGenProgram.uniform1f(sMipLevel, i); + gHeroRadianceGenProgram.uniform1f(sMipLevel, (GLfloat)i); gHeroRadianceGenProgram.uniform1i(sWidth, mProbeResolution); gHeroRadianceGenProgram.uniform1f(sStrength, 1); @@ -533,7 +533,7 @@ void LLHeroProbeManager::initReflectionMaps() mReset = false; mReflectionProbeCount = count; mProbeResolution = gSavedSettings.getS32("RenderHeroProbeResolution"); - mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1 + mMaxProbeLOD = log2f((F32)mProbeResolution) - 1.f; // number of mips - 1 mTexture = new LLCubeMapArray(); diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index 44d33eec93..3e55030610 100644 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -180,7 +180,7 @@ bool LLAdaptiveRetryPolicy::getSecondsUntilRetryAfter(const std::string& retry_a time_t date = curl_getdate(retry_after.c_str(), NULL); if (-1 == date) return false; - seconds_to_wait = (F64)date - LLTimer::getTotalSeconds(); + seconds_to_wait = (F32)((F64)date - LLTimer::getTotalSeconds()); return true; } diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index e1bf6c2077..4011a857e5 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -449,7 +449,7 @@ void LLHUDNameTag::addLine(const std::string &text_utf8, // token does does not fit into signle line, need to draw "...". // Use four dots for ellipsis width to generate padding const LLWString dots_pad(utf8str_to_wstring(std::string("...."))); - S32 elipses_width = font->getWidthF32(dots_pad.c_str()); + S32 elipses_width = (S32)font->getWidthF32(dots_pad.c_str()); // truncated string length segment_length = font->maxDrawableChars(iter->substr(line_length).c_str(), max_pixels - elipses_width, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); const LLWString dots(utf8str_to_wstring(std::string("..."))); @@ -780,7 +780,7 @@ void LLHUDNameTag::updateAll() } LLTrace::CountStatHandle<>* camera_vel_stat = LLViewerCamera::getVelocityStat(); - F32 camera_vel = LLTrace::get_frame_recording().getLastRecording().getPerSec(*camera_vel_stat); + F32 camera_vel = (F32)LLTrace::get_frame_recording().getLastRecording().getPerSec(*camera_vel_stat); if (camera_vel > MAX_STABLE_CAMERA_VELOCITY) { return; diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index e2e83ef42b..e24274650d 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1607,7 +1607,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) } else { - position.set(message_data["local_x"].asReal(), message_data["local_y"].asReal(), message_data["local_z"].asReal()); + position.set((F32)message_data["local_x"].asReal(), (F32)message_data["local_y"].asReal(), (F32)message_data["local_z"].asReal()); } std::vector<U8> bin_bucket; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 05b1fec8e5..b12c2fdc52 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -372,8 +372,10 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) // 4. Toast if ((("toast" == user_preferences) && (ON_TOP_AND_ITEM_IS_SELECTED != conversations_floater_status) && - (!session_floater->isTornOff() || !LLFloater::isVisible(session_floater))) - || !session_floater->isMessagePaneExpanded()) + (!session_floater->isTornOff() + || session_floater->isMinimized() + || !LLFloater::isVisible(session_floater))) + || !session_floater->isMessagePaneExpanded()) { //Show IM toasts (upper right toasts) @@ -4242,7 +4244,7 @@ public: message_params["region_id"].asUUID(), ll_vector3_from_sd(message_params["position"]), false, // is_region_message - timestamp); + (U32)timestamp); if (LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat)) { diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index 75366c4831..24dbe61bad 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -152,7 +152,7 @@ void LLTexturePreviewView::draw() bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0); if (isLoading) - LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, llfloor(rctClient.mLeft + 3), llfloor(rctClient.mTop - 25), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); + LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, rctClient.mLeft + 3, rctClient.mTop - 25, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight())); } } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 114ccfdd3f..e3d4645701 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1519,7 +1519,7 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe void LLInventoryFilter::toParams(Params& params) const { - params.filter_ops.types = getFilterObjectTypes(); + params.filter_ops.types = (U32)getFilterObjectTypes(); params.filter_ops.category_types = getFilterCategoryTypes(); if (getFilterObjectTypes() & FILTERTYPE_WEARABLE) { @@ -1532,7 +1532,7 @@ void LLInventoryFilter::toParams(Params& params) const params.filter_ops.show_folder_state = getShowFolderState(); params.filter_ops.creator_type = getFilterCreatorType(); params.filter_ops.permissions = getFilterPermissions(); - params.filter_ops.search_visibility = getSearchVisibilityTypes(); + params.filter_ops.search_visibility = (U32)getSearchVisibilityTypes(); params.substring = getFilterSubString(); params.since_logoff = isSinceLogoff(); } @@ -1646,7 +1646,7 @@ bool LLInventoryFilter::isTimedOut() void LLInventoryFilter::resetTime(S32 timeout) { mFilterTime.reset(); - F32 time_in_sec = (F32)(timeout)/1000.0; + F32 time_in_sec = (F32)(timeout)/1000.0f; mFilterTime.setTimerExpirySec(time_in_sec); } diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index c69f797868..98b3707457 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2641,7 +2641,7 @@ bool LLInventoryGallery::checkAgainstFilterType(const LLUUID& object_id) { object_type = inv_item->getInventoryType(); } - const U32 filterTypes = mFilter->getFilterTypes(); + const U32 filterTypes = (U32)mFilter->getFilterTypes(); if ((filterTypes & LLInventoryFilter::FILTERTYPE_OBJECT) && inv_item) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9dc13bcf09..6c58eb2ca4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -425,7 +425,7 @@ void LLInventoryPanel::setFilterWorn() U32 LLInventoryPanel::getFilterObjectTypes() const { - return getFilter().getFilterObjectTypes(); + return (U32)getFilter().getFilterObjectTypes(); } U32 LLInventoryPanel::getFilterPermMask() const diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 00dbf9a9f8..4eaf69c39d 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -732,8 +732,8 @@ LLJoystickQuaternion::LLJoystickQuaternion(const LLJoystickQuaternion::Params &p { for (int i = 0; i < 3; ++i) { - mLfRtAxis.mV[i] = (mXAxisIndex == i) ? 1.0 : 0.0; - mUpDnAxis.mV[i] = (mYAxisIndex == i) ? 1.0 : 0.0; + mLfRtAxis.mV[i] = (mXAxisIndex == i) ? 1.0f : 0.0f; + mUpDnAxis.mV[i] = (mYAxisIndex == i) ? 1.0f : 0.0f; } } @@ -864,8 +864,8 @@ void LLJoystickQuaternion::draw() LLVector3 draw_point = mVectorZero * mRotation; S32 halfwidth = getRect().getWidth() / 2; S32 halfheight = getRect().getHeight() / 2; - draw_point.mV[mXAxisIndex] = (draw_point.mV[mXAxisIndex] + 1.0) * halfwidth; - draw_point.mV[mYAxisIndex] = (draw_point.mV[mYAxisIndex] + 1.0) * halfheight; + draw_point.mV[mXAxisIndex] = (draw_point.mV[mXAxisIndex] + 1.0f) * halfwidth; + draw_point.mV[mYAxisIndex] = (draw_point.mV[mYAxisIndex] + 1.0f) * halfheight; gl_circle_2d(draw_point.mV[mXAxisIndex], draw_point.mV[mYAxisIndex], 4, 8, draw_point.mV[mZAxisIndex] >= 0.f); diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index d015c0ed95..f37926a938 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -447,7 +447,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) gViewerWindow->setShowProgress(false); } - showMFAChallange(LLTrans::getString(response["message_id"])); + showMFAChallange(LLTrans::getString(response["message_id"].asString())); } else if( reason_response == "key" || reason_response == "presence" diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index d572605635..aa03001389 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -293,7 +293,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var if (validate_as_uuid) { std::wstring ws(serialNumber, serial_size); - std::string str(ws.begin(), ws.end()); + std::string str = ll_convert_wide_to_string(ws); if (!LLUUID::validate(str)) { diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 2adb506c0f..0c82db1011 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -450,10 +450,10 @@ void LLManip::renderXYZ(const LLVector3 &vec) gGL.color4f(0.f, 0.f, 0.f, 0.7f); imagep->draw( - (window_center_x - 115) * display_scale.mV[VX], - (window_center_y + vertical_offset - PAD) * display_scale.mV[VY], - 235 * display_scale.mV[VX], - (PAD * 2 + 10) * display_scale.mV[VY], + (S32)((window_center_x - 115) * display_scale.mV[VX]), + (S32)((window_center_y + vertical_offset - PAD) * display_scale.mV[VY]), + (S32)(235 * display_scale.mV[VX]), + (S32)((PAD * 2 + 10) * display_scale.mV[VY]), LLColor4(0.f, 0.f, 0.f, 0.7f) ); LLFontGL* font = LLFontGL::getFontSansSerif(); @@ -463,33 +463,33 @@ void LLManip::renderXYZ(const LLVector3 &vec) // render drop shadowed text (manually because of bigger 'distance') F32 right_x; feedback_string = llformat("X: %.3f", vec.mV[VX]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f + 1.f, (F32)(window_center_y + vertical_offset) - 2.f, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); feedback_string = llformat("Y: %.3f", vec.mV[VY]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f + 1.f, (F32)(window_center_y + vertical_offset) - 2.f, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f + 1.f, window_center_y + vertical_offset - 2.f, LLColor4::black, + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f + 1.f, (F32)(window_center_y + vertical_offset) - 2.f, LLColor4::black, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); // render text on top feedback_string = llformat("X: %.3f", vec.mV[VX]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f, window_center_y + vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 102.f, (F32)(window_center_y + vertical_offset), LLColor4(1.f, 0.5f, 0.5f, 1.f), LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); feedback_string = llformat("Y: %.3f", vec.mV[VY]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f, window_center_y + vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x - 27.f, (F32)(window_center_y + vertical_offset), LLColor4(0.5f, 1.f, 0.5f, 1.f), LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); feedback_string = llformat("Z: %.3f", vec.mV[VZ]); - font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f, window_center_y + vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), + font->render(utf8str_to_wstring(feedback_string), 0, window_center_x + 48.f, (F32)(window_center_y + vertical_offset), LLColor4(0.5f, 0.5f, 1.f, 1.f), LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, 1000, &right_x); } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index c4f3f01ea1..ffb66dc6cc 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -884,7 +884,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { F32 drag_dist = mScaleDir * projected_drag_pos1; // Projecting the drag position allows for negative results, vs using the length which will result in a "reverse scaling" bug. - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos1, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos1, mScaleDir, mScaleSnapUnit1, (S32)mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); @@ -902,7 +902,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) { F32 drag_dist = mScaleDir * projected_drag_pos2; // Projecting the drag position allows for negative results, vs using the length which will result in a "reverse scaling" bug. - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos2, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos2, mScaleDir, mScaleSnapUnit2, (S32)mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit2 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit2 / cur_subdivisions); @@ -1113,7 +1113,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) else { F32 drag_dist = scale_center_to_mouse * mScaleDir; - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, (S32)mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); relative_snap_dist -= snap_dist; @@ -1542,8 +1542,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + mTickPixelSpacing1 = (F32)ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); + mTickPixelSpacing2 = (F32)ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); if (uniform) { @@ -1608,8 +1608,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 dist_scale_units_2 = dist_grid_axis / smallest_subdivision2; // find distance to nearest smallest grid unit - F32 grid_multiple1 = llfloor(dist_scale_units_1); - F32 grid_multiple2 = llfloor(dist_scale_units_2); + F32 grid_multiple1 = (F32)llfloor(dist_scale_units_1); + F32 grid_multiple2 = (F32)llfloor(dist_scale_units_2); F32 grid_offset1 = fmodf(dist_grid_axis, smallest_subdivision1); F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2); diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index 92f8ed949e..dde238eddb 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -648,7 +648,7 @@ void LLMaterialEditor::setBaseColor(const LLColor4& color) F32 LLMaterialEditor::getTransparency() { - return childGetValue("transparency").asReal(); + return (F32)childGetValue("transparency").asReal(); } void LLMaterialEditor::setTransparency(F32 transparency) @@ -668,7 +668,7 @@ void LLMaterialEditor::setAlphaMode(const std::string& alpha_mode) F32 LLMaterialEditor::getAlphaCutoff() { - return childGetValue("alpha cutoff").asReal(); + return (F32)childGetValue("alpha cutoff").asReal(); } void LLMaterialEditor::setAlphaCutoff(F32 alpha_cutoff) @@ -708,7 +708,7 @@ void LLMaterialEditor::setMetallicRoughnessUploadId(const LLUUID& id) F32 LLMaterialEditor::getMetalnessFactor() { - return childGetValue("metalness factor").asReal(); + return (F32)childGetValue("metalness factor").asReal(); } void LLMaterialEditor::setMetalnessFactor(F32 factor) @@ -718,7 +718,7 @@ void LLMaterialEditor::setMetalnessFactor(F32 factor) F32 LLMaterialEditor::getRoughnessFactor() { - return childGetValue("roughness factor").asReal(); + return (F32)childGetValue("roughness factor").asReal(); } void LLMaterialEditor::setRoughnessFactor(F32 factor) @@ -2430,14 +2430,14 @@ void LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback(const LLSD& notificati createInventoryItem(str.str(), new_name, std::string(), permissions); } -const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type); +const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k); void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std::string &filename, S32 index, bool open_floater) { if (index == model_in.materials.size()) { // bulk upload all the things - upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL); + upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true); return; } @@ -2618,13 +2618,13 @@ bool LLMaterialEditor::setFromGltfModel(const tinygltf::Model& model, S32 index, } setAlphaMode(material_in.alphaMode); - setAlphaCutoff(material_in.alphaCutoff); + setAlphaCutoff((F32)material_in.alphaCutoff); setBaseColor(LLTinyGLTFHelper::getColor(material_in.pbrMetallicRoughness.baseColorFactor)); setEmissiveColor(LLTinyGLTFHelper::getColor(material_in.emissiveFactor)); - setMetalnessFactor(material_in.pbrMetallicRoughness.metallicFactor); - setRoughnessFactor(material_in.pbrMetallicRoughness.roughnessFactor); + setMetalnessFactor((F32)material_in.pbrMetallicRoughness.metallicFactor); + setRoughnessFactor((F32)material_in.pbrMetallicRoughness.roughnessFactor); setDoubleSided(material_in.doubleSided); } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 01c922df16..cd75e1c313 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1869,7 +1869,7 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes llssize dsize = data_size; char* result_ptr = strip_deprecated_header((char*)data, dsize, &header_size); - data_size = dsize; + data_size = (S32)dsize; boost::iostreams::stream<boost::iostreams::array_source> stream(result_ptr, data_size); @@ -1910,8 +1910,8 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes { LLMutexLock lock(mHeaderMutex); - mMeshHeader[mesh_id] = { header_size, header }; - LLMeshRepository::sCacheBytesHeaders += header_size; + mMeshHeader[mesh_id] = { (U32)header_size, header }; + LLMeshRepository::sCacheBytesHeaders += (U32)header_size; } LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time. @@ -4763,7 +4763,7 @@ F32 LLMeshCostData::getRadiusBasedStreamingCost(F32 radius) F32 LLMeshCostData::getTriangleBasedStreamingCost() { - F32 result = ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * getEstTrisForStreamingCost(); + F32 result = ANIMATED_OBJECT_COST_PER_KTRI * 0.001f * getEstTrisForStreamingCost(); return result; } @@ -5473,7 +5473,7 @@ void on_new_single_inventory_upload_complete( LL_INFOS() << "inventory_item_flags " << inventory_item_flags << LL_ENDL; } } - S32 creation_date_now = time_corrected(); + S32 creation_date_now = (S32)time_corrected(); LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem( server_response["new_inventory_item"].asUUID(), item_folder_id, diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index b1a48db0ee..df573bd785 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -242,7 +242,7 @@ void LLModelPreview::updateDimentionsAndOffsets() std::set<LLModel*> accounted; - mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 3.0f; + mPelvisZOffset = mFMP ? (F32)mFMP->childGetValue("pelvis_offset").asReal() : 3.0f; if (mFMP && mFMP->childGetValue("upload_joints").asBoolean()) { @@ -272,7 +272,7 @@ void LLModelPreview::updateDimentionsAndOffsets() } } - F32 scale = mFMP ? mFMP->childGetValue("import_scale").asReal()*2.f : 2.f; + F32 scale = mFMP ? (F32)mFMP->childGetValue("import_scale").asReal()*2.f : 2.f; mDetailsSignal((F32)(mPreviewScale[0] * scale), (F32)(mPreviewScale[1] * scale), (F32)(mPreviewScale[2] * scale)); @@ -293,7 +293,7 @@ void LLModelPreview::rebuildUploadData() LLSpinCtrl* scale_spinner = mFMP->getChild<LLSpinCtrl>("import_scale"); - F32 scale = scale_spinner->getValue().asReal(); + F32 scale = (F32)scale_spinner->getValue().asReal(); LLMatrix4 scale_mat; scale_mat.initScale(LLVector3(scale, scale, scale)); @@ -1290,7 +1290,7 @@ void LLModelPreview::generateNormals() return; } - F32 angle_cutoff = mFMP->childGetValue("crease_angle").asReal(); + F32 angle_cutoff = (F32)mFMP->childGetValue("crease_angle").asReal(); mRequestedCreaseAngle[which_lod] = angle_cutoff; @@ -1489,7 +1489,7 @@ F32 LLModelPreview::genMeshOptimizerPerModel(LLModel *base_model, LLModel *targe target_indices = 3; } - size_new_indices = LLMeshOptimizer::simplifyU32( + size_new_indices = (S32)LLMeshOptimizer::simplifyU32( output_indices, source_indices, size_indices, @@ -1730,7 +1730,7 @@ F32 LLModelPreview::genMeshOptimizerPerFace(LLModel *base_model, LLModel *target target_indices = 3; } - size_new_indices = LLMeshOptimizer::simplify( + size_new_indices = (S32)LLMeshOptimizer::simplify( output_indices, source_indices, size_indices, @@ -1851,7 +1851,7 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d { if (!enforce_tri_limit) { - triangle_limit = base_triangle_count; + triangle_limit = (F32)base_triangle_count; // reset to default value for this lod F32 pw = pow((F32)decimation, (F32)(LLModel::LOD_HIGH - which_lod)); @@ -1861,7 +1861,7 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d { // UI spacifies limit for all models of single lod - triangle_limit = mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asInteger(); + triangle_limit = (F32)mFMP->childGetValue("lod_triangle_limit_" + lod_name[which_lod]).asReal(); } // meshoptimizer doesn't use triangle limit, it uses indices limit, so convert it to aproximate ratio @@ -1871,14 +1871,14 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d else { // UI shows 0 to 100%, but meshoptimizer works with 0 to 1 - lod_error_threshold = mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal() / 100.f; + lod_error_threshold = (F32)mFMP->childGetValue("lod_error_threshold_" + lod_name[which_lod]).asReal() / 100.f; } } else { // we are genrating all lods and each lod will get own indices_decimator indices_decimator = 1; - triangle_limit = base_triangle_count; + triangle_limit = (F32)base_triangle_count; } mMaxTriangleLimit = base_triangle_count; @@ -1906,7 +1906,7 @@ void LLModelPreview::genMeshOptimizerLODs(S32 which_lod, S32 meshopt_mode, U32 d } } - mRequestedTriangleCount[lod] = triangle_limit; + mRequestedTriangleCount[lod] = (S32)triangle_limit; mRequestedErrorThreshold[lod] = lod_error_threshold * 100; mRequestedLoDMode[lod] = lod_mode; @@ -2748,7 +2748,7 @@ void LLModelPreview::updateLodControls(S32 lod) LLSpinCtrl* threshold = mFMP->getChild<LLSpinCtrl>("lod_error_threshold_" + lod_name[lod]); LLSpinCtrl* limit = mFMP->getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod]); - limit->setMaxValue(mMaxTriangleLimit); + limit->setMaxValue((F32)mMaxTriangleLimit); limit->forceSetValue(mRequestedTriangleCount[lod]); threshold->forceSetValue(mRequestedErrorThreshold[lod]); @@ -2760,8 +2760,8 @@ void LLModelPreview::updateLodControls(S32 lod) limit->setVisible(true); threshold->setVisible(false); - limit->setMaxValue(mMaxTriangleLimit); - limit->setIncrement(llmax((U32)1, mMaxTriangleLimit / 32)); + limit->setMaxValue((F32)mMaxTriangleLimit); + limit->setIncrement((F32)llmax((U32)1, mMaxTriangleLimit / 32)); } else { @@ -3134,6 +3134,13 @@ U32 LLModelPreview::loadTextures(LLImportMaterial& material, void* opaque) LLPointer< LLViewerFetchedTexture >& tex = (*reinterpret_cast< LLPointer< LLViewerFetchedTexture > * >(material.mOpaqueData)); tex = LLViewerTextureManager::getFetchedTextureFromUrl("file://" + LLURI::unescape(material.mDiffuseMapFilename), FTT_LOCAL_FILE, true, LLGLTexture::BOOST_PREVIEW); + if (tex->getDiscardLevel() < tex->getMaxDiscardLevel()) + { + // file was loaded previosly, reload image to get potential changes + tex->clearFetchedResults(); + } + // Todo: might cause a crash if preview gets closed before we get the callback. + // Use a callback list or guard callback in some way tex->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, true, false, opaque, NULL, false); tex->forceToSaveRawImage(0, F32_MAX); material.setDiffuseMap(tex->getID()); // record tex ID @@ -3215,7 +3222,7 @@ bool LLModelPreview::render() gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); gGL.loadIdentity(); - gGL.ortho(0.0f, width, 0.0f, height, -1.0f, 1.0f); + gGL.ortho(0.0f, (F32)width, 0.0f, (F32)height, -1.0f, 1.0f); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); @@ -3353,7 +3360,7 @@ bool LLModelPreview::render() mFMP->childSetEnabled("upload_joints", upload_skin); } - F32 explode = mFMP->childGetValue("physics_explode").asReal(); + F32 explode = (F32)mFMP->childGetValue("physics_explode").asReal(); LLGLDepthTest gls_depth(GL_TRUE); // SL-12781 re-enable z-buffer for 3D model preview diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index da5bc4b05d..dfead5ee8a 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -705,7 +705,7 @@ void LLNavigationBar::resizeLayoutPanel() { LLRect nav_bar_rect = mNavigationPanel->getRect(); - S32 nav_panel_width = (nav_bar_rect.getWidth() + mFavoritePanel->getRect().getWidth()) * gSavedPerAccountSettings.getF32("NavigationBarRatio"); + S32 nav_panel_width = (S32)((nav_bar_rect.getWidth() + mFavoritePanel->getRect().getWidth()) * gSavedPerAccountSettings.getF32("NavigationBarRatio")); nav_bar_rect.setLeftTopAndSize(nav_bar_rect.mLeft, nav_bar_rect.mTop, nav_panel_width, nav_bar_rect.getHeight()); mNavigationPanel->handleReshape(nav_bar_rect,true); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index fd968d9027..3f370b1ab5 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -435,7 +435,7 @@ void LLNetMap::draw() } F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), - LLVector2(local_mouse_x,local_mouse_y)); + LLVector2((F32)local_mouse_x, (F32)local_mouse_y)); if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) { closest_dist_squared = dist_to_cursor_squared; @@ -475,7 +475,7 @@ void LLNetMap::draw() dot_width); F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), - LLVector2(local_mouse_x,local_mouse_y)); + LLVector2((F32)local_mouse_x, (F32)local_mouse_y)); if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) { mClosestAgentToCursor = gAgent.getID(); @@ -671,7 +671,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) bool LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in - F32 new_scale = mScale * pow(MAP_SCALE_ZOOM_FACTOR, -clicks); + F32 new_scale = mScale * (F32)pow(MAP_SCALE_ZOOM_FACTOR, -clicks); F32 old_scale = mScale; setScale(new_scale); @@ -681,8 +681,8 @@ bool LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { // Adjust pan to center the zoom on the mouse pointer LLVector2 zoom_offset; - zoom_offset.mV[VX] = x - getRect().getWidth() / 2; - zoom_offset.mV[VY] = y - getRect().getHeight() / 2; + zoom_offset.mV[VX] = (F32)(x - getRect().getWidth() / 2); + zoom_offset.mV[VY] = (F32)(y - getRect().getHeight() / 2); mCurPan -= zoom_offset * mScale / old_scale - zoom_offset; } diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index 842c24db8a..f0bbaddfb2 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -68,7 +68,7 @@ void LLScriptHandler::initChannel() //-------------------------------------------------------------------------- void LLScriptHandler::addToastWithNotification(const LLNotificationPtr& notification) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; LLToastPanel* notify_box = LLToastPanel::buidPanelFromNotification(notification); LLToast::Params p; diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index c7fa96edca..0c4ef6f943 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -121,12 +121,12 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification, bo if (exp_time > cur_time) { // we have non-default expiration time - keep visible until expires - p.lifetime_secs = exp_time.secondsSinceEpoch() - cur_time.secondsSinceEpoch(); + p.lifetime_secs = (F32)(exp_time.secondsSinceEpoch() - cur_time.secondsSinceEpoch()); } else { // use default time - p.lifetime_secs = gSavedSettings.getS32("NotificationTipToastLifeTime"); + p.lifetime_secs = (F32)gSavedSettings.getS32("NotificationTipToastLifeTime"); } LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get()); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 9fe8f39bd6..1faf241aaa 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -479,8 +479,8 @@ void LLPanelClassifiedInfo::stretchSnapshot() // Lets increase texture height to force texture look as expected. rc.mBottom -= BTN_HEIGHT_SMALL; - F32 t_width = texture->getFullWidth(); - F32 t_height = texture->getFullHeight(); + F32 t_width = (F32)texture->getFullWidth(); + F32 t_height = (F32)texture->getFullHeight(); F32 ratio = llmin<F32>( (rc.getWidth() / t_width), (rc.getHeight() / t_height) ); diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 5255b3763c..ea2b2ba944 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -248,7 +248,7 @@ void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged() void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged() { if (!mSkySettings) return; - mSkySettings->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); + mSkySettings->setHazeHorizon((F32)getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -256,7 +256,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged() void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged() { if (!mSkySettings) return; - mSkySettings->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); + mSkySettings->setHazeDensity((F32)getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -264,7 +264,7 @@ void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged() void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged() { if (!mSkySettings) return; - mSkySettings->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); + mSkySettings->setGamma((F32)getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -272,7 +272,7 @@ void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged() void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged() { if (!mSkySettings) return; - F32 density_mult = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->getValue().asReal(); + F32 density_mult = (F32)getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->getValue().asReal(); density_mult *= SLIDER_SCALE_DENSITY_MULTIPLIER; mSkySettings->setDensityMultiplier(density_mult); mSkySettings->update(); @@ -282,7 +282,7 @@ void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged() void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged() { if (!mSkySettings) return; - mSkySettings->setDistanceMultiplier(getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->getValue().asReal()); + mSkySettings->setDistanceMultiplier((F32)getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -290,7 +290,7 @@ void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged() void LLPanelSettingsSkyAtmosTab::onMaxAltChanged() { if (!mSkySettings) return; - mSkySettings->setMaxY(getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->getValue().asReal()); + mSkySettings->setMaxY((F32)getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -298,7 +298,7 @@ void LLPanelSettingsSkyAtmosTab::onMaxAltChanged() void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged() { if (!mSkySettings) return; - F32 moisture_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->getValue().asReal(); + F32 moisture_level = (F32)getChild<LLUICtrl>(FIELD_SKY_DENSITY_MOISTURE_LEVEL)->getValue().asReal(); mSkySettings->setSkyMoistureLevel(moisture_level); mSkySettings->update(); setIsDirty(); @@ -307,7 +307,7 @@ void LLPanelSettingsSkyAtmosTab::onMoistureLevelChanged() void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged() { if (!mSkySettings) return; - F32 droplet_radius = getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->getValue().asReal(); + F32 droplet_radius = (F32)getChild<LLUICtrl>(FIELD_SKY_DENSITY_DROPLET_RADIUS)->getValue().asReal(); mSkySettings->setSkyDropletRadius(droplet_radius); mSkySettings->update(); setIsDirty(); @@ -316,7 +316,7 @@ void LLPanelSettingsSkyAtmosTab::onDropletRadiusChanged() void LLPanelSettingsSkyAtmosTab::onIceLevelChanged() { if (!mSkySettings) return; - F32 ice_level = getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->getValue().asReal(); + F32 ice_level = (F32)getChild<LLUICtrl>(FIELD_SKY_DENSITY_ICE_LEVEL)->getValue().asReal(); mSkySettings->setSkyIceLevel(ice_level); mSkySettings->update(); setIsDirty(); @@ -325,7 +325,7 @@ void LLPanelSettingsSkyAtmosTab::onIceLevelChanged() void LLPanelSettingsSkyAtmosTab::onReflectionProbeAmbianceChanged() { if (!mSkySettings) return; - F32 ambiance = getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); + F32 ambiance = (F32)getChild<LLUICtrl>(FIELD_REFLECTION_PROBE_AMBIANCE)->getValue().asReal(); mSkySettings->setReflectionProbeAmbiance(ambiance); mSkySettings->update(); @@ -446,7 +446,7 @@ void LLPanelSettingsSkyCloudTab::onCloudColorChanged() void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged() { if (!mSkySettings) return; - mSkySettings->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); + mSkySettings->setCloudShadow((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -454,14 +454,14 @@ void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged() void LLPanelSettingsSkyCloudTab::onCloudScaleChanged() { if (!mSkySettings) return; - mSkySettings->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); + mSkySettings->setCloudScale((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsSkyCloudTab::onCloudVarianceChanged() { if (!mSkySettings) return; - mSkySettings->setCloudVariance(getChild<LLUICtrl>(FIELD_SKY_CLOUD_VARIANCE)->getValue().asReal()); + mSkySettings->setCloudVariance((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_VARIANCE)->getValue().asReal()); setIsDirty(); } @@ -484,9 +484,9 @@ void LLPanelSettingsSkyCloudTab::onCloudMapChanged() void LLPanelSettingsSkyCloudTab::onCloudDensityChanged() { if (!mSkySettings) return; - LLColor3 density(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->getValue().asReal(), - getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->getValue().asReal(), - getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->getValue().asReal()); + LLColor3 density((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->getValue().asReal(), + (F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->getValue().asReal(), + (F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->getValue().asReal()); mSkySettings->setCloudPosDensity1(density); setIsDirty(); @@ -495,9 +495,9 @@ void LLPanelSettingsSkyCloudTab::onCloudDensityChanged() void LLPanelSettingsSkyCloudTab::onCloudDetailChanged() { if (!mSkySettings) return; - LLColor3 detail(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->getValue().asReal(), - getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->getValue().asReal(), - getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->getValue().asReal()); + LLColor3 detail((F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->getValue().asReal(), + (F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->getValue().asReal(), + (F32)getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->getValue().asReal()); mSkySettings->setCloudPosDensity2(detail); setIsDirty(); @@ -626,7 +626,7 @@ void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged() void LLPanelSettingsSkySunMoonTab::onGlowChanged() { if (!mSkySettings) return; - LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); + LLColor3 glow((F32)getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, (F32)getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); // takes 0 - 1.99 UI range -> 40 -> 0.2 range glow.mV[0] = (2.0f - glow.mV[0]) * SLIDER_SCALE_GLOW_R; @@ -640,7 +640,7 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged() void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() { if (!mSkySettings) return; - mSkySettings->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); + mSkySettings->setStarBrightness((F32)getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); mSkySettings->update(); setIsDirty(); } @@ -663,8 +663,8 @@ void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() { - F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); - F32 elevation = getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); + F32 azimuth = (F32)getChild<LLUICtrl>(FIELD_SKY_SUN_AZIMUTH)->getValue().asReal(); + F32 elevation = (F32)getChild<LLUICtrl>(FIELD_SKY_SUN_ELEVATION)->getValue().asReal(); LLQuaternion quat; azimuth *= DEG_TO_RAD; @@ -693,7 +693,7 @@ void LLPanelSettingsSkySunMoonTab::onSunAzimElevChanged() void LLPanelSettingsSkySunMoonTab::onSunScaleChanged() { if (!mSkySettings) return; - mSkySettings->setSunScale((getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal())); + mSkySettings->setSunScale((F32)(getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->getValue().asReal())); mSkySettings->update(); setIsDirty(); } @@ -725,8 +725,8 @@ void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() void LLPanelSettingsSkySunMoonTab::onMoonAzimElevChanged() { - F32 azimuth = getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); - F32 elevation = getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); + F32 azimuth = (F32)getChild<LLUICtrl>(FIELD_SKY_MOON_AZIMUTH)->getValue().asReal(); + F32 elevation = (F32)getChild<LLUICtrl>(FIELD_SKY_MOON_ELEVATION)->getValue().asReal(); LLQuaternion quat; azimuth *= DEG_TO_RAD; @@ -763,7 +763,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged() { if (!mSkySettings) return; - mSkySettings->setMoonScale((getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->getValue().asReal())); + mSkySettings->setMoonScale((F32)(getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->getValue().asReal())); mSkySettings->update(); setIsDirty(); } @@ -771,7 +771,7 @@ void LLPanelSettingsSkySunMoonTab::onMoonScaleChanged() void LLPanelSettingsSkySunMoonTab::onMoonBrightnessChanged() { if (!mSkySettings) return; - mSkySettings->setMoonBrightness((getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->getValue().asReal())); + mSkySettings->setMoonBrightness((F32)(getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->getValue().asReal())); mSkySettings->update(); setIsDirty(); } @@ -851,24 +851,24 @@ void LLPanelSettingsSkyDensityTab::refresh() LLSD mie_config = mSkySettings->getMieConfig(); LLSD absorption_config = mSkySettings->getAbsorptionConfig(); - F32 rayleigh_exponential_term = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - F32 rayleigh_exponential_scale = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); - F32 rayleigh_linear_term = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); - F32 rayleigh_constant_term = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); - F32 rayleigh_max_alt = rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); - - F32 mie_exponential_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - F32 mie_exponential_scale = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); - F32 mie_linear_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); - F32 mie_constant_term = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); - F32 mie_aniso_factor = mie_config[LLSettingsSky::SETTING_MIE_ANISOTROPY_FACTOR].asReal(); - F32 mie_max_alt = mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); - - F32 absorption_exponential_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - F32 absorption_exponential_scale = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); - F32 absorption_linear_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); - F32 absorption_constant_term = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); - F32 absorption_max_alt = absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); + F32 rayleigh_exponential_term = (F32)rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); + F32 rayleigh_exponential_scale = (F32)rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); + F32 rayleigh_linear_term = (F32)rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); + F32 rayleigh_constant_term = (F32)rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); + F32 rayleigh_max_alt = (F32)rayleigh_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); + + F32 mie_exponential_term = (F32)mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); + F32 mie_exponential_scale = (F32)mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); + F32 mie_linear_term = (F32)mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); + F32 mie_constant_term = (F32)mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_CONSTANT_TERM].asReal(); + F32 mie_aniso_factor = (F32)mie_config[LLSettingsSky::SETTING_MIE_ANISOTROPY_FACTOR].asReal(); + F32 mie_max_alt = (F32)mie_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); + + F32 absorption_exponential_term = (F32)absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); + F32 absorption_exponential_scale = (F32)absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_SCALE_FACTOR].asReal(); + F32 absorption_linear_term = (F32)absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_LINEAR_TERM].asReal(); + F32 absorption_constant_term = (F32)absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_EXP_TERM].asReal(); + F32 absorption_max_alt = (F32)absorption_config[LLSettingsSky::SETTING_DENSITY_PROFILE_WIDTH].asReal(); getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL)->setValue(rayleigh_exponential_term); getChild<LLUICtrl>(FIELD_SKY_DENSITY_RAYLEIGH_EXPONENTIAL_SCALE)->setValue(rayleigh_exponential_scale); diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index 236cb6b97c..174a416fb4 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -170,14 +170,14 @@ void LLPanelSettingsWaterMainTab::onFogColorChanged() void LLPanelSettingsWaterMainTab::onFogDensityChanged() { if (!mWaterSettings) return; - mWaterSettings->setWaterFogDensity(getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->getValue().asReal()); + mWaterSettings->setWaterFogDensity((F32)getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onFogUnderWaterChanged() { if (!mWaterSettings) return; - mWaterSettings->setFogMod(getChild<LLUICtrl>(FIELD_WATER_UNDERWATER_MOD)->getValue().asReal()); + mWaterSettings->setFogMod((F32)getChild<LLUICtrl>(FIELD_WATER_UNDERWATER_MOD)->getValue().asReal()); setIsDirty(); } @@ -210,7 +210,7 @@ void LLPanelSettingsWaterMainTab::onSmallWaveChanged() void LLPanelSettingsWaterMainTab::onNormalScaleChanged() { if (!mWaterSettings) return; - LLVector3 vect(getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_X)->getValue().asReal(), getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Y)->getValue().asReal(), getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Z)->getValue().asReal()); + LLVector3 vect((F32)getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_X)->getValue().asReal(), (F32)getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Y)->getValue().asReal(), (F32)getChild<LLUICtrl>(FIELD_WATER_NORMAL_SCALE_Z)->getValue().asReal()); mWaterSettings->setNormalScale(vect); setIsDirty(); } @@ -218,34 +218,34 @@ void LLPanelSettingsWaterMainTab::onNormalScaleChanged() void LLPanelSettingsWaterMainTab::onFresnelScaleChanged() { if (!mWaterSettings) return; - mWaterSettings->setFresnelScale(getChild<LLUICtrl>(FIELD_WATER_FRESNEL_SCALE)->getValue().asReal()); + mWaterSettings->setFresnelScale((F32)getChild<LLUICtrl>(FIELD_WATER_FRESNEL_SCALE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onFresnelOffsetChanged() { if (!mWaterSettings) return; - mWaterSettings->setFresnelOffset(getChild<LLUICtrl>(FIELD_WATER_FRESNEL_OFFSET)->getValue().asReal()); + mWaterSettings->setFresnelOffset((F32)getChild<LLUICtrl>(FIELD_WATER_FRESNEL_OFFSET)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onScaleAboveChanged() { if (!mWaterSettings) return; - mWaterSettings->setScaleAbove(getChild<LLUICtrl>(FIELD_WATER_SCALE_ABOVE)->getValue().asReal()); + mWaterSettings->setScaleAbove((F32)getChild<LLUICtrl>(FIELD_WATER_SCALE_ABOVE)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onScaleBelowChanged() { if (!mWaterSettings) return; - mWaterSettings->setScaleBelow(getChild<LLUICtrl>(FIELD_WATER_SCALE_BELOW)->getValue().asReal()); + mWaterSettings->setScaleBelow((F32)getChild<LLUICtrl>(FIELD_WATER_SCALE_BELOW)->getValue().asReal()); setIsDirty(); } void LLPanelSettingsWaterMainTab::onBlurMultipChanged() { if (!mWaterSettings) return; - mWaterSettings->setBlurMultiplier(getChild<LLUICtrl>(FIELD_WATER_BLUR_MULTIP)->getValue().asReal()); + mWaterSettings->setBlurMultiplier((F32)getChild<LLUICtrl>(FIELD_WATER_BLUR_MULTIP)->getValue().asReal()); setIsDirty(); } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index a14f1d54a2..e88f6c0470 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -299,9 +299,9 @@ LLEditWearableDictionary::Subparts::Subparts() 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)); addEntry(SUBPART_SKIRT, new SubpartEntry(SUBPART_SKIRT, "mPelvis", "skirt", "skirt_main_param_list", "skirt_main_tab", LLVector3d(0.f, 0.f, -0.5f), LLVector3d(-1.6f, 0.15f, -0.5f),SEX_BOTH)); - 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)); // WT_PHYSICS 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)); @@ -794,8 +794,12 @@ bool LLPanelEditWearable::postBuild() continue; } - const std::string accordion_tab = subpart_entry->mAccordionTab; - LLAccordionCtrlTab *tab = getChild<LLAccordionCtrlTab>(accordion_tab); + const std::string& accordion_tab = subpart_entry->mAccordionTab; + if (accordion_tab.empty()) + { + continue; + } + LLAccordionCtrlTab *tab = findChild<LLAccordionCtrlTab>(accordion_tab); if (!tab) { LL_WARNS() << "could not get llaccordionctrltab from UI with name: " << accordion_tab << LL_ENDL; @@ -1199,12 +1203,16 @@ void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, bool show, bo continue; } - const std::string scrolling_panel = subpart_entry->mParamList; - const std::string accordion_tab = subpart_entry->mAccordionTab; + const std::string& scrolling_panel = subpart_entry->mParamList; + const std::string& accordion_tab = subpart_entry->mAccordionTab; - LLScrollingPanelList *panel_list = getChild<LLScrollingPanelList>(scrolling_panel); - LLAccordionCtrlTab *tab = getChild<LLAccordionCtrlTab>(accordion_tab); + if (scrolling_panel.empty() || accordion_tab.empty()) + { + continue; + } + LLScrollingPanelList *panel_list = findChild<LLScrollingPanelList>(scrolling_panel); + LLAccordionCtrlTab *tab = findChild<LLAccordionCtrlTab>(accordion_tab); if (!panel_list) { LL_WARNS() << "could not get scrolling panel list: " << scrolling_panel << LL_ENDL; diff --git a/indra/newview/llpanelemojicomplete.cpp b/indra/newview/llpanelemojicomplete.cpp index 3faa01ae0c..cb89a5910e 100644 --- a/indra/newview/llpanelemojicomplete.cpp +++ b/indra/newview/llpanelemojicomplete.cpp @@ -110,8 +110,8 @@ void LLPanelEmojiComplete::draw() F32 iconCenterX = mRenderRect.mLeft + (F32)mEmojiWidth / 2; F32 iconCenterY = mRenderRect.mTop - (F32)mEmojiHeight / 2; - F32 textLeft = mVertical ? mRenderRect.mLeft + mEmojiWidth + mPadding : 0; - F32 textWidth = mVertical ? getRect().getWidth() - textLeft - mPadding : 0; + F32 textLeft = mVertical ? (F32)(mRenderRect.mLeft + mEmojiWidth + mPadding) : 0.f; + F32 textWidth = mVertical ? (F32)(getRect().getWidth() - textLeft - mPadding) : 0.f; for (size_t curIdx = firstVisibleIdx; curIdx < lastVisibleIdx; curIdx++) { @@ -129,7 +129,7 @@ void LLPanelEmojiComplete::draw() std::string text = shortCode.substr(0, mEmojis[curIdx].Begin); mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - static_cast<S32>(text.size()), x1); + static_cast<S32>(text.size()), (S32)x1); x0 += mTextFont->getWidthF32(text); x1 = textLeft + textWidth - x0; } @@ -138,7 +138,7 @@ void LLPanelEmojiComplete::draw() std::string text = shortCode.substr(mEmojis[curIdx].Begin, mEmojis[curIdx].End - mEmojis[curIdx].Begin); mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::yellow6, LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - static_cast<S32>(text.size()), x1); + static_cast<S32>(text.size()), (S32)x1); x0 += mTextFont->getWidthF32(text); x1 = textLeft + textWidth - x0; } @@ -147,7 +147,7 @@ void LLPanelEmojiComplete::draw() std::string text = shortCode.substr(mEmojis[curIdx].End); mTextFont->renderUTF8(text, 0, x0, iconCenterY, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - static_cast<S32>(text.size()), x1); + static_cast<S32>(text.size()), (S32)x1); } iconCenterY -= mEmojiHeight; } @@ -163,7 +163,7 @@ bool LLPanelEmojiComplete::handleHover(S32 x, S32 y, MASK mask) if (mScrollbar && mScrollbar->getVisible() && childrenHandleHover(x, y, mask)) return true; - LLVector2 curHover(x, y); + LLVector2 curHover((F32)x, (F32)y); if ((mLastHover - curHover).lengthSquared() > MIN_MOUSE_MOVE_DELTA) { size_t index = posToIndex(x, y); @@ -235,7 +235,7 @@ bool LLPanelEmojiComplete::handleMouseDown(S32 x, S32 y, MASK mask) return true; mCurSelected = posToIndex(x, y); - mLastHover = LLVector2(x, y); + mLastHover = LLVector2((F32)x, (F32)y); return true; } @@ -438,7 +438,7 @@ void LLPanelEmojiComplete::updateConstraints() { mRenderRect = getLocalRect(); - mEmojiWidth = mIconFont->getWidthF32(u8"\U0001F431") + mPadding * 2; + mEmojiWidth = (U16)(mIconFont->getWidthF32(u8"\U0001F431") + mPadding * 2); if (mVertical) { mEmojiHeight = mIconFont->getLineHeight() + mPadding * 2; @@ -481,7 +481,7 @@ void LLPanelEmojiComplete::updateScrollPos() } else { - mScrollPos = mCurSelected - ((float)mCurSelected / (mTotalEmojis - 2) * (mVisibleEmojis - 2)); + mScrollPos = (size_t)(mCurSelected - ((float)mCurSelected / (mTotalEmojis - 2) * (mVisibleEmojis - 2))); } if (mScrollbar && mScrollbar->getVisible()) diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index 43612865fc..a706e339ea 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -173,10 +173,10 @@ bool LLPanelEnvironmentInfo::postBuild() getChild<LLUICtrl>(BTN_EDIT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnEdit(); }); getChild<LLUICtrl>(BTN_RST_ALTITUDES)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnRstAltitudes(); }); - getChild<LLUICtrl>(SLD_DAYLENGTH)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayLengthChanged(value.asReal()); }); + getChild<LLUICtrl>(SLD_DAYLENGTH)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayLengthChanged((F32)value.asReal()); }); getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setSliderEditorCommitCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); - getChild<LLUICtrl>(SLD_DAYOFFSET)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayOffsetChanged(value.asReal()); }); + getChild<LLUICtrl>(SLD_DAYOFFSET)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayOffsetChanged((F32)value.asReal()); }); getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setSliderEditorCommitCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); @@ -193,7 +193,7 @@ bool LLPanelEnvironmentInfo::postBuild() drop_target->setPanel(this, alt_sliders[idx]); } // set initial values to prevent [ALTITUDE] from displaying - updateAltLabel(alt_prefixes[idx], idx + 2, idx * 1000); + updateAltLabel(alt_prefixes[idx], idx + 2, (F32)(idx * 1000)); } getChild<LLSettingsDropTarget>("sdt_" + alt_prefixes[3])->setPanel(this, alt_prefixes[3]); getChild<LLSettingsDropTarget>("sdt_" + alt_prefixes[4])->setPanel(this, alt_prefixes[4]); @@ -554,7 +554,7 @@ void LLPanelEnvironmentInfo::updateAltLabel(const std::string &alt_prefix, U32 s S32 sld_range = sld_rect.getHeight(); S32 sld_bottom = sld_rect.mBottom; S32 sld_offset = sld_rect.getWidth(); // Roughly identical to thumb's width in slider. - S32 pos = (sld_range - sld_offset) * ((alt_value - 100) / (4000 - 100)); + S32 pos = (S32)((sld_range - sld_offset) * ((alt_value - 100) / (4000 - 100))); // get related views LLTextBox* text = findChild<LLTextBox>("txt_" + alt_prefix); @@ -647,15 +647,15 @@ void LLPanelEnvironmentInfo::readjustAltLabels() // Account for edges LLRect midle_rect = view_midle->getRect(); F32 factor = 0.5f; - S32 edge_zone_height = midle_rect.getHeight() * 1.5f; + S32 edge_zone_height = (S32)(midle_rect.getHeight() * 1.5f); if (midle_rect.mBottom - sld_rect.mBottom < edge_zone_height) { - factor = 1 - ((midle_rect.mBottom - sld_rect.mBottom) / (edge_zone_height * 2)); + factor = 1.f - (F32)((midle_rect.mBottom - sld_rect.mBottom) / (edge_zone_height * 2)); } else if (sld_rect.mTop - midle_rect.mTop < edge_zone_height ) { - factor = ((sld_rect.mTop - midle_rect.mTop) / (edge_zone_height * 2)); + factor = (F32)((sld_rect.mTop - midle_rect.mTop) / (edge_zone_height * 2)); } S32 shift_middle = (S32)(((F32)shift_down * factor) + ((F32)shift_up * (1.f - factor))); @@ -739,8 +739,8 @@ void LLPanelEnvironmentInfo::commitDayLenOffsetChanges(bool need_callback) { LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(), - mCurrentEnvironment->mDayLength.value(), - mCurrentEnvironment->mDayOffset.value(), + (S32)mCurrentEnvironment->mDayLength.value(), + (S32)mCurrentEnvironment->mDayOffset.value(), LLEnvironment::altitudes_vect_t(), [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } @@ -748,8 +748,8 @@ void LLPanelEnvironmentInfo::commitDayLenOffsetChanges(bool need_callback) { LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(), - mCurrentEnvironment->mDayLength.value(), - mCurrentEnvironment->mDayOffset.value(), + (S32)mCurrentEnvironment->mDayLength.value(), + (S32)mCurrentEnvironment->mDayOffset.value(), LLEnvironment::altitudes_vect_t()); } @@ -813,8 +813,8 @@ void LLPanelEnvironmentInfo::onAltSliderMouseUp() setControlsEnabled(false); LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(), - mCurrentEnvironment ? mCurrentEnvironment->mDayLength.value() : -1, - mCurrentEnvironment ? mCurrentEnvironment->mDayOffset.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayLength.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayOffset.value() : -1, alts); } } @@ -894,8 +894,8 @@ void LLPanelEnvironmentInfo::onBtnRstAltitudes() LLEnvironment::instance().updateParcel(getParcelId(), LLSettingsDay::ptr_t(), - mCurrentEnvironment ? mCurrentEnvironment->mDayLength.value() : -1, - mCurrentEnvironment ? mCurrentEnvironment->mDayOffset.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayLength.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayOffset.value() : -1, alts, [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } @@ -912,7 +912,7 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay() } getChild<LLUICtrl>(LBL_TIMEOFDAY)->setVisible(true); - S32Seconds now(LLDate::now().secondsSinceEpoch()); + S32Seconds now((S32)LLDate::now().secondsSinceEpoch()); now += mCurrentEnvironment->mDayOffset; @@ -984,8 +984,8 @@ void LLPanelEnvironmentInfo::onPickerCommitted(LLUUID item_id, S32 track_num) itemp->getAssetUUID(), itemp->getName(), track_num, - mCurrentEnvironment ? mCurrentEnvironment->mDayLength.value() : -1, - mCurrentEnvironment ? mCurrentEnvironment->mDayOffset.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayLength.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayOffset.value() : -1, flags, LLEnvironment::altitudes_vect_t(), [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); @@ -1018,8 +1018,8 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday) LLEnvironment::instance().updateParcel(getParcelId(), newday, - mCurrentEnvironment ? mCurrentEnvironment->mDayLength.value() : -1, - mCurrentEnvironment ? mCurrentEnvironment->mDayOffset.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayLength.value() : -1, + mCurrentEnvironment ? (S32)mCurrentEnvironment->mDayOffset.value() : -1, LLEnvironment::altitudes_vect_t(), [that_h](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) { _onEnvironmentReceived(that_h, parcel_id, envifo); }); } diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 24c9d7dced..5380565ace 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -76,7 +76,7 @@ bool LLPanelExperienceLog::postBuild() LLSpinCtrl* spin = getChild<LLSpinCtrl>("logsizespinner"); - spin->set(log->getMaxDays()); + spin->set((F32)log->getMaxDays()); spin->setCommitCallback(boost::bind(&LLPanelExperienceLog::logSizeChanged, this)); mPageSize = log->getPageSize(); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 89af765bb7..00338d3125 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -245,19 +245,19 @@ LLUUID LLPanelFace::getCurrentSpecularMap() { return getChild<LLTextureC U32 LLPanelFace::getCurrentShininess() { return getChild<LLComboBox>("combobox shininess")->getCurrentIndex(); } U32 LLPanelFace::getCurrentBumpiness() { return getChild<LLComboBox>("combobox bumpiness")->getCurrentIndex(); } U8 LLPanelFace::getCurrentDiffuseAlphaMode() { return (U8)getChild<LLComboBox>("combobox alphamode")->getCurrentIndex(); } -U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild<LLUICtrl>("maskcutoff")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild<LLUICtrl>("environment")->getValue().asInteger(); } -U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild<LLUICtrl>("glossiness")->getValue().asInteger(); } -F32 LLPanelFace::getCurrentBumpyRot() { return getChild<LLUICtrl>("bumpyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleU() { return getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyScaleV() { return getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetU() { return getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentBumpyOffsetV() { return getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyRot() { return getChild<LLUICtrl>("shinyRot")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleU() { return getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyScaleV() { return getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetU() { return getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); } -F32 LLPanelFace::getCurrentShinyOffsetV() { return getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); } +U8 LLPanelFace::getCurrentAlphaMaskCutoff() { return (U8)getChild<LLUICtrl>("maskcutoff")->getValue().asInteger(); } +U8 LLPanelFace::getCurrentEnvIntensity() { return (U8)getChild<LLUICtrl>("environment")->getValue().asInteger(); } +U8 LLPanelFace::getCurrentGlossiness() { return (U8)getChild<LLUICtrl>("glossiness")->getValue().asInteger(); } +F32 LLPanelFace::getCurrentBumpyRot() { return (F32)getChild<LLUICtrl>("bumpyRot")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleU() { return (F32)getChild<LLUICtrl>("bumpyScaleU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyScaleV() { return (F32)getChild<LLUICtrl>("bumpyScaleV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetU() { return (F32)getChild<LLUICtrl>("bumpyOffsetU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentBumpyOffsetV() { return (F32)getChild<LLUICtrl>("bumpyOffsetV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyRot() { return (F32)getChild<LLUICtrl>("shinyRot")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleU() { return (F32)getChild<LLUICtrl>("shinyScaleU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyScaleV() { return (F32)getChild<LLUICtrl>("shinyScaleV")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetU() { return (F32)getChild<LLUICtrl>("shinyOffsetU")->getValue().asReal(); } +F32 LLPanelFace::getCurrentShinyOffsetV() { return (F32)getChild<LLUICtrl>("shinyOffsetV")->getValue().asReal(); } // // Methods @@ -1854,13 +1854,13 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) // Set variable values for numeric expressions LLCalc* calcp = LLCalc::getInstance(); - calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal()); - calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal()); - calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal()); - calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal()); - calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal()); - calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal()); - calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal()); + calcp->setVar(LLCalc::TEX_U_SCALE, (F32)childGetValue("TexScaleU").asReal()); + calcp->setVar(LLCalc::TEX_V_SCALE, (F32)childGetValue("TexScaleV").asReal()); + calcp->setVar(LLCalc::TEX_U_OFFSET, (F32)childGetValue("TexOffsetU").asReal()); + calcp->setVar(LLCalc::TEX_V_OFFSET, (F32)childGetValue("TexOffsetV").asReal()); + calcp->setVar(LLCalc::TEX_ROTATION, (F32)childGetValue("TexRot").asReal()); + calcp->setVar(LLCalc::TEX_TRANSPARENCY, (F32)childGetValue("ColorTrans").asReal()); + calcp->setVar(LLCalc::TEX_GLOW, (F32)childGetValue("glow").asReal()); } else { @@ -3777,7 +3777,7 @@ void LLPanelFace::onCommitTextureScaleX( LLUICtrl* ctrl, void* userdata ) LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_u = self->getChild<LLUICtrl>("TexScaleU")->getValue().asReal(); + F32 bumpy_scale_u = (F32)self->getChild<LLUICtrl>("TexScaleU")->getValue().asReal(); if (self->isIdenticalPlanarTexgen()) { bumpy_scale_u *= 0.5f; @@ -3797,7 +3797,7 @@ void LLPanelFace::onCommitTextureScaleY( LLUICtrl* ctrl, void* userdata ) LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - F32 bumpy_scale_v = self->getChild<LLUICtrl>("TexScaleV")->getValue().asReal(); + F32 bumpy_scale_v = (F32)self->getChild<LLUICtrl>("TexScaleV")->getValue().asReal(); if (self->isIdenticalPlanarTexgen()) { bumpy_scale_v *= 0.5f; @@ -3818,7 +3818,7 @@ void LLPanelFace::onCommitTextureRot( LLUICtrl* ctrl, void* userdata ) if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncMaterialRot(self, self->getChild<LLUICtrl>("TexRot")->getValue().asReal()); + syncMaterialRot(self, (F32)self->getChild<LLUICtrl>("TexRot")->getValue().asReal()); } else { @@ -3833,7 +3833,7 @@ void LLPanelFace::onCommitTextureOffsetX( LLUICtrl* ctrl, void* userdata ) LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetX(self, self->getChild<LLUICtrl>("TexOffsetU")->getValue().asReal()); + syncOffsetX(self, (F32)self->getChild<LLUICtrl>("TexOffsetU")->getValue().asReal()); } else { @@ -3848,7 +3848,7 @@ void LLPanelFace::onCommitTextureOffsetY( LLUICtrl* ctrl, void* userdata ) LLPanelFace* self = (LLPanelFace*) userdata; if (gSavedSettings.getBOOL("SyncMaterialSettings")) { - syncOffsetY(self, self->getChild<LLUICtrl>("TexOffsetV")->getValue().asReal()); + syncOffsetY(self, (F32)self->getChild<LLUICtrl>("TexOffsetV")->getValue().asReal()); } else { @@ -3861,27 +3861,27 @@ void LLPanelFace::onCommitTextureOffsetY( LLUICtrl* ctrl, void* userdata ) // static void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) { - LLPanelFace* self = (LLPanelFace*) userdata; + LLPanelFace *self = (LLPanelFace *) userdata; - LLUICtrl* repeats_ctrl = self->getChild<LLUICtrl>("rptctrl"); + LLUICtrl *repeats_ctrl = self->getChild<LLUICtrl>("rptctrl"); U32 materials_media = self->mComboMatMedia->getCurrentIndex(); - U32 material_type = 0; + U32 material_type = 0; if (materials_media == MATMEDIA_PBR) { - LLRadioGroup* radio_mat_type = self->getChild<LLRadioGroup>("radio_pbr_type"); - material_type = radio_mat_type->getSelectedIndex(); + LLRadioGroup *radio_mat_type = self->getChild<LLRadioGroup>("radio_pbr_type"); + material_type = radio_mat_type->getSelectedIndex(); } if (materials_media == MATMEDIA_MATERIAL) { - LLRadioGroup* radio_mat_type = self->getChild<LLRadioGroup>("radio_material_type"); - material_type = radio_mat_type->getSelectedIndex(); + LLRadioGroup *radio_mat_type = self->getChild<LLRadioGroup>("radio_material_type"); + material_type = radio_mat_type->getSelectedIndex(); } - F32 repeats_per_meter = repeats_ctrl->getValue().asReal(); + F32 repeats_per_meter = (F32) repeats_ctrl->getValue().asReal(); - F32 obj_scale_s = 1.0f; - F32 obj_scale_t = 1.0f; + F32 obj_scale_s = 1.0f; + F32 obj_scale_t = 1.0f; bool identical_scale_s = false; bool identical_scale_t = false; @@ -3889,10 +3889,10 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata) LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s); LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t); - LLUICtrl* bumpy_scale_u = self->getChild<LLUICtrl>("bumpyScaleU"); - LLUICtrl* bumpy_scale_v = self->getChild<LLUICtrl>("bumpyScaleV"); - LLUICtrl* shiny_scale_u = self->getChild<LLUICtrl>("shinyScaleU"); - LLUICtrl* shiny_scale_v = self->getChild<LLUICtrl>("shinyScaleV"); + LLUICtrl *bumpy_scale_u = self->getChild<LLUICtrl>("bumpyScaleU"); + LLUICtrl *bumpy_scale_v = self->getChild<LLUICtrl>("bumpyScaleV"); + LLUICtrl *shiny_scale_u = self->getChild<LLUICtrl>("shinyScaleU"); + LLUICtrl *shiny_scale_v = self->getChild<LLUICtrl>("shinyScaleV"); if (gSavedSettings.getBOOL("SyncMaterialSettings")) { @@ -5085,7 +5085,7 @@ bool LLPanelFace::Selection::compareSelection() void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl) { - const float value = ctrl->getValue().asReal(); + const float value = (F32)ctrl->getValue().asReal(); const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) { @@ -5095,7 +5095,7 @@ void LLPanelFace::onCommitGLTFTextureScaleU(LLUICtrl* ctrl) void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl) { - const float value = ctrl->getValue().asReal(); + const float value = (F32)ctrl->getValue().asReal(); const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) { @@ -5105,7 +5105,7 @@ void LLPanelFace::onCommitGLTFTextureScaleV(LLUICtrl* ctrl) void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl) { - const float value = ctrl->getValue().asReal() * DEG_TO_RAD; + const float value = (F32)ctrl->getValue().asReal() * DEG_TO_RAD; const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) { @@ -5115,7 +5115,7 @@ void LLPanelFace::onCommitGLTFRotation(LLUICtrl* ctrl) void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl) { - const float value = ctrl->getValue().asReal(); + const float value = (F32)ctrl->getValue().asReal(); const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) { @@ -5125,7 +5125,7 @@ void LLPanelFace::onCommitGLTFTextureOffsetU(LLUICtrl* ctrl) void LLPanelFace::onCommitGLTFTextureOffsetV(LLUICtrl* ctrl) { - const float value = ctrl->getValue().asReal(); + const float value = (F32)ctrl->getValue().asReal(); const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); updateGLTFTextureTransform(value, pbr_type, [&](LLGLTFMaterial::TextureTransform* new_transform) { diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ba52da0760..bbf533b694 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1177,7 +1177,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() return; // Get data needed for filter display - U32 filter_types = mFilter->getFilterObjectTypes(); + U32 filter_types = (U32)mFilter->getFilterObjectTypes(); LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); U32 hours = mFilter->getHoursAgo(); U32 date_search_direction = mFilter->getDateSearchDirection(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 0925351350..35961da579 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -119,7 +119,7 @@ void LLPanelMarketplaceInbox::onFocusReceived() sidepanel_inventory->clearSelections(true, false); } - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", (U32)time_corrected()); } bool LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 526462b940..557c7bbd7b 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -225,7 +225,7 @@ void LLInboxFolderViewFolder::deFreshify() { mFresh = false; - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", (U32)time_corrected()); LLInboxNewItemsStorage::getInstance()->removeItem(static_cast<LLFolderViewModelItemInventory*>(getViewModelItem())->getUUID()); } @@ -304,7 +304,7 @@ void LLInboxFolderViewItem::deFreshify() { mFresh = false; - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", (U32)time_corrected()); } LLInboxNewItemsStorage::LLInboxNewItemsStorage() diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 172c7d0828..f8a73ddb46 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -245,11 +245,14 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata) { return LLLogChat::isTranscriptExist(mUUIDs.front()); } - else if (item == std::string("can_im") || item == std::string("can_invite") || - item == std::string("can_share") || item == std::string("can_pay")) + else if (item == std::string("can_im") || item == std::string("can_invite")) { return true; } + else if (item == std::string("can_share") || item == std::string("can_pay")) + { + return mUUIDs.size() == 1; + } return false; } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 2a27a6e143..aa35335ad9 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -986,7 +986,7 @@ void shorten_name(std::string &name, const LLStyle::Params& style_params, S32 ma LLWString wline = utf8str_to_wstring(name); // panel supports two lines long names - S32 segment_length = font->maxDrawableChars(wline.c_str(), max_pixels, static_cast<S32>(wline.length()), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); + S32 segment_length = font->maxDrawableChars(wline.c_str(), (F32)max_pixels, static_cast<S32>(wline.length()), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE); if (segment_length == wline.length()) { // no work needed @@ -994,7 +994,7 @@ void shorten_name(std::string &name, const LLStyle::Params& style_params, S32 ma } S32 first_line_length = segment_length; - segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), max_pixels, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); + segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), (F32)max_pixels, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); if (segment_length + first_line_length == wline.length()) { // no work needed @@ -1003,8 +1003,8 @@ void shorten_name(std::string &name, const LLStyle::Params& style_params, S32 ma // name does not fit, cut it, add ... const LLWString dots_pad(utf8str_to_wstring(std::string("...."))); - S32 elipses_width = font->getWidthF32(dots_pad.c_str()); - segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), max_pixels - elipses_width, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); + F32 elipses_width = font->getWidthF32(dots_pad.c_str()); + segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), (F32)max_pixels - elipses_width, static_cast<S32>(wline.length()), LLFontGL::ANYWHERE); name = name.substr(0, segment_length + first_line_length) + std::string("..."); } diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 4ceeaa5d51..18588514f8 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -395,9 +395,9 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), (F32)pos_global.mdV[VZ]); - parcel_data.global_x = pos_global.mdV[VX]; - parcel_data.global_y = pos_global.mdV[VY]; - parcel_data.global_z = pos_global.mdV[VZ]; + parcel_data.global_x = (F32)pos_global.mdV[VX]; + parcel_data.global_y = (F32)pos_global.mdV[VY]; + parcel_data.global_z = (F32)pos_global.mdV[VZ]; parcel_data.owner_id = parcel->getOwnerID(); std::string on = getString("on"); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 1299c8c656..4e905ae0fd 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -421,7 +421,7 @@ void LLPanelPrimMediaControls::updateShape() if(mUpdateSlider && mMovieDuration!= 0) { F64 current_time = media_plugin->getCurrentTime(); - F32 percent = current_time / mMovieDuration; + F32 percent = (F32)(current_time / mMovieDuration); mMediaPlaySliderCtrl->setValue(percent); mMediaPlaySliderCtrl->setEnabled(true); } @@ -1309,7 +1309,7 @@ void LLPanelPrimMediaControls::onMediaPlaySliderCtrlMouseUp() } else { - media_impl->seek(cur_value * mMovieDuration); + media_impl->seek((F32)(cur_value * mMovieDuration)); } } diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 2536dce606..69047a30cd 100644 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -211,12 +211,12 @@ void LLPanelSnapshot::onCustomResolutionCommit() S32 width = widthSpinner->getValue().asInteger(); width = power_of_two(width, MAX_TEXTURE_SIZE); info["w"] = width; - widthSpinner->setIncrement(width >> 1); + widthSpinner->setIncrement((F32)(width >> 1)); widthSpinner->forceSetValue(width); S32 height = heightSpinner->getValue().asInteger(); height = power_of_two(height, MAX_TEXTURE_SIZE); - heightSpinner->setIncrement(height >> 1); - heightSpinner->forceSetValue(height); + heightSpinner->setIncrement((F32)(height >> 1)); + heightSpinner->forceSetValue((F32)height); info["h"] = height; } else diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 4e096ecc95..951dc45a78 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -899,25 +899,25 @@ void LLPanelVolume::sendPhysicsShapeType(LLUICtrl* ctrl, void* userdata) void LLPanelVolume::sendPhysicsGravity(LLUICtrl* ctrl, void* userdata) { - F32 val = ctrl->getValue().asReal(); + F32 val = (F32)ctrl->getValue().asReal(); LLSelectMgr::getInstance()->selectionSetGravity(val); } void LLPanelVolume::sendPhysicsFriction(LLUICtrl* ctrl, void* userdata) { - F32 val = ctrl->getValue().asReal(); + F32 val = (F32)ctrl->getValue().asReal(); LLSelectMgr::getInstance()->selectionSetFriction(val); } void LLPanelVolume::sendPhysicsRestitution(LLUICtrl* ctrl, void* userdata) { - F32 val = ctrl->getValue().asReal(); + F32 val = (F32)ctrl->getValue().asReal(); LLSelectMgr::getInstance()->selectionSetRestitution(val); } void LLPanelVolume::sendPhysicsDensity(LLUICtrl* ctrl, void* userdata) { - F32 val = ctrl->getValue().asReal(); + F32 val = (F32)ctrl->getValue().asReal(); LLSelectMgr::getInstance()->selectionSetDensity(val); } @@ -1099,10 +1099,10 @@ void LLPanelVolume::onPasteFeatures() objectp->setMaterial(material); objectp->sendMaterialUpdate(); - objectp->setPhysicsGravity(clipboard["physics"]["gravity"].asReal()); - objectp->setPhysicsFriction(clipboard["physics"]["friction"].asReal()); - objectp->setPhysicsDensity(clipboard["physics"]["density"].asReal()); - objectp->setPhysicsRestitution(clipboard["physics"]["restitution"].asReal()); + objectp->setPhysicsGravity((F32)clipboard["physics"]["gravity"].asReal()); + objectp->setPhysicsFriction((F32)clipboard["physics"]["friction"].asReal()); + objectp->setPhysicsDensity((F32)clipboard["physics"]["density"].asReal()); + objectp->setPhysicsRestitution((F32)clipboard["physics"]["restitution"].asReal()); objectp->updateFlags(true); } @@ -1127,10 +1127,10 @@ void LLPanelVolume::onPasteFeatures() LLFlexibleObjectData new_attributes; new_attributes = *attributes; new_attributes.setSimulateLOD(clipboard["flex"]["lod"].asInteger()); - new_attributes.setGravity(clipboard["flex"]["gav"].asReal()); - new_attributes.setTension(clipboard["flex"]["ten"].asReal()); - new_attributes.setAirFriction(clipboard["flex"]["fri"].asReal()); - new_attributes.setWindSensitivity(clipboard["flex"]["sen"].asReal()); + new_attributes.setGravity((F32)clipboard["flex"]["gav"].asReal()); + new_attributes.setTension((F32)clipboard["flex"]["ten"].asReal()); + new_attributes.setAirFriction((F32)clipboard["flex"]["fri"].asReal()); + new_attributes.setWindSensitivity((F32)clipboard["flex"]["sen"].asReal()); F32 fx = (F32)clipboard["flex"]["forx"].asReal(); F32 fy = (F32)clipboard["flex"]["fory"].asReal(); F32 fz = (F32)clipboard["flex"]["forz"].asReal(); diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 66cc26469e..a6d26727f4 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -83,7 +83,7 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) { llassert(pCharacterData.has(CHARACTER_CPU_TIME_FIELD)); llassert(pCharacterData.get(CHARACTER_CPU_TIME_FIELD).isReal()); - mCPUTime = pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); + mCPUTime = (F32)pCharacterData.get(CHARACTER_CPU_TIME_FIELD).asReal(); llassert(pCharacterData.has(CHARACTER_HORIZONTAL_FIELD)); llassert(pCharacterData.get(CHARACTER_HORIZONTAL_FIELD).isBoolean()); @@ -91,9 +91,9 @@ void LLPathfindingCharacter::parseCharacterData(const LLSD &pCharacterData) llassert(pCharacterData.has(CHARACTER_LENGTH_FIELD)); llassert(pCharacterData.get(CHARACTER_LENGTH_FIELD).isReal()); - mLength = pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); + mLength = (F32)pCharacterData.get(CHARACTER_LENGTH_FIELD).asReal(); llassert(pCharacterData.has(CHARACTER_RADIUS_FIELD)); llassert(pCharacterData.get(CHARACTER_RADIUS_FIELD).isReal()); - mRadius = pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); + mRadius = (F32)pCharacterData.get(CHARACTER_RADIUS_FIELD).asReal(); } diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp index 64f438976a..37bb59a65c 100644 --- a/indra/newview/llperfstats.cpp +++ b/indra/newview/llperfstats.cpp @@ -91,7 +91,7 @@ namespace LLPerfStats const auto newval = gSavedSettings.getF32("RenderAvatarMaxART"); if(newval < log10(LLPerfStats::ART_UNLIMITED_NANOS/1000)) { - LLPerfStats::renderAvatarMaxART_ns = pow(10,newval)*1000; + LLPerfStats::renderAvatarMaxART_ns = (U64)pow(10,newval)*1000; } else { @@ -301,7 +301,7 @@ namespace LLPerfStats std::vector<LLVector3d> positions; uuid_vec_t avatar_ids; - LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, our_pos, distance); + LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, our_pos, (F32)distance); return static_cast<int>(positions.size()); } @@ -375,7 +375,7 @@ namespace LLPerfStats { // if we have less than the user's "max Non-Impostors" avatars within the desired range then adjust the limit. // also adjusts back up again for nearby crowds. - auto count = countNearbyAvatars(std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance)); + auto count = countNearbyAvatars((S32)std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance)); if( count != tunables.nonImpostors ) { tunables.updateNonImposters(((U32)count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER) ? count : 0); @@ -476,7 +476,7 @@ namespace LLPerfStats // max render this frame may be higher than the last (cos new entrants and jitter) so make sure we are heading in the right direction if( new_render_limit_ns > renderAvatarMaxART_ns ) { - new_render_limit_ns = renderAvatarMaxART_ns; + new_render_limit_ns = (double)renderAvatarMaxART_ns; } if (new_render_limit_ns > LLPerfStats::ART_MIN_ADJUST_DOWN_NANOS) @@ -485,12 +485,12 @@ namespace LLPerfStats } // bounce at the bottom to prevent "no limit" - new_render_limit_ns = std::max((U64)new_render_limit_ns, (U64)LLPerfStats::ART_MINIMUM_NANOS); + new_render_limit_ns = (double)std::max((U64)new_render_limit_ns, (U64)LLPerfStats::ART_MINIMUM_NANOS); // assign the new value if (renderAvatarMaxART_ns != new_render_limit_ns) { - renderAvatarMaxART_ns = new_render_limit_ns; + renderAvatarMaxART_ns = (U64)new_render_limit_ns; tunables.updateSettingsFromRenderCostLimit(); } // LL_DEBUGS() << "AUTO_TUNE: avatar_budget adjusted to:" << new_render_limit_ns << LL_ENDL; diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index b6bcd6dd7d..6782aa2123 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -445,8 +445,8 @@ F32 LLPhysicsMotion::calculateAcceleration_local(const F32 velocity_local, const const F32 acceleration_local = (velocity_local - mVelocityJoint_local) / time_delta; const F32 smoothed_acceleration_local = - acceleration_local * 1.0/smoothing + - mAccelerationJoint_local * (smoothing-1.0)/smoothing; + acceleration_local * 1.0f/smoothing + + mAccelerationJoint_local * (smoothing-1.0f)/smoothing; return smoothed_acceleration_local; } @@ -603,7 +603,7 @@ bool LLPhysicsMotion::onUpdate(F32 time) // Drag is a force imparted by velocity (intuitively it is similar to wind resistance) // F = .5kv^2 - const F32 force_drag = .5*behavior_drag*velocity_joint_local*velocity_joint_local*llsgn(velocity_joint_local); + const F32 force_drag = (F32)(.5 * behavior_drag * velocity_joint_local * velocity_joint_local * llsgn(velocity_joint_local)); const F32 force_net = (force_accel + force_gravity + @@ -631,7 +631,7 @@ bool LLPhysicsMotion::onUpdate(F32 time) // Temporary debugging setting to cause all avatars to move, for profiling purposes. if (physics_test) { - velocity_new_local = sin(time*4.0); + velocity_new_local = sin(time*4.0f); } // Calculate the new parameters, or remain unchanged if max speed is 0. F32 position_new_local = position_current_local + velocity_new_local*time_iteration_step; @@ -697,7 +697,7 @@ bool LLPhysicsMotion::onUpdate(F32 time) // For non-self, if the avatar is small enough visually, then don't update. const F32 area_for_max_settings = 0.0; const F32 area_for_min_settings = 1400.0; - const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor); + const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0f-lod_factor); const F32 pixel_area = sqrtf(mCharacter->getPixelArea()); const bool is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != NULL); @@ -763,8 +763,8 @@ void LLPhysicsMotion::setParamValue(const LLViewerVisualParam *param, { const F32 value_min_local = param->getMinWeight(); const F32 value_max_local = param->getMaxWeight(); - const F32 min_val = 0.5f-behavior_maxeffect/2.0; - const F32 max_val = 0.5f+behavior_maxeffect/2.0; + const F32 min_val = 0.5f-behavior_maxeffect/2.0f; + const F32 max_val = 0.5f+behavior_maxeffect/2.0f; // Scale from [0,1] to [min_val,max_val] const F32 new_value_rescaled = min_val + (max_val-min_val) * new_value_normalized; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 259332a3ff..2a5d7f2450 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -657,7 +657,7 @@ void LLPreviewTexture::adjustAspectRatio() S32 num = mImage->getFullWidth() / divisor; S32 denom = mImage->getFullHeight() / divisor; - if (setAspectRatio(num, denom)) + if (setAspectRatio((F32)num, (F32)denom)) { // Select corresponding ratio entry in the combo list LLComboBox* combo = getChild<LLComboBox>("combo_aspect_ratio"); @@ -677,7 +677,7 @@ void LLPreviewTexture::adjustAspectRatio() } else { - combo->setCurrentByIndex(found - mRatiosList.begin()); + combo->setCurrentByIndex((S32)(found - mRatiosList.begin())); } } } diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index e03984a44c..7bef0339c5 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -388,7 +388,7 @@ void LLProgressView::initLogos() // We don't know final screen rect yet, so we can't precalculate position fully LLTextBox *logos_label = getChild<LLTextBox>("logos_lbl"); - S32 texture_start_x = logos_label->getFont()->getWidthF32(logos_label->getText()) + default_pad; + S32 texture_start_x = (S32)logos_label->getFont()->getWidthF32(logos_label->getText()) + default_pad; S32 texture_start_y = -7; // Normally we would just preload these textures from textures.xml, @@ -590,7 +590,7 @@ bool LLProgressView::handleUpdate(const LLSD& event_data) if(percent.isDefined()) { - setPercent(percent.asReal()); + setPercent((F32)percent.asReal()); } return false; } diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index d64dfdfcbc..c698139c6d 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -114,8 +114,8 @@ F32 LLRecentPeople::getArrivalTimeByID(const LLUUID& id) if (it != mAvatarsArrivalTime.end()) { - return it->second; + return (F32)(it->second); } - return LLDate::now().secondsSinceEpoch(); + return (F32)LLDate::now().secondsSinceEpoch(); } diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index cb1ab0dac2..1efe51c1aa 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -230,7 +230,7 @@ void LLReflectionMapManager::update() if (mMipChain.empty()) { U32 res = mProbeResolution; - U32 count = log2((F32)res) + 0.5f; + U32 count = (U32)(log2((F32)res) + 0.5f); mMipChain.resize(count); for (U32 i = 0; i < count; ++i) @@ -251,7 +251,7 @@ void LLReflectionMapManager::update() auto const & iter = std::find(mProbes.begin(), mProbes.end(), probe); if (iter != mProbes.end()) { - deleteProbe(iter - mProbes.begin()); + deleteProbe((U32)(iter - mProbes.begin())); } } @@ -761,7 +761,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) } - S32 mips = log2((F32)mProbeResolution) + 0.5f; + S32 mips = (S32)(log2((F32)mProbeResolution) + 0.5f); gReflectionMipProgram.bind(); S32 diffuseChannel = gReflectionMipProgram.enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, LLTexUnit::TT_TEXTURE); @@ -839,7 +839,7 @@ void LLReflectionMapManager::updateProbeFace(LLReflectionMap* probe, U32 face) static LLStaticHashedString sWidth("u_width"); gRadianceGenProgram.uniform1f(sRoughness, (F32)i / (F32)(mMipChain.size() - 1)); - gRadianceGenProgram.uniform1f(sMipLevel, i); + gRadianceGenProgram.uniform1f(sMipLevel, (GLfloat)i); gRadianceGenProgram.uniform1i(sWidth, mProbeResolution); for (int cf = 0; cf < 6; ++cf) @@ -1378,7 +1378,7 @@ void LLReflectionMapManager::initReflectionMaps() mReset = false; mReflectionProbeCount = count; mProbeResolution = nhpo2(llclamp(gSavedSettings.getU32("RenderReflectionProbeResolution"), (U32)64, (U32)512)); - mMaxProbeLOD = log2f(mProbeResolution) - 1.f; // number of mips - 1 + mMaxProbeLOD = log2f((F32)mProbeResolution) - 1.f; // number of mips - 1 if (mTexture.isNull() || mTexture->getWidth() != mProbeResolution || diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 89ec2bf72e..f75e48c728 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -259,7 +259,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect new_world_rect) //-------------------------------------------------------------------------- void LLScreenChannel::addToast(const LLToast::Params& p) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; bool store_toast = false, show_toast = false; if (mDisplayToastsAlways) diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp index 6eb8cf0b37..6f23477415 100644 --- a/indra/newview/llscripteditor.cpp +++ b/indra/newview/llscripteditor.cpp @@ -127,7 +127,7 @@ void LLScriptEditor::drawLineNumbers() ltext, // string to draw 0, // begin offset UI_TEXTEDITOR_LINE_NUMBER_MARGIN - 2, // x - line_bottom, // y + (F32)line_bottom, // y fg_color, LLFontGL::RIGHT, // horizontal alignment LLFontGL::BOTTOM, // vertical alignment diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 2d8a5eaf13..1e50135e89 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -901,7 +901,7 @@ void _validateCert(int validation_policy, if (validation_policy & VALIDATION_POLICY_TIME) { - LLDate validation_date(time(NULL)); + LLDate validation_date((double)time(NULL)); if(validation_params.has(CERT_VALIDATION_DATE)) { validation_date = validation_params[CERT_VALIDATION_DATE]; @@ -1111,7 +1111,7 @@ void LLBasicCertificateStore::validate(int validation_policy, } else { - validation_date = LLDate(time(NULL)); // current time + validation_date = LLDate((double)time(NULL)); // current time } if((validation_date < cache_entry->second.first) || @@ -1358,8 +1358,8 @@ void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_l protected_data_stream.read((char *)buffer, BUFFER_READ_SIZE); EVP_DecryptUpdate(ctx, decrypted_buffer, &decrypted_length, - buffer, protected_data_stream.gcount()); - decrypted_data.append((const char *)decrypted_buffer, protected_data_stream.gcount()); + buffer, (int)protected_data_stream.gcount()); + decrypted_data.append((const char *)decrypted_buffer, (int)protected_data_stream.gcount()); } // RC4 is a stream cipher, so we don't bother to EVP_DecryptFinal, as there is @@ -1447,7 +1447,7 @@ void LLSecAPIBasicHandler::_writeProtectedData() } int encrypted_length; EVP_EncryptUpdate(ctx, encrypted_buffer, &encrypted_length, - buffer, formatted_data_istream.gcount()); + buffer, (int)formatted_data_istream.gcount()); protected_data_stream.write((const char *)encrypted_buffer, encrypted_length); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b3420f9c57..fcd1c84ba4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -56,6 +56,7 @@ #include "llattachmentsmgr.h" #include "llviewerwindow.h" #include "lldrawable.h" +#include "llfloatergltfasseteditor.h" #include "llfloaterinspect.h" #include "llfloaterreporter.h" #include "llfloaterreg.h" @@ -467,6 +468,11 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectOnly(LLViewerObject* object, S3 if (object->isSelected() ) { // make sure point at position is updated updatePointAt(); + LLSelectNode* nodep = mSelectedObjects->findNode(object); + if (nodep) + { + nodep->selectGLTFNode(gltf_node, gltf_primitive, true); + } gEditMenuHandler = this; return NULL; } @@ -3052,7 +3058,7 @@ void LLSelectMgr::adjustTexturesByScale(bool send_to_sim, bool stretch) for (U8 te_num = 0; te_num < object->getNumTEs(); te_num++) { - const LLTextureEntry* tep = object->getTE(te_num); + LLTextureEntry* tep = object->getTE(te_num); bool planar = tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR; if (planar == stretch) @@ -3086,8 +3092,6 @@ void LLSelectMgr::adjustTexturesByScale(bool send_to_sim, bool stretch) object->setTEScale(te_num, diffuse_scale_s, diffuse_scale_t); - LLTextureEntry* tep = object->getTE(te_num); - if (tep && !tep->getMaterialParams().isNull()) { LLMaterialPtr orig = tep->getMaterialParams(); @@ -3125,6 +3129,47 @@ void LLSelectMgr::adjustTexturesByScale(bool send_to_sim, bool stretch) LLMaterialMgr::getInstance()->put(object->getID(), te_num, *p); } } + + if (tep->getGLTFMaterial()) + { + LLPointer<LLGLTFMaterial> material = tep->getGLTFMaterialOverride(); + if (!material) + { + material = new LLGLTFMaterial(); + tep->setGLTFMaterialOverride(material); + } + + F32 scale_x = 1; + F32 scale_y = 1; + + for (U32 i = 0; i < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++i) + { + LLVector3 scale_ratio = selectNode->mGLTFScaleRatios[te_num][i]; + + if (planar) + { + scale_x = scale_ratio.mV[s_axis] / object_scale.mV[s_axis]; + scale_y = scale_ratio.mV[t_axis] / object_scale.mV[t_axis]; + } + else + { + scale_x = scale_ratio.mV[s_axis] * object_scale.mV[s_axis]; + scale_y = scale_ratio.mV[t_axis] * object_scale.mV[t_axis]; + } + material->mTextureTransform[i].mScale.set(scale_x, scale_y); + } + + LLFetchedGLTFMaterial* render_mat = (LLFetchedGLTFMaterial*)tep->getGLTFRenderMaterial(); + if (render_mat) + { + render_mat->applyOverride(*material); + } + + if (send_to_sim) + { + LLGLTFMaterialList::queueModify(object, te_num, material); + } + } send = send_to_sim; } } @@ -6848,6 +6893,7 @@ void LLSelectNode::saveGLTFMaterials(const uuid_vec_t& materials, const gltf_mat void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query) { mTextureScaleRatios.clear(); + mGLTFScaleRatios.clear(); if (mObject.notNull()) { @@ -6882,6 +6928,40 @@ void LLSelectNode::saveTextureScaleRatios(LLRender::eTexIndex index_to_query) v.mV[t_axis] = diffuse_t/scale.mV[t_axis]; mTextureScaleRatios.push_back(v); } + + LLGLTFMaterial* material = tep->getGLTFMaterialOverride(); + LLVector3 material_v; + F32 scale_x = 1; + F32 scale_y = 1; + std::vector<LLVector3> material_v_vec; + for (U32 i = 0; i < LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; ++i) + { + if (material) + { + LLGLTFMaterial::TextureTransform& transform = material->mTextureTransform[i]; + scale_x = transform.mScale[VX]; + scale_y = transform.mScale[VY]; + } + else + { + // Not having an override doesn't mean that there is no material + scale_x = 1; + scale_y = 1; + } + + if (tep->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR) + { + material_v.mV[s_axis] = scale_x * scale.mV[s_axis]; + material_v.mV[t_axis] = scale_y * scale.mV[t_axis]; + } + else + { + material_v.mV[s_axis] = scale_x / scale.mV[s_axis]; + material_v.mV[t_axis] = scale_y / scale.mV[t_axis]; + } + material_v_vec.push_back(material_v); + } + mGLTFScaleRatios.push_back(material_v_vec); } } } @@ -7187,6 +7267,12 @@ void dialog_refresh_all() { panel_task_info->dirty(); } + + LLFloaterGLTFAssetEditor * gltf_editor = LLFloaterReg::findTypedInstance<LLFloaterGLTFAssetEditor>("gltf_asset_editor"); + if (gltf_editor) + { + gltf_editor->dirty(); + } } S32 get_family_count(LLViewerObject *parent) diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 0456b109d7..355e28595b 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -239,6 +239,7 @@ public: uuid_vec_t mSavedGLTFMaterialIds; gltf_materials_vec_t mSavedGLTFOverrideMaterials; std::vector<LLVector3> mTextureScaleRatios; + std::vector< std::vector<LLVector3> > mGLTFScaleRatios; std::vector<LLVector3> mSilhouetteVertices; // array of vertices to render silhouette of object std::vector<LLVector3> mSilhouetteNormals; // array of normals to render silhouette of object bool mSilhouetteExists; // need to generate silhouette? diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 42927769de..fdb73efa14 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -609,8 +609,8 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA legacy[SETTING_CLOUD_POS_DENSITY2] = ensure_array_4(settings[SETTING_CLOUD_POS_DENSITY2], 1.0); legacy[SETTING_CLOUD_SCALE] = llsd::array(settings[SETTING_CLOUD_SCALE], LLSD::Real(0.0), LLSD::Real(0.0), LLSD::Real(1.0)); legacy[SETTING_CLOUD_SCROLL_RATE] = settings[SETTING_CLOUD_SCROLL_RATE]; - legacy[SETTING_LEGACY_ENABLE_CLOUD_SCROLL] = llsd::array(LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][0].asReal())), - LLSD::Boolean(!is_approx_zero(settings[SETTING_CLOUD_SCROLL_RATE][1].asReal()))); + legacy[SETTING_LEGACY_ENABLE_CLOUD_SCROLL] = llsd::array(LLSD::Boolean(!is_approx_zero((F32)settings[SETTING_CLOUD_SCROLL_RATE][0].asReal())), + LLSD::Boolean(!is_approx_zero((F32)settings[SETTING_CLOUD_SCROLL_RATE][1].asReal()))); legacy[SETTING_CLOUD_SHADOW] = llsd::array(settings[SETTING_CLOUD_SHADOW].asReal(), 0.0f, 0.0f, 1.0f); legacy[SETTING_GAMMA] = llsd::array(settings[SETTING_GAMMA], 0.0f, 0.0f, 1.0f); legacy[SETTING_GLOW] = ensure_array_4(settings[SETTING_GLOW], 1.0); @@ -756,7 +756,7 @@ void LLSettingsVOSky::applySpecial(void *ptarget, bool force) if (psky->getReflectionProbeAmbiance() != 0.f) { shader->uniform3fv(LLShaderMgr::AMBIENT, LLVector3(ambient.mV)); - shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, sqrtf(g)*2.0); // use a modifier here so 1.0 maps to the "most desirable" default and the maximum value doesn't go off the rails + shader->uniform1f(LLShaderMgr::SKY_HDR_SCALE, sqrtf(g)*2.0f); // use a modifier here so 1.0 maps to the "most desirable" default and the maximum value doesn't go off the rails } else if (psky->canAutoAdjust() && should_auto_adjust) { // auto-adjust legacy sky to take advantage of probe ambiance @@ -1055,7 +1055,7 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force) shader->uniform3fv(LLShaderMgr::WATER_FOGCOLOR_LINEAR, linearColor3(fog_color).mV); - F32 blend_factor = env.getCurrentWater()->getBlendFactor(); + F32 blend_factor = (F32)env.getCurrentWater()->getBlendFactor(); shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); // update to normal lightnorm, water shader itself will use rotated lightnorm as necessary diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 0d81f2c099..9b7289df67 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -372,7 +372,7 @@ void LLSidepanelInventory::onToggleInboxBtn() mInboxLayoutPanel->setTargetDim(gSavedPerAccountSettings.getS32("InventoryInboxHeight")); if (mInboxLayoutPanel->isInVisibleChain()) { - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", (U32)time_corrected()); } } else @@ -397,7 +397,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) #else if (mInboxEnabled && getChild<LLButton>(INBOX_BUTTON_NAME)->getToggleState()) { - gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", time_corrected()); + gSavedPerAccountSettings.setU32("LastInventoryInboxActivity", (U32)time_corrected()); } #endif diff --git a/indra/newview/llsidetraypanelcontainer.cpp b/indra/newview/llsidetraypanelcontainer.cpp index eb8e05ec27..44e0c3b05c 100644 --- a/indra/newview/llsidetraypanelcontainer.cpp +++ b/indra/newview/llsidetraypanelcontainer.cpp @@ -62,10 +62,10 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key) getCurrentPanel()->onOpen(key); } -void LLSideTrayPanelContainer::openPanel(const std::string& panel_name, const LLSD& key) +void LLSideTrayPanelContainer::openPanel(std::string_view panel_name, const LLSD& key) { LLSD combined_key = key; - combined_key[PARAM_SUB_PANEL_NAME] = panel_name; + combined_key[PARAM_SUB_PANEL_NAME] = std::string(panel_name); onOpen(combined_key); } diff --git a/indra/newview/llsidetraypanelcontainer.h b/indra/newview/llsidetraypanelcontainer.h index 5dfd7f2d83..0017d7743f 100644 --- a/indra/newview/llsidetraypanelcontainer.h +++ b/indra/newview/llsidetraypanelcontainer.h @@ -59,7 +59,7 @@ public: /** * Opens given subpanel. */ - void openPanel(const std::string& panel_name, const LLSD& key = LLSD::emptyMap()); + void openPanel(std::string_view panel_name, const LLSD& key = LLSD::emptyMap()); /** * Opens previous panel from panel navigation history. diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index d80cf2e80e..9e567e3262 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -342,7 +342,7 @@ LLSLURL::LLSLURL(const std::string& grid, S32 y = ll_round((F32)fmod(position[VY], (F32)REGION_WIDTH_METERS)); S32 z = ll_round((F32)position[VZ]); mType = LOCATION; - mPosition = LLVector3(x, y, z); + mPosition = LLVector3((F32)x, (F32)y, (F32)z); } // create a simstring @@ -358,7 +358,7 @@ LLSLURL::LLSLURL(const std::string& grid, const LLVector3d& global_position) { *this = LLSLURL(LLGridManager::getInstance()->getGridId(grid), region, - LLVector3(global_position.mdV[VX], global_position.mdV[VY], global_position.mdV[VZ])); + LLVector3((F32)global_position.mdV[VX], (F32)global_position.mdV[VY], (F32)global_position.mdV[VZ])); } // create a slurl from a global position diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 787dd3b667..451f5bd607 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -906,7 +906,7 @@ void LLSnapshotLivePreview::estimateDataSize() break; case LLSnapshotModel::SNAPSHOT_FORMAT_JPEG: // Observed from JPG compression tests - ratio = (110 - mSnapshotQuality) / 2; + ratio = (F32)(110 - mSnapshotQuality) / 2.f; break; case LLSnapshotModel::SNAPSHOT_FORMAT_BMP: ratio = 1.0; // No compression with BMP diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 782d57aed8..05c5bb14c6 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -409,7 +409,7 @@ LLSpatialGroup* LLSpatialGroup::getParent() bool LLSpatialGroup::removeObject(LLDrawable *drawablep, bool from_octree) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL + LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; if(!drawablep) { @@ -634,7 +634,7 @@ void LLSpatialGroup::updateDistance(LLCamera &camera) F32 LLSpatialPartition::calcDistance(LLSpatialGroup* group, LLCamera& camera) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL + LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; LLVector4a eye; LLVector4a origin; @@ -729,7 +729,7 @@ F32 LLSpatialGroup::getUpdateUrgency() const bool LLSpatialGroup::changeLOD() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL + LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; if (hasState(ALPHA_DIRTY | OBJECT_DIRTY)) { @@ -818,7 +818,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL + LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; if (child->getListenerCount() == 0) { @@ -2035,7 +2035,7 @@ void renderNormals(LLDrawable *drawablep) obj_scale.normalize3(); // Create inverse-scale vector for normals - inv_scale.set(1.0 / scale_v3.mV[VX], 1.0 / scale_v3.mV[VY], 1.0 / scale_v3.mV[VZ], 0.0); + inv_scale.set(1.0f / scale_v3.mV[VX], 1.0f / scale_v3.mV[VY], 1.0f/ scale_v3.mV[VZ], 0.0f); inv_scale.mul(inv_scale); // Squared, to apply inverse scale twice inv_scale.normalize3fast(); @@ -2763,7 +2763,7 @@ void renderTexelDensity(LLDrawable* drawable) break; } - checkerboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f)); + checkerboard_matrix.initScale(LLVector3((F32)texturep->getWidth(discard_level) / 8.f, (F32)texturep->getHeight(discard_level) / 8.f, 1.f)); gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, true); gGL.matrixMode(LLRender::MM_TEXTURE); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index dd005874a5..b993ba16d5 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -957,7 +957,7 @@ bool idle_startup() // and startup time is close enough if we don't have a real value. if (gSavedPerAccountSettings.getU32("LastLogoff") == 0) { - gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); + gSavedPerAccountSettings.setU32("LastLogoff", (U32)time_corrected()); } //Default the path if one isn't set. @@ -1508,7 +1508,11 @@ bool idle_startup() // create a container's instance for start a controlling conversation windows // by the voice's events - LLFloaterIMContainer::getInstance(); + LLFloaterIMContainer *im_inst = LLFloaterIMContainer::getInstance(); + if(gAgent.isFirstLogin()) + { + im_inst->openFloater(im_inst->getKey()); + } if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 2) { LLViewerParcelAskPlay::getInstance()->loadSettings(); @@ -3665,7 +3669,7 @@ bool process_login_success_response() if(server_utc_time) { time_t now = time(NULL); - gUTCOffset = (server_utc_time - now); + gUTCOffset = (S32)(server_utc_time - now); // Print server timestamp LLSD substitution; diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 2a21170b07..0550889a9b 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -895,7 +895,7 @@ bool LLSurfacePatch::updateTexture() void LLSurfacePatch::updateGL() { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; F32 meters_per_grid = getSurface()->getMetersPerGrid(); F32 grids_per_patch_edge = (F32)getSurface()->getGridsPerPatchEdge(); diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index fa4e92e209..dd7c6aa9e3 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -127,7 +127,7 @@ void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d S32 removed_index = -1; if (item_iter != mItems.end()) { - removed_index = item_iter - mItems.begin(); + removed_index = (S32)(item_iter - mItems.begin()); mItems.erase(item_iter); } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 843da97089..be7653c011 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1260,7 +1260,7 @@ void LLTextureCache::updateEntryTimeStamp(S32 idx, Entry& entry) { if (!mReadOnly) { - entry.mTime = time(NULL); + entry.mTime = (U32)time(NULL); mUpdatedEntryMap[idx] = entry ; } } @@ -1299,7 +1299,7 @@ bool LLTextureCache::updateEntry(S32& idx, Entry& entry, S32 new_image_size, S32 mTexturesSizeTotal -= entry.mBodySize ; mTexturesSizeTotal += new_body_size ; } - entry.mTime = time(NULL); + entry.mTime = (U32)time(NULL); entry.mImageSize = new_image_size ; entry.mBodySize = new_body_size ; diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 81a70a81cf..e154777aef 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -2308,8 +2308,8 @@ void LLTextureCtrl::draw() font->renderUTF8( mLoadingPlaceholderString, 0, - llfloor(interior.mLeft+3), - llfloor(interior.mTop-v_offset), + (interior.mLeft+3), + (interior.mTop-v_offset), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, @@ -2325,17 +2325,17 @@ void LLTextureCtrl::draw() v_offset += 12; tdesc = llformat(" PK : %d%%", U32(mTexturep->getDownloadProgress()*100.0)); - font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset), + font->renderUTF8(tdesc, 0, interior.mLeft+3, interior.mTop-v_offset, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); v_offset += 12; tdesc = llformat(" LVL: %d", mTexturep->getDiscardLevel()); - font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset), + font->renderUTF8(tdesc, 0, interior.mLeft+3, interior.mTop-v_offset, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); v_offset += 12; tdesc = llformat(" ID : %s...", (mImageAssetID.asString().substr(0,7)).c_str()); - font->renderUTF8(tdesc, 0, llfloor(interior.mLeft+3), llfloor(interior.mTop-v_offset), + font->renderUTF8(tdesc, 0, interior.mLeft+3, interior.mTop-v_offset, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); } } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ee13baaa18..689c555998 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3210,7 +3210,7 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r { requested_priority = worker->mImagePriority; } - fetch_priority = worker->getImagePriority(); + fetch_priority = (U32)worker->getImagePriority(); can_use_http = worker->getCanUseHTTP() ; worker->unlockWorkMutex(); // -Mw } diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index 84ef45c97a..514064cf49 100644 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -214,7 +214,7 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microsecon F64 region_vocache_hit_rate = 0; if (region_hit_count > 0 || region_miss_count > 0) { - region_vocache_hit_rate = region_hit_count / (region_hit_count + region_miss_count); + region_vocache_hit_rate = (F64)region_hit_count / (region_hit_count + region_miss_count); } object_cache["vo_region_hitcount"] = ll_sd_from_U64(region_hit_count); object_cache["vo_region_misscount"] = ll_sd_from_U64(region_miss_count); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 9d7319d5b8..92527fc3a9 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -481,8 +481,8 @@ private: void LLGLTexMemBar::draw() { F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = LLAppViewer::getTextureCache()->getUsage().valueInUnits<LLUnits::Megabytes>(); - F32 cache_max_usage = LLAppViewer::getTextureCache()->getMaxUsage().valueInUnits<LLUnits::Megabytes>(); + F32 cache_usage = (F32)LLAppViewer::getTextureCache()->getUsage().valueInUnits<LLUnits::Megabytes>(); + F32 cache_max_usage = (F32)LLAppViewer::getTextureCache()->getMaxUsage().valueInUnits<LLUnits::Megabytes>(); S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); F32Bytes total_texture_downloaded = gTotalTextureData; @@ -530,6 +530,9 @@ void LLGLTexMemBar::draw() F64 raw_image_bytes_MB = raw_image_bytes / (1024.0 * 1024.0); F64 saved_raw_image_bytes_MB = saved_raw_image_bytes / (1024.0 * 1024.0); F64 aux_raw_image_bytes_MB = aux_raw_image_bytes / (1024.0 * 1024.0); + F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 1024.0 * 1.3333f; // add 33% for mipmaps + F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 1024.0; + F64 render_bytes_alloc = LLRenderTarget::sBytesAllocated / 1024.0 / 1024.0; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -559,7 +562,7 @@ void LLGLTexMemBar::draw() // draw a background above first line.... no idea where the rest of the background comes from for the below text gGL.color4f(0.f, 0.f, 0.f, 0.25f); - gl_rect_2d(-10, getRect().getHeight() + line_height + 1, getRect().getWidth()+2, getRect().getHeight()+2); + gl_rect_2d(-10, getRect().getHeight() + line_height*2 + 1, getRect().getWidth()+2, getRect().getHeight()+2); text = llformat("Est. Free: %d MB Sys Free: %d MB FBO: %d MB Bias: %.2f Cache: %.1f/%.1f MB", (S32)LLViewerTexture::sFreeVRAMMegabytes, @@ -568,12 +571,20 @@ void LLGLTexMemBar::draw() discard_bias, cache_usage, cache_max_usage); - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*7, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*8, text_color, LLFontGL::LEFT, LLFontGL::TOP); text = llformat("Images: %d Raw: %d (%.2f MB) Saved: %d (%.2f MB) Aux: %d (%.2f MB)", image_count, raw_image_count, raw_image_bytes_MB, saved_raw_image_count, saved_raw_image_bytes_MB, aux_raw_image_count, aux_raw_image_bytes_MB); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height * 7, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + + text = llformat("Textures: %.2f MB Vertex: %.2f MB Render: %.2f MB Total: %.2f MB", + texture_bytes_alloc, + vertex_bytes_alloc, + render_bytes_alloc, + texture_bytes_alloc+vertex_bytes_alloc+render_bytes_alloc); LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height * 6, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -620,8 +631,8 @@ void LLGLTexMemBar::draw() LLAppViewer::getImageDecodeThread()->getPending(), gTextureList.mCreateTextureList.size()); - x_right = 550.0; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, + x_right = 550.0f; + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0.f, (F32)(v_offset + line_height*3), text_color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &x_right); @@ -630,7 +641,7 @@ void LLGLTexMemBar::draw() color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color; color[VALPHA] = text_color[VALPHA]; text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value()); - LLFontGL::getFontMonospace()->renderUTF8(text, 0, x_right, v_offset + line_height*3, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, (S32)x_right, v_offset + line_height*3, color, LLFontGL::LEFT, LLFontGL::TOP); // Mesh status line diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp index d26ad2f060..ae21d3e733 100644 --- a/indra/newview/llthumbnailctrl.cpp +++ b/indra/newview/llthumbnailctrl.cpp @@ -164,8 +164,8 @@ void LLThumbnailCtrl::draw() font->renderUTF8( mLoadingPlaceholderString, 0, - llfloor(draw_rect.mLeft+3), - llfloor(draw_rect.mTop-v_offset), + (draw_rect.mLeft+3), + (draw_rect.mTop-v_offset), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, diff --git a/indra/newview/lltinygltfhelper.cpp b/indra/newview/lltinygltfhelper.cpp index 168708ca37..b8cb3d712d 100644 --- a/indra/newview/lltinygltfhelper.cpp +++ b/indra/newview/lltinygltfhelper.cpp @@ -140,7 +140,7 @@ LLColor4 LLTinyGLTFHelper::getColor(const std::vector<double>& in) LLColor4 out; for (S32 i = 0; i < llmin((S32)in.size(), 4); ++i) { - out.mV[i] = in[i]; + out.mV[i] = (F32)in[i]; } return out; diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 638a01a080..84503e66a5 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -94,8 +94,8 @@ LLToast::Params::Params() enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), force_store("force_store", false), - fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), - lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) + fading_time_secs("fading_time_secs", (F32)gSavedSettings.getS32("ToastFadingTime")), + lifetime_secs("lifetime_secs", (F32)gSavedSettings.getS32("NotificationToastLifeTime")) {}; LLToast::LLToast(const LLToast::Params& p) @@ -256,12 +256,12 @@ void LLToast::onFocusReceived() void LLToast::setLifetime(S32 seconds) { - mToastLifetime = seconds; + mToastLifetime = (F32)seconds; } void LLToast::setFadingTime(S32 seconds) { - mToastFadingTime = seconds; + mToastFadingTime = (F32)seconds; } void LLToast::closeToast() diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index 0ac2653021..6f8691bb26 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -114,7 +114,7 @@ void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount) LLToastPanel* LLToastPanel::buidPanelFromNotification( const LLNotificationPtr& notification) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; LLToastPanel* res = NULL; //process tip toast panels diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index e2b6924aeb..2fe81df4fb 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -547,7 +547,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region wz = land.getZ((i+di)+(j+dj)*land.mGridsPerEdge), norm_dist = sqrt((float)di*di + dj*dj) / half_edge, force_scale = sqrt(2.f) - norm_dist, // 1 at center, 0 at corner - wz2 = wz + .2 + (.2 + force/100) * force_scale, // top vertex + wz2 = wz + .2f + (.2f + force/100.f) * force_scale, // top vertex tic = .075f; // arrowhead size // vertical line gGL.vertex3f(wx, wy, wz); diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 0ba7ae5e84..b8878b1e6f 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -440,7 +440,7 @@ bool LLToolCamera::handleHover(S32 x, S32 y, MASK mask) } else { - gAgentCamera.cameraZoomIn( pow( IN_FACTOR, dy ) ); + gAgentCamera.cameraZoomIn((F32)pow( IN_FACTOR, dy ) ); } } diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index b3871a6d6c..24cfca5eee 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -189,7 +189,7 @@ bool LLVisualParamHint::render() gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); gGL.loadIdentity(); - gGL.ortho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); + gGL.ortho(0.0f, (F32)mFullWidth, 0.0f, (F32)mFullHeight, -1.0f, 1.0f); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index a28bbb3bf1..d4d3e71b46 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -516,7 +516,7 @@ void LLTracker::drawBeacon(LLVector3 pos_agent, std::string direction, LLColor4 height = pos_agent.mV[2]; } - nRows = ceil((BEACON_ROWS * height) / MAX_HEIGHT); + nRows = (U32)ceil((BEACON_ROWS * height) / MAX_HEIGHT); if(nRows<2) nRows=2; rowHeight = height / nRows; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index fbcaaef1b8..39a9f0f8bc 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -306,9 +306,9 @@ public: LLVector3 coords(128, 128, 0); if (tokens.size() <= 4) { - coords = LLVector3(tokens[1].asReal(), - tokens[2].asReal(), - tokens[3].asReal()); + coords = LLVector3((F32)tokens[1].asReal(), + (F32)tokens[2].asReal(), + (F32)tokens[3].asReal()); } // Region names may be %20 escaped. @@ -332,9 +332,9 @@ public: { // region specified, coordinates (if any) are region-local LLVector3 local_pos( - params.has("x")? params["x"].asReal() : 128, - params.has("y")? params["y"].asReal() : 128, - params.has("z")? params["z"].asReal() : 0); + params.has("x")? (F32)params["x"].asReal() : 128.f, + params.has("y")? (F32)params["y"].asReal() : 128.f, + params.has("z")? (F32)params["z"].asReal() : 0.f); std::string regionname(params["regionname"]); std::string destination(LLSLURL(regionname, local_pos).getSLURLString()); // have to resolve region's global coordinates first diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 26707f5d9a..5ab9f76e47 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -376,6 +376,7 @@ void LLViewerAssetStorage::queueRequestHttp( bool duplicate, bool is_priority) { + LL_PROFILE_ZONE_SCOPED; LL_DEBUGS("ViewerAsset") << "Request asset via HTTP " << uuid << " type " << LLAssetType::lookup(atype) << LL_ENDL; bool with_http = true; diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 337c18f218..50128d826a 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -226,7 +226,7 @@ LLUUID LLResourceUploadInfo::finishUpload(LLSD &result) LL_INFOS() << "inventory_item_flags " << flagsInventoryItem << LL_ENDL; } } - S32 creationDate = time_corrected(); + S32 creationDate = (S32)time_corrected(); LLUUID serverInventoryItem = result["new_inventory_item"].asUUID(); LLUUID serverAssetId = result["new_asset"].asUUID(); @@ -370,7 +370,8 @@ LLNewFileResourceUploadInfo::LLNewFileResourceUploadInfo( LLResourceUploadInfo(name, description, compressionInfo, destinationType, inventoryType, nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory), - mFileName(fileName) + mFileName(fileName), + mMaxImageSize(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT) { } @@ -422,7 +423,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile() else if (assetType == LLAssetType::AT_TEXTURE) { // It's an image file, the upload procedure is the same for all - if (!LLViewerTextureList::createUploadFile(getFileName(), filename, codec)) + if (!LLViewerTextureList::createUploadFile(getFileName(), filename, codec, mMaxImageSize)) { errorMessage = llformat("Problem with file %s:\n\n%s\n", getFileName().c_str(), LLImage::getLastThreadError().c_str()); diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h index 5a07fbf802..365436ede0 100644 --- a/indra/newview/llviewerassetupload.h +++ b/indra/newview/llviewerassetupload.h @@ -161,13 +161,15 @@ public: std::string getFileName() const { return mFileName; }; + void setMaxImageSize(U32 maxUploadSize) { mMaxImageSize = maxUploadSize; } + protected: virtual LLSD exportTempFile(); private: std::string mFileName; - + S32 mMaxImageSize; }; //------------------------------------------------------------------------- diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index ab7953846f..766280e145 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -153,12 +153,12 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, const LLVecto add(sVelocityStat, dpos); add(sAngularVelocityStat, drot); - mAverageSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50); - mAverageAngularSpeed = LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat); + mAverageSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sVelocityStat, 50); + mAverageAngularSpeed = (F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(sAngularVelocityStat); mCosHalfCameraFOV = cosf(0.5f * getView() * llmax(1.0f, getAspect())); // update pixel meter ratio using default fov, not modified one - mPixelMeterRatio = getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5)); + mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f))); // update screen pixel area mScreenPixelArea =(S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect())); } @@ -903,6 +903,6 @@ bool LLViewerCamera::isDefaultFOVChanged() void LLViewerCamera::updateCameraAngle(const LLSD& value) { - setDefaultFOV(value.asReal()); + setDefaultFOV((F32)value.asReal()); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index cd6e780aa8..1d483f1b8a 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -634,7 +634,7 @@ void handleAutoTuneFPSChanged(const LLSD& newValue) LLPerfStats::tunables.userAutoTuneEnabled = newval; if(newval && LLPerfStats::renderAvatarMaxART_ns == 0) // If we've enabled autotune we override "unlimited" to max { - gSavedSettings.setF32("RenderAvatarMaxART",log10(LLPerfStats::ART_UNLIMITED_NANOS-1000));//triggers callback to update static var + gSavedSettings.setF32("RenderAvatarMaxART", (F32)log10(LLPerfStats::ART_UNLIMITED_NANOS-1000));//triggers callback to update static var } } @@ -797,6 +797,7 @@ void settings_setup_listeners() setting_setup_signal_listener(gSavedSettings, "RenderReflectionProbeDetail", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderReflectionsEnabled", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderScreenSpaceReflections", handleReflectionProbeDetailChanged); + setting_setup_signal_listener(gSavedSettings, "RenderMirrors", handleReflectionProbeDetailChanged); setting_setup_signal_listener(gSavedSettings, "RenderHeroProbeResolution", handleHeroProbeResolutionChanged); setting_setup_signal_listener(gSavedSettings, "RenderShadowDetail", handleSetShaderChanged); setting_setup_signal_listener(gSavedSettings, "RenderDeferredSSAO", handleSetShaderChanged); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 09f77c0c29..c774e17e0c 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -213,7 +213,7 @@ void display_update_camera() // Write some stats to LL_INFOS() void display_stats() { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; const F32 FPS_LOG_FREQUENCY = 10.f; if (gRecentFPSTime.getElapsedTimeF32() >= FPS_LOG_FREQUENCY) { @@ -1642,11 +1642,11 @@ void render_ui_2d() S32 height = gViewerWindow->getWindowHeightScaled(); gGL.getTexUnit(0)->bind(&gPipeline.mRT->uiScreen); gGL.begin(LLRender::TRIANGLE_STRIP); - gGL.color4f(1,1,1,1); - gGL.texCoord2f(0, 0); gGL.vertex2i(0, 0); - gGL.texCoord2f(width, 0); gGL.vertex2i(width, 0); - gGL.texCoord2f(0, height); gGL.vertex2i(0, height); - gGL.texCoord2f(width, height); gGL.vertex2i(width, height); + gGL.color4f(1.f,1.f,1.f,1.f); + gGL.texCoord2f(0.f, 0.f); gGL.vertex2i(0, 0); + gGL.texCoord2f((F32)width, 0.f); gGL.vertex2i(width, 0); + gGL.texCoord2f(0.f, (F32)height); gGL.vertex2i(0, height); + gGL.texCoord2f((F32)width, (F32)height); gGL.vertex2i(width, height); gGL.end(); } else diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 3e1705b8a1..c97a512a57 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -47,6 +47,7 @@ #include "llfloaterbeacons.h" #include "llfloaterbuildoptions.h" #include "llfloaterbulkpermission.h" +#include "llfloaterbulkupload.h" #include "llfloaterbump.h" #include "llfloaterbuy.h" #include "llfloaterbuycontents.h" @@ -207,6 +208,7 @@ public: "camera_presets", "delete_pref_preset", "forget_username", + "gltf_asset_editor", "god_tools", "group_picker", "hud", @@ -223,7 +225,8 @@ public: "upload_image", "upload_model", "upload_script", - "upload_sound" + "upload_sound", + "bulk_upload" }; return std::find(blacklist_clicked.begin(), blacklist_clicked.end(), fl_name) == blacklist_clicked.end(); } @@ -247,6 +250,7 @@ public: "env_edit_extdaycycle", "font_test", "forget_username", + "gltf_asset_editor", "god_tools", "group_picker", "hud", @@ -272,7 +276,8 @@ public: "upload_image", "upload_model", "upload_script", - "upload_sound" + "upload_sound", + "bulk_upload" }; return std::find(blacklist_untrusted.begin(), blacklist_untrusted.end(), fl_name) == blacklist_untrusted.end(); } @@ -337,6 +342,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("buy_object_contents", "floater_buy_contents.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyContents>); LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>); LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>); + LLFloaterReg::add("bulk_upload", "floater_bulk_upload.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBulkUpload>); LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>); LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 96541b030c..e2022cae37 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -334,7 +334,7 @@ LLViewerInventoryItem::LLViewerInventoryItem(const LLUUID& uuid, U32 flags, time_t creation_date_utc) : LLInventoryItem(uuid, parent_uuid, perm, asset_uuid, type, inv_type, - name, desc, sale_info, flags, creation_date_utc), + name, desc, sale_info, flags, (S32)creation_date_utc), mIsComplete(true) { } @@ -534,7 +534,7 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const mSaleInfo.packMessage(msg); msg->addStringFast(_PREHASH_Name, mName); msg->addStringFast(_PREHASH_Description, mDescription); - msg->addS32Fast(_PREHASH_CreationDate, mCreationDate); + msg->addS32Fast(_PREHASH_CreationDate, (S32)mCreationDate); U32 crc = getCRC32(); msg->addU32Fast(_PREHASH_CRC, crc); } @@ -675,7 +675,7 @@ bool LLViewerInventoryCategory::fetch(S32 expiry_seconds) { LL_DEBUGS(LOG_INV) << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL; mDescendentsRequested.reset(); - mDescendentsRequested.setTimerExpirySec(expiry_seconds); + mDescendentsRequested.setTimerExpirySec((F32)expiry_seconds); std::string url; if (gAgent.getRegion()) @@ -721,7 +721,7 @@ void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchTyp mDescendentsRequested.reset(); if (AISAPI::isAvailable()) { - mDescendentsRequested.setTimerExpirySec(AISAPI::HTTP_TIMEOUT); + mDescendentsRequested.setTimerExpirySec((F32)AISAPI::HTTP_TIMEOUT); } else { diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index ce6dfa4ad1..787ea02e4c 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -329,7 +329,7 @@ LLViewerJoystick::LLViewerJoystick() memset(mBtn, 0, sizeof(mBtn)); // factor in bandwidth? bandwidth = gViewerStats->mKBitStat - mPerfScale = 4000.f / gSysCPU.getMHz(); // hmm. why? + mPerfScale = 4000.f / (F32)gSysCPU.getMHz(); // hmm. why? mLastDeviceUUID = LLSD::Integer(1); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f62d929e9a..6fc9f2a6f0 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1906,7 +1906,7 @@ void LLViewerMediaImpl::loadURI() // or a seek happened before the media loaded. In either case, seek to the saved time. if(mPreviousMediaTime != 0.0f) { - seek(mPreviousMediaTime); + seek((F32)mPreviousMediaTime); } if(mPreviousMediaState == MEDIA_PLAYING) @@ -2041,7 +2041,7 @@ void LLViewerMediaImpl::skipBack(F32 step_scale) { back_step = 0.0; } - mMediaSource->seek(back_step); + mMediaSource->seek((F32)back_step); } } } @@ -2058,7 +2058,7 @@ void LLViewerMediaImpl::skipForward(F32 step_scale) { forward_step = mMediaSource->getDuration(); } - mMediaSource->seek(forward_step); + mMediaSource->seek((F32)forward_step); } } } @@ -2107,7 +2107,7 @@ void LLViewerMediaImpl::updateVolume() F64 attenuation = 1.0 + (gSavedSettings.getF32("MediaRollOffRate") * adjusted_distance); attenuation = 1.0 / (attenuation * attenuation); // the attenuation multiplier should never be more than one since that would increase volume - volume = volume * llmin(1.0, attenuation); + volume = volume * (F32)llmin(1.0, attenuation); } } @@ -2237,11 +2237,11 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 // Deal with repeating textures by wrapping the coordinates into the range [0, 1.0) texture_x = fmodf(texture_x, 1.0f); if(texture_x < 0.0f) - texture_x = 1.0 + texture_x; + texture_x = 1.0f + texture_x; texture_y = fmodf(texture_y, 1.0f); if(texture_y < 0.0f) - texture_y = 1.0 + texture_y; + texture_y = 1.0f + texture_y; // scale x and y to texel units. *x = ll_round(texture_x * mMediaSource->getTextureWidth()); diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index c8d25180b9..dbec66f81d 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -241,19 +241,19 @@ LLVector3d LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 n if(camera_aspect < 1.0f || invert) { angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect()); - distance = width * 0.5 * padding_factor / tan(angle_of_view * 0.5f ); + distance = width * 0.5f * padding_factor / tanf(angle_of_view * 0.5f ); LL_DEBUGS() << "using width (" << width << "), angle_of_view = " << angle_of_view << ", distance = " << distance << LL_ENDL; } else { angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getView()); - distance = height * 0.5 * padding_factor / tan(angle_of_view * 0.5f ); + distance = height * 0.5f * padding_factor / tanf(angle_of_view * 0.5f ); LL_DEBUGS() << "using height (" << height << "), angle_of_view = " << angle_of_view << ", distance = " << distance << LL_ENDL; } - distance += depth * 0.5; + distance += depth * 0.5f; // Finally animate the camera to this new position and focal point LLVector3d target_pos; diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index e3da52fc78..c4fecf8dff 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -523,15 +523,8 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP return; } -void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification, const LLSD& response) +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k) { - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option != 0) - { - // Cancel upload - return; - } - for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) { std::string filename = (*in_iter); @@ -551,7 +544,7 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification if (LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(ext, asset_type, codec)) { bool resource_upload = false; - if (asset_type == LLAssetType::AT_TEXTURE) + if (asset_type == LLAssetType::AT_TEXTURE && allow_2k) { LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec); if (gDirUtilp->fileExists(filename) && image_frmted->load(filename)) @@ -567,7 +560,7 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification if (resource_upload) { - LLResourceUploadInfo::ptr_t uploadInfo(new LLNewFileResourceUploadInfo( + LLNewFileResourceUploadInfo* info_p = new LLNewFileResourceUploadInfo( filename, asset_name, asset_name, 0, @@ -575,7 +568,13 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost)); + expected_upload_cost); + + if (!allow_2k) + { + info_p->setMaxImageSize(1024); + } + LLResourceUploadInfo::ptr_t uploadInfo(info_p); upload_new_resource(uploadInfo); } @@ -601,11 +600,30 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification } } -bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S32& total_cost, S32& file_count, S32& bvh_count) +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) + { + // Cancel upload + return; + } + + do_bulk_upload(filenames, allow_2k); +} + +bool get_bulk_upload_expected_cost( + const std::vector<std::string>& filenames, + bool allow_2k, + S32& total_cost, + S32& file_count, + S32& bvh_count, + S32& textures_2k_count) { total_cost = 0; file_count = 0; bvh_count = 0; + textures_2k_count = 0; for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) { std::string filename = (*in_iter); @@ -622,12 +640,20 @@ bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S3 if (LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(ext, asset_type, codec)) { - if (asset_type == LLAssetType::AT_TEXTURE) + if (asset_type == LLAssetType::AT_TEXTURE && allow_2k) { LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec); if (gDirUtilp->fileExists(filename) && image_frmted->load(filename)) { total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted); + if (image_frmted) + { + S32 area = image_frmted->getHeight() * image_frmted->getWidth(); + if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA) + { + textures_2k_count++; + } + } file_count++; } } @@ -682,38 +708,27 @@ bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S3 return file_count > 0; } -const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type) +const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k) { - // TODO: - // Check user balance for entire cost - // Charge user entire cost - // Loop, uploading - // If an upload fails, refund the user for that one - // - // Also fix single upload to charge first, then refund - - // FIXME PREMIUM what about known types that can't be bulk uploaded - // (bvh)? These will fail in the item by item upload but won't be - // mentioned in the notification. - std::vector<std::string> filtered_filenames; - for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) - { - const std::string& filename = *in_iter; - if (check_file_extension(filename, type)) - { - filtered_filenames.push_back(filename); - } - } - S32 expected_upload_cost; S32 expected_upload_count; S32 bvh_count; - if (get_bulk_upload_expected_cost(filtered_filenames, expected_upload_cost, expected_upload_count, bvh_count)) + S32 textures_2k_count; + if (get_bulk_upload_expected_cost(filtered_filenames, allow_2k, expected_upload_cost, expected_upload_count, bvh_count, textures_2k_count)) { - LLSD args; - args["COST"] = expected_upload_cost; - args["COUNT"] = expected_upload_count; - LLNotificationsUtil::add("BulkUploadCostConfirmation", args, LLSD(), boost::bind(do_bulk_upload, filtered_filenames, _1, _2)); + LLSD key; + key["upload_cost"] = expected_upload_cost; + key["upload_count"] = expected_upload_count; + key["has_2k_textures"] = (textures_2k_count > 0); + + LLSD array; + for (const std::string& str : filtered_filenames) + { + array.append(str); + } + key["files"] = array; + + LLFloaterReg::showInstance("bulk_upload", key); if (filtered_filenames.size() > expected_upload_count) { @@ -738,6 +753,31 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker:: } +const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k) +{ + // TODO: + // Check user balance for entire cost + // Charge user entire cost + // Loop, uploading + // If an upload fails, refund the user for that one + // + // Also fix single upload to charge first, then refund + + // FIXME PREMIUM what about known types that can't be bulk uploaded + // (bvh)? These will fail in the item by item upload but won't be + // mentioned in the notification. + std::vector<std::string> filtered_filenames; + for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter) + { + const std::string& filename = *in_iter; + if (check_file_extension(filename, type)) + { + filtered_filenames.push_back(filename); + } + } + upload_bulk(filtered_filenames, allow_2k); +} + class LLFileUploadImage : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -803,7 +843,7 @@ class LLFileUploadBulk : public view_listener_t { gAgentCamera.changeCameraToDefault(); } - LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2), LLFilePicker::FFLOAD_ALL, true); + LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true), LLFilePicker::FFLOAD_ALL, true); return true; } }; diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index 1acb701d50..d99f9dc4c6 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -64,13 +64,15 @@ void upload_new_resource( LLAssetStorage::LLStoreAssetCallback callback = LLAssetStorage::LLStoreAssetCallback(), void *userdata = NULL); - -void assign_defaults_and_show_upload_message( - LLAssetType::EType asset_type, - LLInventoryType::EType& inventory_type, - std::string& name, - const std::string& display_name, - std::string& description); +bool get_bulk_upload_expected_cost( + const std::vector<std::string>& filenames, + bool allow_2k, + S32& total_cost, + S32& file_count, + S32& bvh_count, + S32& textures_2k_count); + +void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k); //consider moving all file pickers below to more suitable place class LLFilePickerThread : public LLThread diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5a32f9654d..9a9d7a1baa 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3672,7 +3672,7 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec); - LL_DEBUGS("WindlightSync") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25, 1.f) * 24.f << " h" << LL_ENDL; + LL_DEBUGS("WindlightSync") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25f, 1.f) * 24.f << " h" << LL_ENDL; /* LAPRAS We decode these parts of the message but ignore them @@ -3691,7 +3691,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) } U64 region_handle = 0; - F32 gain = 0; + F32 gain = 0.f; LLUUID sound_id; LLUUID owner_id; LLUUID object_id; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 232b020d3d..8738151930 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2451,7 +2451,7 @@ void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &frame_time) { // calculate dt from last update F32 time_dilation = mRegionp ? mRegionp->getTimeDilation() : 1.0f; - F32 dt_raw = ((F64Seconds)frame_time - mLastInterpUpdateSecs).value(); + F32 dt_raw = (F32)((F64Seconds)frame_time - mLastInterpUpdateSecs).value(); F32 dt = time_dilation * dt_raw; applyAngularVelocity(dt); @@ -2950,7 +2950,7 @@ void LLViewerObject::fetchInventoryDelayed(const F64 &time_seconds) //static void LLViewerObject::fetchInventoryDelayedCoro(const LLUUID task_inv, const F64 time_seconds) { - llcoro::suspendUntilTimeout(time_seconds); + llcoro::suspendUntilTimeout((float)time_seconds); LLViewerObject *obj = gObjectList.findObject(task_inv); if (obj) { @@ -4418,6 +4418,7 @@ void LLViewerObject::moveGLTFNode(S32 node_index, const LLVector3& offset) matMul(trans, mat, mat); node.mMatrix = glm::make_mat4(mat.getF32ptr()); + node.mTRSValid = false; // TODO -- only update transforms for this node and its children (or use a dirty flag) mGLTFAsset->updateTransforms(); diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 08a1ba0f9b..9e274e0566 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1129,10 +1129,10 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) { LLSD objectData = result[it->asString()]; - F32 linkCost = objectData["linked_set_resource_cost"].asReal(); - F32 objectCost = objectData["resource_cost"].asReal(); - F32 physicsCost = objectData["physics_cost"].asReal(); - F32 linkPhysicsCost = objectData["linked_set_physics_cost"].asReal(); + F32 linkCost = (F32)objectData["linked_set_resource_cost"].asReal(); + F32 objectCost = (F32)objectData["resource_cost"].asReal(); + F32 physicsCost = (F32)objectData["physics_cost"].asReal(); + F32 linkPhysicsCost = (F32)objectData["linked_set_physics_cost"].asReal(); gObjectList.updateObjectCost(objectId, objectCost, linkCost, physicsCost, linkPhysicsCost); } @@ -1257,10 +1257,10 @@ void LLViewerObjectList::fetchPhisicsFlagsCoro(std::string url) if (data.has("Density")) { - F32 density = data["Density"].asReal(); - F32 friction = data["Friction"].asReal(); - F32 restitution = data["Restitution"].asReal(); - F32 gravityMult = data["GravityMultiplier"].asReal(); + F32 density = (F32)data["Density"].asReal(); + F32 friction = (F32)data["Friction"].asReal(); + F32 restitution = (F32)data["Restitution"].asReal(); + F32 gravityMult = (F32)data["GravityMultiplier"].asReal(); gObjectList.updatePhysicsProperties(objectId, density, friction, restitution, gravityMult); diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 1f14aa4afc..58b8a5b677 100755 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -611,7 +611,7 @@ void LLViewerParcelOverlay::setDirty() void LLViewerParcelOverlay::updateGL() { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; updateOverlayTexture(); } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index f58e9046f8..96c839d918 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1282,7 +1282,7 @@ void LLViewerRegion::updateReflectionProbes(bool full_update) F32 start = probe_spacing * 0.5f; - U32 grid_width = REGION_WIDTH_METERS / probe_spacing; + U32 grid_width = (U32)(REGION_WIDTH_METERS / probe_spacing); mReflectionMaps.resize(grid_width * grid_width); @@ -3739,7 +3739,7 @@ void LLViewerRegion::resetMaterialsCapThrottle() if ( mSimulatorFeatures.has("RenderMaterialsCapability") && mSimulatorFeatures["RenderMaterialsCapability"].isReal() ) { - requests_per_sec = mSimulatorFeatures["RenderMaterialsCapability"].asReal(); + requests_per_sec = (F32)mSimulatorFeatures["RenderMaterialsCapability"].asReal(); if ( requests_per_sec == 0.0f ) { requests_per_sec = 1.0f; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 12d0aa4f8e..96354ea18f 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -495,8 +495,6 @@ void LLViewerShaderMgr::setShaders() mShaderList.clear(); - LLShaderMgr::sMirrorsEnabled = LLPipeline::RenderMirrors; - if (!gGLManager.mHasRequirements) { // Viewer will show 'hardware requirements' warning later @@ -755,6 +753,8 @@ std::string LLViewerShaderMgr::loadBasicShaders() bool ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections"); + bool mirrors = gSavedSettings.getBOOL("RenderMirrors"); + bool has_reflection_probes = gSavedSettings.getBOOL("RenderReflectionsEnabled") && gGLManager.mGLVersion > 3.99f; S32 probe_level = llclamp(gSavedSettings.getS32("RenderReflectionProbeLevel"), 0, 3); @@ -782,6 +782,11 @@ std::string LLViewerShaderMgr::loadBasicShaders() attribs["REF_SAMPLE_COUNT"] = "32"; } + if (mirrors) + { + attribs["HERO_PROBES"] = "1"; + } + { // PBR terrain const S32 mapping = clamp_terrain_mapping(gSavedSettings.getS32("RenderTerrainPBRPlanarSampleCount")); attribs["TERRAIN_PLANAR_TEXTURE_SAMPLE_COUNT"] = llformat("%d", mapping); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 3499c7eb7d..d1ee9ea17c 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -284,13 +284,13 @@ void LLViewerStats::updateFrameStats(const F64Seconds time_diff) add(LLStatViewer::LOSS_5_PERCENT_TIME, time_diff); } - F32 sim_fps = getRecording().getLastValue(LLStatViewer::SIM_FPS); + F32 sim_fps = (F32)getRecording().getLastValue(LLStatViewer::SIM_FPS); if (0.f < sim_fps && sim_fps < 20.f) { add(LLStatViewer::SIM_20_FPS_TIME, time_diff); } - F32 sim_physics_fps = getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS); + F32 sim_physics_fps = (F32)getRecording().getLastValue(LLStatViewer::SIM_PHYSICS_FPS); if (0.f < sim_physics_fps && sim_physics_fps < 20.f) { diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0ab0265586..15902e8a87 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -220,7 +220,7 @@ public: LLRectf image_rect = draw_rect; image_rect.mRight = image_rect.mLeft + mImage->getWidth(); image_rect.mTop = image_rect.mBottom + mImage->getHeight(); - mImage->draw(LLRect(image_rect.mLeft, image_rect.mTop, image_rect.mRight, image_rect.mBottom)); + mImage->draw(LLRect((S32)image_rect.mLeft, (S32)image_rect.mTop, (S32)image_rect.mRight, (S32)image_rect.mBottom)); LLColor4 color; if (mEditor.getReadOnly()) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b2ed86707c..9648a9af18 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -63,23 +63,18 @@ #include "llwindow.h" /////////////////////////////////////////////////////////////////////////////// -// extern -const S32Megabytes gMinVideoRam(32); -const S32Megabytes gMaxVideoRam(512); - - // statics -LLPointer<LLViewerTexture> LLViewerTexture::sNullImagep = NULL; -LLPointer<LLViewerTexture> LLViewerTexture::sBlackImagep = NULL; -LLPointer<LLViewerTexture> LLViewerTexture::sCheckerBoardImagep = NULL; -LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sMissingAssetImagep = NULL; -LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sWhiteImagep = NULL; -LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = NULL; -LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL; -LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sFlatNormalImagep = NULL; +LLPointer<LLViewerTexture> LLViewerTexture::sNullImagep = nullptr; +LLPointer<LLViewerTexture> LLViewerTexture::sBlackImagep = nullptr; +LLPointer<LLViewerTexture> LLViewerTexture::sCheckerBoardImagep = nullptr; +LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sMissingAssetImagep = nullptr; +LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sWhiteImagep = nullptr; +LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultImagep = nullptr; +LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = nullptr; +LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sFlatNormalImagep = nullptr; LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sDefaultIrradiancePBRp; LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap; -LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL; +LLTexturePipelineTester* LLViewerTextureManager::sTesterp = nullptr; F32 LLViewerFetchedTexture::sMaxVirtualSize = 8192.f*8192.f; const std::string sTesterName("TextureTester"); @@ -89,13 +84,13 @@ S32 LLViewerTexture::sRawCount = 0; S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; -F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; + S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size -const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64; +constexpr S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64; const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez; -const S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128; -const S32 DEFAULT_ICON_DIMENSIONS = 32; -const S32 DEFAULT_THUMBNAIL_DIMENSIONS = 256; +constexpr S32 MAX_CACHED_RAW_TERRAIN_IMAGE_AREA = 128 * 128; +constexpr S32 DEFAULT_ICON_DIMENSIONS = 32; +constexpr S32 DEFAULT_THUMBNAIL_DIMENSIONS = 256; U32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256. U32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA; bool LLViewerTexture::sFreezeImageUpdates = false; @@ -507,21 +502,24 @@ void LLViewerTexture::updateClass() // NOTE: our metrics miss about half the vram we use, so this biases high but turns out to typically be within 5% of the real number F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc + render_bytes_alloc); - F32 budget = max_vram_budget == 0 ? gGLManager.mVRAM : max_vram_budget; + F32 budget = max_vram_budget == 0 ? (F32)gGLManager.mVRAM : (F32)max_vram_budget; // try to leave half a GB for everyone else, but keep at least 768MB for ourselves F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET); sFreeVRAMMegabytes = target - used; - F32 over_pct = llmax((used-target) / target, 0.f); + F32 over_pct = (used - target) / target; + + bool is_low = over_pct > 0.f; if (isSystemMemoryLow()) { + is_low = true; // System RAM is low -> ramp up discard bias over time to free memory if (sEvaluationTimer.getElapsedTimeF32() > MEMORY_CHECK_WAIT_TIME) { static LLCachedControl<F32> low_mem_min_discard_increment(gSavedSettings, "RenderLowMemMinDiscardIncrement", .1f); - sDesiredDiscardBias += llmax(low_mem_min_discard_increment, over_pct); + sDesiredDiscardBias += (F32) low_mem_min_discard_increment * (F32) gFrameIntervalSeconds; sEvaluationTimer.reset(); } } @@ -529,12 +527,28 @@ void LLViewerTexture::updateClass() { sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.f + over_pct); - if (sDesiredDiscardBias > 1.f) + if (sDesiredDiscardBias > 1.f && over_pct < 0.f) { - sDesiredDiscardBias -= gFrameIntervalSeconds * 0.01; + sDesiredDiscardBias -= gFrameIntervalSeconds * 0.01f; } } + static bool was_low = false; + if (is_low && !was_low) + { + LL_WARNS() << "Low system memory detected, emergency downrezzing off screen textures" << LL_ENDL; + sDesiredDiscardBias = llmax(sDesiredDiscardBias, 1.5f); + + for (auto image : gTextureList) + { + gTextureList.updateImageDecodePriority(image); + } + } + + was_low = is_low; + + sDesiredDiscardBias = llclamp(sDesiredDiscardBias, 1.f, 3.f); + LLViewerTexture::sFreezeImageUpdates = false; } @@ -615,16 +629,15 @@ void LLViewerTexture::init(bool firstinit) mParcelMedia = NULL; memset(&mNumVolumes, 0, sizeof(U32)* LLRender::NUM_VOLUME_TEXTURE_CHANNELS); - mFaceList[LLRender::DIFFUSE_MAP].clear(); - mFaceList[LLRender::NORMAL_MAP].clear(); - mFaceList[LLRender::SPECULAR_MAP].clear(); - mNumFaces[LLRender::DIFFUSE_MAP] = - mNumFaces[LLRender::NORMAL_MAP] = - mNumFaces[LLRender::SPECULAR_MAP] = 0; - mVolumeList[LLRender::LIGHT_TEX].clear(); mVolumeList[LLRender::SCULPT_TEX].clear(); + for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; i++) + { + mNumFaces[i] = 0; + mFaceList[i].clear(); + } + mMainQueue = LL::WorkQueue::getInstance("mainloop"); mImageQueue = LL::WorkQueue::getInstance("LLImageGL"); } @@ -1608,7 +1621,11 @@ void LLViewerFetchedTexture::scheduleCreateTexture() } else { - gTextureList.mCreateTextureList.insert(this); + if (!mCreatePending) + { + mCreatePending = true; + gTextureList.mCreateTextureList.push(this); + } } } } @@ -1632,13 +1649,12 @@ void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) void LLViewerFetchedTexture::setDebugText(const std::string& text) { - for (U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { - llassert(mNumFaces[ch] <= mFaceList[ch].size()); - - for (U32 i = 0; i < mNumFaces[ch]; i++) + for (S32 fi = 0; fi < getNumFaces(i); ++fi) { - LLFace* facep = mFaceList[ch][i]; + LLFace* facep = (*(getFaceList(i)))[fi]; + if (facep) { LLDrawable* drawable = facep->getDrawable(); @@ -1651,10 +1667,15 @@ void LLViewerFetchedTexture::setDebugText(const std::string& text) } } +extern bool gCubeSnapshot; + //virtual void LLViewerFetchedTexture::processTextureStats() { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + llassert(!gCubeSnapshot); // should only be called when the main camera is active + llassert(!LLPipeline::sShadowRender); + if(mFullyLoaded) { if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more @@ -2836,7 +2857,7 @@ LLViewerLODTexture::LLViewerLODTexture(const std::string& url, FTType f_type, co void LLViewerLODTexture::init(bool firstinit) { - mTexelsPerImage = 64.f*64.f; + mTexelsPerImage = 64*64; mDiscardVirtualSize = 0.f; mCalculatedDiscardLevel = -1.f; } @@ -2859,6 +2880,8 @@ void LLViewerLODTexture::processTextureStats() LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; updateVirtualSize(); + bool did_downscale = false; + static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes", false); { // restrict texture resolution to download based on RenderMaxTextureResolution @@ -2916,10 +2939,7 @@ void LLViewerLODTexture::processTextureStats() mDiscardVirtualSize = mMaxVirtualSize; mCalculatedDiscardLevel = discard_level; } - if (mBoostLevel < LLGLTexture::BOOST_SCULPTED) - { - discard_level *= sDesiredDiscardScale; // scale (default 1.1f) - } + discard_level = floorf(discard_level); F32 min_discard = 0.f; @@ -2945,10 +2965,9 @@ void LLViewerLODTexture::processTextureStats() // S32 current_discard = getDiscardLevel(); - if (mBoostLevel < LLGLTexture::BOOST_AVATAR_BAKED && - current_discard >= 0) + if (mBoostLevel < LLGLTexture::BOOST_AVATAR_BAKED) { - if (current_discard < (mDesiredDiscardLevel-1) && !mForceToSaveRawImage) + if (current_discard < mDesiredDiscardLevel && !mForceToSaveRawImage) { // should scale down scaleDown(); } @@ -2968,9 +2987,6 @@ void LLViewerLODTexture::processTextureStats() mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel); } - // decay max virtual size over time - mMaxVirtualSize *= 0.8f; - // selection manager will immediately reset BOOST_SELECTED but never unsets it // unset it immediately after we consume it if (getBoostLevel() == BOOST_SELECTED) @@ -2979,14 +2995,22 @@ void LLViewerLODTexture::processTextureStats() } } +extern LLGLSLShader gCopyProgram; + bool LLViewerLODTexture::scaleDown() { - if (mGLTexturep.isNull()) + if (mGLTexturep.isNull() || !mGLTexturep->getHasGLTexture()) { return false; } - return mGLTexturep->scaleDown(mDesiredDiscardLevel); + if (!mDownScalePending) + { + mDownScalePending = true; + gTextureList.mDownScaleQueue.push(this); + } + + return true; } //---------------------------------------------------------------------------------------------- @@ -3460,7 +3484,19 @@ void LLViewerMediaTexture::setPlaying(bool playing) for(std::list< LLFace* >::iterator iter = mMediaFaceList.begin(); iter!= mMediaFaceList.end(); ++iter) { - switchTexture(LLRender::DIFFUSE_MAP, *iter); + LLFace* facep = *iter; + const LLTextureEntry* te = facep->getTextureEntry(); + if (te->getGLTFMaterial()) + { + // PBR material, switch emissive and basecolor + switchTexture(LLRender::EMISSIVE_MAP, *iter); + switchTexture(LLRender::BASECOLOR_MAP, *iter); + } + else + { + // blinn-phong material, switch diffuse map only + switchTexture(LLRender::DIFFUSE_MAP, *iter); + } } } else //stop playing this media @@ -3828,8 +3864,8 @@ LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::lo } //time - F32 start_time = (*log)[label]["StartFetchingTime"].asReal(); - F32 cur_time = (*log)[label]["Time"].asReal(); + F32 start_time = (F32)(*log)[label]["StartFetchingTime"].asReal(); + F32 cur_time = (F32)(*log)[label]["Time"].asReal(); if(start_time - start_fetching_time > F_ALMOST_ZERO) //fetching has paused for a while { sessionp->mTotalGrayTime += total_gray_time; @@ -3845,13 +3881,13 @@ LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::lo } else { - total_gray_time = (*log)[label]["TotalGrayTime"].asReal(); - total_stablizing_time = (*log)[label]["TotalStablizingTime"].asReal(); + total_gray_time = (F32)(*log)[label]["TotalGrayTime"].asReal(); + total_stablizing_time = (F32)(*log)[label]["TotalStablizingTime"].asReal(); - total_loading_sculpties_time = (*log)[label]["EndTimeLoadingSculpties"].asReal() - (*log)[label]["StartTimeLoadingSculpties"].asReal(); + total_loading_sculpties_time = (F32)(*log)[label]["EndTimeLoadingSculpties"].asReal() - (F32)(*log)[label]["StartTimeLoadingSculpties"].asReal(); if(start_fetching_sculpties_time < 0.f && total_loading_sculpties_time > 0.f) { - start_fetching_sculpties_time = (*log)[label]["StartTimeLoadingSculpties"].asReal(); + start_fetching_sculpties_time = (F32)(*log)[label]["StartTimeLoadingSculpties"].asReal(); } } @@ -3867,7 +3903,7 @@ LLMetricPerformanceTesterWithSession::LLTestSession* LLTexturePipelineTester::lo sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAverageBytesUsedForLargeImagePerSecond += (*log)[label]["TotalBytesBoundForLargeImage"].asInteger(); sessionp->mInstantPerformanceList[sessionp->mInstantPerformanceListCounter].mAveragePercentageBytesUsedPerSecond += - (*log)[label]["PercentageBytesBound"].asReal(); + (F32)(*log)[label]["PercentageBytesBound"].asReal(); frame_count++; if(cur_time - last_time >= 1.0f) { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b1e0494a30..ada818c220 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -37,13 +37,11 @@ #include "llmetricperformancetester.h" #include "httpcommon.h" #include "workqueue.h" +#include "gltf/common.h" #include <map> #include <list> -extern const S32Megabytes gMinVideoRam; -extern const S32Megabytes gMaxVideoRam; - class LLFace; class LLImageGL ; class LLImageRaw; @@ -102,7 +100,6 @@ public: DYNAMIC_TEXTURE, FETCHED_TEXTURE, LOD_TEXTURE, - ATLAS_TEXTURE, INVALID_TEXTURE_TYPE }; @@ -173,6 +170,15 @@ public: LLViewerMediaTexture* getParcelMedia() const { return mParcelMedia;} /*virtual*/ void updateBindStatsForTester() ; + + struct MaterialEntry + { + S32 mIndex = LL::GLTF::INVALID_INDEX; + std::shared_ptr<LL::GLTF::Asset> mAsset; + }; + typedef std::vector<MaterialEntry> material_list_t; + material_list_t mMaterialList; // reverse pointer pointing to LL::GLTF::Materials using this image as texture + protected: void cleanup() ; void init(bool firstinit) ; @@ -214,7 +220,6 @@ public: static S32 sAuxCount; static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; - static F32 sDesiredDiscardScale; static S32 sMaxSculptRez ; static U32 sMinLargeImageSize ; static U32 sMaxSmallImageSize ; @@ -414,6 +419,9 @@ public: /*virtual*/bool isActiveFetching() override; //is actively in fetching by the fetching pipeline. + bool mCreatePending = false; // if true, this is in gTextureList.mCreateTextureList + mutable bool mDownScalePending = false; // if true, this is in gTextureList.mDownScaleQueue + protected: S32 getCurrentDiscardLevelForFetching() ; void forceToRefetchTexture(S32 desired_discard = 0, F32 kept_time = 60.f); @@ -424,11 +432,6 @@ private: void saveRawImage() ; - //for atlas - void resetFaceAtlas() ; - void invalidateAtlas(bool rebuild_geom) ; - bool insertToAtlas() ; - private: bool mFullyLoaded; bool mInDebug; @@ -539,9 +542,10 @@ public: /*virtual*/ void processTextureStats(); bool isUpdateFrozen() ; + bool scaleDown(); + private: void init(bool firstinit) ; - bool scaleDown() ; private: F32 mDiscardVirtualSize; // Virtual size used to calculate desired discard diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 238e6830ea..d64026d8a3 100644 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -217,7 +217,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, result |= SCALE; mScaleS = scale_s = 1.f/mSizeX; mScaleT = scale_t = 1.f/mSizeY; - x_frame = fmod(frame_counter, mSizeX); + x_frame = fmodf(frame_counter, mSizeX); y_frame = (S32)(frame_counter / mSizeX); x_pos = x_frame * scale_s; y_pos = y_frame * scale_t; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 4d8fd8ddd5..e486449b4d 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -70,6 +70,8 @@ S32 LLViewerTextureList::sNumImages = 0; LLViewerTextureList gTextureList; +extern LLGLSLShader gCopyProgram; + ETexListType get_element_type(S32 priority) { return (priority == LLViewerFetchedTexture::BOOST_ICON || priority == LLViewerFetchedTexture::BOOST_THUMBNAIL) ? TEX_LIST_SCALE : TEX_LIST_STANDARD; @@ -352,8 +354,11 @@ void LLViewerTextureList::shutdown() mCallbackList.clear(); // Flush all of the references - mLoadingStreamList.clear(); - mCreateTextureList.clear(); + while (!mCreateTextureList.empty()) + { + mCreateTextureList.front()->mCreatePending = false; + mCreateTextureList.pop(); + } mFastCacheList.clear(); mUUIDMap.clear(); @@ -828,7 +833,7 @@ void LLViewerTextureList::updateImages(F32 max_time) } cleared = false; - LLAppViewer::getTextureFetch()->setTextureBandwidth(LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED).value()); + LLAppViewer::getTextureFetch()->setTextureBandwidth((F32)LLTrace::get_frame_recording().getPeriodMeanPerSec(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED).value()); { using namespace LLStatViewer; @@ -897,14 +902,6 @@ void LLViewerTextureList::clearFetchingRequests() } } -static void touch_texture(LLViewerFetchedTexture* tex, F32 vsize) -{ - if (tex) - { - tex->addTextureStats(vsize); - } -} - extern bool gCubeSnapshot; void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imagep) @@ -921,60 +918,67 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag static LLCachedControl<F32> texture_scale_min(gSavedSettings, "TextureScaleMinAreaFactor", 0.04f); static LLCachedControl<F32> texture_scale_max(gSavedSettings, "TextureScaleMaxAreaFactor", 25.f); - LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE + if (imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE) + { // reset max virtual size for unboosted LOD_TEXTURES + // this is an alternative to decaying mMaxVirtualSize over time + // that keeps textures from continously downrezzing and uprezzing in the background + imagep->mMaxVirtualSize = 0.f; + } + + LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { - for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) + for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi) { - for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi) + LLFace* face = (*(imagep->getFaceList(i)))[fi]; + + if (face && face->getViewerObject()) { - LLFace* face = (*(imagep->getFaceList(i)))[fi]; + F32 radius; + F32 cos_angle_to_view_dir; + bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); + static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f); + F32 vsize = face->getPixelArea(); + + // Scale desired texture resolution higher or lower depending on texture scale + // + // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string + // shows one letter at a time + // + // Maximum usage examples: huge chunk of terrain repeats texture + const LLTextureEntry* te = face->getTextureEntry(); + F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f; + min_scale = llclamp(min_scale * min_scale, texture_scale_min(), texture_scale_max()); + vsize /= min_scale; + + // if bias is > 2, apply to on-screen textures as well + bool apply_bias = LLViewerTexture::sDesiredDiscardBias > 2.f; + + // apply bias to off screen objects or objects that are small on screen all the time + if (!in_frustum || !face->getDrawable()->isVisible() || face->getImportanceToCamera() < bias_unimportant_threshold) + { // further reduce by discard bias when off screen or occluded + apply_bias = true; + } - if (face && face->getViewerObject() && face->getTextureEntry()) + if (apply_bias) { - F32 vsize = face->getPixelArea(); - - // Scale desired texture resolution higher or lower depending on texture scale - // - // Minimum usage examples: a 1024x1024 texture with aplhabet, runing string - // shows one letter at a time - // - // Maximum usage examples: huge chunk of terrain repeats texture - const LLTextureEntry* te = face->getTextureEntry(); - F32 min_scale = te ? llmin(fabsf(te->getScaleS()), fabsf(te->getScaleT())) : 1.f; - min_scale = llclamp(min_scale*min_scale, texture_scale_min(), texture_scale_max()); - - vsize /= min_scale; - vsize /= LLViewerTexture::sDesiredDiscardBias; - vsize /= llmax(1.f, (LLViewerTexture::sDesiredDiscardBias-1.f) * (1.f + face->getDrawable()->mDistanceWRTCamera * bias_distance_scale)); - - F32 radius; - F32 cos_angle_to_view_dir; - bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); - if (!in_frustum || !face->getDrawable()->isVisible()) - { // further reduce by discard bias when off screen or occluded - vsize /= LLViewerTexture::sDesiredDiscardBias; - } - // if a GLTF material is present, ignore that face - // as far as this texture stats go, but update the GLTF material - // stats - LLFetchedGLTFMaterial* mat = te ? (LLFetchedGLTFMaterial*)te->getGLTFRenderMaterial() : nullptr; - llassert(mat == nullptr || dynamic_cast<LLFetchedGLTFMaterial*>(te->getGLTFRenderMaterial()) != nullptr); - if (mat) - { - touch_texture(mat->mBaseColorTexture, vsize); - touch_texture(mat->mNormalTexture, vsize); - touch_texture(mat->mMetallicRoughnessTexture, vsize); - touch_texture(mat->mEmissiveTexture, vsize); - } - else - { - imagep->addTextureStats(vsize); - } + F32 bias = powf(4, LLViewerTexture::sDesiredDiscardBias - 1.f); + bias = (F32)llround(bias); + vsize /= bias; } + + imagep->addTextureStats(vsize); } } } + // make sure to addTextureStats for any spotlights that are using this texture + for (S32 vi = 0; vi < imagep->getNumVolumes(LLRender::LIGHT_TEX); ++vi) + { + LLVOVolume* volume = (*imagep->getVolumeList(LLRender::LIGHT_TEX))[vi]; + volume->updateSpotLightPriority(); + } + //imagep->setDebugText(llformat("%.3f - %d", sqrtf(imagep->getMaxVirtualSize()), imagep->getBoostLevel())); F32 lazy_flush_timeout = 30.f; // stop decoding @@ -1068,22 +1072,65 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) // LLTimer create_timer; - image_list_t::iterator enditer = mCreateTextureList.begin(); - for (image_list_t::iterator iter = mCreateTextureList.begin(); - iter != mCreateTextureList.end();) + + if (!mDownScaleQueue.empty() && gPipeline.mDownResMap.isComplete()) { - image_list_t::iterator curiter = iter++; - enditer = iter; - LLViewerFetchedTexture *imagep = *curiter; + // just in case we downres textures, bind downresmap and copy program + gPipeline.mDownResMap.bindTarget(); + gCopyProgram.bind(); + gPipeline.mScreenTriangleVB->setBuffer(); + + // give time to downscaling first -- if mDownScaleQueue is not empty, we're running out of memory and need + // to free up memory by discarding off screen textures quickly + + // do at least 5 and make sure we don't get too far behind even if it violates + // the time limit. If we don't downscale quickly the viewer will hit swap and may + // freeze. + S32 min_count = (S32)mCreateTextureList.size() / 20 + 5; + + while (!mDownScaleQueue.empty()) + { + LLViewerFetchedTexture* image = mDownScaleQueue.front(); + llassert(image->mDownScalePending); + + LLImageGL* img = image->getGLTexture(); + if (img && img->getHasGLTexture()) + { + img->scaleDown(image->getDesiredDiscardLevel()); + } + + image->mDownScalePending = false; + mDownScaleQueue.pop(); + + if (create_timer.getElapsedTimeF32() > max_time && --min_count <= 0) + { + break; + } + } + + gCopyProgram.unbind(); + gPipeline.mDownResMap.flush(); + } + + // do at least 5 and make sure we don't get too far behind even if it violates + // the time limit. Textures pending creation have a copy of their texture data + // in system memory, so we don't want to let them pile up. + S32 min_count = (S32) mCreateTextureList.size() / 20 + 5; + + while (!mCreateTextureList.empty()) + { + LLViewerFetchedTexture *imagep = mCreateTextureList.front(); + llassert(imagep->mCreatePending); imagep->createTexture(); imagep->postCreateTexture(); + imagep->mCreatePending = false; + mCreateTextureList.pop(); - if (create_timer.getElapsedTimeF32() > max_time) + if (create_timer.getElapsedTimeF32() > max_time && --min_count <= 0) { break; } } - mCreateTextureList.erase(mCreateTextureList.begin(), enditer); return create_timer.getElapsedTimeF32(); } @@ -1126,7 +1173,10 @@ void LLViewerTextureList::forceImmediateUpdate(LLViewerFetchedTexture* imagep) removeImageFromList(imagep); } - imagep->processTextureStats(); + if (!gCubeSnapshot) + { // never call processTextureStats in a cube snapshot + imagep->processTextureStats(); + } imagep->sMaxVirtualSize = LLViewerFetchedTexture::sMaxVirtualSize; addImageToList(imagep); @@ -1136,6 +1186,7 @@ void LLViewerTextureList::forceImmediateUpdate(LLViewerFetchedTexture* imagep) F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; + typedef std::vector<LLPointer<LLViewerFetchedTexture> > entries_list_t; entries_list_t entries; diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 2779ad9f91..813fda1647 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -144,12 +144,13 @@ public: void clearFetchingRequests(); void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); -private: // do some book keeping on the specified texture // - updates decode priority // - updates desired discard level // - cleans up textures that haven't been referenced in awhile void updateImageDecodePriority(LLViewerFetchedTexture* imagep); + +private: F32 updateImagesCreateTextures(F32 max_time); F32 updateImagesFetchTextures(F32 max_time); void updateImagesUpdateStats(); @@ -211,8 +212,14 @@ private: public: typedef std::unordered_set<LLPointer<LLViewerFetchedTexture> > image_list_t; - image_list_t mLoadingStreamList; - image_list_t mCreateTextureList; + typedef std::queue<LLPointer<LLViewerFetchedTexture> > image_queue_t; + + // images that have been loaded but are waiting to be uploaded to GL + image_queue_t mCreateTextureList; + + // images that must be downscaled quickly so we don't run out of memory + image_queue_t mDownScaleQueue; + image_list_t mCallbackList; image_list_t mFastCacheList; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ef85d57416..957048566e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -805,8 +805,8 @@ public: LLCoordGL coord = gViewerWindow->getCurrentMouse(); // Convert x,y to raw pixel coords - S32 x_raw = llround(coord.mX * gViewerWindow->getWindowWidthRaw() / (F32) gViewerWindow->getWindowWidthScaled()); - S32 y_raw = llround(coord.mY * gViewerWindow->getWindowHeightRaw() / (F32) gViewerWindow->getWindowHeightScaled()); + S32 x_raw = (S32)llround(coord.mX * gViewerWindow->getWindowWidthRaw() / (F32) gViewerWindow->getWindowWidthScaled()); + S32 y_raw = (S32)llround(coord.mY * gViewerWindow->getWindowHeightRaw() / (F32) gViewerWindow->getWindowHeightScaled()); glReadPixels(x_raw, y_raw, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, color); addText(xpos, ypos, llformat("Pixel <%1d, %1d> R:%1d G:%1d B:%1d A:%1d", x_raw, y_raw, color[0], color[1], color[2], color[3])); @@ -4479,8 +4479,8 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const F32 fov = LLViewerCamera::getInstance()->getView(); // find world view center in scaled ui coordinates - F32 center_x = getWorldViewRectScaled().getCenterX(); - F32 center_y = getWorldViewRectScaled().getCenterY(); + F32 center_x = (F32)getWorldViewRectScaled().getCenterX(); + F32 center_y = (F32)getWorldViewRectScaled().getCenterY(); // calculate pixel distance to screen F32 distance = ((F32)getWorldViewHeightScaled() * 0.5f) / (tan(fov / 2.f)); @@ -4505,8 +4505,8 @@ LLVector3 LLViewerWindow::mousePointHUD(const S32 x, const S32 y) const S32 height = getWorldViewHeightScaled(); // find world view center - F32 center_x = getWorldViewRectScaled().getCenterX(); - F32 center_y = getWorldViewRectScaled().getCenterY(); + F32 center_x = (F32)getWorldViewRectScaled().getCenterX(); + F32 center_y = (F32)getWorldViewRectScaled().getCenterY(); // remap with uniform scale (1/height) so that top is -0.5, bottom is +0.5 F32 hud_x = -((F32)x - center_x) / height; @@ -4528,8 +4528,8 @@ LLVector3 LLViewerWindow::mouseDirectionCamera(const S32 x, const S32 y) const S32 width = getWorldViewWidthScaled(); // find world view center - F32 center_x = getWorldViewRectScaled().getCenterX(); - F32 center_y = getWorldViewRectScaled().getCenterY(); + F32 center_x = (F32)getWorldViewRectScaled().getCenterX(); + F32 center_y = (F32)getWorldViewRectScaled().getCenterY(); // calculate click point relative to middle of screen F32 click_x = (((F32)x - center_x) / (F32)width) * fov_width * -1.f; @@ -4777,7 +4777,7 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save args["NEED_MEMORY"] = needM_bytes_string; std::string freeM_bytes_string; - LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (b_space.free) >> 10); + LLResMgr::getInstance()->getIntegerString(freeM_bytes_string, (S32)(b_space.free >> 10)); args["FREE_MEMORY"] = freeM_bytes_string; LLNotificationsUtil::add("SnapshotToComputerFailed", args); @@ -5623,7 +5623,7 @@ void LLViewerWindow::setup3DRender() void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_UI + LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; gGLViewport[0] = mWorldViewRectRaw.mLeft + x_offset; gGLViewport[1] = mWorldViewRectRaw.mBottom + y_offset; gGLViewport[2] = mWorldViewRectRaw.getWidth(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4f851eabce..ac95a2f8f7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4531,7 +4531,7 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w root_pos += LLVector3d(getHoverOffset()); if (getOverallAppearance() == AOA_JELLYDOLL) { - F32 offz = -0.5 * (getScale()[VZ] - mBodySize.mV[VZ]); + F32 offz = -0.5f * (getScale()[VZ] - mBodySize.mV[VZ]); root_pos[2] += offz; // if (!isSelf() && !isControlAvatar()) // { @@ -4778,8 +4778,8 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent) if (!getParent() && (isSitting() || was_sit_ground_constrained)) { - F32 off_z = LLVector3d(getHoverOffset()).mdV[VZ]; - if (off_z != 0.0) + F32 off_z = (F32)LLVector3d(getHoverOffset()).mdV[VZ]; + if (off_z != 0.0f) { LLVector3 pos = mRoot->getWorldPosition(); pos.mV[VZ] += off_z; @@ -7239,7 +7239,7 @@ void LLVOAvatar::updateGL() { if (mMeshTexturesDirty) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; updateMeshTextures(); mMeshTexturesDirty = false; } @@ -8529,7 +8529,7 @@ void LLVOAvatar::updateTooSlow() auto it = std::find(sAVsIgnoringARTLimit.begin(), sAVsIgnoringARTLimit.end(), mID); if (it != sAVsIgnoringARTLimit.end()) { - S32 index = it - sAVsIgnoringARTLimit.begin(); + S32 index = (S32)(it - sAVsIgnoringARTLimit.begin()); ignore_tune = (index < (MIN_NONTUNED_AVS - sAvatarsNearby + 1 + LLPerfStats::tunedAvatars)); } } @@ -8723,7 +8723,7 @@ void LLVOAvatar::updateMeshVisibility() // virtual void LLVOAvatar::updateMeshTextures() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; static S32 update_counter = 0; mBakedTextureDebugText.clear(); @@ -9505,7 +9505,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe std::vector<LLVisualParam*>::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); if (it != contents.mParams.end()) { - S32 index = it - contents.mParams.begin(); + S32 index = (S32)(it - contents.mParams.begin()); contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]); //LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; } @@ -11101,7 +11101,7 @@ void LLVOAvatar::accountRenderComplexityForObject( LLObjectComplexity object_complexity; object_complexity.objectName = attached_object->getAttachmentItemName(); object_complexity.objectId = attached_object->getAttachmentItemID(); - object_complexity.objectCost = attachment_total_cost; + object_complexity.objectCost = (U32)attachment_total_cost; object_complexity_list.push_back(object_complexity); } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e4a7b53d9f..9c1c304133 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2346,7 +2346,7 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records, key[field] = record[field]; } LLViewerStats::StatsAccumulator& stats = accum[key]; - F32 value = record[val_field].asReal(); + F32 value = (F32)record[val_field].asReal(); stats.push(value); } for (std::map<LLSD,LLViewerStats::StatsAccumulator>::iterator accum_it = accum.begin(); diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 0fe2a3e714..27c105c8d6 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -479,8 +479,8 @@ void LLVOCacheEntry::updateDebugSettings() LLMemory::updateMemoryInfo() ; U32 allocated_mem = LLMemory::getAllocatedMemKB().value(); static const F32 KB_to_MB = 1.f / 1024.f; - U32 clamped_memory = llclamp(allocated_mem * KB_to_MB, (F32) low_mem_bound_MB, (F32) high_mem_bound_MB); - const F32 adjust_range = high_mem_bound_MB - low_mem_bound_MB; + U32 clamped_memory = (U32)llclamp(allocated_mem * KB_to_MB, (F32) low_mem_bound_MB, (F32) high_mem_bound_MB); + const F32 adjust_range = (F32)(high_mem_bound_MB - low_mem_bound_MB); const F32 adjust_factor = (high_mem_bound_MB - clamped_memory) / adjust_range; // [0, 1] //min radius: all objects within this radius remain loaded in memory @@ -502,7 +502,7 @@ void LLVOCacheEntry::updateDebugSettings() static const U32 MIN_FRAMES = 10; static const U32 MAX_FRAMES = 64; const U32 clamped_frames = inv_obj_time ? llclamp((U32) inv_obj_time, MIN_FRAMES, MAX_FRAMES) : MAX_FRAMES; // [10, 64], with zero => 64 - sMinFrameRange = MIN_FRAMES + ((clamped_frames - MIN_FRAMES) * adjust_factor); + sMinFrameRange = MIN_FRAMES + (U32)((clamped_frames - MIN_FRAMES) * adjust_factor); } #endif // LL_TEST @@ -1762,7 +1762,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: entry = new HeaderEntryInfo(); entry->mHandle = handle ; - entry->mTime = time(NULL) ; + entry->mTime = (U32)time(NULL) ; entry->mIndex = mNumEntries++; mHeaderEntryQueue.insert(entry) ; mHandleEntryMap[handle] = entry ; @@ -1775,7 +1775,7 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry: //resort mHeaderEntryQueue.erase(entry) ; - entry->mTime = time(NULL) ; + entry->mTime = (U32)time(NULL) ; mHeaderEntryQueue.insert(entry) ; } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index e04bdbf1d9..6903af2619 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -451,6 +451,9 @@ void LLVOGrass::plantBlades() face->setVertexBuffer(NULL); face->setTEOffset(0); face->mCenterLocal = mPosition + mRegionp->getOriginAgent(); + const LLVector4a* ext = mDrawable->getSpatialExtents(); + face->mExtents[0] = ext[0]; + face->mExtents[1] = ext[1]; } mDepth = (face->mCenterLocal - LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis(); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 371b0df860..fcb8a0a4f2 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1284,7 +1284,7 @@ bool LLVivoxVoiceClient::establishVoiceConnection() { if (result.has("retry") && ++retries <= CONNECT_RETRY_MAX && !sShuttingDown) { - F32 timeout = LLSD::Real(result["retry"]); + F32 timeout = (F32)LLSD::Real(result["retry"]); timeout *= retries; LL_INFOS("Voice") << "Retry connection to voice service in " << timeout << " seconds" << LL_ENDL; llcoro::suspendUntilTimeout(timeout); diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 8049bb7a73..d18a32cb05 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -290,7 +290,7 @@ const LLVoiceVersionInfo& LLWebRTCVoiceClient::getVersion() void LLWebRTCVoiceClient::updateSettings() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; setVoiceEnabled(LLVoiceClient::getInstance()->voiceEnabled()); static LLCachedControl<S32> sVoiceEarLocation(gSavedSettings, "VoiceEarLocation"); @@ -335,7 +335,7 @@ void LLWebRTCVoiceClient::removeObserver(LLVoiceClientParticipantObserver *obser void LLWebRTCVoiceClient::notifyParticipantObservers() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; for (observer_set_t::iterator it = mParticipantObservers.begin(); it != mParticipantObservers.end();) { LLVoiceClientParticipantObserver *observer = *it; @@ -357,7 +357,7 @@ void LLWebRTCVoiceClient::removeObserver(LLVoiceClientStatusObserver *observer) void LLWebRTCVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::EStatusType status) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LL_DEBUGS("Voice") << "( " << LLVoiceClientStatusObserver::status2string(status) << " )" << " mSession=" << mSession << LL_ENDL; @@ -541,7 +541,7 @@ void LLWebRTCVoiceClient::voiceConnectionCoro() // for cross-region voice. void LLWebRTCVoiceClient::updateNeighboringRegions() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; static const std::vector<LLVector3d> neighbors {LLVector3d(0.0f, 1.0f, 0.0f), LLVector3d(0.707f, 0.707f, 0.0f), LLVector3d(1.0f, 0.0f, 0.0f), LLVector3d(0.707f, -0.707f, 0.0f), @@ -574,7 +574,7 @@ void LLWebRTCVoiceClient::updateNeighboringRegions() // shut down the current audio session to make room for the next one. void LLWebRTCVoiceClient::leaveAudioSession() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if(mSession) { @@ -630,7 +630,7 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDeviceList &render_devices, const llwebrtc::LLWebRTCVoiceDeviceList &capture_devices) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); @@ -710,7 +710,7 @@ void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume) if (volume != mTuningSpeakerVolume) { - mTuningSpeakerVolume = volume; + mTuningSpeakerVolume = (int)volume; } } @@ -718,11 +718,11 @@ float LLWebRTCVoiceClient::getAudioLevel() { if (mIsInTuningMode) { - return (1.0 - mWebRTCDeviceInterface->getTuningAudioLevel() * LEVEL_SCALE_WEBRTC) * mTuningMicGain / 2.1; + return (1.0f - mWebRTCDeviceInterface->getTuningAudioLevel() * LEVEL_SCALE_WEBRTC) * mTuningMicGain / 2.1f; } else { - return (1.0 - mWebRTCDeviceInterface->getPeerConnectionAudioLevel() * LEVEL_SCALE_WEBRTC) * mMicGain / 2.1; + return (1.0f - mWebRTCDeviceInterface->getPeerConnectionAudioLevel() * LEVEL_SCALE_WEBRTC) * mMicGain / 2.1f; } } @@ -797,7 +797,7 @@ void LLWebRTCVoiceClient::setHidden(bool hidden) // notify the observers. void LLWebRTCVoiceClient::OnConnectionEstablished(const std::string &channelID, const LLUUID ®ionID) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (gAgent.getRegion()->getRegionID() == regionID) { @@ -881,7 +881,7 @@ void LLWebRTCVoiceClient::setEarLocation(S32 loc) void LLWebRTCVoiceClient::updatePosition(void) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LLViewerRegion *region = gAgent.getRegion(); if (region && isAgentAvatarValid()) @@ -1010,7 +1010,7 @@ void LLWebRTCVoiceClient::enforceTether() // standard 50m void LLWebRTCVoiceClient::sendPositionUpdate(bool force) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; std::string spatial_data; @@ -1126,7 +1126,7 @@ LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::addParticipantBy void LLWebRTCVoiceClient::removeParticipantByID(const std::string &channelID, const LLUUID &id, const LLUUID& region) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; participantStatePtr_t result; LLWebRTCVoiceClient::sessionState::ptr_t session = sessionState::matchSessionByChannelID(channelID); @@ -1156,7 +1156,7 @@ LLWebRTCVoiceClient::participantState::participantState(const LLUUID& agent_id, LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::sessionState::addParticipant(const LLUUID& agent_id, const LLUUID& region) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; participantStatePtr_t result; @@ -1194,7 +1194,7 @@ LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::sessionState::ad LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::sessionState::findParticipantByID(const LLUUID& id) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; participantStatePtr_t result; participantUUIDMap::iterator iter = mParticipantsByUUID.find(id); @@ -1209,7 +1209,7 @@ LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::sessionState::fi void LLWebRTCVoiceClient::sessionState::removeParticipant(const LLWebRTCVoiceClient::participantStatePtr_t &participant) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (participant) { @@ -1492,7 +1492,7 @@ void LLWebRTCVoiceClient::setMicGain(F32 gain) void LLWebRTCVoiceClient::setVoiceEnabled(bool enabled) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LL_DEBUGS("Voice") << "( " << (enabled ? "enabled" : "disabled") << " )" @@ -1887,7 +1887,7 @@ void LLWebRTCVoiceClient::sessionState::revive() void LLWebRTCVoiceClient::sessionState::processSessionStates() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; auto iter = mSessions.begin(); while (iter != mSessions.end()) @@ -1908,7 +1908,7 @@ void LLWebRTCVoiceClient::sessionState::processSessionStates() // process the states on each connection associated with a session. bool LLWebRTCVoiceClient::sessionState::processConnectionStates() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; std::list<connectionPtr_t>::iterator iter = mWebRTCConnections.begin(); while (iter != mWebRTCConnections.end()) @@ -1932,7 +1932,7 @@ bool LLWebRTCVoiceClient::sessionState::processConnectionStates() // on our location. bool LLWebRTCVoiceClient::estateSessionState::processConnectionStates() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (!mShuttingDown) { @@ -2096,7 +2096,7 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID ®ionID, const s { // retries wait a short period...randomize it so // all clients don't try to reconnect at once. - mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; + mRetryWaitSecs = (F32)((F32) rand() / (RAND_MAX)) + 0.5f; mWebRTCPeerConnectionInterface = llwebrtc::newPeerConnection(); mWebRTCPeerConnectionInterface->setSignalingObserver(this); @@ -2168,7 +2168,7 @@ void LLVoiceWebRTCConnection::processIceUpdates() // will make the cap call to the server sending up the ICE candidates. void LLVoiceWebRTCConnection::processIceUpdatesCoro() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (mShutDown || LLWebRTCVoiceClient::isShuttingDown()) { @@ -2395,7 +2395,7 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data) // The simulator will pass this on to the Secondlife WebRTC server. void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LL_DEBUGS("Voice") << "Disconnecting voice." << LL_ENDL; if (mWebRTCDataInterface) @@ -2454,7 +2454,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro() // will use the offer and answer to negotiate the session. void LLVoiceWebRTCSpatialConnection::requestVoiceConnection() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID); @@ -2527,7 +2527,7 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection() void LLVoiceWebRTCConnection::OnVoiceConnectionRequestSuccess(const LLSD &result) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (LLWebRTCVoiceClient::isShuttingDown()) { @@ -2582,7 +2582,7 @@ static llwebrtc::LLWebRTCPeerConnectionInterface::InitOptions getConnectionOptio // Secondlife WebRTC server. bool LLVoiceWebRTCConnection::connectionStateMachine() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; processIceUpdates(); @@ -2678,7 +2678,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() case VOICE_STATE_SESSION_UP: { mRetryWaitPeriod = 0; - mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5; + mRetryWaitSecs = (F32)((F32) rand() / (RAND_MAX)) + 0.5f; // we'll stay here as long as the session remains up. if (mShutDown) @@ -2700,7 +2700,7 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() { // back off the retry period, and do it by a small random // bit so all clients don't reconnect at once. - mRetryWaitSecs += ((F32) rand() / (RAND_MAX)) + 0.5; + mRetryWaitSecs += (F32)((F32) rand() / (RAND_MAX)) + 0.5f; mRetryWaitPeriod = 0; } } @@ -2776,7 +2776,7 @@ void LLVoiceWebRTCConnection::OnDataReceived(const std::string& data, bool binar // this pointer. void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool binary) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; if (mShutDown) { @@ -2943,7 +2943,7 @@ void LLVoiceWebRTCConnection::OnDataChannelReady(llwebrtc::LLWebRTCDataInterface // to peers. void LLVoiceWebRTCConnection::sendJoin() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; boost::json::object root; @@ -3017,7 +3017,7 @@ LLVoiceWebRTCAdHocConnection::~LLVoiceWebRTCAdHocConnection() // So, we have a separate requestVoiceConnection call. void LLVoiceWebRTCAdHocConnection::requestVoiceConnection() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE + LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; LLViewerRegion *regionp = LLWorld::instance().getRegionFromID(mRegionID); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 2b8ed74b0f..ab8d0d2564 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -107,7 +107,7 @@ void LLSkyTex::init(bool isShiny) { mTexture[i] = LLViewerTextureManager::getLocalTexture(false); mTexture[i]->setAddressMode(LLTexUnit::TAM_CLAMP); - mImageRaw[i] = new LLImageRaw(SKYTEX_RESOLUTION, SKYTEX_RESOLUTION, SKYTEX_COMPONENTS); + mImageRaw[i] = new LLImageRaw((U16)SKYTEX_RESOLUTION, (U16)SKYTEX_RESOLUTION, (S8)SKYTEX_COMPONENTS); initEmpty(i); } @@ -139,7 +139,7 @@ LLSkyTex::~LLSkyTex() S32 LLSkyTex::getResolution() { - return SKYTEX_RESOLUTION; + return (S32)SKYTEX_RESOLUTION; } S32 LLSkyTex::getCurrent() @@ -172,8 +172,8 @@ void LLSkyTex::initEmpty(const S32 tex) { for (S32 j = 0; j < SKYTEX_RESOLUTION; ++j) { - const S32 basic_offset = (i * SKYTEX_RESOLUTION + j); - S32 offset = basic_offset * SKYTEX_COMPONENTS; + const S32 basic_offset = (i * (S32)SKYTEX_RESOLUTION + j); + S32 offset = basic_offset * (S32)SKYTEX_COMPONENTS; data[offset] = 0; data[offset+1] = 0; data[offset+2] = 0; @@ -194,8 +194,8 @@ void LLSkyTex::create() { for (S32 j = 0; j < SKYTEX_RESOLUTION; ++j) { - const S32 basic_offset = (i * SKYTEX_RESOLUTION + j); - S32 offset = basic_offset * SKYTEX_COMPONENTS; + const S32 basic_offset = (i * (S32)SKYTEX_RESOLUTION + j); + S32 offset = basic_offset * (S32)SKYTEX_COMPONENTS; U32* pix = (U32*)(data + offset); LLColor4U temp = LLColor4U(mSkyData[basic_offset]); *pix = temp.asRGBA(); @@ -392,8 +392,8 @@ const LLVector3* LLHeavenBody::corners() const Sky ***************************************/ -const S32 SKYTEX_TILE_RES_X = SKYTEX_RESOLUTION / NUM_TILES_X; -const S32 SKYTEX_TILE_RES_Y = SKYTEX_RESOLUTION / NUM_TILES_Y; +const S32 SKYTEX_TILE_RES_X = (S32)SKYTEX_RESOLUTION / NUM_TILES_X; +const S32 SKYTEX_TILE_RES_Y = (S32)SKYTEX_RESOLUTION / NUM_TILES_Y; LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) : LLStaticViewerObject(id, pcode, regionp, true), diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index ad7570105e..17cffcadb4 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -83,26 +83,26 @@ protected: void setDir(const LLVector3 &dir, const S32 i, const S32 j) { - S32 offset = i * SKYTEX_RESOLUTION + j; + S32 offset = (S32)(i * SKYTEX_RESOLUTION + j); mSkyDirs[offset] = dir; } const LLVector3 &getDir(const S32 i, const S32 j) const { - S32 offset = i * SKYTEX_RESOLUTION + j; + S32 offset = (S32)(i * SKYTEX_RESOLUTION + j); return mSkyDirs[offset]; } void setPixel(const LLColor4 &col, const S32 i, const S32 j) { - S32 offset = i * SKYTEX_RESOLUTION + j; + S32 offset = (S32)(i * SKYTEX_RESOLUTION + j); mSkyData[offset] = col; } void setPixel(const LLColor4U &col, const S32 i, const S32 j) { LLImageDataSharedLock lock(mImageRaw[sCurrent]); - S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS; + S32 offset = (S32)((i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS); U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); *pix = col.asRGBA(); } @@ -111,7 +111,7 @@ protected: { LLColor4U col; LLImageDataSharedLock lock(mImageRaw[sCurrent]); - S32 offset = (i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS; + S32 offset = (S32)((i * SKYTEX_RESOLUTION + j) * SKYTEX_COMPONENTS); U32* pix = (U32*) &(mImageRaw[sCurrent]->getData()[offset]); col.fromRGBA( *pix ); return col; diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 56742751e8..471174cf5d 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -142,7 +142,7 @@ void LLVOSurfacePatch::updateGL() { if (mPatchp) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; mPatchp->updateGL(); } } @@ -995,7 +995,7 @@ void gen_terrain_tangents(U16 strider_vertex_count, LLStrider<LLVector2> &texCoords0p, LLStrider<U16> &indicesp) { - LL_PROFILE_ZONE_SCOPED + LL_PROFILE_ZONE_SCOPED; LLVector4a *vertices = new LLVector4a[strider_vertex_count]; LLVector4a *normals = new LLVector4a[strider_vertex_count]; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index a981c60ef2..d982592ee7 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -461,9 +461,7 @@ void LLVOTree::updateTextures() { setDebugText(llformat("%4.0f", (F32) sqrt(mPixelArea))); } - mTreeImagep->addTextureStats(mPixelArea); } - } @@ -479,7 +477,7 @@ LLDrawable* LLVOTree::createDrawable(LLPipeline *pipeline) // Just a placeholder for an actual object... LLFace *facep = mDrawable->addFace(poolp, mTreeImagep); facep->setSize(1, 3); - + facep->setTexture(LLRender::DIFFUSE_MAP, mTreeImagep); updateRadius(); return mDrawable; @@ -1169,6 +1167,10 @@ void LLVOTree::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) LLVector4a pos; pos.load3(center.mV); mDrawable->setPositionGroup(pos); + + LLFace* facep = mDrawable->getFace(0); + facep->mExtents[0] = newMin; + facep->mExtents[1] = newMax; } bool LLVOTree::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, bool pick_transparent, bool pick_rigged, bool pick_unselectable, S32 *face_hitp, diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7ca3fbd1ad..2630aaf43e 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1275,8 +1275,8 @@ void LLVOVolume::sculpt() if(current_discard < -2) { static S32 low_sculpty_discard_warning_count = 1; - S32 exponent = llmax(1, llfloor( log10((F64) low_sculpty_discard_warning_count) )); - S32 interval = pow(10.0, exponent); + S32 exponent = llmax(1, llfloor((F32)log10((F64) low_sculpty_discard_warning_count))); + S32 interval = (S32)pow(10.0, exponent); if ( low_sculpty_discard_warning_count < 10 || (low_sculpty_discard_warning_count % interval) == 0) { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs @@ -1294,8 +1294,8 @@ void LLVOVolume::sculpt() else if (current_discard > MAX_DISCARD_LEVEL) { static S32 high_sculpty_discard_warning_count = 1; - S32 exponent = llmax(1, llfloor( log10((F64) high_sculpty_discard_warning_count) )); - S32 interval = pow(10.0, exponent); + S32 exponent = llmax(1, llfloor((F32)log10((F64) high_sculpty_discard_warning_count))); + S32 interval = (S32)pow(10.0, exponent); if ( high_sculpty_discard_warning_count < 10 || (high_sculpty_discard_warning_count % interval) == 0) { // Log first 10 time, then decreasing intervals afterwards otherwise this can flood the logs @@ -1541,7 +1541,7 @@ bool LLVOVolume::calcLOD() if (isRootEdit()) { S32 total_tris = recursiveGetTriangleCount(); - S32 est_max_tris = recursiveGetEstTrianglesMax(); + S32 est_max_tris = (S32)recursiveGetEstTrianglesMax(); setDebugText(llformat("TRIS SHOWN %d EST %d", total_tris, est_max_tris)); } } @@ -4053,12 +4053,12 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const // Scaling here is to make animated object vs // non-animated object ARC proportional to the // corresponding calculations for streaming cost. - num_triangles = (ANIMATED_OBJECT_COST_PER_KTRI * 0.001 * costs.getEstTrisForStreamingCost())/0.06; + num_triangles = (U32)((ANIMATED_OBJECT_COST_PER_KTRI * 0.001f * costs.getEstTrisForStreamingCost())/0.06f); } else { F32 radius = getScale().length()*0.5f; - num_triangles = costs.getRadiusWeightedTris(radius); + num_triangles = (U32)costs.getRadiusWeightedTris(radius); } } @@ -4534,7 +4534,7 @@ F32 LLVOVolume::getBinRadius() } else { - F32 szf = size_factor; + F32 szf = (F32)size_factor; radius = llmax(mDrawable->getRadius(), szf); //radius = llmax(radius, mDrawable->mDistanceWRTCamera * distance_factor[0]); } @@ -5745,18 +5745,23 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { continue; } -#if 0 -#if LL_RELEASE_WITH_DEBUG_INFO - const LLUUID pbr_id( "49c88210-7238-2a6b-70ac-92d4f35963cf" ); - const LLUUID obj_id( vobj->getID() ); - bool is_pbr = (obj_id == pbr_id); -#else - bool is_pbr = false; -#endif -#else - LLGLTFMaterial *gltf_mat = facep->getTextureEntry()->getGLTFRenderMaterial(); + + LLFetchedGLTFMaterial *gltf_mat = (LLFetchedGLTFMaterial*) facep->getTextureEntry()->getGLTFRenderMaterial(); bool is_pbr = gltf_mat != nullptr; -#endif + + if (is_pbr) + { + // tell texture streaming system to ignore blinn-phong textures + facep->setTexture(LLRender::DIFFUSE_MAP, nullptr); + facep->setTexture(LLRender::NORMAL_MAP, nullptr); + facep->setTexture(LLRender::SPECULAR_MAP, nullptr); + + // let texture streaming system know about PBR textures + facep->setTexture(LLRender::BASECOLOR_MAP, gltf_mat->mBaseColorTexture); + facep->setTexture(LLRender::GLTF_NORMAL_MAP, gltf_mat->mNormalTexture); + facep->setTexture(LLRender::METALLIC_ROUGHNESS_MAP, gltf_mat->mMetallicRoughnessTexture); + facep->setTexture(LLRender::EMISSIVE_MAP, gltf_mat->mEmissiveTexture); + } //ALWAYS null out vertex buffer on rebuild -- if the face lands in a render // batch, it will recover its vertex buffer reference from the spatial group @@ -5874,7 +5879,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) F32 alpha; if (is_pbr) { - alpha = gltf_mat ? gltf_mat->mBaseColor.mV[3] : 1.0; + alpha = gltf_mat ? gltf_mat->mBaseColor.mV[3] : 1.0f; } else { diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 2bc849a74f..4a7e231f30 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -138,8 +138,8 @@ bool LLVOWater::updateGeometry(LLDrawable *drawable) S32 size_y = LLPipeline::sRenderTransparentWater ? 8 : 1; const LLVector3& scale = getScale(); - size_x *= llmin(llround(scale.mV[0] / 256.f), 8); - size_y *= llmin(llround(scale.mV[1] / 256.f), 8); + size_x *= (S32)llmin(llround(scale.mV[0] / 256.f), 8); + size_y *= (S32)llmin(llround(scale.mV[1] / 256.f), 8); const S32 num_quads = size_x * size_y; face->setSize(vertices_per_quad * num_quads, @@ -191,8 +191,8 @@ bool LLVOWater::updateGeometry(LLDrawable *drawable) position_agent.mV[VX] += (x + 0.5f) * step_x; position_agent.mV[VY] += (y + 0.5f) * step_y; - position_agent.mV[VX] = llround(position_agent.mV[VX]); - position_agent.mV[VY] = llround(position_agent.mV[VY]); + position_agent.mV[VX] = (F32)llround(position_agent.mV[VX]); + position_agent.mV[VY] = (F32)llround(position_agent.mV[VY]); *verticesp++ = position_agent - right + up; *verticesp++ = position_agent - right - up; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 6470c81aaa..9508d33eb3 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -805,10 +805,10 @@ void LLWorld::updateNetStats() add(LLStatViewer::PACKETS_OUT, packets_out); add(LLStatViewer::PACKETS_LOST, packets_lost); - F32 total_packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); - if (total_packets_in > 0) + F32 total_packets_in = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN); + if (total_packets_in > 0.f) { - F32 total_packets_lost = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); + F32 total_packets_lost = (F32)LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_LOST); sample(LLStatViewer::PACKETS_LOST_PERCENT, LLUnits::Ratio::fromValue((F32)total_packets_lost/(F32)total_packets_in)); } @@ -1264,7 +1264,7 @@ void send_agent_pause() void send_agent_resume() { - LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // Note: used to check for LLWorld initialization before it became a singleton. // Rather than just remove this check I'm changing it to assure that the message // system has been initialized. -MG diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 09a18a9825..a0eec1e941 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -255,7 +255,7 @@ void LLWorldMapView::zoom(F32 zoom) void LLWorldMapView::zoomWithPivot(F32 zoom, S32 x, S32 y) { mTargetMapScale = scaleFromZoom(zoom); - sZoomPivot = LLVector2(x, y); + sZoomPivot = LLVector2((F32)x, (F32)y); if (!sZoomTimer.getStarted() && mMapScale != mTargetMapScale) { sZoomTimer.start(); @@ -297,8 +297,8 @@ void LLWorldMapView::setScale(F32 scale, bool snap) if (!sZoomPivot.isExactlyZero()) { LLVector2 relative_pivot; - relative_pivot.mV[VX] = sZoomPivot.mV[VX] - (getRect().getWidth() / 2.0); - relative_pivot.mV[VY] = sZoomPivot.mV[VY] - (getRect().getHeight() / 2.0); + relative_pivot.mV[VX] = sZoomPivot.mV[VX] - (getRect().getWidth() / 2.0f); + relative_pivot.mV[VY] = sZoomPivot.mV[VY] - (getRect().getHeight() / 2.0f); LLVector2 zoom_pan_offset = relative_pivot - (relative_pivot * scale / old_scale); mPanX += zoom_pan_offset.mV[VX]; mPanY += zoom_pan_offset.mV[VY]; @@ -422,8 +422,8 @@ void LLWorldMapView::draw() // Find x and y position relative to camera's center. LLVector3d rel_region_pos = origin_global - camera_global; - F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * mMapScale; - F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * mMapScale; + F32 relative_x = (F32)(rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * mMapScale; + F32 relative_y = (F32)(rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * mMapScale; // Coordinates of the sim in pixels in the UI panel // When the view isn't panned, 0,0 = center of rectangle @@ -514,11 +514,11 @@ void LLWorldMapView::draw() { font->renderUTF8( mesg, 0, - llfloor(left + 3), llfloor(bottom + 2), + (F32)llfloor(left + 3), (F32)llfloor(bottom + 2), LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, S32_MAX, //max_chars - mMapScale, //max_pixels + (S32)mMapScale, //max_pixels NULL, /*use_ellipses*/true); } diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 55622fb6b7..ba48b58f3b 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -68,17 +68,13 @@ class LLXMLRPCTransaction::Handler : public LLCore::HttpHandler { public: Handler(LLCore::HttpRequest::ptr_t &request, LLXMLRPCTransaction::Impl *impl); - virtual ~Handler(); - virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) override; typedef std::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; private: - - bool parseResponse(LLXMLNodePtr root); - bool parseValue(LLSD& target, LLXMLNodePtr source); - LLXMLRPCTransaction::Impl *mImpl; LLCore::HttpRequest::ptr_t mRequest; }; @@ -104,6 +100,8 @@ public: std::string mResponseText; LLSD mResponseData; + bool mHasResponse; + bool mResponseParsed; std::string mCertStore; LLSD mErrorCertData; @@ -120,6 +118,10 @@ public: void setStatus(EStatus code, const std::string& message = "", const std::string& uri = ""); void setHttpStatus(const LLCore::HttpStatus &status); + +private: + bool parseResponse(LLXMLNodePtr root); + bool parseValue(LLSD& target, LLXMLNodePtr source); }; LLXMLRPCTransaction::Handler::Handler(LLCore::HttpRequest::ptr_t &request, @@ -129,10 +131,6 @@ LLXMLRPCTransaction::Handler::Handler(LLCore::HttpRequest::ptr_t &request, { } -LLXMLRPCTransaction::Handler::~Handler() -{ -} - void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response) { @@ -159,7 +157,6 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, return; } - mImpl->setStatus(LLXMLRPCTransaction::StatusComplete); mImpl->mTransferStats = response->getTransferStats(); // The contents of a buffer array are potentially noncontiguous, so we @@ -169,88 +166,12 @@ void LLXMLRPCTransaction::Handler::onCompleted(LLCore::HttpHandle handle, body->read(0, mImpl->mResponseText.data(), body->size()); - LLXMLNodePtr root; - if (!LLXMLNode::parseBuffer(mImpl->mResponseText.data(), body->size(), root, nullptr)) - { - LL_WARNS() << "Failed parsing XML response; request URI: " << mImpl->mURI << LL_ENDL; - return; - } - - if (!parseResponse(root)) - return; - - LL_INFOS() << "XML response parsed successfully; request URI: " << mImpl->mURI << LL_ENDL; -} - -struct XMLTreeNode final : public LLSD::TreeNode -{ - XMLTreeNode(const LLXMLNodePtr impl) - : mImpl(impl) - , mFirstChild(impl ? create(impl->getFirstChild()) : nullptr) - , mNextSibling(impl ? create(impl->getNextSibling()) : nullptr) - { - } - - static XMLTreeNode* create(LLXMLNodePtr node) { return node ? new XMLTreeNode(node) : nullptr; } - - virtual bool hasName(const LLSD::String& name) const override { return mImpl && mImpl->hasName(name); } - virtual LLSD::String getTextContents() const override { return mImpl ? mImpl->getTextContents() : LLStringUtil::null; } - virtual TreeNode* getFirstChild() const override { return mFirstChild.get(); } - virtual TreeNode* getNextSibling() const override { return mNextSibling.get(); } - -private: - const LLXMLNodePtr mImpl; - const std::shared_ptr<XMLTreeNode> mFirstChild; - const std::shared_ptr<XMLTreeNode> mNextSibling; -}; - -bool LLXMLRPCTransaction::Handler::parseResponse(LLXMLNodePtr root) -{ - // We have alreasy checked in LLXMLNode::parseBuffer() - // that root contains exactly one child - if (!root->hasName("methodResponse")) - { - LL_WARNS() << "Invalid root element in XML response; request URI: " << mImpl->mURI << LL_ENDL; - return false; - } - - LLXMLNodePtr first = root->getFirstChild(); - LLXMLNodePtr second = first->getFirstChild(); - if (!first->getNextSibling() && second && !second->getNextSibling()) - { - if (first->hasName("fault")) - { - LLSD fault; - if (parseValue(fault, second) && - fault.isMap() && fault.has("faultCode") && fault.has("faultString")) - { - LL_WARNS() << "Request failed;" - << " faultCode: '" << fault.get("faultCode").asString() << "'," - << " faultString: '" << fault.get("faultString").asString() << "'," - << " request URI: " << mImpl->mURI << LL_ENDL; - return false; - } - } - else if (first->hasName("params") && - second->hasName("param") && !second->getNextSibling()) - { - LLXMLNodePtr third = second->getFirstChild(); - if (third && !third->getNextSibling() && parseValue(mImpl->mResponseData, third)) - { - return true; - } - } - } - - LL_WARNS() << "Invalid response format; request URI: " << mImpl->mURI << LL_ENDL; - - return false; -} - -bool LLXMLRPCTransaction::Handler::parseValue(LLSD& target, LLXMLNodePtr source) -{ - XMLTreeNode tn(source); - return target.fromXMLRPCValue(&tn); + // We do not do the parsing in the HTTP coroutine, since it could exhaust + // the coroutine stack in extreme cases. Instead, we flag the data buffer + // as ready, and let mImpl decode it in its process() method, on the main + // coroutine. HB + mImpl->mHasResponse = true; + mImpl->setStatus(LLXMLRPCTransaction::StatusComplete); } //========================================================================= @@ -265,6 +186,8 @@ LLXMLRPCTransaction::Impl::Impl : mHttpRequest() , mStatus(LLXMLRPCTransaction::StatusNotStarted) , mURI(uri) + , mHasResponse(false) + , mResponseParsed(false) { LLCore::HttpOptions::ptr_t httpOpts; LLCore::HttpHeaders::ptr_t httpHeaders; @@ -278,8 +201,8 @@ LLXMLRPCTransaction::Impl::Impl httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); // Delay between repeats will start from 5 sec and grow to 20 sec with each repeat - httpOpts->setMinBackoff(5E6L); - httpOpts->setMaxBackoff(20E6L); + httpOpts->setMinBackoff((LLCore::HttpTime)5E6L); + httpOpts->setMaxBackoff((LLCore::HttpTime)20E6L); httpOpts->setTimeout(http_params.has("timeout") ? http_params["timeout"].asInteger() : 40L); if (http_params.has("retries")) @@ -327,6 +250,57 @@ LLXMLRPCTransaction::Impl::Impl mURI, body.get(), httpOpts, httpHeaders, mHandler); } +bool LLXMLRPCTransaction::Impl::parseResponse(LLXMLNodePtr root) +{ + // We have already checked in LLXMLNode::parseBuffer() that root contains + // exactly one child. + if (!root->hasName("methodResponse")) + { + LL_WARNS() << "Invalid root element in XML response; request URI: " + << mURI << LL_ENDL; + return false; + } + + LLXMLNodePtr first = root->getFirstChild(); + LLXMLNodePtr second = first->getFirstChild(); + if (first && !first->getNextSibling() && second && + !second->getNextSibling()) + { + if (first->hasName("fault")) + { + LLSD fault; + if (parseValue(fault, second) && fault.isMap() && + fault.has("faultCode") && fault.has("faultString")) + { + LL_WARNS() << "Request failed. faultCode: '" + << fault.get("faultCode").asString() + << "', faultString: '" + << fault.get("faultString").asString() + << "', request URI: " << mURI << LL_ENDL; + return false; + } + } + else if (first->hasName("params") && + second->hasName("param") && !second->getNextSibling()) + { + LLXMLNodePtr third = second->getFirstChild(); + if (third && !third->getNextSibling() && + parseValue(mResponseData, third)) + { + return true; + } + } + } + + LL_WARNS() << "Invalid response format; request URI: " << mURI << LL_ENDL; + return false; +} + +bool LLXMLRPCTransaction::Impl::parseValue(LLSD& target, LLXMLNodePtr src) +{ + return src->fromXMLRPCValue(target); +} + bool LLXMLRPCTransaction::Impl::process() { if (!mPostH || !mHttpRequest) @@ -335,6 +309,29 @@ bool LLXMLRPCTransaction::Impl::process() return true; //failed, quit. } + // Parse the response when we have one and it has not yet been parsed. HB + if (mHasResponse && !mResponseParsed) + { + LLXMLNodePtr root; + if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(), + root, nullptr)) + { + LL_WARNS() << "Failed parsing XML in response; request URI: " + << mURI << LL_ENDL; + } + else if (parseResponse(root)) + { + LL_INFOS() << "XMLRPC response parsed successfully; request URI: " + << mURI << LL_ENDL; + } + else + { + LL_WARNS() << "XMLRPC response parsing failed; request URI: " + << mURI << LL_ENDL; + } + mResponseParsed = true; + } + switch (mStatus) { case LLXMLRPCTransaction::StatusComplete: diff --git a/indra/newview/noise.h b/indra/newview/noise.h index ae819cf542..fe3292ab9e 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -344,7 +344,7 @@ static void init(void) } // reintroduce entropy - srand(time(NULL)); // Flawfinder: ignore + srand((unsigned int)time(NULL)); // Flawfinder: ignore } #undef B diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6c9c4751d7..16d66123ae 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -776,9 +776,11 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; if (mRT == &mMainRT) { // hacky -- allocate auxillary buffer + + gCubeSnapshot = TRUE; + if (sReflectionProbesEnabled) { - gCubeSnapshot = true; mReflectionMapManager.initReflectionMaps(); } @@ -863,6 +865,10 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) const U32 post_color_fmt = post_hdr ? GL_RGBA16F : GL_RGBA; mPostMap.allocate(resX, resY, post_color_fmt); + // used to scale down textures + // See LLViwerTextureList::updateImagesCreateTextures and LLImageGL::scaleDown + mDownResMap.allocate(4, 4, GL_RGBA); + //HACK make screenbuffer allocations start failing after 30 seconds if (gSavedSettings.getBOOL("SimulateFBOFailure")) { @@ -1066,12 +1072,7 @@ void LLPipeline::refreshCachedSettings() RenderScreenSpaceReflectionAdaptiveStepMultiplier = gSavedSettings.getF32("RenderScreenSpaceReflectionAdaptiveStepMultiplier"); RenderScreenSpaceReflectionGlossySamples = gSavedSettings.getS32("RenderScreenSpaceReflectionGlossySamples"); RenderBufferVisualization = gSavedSettings.getS32("RenderBufferVisualization"); - if (gSavedSettings.getBOOL("RenderMirrors") != RenderMirrors) - { - RenderMirrors = gSavedSettings.getBOOL("RenderMirrors"); - LLViewerShaderMgr::instance()->clearShaderCache(); - LLViewerShaderMgr::instance()->setShaders(); - } + RenderMirrors = gSavedSettings.getBOOL("RenderMirrors"); RenderHeroProbeUpdateRate = gSavedSettings.getS32("RenderHeroProbeUpdateRate"); RenderHeroProbeConservativeUpdateMultiplier = gSavedSettings.getS32("RenderHeroProbeConservativeUpdateMultiplier"); @@ -1109,6 +1110,8 @@ void LLPipeline::releaseGLBuffers() mPostMap.release(); + mDownResMap.release(); + for (U32 i = 0; i < 3; i++) { mGlow[i].release(); @@ -1233,7 +1236,7 @@ void LLPipeline::createGLBuffers() F32 noise[noiseRes*noiseRes*3]; for (U32 i = 0; i < noiseRes*noiseRes*3; i++) { - noise[i] = ll_frand()*2.0-1.0; + noise[i] = ll_frand()*2.0f-1.0f; } LLImageGL::generateTextures(1, &mTrueNoiseMap); @@ -6906,7 +6909,7 @@ void LLPipeline::generateExposure(LLRenderTarget* src, LLRenderTarget* dst, bool } } shader->uniform1f(dt, gFrameIntervalSeconds); - shader->uniform2f(noiseVec, ll_frand() * 2.0 - 1.0, ll_frand() * 2.0 - 1.0); + shader->uniform2f(noiseVec, ll_frand() * 2.0f - 1.0f, ll_frand() * 2.0f - 1.0f); shader->uniform3f(dynamic_exposure_params, dynamic_exposure_coefficient, exp_min, exp_max); mScreenTriangleVB->setBuffer(); @@ -6952,7 +6955,7 @@ void LLPipeline::gammaCorrect(LLRenderTarget* src, LLRenderTarget* dst) { shader.bindTexture(LLShaderMgr::EXPOSURE_MAP, &mExposureMap); - shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, src->getWidth(), src->getHeight()); + shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)src->getWidth(), (GLfloat)src->getHeight()); static LLCachedControl<F32> exposure(gSavedSettings, "RenderExposure", 1.f); @@ -7031,8 +7034,8 @@ void LLPipeline::generateGlow(LLRenderTarget* src) gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT); } gGlowExtractProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, - mGlow[2].getWidth(), - mGlow[2].getHeight()); + (GLfloat)mGlow[2].getWidth(), + (GLfloat)mGlow[2].getHeight()); } { @@ -7357,7 +7360,7 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); gDeferredCoFProgram.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); - gDeferredCoFProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, dst->getWidth(), dst->getHeight()); + gDeferredCoFProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_FOCAL_DISTANCE, -subject_distance / 1000.f); gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_BLUR_CONSTANT, blur_constant); gDeferredCoFProgram.uniform1f(LLShaderMgr::DOF_TAN_PIXEL_ANGLE, tanf(1.f / LLDrawable::sCurPixelAngle)); @@ -7383,7 +7386,7 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) gDeferredPostProgram.bind(); gDeferredPostProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, &mRT->deferredLight, LLTexUnit::TFO_POINT); - gDeferredPostProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, dst->getWidth(), dst->getHeight()); + gDeferredPostProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); gDeferredPostProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); @@ -7416,7 +7419,7 @@ void LLPipeline::renderDoF(LLRenderTarget* src, LLRenderTarget* dst) gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_DIFFUSE, src, LLTexUnit::TFO_POINT); gDeferredDoFCombineProgram.bindTexture(LLShaderMgr::DEFERRED_LIGHT, &mRT->deferredLight, LLTexUnit::TFO_POINT); - gDeferredDoFCombineProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, dst->getWidth(), dst->getHeight()); + gDeferredDoFCombineProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)dst->getWidth(), (GLfloat)dst->getHeight()); gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_MAX_COF, CameraMaxCoF); gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_RES_SCALE, CameraDoFResScale); gDeferredDoFCombineProgram.uniform1f(LLShaderMgr::DOF_WIDTH, (dof_width - 1) / (F32)src->getWidth()); @@ -7779,15 +7782,15 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ shader.uniform1f(LLShaderMgr::DEFERRED_BLUR_SIZE, RenderShadowBlurSize); shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_RADIUS, RenderSSAOScale); - shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_MAX_RADIUS, RenderSSAOMaxScale); + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_MAX_RADIUS, (GLfloat)RenderSSAOMaxScale); F32 ssao_factor = RenderSSAOFactor; shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR, ssao_factor); - shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR_INV, 1.0/ssao_factor); + shader.uniform1f(LLShaderMgr::DEFERRED_SSAO_FACTOR_INV, 1.0f/ssao_factor); LLVector3 ssao_effect = RenderSSAOEffect; - F32 matrix_diag = (ssao_effect[0] + 2.0*ssao_effect[1])/3.0; - F32 matrix_nondiag = (ssao_effect[0] - ssao_effect[1])/3.0; + F32 matrix_diag = (ssao_effect[0] + 2.0f*ssao_effect[1])/3.0f; + F32 matrix_nondiag = (ssao_effect[0] - ssao_effect[1])/3.0f; // This matrix scales (proj of color onto <1/rt(3),1/rt(3),1/rt(3)>) by // value factor, and scales remainder by saturation factor F32 ssao_effect_mat[] = { matrix_diag, matrix_nondiag, matrix_nondiag, @@ -7799,7 +7802,7 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ F32 shadow_bias_error = RenderShadowBiasError * fabsf(LLViewerCamera::getInstance()->getOrigin().mV[2])/3000.f; F32 shadow_bias = RenderShadowBias + shadow_bias_error; - shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, deferred_target->getWidth(), deferred_target->getHeight()); + shader.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, (GLfloat)deferred_target->getWidth(), (GLfloat)deferred_target->getHeight()); shader.uniform1f(LLShaderMgr::DEFERRED_NEAR_CLIP, LLViewerCamera::getInstance()->getNear()*2.f); shader.uniform1f (LLShaderMgr::DEFERRED_SHADOW_OFFSET, RenderShadowOffset); //*shadow_offset_error); shader.uniform1f(LLShaderMgr::DEFERRED_SHADOW_BIAS, shadow_bias); @@ -7808,8 +7811,8 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ shader.uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, mTransformedSunDir.mV); shader.uniform3fv(LLShaderMgr::DEFERRED_MOON_DIR, 1, mTransformedMoonDir.mV); - shader.uniform2f(LLShaderMgr::DEFERRED_SHADOW_RES, mRT->shadow[0].getWidth(), mRT->shadow[0].getHeight()); - shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, mSpotShadow[0].getWidth(), mSpotShadow[0].getHeight()); + shader.uniform2f(LLShaderMgr::DEFERRED_SHADOW_RES, (GLfloat)mRT->shadow[0].getWidth(), (GLfloat)mRT->shadow[0].getHeight()); + shader.uniform2f(LLShaderMgr::DEFERRED_PROJ_SHADOW_RES, (GLfloat)mSpotShadow[0].getWidth(), (GLfloat)mSpotShadow[0].getHeight()); shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); @@ -7940,8 +7943,8 @@ void LLPipeline::renderDeferredLighting() gDeferredSunProgram.uniform3fv(sOffset, slice, offset); gDeferredSunProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, - deferred_light_target->getWidth(), - deferred_light_target->getHeight()); + (GLfloat)deferred_light_target->getWidth(), + (GLfloat)deferred_light_target->getHeight()); { LLGLDisable blend(GL_BLEND); @@ -8640,7 +8643,7 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep) { gGL.getTexUnit(channel)->bind(img); - F32 lod_range = logf(img->getWidth())/logf(2.f); + F32 lod_range = logf((F32)img->getWidth())/logf(2.f); shader.uniform1f(LLShaderMgr::PROJECTOR_FOCUS, focus); shader.uniform1f(LLShaderMgr::PROJECTOR_LOD, lod_range); @@ -8765,17 +8768,17 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader) } - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ITR_COUNT, RenderScreenSpaceReflectionIterations); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ITR_COUNT, (GLfloat)RenderScreenSpaceReflectionIterations); shader.uniform1f(LLShaderMgr::DEFERRED_SSR_DIST_BIAS, RenderScreenSpaceReflectionDistanceBias); shader.uniform1f(LLShaderMgr::DEFERRED_SSR_RAY_STEP, RenderScreenSpaceReflectionRayStep); - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_GLOSSY_SAMPLES, RenderScreenSpaceReflectionGlossySamples); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_GLOSSY_SAMPLES, (GLfloat)RenderScreenSpaceReflectionGlossySamples); shader.uniform1f(LLShaderMgr::DEFERRED_SSR_REJECT_BIAS, RenderScreenSpaceReflectionDepthRejectBias); mPoissonOffset++; if (mPoissonOffset > 128 - RenderScreenSpaceReflectionGlossySamples) mPoissonOffset = 0; - shader.uniform1f(LLShaderMgr::DEFERRED_SSR_NOISE_SINE, mPoissonOffset); + shader.uniform1f(LLShaderMgr::DEFERRED_SSR_NOISE_SINE, (GLfloat)mPoissonOffset); shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ADAPTIVE_STEP_MULT, RenderScreenSpaceReflectionAdaptiveStepMultiplier); channel = shader.enableTexture(LLShaderMgr::SCENE_DEPTH); @@ -9941,7 +9944,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera) { LLTrace::CountStatHandle<>* velocity_stat = LLViewerCamera::getVelocityStat(); F32 fade_amt = gFrameIntervalSeconds.value() - * llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0); + * (F32)llmax(LLTrace::get_frame_recording().getLastRecording().getSum(*velocity_stat) / LLTrace::get_frame_recording().getLastRecording().getDuration().value(), 1.0); // should never happen llassert(mTargetShadowSpotLight[0] != mTargetShadowSpotLight[1] || mTargetShadowSpotLight[0].isNull()); @@ -10108,8 +10111,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera) for (U32 i = 0; i < 16; i++) { - gGLLastModelView[i] = last_modelview[i]; - gGLLastProjection[i] = last_projection[i]; + gGLLastModelView[i] = (F32)last_modelview[i]; + gGLLastProjection[i] = (F32)last_projection[i]; } popRenderTypeMask(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 1d2033b4f0..6c79d20149 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -725,6 +725,9 @@ public: // tonemapped and gamma corrected render ready for post LLRenderTarget mPostMap; + // downres scratch space for GPU downscaling of textures + LLRenderTarget mDownResMap; + LLCullResult mSky; LLCullResult mReflectedObjects; LLCullResult mRefractedObjects; diff --git a/indra/newview/skins/default/xui/en/floater_bulk_upload.xml b/indra/newview/skins/default/xui/en/floater_bulk_upload.xml new file mode 100644 index 0000000000..b2d03a5d04 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_bulk_upload.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<floater + can_resize="false" + show_title="false" + can_minimize="false" + can_close="false" + header_height="10" + bg_opaque_image="Window_NoTitle_Foreground" + bg_alpha_image="Window_NoTitle_Background" + height="207" + layout="topleft" + name="bulk_upload" + width="430"> + <layout_stack + follows="all" + height="203" + layout="topleft" + left="8" + animate="false" + top="1" + orientation="vertical" + name="maint_layout" + width="421"> + <layout_panel + follows="all" + height="27" + layout="topleft" + auto_resize="false" + visible="true" + name="count_panel"> + <text + follows="left|top" + layout="topleft" + top="6" + left="20" + name="number_of_items" + height="20" + wrap="true"> + Number of items to upload: [COUNT] + </text> + </layout_panel> + <layout_panel + follows="all" + height="37" + layout="topleft" + auto_resize="false" + visible="true" + name="warning_panel"> + <text + name="textures_2k_warning" + follows="left|top" + layout="topleft" + top="6" + left="20" + height="30" + right="-20" + wrap="true"> + By default, one or more selected textures will be scaled to 2048px. + </text> + </layout_panel> + <layout_panel + follows="all" + height="23" + layout="topleft" + auto_resize="false" + visible="true" + name="checkbox_panel"> + <check_box + height="16" + left="20" + label="Scale textures to a maximum of 1024px" + layout="topleft" + name="upload_2k" /> + </layout_panel> + <layout_panel + follows="all" + height="27" + layout="topleft" + auto_resize="false" + visible="true" + name="cost_panel"> + <text + name="upload_cost" + follows="left|top" + layout="topleft" + font.style="BOLD" + top="6" + left="20" + height="20" + wrap="true"> + Upload cost: L$[COST] + </text> + </layout_panel> + <layout_panel + follows="all" + height="29" + layout="topleft" + auto_resize="false" + visible="true" + name="buttoms_panel"> + <button + follows="bottom|left|right" + height="23" + label="Upload" + layout="topleft" + mouse_opaque="false" + name="upload_btn" + top="1" + left="84" + width="120" /> + <button + follows="bottom|left|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="12" + top_delta="0" + mouse_opaque="false" + name="cancel_btn" + width="120" /> + </layout_panel> + <layout_panel + follows="all" + height="40" + layout="topleft" + auto_resize="false" + visible="true" + name="link_panel"> + <text + follows="left|top" + layout="topleft" + top="6" + left="20" + name="new_folder_textbox" + height="39" + parse_urls="true" + skip_link_underline="true" + wrap="true"> +How textures are scaled during upload: +https://wiki.secondlife.com/wiki/Limits#All_Viewers + </text> + </layout_panel> + </layout_stack> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 4df29c47de..176a2ca1a4 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -14,7 +14,7 @@ reuse_instance="true" title="CONVERSATIONS" bottom="-50" - right="-5" + left="5" width="450" min_width="38"> <string diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml index 63185b537c..61738e73db 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_multiselect.xml @@ -48,6 +48,9 @@ name="share"> <on_click function="Avatar.Share" /> + <on_enable + function="Avatar.EnableItem" + parameter="can_share" /> </menu_item_call> <menu_item_call enabled="false" @@ -56,6 +59,9 @@ name="pay"> <on_click function="Avatar.Pay" /> + <on_enable + function="Avatar.EnableItem" + parameter="can_pay" /> </menu_item_call> <menu_item_call label="Offer Teleport" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f86b297395..a1e25f48ed 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -9060,17 +9060,6 @@ Your voice has been muted by moderator. name="okbutton" yestext="OK"/> </notification> - - <notification - icon="alertmodal.tga" - name="BulkUploadCostConfirmation" - type="alertmodal"> -This will upload [COUNT] items at a total cost of L$[COST]. Do you wish to continue with the upload? - <usetemplate - name="okcancelbuttons" - notext="Cancel" - yestext="Upload"/> - </notification> <notification icon="alertmodal.tga" diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp index e9d4982e35..151aadfd4b 100644 --- a/indra/newview/tests/lldateutil_test.cpp +++ b/indra/newview/tests/lldateutil_test.cpp @@ -38,18 +38,23 @@ // Baked-in return values for getString() -std::map< std::string, std::string > gString; +std::map< std::string, std::string, std::less<>> gString; // Baked-in return values for getCountString() // map of pairs of input xml_desc and integer count typedef std::pair< std::string, int > count_string_t; std::map< count_string_t, std::string > gCountString; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(const std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { - std::string text = gString[xml_desc]; - LLStringUtil::format(text, args); - return text; + auto it = gString.find(xml_desc); + if (it != gString.end()) + { + std::string text = it->second; + LLStringUtil::format(text, args); + return text; + } + return {}; } std::string LLTrans::getCountString(const std::string& language, const std::string& xml_desc, S32 count) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index df0f006d02..bff2289a7c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -79,7 +79,7 @@ LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; } LLViewerWindow* gViewerWindow; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { return std::string("test_trans"); } @@ -235,7 +235,7 @@ static LLEventPump * gTOSReplyPump = NULL; LLPointer<LLSecAPIHandler> gSecAPIHandler; //static -LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, bool focus) +LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bool focus) { gTOSType = name; gTOSReplyPump = &LLEventPumps::instance().obtain(key["reply_pump"]); diff --git a/indra/newview/tests/llslurl_test.cpp b/indra/newview/tests/llslurl_test.cpp index 3be44a9bd5..fc9f5b707a 100644 --- a/indra/newview/tests/llslurl_test.cpp +++ b/indra/newview/tests/llslurl_test.cpp @@ -46,10 +46,10 @@ static const char * const TEST_FILENAME("llslurl_test.xml"); class LLTrans { public: - static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); + static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); }; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { return std::string(); } diff --git a/indra/newview/tests/llviewernetwork_test.cpp b/indra/newview/tests/llviewernetwork_test.cpp index 40c2059d27..d9cb9e7538 100644 --- a/indra/newview/tests/llviewernetwork_test.cpp +++ b/indra/newview/tests/llviewernetwork_test.cpp @@ -45,10 +45,10 @@ static const char * const TEST_FILENAME("llviewernetwork_test.xml"); class LLTrans { public: - static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); + static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false); }; -std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string) +std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string) { std::string grid_label = std::string(); if(xml_desc == "AgniGridLabel") diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index 8564dbeeb6..d5bf189d82 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -66,7 +66,7 @@ void LLWorldMipmap::equalizeBoostLevels() { } LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return NULL; } // Stub other stuff -std::string LLTrans::getString(const std::string &, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); } +std::string LLTrans::getString(std::string_view, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); } void LLUIString::updateResult() const { } void LLUIString::setArg(const std::string& , const std::string& ) { } void LLUIString::assign(const std::string& ) { } |