Merge viewer-neko

meow-7.2.2
Ansariel 2019-01-03 19:07:09 +01:00
commit f9ec853f4a
16 changed files with 136 additions and 182 deletions

View File

@ -257,6 +257,8 @@ Benja Kepler
VWR-746
Benjamin Bigdipper
Beth Walcher
Beq Janus
SL-10288
Bezilon Kasei
Biancaluce Robbiani
CT-225

View File

@ -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;

View File

@ -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;

View File

@ -125,17 +125,11 @@ BOOL LLViewerDynamicTexture::render()
//-----------------------------------------------------------------------------
void LLViewerDynamicTexture::preRender(BOOL clear_depth)
{
// <FS:Beq> 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<S32>(gPipeline.mPhysicsDisplay.getWidth()));
llassert(mFullHeight <= static_cast<S32>(gPipeline.mPhysicsDisplay.getHeight()));
// if (gGLManager.mHasFramebufferObject && gPipeline.mWaterDis.isComplete() && !gGLManager.mIsATI)
if (gGLManager.mHasFramebufferObject && gPipeline.mPhysicsDisplay.isComplete() && !gGLManager.mIsATI)
// </FS:Beq>
{ //using offscreen render target, just use the bottom left corner
mOrigin.set(0, 0);
}
@ -221,12 +215,10 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
{
return TRUE;
}
// <FS:Beq> 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();
}
// </FS:Beq>
@ -265,10 +257,7 @@ BOOL LLViewerDynamicTexture::updateAllInstances()
if (use_fbo)
{
// <FS:Beq> changes to support higher resolution rendering in the preview
// gPipeline.mWaterDis.flush();
gPipeline.mPhysicsDisplay.flush();
// </FS:Beq>
}
return ret;

View File

@ -105,6 +105,8 @@ LLFilePicker::LLFilePicker()
mOFN.lpfnHook = NULL;
mOFN.lpTemplateName = NULL;
mFilesW[0] = '\0';
#elif LL_DARWIN
mPickOptions = 0;
#endif
}

View File

