aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/newview/llviewerwindow.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/newview/llviewerwindow.cpp')
-rw-r--r--linden/indra/newview/llviewerwindow.cpp98
1 files changed, 57 insertions, 41 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index fb52827..49abf13 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -2,6 +2,8 @@
2 * @file llviewerwindow.cpp 2 * @file llviewerwindow.cpp
3 * @brief Implementation of the LLViewerWindow class. 3 * @brief Implementation of the LLViewerWindow class.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,15 +26,11 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
30 33
31// system library includes
32#include <stdio.h>
33#include <iostream>
34#include <fstream>
35
36#include "llviewerwindow.h" 34#include "llviewerwindow.h"
37#include "llviewquery.h" 35#include "llviewquery.h"
38#include "llxmltree.h" 36#include "llxmltree.h"
@@ -156,6 +154,7 @@
156#include "lltoolview.h" 154#include "lltoolview.h"
157#include "llvieweruictrlfactory.h" 155#include "llvieweruictrlfactory.h"
158#include "lluploaddialog.h" 156#include "lluploaddialog.h"
157#include "llurldispatcher.h" // SLURL from other app instance
159#include "llviewercamera.h" 158#include "llviewercamera.h"
160#include "llviewergesture.h" 159#include "llviewergesture.h"
161#include "llviewerimagelist.h" 160#include "llviewerimagelist.h"
@@ -1219,6 +1218,10 @@ void LLViewerWindow::handleFocus(LLWindow *window)
1219 { 1218 {
1220 gKeyboard->resetMaskKeys(); 1219 gKeyboard->resetMaskKeys();
1221 } 1220 }
1221
1222 // resume foreground running timer
1223 // since we artifically limit framerate when not frontmost
1224 gForegroundTime.unpause();
1222} 1225}
1223 1226
1224// The top-level window has lost focus (e.g. via ALT-TAB) 1227// The top-level window has lost focus (e.g. via ALT-TAB)
@@ -1252,6 +1255,9 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
1252 { 1255 {
1253 gKeyboard->resetKeys(); 1256 gKeyboard->resetKeys();
1254 } 1257 }
1258
1259 // pause timer that tracks total foreground running time
1260 gForegroundTime.pause();
1255} 1261}
1256 1262
1257 1263
@@ -1329,10 +1335,16 @@ BOOL LLViewerWindow::handleActivate(LLWindow *window, BOOL activated)
1329 else 1335 else
1330 { 1336 {
1331 mActive = FALSE; 1337 mActive = FALSE;
1332 if (gAllowIdleAFK) { 1338 if (gAllowIdleAFK)
1339 {
1333 gAgent.setAFK(); 1340 gAgent.setAFK();
1334 } 1341 }
1342
1343 // SL-53351: Make sure we're not in mouselook when minimised, to prevent control issues
1344 gAgent.changeCameraToDefault();
1345
1335 send_agent_pause(); 1346 send_agent_pause();
1347
1336 if (mWindow->getFullscreen() && !mIgnoreActivate) 1348 if (mWindow->getFullscreen() && !mIgnoreActivate)
1337 { 1349 {
1338 llinfos << "Stopping GL during deactivation" << llendl; 1350 llinfos << "Stopping GL during deactivation" << llendl;
@@ -1414,22 +1426,14 @@ void LLViewerWindow::handleWindowUnblock(LLWindow *window)
1414 1426
1415void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data) 1427void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
1416{ 1428{
1429 const S32 SLURL_MESSAGE_TYPE = 0;
1417 switch (data_type) 1430 switch (data_type)
1418 { 1431 {
1419 case 0: 1432 case SLURL_MESSAGE_TYPE:
1420 // received URL 1433 // received URL
1421 if (LLURLSimString::unpack_data(data)) 1434 std::string url = (const char*)data;
1435 if (LLURLDispatcher::dispatch(url))
1422 { 1436 {
1423 if(gFloaterWorldMap)
1424 {
1425 gFloaterWorldMap->trackURL(LLURLSimString::sInstance.mSimName,
1426 LLURLSimString::sInstance.mX,
1427 LLURLSimString::sInstance.mY,
1428 LLURLSimString::sInstance.mZ);
1429
1430 LLFloaterWorldMap::show(NULL, TRUE);
1431 }
1432
1433 // bring window to foreground, as it has just been "launched" from a URL 1437 // bring window to foreground, as it has just been "launched" from a URL
1434 mWindow->bringToFront(); 1438 mWindow->bringToFront();
1435 } 1439 }
@@ -1820,6 +1824,8 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
1820 1824
1821 adjust_rect_top_right("FloaterMapRect", window); 1825 adjust_rect_top_right("FloaterMapRect", window);
1822 1826
1827 adjust_rect_top_right("FloaterLagMeter", window);
1828
1823 adjust_rect_top_left("FloaterBuildOptionsRect", window); 1829 adjust_rect_top_left("FloaterBuildOptionsRect", window);
1824 1830
1825 // bottom-right 1831 // bottom-right
@@ -3106,7 +3112,6 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point)
3106// render_hud_elements: FALSE, FALSE, FALSE 3112// render_hud_elements: FALSE, FALSE, FALSE
3107void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud ) 3113void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud )
3108{ 3114{
3109 LLViewerObject* object;
3110 LLObjectSelectionHandle selection = gSelectMgr->getSelection(); 3115 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
3111 3116
3112 if (!for_hud && !for_gl_pick) 3117 if (!for_hud && !for_gl_pick)
@@ -3162,34 +3167,41 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
3162 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 3167 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom;
3163 glScalef(zoom, zoom, zoom); 3168 glScalef(zoom, zoom, zoom);
3164 } 3169 }
3165 for( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() ) 3170
3171 struct f : public LLSelectedObjectFunctor
3166 { 3172 {
3167 LLDrawable* drawable = object->mDrawable; 3173 virtual bool apply(LLViewerObject* object)
3168 if (drawable && drawable->isLight())
3169 { 3174 {
3170 LLVOVolume* vovolume = drawable->getVOVolume(); 3175 LLDrawable* drawable = object->mDrawable;
3171 glPushMatrix(); 3176 if (drawable && drawable->isLight())
3177 {
3178 LLVOVolume* vovolume = drawable->getVOVolume();
3179 glPushMatrix();
3172 3180
3173 LLVector3 center = drawable->getPositionAgent(); 3181 LLVector3 center = drawable->getPositionAgent();
3174 glTranslatef(center[0], center[1], center[2]); 3182 glTranslatef(center[0], center[1], center[2]);
3175 F32 scale = vovolume->getLightRadius(); 3183 F32 scale = vovolume->getLightRadius();
3176 glScalef(scale, scale, scale); 3184 glScalef(scale, scale, scale);
3177 3185
3178 LLColor4 color(vovolume->getLightColor(), .5f); 3186 LLColor4 color(vovolume->getLightColor(), .5f);
3179 glColor4fv(color.mV); 3187 glColor4fv(color.mV);
3180 3188
3181 F32 pixel_area = 100000.f; 3189 F32 pixel_area = 100000.f;
3182 // Render Outside 3190 // Render Outside
3183 gSphere.render(pixel_area); 3191 gSphere.render(pixel_area);
3184 3192
3185 // Render Inside 3193 // Render Inside
3186 glCullFace(GL_FRONT); 3194 glCullFace(GL_FRONT);
3187 gSphere.render(pixel_area); 3195 gSphere.render(pixel_area);
3188 glCullFace(GL_BACK); 3196 glCullFace(GL_BACK);
3189 3197
3190 glPopMatrix(); 3198 glPopMatrix();
3199 }
3200 return true;
3191 } 3201 }
3192 } 3202 } func;
3203 gSelectMgr->getSelection()->applyToObjects(&func);
3204
3193 glPopMatrix(); 3205 glPopMatrix();
3194 } 3206 }
3195 3207
@@ -3212,8 +3224,12 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls,
3212 BOOL all_selected_objects_move = TRUE; 3224 BOOL all_selected_objects_move = TRUE;
3213 BOOL all_selected_objects_modify = TRUE; 3225 BOOL all_selected_objects_modify = TRUE;
3214 BOOL selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); 3226 BOOL selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts");
3215 for( object = gSelectMgr->getSelection()->getFirstObject(); object; object = gSelectMgr->getSelection()->getNextObject() ) 3227
3228 for (LLObjectSelection::iterator iter = gSelectMgr->getSelection()->begin();
3229 iter != gSelectMgr->getSelection()->end(); iter++)
3216 { 3230 {
3231 LLSelectNode* nodep = *iter;
3232 LLViewerObject* object = nodep->getObject();
3217 BOOL this_object_movable = FALSE; 3233 BOOL this_object_movable = FALSE;
3218 if (object->permMove() && (object->permModify() || selecting_linked_set)) 3234 if (object->permMove() && (object->permModify() || selecting_linked_set))
3219 { 3235 {