summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimagepreview.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-11-19 17:59:55 -0500
committerOz Linden <oz@lindenlab.com>2013-11-19 17:59:55 -0500
commit0031e9a97be1bf6e9fe773c23506494d09ce91ae (patch)
tree220f195c82174b7cc8e94dceb2553e59fe5837a5 /indra/newview/llfloaterimagepreview.cpp
parentb7edc965bc77ab21e9a1e3f6b424299a50053529 (diff)
parentebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff)
merge up to 3.6.10-release; some of the storm-68 changes lost
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llfloaterimagepreview.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 92ee8ddac6..52e678ce24 100644..100755
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -593,7 +593,7 @@ S8 LLImagePreviewAvatar::getType() const
void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male)
{
- mTargetJoint = mDummyAvatar->mRoot.findJoint(joint_name);
+ mTargetJoint = mDummyAvatar->mRoot->findJoint(joint_name);
// clear out existing test mesh
if (mTargetMesh)
{
@@ -612,9 +612,9 @@ void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const
mDummyAvatar->updateVisualParams();
mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable);
}
- mDummyAvatar->mRoot.setVisible(FALSE, TRUE);
+ mDummyAvatar->mRoot->setVisible(FALSE, TRUE);
- mTargetMesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name);
+ mTargetMesh = dynamic_cast<LLViewerJointMesh*>(mDummyAvatar->mRoot->findJoint(mesh_name));
mTargetMesh->setTestTexture(mTextureName);
mTargetMesh->setVisible(TRUE, FALSE);
mCameraDistance = distance;
@@ -631,7 +631,7 @@ void LLImagePreviewAvatar::clearPreviewTexture(const std::string& mesh_name)
{
if (mDummyAvatar)
{
- LLViewerJointMesh *mesh = (LLViewerJointMesh*)mDummyAvatar->mRoot.findJoint(mesh_name);
+ LLViewerJointMesh *mesh = dynamic_cast<LLViewerJointMesh*>(mDummyAvatar->mRoot->findJoint(mesh_name));
// clear out existing test mesh
if (mesh)
{
@@ -704,9 +704,13 @@ BOOL LLImagePreviewAvatar::render()
// make sure alpha=0 shows avatar material color
LLGLDisable no_blend(GL_BLEND);
- LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool();
- gPipeline.enableLightsPreview();
- avatarPoolp->renderAvatars(avatarp); // renders only one avatar
+ LLFace* face = avatarp->mDrawable->getFace(0);
+ if (face)
+ {
+ LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)face->getPool();
+ gPipeline.enableLightsPreview();
+ avatarPoolp->renderAvatars(avatarp); // renders only one avatar
+ }
}
gGL.popUIMatrix();
@@ -897,11 +901,13 @@ BOOL LLImagePreviewSculpted::render()
{
gObjectPreviewProgram.bind();
}
+ gPipeline.enableLightsPreview();
+
gGL.pushMatrix();
const F32 SCALE = 1.25f;
gGL.scalef(SCALE, SCALE, SCALE);
const F32 BRIGHTNESS = 0.9f;
- gGL.color3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
+ gGL.diffuseColor3f(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS);
mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD0);
mVertexBuffer->draw(LLRender::TRIANGLES, num_indices, 0);