summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-04-01 10:58:34 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-04-01 10:58:34 -0600
commitf0c70a4ee3739c34b1da2ce384bfcf420f8c6c72 (patch)
tree630e7c3f7a02224324ef2745e4bf7c06f04559b6 /indra/newview
parent3a08499572250b46d061106298e2d2777276efc1 (diff)
fix for SH-1176: A Mesh That Crashes Client on Upload Attempt (due to triangle number overflowing)
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp27
-rw-r--r--indra/newview/llfloatermodelpreview.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_model_preview.xml1
-rw-r--r--indra/newview/skins/default/xui/en/floater_model_wizard.xml1
4 files changed, 26 insertions, 5 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 21c9fca164..f2fa891bca 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -579,7 +579,14 @@ void LLFloaterModelPreview::draw()
if (!mModelPreview->mLoading)
{
- childSetTextArg("status", "[STATUS]", getString("status_idle"));
+ if ( mModelPreview->getLoadState() > LLModelLoader::ERROR_PARSING )
+ {
+ childSetTextArg("status", "[STATUS]", getString(LLModel::getStatusString(mModelPreview->getLoadState() - LLModelLoader::ERROR_PARSING)));
+ }
+ else
+ {
+ childSetTextArg("status", "[STATUS]", getString("status_idle"));
+ }
}
childSetTextArg("prim_cost", "[PRIM_COST]", llformat("%d", mModelPreview->mResourceCost));
@@ -1285,6 +1292,12 @@ bool LLModelLoader::doLoadModel()
{
LLPointer<LLModel> model = LLModel::loadModelFromDomMesh(mesh);
+ if(model->getStatus() != LLModel::NO_ERRORS)
+ {
+ setLoadState(ERROR_PARSING + model->getStatus()) ;
+ return true ; //abort
+ }
+
if (model.notNull() && validate_model(model))
{
mModelList.push_back(model);
@@ -2502,7 +2515,7 @@ U32 LLModelPreview::calcResourceCost()
if (mFMP && mModelLoader)
{
- if ( getLoadState() != LLModelLoader::ERROR_PARSING )
+ if ( getLoadState() < LLModelLoader::ERROR_PARSING )
{
mFMP->childEnable("ok_btn");
}
@@ -2856,7 +2869,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
setPreviewLOD(lod);
- if ( getLoadState() == LLModelLoader::ERROR_PARSING )
+ if ( getLoadState() >= LLModelLoader::ERROR_PARSING )
{
mFMP->childDisable("ok_btn");
}
@@ -2938,8 +2951,14 @@ void LLModelPreview::loadModelCallback(S32 lod)
LLMutexLock lock(this);
if (!mModelLoader)
{
+ mLoading = false ;
return;
}
+ if(getLoadState() >= LLModelLoader::ERROR_PARSING)
+ {
+ mLoading = false ;
+ return ;
+ }
mModelLoader->loadTextures() ;
@@ -3675,7 +3694,7 @@ void LLModelPreview::updateStatusMessages()
}
}
- bool errorStateFromLoader = getLoadState() == LLModelLoader::ERROR_PARSING ? true : false;
+ bool errorStateFromLoader = getLoadState() >= LLModelLoader::ERROR_PARSING ? true : false;
bool skinAndRigOk = true;
bool uploadingSkin = mFMP->childGetValue("upload_skin").asBoolean();
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 3fcc1b3e57..dabe3c613d 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -66,7 +66,7 @@ public:
GENERATING_VERTEX_BUFFERS,
GENERATING_LOD,
DONE,
- ERROR_PARSING, //basically loading failed
+ ERROR_PARSING //basically loading failed
} eLoadState;
U32 mState;
diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml
index 0053be4f67..7be6165a0d 100644
--- a/indra/newview/skins/default/xui/en/floater_model_preview.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml
@@ -6,6 +6,7 @@
<string name="status_idle">Idle</string>
<string name="status_reading_file">Loading...</string>
<string name="status_generating_meshes">Generating Meshes...</string>
+ <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
<string name="high">High</string>
<string name="medium">Medium</string>
<string name="low">Low</string>
diff --git a/indra/newview/skins/default/xui/en/floater_model_wizard.xml b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
index 93740007ee..54ef4695f0 100644
--- a/indra/newview/skins/default/xui/en/floater_model_wizard.xml
+++ b/indra/newview/skins/default/xui/en/floater_model_wizard.xml
@@ -1026,6 +1026,7 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
<string name="status_idle">Idle</string>
<string name="status_reading_file">Loading...</string>
<string name="status_generating_meshes">Generating Meshes...</string>
+ <string name="status_vertex_number_overflow">Error: Vertex number is more than 65534, aborted!</string>
<string name="high">High</string>
<string name="medium">Medium</string>
<string name="low">Low</string>