summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index d356e22072..ff687386de 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -381,8 +381,6 @@ BOOL LLFloaterModelPreview::postBuild()
LLFloaterModelPreview::~LLFloaterModelPreview()
{
sInstance = NULL;
-
- const LLModelLoader *model_loader = mModelPreview->mModelLoader;
if ( mModelPreview && mModelPreview->getResetJointFlag() )
{
@@ -576,7 +574,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));
@@ -1282,6 +1287,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);
@@ -2499,7 +2510,7 @@ U32 LLModelPreview::calcResourceCost()
if (mFMP && mModelLoader)
{
- if ( getLoadState() != LLModelLoader::ERROR_PARSING )
+ if ( getLoadState() < LLModelLoader::ERROR_PARSING )
{
mFMP->childEnable("ok_btn");
}
@@ -2853,7 +2864,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");
}
@@ -2935,8 +2946,14 @@ void LLModelPreview::loadModelCallback(S32 lod)
LLMutexLock lock(this);
if (!mModelLoader)
{
+ mLoading = false ;
return;
}
+ if(getLoadState() >= LLModelLoader::ERROR_PARSING)
+ {
+ mLoading = false ;
+ return ;
+ }
mModelLoader->loadTextures() ;
@@ -3672,7 +3689,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();