diff options
39 files changed, 1055 insertions, 466 deletions
diff --git a/indra/llmessage/tests/llareslistener_test.cpp b/indra/llmessage/tests/llareslistener_test.cpp index ac4886ccf4..6ee74c8e7a 100644 --- a/indra/llmessage/tests/llareslistener_test.cpp +++ b/indra/llmessage/tests/llareslistener_test.cpp @@ -4,7 +4,7 @@ * @date 2009-02-26 * @brief Tests of llareslistener.h. * - * $LicenseInfo:firstyear=2009&license=internal$ + * $LicenseInfo:firstyear=2009&license=viewergpl$ * Copyright (c) 2009, Linden Research, Inc. * $/LicenseInfo$ */ diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 25f8320b02..b6a6b448ee 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -151,16 +151,14 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } } - gGL.pushUIMatrix(); - - gGL.loadUIIdentity(); - - gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); + gGL.pushMatrix(); + glLoadIdentity(); + gGL.translatef(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ); // this code snaps the text origin to a pixel grid to start with F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); - gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f); + gGL.translatef(-pixel_offset_x, -pixel_offset_y, 0.f); LLFastTimer t(FTM_RENDER_FONTS); @@ -248,6 +246,9 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } + // Remember last-used texture to avoid unnecesssary bind calls. + LLImageGL *last_bound_texture = NULL; + for (i = begin_offset; i < begin_offset + length; i++) { llwchar wch = wstr[i]; @@ -260,8 +261,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons } // Per-glyph bitmap texture. LLImageGL *image_gl = mFontFreetype->getFontBitmapCache()->getImageGL(fgi->mBitmapNum); - gGL.getTexUnit(0)->bind(image_gl); - + if (last_bound_texture != image_gl) + { + gGL.getTexUnit(0)->bind(image_gl); + last_bound_texture = image_gl; + } + if ((start_x + scaled_max_pixels) < (cur_x + fgi->mXBearing + fgi->mWidth)) { // Not enough room for this character. @@ -325,7 +330,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons // recursively render ellipses at end of string // we've already reserved enough room - gGL.pushUIMatrix(); + gGL.pushMatrix(); + //glLoadIdentity(); + //gGL.translatef(sCurOrigin.mX, sCurOrigin.mY, 0.0f); + //glScalef(sScaleX, sScaleY, 1.f); renderUTF8(std::string("..."), 0, cur_x / sScaleX, (F32)y, @@ -336,10 +344,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons S32_MAX, max_pixels, right_x, FALSE); - gGL.popUIMatrix(); + gGL.popMatrix(); } - gGL.popUIMatrix(); + gGL.popMatrix(); return chars_drawn; } diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 55c5b4531b..04ba63dd34 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -49,9 +49,6 @@ F64 gGLLastProjection[16]; F64 gGLProjection[16]; S32 gGLViewport[4]; -U32 LLRender::sUICalls = 0; -U32 LLRender::sUIVerts = 0; - static const U32 LL_NUM_TEXTURE_LAYERS = 16; static GLenum sGLTextureType[] = @@ -258,9 +255,10 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) return false ; } + gGL.flush(); + if ((mCurrTexture != texture->getTexName()) || forceBind) { - gGL.flush(); activate(); enable(texture->getTarget()); mCurrTexture = texture->getTexName(); @@ -447,8 +445,6 @@ void LLTexUnit::setTextureBlendType(eTextureBlendType type) return; } - gGL.flush(); - activate(); mCurrBlendType = type; S32 scale_amount = 1; @@ -763,8 +759,6 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrBlendSFactor = BF_ONE; - mCurrBlendDFactor = BF_ZERO; } LLRender::~LLRender() @@ -827,80 +821,6 @@ void LLRender::popMatrix() glPopMatrix(); } -void LLRender::translateUI(F32 x, F32 y, F32 z) -{ - if (mUIOffset.empty()) - { - llerrs << "Need to push a UI translation frame before offsetting" << llendl; - } - - mUIOffset.front().mV[0] += x; - mUIOffset.front().mV[1] += y; - mUIOffset.front().mV[2] += z; -} - -void LLRender::scaleUI(F32 x, F32 y, F32 z) -{ - if (mUIScale.empty()) - { - llerrs << "Need to push a UI transformation frame before scaling." << llendl; - } - - mUIScale.front().scaleVec(LLVector3(x,y,z)); -} - -void LLRender::pushUIMatrix() -{ - mUIOffset.push_front(mUIOffset.front()); - if (mUIScale.empty()) - { - mUIScale.push_front(LLVector3(1,1,1)); - } - else - { - mUIScale.push_front(mUIScale.front()); - } -} - -void LLRender::popUIMatrix() -{ - if (mUIOffset.empty()) - { - llerrs << "UI offset stack blown." << llendl; - } - mUIOffset.pop_front(); - mUIScale.pop_front(); -} - -LLVector3 LLRender::getUITranslation() -{ - if (mUIOffset.empty()) - { - llerrs << "UI offset stack empty." << llendl; - } - return mUIOffset.front(); -} - -LLVector3 LLRender::getUIScale() -{ - if (mUIScale.empty()) - { - llerrs << "UI scale stack empty." << llendl; - } - return mUIScale.front(); -} - - -void LLRender::loadUIIdentity() -{ - if (mUIOffset.empty()) - { - llerrs << "Need to push UI translation frame before clearing offset." << llendl; - } - mUIOffset.front().setVec(0,0,0); - mUIScale.front().setVec(1,1,1); -} - void LLRender::setColorMask(bool writeColor, bool writeAlpha) { setColorMask(writeColor, writeColor, writeColor, writeAlpha); @@ -923,6 +843,7 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB void LLRender::setSceneBlendType(eBlendType type) { + flush(); switch (type) { case BT_ALPHA: @@ -1096,12 +1017,6 @@ void LLRender::flush() } #endif - if (!mUIOffset.empty()) - { - sUICalls++; - sUIVerts += mCount; - } - mBuffer->setBuffer(immediate_mask); mBuffer->drawArrays(mMode, 0, mCount); @@ -1121,16 +1036,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) return; } - if (mUIOffset.empty()) - { - mVerticesp[mCount] = LLVector3(x,y,z); - } - else - { - LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.front()).scaledVec(mUIScale.front()); - mVerticesp[mCount] = vert; - } - + mVerticesp[mCount] = LLVector3(x,y,z); mCount++; if (mCount < 4096) { diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index a70ccf4d80..0121a190ee 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -286,14 +286,6 @@ public: void pushMatrix(); void popMatrix(); - void translateUI(F32 x, F32 y, F32 z); - void scaleUI(F32 x, F32 y, F32 z); - void pushUIMatrix(); - void popUIMatrix(); - void loadUIIdentity(); - LLVector3 getUITranslation(); - LLVector3 getUIScale(); - void flush(); void begin(const GLuint& mode); @@ -341,9 +333,7 @@ public: }; public: - static U32 sUICalls; - static U32 sUIVerts; - + private: bool mDirty; U32 mCount; @@ -360,14 +350,7 @@ private: std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; - U32 mCurrBlendSFactor; - U32 mCurrBlendDFactor; - F32 mMaxAnisotropy; - - std::list<LLVector3> mUIOffset; - std::list<LLVector3> mUIScale; - }; extern F64 gGLModelView[16]; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 22d3af3e6b..76f07373b4 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -39,7 +39,6 @@ // Linden library includes #include "v2math.h" -#include "m3math.h" #include "v4color.h" #include "llrender.h" #include "llrect.h" @@ -181,19 +180,19 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, const LL void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixel_offset, BOOL filled) { - gGL.pushUIMatrix(); + gGL.pushMatrix(); left += LLFontGL::sCurOrigin.mX; right += LLFontGL::sCurOrigin.mX; bottom += LLFontGL::sCurOrigin.mY; top += LLFontGL::sCurOrigin.mY; - gGL.loadUIIdentity(); + glLoadIdentity(); gl_rect_2d(llfloor((F32)left * LLUI::sGLScaleFactor.mV[VX]) - pixel_offset, llfloor((F32)top * LLUI::sGLScaleFactor.mV[VY]) + pixel_offset, llfloor((F32)right * LLUI::sGLScaleFactor.mV[VX]) + pixel_offset, llfloor((F32)bottom * LLUI::sGLScaleFactor.mV[VY]) - pixel_offset, filled); - gGL.popUIMatrix(); + gGL.popMatrix(); } @@ -509,9 +508,9 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); } - gGL.pushUIMatrix(); + gGL.pushMatrix(); { - gGL.translateUI((F32)x, (F32)y, 0.f); + gGL.translatef((F32)x, (F32)y, 0.f); gGL.getTexUnit(0)->bind(image); @@ -638,7 +637,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex } gGL.end(); } - gGL.popUIMatrix(); + gGL.popMatrix(); if (solid_color) { @@ -661,72 +660,39 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre LLGLSUIDefault gls_ui; - - gGL.getTexUnit(0)->bind(image); - - gGL.color4fv(color.mV); - - if (degrees == 0.f) + gGL.pushMatrix(); { - gGL.pushUIMatrix(); - gGL.translateUI((F32)x, (F32)y, 0.f); - - gGL.begin(LLRender::QUADS); + gGL.translatef((F32)x, (F32)y, 0.f); + if( degrees ) { - gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2i(width, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2i(0, height ); - - gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2i(0, 0); - - gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2i(width, 0); + F32 offset_x = F32(width/2); + F32 offset_y = F32(height/2); + gGL.translatef( offset_x, offset_y, 0.f); + glRotatef( degrees, 0.f, 0.f, 1.f ); + gGL.translatef( -offset_x, -offset_y, 0.f ); } - gGL.end(); - gGL.popUIMatrix(); - } - else - { - gGL.pushUIMatrix(); - gGL.translateUI((F32)x, (F32)y, 0.f); - - F32 offset_x = F32(width/2); - F32 offset_y = F32(height/2); - - gGL.translateUI(offset_x, offset_y, 0.f); - LLMatrix3 quat(0.f, 0.f, degrees*DEG_TO_RAD); - gGL.getTexUnit(0)->bind(image); gGL.color4fv(color.mV); gGL.begin(LLRender::QUADS); { - LLVector3 v; - - v = LLVector3(offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2i(width, height ); - v = LLVector3(-offset_x, offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2i(0, height ); - v = LLVector3(-offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2i(0, 0); - v = LLVector3(offset_x, -offset_y, 0.f) * quat; gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); - gGL.vertex2f(v.mV[0], v.mV[1] ); + gGL.vertex2i(width, 0); } gGL.end(); - gGL.popUIMatrix(); } + gGL.popMatrix(); } @@ -781,9 +747,9 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F end_angle += F_TWO_PI; } - gGL.pushUIMatrix(); + gGL.pushMatrix(); { - gGL.translateUI(center_x, center_y, 0.f); + gGL.translatef(center_x, center_y, 0.f); // Inexact, but reasonably fast. F32 delta = (end_angle - start_angle) / steps; @@ -814,15 +780,15 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F } gGL.end(); } - gGL.popUIMatrix(); + gGL.popMatrix(); } void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled) { - gGL.pushUIMatrix(); + gGL.pushMatrix(); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.translateUI(center_x, center_y, 0.f); + gGL.translatef(center_x, center_y, 0.f); // Inexact, but reasonably fast. F32 delta = F_TWO_PI / steps; @@ -853,7 +819,7 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled } gGL.end(); } - gGL.popUIMatrix(); + gGL.popMatrix(); } // Renders a ring with sides (tube shape) @@ -880,9 +846,9 @@ void gl_deep_circle( F32 radius, F32 depth, S32 steps ) void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor4& side_color, S32 steps, BOOL render_center ) { - gGL.pushUIMatrix(); + gGL.pushMatrix(); { - gGL.translateUI(0.f, 0.f, -width / 2); + gGL.translatef(0.f, 0.f, -width / 2); if( render_center ) { gGL.color4fv(center_color.mV); @@ -891,11 +857,11 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor else { gl_washer_2d(radius, radius - width, steps, side_color, side_color); - gGL.translateUI(0.f, 0.f, width); + gGL.translatef(0.f, 0.f, width); gl_washer_2d(radius - width, radius, steps, side_color, side_color); } } - gGL.popUIMatrix(); + gGL.popMatrix(); } // Draw gray and white checkerboard with black border @@ -1084,9 +1050,9 @@ void gl_segmented_rect_2d_tex(const S32 left, S32 width = llabs(right - left); S32 height = llabs(top - bottom); - gGL.pushUIMatrix(); + gGL.pushMatrix(); - gGL.translateUI((F32)left, (F32)bottom, 0.f); + gGL.translatef((F32)left, (F32)bottom, 0.f); LLVector2 border_uv_scale((F32)border_size / (F32)texture_width, (F32)border_size / (F32)texture_height); if (border_uv_scale.mV[VX] > 0.5f) @@ -1227,7 +1193,7 @@ void gl_segmented_rect_2d_tex(const S32 left, } gGL.end(); - gGL.popUIMatrix(); + gGL.popMatrix(); } void gl_segmented_rect_2d_fragment_tex(const S32 left, @@ -1244,9 +1210,9 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, S32 width = llabs(right - left); S32 height = llabs(top - bottom); - gGL.pushUIMatrix(); + gGL.pushMatrix(); - gGL.translateUI((F32)left, (F32)bottom, 0.f); + gGL.translatef((F32)left, (F32)bottom, 0.f); LLVector2 border_uv_scale((F32)border_size / (F32)texture_width, (F32)border_size / (F32)texture_height); if (border_uv_scale.mV[VX] > 0.5f) @@ -1417,7 +1383,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, } gGL.end(); - gGL.popUIMatrix(); + gGL.popMatrix(); } void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, @@ -1625,7 +1591,7 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::translate(F32 x, F32 y, F32 z) { - gGL.translateUI(x,y,z); + gGL.translatef(x,y,z); LLFontGL::sCurOrigin.mX += (S32) x; LLFontGL::sCurOrigin.mY += (S32) y; LLFontGL::sCurOrigin.mZ += z; @@ -1634,14 +1600,14 @@ void LLUI::translate(F32 x, F32 y, F32 z) //static void LLUI::pushMatrix() { - gGL.pushUIMatrix(); + gGL.pushMatrix(); LLFontGL::sOriginStack.push_back(LLFontGL::sCurOrigin); } //static void LLUI::popMatrix() { - gGL.popUIMatrix(); + gGL.popMatrix(); LLFontGL::sCurOrigin = *LLFontGL::sOriginStack.rbegin(); LLFontGL::sOriginStack.pop_back(); } @@ -1649,7 +1615,7 @@ void LLUI::popMatrix() //static void LLUI::loadIdentity() { - gGL.loadUIIdentity(); + glLoadIdentity(); LLFontGL::sCurOrigin.mX = 0; LLFontGL::sCurOrigin.mY = 0; LLFontGL::sCurOrigin.mZ = 0; diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp index bd9c43c97f..30717f87de 100644 --- a/indra/llui/llviewborder.cpp +++ b/indra/llui/llviewborder.cpp @@ -125,6 +125,14 @@ void LLViewBorder::draw() llassert( FALSE ); // not implemented } } + else + if( STYLE_TEXTURE == mStyle ) + { + if( mTexture ) + { + drawTextures(); + } + } LLView::draw(); } @@ -247,6 +255,56 @@ void LLViewBorder::drawTwoPixelLines() gl_line_2d(left+1, bottom+1, right-1, bottom+1); } +void LLViewBorder::drawTextures() +{ + //LLGLSUIDefault gls_ui; + + //llassert( FALSE ); // TODO: finish implementing + + //gGL.color4fv(UI_VERTEX_COLOR.mV); + + //gGL.getTexUnit(0)->bind(mTexture); + //gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP); + + //drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); + //drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); + //drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); + //drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); +} + + +void LLViewBorder::drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y ) +{ + gGL.pushMatrix(); + { + gGL.translatef(start_x, start_y, 0.f); + glRotatef( degrees, 0, 0, 1 ); + + gGL.begin(LLRender::QUADS); + { + // width, width /---------\ length-width, width // + // / \ // + // / \ // + // /---------------\ // + // 0,0 length, 0 // + + gGL.texCoord2f( 0, 0 ); + gGL.vertex2i( 0, 0 ); + + gGL.texCoord2f( (GLfloat)length, 0 ); + gGL.vertex2i( length, 0 ); + + gGL.texCoord2f( (GLfloat)(length - width), (GLfloat)width ); + gGL.vertex2i( length - width, width ); + + gGL.texCoord2f( (GLfloat)width, (GLfloat)width ); + gGL.vertex2i( width, width ); + } + gGL.end(); + } + gGL.popMatrix(); +} + BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style) { if (node->hasAttribute("bevel_style")) diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index 342e84fd93..92fd569325 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -99,7 +99,8 @@ private: void drawOnePixelLines(); void drawTwoPixelLines(); void drawTextures(); - + void drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 start_x, F32 start_y ); + EBevel mBevel; EStyle mStyle; LLUIColor mHighlightLight; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 407036f76e..0c63dc3ae3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -165,6 +165,7 @@ set(viewer_SOURCE_FILES llfloatercustomize.cpp llfloaterdaycycle.cpp llfloaterenvsettings.cpp + llfloaterevent.cpp llfloaterfonttest.cpp llfloatergesture.cpp llfloatergodtools.cpp @@ -308,7 +309,6 @@ set(viewer_SOURCE_FILES llpanelclassified.cpp llpanelcontents.cpp llpaneleditwearable.cpp - llpanelevent.cpp llpanelface.cpp llpanelgroup.cpp llpanelgroupgeneral.cpp @@ -669,6 +669,7 @@ set(viewer_HEADER_FILES llfloatercustomize.h llfloaterdaycycle.h llfloaterenvsettings.h + llfloaterevent.h llfloaterfonttest.h llfloatergesture.h llfloatergodtools.h @@ -807,7 +808,6 @@ set(viewer_HEADER_FILES llpanelclassified.h llpanelcontents.h llpaneleditwearable.h - llpanelevent.h llpanelface.h llpanelgroup.h llpanelgroupgeneral.h diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 561965d021..aea2de8e92 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -51,9 +51,6 @@ /*static*/ F32 LLVolumeImplFlexible::sUpdateFactor = 1.0f; -static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild"); -static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Update"); - // LLFlexibleObjectData::pack/unpack now in llprimitive.cpp //----------------------------------------------- @@ -197,6 +194,7 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so } } + //----------------------------------------------------------------------------- void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale) { @@ -365,7 +363,6 @@ inline S32 log2(S32 x) void LLVolumeImplFlexible::doFlexibleUpdate() { - LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE); LLVolume* volume = mVO->getVolume(); LLPath *path = &volume->getPath(); if (mSimulateRes == 0) @@ -696,10 +693,7 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) } volume->updateRelativeXform(); - { - LLFastTimer t(FTM_DO_FLEXIBLE_UPDATE); - doFlexibleUpdate(); - } + doFlexibleUpdate(); // Object may have been rotated, which means it needs a rebuild. See SL-47220 BOOL rotated = FALSE; @@ -716,10 +710,7 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) volume->regenFaces(); volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME); volume->dirtySpatialGroup(); - { - LLFastTimer t(FTM_FLEXIBLE_REBUILD); - doFlexibleRebuild(); - } + doFlexibleRebuild(); volume->genBBoxes(isVolumeGlobal()); } else if (!mUpdated || rotated) diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp new file mode 100644 index 0000000000..64efa10ef9 --- /dev/null +++ b/indra/newview/llfloaterevent.cpp @@ -0,0 +1,324 @@ +/** + * @file llfloaterevent.cpp + * @brief Display for events in the finder + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterevent.h" + +#include "message.h" +#include "llnotificationsutil.h" +#include "llui.h" + +#include "llagent.h" +#include "llviewerwindow.h" +#include "llbutton.h" +#include "llcachename.h" +#include "llcommandhandler.h" // secondlife:///app/chat/ support +#include "lleventflags.h" +#include "lleventnotifier.h" +#include "llexpandabletextbox.h" +#include "llfloater.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" +#include "llinventorymodel.h" +#include "llsecondlifeurls.h" +#include "llslurl.h" +#include "lltextbox.h" +#include "lltexteditor.h" +#include "lluiconstants.h" +#include "llviewercontrol.h" +#include "llweb.h" +#include "llworldmap.h" +#include "lluictrlfactory.h" +#include "lltrans.h" + + +class LLEventHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLEventHandler() : LLCommandHandler("event", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& params, const LLSD& query_map, + LLMediaCtrl* web) + { + if (params.size() < 1) + { + return false; + } + + LLFloaterEvent* floater = LLFloaterReg::getTypedInstance<LLFloaterEvent>("event"); + if (floater) + { + floater->setEventID(params[0].asInteger()); + LLFloaterReg::showTypedInstance<LLFloaterEvent>("event"); + return true; + } + + return false; + } +}; +LLEventHandler gEventHandler; + +LLFloaterEvent::LLFloaterEvent(const LLSD& key) + : LLFloater(key), + + mEventID(0) +{ +} + + +LLFloaterEvent::~LLFloaterEvent() +{ +} + + +BOOL LLFloaterEvent::postBuild() +{ + mTBName = getChild<LLTextBox>("event_name"); + + mTBCategory = getChild<LLTextBox>("event_category"); + + mTBDate = getChild<LLTextBox>("event_date"); + + mTBDuration = getChild<LLTextBox>("event_duration"); + + mTBDesc = getChild<LLExpandableTextBox>("event_desc"); + mTBDesc->setEnabled(FALSE); + + mTBRunBy = getChild<LLTextBox>("event_runby"); + mTBLocation = getChild<LLTextBox>("event_location"); + mTBCover = getChild<LLTextBox>("event_cover"); + + mTeleportBtn = getChild<LLButton>( "teleport_btn"); + mTeleportBtn->setClickedCallback(onClickTeleport, this); + + mMapBtn = getChild<LLButton>( "map_btn"); + mMapBtn->setClickedCallback(onClickMap, this); + + mNotifyBtn = getChild<LLButton>( "notify_btn"); + mNotifyBtn->setClickedCallback(onClickNotify, this); + + mCreateEventBtn = getChild<LLButton>( "create_event_btn"); + mCreateEventBtn->setClickedCallback(onClickCreateEvent, this); + + mGodDeleteEventBtn = getChild<LLButton>( "god_delete_event_btn"); + mGodDeleteEventBtn->setClickedCallback(boost::bind(&LLFloaterEvent::onClickDeleteEvent, this)); + + return TRUE; +} + +void LLFloaterEvent::setEventID(const U32 event_id) +{ + mEventID = event_id; + // Should reset all of the panel state here + resetInfo(); + + if (event_id != 0) + { + sendEventInfoRequest(); + } +} + +void LLFloaterEvent::onClickDeleteEvent() +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_EventGodDelete); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_EventData); + msg->addU32Fast(_PREHASH_EventID, mEventID); + + gAgent.sendReliableMessage(); +} + +void LLFloaterEvent::sendEventInfoRequest() +{ + LLMessageSystem *msg = gMessageSystem; + + msg->newMessageFast(_PREHASH_EventInfoRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); + msg->nextBlockFast(_PREHASH_EventData); + msg->addU32Fast(_PREHASH_EventID, mEventID); + gAgent.sendReliableMessage(); +} + +//static +void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **) +{ + // extract the agent id + LLUUID agent_id; + msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); + + LLFloaterEvent* floater = LLFloaterReg::getTypedInstance<LLFloaterEvent>("event"); + + if(floater) + { + floater->mEventInfo.unpack(msg); + floater->mTBName->setText(floater->mEventInfo.mName); + floater->mTBCategory->setText(floater->mEventInfo.mCategoryStr); + floater->mTBDate->setText(floater->mEventInfo.mTimeStr); + floater->mTBDesc->setText(floater->mEventInfo.mDesc); + floater->mTBRunBy->setText(LLSLURL::buildCommand("agent", floater->mEventInfo.mRunByID, "inspect")); + + floater->mTBDuration->setText(llformat("%d:%.2d", floater->mEventInfo.mDuration / 60, floater->mEventInfo.mDuration % 60)); + + if (!floater->mEventInfo.mHasCover) + { + floater->mTBCover->setText(floater->getString("none")); + } + else + { + floater->mTBCover->setText(llformat("%d", floater->mEventInfo.mCover)); + } + + F32 global_x = (F32)floater->mEventInfo.mPosGlobal.mdV[VX]; + F32 global_y = (F32)floater->mEventInfo.mPosGlobal.mdV[VY]; + + S32 region_x = llround(global_x) % REGION_WIDTH_UNITS; + S32 region_y = llround(global_y) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)floater->mEventInfo.mPosGlobal.mdV[VZ]); + + std::string desc = floater->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z); + floater->mTBLocation->setText(desc); + + if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE) + { + floater->childSetVisible("event_mature_yes", TRUE); + floater->childSetVisible("event_mature_no", FALSE); + } + else + { + floater->childSetVisible("event_mature_yes", FALSE); + floater->childSetVisible("event_mature_no", TRUE); + } + + if (floater->mEventInfo.mUnixTime < time_corrected()) + { + floater->mNotifyBtn->setEnabled(FALSE); + } + else + { + floater->mNotifyBtn->setEnabled(TRUE); + } + + if (gEventNotifier.hasNotification(floater->mEventInfo.mID)) + { + floater->mNotifyBtn->setLabel(floater->getString("dont_notify")); + } + else + { + floater->mNotifyBtn->setLabel(floater->getString("notify")); + } + + floater->mMapBtn->setEnabled(TRUE); + floater->mTeleportBtn->setEnabled(TRUE); + } +} + + +void LLFloaterEvent::draw() +{ + mGodDeleteEventBtn->setVisible(gAgent.isGodlike()); + + LLPanel::draw(); +} + +void LLFloaterEvent::resetInfo() +{ + mTBName->setText(LLStringUtil::null); + mTBCategory->setText(LLStringUtil::null); + mTBDate->setText(LLStringUtil::null); + mTBDesc->setText(LLStringUtil::null); + mTBDuration->setText(LLStringUtil::null); + mTBCover->setText(LLStringUtil::null); + mTBLocation->setText(LLStringUtil::null); + mTBRunBy->setText(LLStringUtil::null); + mNotifyBtn->setEnabled(FALSE); + mMapBtn->setEnabled(FALSE); + mTeleportBtn->setEnabled(FALSE); +} + +// static +void LLFloaterEvent::onClickTeleport(void* data) +{ + LLFloaterEvent* self = (LLFloaterEvent*)data; + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!self->mEventInfo.mPosGlobal.isExactlyZero()&&worldmap_instance) + { + gAgent.teleportViaLocation(self->mEventInfo.mPosGlobal); + worldmap_instance->trackLocation(self->mEventInfo.mPosGlobal); + } +} + + +// static +void LLFloaterEvent::onClickMap(void* data) +{ + LLFloaterEvent* self = (LLFloaterEvent*)data; + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + + if (!self->mEventInfo.mPosGlobal.isExactlyZero()&&worldmap_instance) + { + worldmap_instance->trackLocation(self->mEventInfo.mPosGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } +} + + +// static +void LLFloaterEvent::onClickCreateEvent(void* data) +{ + LLNotificationsUtil::add("PromptGoToEventsPage");//, LLSD(), LLSD(), callbackCreateEventWebPage); +} + + +// static +void LLFloaterEvent::onClickNotify(void *data) +{ + LLFloaterEvent* self = (LLFloaterEvent*)data; + + if (!gEventNotifier.hasNotification(self->mEventID)) + { + gEventNotifier.add(self->mEventInfo); + self->mNotifyBtn->setLabel(self->getString("dont_notify")); + } + else + { + gEventNotifier.remove(self->mEventInfo.mID); + self->mNotifyBtn->setLabel(self->getString("notify")); + } +} diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h new file mode 100644 index 0000000000..54aaaf6a0f --- /dev/null +++ b/indra/newview/llfloaterevent.h @@ -0,0 +1,96 @@ +/** + * @file llfloaterevent.h + * @brief Display for events in the finder + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, 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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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_LLFLOATEREVENT_H +#define LL_LLFLOATEREVENT_H + +#include "llfloater.h" +#include "lleventinfo.h" +#include "lluuid.h" +#include "v3dmath.h" + +class LLTextBox; +class LLTextEditor; +class LLButton; +class LLExpandableTextBox; +class LLMessageSystem; + +class LLFloaterEvent : public LLFloater +{ +public: + LLFloaterEvent(const LLSD& key); + /*virtual*/ ~LLFloaterEvent(); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); + + void setEventID(const U32 event_id); + void sendEventInfoRequest(); + + static void processEventInfoReply(LLMessageSystem *msg, void **); + + U32 getEventID() { return mEventID; } + +protected: + void resetInfo(); + + static void onClickTeleport(void*); + static void onClickMap(void*); + //static void onClickLandmark(void*); + static void onClickCreateEvent(void*); + static void onClickNotify(void*); + void onClickDeleteEvent(); + +// static bool callbackCreateEventWebPage(const LLSD& notification, const LLSD& response); + +protected: + U32 mEventID; + LLEventInfo mEventInfo; + + LLTextBox* mTBName; + LLTextBox* mTBCategory; + LLTextBox* mTBDate; + LLTextBox* mTBDuration; + LLExpandableTextBox* mTBDesc; + + LLTextBox* mTBRunBy; + LLTextBox* mTBLocation; + LLTextBox* mTBCover; + + LLButton* mTeleportBtn; + LLButton* mMapBtn; + LLButton* mCreateEventBtn; + LLButton* mGodDeleteEventBtn; + LLButton* mNotifyBtn; +}; + +#endif // LL_LLFLOATEREVENT_H diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 3946224c0c..76607e4874 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1855,10 +1855,9 @@ EInventorySortGroup LLFolderViewFolder::getSortGroup() const return SG_TRASH_FOLDER; } - // Folders that can't be moved are 'system' folders. if( mListener ) { - if( !(mListener->isItemMovable()) ) + if(LLFolderType::lookupIsProtectedType(mListener->getPreferredType())) { return SG_SYSTEM_FOLDER; } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 8569e208eb..750a9d478f 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -897,21 +897,19 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; - for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) + for (S32 i = 0; i < mDebugBeacons.count(); i++) { - const LLDebugBeacon &debug_beacon = *iter; + const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; LLColor4 color = debug_beacon.mColor; color.mV[3] *= 0.25f; S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) + if (i > 0) { gGL.end(); + gGL.flush(); } - flush = TRUE; - gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(LLRender::LINES); @@ -938,20 +936,18 @@ void LLViewerObjectList::renderObjectBeacons() S32 last_line_width = -1; // gGL.begin(LLRender::LINES); // Always happens in (line_width != last_line_width) - BOOL flush = FALSE; - for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) + for (S32 i = 0; i < mDebugBeacons.count(); i++) { - const LLDebugBeacon &debug_beacon = *iter; + const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - if (flush) + if (i > 0) { gGL.end(); + gGL.flush(); } - flush = TRUE; - gGL.flush(); glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(LLRender::LINES); @@ -973,9 +969,9 @@ void LLViewerObjectList::renderObjectBeacons() gGL.flush(); glLineWidth(1.f); - for (std::vector<LLDebugBeacon>::iterator iter = mDebugBeacons.begin(); iter != mDebugBeacons.end(); ++iter) + for (S32 i = 0; i < mDebugBeacons.count(); i++) { - LLDebugBeacon &debug_beacon = *iter; + LLDebugBeacon &debug_beacon = mDebugBeacons[i]; if (debug_beacon.mString == "") { continue; diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 325c9c260c..a02dc3355b 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -121,24 +121,24 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); - gGL.pushMatrix(); + LLUI::pushMatrix(); gl_state_for_2d(world_view_rect.getWidth(), world_view_rect.getHeight()); gViewerWindow->setup3DViewport(); - + //gViewerWindow->setup2DRender(); + winX -= world_view_rect.mLeft; winY -= world_view_rect.mBottom; LLUI::loadIdentity(); - glLoadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); + //glRotatef(angle * RAD_TO_DEG, axis.mV[VX], axis.mV[VY], axis.mV[VZ]); + //glScalef(right_scale, up_scale, 1.f); F32 right_x; font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, shadow, wstr.length(), 1000, &right_x); - LLUI::popMatrix(); - gGL.popMatrix(); - + glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 9ed5d13831..2c0cbd4c66 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -555,7 +555,7 @@ void LLHUDText::renderText(BOOL for_select) } } /// Reset the default color to white. The renderer expects this to be the default. - gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); if (for_select) { gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index bf33d8527e..501a137b42 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -724,14 +724,14 @@ void LLMediaCtrl::draw() LLGLSUIDefault gls_ui; LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - gGL.pushUIMatrix(); + gGL.pushMatrix(); { if (mIgnoreUIScale) { - gGL.loadUIIdentity(); + glLoadIdentity(); // font system stores true screen origin, need to scale this by UI scale factor // to get render origin for this view (with unit scale) - gGL.translateUI(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), + gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), LLFontGL::sCurOrigin.mZ); } @@ -825,7 +825,7 @@ void LLMediaCtrl::draw() gGL.end(); gGL.setSceneBlendType(LLRender::BT_ALPHA); } - gGL.popUIMatrix(); + gGL.popMatrix(); } else diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 05623198ab..234fe13217 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -153,18 +153,6 @@ void LLNetMap::draw() // Prepare a scissor region F32 rotation = 0; - gGL.pushMatrix(); - gGL.pushUIMatrix(); - - LLVector3 offset = gGL.getUITranslation(); - LLVector3 scale = gGL.getUIScale(); - - glLoadIdentity(); - gGL.loadUIIdentity(); - - glScalef(scale.mV[0], scale.mV[1], scale.mV[2]); - gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); - { LLLocalClipRect clip(getLocalRect()); { @@ -447,9 +435,6 @@ void LLNetMap::draw() } } - gGL.popMatrix(); - gGL.popUIMatrix(); - LLUICtrl::draw(); } diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index f1cb6e87a3..40ea75ea7a 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -111,25 +111,76 @@ void LLCheckFolderState::doFolder(LLFolderViewFolder* folder) } } +// Functor searching and opening a folder specified by UUID +// in a folder view tree. +class LLOpenFolderByID : public LLFolderViewFunctor +{ +public: + LLOpenFolderByID(const LLUUID& folder_id) + : mFolderID(folder_id) + , mIsFolderOpen(false) + {} + virtual ~LLOpenFolderByID() {} + /*virtual*/ void doFolder(LLFolderViewFolder* folder); + /*virtual*/ void doItem(LLFolderViewItem* item) {} + + bool isFolderOpen() { return mIsFolderOpen; } + +private: + bool mIsFolderOpen; + LLUUID mFolderID; +}; + +// virtual +void LLOpenFolderByID::doFolder(LLFolderViewFolder* folder) +{ + if (folder->getListener() && folder->getListener()->getUUID() == mFolderID) + { + if (!folder->isOpen()) + { + folder->setOpen(TRUE); + mIsFolderOpen = true; + } + } +} + /** * Bridge to support knowing when the inventory has changed to update Landmarks tab * ShowFolderState filter setting to show all folders when the filter string is empty and * empty folder message when Landmarks inventory category has no children. + * Ensures that "Landmarks" folder in the Library is open on strart up. */ class LLLandmarksPanelObserver : public LLInventoryObserver { public: - LLLandmarksPanelObserver(LLLandmarksPanel* lp) : mLP(lp) {} + LLLandmarksPanelObserver(LLLandmarksPanel* lp) + : mLP(lp), + mIsLibraryLandmarksOpen(false) + {} virtual ~LLLandmarksPanelObserver() {} /*virtual*/ void changed(U32 mask); private: LLLandmarksPanel* mLP; + bool mIsLibraryLandmarksOpen; }; void LLLandmarksPanelObserver::changed(U32 mask) { mLP->updateShowFolderState(); + + LLPlacesInventoryPanel* library = mLP->getLibraryInventoryPanel(); + if (!mIsLibraryLandmarksOpen && library) + { + // Search for "Landmarks" folder in the Library and open it once on start up. See EXT-4827. + const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true); + if (landmarks_cat.notNull()) + { + LLOpenFolderByID opener(landmarks_cat); + library->getRootFolder()->applyFunctorRecursively(opener); + mIsLibraryLandmarksOpen = opener.isFolderOpen(); + } + } } LLLandmarksPanel::LLLandmarksPanel() diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index cbbd10ac26..6358bd6f23 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -78,6 +78,8 @@ public: */ void setItemSelected(const LLUUID& obj_id, BOOL take_keyboard_focus); + LLPlacesInventoryPanel* getLibraryInventoryPanel() { return mLibraryInventoryPanel; } + protected: /** * @return true - if current selected panel is not null and selected item is a landmark diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index af96629547..136989166f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -123,7 +123,7 @@ #include "llmutelist.h" #include "llpanelavatar.h" #include "llavatarpropertiesprocessor.h" -#include "llpanelevent.h" +#include "llfloaterevent.h" #include "llpanelclassified.h" #include "llpanelpick.h" #include "llpanelplace.h" @@ -2473,7 +2473,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("MapBlockReply", LLWorldMapMessage::processMapBlockReply); msg->setHandlerFunc("MapItemReply", LLWorldMapMessage::processMapItemReply); - msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply); + msg->setHandlerFunc("EventInfoReply", LLFloaterEvent::processEventInfoReply); msg->setHandlerFunc("PickInfoReply", &LLAvatarPropertiesProcessor::processPickInfoReply); // msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); msg->setHandlerFunc("ClassifiedInfoReply", LLAvatarPropertiesProcessor::processClassifiedInfoReply); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 6dcf4bc798..6c35464a51 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1515,8 +1515,8 @@ bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, con unlockQueue() ; worker->lockWorkMutex(); - worker->mActiveCount++; - worker->mNeedsAux = needs_aux; + worker->mActiveCount++; + worker->mNeedsAux = needs_aux; worker->unlockWorkMutex(); } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 0b7f6900ed..5daea96123 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -515,7 +515,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 30316d9dac..145c717020 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -55,6 +55,7 @@ #include "llfloaterbump.h" #include "llfloatercamera.h" #include "llfloaterdaycycle.h" +#include "llfloaterevent.h" #include "llfloatersearch.h" #include "llfloaterenvsettings.h" #include "llfloaterfonttest.h" @@ -163,6 +164,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("env_settings", "floater_env_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvSettings>); LLFloaterReg::add("env_water", "floater_water.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWater>); LLFloaterReg::add("env_windlight", "floater_windlight_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWindLight>); + + LLFloaterReg::add("event", "floater_event.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEvent>); LLFloaterReg::add("font_test", "floater_font_test.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFontTest>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 3001992630..b69eaa4853 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -649,6 +649,8 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const void LLViewerInventoryCategory::determineFolderType() { + /* Do NOT uncomment this code. This is for future 2.1 support of ensembles. + llassert(FALSE); LLFolderType::EType original_type = getPreferredType(); if (LLFolderType::lookupIsProtectedType(original_type)) return; @@ -692,6 +694,8 @@ void LLViewerInventoryCategory::determineFolderType() { changeType(LLFolderType::FT_NONE); } + llassert(FALSE); + */ } void LLViewerInventoryCategory::changeType(LLFolderType::EType new_folder_type) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index b5642d07a5..d0afa9d9de 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2001,9 +2001,6 @@ BOOL LLViewerObject::isActive() const BOOL LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - static LLFastTimer::DeclareTimer ftm("Viewer Object"); - LLFastTimer t(ftm); - if (mDead) { // It's dead. Don't update it. diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 7f147836a1..7a6f479685 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -93,7 +93,7 @@ extern LLPipeline gPipeline; // Statics for object lookup tables. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. -std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex; +LLMap<U64, U32> LLViewerObjectList::sIPAndPortToIndex; std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID; LLViewerObjectList::LLViewerObjectList() @@ -571,9 +571,10 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys, void LLViewerObjectList::dirtyAllObjectInventory() { - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + S32 count = mObjects.count(); + for(S32 i = 0; i < count; ++i) { - (*iter)->dirtyInventory(); + mObjects[i]->dirtyInventory(); } } @@ -586,14 +587,14 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) S32 num_updates, max_value; if (NUM_BINS - 1 == mCurBin) { - num_updates = (S32) mObjects.size() - mCurLazyUpdateIndex; - max_value = (S32) mObjects.size(); + num_updates = mObjects.count() - mCurLazyUpdateIndex; + max_value = mObjects.count(); gTextureList.setUpdateStats(TRUE); } else { - num_updates = ((S32) mObjects.size() / NUM_BINS) + 1; - max_value = llmin((S32) mObjects.size(), mCurLazyUpdateIndex + num_updates); + num_updates = (mObjects.count() / NUM_BINS) + 1; + max_value = llmin(mObjects.count(), mCurLazyUpdateIndex + num_updates); } @@ -646,7 +647,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) } mCurLazyUpdateIndex = max_value; - if (mCurLazyUpdateIndex == mObjects.size()) + if (mCurLazyUpdateIndex == mObjects.count()) { mCurLazyUpdateIndex = 0; } @@ -693,26 +694,20 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) // Make a copy of the list in case something in idleUpdate() messes with it std::vector<LLViewerObject*> idle_list; - - static LLFastTimer::DeclareTimer idle_copy("Idle Copy"); + idle_list.reserve( mActiveObjects.size() ); + for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); + active_iter != mActiveObjects.end(); active_iter++) { - LLFastTimer t(idle_copy); - idle_list.reserve( mActiveObjects.size() ); - - for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin(); - active_iter != mActiveObjects.end(); active_iter++) + objectp = *active_iter; + if (objectp) { - objectp = *active_iter; - if (objectp) - { - idle_list.push_back( objectp ); - } - else - { // There shouldn't be any NULL pointers in the list, but they have caused - // crashes before. This may be idleUpdate() messing with the list. - llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl; - } + idle_list.push_back( objectp ); + } + else + { // There shouldn't be any NULL pointers in the list, but they have caused + // crashes before. This may be idleUpdate() messing with the list. + llwarns << "LLViewerObjectList::update has a NULL objectp" << llendl; } } @@ -812,7 +807,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } */ - LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size()); + LLViewerStats::getInstance()->mNumObjectsStat.addValue(mObjects.count()); LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(num_active_objects); LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled); LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled); @@ -820,9 +815,9 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) void LLViewerObjectList::clearDebugText() { - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + for (S32 i = 0; i < mObjects.count(); i++) { - (*iter)->setDebugText(""); + mObjects[i]->setDebugText(""); } } @@ -861,7 +856,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) if (objectp->isOnMap()) { - removeFromMap(objectp); + mMapObjects.removeObj(objectp); } // Don't clean up mObject references, these will be cleaned up more efficiently later! @@ -922,10 +917,10 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp) { LLViewerObject *objectp; - - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + S32 i; + for (i = 0; i < mObjects.count(); i++) { - objectp = *iter; + objectp = mObjects[i]; if (objectp->mRegionp == regionp) { @@ -942,9 +937,10 @@ void LLViewerObjectList::killAllObjects() // Used only on global destruction. LLViewerObject *objectp; - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + for (S32 i = 0; i < mObjects.count(); i++) { - objectp = *iter; + objectp = mObjects[i]; + killObject(objectp); llassert(objectp->isDead()); } @@ -953,7 +949,7 @@ void LLViewerObjectList::killAllObjects() if(!mObjects.empty()) { - llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.size() << llendl; + llwarns << "LLViewerObjectList::killAllObjects still has entries in mObjects: " << mObjects.count() << llendl; mObjects.clear(); } @@ -978,15 +974,16 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) return; } + S32 i = 0; S32 num_removed = 0; LLViewerObject *objectp; - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ) + while (i < mObjects.count()) { // Scan for all of the dead objects and remove any "global" references to them. - objectp = *iter; + objectp = mObjects[i]; if (objectp->isDead()) { - iter = mObjects.erase(iter); + mObjects.remove(i); num_removed++; if (num_removed == mNumDeadObjects) @@ -997,7 +994,8 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) } else { - ++iter; + // iterate, this isn't a dead object. + i++; } } @@ -1047,11 +1045,12 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) } LLViewerObject *objectp; - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + S32 i; + for (i = 0; i < mObjects.count(); i++) { - objectp = *iter; + objectp = getObject(i); // There could be dead objects on the object list, so don't update stuff if the object is dead. - if (!objectp->isDead()) + if (objectp) { objectp->updatePositionCaches(); @@ -1081,9 +1080,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius"); - for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + for (S32 i = 0; i < mMapObjects.count(); i++) { - LLViewerObject* objectp = *iter; + LLViewerObject* objectp = mMapObjects[i]; if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) { continue; @@ -1149,14 +1148,21 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 ¢er) { } +void LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent) +{ + generatePickList(camera); + renderPickList(screen_rect, pick_parcel_wall, render_transparent); +} + void LLViewerObjectList::generatePickList(LLCamera &camera) { LLViewerObject *objectp; S32 i; // Reset all of the GL names to zero. - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + for (i = 0; i < mObjects.count(); i++) { - (*iter)->mGLName = 0; + objectp = mObjects[i]; + objectp->mGLName = 0; } mSelectPickList.clear(); @@ -1319,19 +1325,17 @@ void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent, const LLColor4 &text_color, S32 line_width) { - LLDebugBeacon beacon; - beacon.mPositionAgent = pos_agent; - beacon.mString = string; - beacon.mColor = color; - beacon.mTextColor = text_color; - beacon.mLineWidth = line_width; - - mDebugBeacons.push_back(beacon); + LLDebugBeacon *beaconp = mDebugBeacons.reserve_block(1); + beaconp->mPositionAgent = pos_agent; + beaconp->mString = string; + beaconp->mColor = color; + beaconp->mTextColor = text_color; + beaconp->mLineWidth = line_width; } void LLViewerObjectList::resetObjectBeacons() { - mDebugBeacons.clear(); + mDebugBeacons.reset(); } LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLViewerRegion *regionp) @@ -1349,7 +1353,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi mUUIDObjectMap[fullid] = objectp; - mObjects.push_back(objectp); + mObjects.put(objectp); updateActive(objectp); @@ -1388,7 +1392,7 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe gMessageSystem->getSenderIP(), gMessageSystem->getSenderPort()); - mObjects.push_back(objectp); + mObjects.put(objectp); updateActive(objectp); @@ -1411,11 +1415,11 @@ LLViewerObject *LLViewerObjectList::replaceObject(const LLUUID &id, const LLPCod S32 LLViewerObjectList::findReferences(LLDrawable *drawablep) const { LLViewerObject *objectp; + S32 i; S32 num_refs = 0; - - for (vobj_list_t::const_iterator iter = mObjects.begin(); iter != mObjects.end(); ++iter) + for (i = 0; i < mObjects.count(); i++) { - objectp = *iter; + objectp = mObjects[i]; if (objectp->mDrawable.notNull()) { num_refs += objectp->mDrawable->findReferences(drawablep); @@ -1460,15 +1464,15 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip // Unknown parent, add to orpaned child list U64 parent_info = getIndex(parent_id, ip, port); - if (std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info) == mOrphanParents.end()) + if (-1 == mOrphanParents.find(parent_info)) { - mOrphanParents.push_back(parent_info); + mOrphanParents.put(parent_info); } LLViewerObjectList::OrphanInfo oi(parent_info, childp->mID); - if (std::find(mOrphanChildren.begin(), mOrphanChildren.end(), oi) == mOrphanChildren.end()) + if (-1 == mOrphanChildren.find(oi)) { - mOrphanChildren.push_back(oi); + mOrphanChildren.put(oi); mNumOrphans++; } } @@ -1491,29 +1495,28 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) // See if we are a parent of an orphan. // Note: This code is fairly inefficient but it should happen very rarely. // It can be sped up if this is somehow a performance issue... - if (mOrphanParents.empty()) + if (0 == mOrphanParents.count()) { // no known orphan parents return; } - if (std::find(mOrphanParents.begin(), mOrphanParents.end(), getIndex(objectp->mLocalID, ip, port)) == mOrphanParents.end()) + if (-1 == mOrphanParents.find(getIndex(objectp->mLocalID, ip, port))) { // did not find objectp in OrphanParent list return; } + S32 i; U64 parent_info = getIndex(objectp->mLocalID, ip, port); BOOL orphans_found = FALSE; // Iterate through the orphan list, and set parents of matching children. - - for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); ) - { - if (iter->mParentInfo != parent_info) + for (i = 0; i < mOrphanChildren.count(); i++) + { + if (mOrphanChildren[i].mParentInfo != parent_info) { - ++iter; continue; } - LLViewerObject *childp = findObject(iter->mChildInfo); + LLViewerObject *childp = findObject(mOrphanChildren[i].mChildInfo); if (childp) { if (childp == objectp) @@ -1547,35 +1550,29 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) objectp->addChild(childp); orphans_found = TRUE; - ++iter; } else { llinfos << "Missing orphan child, removing from list" << llendl; - - iter = mOrphanChildren.erase(iter); + mOrphanChildren.remove(i); + i--; } } // Remove orphan parent and children from lists now that they've been found + mOrphanParents.remove(mOrphanParents.find(parent_info)); + + i = 0; + while (i < mOrphanChildren.count()) { - std::vector<U64>::iterator iter = std::find(mOrphanParents.begin(), mOrphanParents.end(), parent_info); - if (iter != mOrphanParents.end()) - { - mOrphanParents.erase(iter); - } - } - - for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); ) - { - if (iter->mParentInfo == parent_info) + if (mOrphanChildren[i].mParentInfo == parent_info) { - iter = mOrphanChildren.erase(iter); + mOrphanChildren.remove(i); mNumOrphans--; } else { - ++iter; + i++; } } diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 706966deae..2858081dc9 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -38,6 +38,8 @@ // common includes #include "llstat.h" +#include "lldarrayptr.h" +#include "llmap.h" // *TODO: switch to std::map #include "llstring.h" // project includes @@ -48,7 +50,7 @@ class LLNetMap; class LLDebugBeacon; const U32 CLOSE_BIN_SIZE = 10; -const U32 NUM_BINS = 128; +const U32 NUM_BINS = 16; // GL name = position in object list + GL_NAME_INDEX_OFFSET so that // we can have special numbers like zero. @@ -109,12 +111,13 @@ public: void updateAvatarVisibility(); // Selection related stuff + void renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall = FALSE, BOOL render_transparent = TRUE); void generatePickList(LLCamera &camera); void renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent); LLViewerObject *getSelectedObject(const U32 object_id); - inline S32 getNumObjects() { return (S32) mObjects.size(); } + inline S32 getNumObjects() { return mObjects.count(); } void addToMap(LLViewerObject *objectp); void removeFromMap(LLViewerObject *objectp); @@ -128,7 +131,7 @@ public: S32 findReferences(LLDrawable *drawablep) const; // Find references to drawable in all objects, and return value. - S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); } + S32 getOrphanParentCount() const { return mOrphanParents.count(); } S32 getOrphanCount() const { return mNumOrphans; } void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port); void findOrphans(LLViewerObject* objectp, U32 ip, U32 port); @@ -176,28 +179,26 @@ public: S32 mNumUnknownKills; S32 mNumDeadObjects; protected: - std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects - std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects + LLDynamicArray<U64> mOrphanParents; // LocalID/ip,port of orphaned objects + LLDynamicArray<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects S32 mNumOrphans; - typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t; - - vobj_list_t mObjects; + LLDynamicArrayPtr<LLPointer<LLViewerObject>, 256> mObjects; std::set<LLPointer<LLViewerObject> > mActiveObjects; - vobj_list_t mMapObjects; + LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects; typedef std::map<LLUUID, LLPointer<LLViewerObject> > vo_map; vo_map mDeadObjects; // Need to keep multiple entries per UUID std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap; - std::vector<LLDebugBeacon> mDebugBeacons; + LLDynamicArray<LLDebugBeacon> mDebugBeacons; S32 mCurLazyUpdateIndex; static U32 sSimulatorMachineIndex; - static std::map<U64, U32> sIPAndPortToIndex; + static LLMap<U64, U32> sIPAndPortToIndex; static std::map<U64, LLUUID> sIndexAndLocalIDToUUID; @@ -263,16 +264,12 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index) inline void LLViewerObjectList::addToMap(LLViewerObject *objectp) { - mMapObjects.push_back(objectp); + mMapObjects.put(objectp); } inline void LLViewerObjectList::removeFromMap(LLViewerObject *objectp) { - std::vector<LLPointer<LLViewerObject> >::iterator iter = std::find(mMapObjects.begin(), mMapObjects.end(), objectp); - if (iter != mMapObjects.end()) - { - mMapObjects.erase(iter); - } + mMapObjects.removeObj(objectp); } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 09353e3146..768b145351 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2310,13 +2310,13 @@ void LLViewerFetchedTexture::destroyRawImage() if (mRawImage.notNull()) { - sRawCount--; - setCachedRawImage() ; + sRawCount--; if(mForceToSaveRawImage) { saveRawImage() ; } + setCachedRawImage() ; } mRawImage = NULL; @@ -2406,7 +2406,8 @@ void LLViewerFetchedTexture::setCachedRawImage() mRawImage->scale(w >> i, h >> i) ; } mCachedRawImage = mRawImage ; - mCachedRawDiscardLevel = mRawDiscardLevel + i ; + mRawDiscardLevel += i ; + mCachedRawDiscardLevel = mRawDiscardLevel ; } } @@ -2476,7 +2477,7 @@ BOOL LLViewerFetchedTexture::hasSavedRawImage() const F32 LLViewerFetchedTexture::getElapsedLastReferencedSavedRawImageTime() const { - return mLastReferencedSavedRawImageTime - sCurrentTime ; + return sCurrentTime - mLastReferencedSavedRawImageTime ; } //---------------------------------------------------------------------------------------------- //atlasing diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 84d8f14bfc..05096b6bbc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -486,10 +486,6 @@ public: } ypos += y_inc; - addText(xpos, ypos, llformat("UI Verts/Calls: %d/%d", LLRender::sUIVerts, LLRender::sUICalls)); - LLRender::sUICalls = LLRender::sUIVerts = 0; - ypos += y_inc; - addText(xpos,ypos, llformat("%d/%d Nodes visible", gPipeline.mNumVisibleNodes, LLSpatialGroup::sNodeCount)); ypos += y_inc; @@ -856,56 +852,71 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi LLVOVolume *obj = dynamic_cast<LLVOVolume*>(static_cast<LLViewerObject*>(pick_info.getObject())); - if (obj && obj->permModify() && !obj->getRegion()->getCapability("ObjectMedia").empty()) + if (obj && !obj->getRegion()->getCapability("ObjectMedia").empty()) { LLTextureEntry *te = obj->getTE(object_face); if (te) { if (drop) { - if (! te->hasMedia()) + // object does NOT have media already + if ( ! te->hasMedia() ) { - // Create new media entry - LLSD media_data; - // XXX Should we really do Home URL too? - media_data[LLMediaEntry::HOME_URL_KEY] = url; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; - obj->syncMediaData(object_face, media_data, true, true); - // XXX This shouldn't be necessary, should it ?!? - if (obj->getMediaImpl(object_face)) - obj->getMediaImpl(object_face)->navigateReload(); - obj->sendMediaDataUpdate(); - - result = LLWindowCallbacks::DND_COPY; - } - else { - // Check the whitelist - if (te->getMediaData()->checkCandidateUrl(url)) + // we are allowed to modify the object + if ( obj->permModify() ) { - // just navigate to the URL + // Create new media entry + LLSD media_data; + // XXX Should we really do Home URL too? + media_data[LLMediaEntry::HOME_URL_KEY] = url; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + media_data[LLMediaEntry::AUTO_PLAY_KEY] = true; + obj->syncMediaData(object_face, media_data, true, true); + // XXX This shouldn't be necessary, should it ?!? if (obj->getMediaImpl(object_face)) + obj->getMediaImpl(object_face)->navigateReload(); + obj->sendMediaDataUpdate(); + + result = LLWindowCallbacks::DND_COPY; + } + } + else + // object HAS media already + { + // URL passes the whitelist + if (te->getMediaData()->checkCandidateUrl( url ) ) + { + // we are allowed to modify the object or we have navigate permissions + // NOTE: Design states you you can change the URL if you have media + // navigate permissions even if you do not have prim modify rights + if ( obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ) ) { - obj->getMediaImpl(object_face)->navigateTo(url); - } - else { - // This is very strange. Navigation should - // happen via the Impl, but we don't have one. - // This sends it to the server, which /should/ - // trigger us getting it. Hopefully. - LLSD media_data; - media_data[LLMediaEntry::CURRENT_URL_KEY] = url; - obj->syncMediaData(object_face, media_data, true, true); - obj->sendMediaDataUpdate(); + // just navigate to the URL + if (obj->getMediaImpl(object_face)) + { + obj->getMediaImpl(object_face)->navigateTo(url); + } + else + { + // This is very strange. Navigation should + // happen via the Impl, but we don't have one. + // This sends it to the server, which /should/ + // trigger us getting it. Hopefully. + LLSD media_data; + media_data[LLMediaEntry::CURRENT_URL_KEY] = url; + obj->syncMediaData(object_face, media_data, true, true); + obj->sendMediaDataUpdate(); + } + result = LLWindowCallbacks::DND_LINK; } - result = LLWindowCallbacks::DND_LINK; } } LLSelectMgr::getInstance()->unhighlightObjectOnly(mDragHoveredObject); mDragHoveredObject = NULL; } - else { + else + { // Check the whitelist, if there's media (otherwise just show it) if (te->getMediaData() == NULL || te->getMediaData()->checkCandidateUrl(url)) { @@ -1362,7 +1373,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getBOOL("DisableVerticalSync"), !gNoRender, ignore_pixel_depth, - 0); //gSavedSettings.getU32("RenderFSAASamples")); + gSavedSettings.getU32("RenderFSAASamples")); if (!LLAppViewer::instance()->restoreErrorTrap()) { @@ -1992,15 +2003,12 @@ void LLViewerWindow::drawDebugText() { gGL.color4f(1,1,1,1); gGL.pushMatrix(); - gGL.pushUIMatrix(); { // scale view by UI global scale factor and aspect ratio correction factor - gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); + glScalef(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); mDebugText->draw(); } - gGL.popUIMatrix(); gGL.popMatrix(); - gGL.flush(); } @@ -2048,11 +2056,9 @@ void LLViewerWindow::draw() // No translation needed, this view is glued to 0,0 gGL.pushMatrix(); - LLUI::pushMatrix(); { - // scale view by UI global scale factor and aspect ratio correction factor - gGL.scaleUI(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); + glScalef(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); LLVector2 old_scale_factor = LLUI::sGLScaleFactor; // apply camera zoom transform (for high res screenshots) @@ -2118,7 +2124,6 @@ void LLViewerWindow::draw() LLUI::sGLScaleFactor = old_scale_factor; } - LLUI::popMatrix(); gGL.popMatrix(); #if LL_DEBUG @@ -2471,9 +2476,6 @@ void append_xui_tooltip(LLView* viewp, LLToolTip::Params& params) // event processing. void LLViewerWindow::updateUI() { - static LLFastTimer::DeclareTimer ftm("Update UI"); - LLFastTimer t(ftm); - static std::string last_handle_msg; LLConsole::updateClass(); @@ -3055,6 +3057,7 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) // Must be called after displayObjects is called, which sets the mGLName parameter // NOTE: This function gets called 3 times: // render_ui_3d: FALSE, FALSE, TRUE +// renderObjectsForSelect: TRUE, pick_parcel_wall, FALSE // render_hud_elements: FALSE, FALSE, FALSE void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud ) { @@ -4585,9 +4588,8 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, return TRUE; } - //U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); - //U32 old_fsaa = mWindow->getFSAASamples(); - + U32 fsaa = gSavedSettings.getU32("RenderFSAASamples"); + U32 old_fsaa = mWindow->getFSAASamples(); // going from windowed to windowed if (!old_fullscreen && !fullscreen) { @@ -4597,7 +4599,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, mWindow->setSize(size); } - //if (fsaa == old_fsaa) + if (fsaa == old_fsaa) { return TRUE; } @@ -4626,13 +4628,13 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size, gSavedSettings.setS32("WindowY", old_pos.mY); } - //mWindow->setFSAASamples(fsaa); + mWindow->setFSAASamples(fsaa); result_first_try = mWindow->switchContext(fullscreen, size, disable_vsync); if (!result_first_try) { // try to switch back - //mWindow->setFSAASamples(old_fsaa); + mWindow->setFSAASamples(old_fsaa); result_second_try = mWindow->switchContext(old_fullscreen, old_size, disable_vsync); if (!result_second_try) diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index 5153cef709..177cb16c50 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -77,11 +77,9 @@ BOOL LLVOClouds::isActive() const return TRUE; } + BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - static LLFastTimer::DeclareTimer ftm("Idle Clouds"); - LLFastTimer t(ftm); - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) { return TRUE; diff --git a/indra/newview/llvotextbubble.cpp b/indra/newview/llvotextbubble.cpp index 428ef20006..75beab519e 100644 --- a/indra/newview/llvotextbubble.cpp +++ b/indra/newview/llvotextbubble.cpp @@ -84,9 +84,6 @@ BOOL LLVOTextBubble::isActive() const BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - static LLFastTimer::DeclareTimer ftm("Text Bubble"); - LLFastTimer t(ftm); - F32 dt = mUpdateTimer.getElapsedTimeF32(); // Die after a few seconds. if (dt > 1.5f) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e95c7f411c..4f0f3f3c45 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -613,9 +613,6 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { LLViewerObject::idleUpdate(agent, world, time); - static LLFastTimer::DeclareTimer ftm("Volume"); - LLFastTimer t(ftm); - if (mDead || mDrawable.isNull()) { return TRUE; @@ -637,18 +634,6 @@ BOOL LLVOVolume::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) mVolumeImpl->doIdleUpdate(agent, world, time); } - const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40; - - if (mDrawable->isActive()) - { - if (mDrawable->isRoot() && - mDrawable->mQuietCount++ > MAX_ACTIVE_OBJECT_QUIET_FRAMES && - (!mDrawable->getParent() || !mDrawable->getParent()->isActive())) - { - mDrawable->makeStatic(); - } - } - return TRUE; } @@ -1149,7 +1134,7 @@ BOOL LLVOVolume::calcLOD() S32 cur_detail = 0; F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length(); - F32 distance = mDrawable->mDistanceWRTCamera; //llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE); + F32 distance = llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE); distance *= sDistanceFactor; F32 rampDist = LLVOVolume::sLODFactor * 2; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index f01e30f9da..feab6d126b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -657,9 +657,6 @@ void LLWorld::updateParticles() void LLWorld::updateClouds(const F32 dt) { - static LLFastTimer::DeclareTimer ftm("World Clouds"); - LLFastTimer t(ftm); - if (gSavedSettings.getBOOL("FreezeTime") || !gSavedSettings.getBOOL("SkyUseClassicClouds")) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c61274bfb1..e6dfb90327 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -272,7 +272,8 @@ public: void shiftObjects(const LLVector3 &offset); void setLight(LLDrawable *drawablep, BOOL is_light); - + void setActive(LLDrawable *drawablep, BOOL active); + BOOL hasRenderBatches(const U32 type) const; LLCullResult::drawinfo_list_t::iterator beginRenderMap(U32 type); LLCullResult::drawinfo_list_t::iterator endRenderMap(U32 type); @@ -590,6 +591,8 @@ protected: LLViewerObject::vobj_list_t mCreateQ; + LLDrawable::drawable_set_t mActiveQ; + LLDrawable::drawable_set_t mRetexturedList; class HighlightItem diff --git a/indra/newview/skins/default/textures/icons/Inv_Shoe.png b/indra/newview/skins/default/textures/icons/Inv_Shoe.png Binary files differindex 51e1c7bbb7..1f52b0a6b6 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Shoe.png +++ b/indra/newview/skins/default/textures/icons/Inv_Shoe.png diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml new file mode 100644 index 0000000000..9ce0c9c86d --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_event.xml @@ -0,0 +1,243 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + follows="all" + height="350" + label="Event" + layout="topleft" + name="Event" + width="330"> + <floater.string + name="none"> + none + </floater.string> + <floater.string + name="notify"> + Notify + </floater.string> + <floater.string + name="dont_notify"> + Don't Notify + </floater.string> + <layout_stack + name="layout" + orientation="vertical" + follows="all" + layout="topleft" + left="0" + top="0" + height="350" + width="330" + border_size="0"> + <layout_panel + name="profile_stack" + follows="all" + layout="topleft" + top="0" + left="0" + height="305" + width="330"> + <text + follows="top|left|right" + font="SansSerifLarge" + text_color="white" + height="17" + layout="topleft" + left="10" + name="event_name" + top="5" + use_ellipses="true" + width="310"> + Nameless Event...of Doom! De doom! Doom doom. + </text> + <text + type="string" + length="1" + follows="top|left" + height="13" + text_color="LtGray_50" + layout="topleft" + left="25" + name="event_category" + width="300"> + (no category) + </text> + + <text + type="string" + length="1" + follows="top|left" + layout="topleft" + left="10" + top_pad="7" + name="event_runby_label" + width="310"> + Run by: + </text> + <text + follows="left|top" + height="20" + initial_value="(retrieving)" + layout="topleft" + left="10" + link="true" + name="event_runby" + top_pad="2" + use_ellipses="true" + width="310" /> + <text + type="string" + length="1" + left="10" + height="17" + font="SansSerifMedium" + text_color="EmphasisColor" + top_pad="5" + follows="top|left" + layout="topleft" + name="event_date" + width="310"> + 10/10/2010 + </text> + <text + type="string" + height="14" + length="1" + left="10" + follows="top|left" + layout="topleft" + name="event_duration" + width="310"> + 1 hour + </text> + <text + font="SansSerifMedium" + text_color="EmphasisColor" + type="string" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="event_cover" + visible="true" + width="310"> + Free + </text> + <text + type="string" + length="1" + follows="top|left" + layout="topleft" + left="10" + top_pad="5" + name="event_location_label"> + Location: + </text> + <text + type="string" + length="1" + height="20" + left="10" + follows="top|left" + layout="topleft" + name="event_location" + use_ellipses="true" + value="SampleParcel, Name Long (145, 228, 26)" + width="310" /> + <icon + follows="top|left" + height="16" + image_name="Parcel_PG_Dark" + layout="topleft" + left="10" + name="rating_icon" + width="18" /> + <text + follows="left|top" + height="16" + layout="topleft" + left_pad="12" + name="rating_label" + top_delta="3" + value="Rating:" + width="60" /> + <text + follows="left|right|top" + height="16" + layout="topleft" + left_pad="0" + name="rating_value" + top_delta="0" + value="unknown" + width="200" /> + <expandable_text + follows="left|top|right" + height="106" + layout="topleft" + left="6" + name="event_desc" + width="313" /> + </layout_panel> + <layout_panel + follows="left|right" + height="24" + layout="topleft" + mouse_opaque="false" + name="button_panel" + top="0" + left="0" + user_resize="false"> + <button + follows="left|top" + height="18" + image_selected="AddItem_Press" + image_unselected="AddItem_Off" + image_disabled="AddItem_Disabled" + layout="topleft" + left="6" + name="create_event_btn" + picture_style="true" + tool_tip="Create Event" + width="18" /> + <button + follows="left|top" + height="18" + image_selected="MinusItem_Press" + image_unselected="MinusItem_Off" + image_disabled="MinusItem_Disabled" + layout="topleft" + visible="false" + left="6" + top_pad="-7" + name="god_delete_event_btn" + picture_style="true" + tool_tip="Delete Event" + width="18" /> + <button + follows="left|top" + height="23" + label="Notify Me" + layout="topleft" + left_pad="3" + top_delta="-12" + name="notify_btn" + width="100" /> + <button + follows="left|top" + height="23" + label="Teleport" + layout="topleft" + left_pad="5" + name="teleport_btn" + width="100" /> + <button + follows="left|top" + height="23" + label="Map" + layout="topleft" + left_pad="5" + name="map_btn" + width="85" /> + </layout_panel> + </layout_stack> + </floater> + diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 0bb59ae0df..56b8440c4f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -19,7 +19,7 @@ <button default="true" index="0" - name="OK" + name="OK_okbutton" text="$yestext"/> </form> </template> @@ -29,7 +29,7 @@ <button default="true" index="0" - name="OK" + name="OK_okignore" text="$yestext"/> <ignore text="$ignoretext"/> </form> @@ -40,11 +40,11 @@ <button default="true" index="0" - name="OK" + name="OK_okcancelbuttons" text="$yestext"/> <button index="1" - name="Cancel" + name="Cancel_okcancelbuttons" text="$notext"/> </form> </template> @@ -54,11 +54,11 @@ <button default="true" index="0" - name="OK" + name="OK_okcancelignore" text="$yestext"/> <button index="1" - name="Cancel" + name="Cancel_okcancelignore" text="$notext"/> <ignore text="$ignoretext"/> </form> @@ -69,7 +69,7 @@ <button default="true" index="0" - name="OK" + name="OK_okhelpbuttons" text="$yestext"/> <button index="1" @@ -91,7 +91,7 @@ text="$notext"/> <button index="2" - name="Cancel" + name="Cancel_yesnocancelbuttons" text="$canceltext"/> </form> </template> diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index f7ac5361c5..ef93586c6e 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -2,7 +2,7 @@ * @file lllogininstance_test.cpp * @brief Test for lllogininstance.cpp. * - * $LicenseInfo:firstyear=2008&license=internal$ + * $LicenseInfo:firstyear=2008&license=viewergpl$ * Copyright (c) 2008, Linden Research, Inc. * $/LicenseInfo$ */ diff --git a/indra/newview/tests/llxmlrpclistener_test.cpp b/indra/newview/tests/llxmlrpclistener_test.cpp index c94ba0a3e8..c2c7e963b9 100644 --- a/indra/newview/tests/llxmlrpclistener_test.cpp +++ b/indra/newview/tests/llxmlrpclistener_test.cpp @@ -4,7 +4,7 @@ * @date 2009-03-20 * @brief Test for llxmlrpclistener. * - * $LicenseInfo:firstyear=2009&license=internal$ + * $LicenseInfo:firstyear=2009&license=viewergpl$ * Copyright (c) 2009, Linden Research, Inc. * $/LicenseInfo$ */ |