diff options
author | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2007-11-09 01:56:15 +0000 |
commit | c1920e3c1c60fb792cf091750b05de618b355878 (patch) | |
tree | 204b78e0f0b87fb2875b90af0f579d53e3138cbb /indra/newview | |
parent | 760f2ceb1518d87e865f25ac87a540625e974517 (diff) |
EFFECTIVE MERGE: svn merge -r 70833:71458 svn+ssh://svn/svn/linden/branches/maintenance-2 into release
ACTUAL MERGE: svn merge -r 73210:73222 svn+ssh://svn/svn/linden/qa/maintenance-2-merge-73206 into release
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llagent.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llagent.h | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterfriends.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 6 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 16 | ||||
-rw-r--r-- | indra/newview/lltoolmgr.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltoolmgr.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenufile.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 36 |
10 files changed, 82 insertions, 47 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 54f6741fee..d7e316438c 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -527,6 +527,21 @@ void LLAgent::resetView(BOOL reset_camera) } } +// Handle any actions that need to be performed when the main app gains focus +// (such as through alt-tab). +//----------------------------------------------------------------------------- +// onAppFocusGained() +//----------------------------------------------------------------------------- +void LLAgent::onAppFocusGained() +{ + if (CAMERA_MODE_MOUSELOOK == mCameraMode) + { + changeCameraToDefault(); + gToolMgr->clearSavedTool(); + } +} + + void LLAgent::ageChat() { if (mAvatarObject) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index ad0606aea2..c6de97fede 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -141,6 +141,8 @@ public: // default position behind the avatar. void unlockView(); + void onAppFocusGained(); + void sendMessage(); // Send message to this agent's region. void sendReliableMessage(); diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 6f792e062f..6f4945e54b 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -61,19 +61,43 @@ //Maximum number of people you can select to do an operation on at once. #define MAX_FRIEND_SELECT 20 #define RIGHTS_CHANGE_TIMEOUT 5.0 +#define OBSERVER_TIMEOUT 0.5 // simple class to observe the calling cards. -class LLLocalFriendsObserver : public LLFriendObserver +class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer { -public: - LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater) {} - virtual ~LLLocalFriendsObserver() { mFloater = NULL; } +public: + LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT) + { + mEventTimer.stop(); + } + virtual ~LLLocalFriendsObserver() + { + mFloater = NULL; + } virtual void changed(U32 mask) { - mFloater->updateFriends(mask); + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); + mEventTimer.reset(); + + // save-up all the mask-bits which have come-in + mMask |= mask; + } + virtual BOOL tick() + { + mFloater->updateFriends(mMask); + + mEventTimer.stop(); + mMask = 0; + + return FALSE; } + protected: LLPanelFriends* mFloater; + U32 mMask; }; LLPanelFriends::LLPanelFriends() : diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0111676a97..d5af7243a0 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2162,17 +2162,17 @@ BOOL idle_startup() if (url_ok) { args["[TYPE]"] = "desired"; - args["[HELP]"] = " "; + args["[HELP]"] = ""; } else if (gSavedSettings.getBOOL("LoginLastLocation")) { args["[TYPE]"] = "last"; - args["[HELP]"] = " \n "; + args["[HELP]"] = ""; } else { args["[TYPE]"] = "home"; - args["[HELP]"] = " \nYou may want to set a new home location.\n "; + args["[HELP]"] = "\nYou may want to set a new home location."; } gViewerWindow->alertXml("AvatarMoved", args); } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index ae42ec60d3..9464146742 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1294,11 +1294,21 @@ bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 pri return false; } } - // If the requester knows the dimentions of the image, - // this will calculate how much data we need without having to parse the header + S32 desired_size; - if (w*h*c > 0) + if ((discard == 0) && worker && worker->mFileSize) + { + // if we want the entire image, and we know its size, then get it all + // (calcDataSizeJ2C() below makes assumptions about how the image + // was compressed - this code ensures that when we request the entire image, + // we really do get it.) + desired_size = worker->mFileSize; + } + else if (w*h*c > 0) { + // If the requester knows the dimentions of the image, + // this will calculate how much data we need without having to parse the header + desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, discard); } else diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index ae74eba026..0e46ece794 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -428,6 +428,11 @@ void LLToolMgr::onAppFocusGained() updateToolStatus(); } +void LLToolMgr::clearSavedTool() +{ + mSavedTool = NULL; +} + ///////////////////////////////////////////////////// // LLToolset diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index e0f554d5b6..557208be7b 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -70,6 +70,8 @@ public: void onAppFocusGained(); void onAppFocusLost(); + void clearSavedTool(); + protected: friend class LLToolset; // to allow access to setCurrentTool(); void setCurrentTool(LLTool* tool); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index ac4ac77f0c..13ff55ce1c 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -348,6 +348,16 @@ class LLFileCloseWindow : public view_listener_t } }; +class LLFileEnableCloseAllWindows : public view_listener_t +{ + bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) + { + bool open_children = gFloaterView->allChildrenClosed(); + gMenuHolder->findControl(userdata["control"].asString())->setValue(!open_children); + return true; + } +}; + class LLFileCloseAllWindows : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) @@ -1036,6 +1046,7 @@ void init_menu_file() (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); (new LLFileCloseAllWindows())->registerListener(gMenuHolder, "File.CloseAllWindows"); (new LLFileEnableCloseWindow())->registerListener(gMenuHolder, "File.EnableCloseWindow"); + (new LLFileEnableCloseAllWindows())->registerListener(gMenuHolder, "File.EnableCloseAllWindows"); (new LLFileSaveTexture())->registerListener(gMenuHolder, "File.SaveTexture"); (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e7e2151353..74788f6f26 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1221,6 +1221,8 @@ void LLViewerWindow::handleFocus(LLWindow *window) { gFocusMgr.setAppHasFocus(TRUE); LLModalDialog::onAppFocusGained(); + + gAgent.onAppFocusGained(); if (gToolMgr) { gToolMgr->onAppFocusGained(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 559db5fc89..e9faccb4da 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -385,22 +385,14 @@ void LLPipeline::releaseGLBuffers() if (mCubeFrameBuffer) { -#if !defined(__sparc) glDeleteFramebuffersEXT(1, &mCubeFrameBuffer); glDeleteRenderbuffersEXT(1, &mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif mCubeDepth = mCubeFrameBuffer = 0; } if (mFramebuffer[0]) { -#if !defined(__sparc) glDeleteFramebuffersEXT(2, mFramebuffer); -#else -#error Can we generalize this without a CPU architecture test? -#endif mFramebuffer[0] = mFramebuffer[1] = 0; } } @@ -3778,12 +3770,8 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, BOOL reattach = FALSE; if (mCubeFrameBuffer == 0) { -#if !defined(__sparc) glGenFramebuffersEXT(1, &mCubeFrameBuffer); glGenRenderbuffersEXT(1, &mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif reattach = TRUE; } @@ -3854,7 +3842,6 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, if (reattach) { -#if !defined(__sparc) glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, mCubeDepth); GLint res_x, res_y; glGetRenderbufferParameterivEXT(GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, &res_x); @@ -3866,22 +3853,15 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, } glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif } for (S32 i = 0; i < 6; i++) { -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mCubeFrameBuffer); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, cube_face[i], cube_map->getGLName(), 0); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, mCubeDepth); -#else -#error Can we generalize this without a CPU architecture test? -#endif glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.f, 1.f, 0.1f, 1024.f); @@ -3901,11 +3881,7 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam, gPipeline.renderGeom(cube_cam); } -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif cube_cam.setOrigin(origin); gPipeline.resetDrawOrders(); @@ -4114,14 +4090,10 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, LLGLDisable blend(GL_BLEND); LLGLDisable cull(GL_CULL_FACE); -#if !defined(__sparc) if (mFramebuffer[0] == 0) { glGenFramebuffersEXT(2, mFramebuffer); } -#else -#error Can we generalize this without a CPU architecture test? -#endif GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); @@ -4144,15 +4116,11 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, for (S32 i = 0; i < kernel; i++) { -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFramebuffer[i%2]); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, i%2 == 0 ? buffer : dest, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif glBindTexture(GL_TEXTURE_2D, i == 0 ? source : i%2==0 ? dest : @@ -4179,11 +4147,7 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, } -#if !defined(__sparc) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); -#else -#error Can we generalize this without a CPU architecture test? -#endif gGlowProgram.unbind(); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); |