From 133a7b5fe2bcaaec8389b209cb5bd774ebc2ab63 Mon Sep 17 00:00:00 2001 From: Josh Bell Date: Fri, 14 Mar 2008 19:27:38 +0000 Subject: svn merge -r 82272:82277 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-ui-9-merge-2 --> release QAR-364 - merge of maint-ui-9 --- indra/llcommon/llsmoothstep.h | 50 +++++++++++++++ indra/llui/llfloater.h | 2 + indra/newview/linux_tools/client-readme.txt | 5 +- indra/newview/llagent.cpp | 73 +++++++++++++++++++-- indra/newview/llagent.h | 41 +++++++++--- indra/newview/llfloaterbuyland.cpp | 21 ++++++- indra/newview/llmoveview.cpp | 16 +---- indra/newview/llmoveview.h | 4 +- indra/newview/llpanelgroupinvite.cpp | 68 ++++++++++++++++---- indra/newview/llprogressview.cpp | 98 ++++++++++++++--------------- indra/newview/llprogressview.h | 3 +- indra/newview/llstartup.cpp | 5 +- indra/newview/lltooldraganddrop.cpp | 14 ++++- indra/newview/llurldispatcher.cpp | 61 ++++++++++++++++-- indra/newview/llviewerkeyboard.cpp | 89 +++++++++++++++----------- indra/newview/llviewermenu.cpp | 13 ++-- indra/newview/llviewermessage.cpp | 9 +-- indra/newview/llviewerwindow.cpp | 10 +-- indra/newview/llworldmap.cpp | 49 +++++++++++---- indra/newview/llworldmap.h | 5 ++ 20 files changed, 462 insertions(+), 174 deletions(-) create mode 100644 indra/llcommon/llsmoothstep.h (limited to 'indra') diff --git a/indra/llcommon/llsmoothstep.h b/indra/llcommon/llsmoothstep.h new file mode 100644 index 0000000000..cac40c8f67 --- /dev/null +++ b/indra/llcommon/llsmoothstep.h @@ -0,0 +1,50 @@ +/** + * @file llsmoothstep.h + * @brief Smoothstep - transition from 0 to 1 - function, first and second derivatives all continuous (smooth) + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2007, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlife.com/developers/opensource/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlife.com/developers/opensource/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLSMOOTHSTEP_H +#define LL_LLSMOOTHSTEP_H + +template +inline LLDATATYPE llsmoothstep(const LLDATATYPE& edge0, const LLDATATYPE& edge1, const LLDATATYPE& value) +{ + if (value < edge0) + return (LLDATATYPE)0; + + if (value >= edge1) + return (LLDATATYPE)1; + + // Scale/bias into [0..1] range + LLDATATYPE scaled_value = (value - edge0) / (edge1 - edge0); + + return scaled_value * scaled_value * (3 - 2 * scaled_value); +} + +#endif // LL_LLSMOOTHSTEP_H diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 32ee0227d0..6597ef46da 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -185,6 +185,8 @@ public: // Defaults to destroy(). virtual void onClose(bool app_quitting) { destroy(); } + // This cannot be "const" until all derived floater canClose() + // methods are const as well. JC virtual BOOL canClose() { return TRUE; } virtual void setVisible(BOOL visible); diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index ff607b778a..87087be778 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -104,9 +104,8 @@ the Beta release of the Linux client. stability. See PROBLEM 3 in the TROUBLESHOOTING section if you wish to turn these on to possibly enhance your experience. -* MISC - The following features are known to not yet be fully operational on - the Linux client: - * Movie recording (soon to be deprecated) +* MISC - The following features are not currently fully implemented on the + Linux client and are therefore known not to work properly: * Full Unicode font rendering * UPLOAD / SAVE / COLOR-PICKER DIALOGS - These only appear when the client diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 156b4a395d..ac92ee8525 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -51,6 +51,7 @@ #include "llquaternion.h" #include "v3math.h" #include "v4math.h" +#include "llsmoothstep.h" #include "llsdutil.h" //#include "vmath.h" @@ -176,6 +177,8 @@ const F32 AVATAR_ZOOM_MIN_Z_FACTOR = 1.15f; const F32 MAX_CAMERA_DISTANCE_FROM_AGENT = 50.f; +const F32 MAX_CAMERA_SMOOTH_DISTANCE = 20.0f; + const F32 HEAD_BUFFER_SIZE = 0.3f; const F32 CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP = 0.2f; @@ -272,6 +275,13 @@ void LLAgentFriendObserver::changed(U32 mask) LLAgent::LLAgent() : mViewerPort(NET_USE_OS_ASSIGNED_PORT), mDrawDistance( DEFAULT_FAR_PLANE ), + + mDoubleTapRunTimer(), + mDoubleTapRunMode(DOUBLETAP_NONE), + + mbAlwaysRun(false), + mbRunning(false), + mAccess(SIM_ACCESS_PG), mGroupPowers(0), mGroupID(), @@ -303,7 +313,6 @@ LLAgent::LLAgent() mLastCameraMode( CAMERA_MODE_THIRD_PERSON ), mViewsPushed(FALSE), - mbAlwaysRun(FALSE), mShowAvatar(TRUE), mCameraAnimating( FALSE ), @@ -329,6 +338,8 @@ LLAgent::LLAgent() mFocusObjectOffset(), mFocusDotRadius( 0.1f ), // meters mTrackFocusObject(TRUE), + mCameraSmoothingLastPositionGlobal(), + mCameraSmoothingLastPositionAgent(), mFrameAgent(), @@ -3185,8 +3196,9 @@ void LLAgent::updateCamera() } // ...adjust position for animation - camera_pos_global = lerp(mAnimationCameraStartGlobal, camera_target_global, fraction_of_animation); - mFocusGlobal = lerp(mAnimationFocusStartGlobal, focus_target_global, fraction_of_animation); + F32 smooth_fraction_of_animation = llsmoothstep(0.0f, 1.0f, fraction_of_animation); + camera_pos_global = lerp(mAnimationCameraStartGlobal, camera_target_global, smooth_fraction_of_animation); + mFocusGlobal = lerp(mAnimationFocusStartGlobal, focus_target_global, smooth_fraction_of_animation); } else { @@ -3205,13 +3217,52 @@ void LLAgent::updateCamera() getAvatarObject()->updateAttachmentVisibility(mCameraMode); } } - else + else { camera_pos_global = camera_target_global; mFocusGlobal = focus_target_global; mShowAvatar = TRUE; } + // smoothing + if (TRUE) + { + LLVector3d agent_pos = getPositionGlobal(); + LLVector3d camera_pos_agent = camera_pos_global - agent_pos; + + if (cameraThirdPerson()) // only smooth in third person mode + { + F32 smoothing = llclampf(1.f - pow(2.f, -4.f * gSavedSettings.getF32("CameraPositionSmoothing") / gFPSClamped)); + // we use average FPS instead of LLCriticalDamp b/c exact frame time is jittery + + + if (!mFocusObject) // we differentiate on avatar mode + { + // for avatar-relative focus, we smooth in avatar space - + // the avatar moves too jerkily w/r/t global space to smooth there. + + LLVector3d delta = camera_pos_agent - mCameraSmoothingLastPositionAgent; + if (delta.magVec() < MAX_CAMERA_SMOOTH_DISTANCE) // only smooth over short distances please + { + camera_pos_agent = lerp(camera_pos_agent, mCameraSmoothingLastPositionAgent, smoothing); + camera_pos_global = camera_pos_agent + agent_pos; + } + } + else + { + LLVector3d delta = camera_pos_global - mCameraSmoothingLastPositionGlobal; + if (delta.magVec() < MAX_CAMERA_SMOOTH_DISTANCE) // only smooth over short distances please + { + camera_pos_global = lerp(camera_pos_global, mCameraSmoothingLastPositionGlobal, smoothing); + } + } + } + + mCameraSmoothingLastPositionGlobal = camera_pos_global; + mCameraSmoothingLastPositionAgent = camera_pos_agent; + } + + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -4990,6 +5041,20 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) sendReliableMessage(); } +void LLAgent::sendWalkRun(bool running) +{ + LLMessageSystem* msgsys = gMessageSystem; + if (msgsys) + { + msgsys->newMessageFast(_PREHASH_SetAlwaysRun); + msgsys->nextBlockFast(_PREHASH_AgentData); + msgsys->addUUIDFast(_PREHASH_AgentID, getID()); + msgsys->addUUIDFast(_PREHASH_SessionID, getSessionID()); + msgsys->addBOOLFast(_PREHASH_AlwaysRun, BOOL(running) ); + sendReliableMessage(); + } +} + void LLAgent::friendsChanged() { LLCollectProxyBuddies collector; diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 6fe978b6cb..469d2e4fe0 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -201,16 +201,17 @@ public: void heardChat(const LLUUID& id); void lookAtLastChat(); - LLUUID getLastChatter() { return mLastChatterID; } - F32 getTypingTime() { return mTypingTimer.getElapsedTimeF32(); } + F32 getTypingTime() { return mTypingTimer.getElapsedTimeF32(); } void setAFK(); void clearAFK(); BOOL getAFK() const; - void setAlwaysRun() { mbAlwaysRun = TRUE; } - void clearAlwaysRun() { mbAlwaysRun = FALSE; } - BOOL getAlwaysRun() const { return mbAlwaysRun; } + void setAlwaysRun() { mbAlwaysRun = true; } + void clearAlwaysRun() { mbAlwaysRun = false; } + + void setRunning() { mbRunning = true; } + void clearRunning() { mbRunning = false; } void setBusy(); void clearBusy(); @@ -220,8 +221,7 @@ public: void setGodLevel(U8 god_level) { mGodLevel = god_level; } void setFirstLogin(BOOL b) { mFirstLogin = b; } void setGenderChosen(BOOL b) { mGenderChosen = b; } - - BOOL getAdminOverride() const { return mAdminOverride; } + // update internal datastructures and update the server with the // new contribution level. Returns true if the group id was found // and contribution could be set. @@ -255,6 +255,11 @@ public: F32 getFocusObjectDist() const { return mFocusObjectDist; } BOOL inPrelude(); BOOL canManageEstate() const; + BOOL getAdminOverride() const { return mAdminOverride; } + + LLUUID getLastChatter() const { return mLastChatterID; } + bool getAlwaysRun() const { return mbAlwaysRun; } + bool getRunning() const { return mbRunning; } const LLUUID& getInventoryRootID() const { return mInventoryRootID; } @@ -535,6 +540,15 @@ public: F32 getNearChatRadius() { return mNearChatRadius; } + enum EDoubleTapRunMode + { + DOUBLETAP_NONE, + DOUBLETAP_FORWARD, + DOUBLETAP_BACKWARD, + DOUBLETAP_SLIDELEFT, + DOUBLETAP_SLIDERIGHT + }; + enum ETeleportState { TELEPORT_NONE = 0, // No teleport in progress @@ -637,6 +651,8 @@ public: BOOL areWearablesLoaded() { return mWearablesLoaded; } + void sendWalkRun(bool running); + void observeFriends(); void friendsChanged(); @@ -709,7 +725,13 @@ public: static std::map sTeleportErrorMessages; static std::map sTeleportProgressMessages; + LLFrameTimer mDoubleTapRunTimer; + EDoubleTapRunMode mDoubleTapRunMode; + private: + bool mbAlwaysRun; // should the avatar run by default rather than walk + bool mbRunning; // is the avatar trying to run right now + // Access or "maturity" level U8 mAccess; // SIM_ACCESS_MATURE or SIM_ACCESS_PG ETeleportState mTeleportState; @@ -738,7 +760,6 @@ private: BOOL mViewsPushed; // keep track of whether or not we have pushed views. BOOL mCustomAnim ; //current animation is ANIM_AGENT_CUSTOMIZE ? - BOOL mbAlwaysRun; // should the avatar run rather than walk BOOL mShowAvatar; // should we render the avatar? BOOL mCameraAnimating; // camera is transitioning from one mode to another LLVector3d mAnimationCameraStartGlobal; // camera start position, global coords @@ -762,7 +783,9 @@ private: BOOL mSitCameraEnabled; // use provided camera information when sitting? LLVector3 mSitCameraPos; // root relative camera pos when sitting LLVector3 mSitCameraFocus; // root relative camera target when sitting - + LLVector3d mCameraSmoothingLastPositionGlobal; + LLVector3d mCameraSmoothingLastPositionAgent; + //Ventrella LLVector3 mCameraUpVector; // camera's up direction in world coordinates (determines the 'roll' of the view) //End Ventrella diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 52736c8c60..5450b6de26 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -187,6 +187,7 @@ public: virtual void draw(); virtual BOOL canClose(); virtual void onClose(bool app_quitting); + /*virtual*/ void setMinimized(BOOL b); private: class SelectionObserver : public LLParcelObserver @@ -968,9 +969,27 @@ void LLFloaterBuyLandUI::draw() } } +// virtual BOOL LLFloaterBuyLandUI::canClose() { - return (mTransaction ? FALSE : TRUE) && mCurrency.canCancel(); + bool can_close = (mTransaction ? FALSE : TRUE) && mCurrency.canCancel(); + if (!can_close) + { + // explain to user why they can't do this, see DEV-9605 + gViewerWindow->alertXml("CannotCloseFloaterBuyLand"); + } + return can_close; +} + +// virtual +void LLFloaterBuyLandUI::setMinimized(BOOL minimize) +{ + bool restored = (isMinimized() && !minimize); + LLFloater::setMinimized(minimize); + if (restored) + { + refreshUI(); + } } void LLFloaterBuyLandUI::onClose(bool app_quitting) diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 4963b42a62..eea729393c 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -39,11 +39,9 @@ // Viewer includes #include "llagent.h" #include "llviewercontrol.h" -#include "llfontgl.h" #include "llbutton.h" #include "llviewerwindow.h" #include "lljoystickbutton.h" -#include "llresmgr.h" #include "llvieweruictrlfactory.h" // @@ -54,8 +52,6 @@ const F32 MOVE_BUTTON_DELAY = 0.0f; const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed const F32 NUDGE_TIME = 0.25f; // in seconds -const char *MOVE_TITLE = ""; - // // Global statics // @@ -69,8 +65,7 @@ LLFloaterMove* LLFloaterMove::sInstance = NULL; // protected LLFloaterMove::LLFloaterMove() -: LLFloater("move floater", "FloaterMoveRect", MOVE_TITLE, FALSE, 100, 100, DRAG_ON_TOP, - MINIMIZE_NO) +: LLFloater("move floater") { setIsChrome(TRUE); gUICtrlFactory->buildFloater(this,"floater_moveview.xml"); @@ -105,9 +100,6 @@ LLFloaterMove::LLFloaterMove() mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mMoveDownButton->setHeldDownCallback( moveDown ); - mFlyButton = LLUICtrlFactory::getButtonByName(this, "fly btn"); - childSetAction("fly btn",onFlyButtonClicked,NULL); - sInstance = this; } @@ -168,12 +160,6 @@ BOOL LLFloaterMove::visible(void*) return (sInstance != NULL); } -// protected static -void LLFloaterMove::onFlyButtonClicked(void *) -{ - gAgent.toggleFlying(); -} - // protected static F32 LLFloaterMove::getYawRate( F32 time ) diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index e08f20a027..4d55206194 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -51,7 +51,7 @@ protected: public: /*virtual*/ void onClose(bool app_quitting); - static void onFlyButtonClicked(void* userdata); + static F32 getYawRate(F32 time); static void show(void*); @@ -72,8 +72,6 @@ protected: static void moveDown(void* userdata); public: - LLButton* mFlyButton; - LLJoystickAgentTurn* mForwardButton; LLJoystickAgentTurn* mBackwardButton; LLJoystickAgentSlide* mSlideLeftButton; diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index e51afa30ea..f5b4fc83ca 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -43,6 +43,7 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llvieweruictrlfactory.h" +#include "llviewerwindow.h" class LLPanelGroupInvite::impl { @@ -65,6 +66,7 @@ public: static void callbackAddUsers(const std::vector& names, const std::vector& agent_ids, void* user_data); + static void inviteOwnerCallback(S32 option, void* userdata); public: LLUUID mGroupID; @@ -75,6 +77,8 @@ public: LLButton *mOKButton; LLButton *mRemoveButton; LLTextBox *mGroupName; + LLTextBox *mOwnerWarning; + bool mConfirmedOwnerInvite; void (*mCloseCallback)(void* data); @@ -82,16 +86,19 @@ public: }; -LLPanelGroupInvite::impl::impl(const LLUUID& group_id) +LLPanelGroupInvite::impl::impl(const LLUUID& group_id): + mGroupID( group_id ), + mLoadingText (), + mInvitees ( NULL ), + mRoleNames( NULL ), + mOKButton ( NULL ), + mRemoveButton( NULL ), + mGroupName( NULL ), + mOwnerWarning ( NULL ), + mConfirmedOwnerInvite( false ), + mCloseCallback( NULL ), + mCloseCallbackUserData( NULL ) { - mGroupID = group_id; - - mInvitees = NULL; - mRoleNames = NULL; - mRemoveButton = NULL; - - mCloseCallback = NULL; - mCloseCallbackUserData = NULL; } LLPanelGroupInvite::impl::~impl() @@ -140,12 +147,23 @@ void LLPanelGroupInvite::impl::submitInvitations() { std::map role_member_pairs; + LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + // Default to everyone role. LLUUID role_id = LLUUID::null; if (mRoleNames) { role_id = mRoleNames->getCurrentID(); + + // owner role: display confirmation and wait for callback + if ((role_id == gdatap->mOwnerRole) && (!mConfirmedOwnerInvite)) + { + LLString::format_map_t args; + args["[MESSAGE]"] = mOwnerWarning->getText(); + gViewerWindow->alertXml("GenericAlertYesCancel", args, inviteOwnerCallback, this); + return; // we'll be called again if user confirms + } } //loop over the users @@ -163,6 +181,28 @@ void LLPanelGroupInvite::impl::submitInvitations() (*mCloseCallback)(mCloseCallbackUserData); } +//static +void LLPanelGroupInvite::impl::inviteOwnerCallback(S32 option, void* userdata) +{ + LLPanelGroupInvite::impl* self = (LLPanelGroupInvite::impl*)userdata; + if (!self) return; + + switch(option) + { + case 0: + // user confirmed that they really want a new group owner + self->mConfirmedOwnerInvite = true; + self->submitInvitations(); + break; + case 1: + // fall through + default: + break; + } +} + + + void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) { LLGroupMgrGroupData::member_list_t::iterator agent_iter = @@ -413,7 +453,7 @@ void LLPanelGroupInvite::update() void LLPanelGroupInvite::updateLists() { LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mImplementation->mGroupID); - BOOL waiting = FALSE; + bool waiting = false; if (gdatap) { @@ -426,7 +466,7 @@ void LLPanelGroupInvite::updateLists() } else { - waiting = TRUE; + waiting = true; } if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete()) { @@ -442,12 +482,12 @@ void LLPanelGroupInvite::updateLists() } else { - waiting = TRUE; + waiting = true; } } else { - waiting = TRUE; + waiting = true; } if (waiting) @@ -523,6 +563,8 @@ BOOL LLPanelGroupInvite::postBuild() button->setCallbackUserData(mImplementation); } + mImplementation->mOwnerWarning = (LLTextBox*)getChildByName("confirm_invite_owner_str", recurse); + update(); return (mImplementation->mRoleNames && diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 28b09358ef..2d67e432c3 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -67,12 +67,10 @@ const S32 ANIMATION_FRAMES = 1; //13; // XUI:translate LLProgressView::LLProgressView(const std::string& name, const LLRect &rect) -: LLPanel(name, rect, FALSE), -mMouseDownInActiveArea( false ) +: LLPanel(name, rect, FALSE), + mPercentDone( 0.f ), + mMouseDownInActiveArea( false ) { - mPercentDone = 0.f; - mDrawBackground = TRUE; - const S32 CANCEL_BTN_WIDTH = 70; const S32 CANCEL_BTN_OFFSET = 16; LLRect r; @@ -218,39 +216,37 @@ void LLProgressView::draw() } // Paint bitmap if we've got one - if (mDrawBackground) + glPushMatrix(); + if (gStartImageGL) { - glPushMatrix(); - if (gStartImageGL) + LLGLSUIDefault gls_ui; + LLViewerImage::bindTexture(gStartImageGL); + gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f); + F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; + F32 view_aspect = (F32)width / (F32)height; + // stretch image to maintain aspect ratio + if (image_aspect > view_aspect) { - LLGLSUIDefault gls_ui; - LLViewerImage::bindTexture(gStartImageGL); - gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f); - F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; - F32 view_aspect = (F32)width / (F32)height; - // stretch image to maintain aspect ratio - if (image_aspect > view_aspect) - { - glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f); - glScalef(image_aspect / view_aspect, 1.f, 1.f); - } - else - { - glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f); - glScalef(1.f, view_aspect / image_aspect, 1.f); - } - gl_rect_2d_simple_tex( getRect().getWidth(), getRect().getHeight() ); - gStartImageGL->unbindTexture(0, GL_TEXTURE_2D); + glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f); + glScalef(image_aspect / view_aspect, 1.f, 1.f); } else { - LLGLSNoTexture gls_no_texture; - gGL.color4f(0.f, 0.f, 0.f, 1.f); - gl_rect_2d(getRect()); + glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f); + glScalef(1.f, view_aspect / image_aspect, 1.f); } - glPopMatrix(); + gl_rect_2d_simple_tex( getRect().getWidth(), getRect().getHeight() ); + gStartImageGL->unbindTexture(0, GL_TEXTURE_2D); + } + else + { + LLGLSNoTexture gls_no_texture; + gGL.color4f(0.f, 0.f, 0.f, 1.f); + gl_rect_2d(getRect()); } + glPopMatrix(); + // Handle fade-in animation if (mFadeTimer.getStarted()) { LLView::draw(); @@ -294,31 +290,31 @@ void LLProgressView::draw() S32 background_box_height = background_box_top - background_box_bottom + 1; gl_draw_scaled_image_with_border( background_box_left + 2, - background_box_bottom - 2, - 16, - 16, - background_box_width, - background_box_height, - shadow_imagep, - gColors.getColor( "ColorDropShadow" ) ); + background_box_bottom - 2, + 16, + 16, + background_box_width, + background_box_height, + shadow_imagep, + gColors.getColor( "ColorDropShadow" ) ); gl_draw_scaled_image_with_border( background_box_left, - background_box_bottom, - 16, - 16, - background_box_width, - background_box_height, - bar_imagep, - LLColor4( 0.0f, 0.0f, 0.0f, 0.5f ) ); + background_box_bottom, + 16, + 16, + background_box_width, + background_box_height, + bar_imagep, + LLColor4( 0.0f, 0.0f, 0.0f, 0.4f ) ); gl_draw_scaled_image_with_border( background_box_left + 1, - background_box_bottom + 1, - 16, - 16, - background_box_width - 2, - background_box_height - 2, - bar_imagep, - LLColor4( 0.4f, 0.4f, 0.4f, 0.4f ) ); + background_box_bottom + 1, + 16, + 16, + background_box_width - 2, + background_box_height - 2, + bar_imagep, + LLColor4( 0.4f, 0.4f, 0.4f, 0.3f ) ); // we'll need this later for catching a click if it looks like it contains a link if ( mMessage.find( "http://" ) != std::string::npos ) diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index 8f242b865a..e9fe7e817e 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -66,7 +66,6 @@ public: static void onCancelButtonClicked( void* ); protected: - BOOL mDrawBackground; F32 mPercentDone; LLString mText; LLString mMessage; @@ -75,8 +74,8 @@ protected: LLFrameTimer mProgressTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; - static LLProgressView* sInstance; + static LLProgressView* sInstance; }; #endif // LL_LLPROGRESSVIEW_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index e189e28c7d..d2bc8f4100 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2253,8 +2253,9 @@ BOOL idle_startup() else { update_texture_fetch(); - set_startup_status(0.60f + 0.40f * timeout_frac, "Precaching...", - gAgent.mMOTD.c_str()); + set_startup_status(0.60f + 0.40f * timeout_frac, + "Loading world...", + gAgent.mMOTD.c_str()); } return do_normal_idle; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index f4de261240..b4107192d6 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1465,6 +1465,16 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, // Select the object only if we're editing. BOOL rez_selected = gToolMgr->inEdit(); + + LLVector3 ray_start = regionp->getPosRegionFromGlobal(mLastCameraPos); + LLVector3 ray_end = regionp->getPosRegionFromGlobal(mLastHitPos); + // currently the ray's end point is an approximation, + // and is sometimes too short (causing failure.) so we + // double the ray's length: + LLVector3 ray_direction = ray_start - ray_end; + ray_end = ray_end - ray_direction; + + // Message packing code should be it's own uninterrupted block LLMessageSystem* msg = gMessageSystem; if (mSource == SOURCE_NOTECARD) @@ -1488,8 +1498,8 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, // optimization. msg->addUUIDFast(_PREHASH_FromTaskID, source_id); msg->addU8Fast(_PREHASH_BypassRaycast, (U8) bypass_sim_raycast); - msg->addVector3Fast(_PREHASH_RayStart, regionp->getPosRegionFromGlobal(mLastCameraPos)); - msg->addVector3Fast(_PREHASH_RayEnd, regionp->getPosRegionFromGlobal(mLastHitPos)); + msg->addVector3Fast(_PREHASH_RayStart, ray_start); + msg->addVector3Fast(_PREHASH_RayEnd, ray_end); msg->addUUIDFast(_PREHASH_RayTargetID, ray_target_id ); msg->addBOOLFast(_PREHASH_RayEndIsIntersection, FALSE); msg->addBOOLFast(_PREHASH_RezSelected, rez_selected); diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 9e4f196601..5f167e62ad 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -88,6 +88,11 @@ private: // Returns true if handled. static void regionHandleCallback(U64 handle, const std::string& url, + const LLUUID& snapshot_id, bool teleport); + // Called by LLWorldMap when a location has been resolved to a + // region name + + static void regionNameCallback(U64 handle, const std::string& url, const LLUUID& snapshot_id, bool teleport); // Called by LLWorldMap when a region name has been resolved to a // location in-world, used by places-panel display. @@ -220,14 +225,14 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, BOOL right_mous // Request a region handle by name gWorldMap->sendNamedRegionRequest(region_name, - LLURLDispatcherImpl::regionHandleCallback, - url, - false); // don't teleport + LLURLDispatcherImpl::regionNameCallback, + url, + false); // don't teleport return true; } /*static*/ -void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) +void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) { std::string sim_string = stripProtocol(url); std::string region_name; @@ -241,6 +246,54 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::str local_pos.mV[VY] = (F32)y; local_pos.mV[VZ] = (F32)z; + + // determine whether the point is in this region + if ((x >= 0) && (x < REGION_WIDTH_UNITS) && + (y >= 0) && (y < REGION_WIDTH_UNITS)) + { + // if so, we're done + regionHandleCallback(region_handle, url, snapshot_id, teleport); + } + + else + { + // otherwise find the new region from the location + + // add the position to get the new region + LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos); + + U64 new_region_handle = to_region_handle(global_pos); + gWorldMap->sendHandleRegionRequest(new_region_handle, + LLURLDispatcherImpl::regionHandleCallback, + url, teleport); + } +} + +/* static */ +void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport) +{ + std::string sim_string = stripProtocol(url); + std::string region_name; + S32 x = 128; + S32 y = 128; + S32 z = 0; + LLURLSimString::parse(sim_string, ®ion_name, &x, &y, &z); + + // remap x and y to local coordinates + S32 local_x = x % REGION_WIDTH_UNITS; + S32 local_y = y % REGION_WIDTH_UNITS; + if (local_x < 0) + local_x += REGION_WIDTH_UNITS; + if (local_y < 0) + local_y += REGION_WIDTH_UNITS; + + LLVector3 local_pos; + local_pos.mV[VX] = (F32)local_x; + local_pos.mV[VY] = (F32)local_y; + local_pos.mV[VZ] = (F32)z; + + + if (teleport) { LLVector3d global_pos = from_region_handle(region_handle); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 8a5a5e99c9..db0da19927 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -83,82 +83,101 @@ void agent_push_down( EKeystate s ) gAgent.moveUp(-1); } -void agent_push_forward( EKeystate s ) +static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode) { - if( KEYSTATE_UP == s ) return; - F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); - - if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) + if (KEYSTATE_UP == s) { - gAgent.moveAtNudge(1); + // Releasing a walk-key resets the double-tap timer + gAgent.mDoubleTapRunTimer.reset(); + if (gAgent.mDoubleTapRunMode == mode && + gAgent.getRunning() && + !gAgent.getAlwaysRun()) + { + // Turn off temporary running. + gAgent.clearRunning(); + gAgent.sendWalkRun(gAgent.getRunning()); + } + gAgent.mDoubleTapRunMode = mode; } - else + else if (KEYSTATE_DOWN == s && + gAgent.mDoubleTapRunMode == mode && + gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME) { - gAgent.moveAt(1); + // Same walk-key was pushed again quickly; this is a double-tap + // so engage temporary running. + gAgent.setRunning(); + gAgent.sendWalkRun(gAgent.getRunning()); } } - -void agent_push_backward( EKeystate s ) +static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDoubleTapRunMode mode ) { - if( KEYSTATE_UP == s ) return; - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + agent_handle_doubletap_run(s, mode); + if (KEYSTATE_UP == s) return; + F32 time = gKeyboard->getCurKeyElapsedTime(); + S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { - gAgent.moveAtNudge(-1); + gAgent.moveAtNudge(direction); } else { - gAgent.moveAt(-1); + gAgent.moveAt(direction); } } -void agent_slide_left( EKeystate s ) +void agent_push_forward( EKeystate s ) { - if( KEYSTATE_UP == s ) return; + agent_push_forwardbackward(s, 1, LLAgent::DOUBLETAP_FORWARD); +} + + +void agent_push_backward( EKeystate s ) +{ + agent_push_forwardbackward(s, -1, LLAgent::DOUBLETAP_BACKWARD); +} + +static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleTapRunMode mode ) +{ + agent_handle_doubletap_run(s, mode); + if( KEYSTATE_UP == s ) return; F32 time = gKeyboard->getCurKeyElapsedTime(); S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) { - gAgent.moveLeftNudge(1); + gAgent.moveLeftNudge(direction); } else { - gAgent.moveLeft(1); + gAgent.moveLeft(direction); } } -void agent_slide_right( EKeystate s ) +void agent_slide_left( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - F32 time = gKeyboard->getCurKeyElapsedTime(); - S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount()); + agent_slide_leftright(s, 1, LLAgent::DOUBLETAP_SLIDELEFT); +} - if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES) - { - gAgent.moveLeftNudge(-1); - } - else - { - gAgent.moveLeft(-1); - } + +void agent_slide_right( EKeystate s ) +{ + agent_slide_leftright(s, -1, LLAgent::DOUBLETAP_SLIDERIGHT); } void agent_turn_left( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - F32 time = gKeyboard->getCurKeyElapsedTime(); if (gToolCamera->mouseSteerMode()) { agent_slide_left(s); } else { + if (KEYSTATE_UP == s) return; + F32 time = gKeyboard->getCurKeyElapsedTime(); gAgent.moveYaw( LLFloaterMove::getYawRate( time ) ); } } @@ -166,14 +185,14 @@ void agent_turn_left( EKeystate s ) void agent_turn_right( EKeystate s ) { - if( KEYSTATE_UP == s ) return; - F32 time = gKeyboard->getCurKeyElapsedTime(); if (gToolCamera->mouseSteerMode()) { agent_slide_right(s); } else { + if (KEYSTATE_UP == s) return; + F32 time = gKeyboard->getCurKeyElapsedTime(); gAgent.moveYaw( -LLFloaterMove::getYawRate( time ) ); } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 8ef9d9c913..a384d24947 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4881,23 +4881,22 @@ class LLWorldAlwaysRun : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { + // as well as altering the default walk-vs-run state, + // we also change the *current* walk-vs-run state. if (gAgent.getAlwaysRun()) { gAgent.clearAlwaysRun(); + gAgent.clearRunning(); } else { gAgent.setAlwaysRun(); + gAgent.setRunning(); } - LLMessageSystem *msg = gMessageSystem; + // tell the simulator. + gAgent.sendWalkRun(gAgent.getAlwaysRun()); - msg->newMessageFast(_PREHASH_SetAlwaysRun); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun() ); - gAgent.sendReliableMessage(); return true; } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5200c321db..6bd81e76e9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2834,13 +2834,8 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) avatarp->mFootPlane.clearVec(); } - // reset always run status - msg->newMessageFast(_PREHASH_SetAlwaysRun); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun()); - gAgent.sendReliableMessage(); + // send walk-vs-run status + gAgent.sendWalkRun(gAgent.getRunning() || gAgent.getAlwaysRun()); if (LLFloaterReleaseMsg::checkVersion(version_channel_char)) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index dcceb397d3..900fd6fc8b 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1802,9 +1802,11 @@ void adjust_rect_bottom_center(const LLString& control, const LLRect& window) LLRect r = gSavedSettings.getRect(control); if (r.mLeft == 0 && r.mBottom == 0) { + // *TODO: Adjust based on XUI XML + const S32 TOOLBAR_HEIGHT = 64; r.setOriginAndSize( window.getWidth()/2 - r.getWidth()/2, - 0, + TOOLBAR_HEIGHT, r.getWidth(), r.getHeight()); gSavedSettings.setRect(control, r); @@ -1838,9 +1840,9 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) { LLRect r; - adjust_rect_bottom_center("FloaterMoveRect", window); + adjust_rect_bottom_center("FloaterMoveRect2", window); - adjust_rect_bottom_center("FloaterCameraRect", window); + adjust_rect_bottom_center("FloaterCameraRect2", window); adjust_rect_top_left("FloaterCustomizeAppearanceRect", window); @@ -1856,8 +1858,6 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) adjust_rect_top_right("FloaterLagMeter", window); - adjust_rect_top_right("FloaterLagMeter", window); - adjust_rect_top_left("FloaterBuildOptionsRect", window); // bottom-right diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 50c9ceeb0a..6d0853a6dc 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -108,6 +108,7 @@ LLWorldMap::LLWorldMap() : mNeighborMapWidth(0), mNeighborMapHeight(0), mSLURLRegionName(), + mSLURLRegionHandle(0), mSLURL(), mSLURLCallback(0), mSLURLTeleport(false) @@ -409,6 +410,7 @@ void LLWorldMap::sendNamedRegionRequest(std::string region_name, bool teleport) // immediately teleport when result returned { mSLURLRegionName = region_name; + mSLURLRegionHandle = 0; mSLURL = callback_url; mSLURLCallback = callback; mSLURLTeleport = teleport; @@ -416,6 +418,26 @@ void LLWorldMap::sendNamedRegionRequest(std::string region_name, sendNamedRegionRequest(region_name); } +void LLWorldMap::sendHandleRegionRequest(U64 region_handle, + url_callback_t callback, + const std::string& callback_url, + bool teleport) // immediately teleport when result returned +{ + mSLURLRegionName.clear(); + mSLURLRegionHandle = region_handle; + mSLURL = callback_url; + mSLURLCallback = callback; + mSLURLTeleport = teleport; + + U32 global_x; + U32 global_y; + from_region_handle(region_handle, &global_x, &global_y); + U16 grid_x = (U16)(global_x / REGION_WIDTH_UNITS); + U16 grid_y = (U16)(global_y / REGION_WIDTH_UNITS); + + sendMapBlockRequest(grid_x, grid_y, grid_x, grid_y, true); +} + // public void LLWorldMap::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) { @@ -566,17 +588,6 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) found_null_sim = true; } - else if(gWorldMap->mSLURLCallback != NULL) - { - // Server returns definitive capitalization, SLURL might - // not have that. - if (!stricmp(gWorldMap->mSLURLRegionName.c_str(), name)) - { - gWorldMap->mSLURLCallback(handle, gWorldMap->mSLURL, image_id, gWorldMap->mSLURLTeleport); - gWorldMap->mSLURLCallback = NULL; - gWorldMap->mSLURLRegionName.clear(); - } - } else { adjust = gWorldMap->extendAABB(x_meters, @@ -642,6 +653,22 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) } } } + + if(gWorldMap->mSLURLCallback != NULL) + { + // Server returns definitive capitalization, SLURL might + // not have that. + if (!stricmp(gWorldMap->mSLURLRegionName.c_str(), name) || (gWorldMap->mSLURLRegionHandle == handle)) + { + url_callback_t callback = gWorldMap->mSLURLCallback; + + gWorldMap->mSLURLCallback = NULL; + gWorldMap->mSLURLRegionName.clear(); + gWorldMap->mSLURLRegionHandle = 0; + + callback(handle, gWorldMap->mSLURL, image_id, gWorldMap->mSLURLTeleport); + } + } } if(adjust) gFloaterWorldMap->adjustZoomSliderBounds(); diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index b0c6f352b0..3c9dc781fa 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -153,6 +153,10 @@ public: url_callback_t callback, const std::string& callback_url, bool teleport); + void sendHandleRegionRequest(U64 region_handle, + url_callback_t callback, + const std::string& callback_url, + bool teleport); void sendItemRequest(U32 type, U64 handle = 0); static void processMapLayerReply(LLMessageSystem*, void**); @@ -217,6 +221,7 @@ private: // search for named region for url processing std::string mSLURLRegionName; + U64 mSLURLRegionHandle; std::string mSLURL; url_callback_t mSLURLCallback; bool mSLURLTeleport; -- cgit v1.2.3