From b1831d23bfdd0c876ac8cf687d6d3cf02345e28e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:45 -0500 Subject: Second Life viewer sources 1.20.4 --- linden/indra/llcommon/llversionviewer.h | 2 +- linden/indra/llimage/llimage.cpp | 5 ++-- linden/indra/llmath/llvolumemgr.cpp | 28 ++++++++++++++++++--- linden/indra/llmath/llvolumemgr.h | 1 + linden/indra/llrender/llimagegl.cpp | 14 ++++++++++- linden/indra/llxml/llcontrol.cpp | 33 ++++++++++++++++++++---- linden/indra/llxml/llcontrol.h | 2 +- linden/indra/newview/app_settings/settings.xml | 2 +- linden/indra/newview/lldynamictexture.cpp | 6 ++--- linden/indra/newview/llfloateranimpreview.cpp | 3 ++- linden/indra/newview/llfloaterimagepreview.cpp | 8 ++++-- linden/indra/newview/llglsandbox.cpp | 35 +++++++++++++++----------- linden/indra/newview/llimpanel.cpp | 4 ++- linden/indra/newview/lltexlayer.cpp | 4 +++ linden/indra/newview/lltoolmorph.cpp | 5 +++- linden/indra/newview/llviewermenu.cpp | 4 +-- linden/indra/newview/llviewermessage.cpp | 2 +- linden/indra/newview/llvovolume.cpp | 20 +++++++++------ linden/indra/newview/releasenotes.txt | 8 ++++++ 19 files changed, 137 insertions(+), 49 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index 747526f..b81fb8d 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h @@ -34,7 +34,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 20; -const S32 LL_VERSION_PATCH = 3; +const S32 LL_VERSION_PATCH = 4; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Release"; diff --git a/linden/indra/llimage/llimage.cpp b/linden/indra/llimage/llimage.cpp index 3600cce..65d19de 100644 --- a/linden/indra/llimage/llimage.cpp +++ b/linden/indra/llimage/llimage.cpp @@ -768,8 +768,8 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) LLMemType mt1((LLMemType::EMemType)mMemType); LLImageRaw* dst = this; // Just for clarity. - llassert( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); - llassert( src->getComponents() == dst->getComponents() ); + llassert_always( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); + llassert_always( src->getComponents() == dst->getComponents() ); if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { @@ -779,6 +779,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) // Vertical S32 temp_data_size = src->getWidth() * dst->getHeight() * getComponents(); + llassert_always(temp_data_size > 0); U8* temp_buffer = new U8[ temp_data_size ]; for( S32 col = 0; col < src->getWidth(); col++ ) { diff --git a/linden/indra/llmath/llvolumemgr.cpp b/linden/indra/llmath/llvolumemgr.cpp index 0b49bb3..0b5464c 100644 --- a/linden/indra/llmath/llvolumemgr.cpp +++ b/linden/indra/llmath/llvolumemgr.cpp @@ -77,11 +77,8 @@ BOOL LLVolumeMgr::cleanup() iter != end; iter++) { LLVolumeLODGroup *volgroupp = iter->second; - if (volgroupp->getNumRefs() != 0) + if (volgroupp->cleanupRefs() == false) { - llwarns << "Volume group " << volgroupp << " has " - << volgroupp->getNumRefs() << " remaining refs" << llendl; - llwarns << *volgroupp->getVolumeParams() << llendl; no_refs = FALSE; } delete volgroupp; @@ -274,6 +271,29 @@ LLVolumeLODGroup::~LLVolumeLODGroup() } } +// Called from LLVolumeMgr::cleanup +bool LLVolumeLODGroup::cleanupRefs() +{ + bool res = true; + if (mRefs != 0) + { + llwarns << "Volume group has remaining refs:" << getNumRefs() << llendl; + mRefs = 0; + for (S32 i = 0; i < NUM_LODS; i++) + { + if (mLODRefs[i] > 0) + { + llwarns << " LOD " << i << " refs = " << mLODRefs[i] << llendl; + mLODRefs[i] = 0; + mVolumeLODs[i] = NULL; + } + } + llwarns << *getVolumeParams() << llendl; + res = false; + } + return res; +} + LLVolume* LLVolumeLODGroup::getLODVolume(const S32 detail) { llassert(detail >=0 && detail < NUM_LODS); diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h index 8f107f6..dcaca01 100644 --- a/linden/indra/llmath/llvolumemgr.h +++ b/linden/indra/llmath/llvolumemgr.h @@ -53,6 +53,7 @@ public: LLVolumeLODGroup(const LLVolumeParams ¶ms); ~LLVolumeLODGroup(); + bool cleanupRefs(); static S32 getDetailFromTan(const F32 tan_angle); static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher); diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp index c4b90a7..92d8eb4 100644 --- a/linden/indra/llrender/llimagegl.cpp +++ b/linden/indra/llrender/llimagegl.cpp @@ -615,18 +615,25 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) S32 w = width, h = height; const U8* prev_mip_data = 0; const U8* cur_mip_data = 0; + S32 prev_mip_size = 0; + S32 cur_mip_size = 0; for (int m=0; m 0 && h > 0 && cur_mip_data); { @@ -651,12 +658,14 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) delete[] prev_mip_data; } prev_mip_data = cur_mip_data; + prev_mip_size = cur_mip_size; w >>= 1; h >>= 1; } if (prev_mip_data && prev_mip_data != data_in) { delete[] prev_mip_data; + prev_mip_data = NULL; } } } @@ -1058,6 +1067,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre llerrs << llformat("LLImageGL::readBackRaw: bogus params: %d x %d x %d",width,height,ncomponents) << llendl; } + BOOL return_result = TRUE ; LLGLint is_compressed = 0; if (compressed_ok) { @@ -1073,6 +1083,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre { llwarns << "Error happens when reading back the compressed texture image." << llendl ; imageraw->deleteData() ; + return_result = FALSE ; } stop_glerror(); } @@ -1084,11 +1095,12 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre { llwarns << "Error happens when reading back the texture image." << llendl ; imageraw->deleteData() ; + return_result = FALSE ; } stop_glerror(); } - return TRUE; + return return_result ; } void LLImageGL::destroyGLTexture() diff --git a/linden/indra/llxml/llcontrol.cpp b/linden/indra/llxml/llcontrol.cpp index 18292d2..8c74127 100644 --- a/linden/indra/llxml/llcontrol.cpp +++ b/linden/indra/llxml/llcontrol.cpp @@ -953,7 +953,7 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only) return num_saved; } -U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declaration, eControlType declare_as) +U32 LLControlGroup::loadFromFile(const LLString& filename) { LLString name; LLSD settings; @@ -965,24 +965,47 @@ U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declarat llwarns << "Cannot find file " << filename << " to load." << llendl; return 0; } + S32 ret = LLSDSerialize::fromXML(settings, infile); + if (ret <= 0) { infile.close(); llwarns << "Unable to open LLSD control file " << filename << ". Trying Legacy Method." << llendl; - return loadFromFileLegacy(filename, require_declaration, declare_as); + return loadFromFileLegacy(filename, TRUE, TYPE_STRING); } - U32 validitems = 0; + U32 validitems = 0; int persist = 1; for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) { name = (*itr).first; control_map = (*itr).second; - if(control_map.has("Persist")) persist = control_map["Persist"].asInteger(); + if(control_map.has("Persist")) + { + persist = control_map["Persist"].asInteger(); + } - declareControl(name, typeStringToEnum(control_map["Type"].asString()), control_map["Value"], control_map["Comment"].asString(), persist); + // If the control exists just set the value from the input file. + LLControlVariable* existing_control = getControl(name); + if(existing_control) + { + // Check persistence. If not persisted, we shouldn't be loading. + if(existing_control->isPersisted()) + { + existing_control->setValue(control_map["Value"]); + } + } + else + { + declareControl(name, + typeStringToEnum(control_map["Type"].asString()), + control_map["Value"], + control_map["Comment"].asString(), + persist + ); + } ++validitems; } diff --git a/linden/indra/llxml/llcontrol.h b/linden/indra/llxml/llcontrol.h index 9e11628..2511940 100644 --- a/linden/indra/llxml/llcontrol.h +++ b/linden/indra/llxml/llcontrol.h @@ -213,7 +213,7 @@ public: // as the given type. U32 loadFromFileLegacy(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); U32 saveToFile(const LLString& filename, BOOL nondefault_only); - U32 loadFromFile(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); + U32 loadFromFile(const LLString& filename); void resetToDefaults(); diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 7be1db3..2bfac48 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -5763,7 +5763,7 @@ RenderUseCleverUI Comment - Turns on the \"clever\" UI rendering optimization. It's a known performace gain (and enabled by default) on apple. + Turns on the \"clever\" UI rendering optimization. It's a known performace gain on apple. Persist 1 Type diff --git a/linden/indra/newview/lldynamictexture.cpp b/linden/indra/newview/lldynamictexture.cpp index 14b80d6..6bcf140 100644 --- a/linden/indra/newview/lldynamictexture.cpp +++ b/linden/indra/newview/lldynamictexture.cpp @@ -223,17 +223,15 @@ BOOL LLDynamicTexture::updateAllInstances() glClear(GL_DEPTH_BUFFER_BIT); gDisplaySwapBuffers = FALSE; - LLVertexBuffer::startRender(); - gGL.start(); - dynamicTexture->preRender(); // Must be called outside of startRender() + LLVertexBuffer::startRender(); + if (dynamicTexture->render()) { result = TRUE; sNumRenders++; } - gGL.stop(); LLVertexBuffer::stopRender(); dynamicTexture->postRender(result); diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 1ea0495..317636e 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -1038,6 +1038,8 @@ BOOL LLPreviewAnimation::render() { mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; + + gGL.start(); glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); @@ -1108,7 +1110,6 @@ BOOL LLPreviewAnimation::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } - gGL.start(); return TRUE; } diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp index 7b1c8cc..f1f7ff6 100644 --- a/linden/indra/newview/llfloaterimagepreview.cpp +++ b/linden/indra/newview/llfloaterimagepreview.cpp @@ -667,6 +667,8 @@ void LLImagePreviewAvatar::setPreviewTarget(const char* joint_name, const char* //----------------------------------------------------------------------------- BOOL LLImagePreviewAvatar::render() { + gGL.start(); + mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; @@ -723,8 +725,6 @@ BOOL LLImagePreviewAvatar::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } - gGL.start(); - return TRUE; } @@ -823,6 +823,8 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) //----------------------------------------------------------------------------- BOOL LLImagePreviewSculpted::render() { + gGL.start(); + mNeedsUpdate = FALSE; LLGLSUIDefault def; @@ -917,6 +919,8 @@ BOOL LLImagePreviewSculpted::render() delete [] normals; } + gGL.stop(); + return TRUE; } diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index 28b92fd..f63eaf3 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp @@ -1006,17 +1006,17 @@ void LLViewerObjectList::renderObjectBeacons() return; } - S32 i; //const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); LLGLSUIDefault gls_ui; - S32 last_line_width = -1; - { LLGLSNoTexture gls_ui_no_texture; - gGL.begin(GL_LINES); - for (i = 0; i < mDebugBeacons.count(); i++) + + S32 last_line_width = -1; + // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width) + + for (S32 i = 0; i < mDebugBeacons.count(); i++) { const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; LLColor4 color = debug_beacon.mColor; @@ -1024,8 +1024,11 @@ void LLViewerObjectList::renderObjectBeacons() S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.end(); - gGL.flush(); + if (i > 0) + { + gGL.end(); + gGL.flush(); + } glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(GL_LINES); @@ -1049,17 +1052,21 @@ void LLViewerObjectList::renderObjectBeacons() LLGLSNoTexture gls_ui_no_texture; LLGLDepthTest gls_depth(GL_TRUE); - gGL.begin(GL_LINES); - last_line_width = -1; - for (i = 0; i < mDebugBeacons.count(); i++) + S32 last_line_width = -1; + // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width) + + for (S32 i = 0; i < mDebugBeacons.count(); i++) { const LLDebugBeacon &debug_beacon = mDebugBeacons[i]; S32 line_width = debug_beacon.mLineWidth; if (line_width != last_line_width) { - gGL.end(); - gGL.flush(); + if (i > 0) + { + gGL.end(); + gGL.flush(); + } glLineWidth( (F32)line_width ); last_line_width = line_width; gGL.begin(GL_LINES); @@ -1076,12 +1083,12 @@ void LLViewerObjectList::renderObjectBeacons() draw_line_cube(0.10f, thisline); } + gGL.end(); - gGL.flush(); glLineWidth(1.f); - for (i = 0; i < mDebugBeacons.count(); i++) + for (S32 i = 0; i < mDebugBeacons.count(); i++) { LLDebugBeacon &debug_beacon = mDebugBeacons[i]; if (debug_beacon.mString == "") diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 6f06117..3cb9dfb 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -1061,7 +1061,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( mSessionUUID(session_id), mVoiceChannel(NULL), mSessionInitialized(FALSE), - + mSessionStartMsgPos(0), mOtherParticipantUUID(other_participant_id), mDialog(dialog), mTyping(FALSE), @@ -1090,6 +1090,7 @@ LLFloaterIMPanel::LLFloaterIMPanel( mSessionUUID(session_id), mVoiceChannel(NULL), mSessionInitialized(FALSE), + mSessionStartMsgPos(0), mOtherParticipantUUID(other_participant_id), mDialog(dialog), mTyping(FALSE), @@ -1182,6 +1183,7 @@ void LLFloaterIMPanel::init(const LLString& session_label) //we don't need to need to wait for any responses //so we're already initialized mSessionInitialized = TRUE; + mSessionStartMsgPos = 0; } else { diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp index 66d9a33..5a0a843 100644 --- a/linden/indra/newview/lltexlayer.cpp +++ b/linden/indra/newview/lltexlayer.cpp @@ -244,6 +244,8 @@ BOOL LLTexLayerSetBuffer::render() BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal()); BOOL success = TRUE; + gGL.start(); + // Composite bump if( mBumpTexName ) { @@ -295,6 +297,8 @@ BOOL LLTexLayerSetBuffer::render() glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); + gGL.stop(); + // we have valid texture data now mInitialized = TRUE; mNeedsUpdate = FALSE; diff --git a/linden/indra/newview/lltoolmorph.cpp b/linden/indra/newview/lltoolmorph.cpp index 5b3f1eb..9acf3a0 100644 --- a/linden/indra/newview/lltoolmorph.cpp +++ b/linden/indra/newview/lltoolmorph.cpp @@ -163,6 +163,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth) //----------------------------------------------------------------------------- BOOL LLVisualParamHint::render() { + gGL.start(); + LLVisualParamReset::sDirty = TRUE; LLVOAvatar* avatarp = gAgent.getAvatarObject(); @@ -223,6 +225,7 @@ BOOL LLVisualParamHint::render() LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation); gGL.stop(); + LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight); LLViewerCamera::getInstance()->setOriginAndLookAt( camera_pos, // camera @@ -238,7 +241,7 @@ BOOL LLVisualParamHint::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight); - gGL.start(); + return TRUE; } diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 6ee80a6..2459133 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -4897,12 +4897,12 @@ BOOL menu_check_build_tool( void* user_data ) void handle_reload_settings(void*) { gSavedSettings.resetToDefaults(); - gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile")); llinfos << "Loading colors from colors.xml" << llendl; std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml"); gColors.resetToDefaults(); - gColors.loadFromFile(color_file, FALSE, TYPE_COL4U); + gColors.loadFromFileLegacy(color_file, FALSE, TYPE_COL4U); } class LLWorldSetHomeLocation : public view_listener_t diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 592ef39..e9f100e 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -5063,7 +5063,7 @@ void callback_load_url(S32 option, void* data) if (0 == option) { - LLWeb::loadURL(infop->mUrl); + LLWeb::loadURLExternal(infop->mUrl); } delete infop; diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index 188c277..6b5b9bb 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp @@ -766,9 +766,7 @@ void LLVOVolume::sculpt() sculpt_height = raw_image->getHeight(); sculpt_width = raw_image->getWidth(); - - sculpt_components = raw_image->getComponents(); - sculpt_data = raw_image->getData(); + sculpt_components = raw_image->getComponents(); if(is_valid) { @@ -776,12 +774,18 @@ void LLVOVolume::sculpt() } if(!is_valid) { - sculpt_width = 0 ; - sculpt_height = 0 ; + sculpt_width = 0; + sculpt_height = 0; + sculpt_data = NULL ; + } + else + { + if (raw_image->getDataSize() < sculpt_height * sculpt_width * sculpt_components) + llerrs << "Sculpt: image data size = " << raw_image->getDataSize() + << " < " << sculpt_height << " x " << sculpt_width << " x " <getData(); } - - llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components); - getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); } } diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index 0243fd7..c87e237 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt @@ -1,3 +1,11 @@ +Release Notes for Second Life 1.20(4) April 24th, 2008 +===================================== +Fixes: +* VWR-6286 - changed the method LLControlGroup::loadFromFile to only load values of settings that are persistent +* Instant Crash on Editing Appearance +* Crash in LLFloaterIMPanel when starting conference +* Crash on LLVOVolume::sculpt - newview/llvovolume.cpp + Release Notes for Second Life 1.20(3) April 23th, 2008 ===================================== Fixes: -- cgit v1.1