diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llglsandbox.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llglsandbox.cpp | 142 |
1 files changed, 19 insertions, 123 deletions
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index cc4ec9d..decbdd9 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp | |||
@@ -181,15 +181,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
181 | F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); | 181 | F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); |
182 | select_dist_squared = select_dist_squared * select_dist_squared; | 182 | select_dist_squared = select_dist_squared * select_dist_squared; |
183 | 183 | ||
184 | x = llround((F32)x * LLUI::sGLScaleFactor.mV[VX]); | ||
185 | y = llround((F32)y * LLUI::sGLScaleFactor.mV[VY]); | ||
186 | |||
187 | BOOL deselect = (mask == MASK_CONTROL); | 184 | BOOL deselect = (mask == MASK_CONTROL); |
188 | S32 left = llmin(x, mDragStartX); | 185 | S32 left = llmin(x, mDragStartX); |
189 | S32 right = llmax(x, mDragStartX); | 186 | S32 right = llmax(x, mDragStartX); |
190 | S32 top = llmax(y, mDragStartY); | 187 | S32 top = llmax(y, mDragStartY); |
191 | S32 bottom =llmin(y, mDragStartY); | 188 | S32 bottom =llmin(y, mDragStartY); |
192 | 189 | ||
190 | left = llround((F32) left * LLUI::sGLScaleFactor.mV[VX]); | ||
191 | right = llround((F32) right * LLUI::sGLScaleFactor.mV[VX]); | ||
192 | top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]); | ||
193 | bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]); | ||
194 | |||
193 | F32 old_far_plane = gCamera->getFar(); | 195 | F32 old_far_plane = gCamera->getFar(); |
194 | F32 old_near_plane = gCamera->getNear(); | 196 | F32 old_near_plane = gCamera->getNear(); |
195 | 197 | ||
@@ -245,9 +247,11 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
245 | 247 | ||
246 | if (shrink_selection) | 248 | if (shrink_selection) |
247 | { | 249 | { |
248 | for (LLViewerObject* vobjp = gSelectMgr->getFirstHighlightedObject(); | 250 | LLObjectSelectionHandle highlighted_objects = gSelectMgr->getHighlightedObjects(); |
251 | |||
252 | for (LLViewerObject* vobjp = highlighted_objects->getFirstObject(); | ||
249 | vobjp; | 253 | vobjp; |
250 | vobjp = gSelectMgr->getNextHighlightedObject()) | 254 | vobjp = highlighted_objects->getNextObject()) |
251 | { | 255 | { |
252 | LLDrawable* drawable = vobjp->mDrawable; | 256 | LLDrawable* drawable = vobjp->mDrawable; |
253 | if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment()) | 257 | if (!drawable || vobjp->getPCode() != LL_PCODE_VOLUME || vobjp->isAttachment()) |
@@ -255,7 +259,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
255 | continue; | 259 | continue; |
256 | } | 260 | } |
257 | 261 | ||
258 | S32 result = gCamera->sphereInFrustum(drawable->getWorldPosition(), drawable->getRadius()); | 262 | S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); |
259 | switch (result) | 263 | switch (result) |
260 | { | 264 | { |
261 | case 0: | 265 | case 0: |
@@ -278,11 +282,16 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
278 | { | 282 | { |
279 | std::vector<LLDrawable*> potentials; | 283 | std::vector<LLDrawable*> potentials; |
280 | 284 | ||
281 | if (gPipeline.mObjectPartition) | 285 | |
286 | for (U32 i = 0; i < LLPipeline::NUM_PARTITIONS-1; i++) | ||
282 | { | 287 | { |
283 | gPipeline.mObjectPartition->cull(*gCamera, &potentials, TRUE); | 288 | LLSpatialPartition* part = gPipeline.getSpatialPartition(i); |
289 | if (part) | ||
290 | { | ||
291 | part->cull(*gCamera, &potentials, TRUE); | ||
292 | } | ||
284 | } | 293 | } |
285 | 294 | ||
286 | for (std::vector<LLDrawable*>::iterator iter = potentials.begin(); | 295 | for (std::vector<LLDrawable*>::iterator iter = potentials.begin(); |
287 | iter != potentials.end(); iter++) | 296 | iter != potentials.end(); iter++) |
288 | { | 297 | { |
@@ -302,7 +311,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
302 | continue; | 311 | continue; |
303 | } | 312 | } |
304 | 313 | ||
305 | S32 result = gCamera->sphereInFrustum(drawable->getWorldPosition(), drawable->getRadius()); | 314 | S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); |
306 | if (result) | 315 | if (result) |
307 | { | 316 | { |
308 | switch (result) | 317 | switch (result) |
@@ -956,119 +965,6 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV | |||
956 | glEnd(); | 965 | glEnd(); |
957 | } | 966 | } |
958 | 967 | ||
959 | |||
960 | const S32 CLIENT_RECT_VPAD = 4; | ||
961 | void LLPreviewTexture::draw() | ||
962 | { | ||
963 | if( getVisible() ) | ||
964 | { | ||
965 | updateAspectRatio(); | ||
966 | |||
967 | LLPreview::draw(); | ||
968 | |||
969 | if (!mMinimized) | ||
970 | { | ||
971 | LLGLSUIDefault gls_ui; | ||
972 | LLGLSNoTexture gls_notex; | ||
973 | |||
974 | const LLRect& border = mClientRect; | ||
975 | LLRect interior = mClientRect; | ||
976 | interior.stretch( -PREVIEW_BORDER_WIDTH ); | ||
977 | |||
978 | // ...border | ||
979 | gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f)); | ||
980 | gl_rect_2d_checkerboard( interior ); | ||
981 | |||
982 | if ( mImage.notNull() ) | ||
983 | { | ||
984 | LLGLSTexture gls_no_texture; | ||
985 | // Draw the texture | ||
986 | glColor3f( 1.f, 1.f, 1.f ); | ||
987 | gl_draw_scaled_image(interior.mLeft, | ||
988 | interior.mBottom, | ||
989 | interior.getWidth(), | ||
990 | interior.getHeight(), | ||
991 | mImage); | ||
992 | |||
993 | // Pump the texture priority | ||
994 | F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); | ||
995 | mImage->addTextureStats( pixel_area ); | ||
996 | |||
997 | // Don't bother decoding more than we can display, unless | ||
998 | // we're loading the full image. | ||
999 | if (!mLoadingFullImage) | ||
1000 | { | ||
1001 | S32 int_width = interior.getWidth(); | ||
1002 | S32 int_height = interior.getHeight(); | ||
1003 | mImage->setKnownDrawSize(int_width, int_height); | ||
1004 | } | ||
1005 | else | ||
1006 | { | ||
1007 | // Don't use this feature | ||
1008 | mImage->setKnownDrawSize(0, 0); | ||
1009 | } | ||
1010 | |||
1011 | if( mLoadingFullImage ) | ||
1012 | { | ||
1013 | LLFontGL::sSansSerif->renderUTF8("Receiving:", 0, | ||
1014 | interior.mLeft + 4, | ||
1015 | interior.mBottom + 4, | ||
1016 | LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, | ||
1017 | LLFontGL::DROP_SHADOW); | ||
1018 | |||
1019 | F32 data_progress = 0.0f; | ||
1020 | F32 decode_progress = mImage->getDecodeProgress(&data_progress); | ||
1021 | |||
1022 | // Draw the progress bar. | ||
1023 | const S32 BAR_HEIGHT = 12; | ||
1024 | const S32 BAR_LEFT_PAD = 80; | ||
1025 | S32 left = interior.mLeft + 4 + BAR_LEFT_PAD; | ||
1026 | S32 bar_width = mRect.getWidth() - left - RESIZE_HANDLE_WIDTH - 2; | ||
1027 | S32 top = interior.mBottom + 4 + BAR_HEIGHT; | ||
1028 | S32 right = left + bar_width; | ||
1029 | S32 bottom = top - BAR_HEIGHT; | ||
1030 | |||
1031 | LLColor4 background_color(0.f, 0.f, 0.f, 0.75f); | ||
1032 | LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f); | ||
1033 | LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f); | ||
1034 | |||
1035 | gl_rect_2d(left, top, right, bottom, background_color); | ||
1036 | |||
1037 | if (data_progress > 0.0f) | ||
1038 | { | ||
1039 | // Decoded bytes | ||
1040 | right = left + llfloor(decode_progress * (F32)bar_width); | ||
1041 | |||
1042 | if (left < right) | ||
1043 | { | ||
1044 | gl_rect_2d(left, top, right, bottom, decoded_color); | ||
1045 | } | ||
1046 | |||
1047 | // Downloaded bytes | ||
1048 | left = right; | ||
1049 | right = left + llfloor((data_progress - decode_progress) * (F32)bar_width); | ||
1050 | |||
1051 | if (left < right) | ||
1052 | { | ||
1053 | gl_rect_2d(left, top, right, bottom, downloaded_color); | ||
1054 | } | ||
1055 | } | ||
1056 | } | ||
1057 | else | ||
1058 | if( !mSavedFileTimer.hasExpired() ) | ||
1059 | { | ||
1060 | LLFontGL::sSansSerif->renderUTF8("File Saved", 0, | ||
1061 | interior.mLeft + 4, | ||
1062 | interior.mBottom + 4, | ||
1063 | LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, | ||
1064 | LLFontGL::DROP_SHADOW); | ||
1065 | } | ||
1066 | } | ||
1067 | } | ||
1068 | } | ||
1069 | } | ||
1070 | |||
1071 | |||
1072 | void draw_line_cube(F32 width, const LLVector3& center) | 968 | void draw_line_cube(F32 width, const LLVector3& center) |
1073 | { | 969 | { |
1074 | width = 0.5f * width; | 970 | width = 0.5f * width; |