diff --git a/doc/contributions.txt b/doc/contributions.txt index 5ed4809e09..2078ed11c5 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -257,6 +257,8 @@ Benja Kepler VWR-746 Benjamin Bigdipper Beth Walcher +Beq Janus + SL-10288 Bezilon Kasei Biancaluce Robbiani CT-225 diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 2143df2213..fde66e2277 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1594,7 +1594,7 @@ bool LLPrimitive::getTESTAxes(const U8 face, U32* s_axis, U32* t_axis) *s_axis = VY; *t_axis = VZ; return true; } - else if (face == 5) + else if (face >= 5) { *s_axis = VX; *t_axis = VY; return true; diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 3424613e94..de2ea2a065 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -91,9 +91,7 @@ void main() // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); -// col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); col.rgb += light_diffuse[2].rgb * calcDirectionalLight(norm, light_position[2].xyz); -// col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); col.rgb += light_diffuse[3].rgb * calcDirectionalLight(norm, light_position[3].xyz); col /= 2.0; vertex_color = col*color; diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index af6977d3cd..83a6e9f279 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -125,17 +125,11 @@ BOOL LLViewerDynamicTexture::render() //----------------------------------------------------------------------------- void LLViewerDynamicTexture::preRender(BOOL clear_depth) { - // changes to support higher resolution rendering in the preview - ////only images up to 512x512 are supported - //llassert(mFullHeight <= 512); - //llassert(mFullWidth <= 512); gPipeline.allocatePhysicsBuffer(); llassert(mFullWidth <= static_cast(gPipeline.mPhysicsDisplay.getWidth())); llassert(mFullHeight <= static_cast(gPipeline.mPhysicsDisplay.getHeight())); -// if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI) if (gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI) -// { //using offscreen render target, just use the bottom left corner mOrigin.set(0, 0); } @@ -221,12 +215,10 @@ BOOL LLViewerDynamicTexture::updateAllInstances() { return TRUE; } - // changes to support higher resolution rendering in the preview - // bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI; + bool use_fbo = gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI; if (use_fbo) { -// gPipeline.mWaterDis.bindTarget(); gPipeline.mPhysicsDisplay.bindTarget(); } // @@ -265,10 +257,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances() if (use_fbo) { - // changes to support higher resolution rendering in the preview - // gPipeline.mWaterDis.flush(); gPipeline.mPhysicsDisplay.flush(); - // } return ret; diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 6c0f6cba2e..489c1a02cd 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -105,6 +105,8 @@ LLFilePicker::LLFilePicker() mOFN.lpfnHook = NULL; mOFN.lpTemplateName = NULL; mFilesW[0] = '\0'; +#elif LL_DARWIN + mPickOptions = 0; #endif } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 99a388309f..6afe09b996 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -465,11 +465,8 @@ void LLFloaterModelPreview::initModelPreview() { delete mModelPreview; } - // mesh uploader changes to allow higher resolution render - // mModelPreview = new LLModelPreview(512, 512, this); auto size = gSavedSettings.getS32("PreviewRenderSize"); mModelPreview = new LLModelPreview(size, size, this ); - // mModelPreview->setPreviewTarget(16.f); mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5)); mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1)); @@ -479,7 +476,17 @@ void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl) { if (mModelPreview) { + // + //auto name = ctrl->getName(); + //mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; + //if (name == "show_physics") + //{ + // auto enabled = mModelPreview->mViewOption[name]; + // childSetEnabled("physics_explode", enabled); + // childSetVisible("physics_explode", enabled); + //} mModelPreview->mViewOption[ctrl->getName()] = !mModelPreview->mViewOption[ctrl->getName()]; + // mModelPreview->refresh(); } } @@ -707,7 +714,6 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit) } } -// extracted method to simplify changes in layout void LLFloaterModelPreview::draw3dPreview() { gGL.color3f(1.f, 1.f, 1.f); @@ -715,6 +721,7 @@ void LLFloaterModelPreview::draw3dPreview() gGL.getTexUnit(0)->bind(mModelPreview); + LLView* preview_panel = getChild("preview_panel"); if (!preview_panel) @@ -1352,7 +1359,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) , mResetJoints( false ) , mModelNoErrors( true ) , mLastJointUpdate( false ) -, mHasDegenerate( false ) // +, mHasDegenerate( false ) { mNeedsUpdate = TRUE; mCameraDistance = 0.f; @@ -2939,7 +2946,7 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim void LLModelPreview::updateStatusMessages() { -// bit mask values for physics errors. used to prevent overwrite of single line status +// bit mask values for physics errors. used to prevent overwrite of single line status // TODO: use this to provied multiline status enum PhysicsError { @@ -2949,10 +2956,10 @@ void LLModelPreview::updateStatusMessages() TOOMANYHULLS=4, TOOMANYVERTSINHULL=8 }; -// + assert_main_thread(); - U32 has_physics_error{ PhysicsError::NONE }; // physics error bitmap + U32 has_physics_error{ PhysicsError::NONE }; // physics error bitmap //triangle/vertex/submesh count for each mesh asset for each lod std::vector tris[LLModel::NUM_LODS]; std::vector verts[LLModel::NUM_LODS]; @@ -3041,38 +3048,25 @@ void LLModelPreview::updateStatusMessages() { mMaxTriangleLimit = total_tris[LLModel::LOD_HIGH]; } - // make has_degenerate a member so that we can use it in the render method - // has_degenerate = false + mHasDegenerate = false; {//check for degenerate triangles in physics mesh U32 lod = LLModel::LOD_PHYSICS; const LLVector4a scale(0.5f); - for (U32 i = 0; i < mModel[lod].size() && !mHasDegenerate; ++i)// make has_degenerate a member + for (U32 i = 0; i < mModel[lod].size() && !mHasDegenerate; ++i) { //for each model in the lod if (mModel[lod][i] && mModel[lod][i]->mPhysics.mHull.empty()) { //no decomp exists S32 cur_submeshes = mModel[lod][i]->getNumVolumeFaces(); - for (S32 j = 0; j < cur_submeshes && !mHasDegenerate; ++j)// make has_degenerate a member + for (S32 j = 0; j < cur_submeshes && !mHasDegenerate; ++j) { //for each submesh (face), add triangles and vertices to current total LLVolumeFace& face = mModel[lod][i]->getVolumeFace(j); - for (S32 k = 0; (k < face.mNumIndices) && !mHasDegenerate; )// make has_degenerate a member + for (S32 k = 0; (k < face.mNumIndices) && !mHasDegenerate; ) { - U16 index_a = face.mIndices[k+0]; - U16 index_b = face.mIndices[k+1]; - U16 index_c = face.mIndices[k+2]; - // FIRE-23367/23387 - Allow forced empty triangle placeholders created by the LOD processing. - // LLVector4a v1; v1.setMul(face.mPositions[index_a], scale); - // LLVector4a v2; v2.setMul(face.mPositions[index_b], scale); - // LLVector4a v3; v3.setMul(face.mPositions[index_c], scale); + U16 index_a = face.mIndices[k + 0]; + U16 index_b = face.mIndices[k + 1]; + U16 index_c = face.mIndices[k + 2]; - // if (ll_is_degenerate(v1, v2, v3)) - // { - // mHasDegenerate = true;// make has_degenerate a member - // } - // else - // { - // k += 3; - // } if (index_c == 0 && index_b == 0 && index_a == 0) // test in reverse as 3rd index is less likely to be 0 in a normal case { LL_DEBUGS("MeshValidation") << "Empty placeholder triangle (3 identical index 0 verts) ignored" << LL_ENDL; @@ -3084,23 +3078,31 @@ void LLModelPreview::updateStatusMessages() LLVector4a v3; v3.setMul(face.mPositions[index_c], scale); if (ll_is_degenerate(v1, v2, v3)) { - mHasDegenerate = true;// make has_degenerate a member + mHasDegenerate = true; } } k += 3; - // } } } } } - // flag degenerates here rather than deferring to a MAV error later + // flag degenerates here rather than deferring to a MAV error later + // + //mFMP->childSetVisible("physics_status_message_text", mHasDegenerate); //display or clear + //auto degenerateIcon = mFMP->getChild("physics_status_message_icon"); + //degenerateIcon->setVisible(mHasDegenerate); + // if (mHasDegenerate) { has_physics_error |= PhysicsError::DEGENERATE; + // + //mFMP->childSetValue("physics_status_message_text", mFMP->getString("phys_status_degenerate_triangles")); + //LLUIImagePtr img = LLUI::getUIImage("ModelImport_Status_Error"); + //degenerateIcon->setImage(img); + // } - // mFMP->childSetTextArg("submeshes_info", "[SUBMESHES]", llformat("%d", total_submeshes[LLModel::LOD_HIGH])); @@ -3243,16 +3245,16 @@ void LLModelPreview::updateStatusMessages() } // standardise error handling - //if (!(has_physics_error & PhysicsError::DEGENERATE)){ // only update this field (incluides clearing it) if it is not already in use. - // mFMP->childSetVisible("physics_status_message_text", physExceededVertexLimit); - // LLIconCtrl* physStatusIcon = mFMP->getChild("physics_status_message_icon"); - // physStatusIcon->setVisible(physExceededVertexLimit); - // if (physExceededVertexLimit) - // { - // mFMP->childSetValue("physics_status_message_text", mFMP->getString("phys_status_vertex_limit_exceeded")); - // LLUIImagePtr img = LLUI::getUIImage("ModelImport_Status_Warning"); - // physStatusIcon->setImage(img); - // } + //if (!(has_physics_error & PhysicsError::DEGENERATE)){ // only update this field (incluides clearing it) if it is not already in use. + // mFMP->childSetVisible("physics_status_message_text", physExceededVertexLimit); + // LLIconCtrl* physStatusIcon = mFMP->getChild("physics_status_message_icon"); + // physStatusIcon->setVisible(physExceededVertexLimit); + // if (physExceededVertexLimit) + // { + // mFMP->childSetValue("physics_status_message_text", mFMP->getString("phys_status_vertex_limit_exceeded")); + // LLUIImagePtr img = LLUI::getUIImage("ModelImport_Status_Warning"); + // physStatusIcon->setImage(img); + // } //} #ifdef OPENSIM has_physics_error |= PhysicsError::NOHAVOK; @@ -3330,12 +3332,9 @@ void LLModelPreview::updateStatusMessages() } } // Improve the error checking the TO DO here is no longer applicable but not an FS comment so edited to stop it being picked up - //// To do investigate use of has_degenerate and include into mModelNoErrors upload blocking mechanics - //// current use of has_degenerate won't block upload permanently - later checks will restore the button //if (!mModelNoErrors || mHasDegenerate) - //{ - // mFMP->childDisable("ok_btn"); - if ((gSavedSettings.getBOOL("FSIgnoreClientsideMeshValidation")==FALSE) && (!mModelNoErrors || (has_physics_error > PhysicsError::NOHAVOK))) // block for all cases of phsyics error except NOHAVOK + if (!gSavedSettings.getBOOL("FSIgnoreClientsideMeshValidation") && (!mModelNoErrors || (has_physics_error > PhysicsError::NOHAVOK))) // block for all cases of phsyics error except NOHAVOK + // { mFMP->childDisable("ok_btn"); mFMP->childDisable("calculate_btn"); @@ -3414,14 +3413,14 @@ void LLModelPreview::updateStatusMessages() mViewOption["show_physics"] = true; fmp->childSetValue("show_physics", true); } - // handle hiding of hull only explode slider - //else - //{ - // fmp->disableViewOption("show_physics"); - // mViewOption["show_physics"] = false; - // fmp->childSetValue("show_physics", false); - - //} + // handle hiding of hull only explode slider + //} + //else + //{ + // fmp->disableViewOption("show_physics"); + // mViewOption["show_physics"] = false; + // fmp->childSetValue("show_physics", false); + //} mViewOption["show_physics"] = true; if (phys_hulls > 0) { @@ -3740,7 +3739,7 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights) } vb = new LLVertexBuffer(mask, 0); - + if (!vb->allocateBuffer(num_vertices, num_indices, TRUE)) { // We are likely to crash due this failure, if this happens, find a way to gracefully stop preview @@ -4009,7 +4008,7 @@ BOOL LLModelPreview::render() bool physics = mViewOption["show_physics"]; bool uv_guide = mViewOption["show_uv_guide"]; // Add UV guide overlay in mesh preview - // Extra configurability, to be exposed later as controls? + // Extra configurability, to be exposed later as controls? static LLCachedControl canvas_col(gSavedSettings, "MeshPreviewCanvasColor"); static LLCachedControl edge_col(gSavedSettings, "MeshPreviewEdgeColor"); static LLCachedControl base_col(gSavedSettings, "MeshPreviewBaseColor"); @@ -4022,16 +4021,12 @@ BOOL LLModelPreview::render() static LLCachedControl deg_fill_col(gSavedSettings, "MeshPreviewDegenerateFillColor"); static LLCachedControl deg_edge_width(gSavedSettings, "MeshPreviewDegenerateEdgeWidth"); static LLCachedControl deg_point_size(gSavedSettings, "MeshPreviewDegeneratePointSize"); - // + S32 width = getWidth(); S32 height = getHeight(); LLGLSUIDefault def; LLGLDisable no_blend(GL_BLEND); -// Clean up render of mesh preview -// LLGLEnable blend(GL_BLEND); -// gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); -// LLGLEnable cull(GL_CULL_FACE); LLGLDepthTest depth(GL_TRUE); @@ -4051,8 +4046,7 @@ BOOL LLModelPreview::render() gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); gGL.loadIdentity(); - // uploader improvements - //gGL.color4f(0.169f, 0.169f, 0.169f, 1.f); + gGL.color4fv(static_cast(canvas_col).mV); gl_rect_2d_simple( width, height ); @@ -4201,11 +4195,7 @@ BOOL LLModelPreview::render() stop_glerror(); gGL.pushMatrix(); - // mesh uploader improvements configurable brightness - //const F32 BRIGHTNESS = 0.9f; - //gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS); gGL.color4fv(edge_col().mV); - // const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0; @@ -4287,12 +4277,8 @@ BOOL LLModelPreview::render() mTextureSet.insert(tex); } } - // improved mesh uploader - // else - // { - // gGL.diffuseColor4f(1,1,1,1); - // } } + // improved mesh uploader else if (uv_guide) { if(mUVGuideTexture) @@ -4305,19 +4291,15 @@ BOOL LLModelPreview::render() gGL.diffuseColor4fv(static_cast(base_col).mV); } + // else { - // gGL.diffuseColor4f(1,1,1,1); gGL.diffuseColor4fv(static_cast(base_col).mV); - // } buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - // improved mesh uploader - //gGL.diffuseColor3f(0.4f, 0.4f, 0.4f); gGL.diffuseColor4fv(static_cast(edge_col).mV); - // if (edges) { glLineWidth(edge_width); @@ -4332,25 +4314,10 @@ BOOL LLModelPreview::render() if (physics) { - // model upload improvements - use the settings - ////Vector4a physicsFillColour(0.4, 0.4, 0.4, 0.4); - //const LLColor4 physicsFillColour(0.0, 0.5, 1.0, 0.5); - ////LLVector4a physicsEdgeColour(1.0, 1.0, 0.0, 1.0); - //const LLColor4 physicsEdgeColour=physicsFillColour*0.5; - //const LLColor4 degenerateFill(1.0, 0.0, 0.0, 0.5); - //const LLColor4 degenerateEdge(1.0,0.0,0.0,1.0); - // - glClear(GL_DEPTH_BUFFER_BIT); - // refactor to remove silly variable names - // for (U32 i = 0; i < 2; i++) for (U32 pass = 0; pass < 2; pass++) - // { - // refactor to remove silly variable names - //if (i == 0) if (pass == 0) - // { //depth only pass gGL.setColorMask(false, false); } @@ -4360,10 +4327,7 @@ BOOL LLModelPreview::render() } //enable alpha blending on second pass but not first pass - // refactor to remove silly variable names - //LLGLState blend(GL_BLEND, i); LLGLState blend(GL_BLEND, pass); - // gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); @@ -4467,16 +4431,11 @@ BOOL LLModelPreview::render() gGL.popMatrix(); } - // refactor to remove silly variable names - // also only do this if mDegenerate was set in the preceding mesh checks [Check this if the ordering ever breaks] - //if (i > 0) + // only do this if mDegenerate was set in the preceding mesh checks [Check this if the ordering ever breaks] if (pass > 0 && mHasDegenerate) - // { glLineWidth(deg_edge_width); glPointSize(deg_point_size); -// This single line is why the degenerate triangles display has been crap forever. -// gPipeline.enableLightsFullbright(LLColor4::white); //show degenerate triangles LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS); LLGLDisable cull(GL_CULL_FACE); @@ -4514,13 +4473,10 @@ BOOL LLModelPreview::render() } auto num_degenerate = 0; - // More nested i variable silliness - // for (U32 i = 0; i < mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); ++i) auto num_models = mVertexBuffer[LLModel::LOD_PHYSICS][model].size(); for (U32 v = 0; v < num_models; ++v) { LLVertexBuffer* buffer = mVertexBuffer[LLModel::LOD_PHYSICS][model][v]; - // if(buffer->getNumVerts() < 3)continue; buffer->setBuffer(type_mask & buffer->getTypeMask()); @@ -4533,7 +4489,6 @@ BOOL LLModelPreview::render() buffer->getIndexStrider(idx, 0); LLVector4a v1, v2, v3; - // rename inner most i to avoid merge confusion for (U32 indices_offset = 0; indices_offset < buffer->getNumIndices(); indices_offset += 3) { v1.setMul(pos[*idx++], scale); @@ -4606,7 +4561,7 @@ BOOL LLModelPreview::render() LLMatrix4a mat[LL_MAX_JOINTS_PER_MESH_OBJECT]; const LLMeshSkinInfo *skin = &model->mSkinInfo; U32 count = LLSkinningUtil::getMeshJointCount(skin); - //LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, + //LLSkinningUtil::initSkinningMatrixPalette((LLMatrix4*)mat, count, // skin, getPreviewAvatar()); LLSkinningUtil::initSkinningMatrixPalette(mat, count, skin, getPreviewAvatar()); @@ -4665,8 +4620,6 @@ BOOL LLModelPreview::render() } // buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); - // configurable colour and width - //gGL.diffuseColor3f(0.4f, 0.4f, 0.4f); if (edges) { @@ -4677,7 +4630,6 @@ BOOL LLModelPreview::render() glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glLineWidth(1.f); } - // } } } @@ -4735,11 +4687,9 @@ void LLModelPreview::rotate(F32 yaw_radians, F32 pitch_radians) void LLModelPreview::zoom(F32 zoom_amt) { F32 new_zoom = mCameraZoom+zoom_amt; - // add configurable zoom TODO: stop clamping in render - // mCameraZoom = llclamp(new_zoom, 1.f, 10.f); + // TODO: stop clamping in render static LLCachedControl zoom_limit(gSavedSettings, "MeshPreviewZoomLimit"); mCameraZoom = llclamp(new_zoom, 1.f, zoom_limit()); - // } void LLModelPreview::pan(F32 right, F32 up) @@ -4947,12 +4897,6 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) childSetTextArg("server_weight", "[SIM]", tbd); childSetTextArg("physics_weight", "[PH]", tbd); childSetTextArg("upload_fee", "[FEE]", tbd); - // add extended info fields - //childSetTextArg("price_breakdown", "[STREAMING]", dashes); - //childSetTextArg("price_breakdown", "[PHYSICS]", dashes); - //childSetTextArg("price_breakdown", "[INSTANCES]", dashes); - //childSetTextArg("price_breakdown", "[TEXTURES]", dashes); - //childSetTextArg("price_breakdown", "[MODEL]", dashes); std::string dashes = hasString("--") ? getString("--") : "--"; childSetTextArg("price_breakdown", "[STREAMING]", dashes); childSetTextArg("price_breakdown", "[PHYSICS]", dashes); @@ -4962,7 +4906,6 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) childSetTextArg("physics_breakdown", "[PCH]", dashes); childSetTextArg("physics_breakdown", "[PM]", dashes); childSetTextArg("physics_breakdown", "[PHU]", dashes); - // } } @@ -5012,7 +4955,7 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() childSetTextArg("price_breakdown", "[INSTANCES]", llformat("%d", result["upload_price_breakdown"]["mesh_instance"].asInteger())); childSetTextArg("price_breakdown", "[TEXTURES]", llformat("%d", result["upload_price_breakdown"]["texture"].asInteger())); childSetTextArg("price_breakdown", "[MODEL]", llformat("%d", result["upload_price_breakdown"]["model"].asInteger())); -// Updates for enhanced Mesh feedback at upload + childSetTextArg("physics_breakdown", "[PCH]", llformat("%0.3f", result["model_physics_cost"]["hull"].asReal())); childSetTextArg("physics_breakdown", "[PM]", llformat("%0.3f", result["model_physics_cost"]["mesh"].asReal())); childSetTextArg("physics_breakdown", "[PHU]", llformat("%0.3f", result["model_physics_cost"]["decomposition"].asReal())); @@ -5021,7 +4964,7 @@ void LLFloaterModelPreview::handleModelPhysicsFeeReceived() childSetTextArg("streaming_breakdown", "[STR_MED]", llformat("%d", result["streaming_params"]["medium_lod"].asInteger())); childSetTextArg("streaming_breakdown", "[STR_LOW]", llformat("%d", result["streaming_params"]["low_lod"].asInteger())); childSetTextArg("streaming_breakdown", "[STR_LOWEST]", llformat("%d", result["streaming_params"]["lowest_lod"].asInteger())); -// + childSetVisible("upload_fee", true); childSetVisible("price_breakdown", true); mUploadBtn->setEnabled(isModelUploadAllowed()); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d6683f136b..36a1932835 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -8079,7 +8079,10 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ { if (!LLAppearanceMgr::instance().canAddWearables(ids) && canWearSelected(ids)) { - disabled_items.push_back(std::string("Wearable Add")); + disabled_items.push_back(std::string("Wearable And Object Wear")); + disabled_items.push_back(std::string("Wearable Add")); + disabled_items.push_back(std::string("Attach To")); + disabled_items.push_back(std::string("Attach To HUD")); } } disable_context_entries_if_present(menu, disabled_items); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 1e09cd1f2a..46472051ab 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -691,8 +691,14 @@ void LLOutfitsList::applyFilterToTab( bool LLOutfitsList::canWearSelected() { + if (!isAgentAvatarValid()) + { + return false; + } + uuid_vec_t selected_items; getSelectedItemsUUIDs(selected_items); + S32 nonreplacable_objects = 0; for (uuid_vec_t::const_iterator it = selected_items.begin(); it != selected_items.end(); ++it) { @@ -703,10 +709,21 @@ bool LLOutfitsList::canWearSelected() { return false; } + + const LLViewerInventoryItem* item = gInventory.getItem(id); + if (!item) + { + return false; + } + + if (item->getType() == LLAssetType::AT_OBJECT) + { + nonreplacable_objects++; + } } - // All selected items can be worn. - return true; + // All selected items can be worn. But do we have enough space for them? + return nonreplacable_objects == 0 || gAgentAvatarp->canAttachMoreObjects(nonreplacable_objects); } void LLOutfitsList::wearSelectedItems() diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 07840bb459..c70f9157dc 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1515,6 +1515,11 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) mColorSwatch->setFallbackImage(LLUI::getUIImage("locked_image.j2c") ); mColorSwatch->setValid(FALSE); } + LLRadioGroup* radio_mat_type = getChild("radio_material_type"); + if (radio_mat_type) + { + radio_mat_type->setSelectedIndex(0); + } getChildView("color trans")->setEnabled(FALSE); mCtrlRpt->setEnabled(FALSE); getChildView("tex gen")->setEnabled(FALSE); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 25a5a1c08e..c8936ed6ec 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -555,11 +555,12 @@ bool LLPanelGroupGeneral::createGroupCallback(const LLSD& notification, const LL // Yay! We are making a new group! U32 enrollment_fee = (mCtrlEnrollmentFee->get() ? (U32) mSpinEnrollmentFee->get() : 0); - + LLUUID insignia_id = mInsignia->getImageItemID().isNull() ? LLUUID::null : mInsignia->getImageAssetID(); + LLGroupMgr::getInstance()->sendCreateGroupRequest(mGroupNameEditor->getText(), mEditCharter->getText(), mCtrlShowInGroupList->get(), - mInsignia->getImageAssetID(), + insignia_id, enrollment_fee, mCtrlOpenEnrollment->get(), false, diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 81d7b04454..ef27ff51cf 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1035,11 +1035,11 @@ S64 LLTextureCache::initCache(ELLPath location, S64 max_size, BOOL texture_cache { llassert_always(getPending() == 0) ; //should not start accessing the texture cache before initialized. - S64 header_size = (max_size / 100) * 36; //0.36 * max_size - S64 max_entries = header_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE); + S64 entries_size = (max_size * 36) / 100; //0.36 * max_size + S64 max_entries = entries_size / (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE); sCacheMaxEntries = (S32)(llmin((S64)sCacheMaxEntries, max_entries)); - header_size = sCacheMaxEntries * TEXTURE_CACHE_ENTRY_SIZE; - max_size -= header_size; + entries_size = sCacheMaxEntries * (TEXTURE_CACHE_ENTRY_SIZE + TEXTURE_FAST_CACHE_ENTRY_SIZE); + max_size -= entries_size; if (sCacheMaxTexturesSize > 0) sCacheMaxTexturesSize = llmin(sCacheMaxTexturesSize, max_size); else diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 88dd120496..31e53dbc91 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -144,7 +144,7 @@ LLFloaterTexturePicker::~LLFloaterTexturePicker() void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/) { - if( mImageAssetID != image_id && mActive) + if( ((mImageAssetID != image_id) || mTentative) && mActive) { mNoCopyTextureSelected = FALSE; mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index df0f0d0c13..bb502ea7e1 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8775,8 +8775,11 @@ BOOL object_selected_and_point_valid(const LLSD& sdParam) /* BOOL object_is_wearable() { -// if (!object_selected_and_point_valid()) - if (!object_selected_and_point_valid(LLSD(0))) + if (!isAgentAvatarValid()) + { + return FALSE; + } + if (!object_selected_and_point_valid()) { return FALSE; } @@ -8784,17 +8787,7 @@ BOOL object_is_wearable() { return FALSE; } - LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); - iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) - { - LLSelectNode* node = *iter; - if (node->mPermissions->getOwner() == gAgent.getID()) - { - return TRUE; - } - } - return FALSE; + return gAgentAvatarp->canAttachMoreObjects(); } */ // [/RLVa:KB] @@ -11718,7 +11711,7 @@ void initialize_menus() enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); enable.add("Object.EnableTouch", boost::bind(&enable_object_touch, _1)); enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); -// enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid)); +// enable.add("Object.EnableWear", boost::bind(&object_is_wearable)); // [RLVa:KB] - Checked: 2010-03-16 (RLVa-1.2.0a) | Added: RLVa-1.2.0a enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid, _2)); // [/RLVa:KB] diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ff45b0fd57..d0d0419af6 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -279,6 +279,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mLastInterpUpdateSecs(0.f), mLastMessageUpdateSecs(0.f), mLatestRecvPacketID(0), + mRegionCrossExpire(0), mData(NULL), mAudioSourcep(NULL), mAudioGain(1.f), @@ -2704,8 +2705,7 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim new_pos.mV[VZ] = llmax(min_height, new_pos.mV[VZ]); // Check to see if it's going off the region - LLVector3 temp(new_pos); - static F64SecondsImplicit region_cross_expire = 0; // frame time we detected region crossing in + wait time + LLVector3 temp(new_pos.mV[VX], new_pos.mV[VY], 0.f); if (temp.clamp(0.f, mRegionp->getWidth())) { // Going off this region, so see if we might end up on another region LLVector3d old_pos_global = mRegionp->getPosGlobalFromRegion(getPositionRegion()); @@ -2758,28 +2758,28 @@ void LLViewerObject::interpolateLinearMotion(const F64SecondsImplicit& frame_tim // Note: theoretically we can find time from velocity, acceleration and // distance from border to new position, but it is not going to work // if 'phase_out' activates - if (region_cross_expire == 0) + if (mRegionCrossExpire == 0) { // Workaround: we can't accurately figure out time when we cross border // so just write down time 'after the fact', it is far from optimal in // case of lags, but for lags sMaxUpdateInterpolationTime will kick in first LL_DEBUGS("Interpolate") << "Predicted region crossing, new position " << new_pos << LL_ENDL; - region_cross_expire = frame_time + sMaxRegionCrossingInterpolationTime; + mRegionCrossExpire = frame_time + sMaxRegionCrossingInterpolationTime; } - else if (frame_time > region_cross_expire) + else if (frame_time > mRegionCrossExpire) { // Predicting crossing over 1s, stop motion // Stop motion LL_DEBUGS("Interpolate") << "Predicting region crossing for too long, stopping at " << new_pos << LL_ENDL; new_v.clear(); setAcceleration(LLVector3::zero); - region_cross_expire = 0; + mRegionCrossExpire = 0; } } } else { - region_cross_expire = 0; + mRegionCrossExpire = 0; } // Set new position and velocity diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 0453b21efb..40dc7b2297 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -789,6 +789,7 @@ protected: F64Seconds mLastInterpUpdateSecs; // Last update for purposes of interpolation F64Seconds mLastMessageUpdateSecs; // Last update from a message from the simulator TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator + F64SecondsImplicit mRegionCrossExpire; // frame time we detected region crossing in + wait time // extra data sent from the sim...currently only used for tree species info U8* mData; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 8563b07a0e..13c3b385db 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1875,7 +1875,7 @@ You are not allowed to terraform parcel [PARCEL]. name="CannotCopyWarning" type="alertmodal"> You do not have permission to copy the following items: -[ITEMS] +<nolink>[ITEMS]</nolink> and will lose it from your inventory if you give it away. Do you really want to offer these items? confirm fail -Copy failed because you lack permission to copy the object '[OBJ_NAME]'. +Copy failed because you lack permission to copy the object <nolink>'[OBJ_NAME]'</nolink>. fail -Copy failed because the object '[OBJ_NAME]' cannot be transferred to you. +Copy failed because the object <nolink>'[OBJ_NAME]'</nolink> cannot be transferred to you. fail -Copy failed because the object '[OBJ_NAME]' contributes to navmesh. +Copy failed because the object <nolink>'[OBJ_NAME]'</nolink> contributes to navmesh. fail -Cannot save '[OBJ_NAME]' to object contents because the object it was rezzed from no longer exists. +Cannot save <nolink>'[OBJ_NAME]'</nolink> to object contents because the object it was rezzed from no longer exists. fail -Cannot save '[OBJ_NAME]' to object contents because you do not have permission to modify the object '[DEST_NAME]'. +Cannot save <nolink>'[OBJ_NAME]'</nolink> to object contents because you do not have permission to modify the object <nolink>'[DEST_NAME]'</nolink>. fail -Cannot save '[OBJ_NAME]' back to inventory -- this operation has been disabled. +Cannot save <nolink>'[OBJ_NAME]'</nolink> back to inventory -- this operation has been disabled. fail -You cannot copy your selection because you do not have permission to copy the object '[OBJ_NAME]'. +You cannot copy your selection because you do not have permission to copy the object <nolink>'[OBJ_NAME]'</nolink>. fail -You cannot copy your selection because the object '[OBJ_NAME]' is not transferable. +You cannot copy your selection because the object <nolink>'[OBJ_NAME]'</nolink> is not transferable. fail -You cannot copy your selection because the object '[OBJ_NAME]' is not transferable. +You cannot copy your selection because the object <nolink>'[OBJ_NAME]'</nolink> is not transferable. fail -Removal of the object '[OBJ_NAME]' from the simulator is disallowed by the permissions system. +Removal of the object <nolink>'[OBJ_NAME]'</nolink> from the simulator is disallowed by the permissions system. fail -Cannot save your selection because you do not have permission to modify the object '[OBJ_NAME]'. +Cannot save your selection because you do not have permission to modify the object <nolink>'[OBJ_NAME]'</nolink>. fail -Cannot save your selection because the object '[OBJ_NAME]' is not copyable. +Cannot save your selection because the object <nolink>'[OBJ_NAME]'</nolink> is not copyable. fail -You cannot take your selection because you do not have permission to modify the object '[OBJ_NAME]'. +You cannot take your selection because you do not have permission to modify the object <nolink>'[OBJ_NAME]'</nolink>.