@ -465,11 +465,8 @@ void LLFloaterModelPreview::initModelPreview()
{
delete mModelPreview;
}
// <FS:Beq> 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 );
// </FS:Beq>
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)
{
// <FS>
//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()];
// </FS>
mModelPreview->refresh();
}
}
@ -707,7 +714,6 @@ void LLFloaterModelPreview::onLODParamCommit(S32 lod, bool enforce_tri_limit)
}
}
// <FS:Beq> 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<LLView>("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 ) // <FS:Beq>
, 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()
{
// <FS:Beq> 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
};
// </FS:Beq>
assert_main_thread();
U32 has_physics_error{ PhysicsError::NONE }; // <FS:Beq> 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<S32> tris[LLModel::NUM_LODS];
std::vector<S32> verts[LLModel::NUM_LODS];
@ -3041,38 +3048,25 @@ void LLModelPreview::updateStatusMessages()
{
mMaxTriangleLimit = total_tris[LLModel::LOD_HIGH];
}
// <FS:Beq> 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)// <FS:Beq> 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)// <FS:Beq> 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; )// <FS:Beq> 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];
// <FS:Beq> 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;// <FS:Beq> 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;// <FS:Beq> make has_degenerate a member
mHasDegenerate = true;
}
}
k += 3;
// </FS:Beq>
}
}
}
}
}
// <FS:Beq> flag degenerates here rather than deferring to a MAV error later
// flag degenerates here rather than deferring to a MAV error later
// <FS>
//mFMP->childSetVisible("physics_status_message_text", mHasDegenerate); //display or clear
//auto degenerateIcon = mFMP->getChild<LLIconCtrl>("physics_status_message_icon");
//degenerateIcon->setVisible(mHasDegenerate);
// </FS>
if (mHasDegenerate)
{
has_physics_error |= PhysicsError::DEGENERATE;
// <FS>
//mFMP->childSetValue("physics_status_message_text", mFMP->getString("phys_status_degenerate_triangles"));
//LLUIImagePtr img = LLUI::getUIImage("ModelImport_Status_Error");
//degenerateIcon->setImage(img);
// </FS>
}
// </FS:Beq>
mFMP->childSetTextArg("submeshes_info", "[SUBMESHES]", llformat("%d", total_submeshes[LLModel::LOD_HIGH]));
@ -3243,16 +3245,16 @@ void LLModelPreview::updateStatusMessages()
}
// <FS:Beq> 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<LLIconCtrl>("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<LLIconCtrl>("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()
}
}
// <FS:Beq> 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
// </FS:Beq>
{
mFMP->childDisable("ok_btn");
mFMP->childDisable("calculate_btn");
@ -3414,14 +3413,14 @@ void LLModelPreview::updateStatusMessages()
mViewOption["show_physics"] = true;
fmp->childSetValue("show_physics", true);
}
// <FS:Beq> handle hiding of hull only explode slider
//else
//{
// fmp->disableViewOption("show_physics");
// mViewOption["show_physics"] = false;
// fmp->childSetValue("show_physics", false);
//}
// <FS:Beq> 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"]; // <FS:Beq> Add UV guide overlay in mesh preview
// <FS:Beq> Extra configurability, to be exposed later as controls?
// Extra configurability, to be exposed later as controls?
static LLCachedControl<LLColor4> canvas_col(gSavedSettings, "MeshPreviewCanvasColor");
static LLCachedControl<LLColor4> edge_col(gSavedSettings, "MeshPreviewEdgeColor");
static LLCachedControl<LLColor4> base_col(gSavedSettings, "MeshPreviewBaseColor");
@ -4022,16 +4021,12 @@ BOOL LLModelPreview::render()
static LLCachedControl<LLColor4> deg_fill_col(gSavedSettings, "MeshPreviewDegenerateFillColor");
static LLCachedControl<F32> deg_edge_width(gSavedSettings, "MeshPreviewDegenerateEdgeWidth");
static LLCachedControl<F32> deg_point_size(gSavedSettings, "MeshPreviewDegeneratePointSize");
// </FS:Beq>
S32 width = getWidth();
S32 height = getHeight();
LLGLSUIDefault def;
LLGLDisable no_blend(GL_BLEND);
// <FS:Beq> Clean up render of mesh preview
// LLGLEnable blend(GL_BLEND);
// gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
// </FS:Beq>
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();
// <FS:Beq> uploader improvements
//gGL.color4f(0.169f, 0.169f, 0.169f, 1.f);
gGL.color4fv(static_cast<LLColor4>(canvas_col).mV);
gl_rect_2d_simple( width, height );
@ -4201,11 +4195,7 @@ BOOL LLModelPreview::render()
stop_glerror();
gGL.pushMatrix();
// <FS:Beq> mesh uploader improvements configurable brightness
//const F32 BRIGHTNESS = 0.9f;
//gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
gGL.color4fv(edge_col().mV);
// </FS:Beq>
const U32 type_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0;
@ -4287,12 +4277,8 @@ BOOL LLModelPreview::render()
mTextureSet.insert(tex);
}
}
// <FS:Beq> improved mesh uploader
// else
// {
// gGL.diffuseColor4f(1,1,1,1);
// }
}
// <FS:Beq> improved mesh uploader
else if (uv_guide)
{
if(mUVGuideTexture)
@ -4305,19 +4291,15 @@ BOOL LLModelPreview::render()
gGL.diffuseColor4fv(static_cast<LLColor4>(base_col).mV);
}
// </FS:Beq>
else
{
// gGL.diffuseColor4f(1,1,1,1);
gGL.diffuseColor4fv(static_cast<LLColor4>(base_col).mV);
// </FS:Beq>
}
buffer->drawRange(LLRender::TRIANGLES, 0, buffer->getNumVerts()-1, buffer->getNumIndices(), 0);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
// <FS:Beq> improved mesh uploader
//gGL.diffuseColor3f(0.4f, 0.4f, 0.4f);
gGL.diffuseColor4fv(static_cast<LLColor4>(edge_col).mV);
// </FS:Beq>
if (edges)
{
glLineWidth(edge_width);
@ -4332,25 +4314,10 @@ BOOL LLModelPreview::render()
if (physics)
{
// <FS:Beq> 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);
// </FS:Beq>
glClear(GL_DEPTH_BUFFER_BIT);
//<FS:Beq> refactor to remove silly variable names
// for (U32 i = 0; i < 2; i++)
for (U32 pass = 0; pass < 2; pass++)
//</FS:Beq>
{
//<FS:Beq> refactor to remove silly variable names
//if (i == 0)
if (pass == 0)
//</FS:Beq>
{ //depth only pass
gGL.setColorMask(false, false);
}
@ -4360,10 +4327,7 @@ BOOL LLModelPreview::render()
}
//enable alpha blending on second pass but not first pass
//<FS:Beq> refactor to remove silly variable names
//LLGLState blend(GL_BLEND, i);
LLGLState blend(GL_BLEND, pass);
//</FS:Beq>
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
@ -4467,16 +4431,11 @@ BOOL LLModelPreview::render()
gGL.popMatrix();
}
//<FS:Beq> 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)
//</FS:Beq>
{
glLineWidth(deg_edge_width);
glPointSize(deg_point_size);
// <FS:Beq> 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;
//<FS:Beq> 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];
//</FS:Beq>
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;
//<FS:Beq> 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()
} // </FS:ND>
buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0);
// <FS:Beq> 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);
}
// </FS:Beq>
}
}
}
@ -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;
// <FS:Beq> add configurable zoom TODO: stop clamping in render
// mCameraZoom = llclamp(new_zoom, 1.f, 10.f);
// TODO: stop clamping in render
static LLCachedControl<F32> zoom_limit(gSavedSettings, "MeshPreviewZoomLimit");
mCameraZoom = llclamp(new_zoom, 1.f, zoom_limit());
// </FS:Beq>
}
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);
// <FS:Beq> 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);
// </FS:Beq>
}
}
@ -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()));
//<FS:Beq> 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()));
//</FS:Beq>
childSetVisible("upload_fee", true);
childSetVisible("price_breakdown", true);
mUploadBtn->setEnabled(isModelUploadAllowed());

