summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimagepreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r--indra/newview/llfloaterimagepreview.cpp45
1 files changed, 18 insertions, 27 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index d39824ee05..faa4f0ec99 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -214,13 +214,16 @@ void LLFloaterImagePreview::onPreviewTypeCommit(LLUICtrl* ctrl, void* userdata)
//-----------------------------------------------------------------------------
void LLFloaterImagePreview::clearAllPreviewTextures()
{
- mAvatarPreview->clearPreviewTexture("mHairMesh0");
- mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0");
- mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0");
- mAvatarPreview->clearPreviewTexture("mHeadMesh0");
- mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0");
- mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0");
- mAvatarPreview->clearPreviewTexture("mSkirtMesh0");
+ if (mAvatarPreview)
+ {
+ mAvatarPreview->clearPreviewTexture("mHairMesh0");
+ mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0");
+ mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0");
+ mAvatarPreview->clearPreviewTexture("mHeadMesh0");
+ mAvatarPreview->clearPreviewTexture("mUpperBodyMesh0");
+ mAvatarPreview->clearPreviewTexture("mLowerBodyMesh0");
+ mAvatarPreview->clearPreviewTexture("mSkirtMesh0");
+ }
}
//-----------------------------------------------------------------------------
@@ -614,6 +617,7 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTex
mCameraZoom = 1.f;
mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
+ mDummyAvatar->initInstance();
mDummyAvatar->createDrawable(&gPipeline);
mDummyAvatar->mIsDummy = TRUE;
mDummyAvatar->mSpecialRenderMode = 2;
@@ -671,11 +675,14 @@ void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const
//-----------------------------------------------------------------------------
void LLImagePreviewAvatar::clearPreviewTexture(const std::string& mesh_name)
{
- LLViewerJointMesh *mesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name);
- // clear out existing test mesh
- if (mesh)
+ if (mDummyAvatar)
{
- mesh->setTestTexture(0);
+ LLViewerJointMesh *mesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name);
+ // clear out existing test mesh
+ if (mesh)
+ {
+ mesh->setTestTexture(0);
+ }
}
}
@@ -796,27 +803,11 @@ LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLDynami
F32 const HIGHEST_LOD = 4.0f;
mVolume = new LLVolume(volume_params, HIGHEST_LOD);
-
- /*
- mDummyAvatar = new LLVOAvatar(LLUUID::null, LL_PCODE_LEGACY_AVATAR, gAgent.getRegion());
- mDummyAvatar->createDrawable(&gPipeline);
- mDummyAvatar->mIsDummy = TRUE;
- mDummyAvatar->mSpecialRenderMode = 2;
- mDummyAvatar->setPositionAgent(LLVector3::zero);
- mDummyAvatar->slamPosition();
- mDummyAvatar->updateJointLODs();
- mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
- gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance());
- mTextureName = 0;
- */
}
LLImagePreviewSculpted::~LLImagePreviewSculpted()
{
- /*
- mDummyAvatar->markDead();
- */
}