diff options
Diffstat (limited to 'indra/newview/llfloaterimagepreview.cpp')
-rw-r--r-- | indra/newview/llfloaterimagepreview.cpp | 87 |
1 files changed, 44 insertions, 43 deletions
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 2a5106f79e..902f261596 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -87,11 +87,11 @@ LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : //----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- -BOOL LLFloaterImagePreview::postBuild() +bool LLFloaterImagePreview::postBuild() { if (!LLFloaterNameDesc::postBuild()) { - return FALSE; + return false; } LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); @@ -107,12 +107,12 @@ BOOL LLFloaterImagePreview::postBuild() PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); - getChildView("bad_image_text")->setVisible(FALSE); + getChildView("bad_image_text")->setVisible(false); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { mAvatarPreview = new LLImagePreviewAvatar(256, 256); - mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, FALSE); + mAvatarPreview->setPreviewTarget("mPelvis", "mUpperBodyMesh0", mRawImagep, 2.f, false); mSculptedPreview = new LLImagePreviewSculpted(256, 256); mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); @@ -122,7 +122,7 @@ BOOL LLFloaterImagePreview::postBuild() // We want "lossless_check" to be unchecked when it is disabled, regardless of // LosslessJ2CUpload state, so only assign control when enabling checkbox LLCheckBoxCtrl* check_box = getChild<LLCheckBoxCtrl>("lossless_check"); - check_box->setEnabled(TRUE); + check_box->setEnabled(true); check_box->setControlVariable(gSavedSettings.getControl("LosslessJ2CUpload")); } } @@ -130,9 +130,9 @@ BOOL LLFloaterImagePreview::postBuild() { mAvatarPreview = NULL; mSculptedPreview = NULL; - getChildView("bad_image_text")->setVisible(TRUE); - getChildView("clothing_type_combo")->setEnabled(FALSE); - getChildView("ok_btn")->setEnabled(FALSE); + getChildView("bad_image_text")->setVisible(true); + getChildView("clothing_type_combo")->setEnabled(false); + getChildView("ok_btn")->setEnabled(false); if(!mImageLoadError.empty()) { @@ -142,7 +142,7 @@ BOOL LLFloaterImagePreview::postBuild() getChild<LLUICtrl>("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); - return TRUE; + return true; } @@ -191,28 +191,28 @@ void LLFloaterImagePreview::onPreviewTypeCommit(LLUICtrl* ctrl, void* userdata) case 0: break; case 1: - fp->mAvatarPreview->setPreviewTarget("mSkull", "mHairMesh0", fp->mRawImagep, 0.4f, FALSE); + fp->mAvatarPreview->setPreviewTarget("mSkull", "mHairMesh0", fp->mRawImagep, 0.4f, false); break; case 2: - fp->mAvatarPreview->setPreviewTarget("mSkull", "mHeadMesh0", fp->mRawImagep, 0.4f, FALSE); + fp->mAvatarPreview->setPreviewTarget("mSkull", "mHeadMesh0", fp->mRawImagep, 0.4f, false); break; case 3: - fp->mAvatarPreview->setPreviewTarget("mChest", "mUpperBodyMesh0", fp->mRawImagep, 1.0f, FALSE); + fp->mAvatarPreview->setPreviewTarget("mChest", "mUpperBodyMesh0", fp->mRawImagep, 1.0f, false); break; case 4: - fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mLowerBodyMesh0", fp->mRawImagep, 1.2f, FALSE); + fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mLowerBodyMesh0", fp->mRawImagep, 1.2f, false); break; case 5: - fp->mAvatarPreview->setPreviewTarget("mSkull", "mHeadMesh0", fp->mRawImagep, 0.4f, TRUE); + fp->mAvatarPreview->setPreviewTarget("mSkull", "mHeadMesh0", fp->mRawImagep, 0.4f, true); break; case 6: - fp->mAvatarPreview->setPreviewTarget("mChest", "mUpperBodyMesh0", fp->mRawImagep, 1.2f, TRUE); + fp->mAvatarPreview->setPreviewTarget("mChest", "mUpperBodyMesh0", fp->mRawImagep, 1.2f, true); break; case 7: - fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mLowerBodyMesh0", fp->mRawImagep, 1.2f, TRUE); + fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mLowerBodyMesh0", fp->mRawImagep, 1.2f, true); break; case 8: - fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mSkirtMesh0", fp->mRawImagep, 1.3f, FALSE); + fp->mAvatarPreview->setPreviewTarget("mKneeLeft", "mSkirtMesh0", fp->mRawImagep, 1.3f, false); break; case 9: fp->mSculptedPreview->setPreviewTarget(fp->mRawImagep, 2.0f); @@ -268,7 +268,7 @@ void LLFloaterImagePreview::draw() } else { - mImagep = LLViewerTextureManager::getLocalTexture(mRawImagep.get(), FALSE) ; + mImagep = LLViewerTextureManager::getLocalTexture(mRawImagep.get(), false) ; gGL.getTexUnit(0)->unbind(mImagep->getTarget()) ; gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, mImagep->getTexName()); @@ -397,7 +397,7 @@ bool LLFloaterImagePreview::loadImage(const std::string& src_filename) //----------------------------------------------------------------------------- // handleMouseDown() //----------------------------------------------------------------------------- -BOOL LLFloaterImagePreview::handleMouseDown(S32 x, S32 y, MASK mask) +bool LLFloaterImagePreview::handleMouseDown(S32 x, S32 y, MASK mask) { if (mPreviewRect.pointInRect(x, y)) { @@ -406,7 +406,7 @@ BOOL LLFloaterImagePreview::handleMouseDown(S32 x, S32 y, MASK mask) gViewerWindow->hideCursor(); mLastMouseX = x; mLastMouseY = y; - return TRUE; + return true; } return LLFloater::handleMouseDown(x, y, mask); @@ -415,9 +415,9 @@ BOOL LLFloaterImagePreview::handleMouseDown(S32 x, S32 y, MASK mask) //----------------------------------------------------------------------------- // handleMouseUp() //----------------------------------------------------------------------------- -BOOL LLFloaterImagePreview::handleMouseUp(S32 x, S32 y, MASK mask) +bool LLFloaterImagePreview::handleMouseUp(S32 x, S32 y, MASK mask) { - gFocusMgr.setMouseCapture(FALSE); + gFocusMgr.setMouseCapture(nullptr); gViewerWindow->showCursor(); return LLFloater::handleMouseUp(x, y, mask); } @@ -425,7 +425,7 @@ BOOL LLFloaterImagePreview::handleMouseUp(S32 x, S32 y, MASK mask) //----------------------------------------------------------------------------- // handleHover() //----------------------------------------------------------------------------- -BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask) +bool LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask) { MASK local_mask = mask & ~MASK_ALT; @@ -539,13 +539,13 @@ BOOL LLFloaterImagePreview::handleHover(S32 x, S32 y, MASK mask) gViewerWindow->setCursor(UI_CURSOR_TOOLZOOMIN); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // handleScrollWheel() //----------------------------------------------------------------------------- -BOOL LLFloaterImagePreview::handleScrollWheel(S32 x, S32 y, S32 clicks) +bool LLFloaterImagePreview::handleScrollWheel(S32 x, S32 y, S32 clicks) { if (mPreviewRect.pointInRect(x, y) && mAvatarPreview) { @@ -556,7 +556,7 @@ BOOL LLFloaterImagePreview::handleScrollWheel(S32 x, S32 y, S32 clicks) mSculptedPreview->refresh(); } - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -572,9 +572,9 @@ void LLFloaterImagePreview::onMouseCaptureLostImagePreview(LLMouseHandler* handl //----------------------------------------------------------------------------- // LLImagePreviewAvatar //----------------------------------------------------------------------------- -LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) +LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, false) { - mNeedsUpdate = TRUE; + mNeedsUpdate = true; mTargetJoint = NULL; mTargetMesh = NULL; mCameraDistance = 0.f; @@ -600,7 +600,7 @@ S8 LLImagePreviewAvatar::getType() const return LLViewerDynamicTexture::LL_IMAGE_PREVIEW_AVATAR ; } -void LLImagePreviewAvatar::setPreviewTarget(const std::string& joint_name, const std::string& mesh_name, LLImageRaw* imagep, F32 distance, BOOL male) +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); // clear out existing test mesh @@ -621,11 +621,11 @@ 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 = dynamic_cast<LLViewerJointMesh*>(mDummyAvatar->mRoot->findJoint(mesh_name)); mTargetMesh->setTestTexture(mTextureName); - mTargetMesh->setVisible(TRUE, FALSE); + mTargetMesh->setVisible(true, false); mCameraDistance = distance; mCameraZoom = 1.f; mCameraPitch = 0.f; @@ -652,9 +652,9 @@ void LLImagePreviewAvatar::clearPreviewTexture(const std::string& mesh_name) //----------------------------------------------------------------------------- // update() //----------------------------------------------------------------------------- -BOOL LLImagePreviewAvatar::render() +bool LLImagePreviewAvatar::render() { - mNeedsUpdate = FALSE; + mNeedsUpdate = false; LLVOAvatar* avatarp = mDummyAvatar; gGL.pushUIMatrix(); @@ -699,7 +699,7 @@ BOOL LLImagePreviewAvatar::render() LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / mFullHeight); LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); - LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE); + LLViewerCamera::getInstance()->setPerspective(false, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, false); LLVertexBuffer::unbind(); avatarp->updateLOD(); @@ -721,7 +721,7 @@ BOOL LLImagePreviewAvatar::render() gGL.popUIMatrix(); gGL.color4f(1,1,1,1); - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -729,7 +729,7 @@ BOOL LLImagePreviewAvatar::render() //----------------------------------------------------------------------------- void LLImagePreviewAvatar::refresh() { - mNeedsUpdate = TRUE; + mNeedsUpdate = true; } //----------------------------------------------------------------------------- @@ -761,9 +761,9 @@ void LLImagePreviewAvatar::pan(F32 right, F32 up) // LLImagePreviewSculpted //----------------------------------------------------------------------------- -LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) +LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, false) { - mNeedsUpdate = TRUE; + mNeedsUpdate = true; mCameraDistance = 0.f; mCameraYaw = 0.f; mCameraPitch = 0.f; @@ -799,6 +799,7 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) if (imagep) { + LLImageDataSharedLock lock(imagep); mVolume->sculpt(imagep->getWidth(), imagep->getHeight(), imagep->getComponents(), imagep->getData(), 0, false); } @@ -855,9 +856,9 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) //----------------------------------------------------------------------------- // render() //----------------------------------------------------------------------------- -BOOL LLImagePreviewSculpted::render() +bool LLImagePreviewSculpted::render() { - mNeedsUpdate = FALSE; + mNeedsUpdate = false; LLGLSUIDefault def; LLGLDisable no_blend(GL_BLEND); LLGLEnable cull(GL_CULL_FACE); @@ -901,7 +902,7 @@ BOOL LLImagePreviewSculpted::render() LLViewerCamera::getInstance()->setAspect((F32) mFullWidth / mFullHeight); LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); - LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE); + LLViewerCamera::getInstance()->setPerspective(false, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, false); const LLVolumeFace &vf = mVolume->getVolumeFace(0); U32 num_indices = vf.mNumIndices; @@ -924,7 +925,7 @@ BOOL LLImagePreviewSculpted::render() gObjectPreviewProgram.unbind(); - return TRUE; + return true; } //----------------------------------------------------------------------------- @@ -932,7 +933,7 @@ BOOL LLImagePreviewSculpted::render() //----------------------------------------------------------------------------- void LLImagePreviewSculpted::refresh() { - mNeedsUpdate = TRUE; + mNeedsUpdate = true; } //----------------------------------------------------------------------------- |