View File

@ -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);

View File

@ -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()

View File

@ -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<LLRadioGroup>("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);

View File

@ -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,

View File

@ -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

View File

@ -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?

View File

@ -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]

View File

@ -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

View File

@ -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;

View File

@ -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]
&lt;nolink&gt;[ITEMS]&lt;/nolink&gt;
and will lose it from your inventory if you give it away. Do you really want to offer these items?
<tag>confirm</tag>
<usetemplate
@ -10675,7 +10675,7 @@ You can't create trees and grass on land you don't own.
name="NoCopyPermsNoObject"
type="notify">
<tag>fail</tag>
Copy failed because you lack permission to copy the object '[OBJ_NAME]'.
Copy failed because you lack permission to copy the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt;.
</notification>
<notification
@ -10683,7 +10683,7 @@ Copy failed because you lack permission to copy the object '[OBJ_NAME]'.
name="NoTransPermsNoObject"
type="notify">
<tag>fail</tag>
Copy failed because the object '[OBJ_NAME]' cannot be transferred to you.
Copy failed because the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; cannot be transferred to you.
</notification>
<notification
@ -10691,7 +10691,7 @@ Copy failed because the object '[OBJ_NAME]' cannot be transferred to you.
name="AddToNavMeshNoCopy"
type="notify">
<tag>fail</tag>
Copy failed because the object '[OBJ_NAME]' contributes to navmesh.
Copy failed because the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; contributes to navmesh.
</notification>
<notification
@ -10815,7 +10815,7 @@ Save Back To Inventory has been disabled.
name="NoExistNoSaveToContents"
type="notify">
<tag>fail</tag>
Cannot save '[OBJ_NAME]' to object contents because the object it was rezzed from no longer exists.
Cannot save &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; to object contents because the object it was rezzed from no longer exists.
</notification>
<notification
@ -10823,7 +10823,7 @@ Cannot save '[OBJ_NAME]' to object contents because the object it was rezzed fro
name="NoModNoSaveToContents"
type="notify">
<tag>fail</tag>
Cannot save '[OBJ_NAME]' to object contents because you do not have permission to modify the object '[DEST_NAME]'.
Cannot save &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; to object contents because you do not have permission to modify the object &lt;nolink&gt;'[DEST_NAME]'&lt;/nolink&gt;.
</notification>
<notification
@ -10831,7 +10831,7 @@ Cannot save '[OBJ_NAME]' to object contents because you do not have permission t
name="NoSaveBackToInvDisabled"
type="notify">
<tag>fail</tag>
Cannot save '[OBJ_NAME]' back to inventory -- this operation has been disabled.
Cannot save &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; back to inventory -- this operation has been disabled.
</notification>
<notification
@ -10839,7 +10839,7 @@ Cannot save '[OBJ_NAME]' back to inventory -- this operation has been disabled.
name="NoCopyNoSelCopy"
type="notify">
<tag>fail</tag>
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 &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt;.
</notification>
<notification
@ -10847,7 +10847,7 @@ You cannot copy your selection because you do not have permission to copy the ob
name="NoTransNoSelCopy"
type="notify">
<tag>fail</tag>
You cannot copy your selection because the object '[OBJ_NAME]' is not transferable.
You cannot copy your selection because the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; is not transferable.
</notification>
<notification
@ -10855,7 +10855,7 @@ You cannot copy your selection because the object '[OBJ_NAME]' is not transferab
name="NoTransNoCopy"
type="notify">
<tag>fail</tag>
You cannot copy your selection because the object '[OBJ_NAME]' is not transferable.
You cannot copy your selection because the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; is not transferable.
</notification>
<notification
@ -10863,7 +10863,7 @@ You cannot copy your selection because the object '[OBJ_NAME]' is not transferab
name="NoPermsNoRemoval"
type="notify">
<tag>fail</tag>
Removal of the object '[OBJ_NAME]' from the simulator is disallowed by the permissions system.
Removal of the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; from the simulator is disallowed by the permissions system.
</notification>
<notification
@ -10871,7 +10871,7 @@ Removal of the object '[OBJ_NAME]' from the simulator is disallowed by the permi
name="NoModNoSaveSelection"
type="notify">
<tag>fail</tag>
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 &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt;.
</notification>
<notification
@ -10879,7 +10879,7 @@ Cannot save your selection because you do not have permission to modify the obje
name="NoCopyNoSaveSelection"
type="notify">
<tag>fail</tag>
Cannot save your selection because the object '[OBJ_NAME]' is not copyable.
Cannot save your selection because the object &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt; is not copyable.
</notification>
<notification
@ -10887,7 +10887,7 @@ Cannot save your selection because the object '[OBJ_NAME]' is not copyable.
name="NoModNoTaking"
type="notify">
<tag>fail</tag>
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 &lt;nolink&gt;'[OBJ_NAME]'&lt;/nolink&gt;.
</notification>
<notification