diff options
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index faa4f0ec99..26b969224e 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -56,7 +56,7 @@ #include "llvoavatar.h" #include "pipeline.h" #include "lluictrlfactory.h" -#include "llviewerimagelist.h" +#include "llviewertexturelist.h" #include "llstring.h" //static @@ -142,9 +142,6 @@ LLFloaterImagePreview::~LLFloaterImagePreview() clearAllPreviewTextures(); mRawImagep = NULL; - delete mAvatarPreview; - delete mSculptedPreview; - mImagep = NULL ; } @@ -252,7 +249,7 @@ void LLFloaterImagePreview::draw() } else { - mImagep = new LLImageGL(mRawImagep, FALSE) ; + mImagep = LLViewerTextureManager::getLocalTexture(mRawImagep.get(), FALSE) ; gGL.getTexUnit(0)->unbind(mImagep->getTarget()) ; gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mImagep->getTexName()); @@ -294,11 +291,11 @@ void LLFloaterImagePreview::draw() if (selected == 9) { - gGL.getTexUnit(0)->bind(mSculptedPreview->getTexture()); + gGL.getTexUnit(0)->bind(mSculptedPreview); } else { - gGL.getTexUnit(0)->bind(mAvatarPreview->getTexture()); + gGL.getTexUnit(0)->bind(mAvatarPreview); } gGL.begin( LLRender::QUADS ); @@ -606,7 +603,7 @@ void LLFloaterImagePreview::onMouseCaptureLostImagePreview(LLMouseHandler* handl //----------------------------------------------------------------------------- // LLImagePreviewAvatar //----------------------------------------------------------------------------- -LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) +LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) { mNeedsUpdate = TRUE; mTargetJoint = NULL; @@ -697,7 +694,7 @@ BOOL LLImagePreviewAvatar::render() glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); glLoadIdentity(); - glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f); + glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); @@ -706,7 +703,7 @@ BOOL LLImagePreviewAvatar::render() LLGLSUIDefault def; gGL.color4f(0.15f, 0.2f, 0.3f, 1.f); - gl_rect_2d_simple( mWidth, mHeight ); + gl_rect_2d_simple( mFullWidth, mFullHeight ); glMatrixMode(GL_PROJECTION); gGL.popMatrix(); @@ -728,9 +725,9 @@ BOOL LLImagePreviewAvatar::render() stop_glerror(); - LLViewerCamera::getInstance()->setAspect((F32)mWidth / mHeight); + LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / mFullHeight); LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); - LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE); LLVertexBuffer::unbind(); avatarp->updateLOD(); @@ -788,7 +785,7 @@ void LLImagePreviewAvatar::pan(F32 right, F32 up) // LLImagePreviewSculpted //----------------------------------------------------------------------------- -LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) +LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) { mNeedsUpdate = TRUE; mCameraDistance = 0.f; @@ -871,7 +868,7 @@ BOOL LLImagePreviewSculpted::render() glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); glLoadIdentity(); - glOrtho(0.0f, mWidth, 0.0f, mHeight, -1.0f, 1.0f); + glOrtho(0.0f, mFullWidth, 0.0f, mFullHeight, -1.0f, 1.0f); glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); @@ -879,7 +876,7 @@ BOOL LLImagePreviewSculpted::render() gGL.color4f(0.15f, 0.2f, 0.3f, 1.f); - gl_rect_2d_simple( mWidth, mHeight ); + gl_rect_2d_simple( mFullWidth, mFullHeight ); glMatrixMode(GL_PROJECTION); gGL.popMatrix(); @@ -902,9 +899,9 @@ BOOL LLImagePreviewSculpted::render() stop_glerror(); - LLViewerCamera::getInstance()->setAspect((F32) mWidth / mHeight); + LLViewerCamera::getInstance()->setAspect((F32) mFullWidth / mFullHeight); LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); - LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE); const LLVolumeFace &vf = mVolume->getVolumeFace(0); U32 num_indices = vf.mIndices.size(); |