diff options
Diffstat (limited to 'indra/newview/llfloateranimpreview.cpp')
-rw-r--r-- | indra/newview/llfloateranimpreview.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 12c4932293..dec27db74b 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -37,6 +37,7 @@ #include "llbvhloader.h" #include "lldatapacker.h" #include "lldir.h" +#include "lleconomy.h" #include "llvfile.h" #include "llapr.h" #include "llstring.h" @@ -69,8 +70,6 @@ #include "lluictrlfactory.h" #include "lltrans.h" -S32 LLFloaterAnimPreview::sUploadAmount = 10; - const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; @@ -197,7 +196,6 @@ BOOL LLFloaterAnimPreview::postBuild() childSetCommitCallback("name_form", onCommitName, this); - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); @@ -307,8 +305,9 @@ BOOL LLFloaterAnimPreview::postBuild() motionp->setName(childGetValue("name_form").asString()); mAnimPreview->getDummyAvatar()->startMotion(mMotionID); - childSetMinValue("playback_slider", 0.0); - childSetMaxValue("playback_slider", 1.0); + + getChild<LLSlider>("playback_slider")->setMinValue(0.0); + getChild<LLSlider>("playback_slider")->setMaxValue(1.0); childSetValue("loop_check", LLSD(motionp->getLoop())); childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); @@ -325,7 +324,6 @@ BOOL LLFloaterAnimPreview::postBuild() } else { - delete mAnimPreview; mAnimPreview = NULL; mMotionID.setNull(); childSetValue("bad_animation_text", getString("failed_to_initialize")); @@ -367,7 +365,6 @@ BOOL LLFloaterAnimPreview::postBuild() //----------------------------------------------------------------------------- LLFloaterAnimPreview::~LLFloaterAnimPreview() { - delete mAnimPreview; mAnimPreview = NULL; setEnabled(FALSE); @@ -387,7 +384,7 @@ void LLFloaterAnimPreview::draw() { gGL.color3f(1.f, 1.f, 1.f); - gGL.getTexUnit(0)->bind(mAnimPreview->getTexture()); + gGL.getTexUnit(0)->bind(mAnimPreview); gGL.begin( LLRender::QUADS ); { @@ -734,7 +731,7 @@ void LLFloaterAnimPreview::onCommitName(LLUICtrl* ctrl, void* data) motionp->setName(previewp->childGetValue("name_form").asString()); } - LLFloaterNameDesc::doCommit(ctrl, data); + previewp->doCommit(); } //----------------------------------------------------------------------------- @@ -985,7 +982,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) std::string name = floaterp->childGetValue("name_form").asString(); std::string desc = floaterp->childGetValue("description_form").asString(); LLAssetStorage::LLStoreAssetCallback callback = NULL; - S32 expected_upload_cost = sUploadAmount; + S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; upload_new_resource(floaterp->mTransactionID, // tid LLAssetType::AT_ANIMATION, @@ -1017,7 +1014,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata) //----------------------------------------------------------------------------- // LLPreviewAnimation //----------------------------------------------------------------------------- -LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) +LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE) { mNeedsUpdate = TRUE; mCameraDistance = PREVIEW_CAMERA_DISTANCE; @@ -1063,7 +1060,7 @@ BOOL LLPreviewAnimation::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(); @@ -1073,7 +1070,7 @@ BOOL LLPreviewAnimation::render() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); 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(); @@ -1095,7 +1092,7 @@ BOOL LLPreviewAnimation::render() target_pos + (mCameraOffset * av_rot) ); // point of interest 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); mCameraRelPos = LLViewerCamera::getInstance()->getOrigin() - avatarp->mHeadp->getWorldPosition(); |