diff options
author | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
commit | 0277259455c4354f81ea8a24c8ab93f27567bc6f (patch) | |
tree | f1411dab563dcf697f794e9e8a592a6d3e5c4d2d /indra/newview | |
parent | 568397bbcc4fca307ebc010ec7f815422b9ba80a (diff) |
svn merge -r 59968:60342 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/newview')
40 files changed, 440 insertions, 287 deletions
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 17e24277f0..28b1ddc131 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -153,21 +153,8 @@ RenderLighting 1 0 RenderParticleCount 1 2048 RenderTerrainDetail 1 0 -list GeForce3 - -list ATI - -list Radeon8500 -RenderLighting 1 0 -RenderParticleCount 1 4096 - -// Hacked to be paranoid "safe" -list Radeon9700 -RenderParticleCount 1 4096 - -// Hacked to be paranoid "safe" -list MobilityRadeon9000 -RenderLighting 1 0 -RenderParticleCount 1 4096 +list ATI_Mobility_Radeon_X3xx +VertexShaderEnable 1 0 -list GeForceFX +list ATI_Mobility_Radeon_X6xx +VertexShaderEnable 1 0 diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 92f9b446f8..49b199c0a4 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -22,6 +22,8 @@ ATI All-in-Wonder X1800 .*ATI.*All-in-Wonder X18.* 3 ATI All-in-Wonder X1900 .*ATI.*All-in-Wonder X19.* 3 ATI ASUS X1xxx .*ASUS X1.* 3 ATI Mobility Radeon X1xxx .*ATI.*Mobility.*X1.* 2 +ATI Mobility Radeon X3xx .*ATI.*Mobility.*X3.* 1 +ATI Mobility Radeon X6xx .*ATI.*Mobility.*X6.* 1 ATI Radeon OpenGL .*ATI.*Radeon OpenGL.* 3 ATI Diamond X1xxx .*ATI.*Diamond.*X1.* 3 ATI FireGL 5xxx .*ATI.*FireGL V5.* 3 diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index 7c972bb8d1..cabb0345db 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -10,8 +10,16 @@ Life itself - please see <http://www.secondlife.com/whatis/>. 3. Installing & Running 4. Known Issues 5. Troubleshooting + 5.1. 'Error creating window.' + 5.2. System hangs + 5.3. 'Shiny' and client performance + 5.4. Audio + 5.5. 'Alt' key for camera controls doesn't work 6. Advanced Troubleshooting -7. Getting more help, and reporting problems + 6.1. Audio + 6.2. OpenGL +7. Obtaining and working with the client source code +8. Getting more help, and reporting problems 1. INTRODUCTION @@ -28,6 +36,11 @@ with your system. Be aware that although the client itself is provided for testing purposes, any changes you make within the Second Life world are permanent. +You will have either obtained this client from secondlife.com (the official +site) or from a third-party packager; if you encounter any problems then +we recommend trying the latest official builds from secondlife.com which are +updated often. + Please enjoy! @@ -37,10 +50,10 @@ Please enjoy! Minimum requirements: * Internet Connection: Cable or DSL * Computer Processor: 800MHz Pentium III or Athlon, or better - * Computer Memory: 256MB or better + * Computer Memory: 256MB or better (strongly recommend more!) * Linux Operating System: A reasonably modern 32-bit Linux environment - is required. If you are running a 64-bit Linux distribution, you - may need a set of 32-bit compatibility libraries. + is required. If you are running a 64-bit Linux distribution then + you will need its 32-bit compatibility environment installed. * Video/Graphics Card: o nVidia GeForce 2, GeForce 4mx, or better o OR ATI Radeon 8500, 9250, or better @@ -125,7 +138,7 @@ SOLUTION:- Usually this indicates that your graphics card does not meet PROBLEM 2:- My whole system seems to hang when running Second Life. SOLUTION:- This is typically a hardware/driver issue. The first thing to do is to check that you have the most recent official drivers for your - graphics card. + graphics card (see PROBLEM 1). SOLUTION:- Some residents with ATI cards have reported that running 'sudo aticonfig --locked-userpages=off' before running Second Life solves their stability issues. @@ -147,6 +160,9 @@ SOLUTION:- Some graphics performance features in Second Life are disabled automatically used, and some new options in Preferences will now be available to you; there is no guarantee, however, that they will positively affect performance! +SOLUTION:- If you are not running an official Second Life client obtained from + secondlife.com, you should consider doing so as you may find its + performance to be superior to third-party versions. PROBLEM 4:- Sound effects seem to 'lag' a fraction of a second behind actions. @@ -154,6 +170,13 @@ SOLUTION:- You may uncomment the 'LL_BAD_ESD' line in the 'secondlife' script to get more responsive audio. However, if you do this then you may encounter audio issues or a hang during login, so beware. +PROBLEM 5:- Using the 'Alt' key to control the camera doesn't work or just + moves the Second Life window. +SOLUTION:- Some window managers eat the Alt key for their own purposes; you + can configure your window manager to use a different key instead (for + example, the 'Windows' key!) which will allow the Alt key to function + properly with mouse actions in Second Life and other applications. + 6. ADVANCED TROUBLESHOOTING -=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -178,15 +201,28 @@ configuration options for advanced troubleshooters. LL_GL_BASICEXT and LL_GL_NOEXT should be commented-out for this to be useful. -7. GETTING MORE HELP AND REPORTING PROBLEMS +7. OBTAINING AND WORKING WITH THE CLIENT SOURCE CODE +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +We're pleased to have released the Second Life client's source code under +an Open Source license compatible with the 'GPL'. To get involved with client +development, please see: +<http://wiki.secondlife.com/wiki/Open_Source_Portal> + + +8. GETTING MORE HELP AND REPORTING PROBLEMS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- For general help and support with Second Life: <http://secondlife.com/community/support.php> +For problems and discussion concerning unofficial (not secondlife.com) +releases, please contact your packager or the SLDev mailing list: +<https://lists.secondlife.com/cgi-bin/mailman/listinfo/sldev> + In-world help: Please use the 'Help' menu in the client for general non-Linux-specific Second Life help including live support from the fabulous -Live Help team. +'Help Request' team. In-world discussion: There is a 'Linux Client Users' group inside Second Life which is free to join. You can find it by pressing diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 77bbc1ca81..5af5353c1b 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -82,7 +82,6 @@ void LLDrawable::init() mVObjp = NULL; // mFaces mSpatialGroupp = NULL; - mSpatialGroupOffset = -1; mVisible = 0; mRadius = 0.f; mSunShadowFactor = 1.f; @@ -1026,18 +1025,13 @@ void LLDrawable::updateUVMinMax() { } -void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp, const S32 offset) +void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp) { - mSpatialGroupp = groupp; - - if (mSpatialGroupp) + if (mSpatialGroupp && (groupp != mSpatialGroupp)) { - mSpatialGroupOffset = offset; + mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY); } - else - { - mSpatialGroupOffset = -1; - } + mSpatialGroupp = groupp; } LLSpatialPartition* LLDrawable::getSpatialPartition() @@ -1411,13 +1405,13 @@ void LLSpatialBridge::cleanupReferences() LLDrawable::cleanupReferences(); if (mDrawable) { - mDrawable->setSpatialGroup(NULL, -1); + mDrawable->setSpatialGroup(NULL); for (U32 i = 0; i < mDrawable->getChildCount(); i++) { LLDrawable* drawable = mDrawable->getChild(i); - if (drawable && drawable->getVOVolume()) + if (drawable) { - drawable->setSpatialGroup(NULL, -1); + drawable->setSpatialGroup(NULL); } } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index fef8b02ad5..e95437f4ec 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -170,7 +170,7 @@ public: // Debugging methods S32 findReferences(LLDrawable *drawablep); // Not const because of @#$! iterators... - void setSpatialGroup(LLSpatialGroup *groupp, const S32 offset); + void setSpatialGroup(LLSpatialGroup *groupp); LLSpatialGroup *getSpatialGroup() const { return mSpatialGroupp; } LLSpatialPartition* getSpatialPartition(); @@ -287,7 +287,6 @@ protected: face_list_t mFaces; LLSpatialGroup* mSpatialGroupp; LLPointer<LLDrawable> mSpatialBridge; - S32 mSpatialGroupOffset; mutable U32 mVisible; F32 mRadius; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a0cc189c46..d8b923c271 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -79,7 +79,6 @@ LLDrawPool *LLDrawPoolAvatar::instancePool() } BOOL gRenderAvatar = TRUE; -static LLMatrix4 sModelViewMatrix = LLMatrix4(); S32 LLDrawPoolAvatar::getVertexShaderLevel() const { @@ -103,7 +102,14 @@ void LLDrawPoolAvatar::prerender() LLMatrix4& LLDrawPoolAvatar::getModelView() { - return sModelViewMatrix; + static LLMatrix4 ret; + + ret.initRows(LLVector4(gGLModelView+0), + LLVector4(gGLModelView+4), + LLVector4(gGLModelView+8), + LLVector4(gGLModelView+12)); + + return ret; } //----------------------------------------------------------------------------- @@ -132,7 +138,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass) beginFootShadow(); break; case 1: - glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) sModelViewMatrix.mMatrix); beginRigid(); break; case 2: @@ -507,7 +512,6 @@ void LLDrawPoolAvatar::renderForSelect() glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) sModelViewMatrix.mMatrix); sVertexProgram = &gAvatarPickProgram; if (sShaderLevel > 0) { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index f0f7130e0b..67f60ffdfa 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -16,6 +16,7 @@ #include "llimagegl.h" #include "m3math.h" #include "m4math.h" +#include "v4math.h" #include "llagent.h" #include "llcubemap.h" @@ -182,6 +183,11 @@ void LLDrawPoolBump::render(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_BUMP); + if (!gPipeline.hasRenderType(LLDrawPool::POOL_SIMPLE)) + { + return; + } + switch( pass ) { case 0: @@ -237,7 +243,10 @@ void LLDrawPoolBump::beginShiny() if (LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT) > 0) { LLMatrix4 mat; - glGetFloatv(GL_MODELVIEW_MATRIX, (F32*) mat.mMatrix); + mat.initRows(LLVector4(gGLModelView+0), + LLVector4(gGLModelView+4), + LLVector4(gGLModelView+8), + LLVector4(gGLModelView+12)); gObjectShinyProgram.bind(); LLVector3 vec = LLVector3(gShinyOrigin) * mat; LLVector4 vec4(vec, gShinyOrigin.mV[3]); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e3b5a2bb68..7d7c2017aa 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -173,7 +173,7 @@ BOOL LLFeatureManager::maskFeatures(const char *name) LLFeatureList *maskp = findMask(name); if (!maskp) { - llwarns << "Unknown feature mask " << name << llendl; +// llwarns << "Unknown feature mask " << name << llendl; return FALSE; } llinfos << "Applying Feature Mask: " << name << llendl; @@ -431,14 +431,6 @@ void LLFeatureManager::initGraphicsFeatureMasks() { maskFeatures("ATI"); } - if (gGLManager.mIsRadeon8500) - { - maskFeatures("Radeon8500"); - } - if (gGLManager.mIsRadeon9700) - { - maskFeatures("Radeon9700"); - } if (gGLManager.mIsGFFX) { maskFeatures("GeForceFX"); @@ -451,11 +443,18 @@ void LLFeatureManager::initGraphicsFeatureMasks() { maskFeatures("OpenGLPre15"); } - - if (gGLManager.mIsMobilityRadeon9000) + // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces + std::string gpustr = mGPUString; + for (std::string::iterator iter = gpustr.begin(); iter != gpustr.end(); ++iter) { - maskFeatures("MobilityRadeon9000"); + if (*iter == ' ') + { + *iter = '_'; + } } +// llinfos << "Masking features from gpu table match: " << gpustr << llendl; + maskFeatures(gpustr.c_str()); + if (isSafe()) { maskFeatures("safe"); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 5ced5eafb7..63b5262ced 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -93,7 +93,7 @@ LLFloaterAbout::LLFloaterAbout() // CPU support.append("CPU: "); - support.append( gSysCPU.getCPUStringTerse() ); + support.append( gSysCPU.getCPUString() ); support.append("\n"); U32 memory = gSysMemory.getPhysicalMemory() / 1024 / 1024; diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index 293bf61a0d..59df3bc2e2 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -78,6 +78,7 @@ void LLFloaterAvatarTextures::draw() LLFloater::draw(); } +#if !LL_RELEASE_FOR_DOWNLOAD static void update_texture_ctrl(LLVOAvatar* avatarp, LLTextureCtrl* ctrl, LLVOAvatar::ETextureIndex te) @@ -115,7 +116,6 @@ static LLVOAvatar* find_avatar(const LLUUID& id) void LLFloaterAvatarTextures::refresh() { -#if !LL_RELEASE_FOR_DOWNLOAD LLVOAvatar *avatarp = find_avatar(mID); if (avatarp) { @@ -158,9 +158,16 @@ void LLFloaterAvatarTextures::refresh() { setTitle(mTitle + ": INVALID AVATAR (" + mID.asString() + ")"); } -#endif } +#else + +void LLFloaterAvatarTextures::refresh() +{ +} + +#endif + // static void LLFloaterAvatarTextures::onClickDump(void* data) { diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 6f31cbb3a0..534aac077f 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -526,38 +526,51 @@ void LLFloaterFriends::requestFriendship(const LLUUID& target_id, const LLString IM_FRIENDSHIP_OFFERED); } +struct LLAddFriendData +{ + LLUUID mID; + std::string mName; +}; + // static -void LLFloaterFriends::callbackAddFriend(S32 option, void* user_data) +void LLFloaterFriends::callbackAddFriend(S32 option, void* data) { + LLAddFriendData* add = (LLAddFriendData*)data; if (option == 0) { - LLFloaterFriends* self = (LLFloaterFriends*)user_data; - requestFriendship(self->mAddFriendID, self->mAddFriendName); + requestFriendship(add->mID, add->mName); } + delete add; } // static void LLFloaterFriends::onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, - void* user_data) + void* ) { if (names.empty()) return; if (ids.empty()) return; + requestFriendshipDialog(ids[0], names[0]); +} - LLFloaterFriends* self = (LLFloaterFriends*)user_data; - self->mAddFriendID = ids[0]; - self->mAddFriendName = names[0]; - - if(ids[0] == gAgentID) +// static +void LLFloaterFriends::requestFriendshipDialog(const LLUUID& id, + const std::string& name) +{ + if(id == gAgentID) { LLNotifyBox::showXml("AddSelfFriend"); return; } + LLAddFriendData* data = new LLAddFriendData(); + data->mID = id; + data->mName = name; + // TODO: accept a line of text with this dialog LLString::format_map_t args; - args["[NAME]"] = names[0]; - gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, user_data); + args["[NAME]"] = name; + gViewerWindow->alertXml("AddFriend", args, callbackAddFriend, data); } // static diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h index a71b53f206..c6ef365517 100644 --- a/indra/newview/llfloaterfriends.h +++ b/indra/newview/llfloaterfriends.h @@ -53,7 +53,14 @@ public: // Toggles visibility of floater static void toggle(void* unused = NULL); - static void requestFriendship(const LLUUID& target_id, const LLString& target_name); + // Show a dialog explaining what friendship entails, then request + // friendship. JC + static void requestFriendshipDialog(const LLUUID& target_id, + const std::string& target_name); + + // Just request friendship, no dialog. + static void requestFriendship(const LLUUID& target_id, + const LLString& target_name); private: diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 9b74b3963b..72c114d966 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -77,12 +77,9 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, LLVector3 render_pos = pos_agent + (floorf(x_offset) * right_axis) + (floorf(y_offset) * up_axis); //get the render_pos in screen space - F64 modelview[16]; - F64 projection[16]; - GLint viewport[4]; - glGetDoublev(GL_MODELVIEW_MATRIX, modelview); - glGetDoublev(GL_PROJECTION_MATRIX, projection); - glGetIntegerv(GL_VIEWPORT, viewport); + F64* modelview = gGLModelView; + F64* projection = gGLProjection; + GLint* viewport = (GLint*) gGLViewport; F64 winX, winY, winZ; gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1050070f81..5c32f8d90a 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -219,8 +219,6 @@ void LLNetMap::draw() mCurPanY = lerp(mCurPanY, mTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); // Prepare a scissor region - // GLint params[4]; - // glGetIntegerv( GL_SCISSOR_BOX, params ); F32 rotation = 0; { diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 05bd59593d..1b0c731ea9 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -10,6 +10,7 @@ #include "llpanelavatar.h" +#include "llclassifiedflags.h" #include "llfontgl.h" #include "llcachename.h" @@ -24,6 +25,8 @@ #include "llcallingcard.h" #include "llcheckboxctrl.h" #include "llfloater.h" + +#include "llfloaterfriends.h" #include "llfloatergroupinfo.h" #include "llfloaterworldmap.h" #include "llfloatermute.h" @@ -446,7 +449,8 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); - childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + //childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); @@ -839,9 +843,9 @@ void LLPanelAvatarClassified::refresh() S32 tab_count = tabs ? tabs->getTabCount() : 0; - BOOL allow_new = TRUE; //tab_count < MAX_CLASSIFIEDS; - BOOL allow_delete = (tab_count > 0); - BOOL show_help = (tab_count == 0); + bool allow_new = tab_count < MAX_CLASSIFIEDS; + bool allow_delete = (tab_count > 0); + bool show_help = (tab_count == 0); childSetEnabled("New...",self && allow_new); childSetEnabled("Delete...",self && allow_delete); @@ -904,9 +908,8 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); - // Clear out all the old panels. - // We'll replace them with the correct number of new panels. - deleteClassifiedPanels(); + // Don't remove old panels. We need to be able to process multiple + // packets for people who have lots of classifieds. JC block_count = msg->getNumberOfBlocksFast(_PREHASH_Data); for (block = 0; block < block_count; block++) @@ -1434,6 +1437,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, childSetEnabled("Show on Map",FALSE); childSetVisible("Rate...",FALSE); childSetEnabled("Rate...",FALSE); + childSetVisible("Add Friend...",FALSE); + childSetEnabled("Add Friend...",FALSE); childSetVisible("Pay...",FALSE); childSetEnabled("Pay...",FALSE); } @@ -1472,6 +1477,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, } childSetVisible("Rate...",TRUE); childSetEnabled("Rate...",FALSE); + childSetVisible("Add Friend...", true); + childSetEnabled("Add Friend...", true); childSetVisible("Pay...",TRUE); childSetEnabled("Pay...",FALSE); } @@ -1580,6 +1587,18 @@ void LLPanelAvatar::onClickRate(void *userdata) LLFloaterRate::show(self->mAvatarID); } +// static +void LLPanelAvatar::onClickAddFriend(void* userdata) +{ + LLPanelAvatar* self = (LLPanelAvatar*) userdata; + LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + if (name_edit) + { + LLFloaterFriends::requestFriendshipDialog(self->getAvatarID(), + name_edit->getText()); + } +} + //----------------------------------------------------------------------------- // onClickMute() //----------------------------------------------------------------------------- diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index be6feebc30..994d23b7d3 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -289,6 +289,7 @@ public: static void onClickOfferTeleport( void *userdata); static void onClickPay( void *userdata); static void onClickRate( void *userdata); + static void onClickAddFriend(void* userdata); static void onClickOK( void *userdata); static void onClickCancel( void *userdata); static void onClickKick( void *userdata); @@ -296,7 +297,6 @@ public: static void onClickUnfreeze(void *userdata); static void onClickCSR( void *userdata); static void onClickMute( void *userdata); - static void onClickAddFriend(void* data); static void finishKick(S32 option, const LLString& text, void* userdata); static void finishFreeze(S32 option, const LLString& text, void* userdata); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 94773e21ba..58a5969792 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -382,7 +382,7 @@ BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) if ( KEY_F1 == key ) { llinfos << "Spawning HTML help window" << llendl; - LLHtmlHelp::show(); + gViewerHtmlHelp.show(); return TRUE; }; #if ! LL_RELEASE_FOR_DOWNLOAD diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 4b7be3701b..b8f1e51e9e 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -457,7 +457,7 @@ void LLPreviewTexture::updateAspectRatio() void LLPreviewTexture::loadAsset() { - mImage = gImageList.getImage(mImageID, MIPMAP_FALSE, FALSE); + mImage = gImageList.getImage(mImageID, MIPMAP_TRUE, FALSE); mImage->setBoostLevel(LLViewerImage::BOOST_PREVIEW); mAssetStatus = PREVIEW_ASSET_LOADING; } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d8d9f1c5d6..333ed91e4a 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -126,7 +126,7 @@ LLSpatialGroup::~LLSpatialGroup() { sZombieGroups--; } - + LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); clearDrawMap(); } @@ -197,10 +197,34 @@ void LLSpatialGroup::validate() #if LL_OCTREE_PARANOIA_CHECK sg_assert(!isState(DIRTY)); + sg_assert(!isDead()); LLVector3 myMin = mBounds[0] - mBounds[1]; LLVector3 myMax = mBounds[0] + mBounds[1]; + validateDrawMap(); + + for (element_iter i = getData().begin(); i != getData().end(); ++i) + { + LLDrawable* drawable = *i; + sg_assert(drawable->getSpatialGroup() == this); + if (drawable->getSpatialBridge()) + { + sg_assert(drawable->getSpatialBridge() == mSpatialPartition->asBridge()); + } + + if (drawable->isSpatialBridge()) + { + LLSpatialPartition* part = drawable->asPartition(); + if (!part) + { + llerrs << "Drawable reports it is a spatial bridge but not a partition." << llendl; + } + LLSpatialGroup* group = (LLSpatialGroup*) part->mOctree->getListener(0); + group->validate(); + } + } + for (U32 i = 0; i < mOctreeNode->getChildCount(); ++i) { LLSpatialGroup* group = (LLSpatialGroup*) mOctreeNode->getChild(i)->getListener(0); @@ -226,8 +250,8 @@ void LLSpatialGroup::validate() void validate_draw_info(LLDrawInfo& params) { -#if LL_DEBUG -/* if (params.mVertexBuffer.isNull()) +#if LL_OCTREE_PARANOIA_CHECK + if (params.mVertexBuffer.isNull()) { llerrs << "Draw batch has no vertex buffer." << llendl; } @@ -238,12 +262,12 @@ void validate_draw_info(LLDrawInfo& params) llerrs << "Draw batch has invalid range." << llendl; } - if (params.mEnd >= params.mVertexBuffer->getNumVerts()) + if (params.mEnd >= (U32) params.mVertexBuffer->getNumVerts()) { llerrs << "Draw batch has buffer overrun error." << llendl; } - if (params.mOffset + params.mCount > params.mVertexBuffer->getNumIndices()) + if (params.mOffset + params.mCount > (U32) params.mVertexBuffer->getNumIndices()) { llerrs << "Draw batch has index buffer ovverrun error." << llendl; } @@ -264,13 +288,14 @@ void validate_draw_info(LLDrawInfo& params) llerrs << "Draw batch has vertex buffer index out of range error (index too high)." << llendl; } } - }*/ + } #endif } void LLSpatialGroup::validateDrawMap() { -/* for (draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i) +#if LL_OCTREE_PARANOIA_CHECK + for (draw_map_t::iterator i = mDrawMap.begin(); i != mDrawMap.end(); ++i) { std::vector<LLDrawInfo*>& draw_vec = i->second; for (std::vector<LLDrawInfo*>::iterator j = draw_vec.begin(); j != draw_vec.end(); ++j) @@ -279,7 +304,8 @@ void LLSpatialGroup::validateDrawMap() validate_draw_info(params); } - }*/ + } +#endif } void LLSpatialGroup::makeStatic() @@ -342,7 +368,7 @@ BOOL LLSpatialGroup::addObject(LLDrawable *drawablep, BOOL add_all, BOOL from_oc } else { - drawablep->setSpatialGroup(this, 0); + drawablep->setSpatialGroup(this); validate_drawable(drawablep); setState(OBJECT_DIRTY | GEOM_DIRTY); mLastAddTime = gFrameTimeSeconds; @@ -554,7 +580,7 @@ BOOL LLSpatialGroup::removeObject(LLDrawable *drawablep, BOOL from_octree) } else { - drawablep->setSpatialGroup(NULL, -1); + drawablep->setSpatialGroup(NULL); setState(GEOM_DIRTY); if (drawablep->isSpatialBridge()) { @@ -867,6 +893,16 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); setState(DEAD); + + for (element_iter i = getData().begin(); i != getData().end(); ++i) + { + LLDrawable* drawable = *i; + if (drawable->getSpatialGroup() == this) + { + drawable->setSpatialGroup(NULL); + } + } + clearDrawMap(); mOcclusionVerts = NULL; mVertexBuffer = NULL; @@ -1108,7 +1144,7 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp) { LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); - drawablep->setSpatialGroup(NULL, -1); + drawablep->setSpatialGroup(NULL); if (!curp->removeObject(drawablep)) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f3a2c629fd..baf6abda11 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -328,13 +328,16 @@ BOOL idle_startup() { gViewerWindow->alertXml("DisplaySetToSafe"); } - else if (gSavedSettings.getS32("LastFeatureVersion") < gFeatureManagerp->getVersion()) + else if ((gSavedSettings.getS32("LastFeatureVersion") < gFeatureManagerp->getVersion()) && + (gSavedSettings.getS32("LastFeatureVersion") != 0)) { - if (gSavedSettings.getS32("LastFeatureVersion") != 0) - { - gViewerWindow->alertXml("DisplaySetToRecommended"); - } + gViewerWindow->alertXml("DisplaySetToRecommended"); } + else if (!gViewerWindow->getInitAlert().empty()) + { + gViewerWindow->alertXml(gViewerWindow->getInitAlert()); + } + gSavedSettings.setS32("LastFeatureVersion", gFeatureManagerp->getVersion()); LLString xml_file = LLUI::locateSkin("xui_version.xml"); diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 4be7cf41e7..8d30ebbcda 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -183,6 +183,11 @@ LLVector2 LLSurfacePatch::getTexCoords(const U32 x, const U32 y) const void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 *vertex, LLVector3 *normal, LLVector2 *tex0, LLVector2 *tex1) { + if (!mSurfacep || !mSurfacep->getRegion()) + { + return; // failsafe + } + U32 surface_stride = mSurfacep->getGridsPerEdge(); U32 point_offset = x + y*surface_stride; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 2c7c892807..a155a7aeec 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -77,6 +77,7 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 ¢er, // Handy copies of last good GL matrices F64 gGLModelView[16]; +F64 gGLProjection[16]; S32 gGLViewport[4]; const LLMatrix4 &LLViewerCamera::getProjection() const @@ -231,6 +232,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection, aspect, z_near, z_far); + glGetDoublev(GL_PROJECTION_MATRIX, gGLProjection); glGetFloatv(GL_PROJECTION_MATRIX, (float*)&gProjectionMat); glMatrixMode( GL_MODELVIEW ); diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index 6ce1dcc046..b28aac269b 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -90,6 +90,7 @@ public: extern LLViewerCamera *gCamera; extern F64 gGLModelView[16]; +extern F64 gGLProjection[16]; extern S32 gGLViewport[4]; #endif // LL_LLVIEWERCAMERA_H diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index df5b0f1182..ee878c1dc0 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -577,11 +577,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield) gPipeline.stateSort(hud_cam); } - if (LLVertexBuffer::sEnableVBOs) - { - LLImageGL::sBoundTextureMemory += LLVertexBuffer::sAllocatedBytes; - } - gPipeline.renderGeom(hud_cam); //restore type mask @@ -800,8 +795,10 @@ void render_ui_2d() glPushMatrix(); S32 half_width = (gViewerWindow->getWindowWidth() / 2); S32 half_height = (gViewerWindow->getWindowHeight() / 2); + glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); glTranslatef((F32)half_width, (F32)half_height, 0.f); - glScalef(gAgent.getAvatarObject()->mHUDCurZoom, gAgent.getAvatarObject()->mHUDCurZoom, gAgent.getAvatarObject()->mHUDCurZoom); + F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; + glScalef(zoom,zoom,1.f); glColor4fv(LLColor4::white.mV); gl_rect_2d(-half_width, half_height, half_width, -half_height, FALSE); glPopMatrix(); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 123dcc8eb4..9bb4aa4cf9 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -47,7 +47,6 @@ static LLPointer<LLVertexBuffer> sRenderBuffer = NULL; static const U32 sRenderMask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD; -LLMatrix4 gBlendMat; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -884,89 +883,108 @@ BOOL LLViewerJointMesh::updateLOD(F32 pixel_area, BOOL activate) return (valid != activate); } + void LLViewerJointMesh::updateGeometry() { - if (mValid && mMesh && mFace && - mMesh->hasWeights() && - mFace->mVertexBuffer.notNull() && - LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR) == 0) + if (!(mValid + && mMesh + && mFace + && mMesh->hasWeights() + && mFace->mVertexBuffer.notNull() + && LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_AVATAR) == 0)) { - uploadJointMatrices(); - LLStrider<LLVector3> o_vertices; - LLStrider<LLVector3> o_normals; + return; + } + + uploadJointMatrices(); - //get vertex and normal striders - LLVertexBuffer *buffer = mFace->mVertexBuffer; - buffer->getVertexStrider(o_vertices, 0); - buffer->getNormalStrider(o_normals, 0); + LLStrider<LLVector3> o_vertices; + LLStrider<LLVector3> o_normals; + //get vertex and normal striders + LLVertexBuffer *buffer = mFace->mVertexBuffer; + buffer->getVertexStrider(o_vertices, 0); + buffer->getNormalStrider(o_normals, 0); + + F32 last_weight = F32_MAX; + LLMatrix4 gBlendMat; + LLMatrix3 gBlendRotMat; + + const F32* weights = mMesh->getWeights(); + const LLVector3* coords = mMesh->getCoords(); + const LLVector3* normals = mMesh->getNormals(); + for (U32 index = 0; index < mMesh->getNumVertices(); index++) + { + U32 bidx = index + mMesh->mFaceVertexOffset; + + // blend by first matrix + F32 w = weights[index]; + + // Maybe we don't have to change gBlendMat. + // Profiles of a single-avatar scene on a Mac show this to be a very + // common case. JC + if (w == last_weight) { - LLVector4 tpos0, tnorm0, tpos1, tnorm1, tbinorm0, tbinorm1; - F32 last_weight = F32_MAX; - LLMatrix3 gBlendRotMat; + o_vertices[bidx] = coords[index] * gBlendMat; + o_normals[bidx] = normals[index] * gBlendRotMat; + continue; + } + + last_weight = w; + S32 joint = llfloor(w); + w -= joint; - for (U32 index= 0; index < mMesh->getNumVertices(); index++) - { - // blend by first matrix - F32 w = mMesh->getWeights()[index]; - - if (w != last_weight) - { - last_weight = w; - - S32 joint = llfloor(w); - w -= joint; - - LLMatrix4 &m0 = gJointMat[joint+1]; - LLMatrix4 &m1 = gJointMat[joint+0]; - LLMatrix3 &n0 = gJointRot[joint+1]; - LLMatrix3 &n1 = gJointRot[joint+0]; - - if (w == 1.0f) - { - gBlendMat = m0; - gBlendRotMat = n0; - } - else - { - gBlendMat.mMatrix[VX][VX] = lerp(m1.mMatrix[VX][VX], m0.mMatrix[VX][VX], w); - gBlendMat.mMatrix[VX][VY] = lerp(m1.mMatrix[VX][VY], m0.mMatrix[VX][VY], w); - gBlendMat.mMatrix[VX][VZ] = lerp(m1.mMatrix[VX][VZ], m0.mMatrix[VX][VZ], w); - - gBlendMat.mMatrix[VY][VX] = lerp(m1.mMatrix[VY][VX], m0.mMatrix[VY][VX], w); - gBlendMat.mMatrix[VY][VY] = lerp(m1.mMatrix[VY][VY], m0.mMatrix[VY][VY], w); - gBlendMat.mMatrix[VY][VZ] = lerp(m1.mMatrix[VY][VZ], m0.mMatrix[VY][VZ], w); - - gBlendMat.mMatrix[VZ][VX] = lerp(m1.mMatrix[VZ][VX], m0.mMatrix[VZ][VX], w); - gBlendMat.mMatrix[VZ][VY] = lerp(m1.mMatrix[VZ][VY], m0.mMatrix[VZ][VY], w); - gBlendMat.mMatrix[VZ][VZ] = lerp(m1.mMatrix[VZ][VZ], m0.mMatrix[VZ][VZ], w); - - gBlendMat.mMatrix[VW][VX] = lerp(m1.mMatrix[VW][VX], m0.mMatrix[VW][VX], w); - gBlendMat.mMatrix[VW][VY] = lerp(m1.mMatrix[VW][VY], m0.mMatrix[VW][VY], w); - gBlendMat.mMatrix[VW][VZ] = lerp(m1.mMatrix[VW][VZ], m0.mMatrix[VW][VZ], w); - - gBlendRotMat.mMatrix[VX][VX] = lerp(n1.mMatrix[VX][VX], n0.mMatrix[VX][VX], w); - gBlendRotMat.mMatrix[VX][VY] = lerp(n1.mMatrix[VX][VY], n0.mMatrix[VX][VY], w); - gBlendRotMat.mMatrix[VX][VZ] = lerp(n1.mMatrix[VX][VZ], n0.mMatrix[VX][VZ], w); - - gBlendRotMat.mMatrix[VY][VX] = lerp(n1.mMatrix[VY][VX], n0.mMatrix[VY][VX], w); - gBlendRotMat.mMatrix[VY][VY] = lerp(n1.mMatrix[VY][VY], n0.mMatrix[VY][VY], w); - gBlendRotMat.mMatrix[VY][VZ] = lerp(n1.mMatrix[VY][VZ], n0.mMatrix[VY][VZ], w); - - gBlendRotMat.mMatrix[VZ][VX] = lerp(n1.mMatrix[VZ][VX], n0.mMatrix[VZ][VX], w); - gBlendRotMat.mMatrix[VZ][VY] = lerp(n1.mMatrix[VZ][VY], n0.mMatrix[VZ][VY], w); - gBlendRotMat.mMatrix[VZ][VZ] = lerp(n1.mMatrix[VZ][VZ], n0.mMatrix[VZ][VZ], w); - } - } + // No lerp required in this case. + if (w == 1.0f) + { + gBlendMat = gJointMat[joint+1]; + o_vertices[bidx] = coords[index] * gBlendMat; + gBlendRotMat = gJointRot[joint+1]; + o_normals[bidx] = normals[index] * gBlendRotMat; + continue; + } + + // Try to keep all the accesses to the matrix data as close + // together as possible. This function is a hot spot on the + // Mac. JC + LLMatrix4 &m0 = gJointMat[joint+1]; + LLMatrix4 &m1 = gJointMat[joint+0]; + + gBlendMat.mMatrix[VX][VX] = lerp(m1.mMatrix[VX][VX], m0.mMatrix[VX][VX], w); + gBlendMat.mMatrix[VX][VY] = lerp(m1.mMatrix[VX][VY], m0.mMatrix[VX][VY], w); + gBlendMat.mMatrix[VX][VZ] = lerp(m1.mMatrix[VX][VZ], m0.mMatrix[VX][VZ], w); - // write result - U32 bidx = index + mMesh->mFaceVertexOffset; + gBlendMat.mMatrix[VY][VX] = lerp(m1.mMatrix[VY][VX], m0.mMatrix[VY][VX], w); + gBlendMat.mMatrix[VY][VY] = lerp(m1.mMatrix[VY][VY], m0.mMatrix[VY][VY], w); + gBlendMat.mMatrix[VY][VZ] = lerp(m1.mMatrix[VY][VZ], m0.mMatrix[VY][VZ], w); - o_vertices[bidx] = mMesh->getCoords()[index] * gBlendMat; - o_normals[bidx] = mMesh->getNormals()[index] * gBlendRotMat; - } - } + gBlendMat.mMatrix[VZ][VX] = lerp(m1.mMatrix[VZ][VX], m0.mMatrix[VZ][VX], w); + gBlendMat.mMatrix[VZ][VY] = lerp(m1.mMatrix[VZ][VY], m0.mMatrix[VZ][VY], w); + gBlendMat.mMatrix[VZ][VZ] = lerp(m1.mMatrix[VZ][VZ], m0.mMatrix[VZ][VZ], w); + + gBlendMat.mMatrix[VW][VX] = lerp(m1.mMatrix[VW][VX], m0.mMatrix[VW][VX], w); + gBlendMat.mMatrix[VW][VY] = lerp(m1.mMatrix[VW][VY], m0.mMatrix[VW][VY], w); + gBlendMat.mMatrix[VW][VZ] = lerp(m1.mMatrix[VW][VZ], m0.mMatrix[VW][VZ], w); + + o_vertices[bidx] = coords[index] * gBlendMat; + + LLMatrix3 &n0 = gJointRot[joint+1]; + LLMatrix3 &n1 = gJointRot[joint+0]; + + gBlendRotMat.mMatrix[VX][VX] = lerp(n1.mMatrix[VX][VX], n0.mMatrix[VX][VX], w); + gBlendRotMat.mMatrix[VX][VY] = lerp(n1.mMatrix[VX][VY], n0.mMatrix[VX][VY], w); + gBlendRotMat.mMatrix[VX][VZ] = lerp(n1.mMatrix[VX][VZ], n0.mMatrix[VX][VZ], w); + + gBlendRotMat.mMatrix[VY][VX] = lerp(n1.mMatrix[VY][VX], n0.mMatrix[VY][VX], w); + gBlendRotMat.mMatrix[VY][VY] = lerp(n1.mMatrix[VY][VY], n0.mMatrix[VY][VY], w); + gBlendRotMat.mMatrix[VY][VZ] = lerp(n1.mMatrix[VY][VZ], n0.mMatrix[VY][VZ], w); + + gBlendRotMat.mMatrix[VZ][VX] = lerp(n1.mMatrix[VZ][VX], n0.mMatrix[VZ][VX], w); + gBlendRotMat.mMatrix[VZ][VY] = lerp(n1.mMatrix[VZ][VY], n0.mMatrix[VZ][VY], w); + gBlendRotMat.mMatrix[VZ][VZ] = lerp(n1.mMatrix[VZ][VZ], n0.mMatrix[VZ][VZ], w); + + o_normals[bidx] = normals[index] * gBlendRotMat; } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 114c90a4d8..e9d2218d55 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1237,11 +1237,6 @@ void init_debug_rendering_menu(LLMenuGL* menu) item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); menu->append(item); -#if 0 // 1.9.2 - item = new LLMenuItemCheckGL("Vertex Shaders", toggle_vertex_shaders, NULL, check_vertex_shaders, (void*)"VertexShaderEnable", 'V', MASK_CONTROL|MASK_ALT); - item->setEnabled(gGLManager.mHasVertexShader); - menu->append(item); -#endif menu->createJumpKeys(); } @@ -6481,7 +6476,7 @@ class LLShowFloater : public view_listener_t else if (floater_name == "help f1") { #if LL_LIBXUL_ENABLED - LLHtmlHelp::show(); + gViewerHtmlHelp.show(); #endif } else if (floater_name == "help in-world") diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 55256a6f23..cc1beefec5 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1560,7 +1560,17 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - + + // System messages, specifically "Foo Bar has left this session" + // are not shown unless you actually have that session open. + // Band-aid. JC + if (offline == IM_ONLINE + && chat.mFromName == SYSTEM_FROM + && !gIMView->hasSession(session_id)) + { + return; + } + // standard message, not from system char saved[MAX_STRING]; /* Flawfinder: ignore */ saved[0] = '\0'; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index bd8ac806f5..7ae166849b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4612,6 +4612,13 @@ void LLViewerObject::setRegion(LLViewerRegion *regionp) llassert(regionp); mLatestRecvPacketID = 0; mRegionp = regionp; + + for (child_list_t::iterator i = getChildren().begin(); i != getChildren().end(); ++i) + { + LLViewerObject* child = *i; + child->setRegion(regionp); + } + setChanged(MOVED | SILHOUETTE); updateDrawable(FALSE); } diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index bf09c54100..cb0df92386 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -230,13 +230,13 @@ void LLViewerPartGroup::removePart(const S32 part_num) void LLViewerPartGroup::updateParticles(const F32 dt) { LLMemType mt(LLMemType::MTYPE_PARTICLES); - S32 i, count; + S32 i; LLVector3 gravity(0.f, 0.f, -9.8f); LLViewerRegion *regionp = getRegion(); - count = (S32) mParticles.size(); - for (i = 0; i < count; i++) + S32 end = (S32) mParticles.size(); + for (i = 0; i < end; i++) { LLVector3 a(0.f, 0.f, 0.f); LLViewerPart& part = *((LLViewerPart*) mParticles[i]); @@ -345,9 +345,8 @@ void LLViewerPartGroup::updateParticles(const F32 dt) // Kill dead particles (either flagged dead, or too old) if ((part.mLastUpdateTime > part.mMaxAge) || (LLViewerPart::LL_PART_DEAD_MASK == part.mFlags)) { - removePart(i); - i--; - count--; + end--; + LLPointer<LLViewerPart>::swap(mParticles[i], mParticles[end]); } else { @@ -356,13 +355,24 @@ void LLViewerPartGroup::updateParticles(const F32 dt) { // Transfer particles between groups gWorldPointer->mPartSim.put(&part); - removePart(i); - i--; - count--; + end--; + LLPointer<LLViewerPart>::swap(mParticles[i], mParticles[end]); } } } + S32 removed = (S32)mParticles.size() - end; + if (removed > 0) + { + // we removed one or more particles, so flag this group for update + mParticles.erase(mParticles.begin() + end, mParticles.end()); + if (mVOPartGroupp.notNull()) + { + gPipeline.markRebuild(mVOPartGroupp->mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + LLViewerPartSim::decPartCount(removed); + } + // Kill the viewer object if this particle group is empty if (mParticles.empty()) { diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 4ebfef3a9b..d81454fa8d 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -1433,12 +1433,14 @@ BOOL LLViewerTextEditor::exportBuffer( LLString& buffer ) { LLNotecard nc(LLNotecard::MAX_SIZE); - std::vector<LLPointer<LLInventoryItem> > embedded_items; - mEmbeddedItemList->getEmbeddedItemList(embedded_items); - - nc.setItems(embedded_items); + // Get the embedded text and update the item list to just be the used items nc.setText(getEmbeddedText()); + // Now get the used items and copy the list to the notecard + std::vector<LLPointer<LLInventoryItem> > embedded_items; + mEmbeddedItemList->getEmbeddedItemList(embedded_items); + nc.setItems(embedded_items); + std::stringstream out_stream; nc.exportStream(out_stream); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 732568f652..f11f9fb1be 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1450,6 +1450,8 @@ LLViewerWindow::LLViewerWindow( LLFontManager::initClass(); + // Initialize OpenGL Renderer + if (!gFeatureManagerp->isFeatureAvailable("RenderVBO") || !gGLManager.mHasVertexBufferObject) { @@ -1475,16 +1477,30 @@ LLViewerWindow::LLViewerWindow( idx = LLViewerImageList::getMaxVideoRamSetting(-2); // get max recommended setting gSavedSettings.setS32("GraphicsCardMemorySetting", idx); } - + + // If we crashed while initializng GL stuff last time, disable certain features + if (gSavedSettings.getBOOL("RenderInitError")) + { + mInitAlert = "DisplaySettingsNoShaders"; + gSavedSettings.setBOOL("VertexShaderEnable", FALSE); + } + if (!gNoRender) { // // Initialize GL stuff // + // Set this flag in case we crash while initializing GL + gSavedSettings.setBOOL("RenderInitError", TRUE); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); + gPipeline.init(); stop_glerror(); initGLDefaults(); + + gSavedSettings.setBOOL("RenderInitError", FALSE); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); } // @@ -1531,6 +1547,7 @@ LLViewerWindow::LLViewerWindow( gSavedSettings.getControl("NumpadControl")->firePropertyChanged(); mDebugText = new LLDebugText(this); + } void LLViewerWindow::initGLDefaults() diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 8f3642ffd3..af5ffd7914 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -125,7 +125,9 @@ public: void getTargetWindow(BOOL& fullscreen, S32& width, S32& height) const; // The 'target' is where the user wants the window to be. It may not be // there yet, because we may be supressing fullscreen prior to login. - + + const LLString& getInitAlert() { return mInitAlert; } + // // MANIPULATORS // @@ -319,6 +321,8 @@ protected: BOOL mIgnoreActivate; U8* mPickBuffer; + LLString mInitAlert; // Window / GL initialization requires an alert + class LLDebugText* mDebugText; // Internal class for debug text protected: diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 7dd7f2674b..de67506e3f 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -265,7 +265,7 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y, ddiscard++; min_dim /= 2; } - if (!mDetailTextures[i]->readBackRaw(ddiscard, mRawImages[i])) + if (!mDetailTextures[i]->readBackRaw(ddiscard, mRawImages[i], false)) { llwarns << "Unable to read raw data for terrain detail texture: " << mDetailTextures[i]->getID() << llendl; mRawImages[i] = NULL; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f0e797b6e9..e74c286e43 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6329,7 +6329,7 @@ BOOL LLVOAvatar::getLocalTextureRaw(S32 index, LLImageRaw* image_raw) } else { - if( mLocalTexture[ index ]->readBackRaw(-1, image_raw) ) + if( mLocalTexture[ index ]->readBackRaw(-1, image_raw, false) ) { success = TRUE; } @@ -9184,7 +9184,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base) continue; } LLPointer<LLImageRaw> raw_image = new LLImageRaw; - viewer_imagep->readBackRaw(-1, raw_image); + viewer_imagep->readBackRaw(-1, raw_image, false); BOOL success = tga_image->encode(raw_image); success = tga_image->save(filename); } @@ -9199,7 +9199,7 @@ void LLVOAvatar::writeCAL3D(std::string& path, std::string& file_base) else { LLPointer<LLImageRaw> raw_image = new LLImageRaw; - viewer_imagep->readBackRaw(-1, raw_image); + viewer_imagep->readBackRaw(-1, raw_image, false); BOOL success = tga_image->encode(raw_image); success = tga_image->save(filename); } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 94f9f0b21f..9da6027ab5 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -169,7 +169,7 @@ inline F32 color_intens ( const LLColor4 &col ) inline F32 color_avg ( const LLColor3 &col ) { - return color_intens(col) / 3; + return color_intens(col) / 3.f; } inline void color_gamma_correct(LLColor3 &col) @@ -756,7 +756,7 @@ LLColor3 LLVOSky::calcSkyColorInDir(const LLVector3 &dir) { LLColor3 col, transp; - if (dir.mV[VZ] < -0.02) + if (dir.mV[VZ] < -0.02f) { col = LLColor3(llmax(mFogColor[0],0.2f), llmax(mFogColor[1],0.2f), llmax(mFogColor[2],0.27f)); float x = 1.0f-fabsf(-0.1f-dir.mV[VZ]); @@ -806,15 +806,18 @@ void LLVOSky::calcSkyColorInDir(LLColor3& res, LLColor3& transp, const LLVector3 const F32 e_pow_k = (F32)LL_FAST_EXP(K); F32 step = FIRST_STEP * (1 - 1 / e_pow_k); + // Initialize outside the loop because we write into them every iteration. JC + LLColor3 air_sca_opt_depth; + LLColor3 haze_sca_opt_depth; + LLColor3 air_transp; + for (S32 s = 0; s < NO_STEPS; ++s) { h = calcHeight(cur_pos); step *= e_pow_k; - LLColor3 air_sca_opt_depth; LLHaze::calcAirSca(h, air_sca_opt_depth); air_sca_opt_depth *= step; - LLColor3 haze_sca_opt_depth; mHaze.calcSigSca(h, haze_sca_opt_depth); haze_sca_opt_depth *= step; @@ -824,7 +827,6 @@ void LLVOSky::calcSkyColorInDir(LLColor3& res, LLColor3& transp, const LLVector3 if (calcHitsEarth(cur_pos, tosun) < 0) // calculates amount of in-scattered light from the sun { //visibility check is too expensive - LLColor3 air_transp; mTransp.calcTransp(calcUpVec(cur_pos) * tosun, h, air_transp); air_transp *= transp; res += air_sca_opt_depth * air_transp; diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 0ded91bb80..5697e721ff 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -42,19 +42,12 @@ const F32 INV_NO_STEPS = 1.f/NO_STEPS; // constants used in calculation of scattering coeff of clear air const F32 sigma = 0.035f; -const F32 fsigma = (6+3*sigma)/(6.f-7.f*sigma); +const F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma); const F64 Ndens = 2.55e25; const F64 Ndens2 = Ndens*Ndens; -// !!! *FIX: This #define should be in llcommon somewhere... -// We should not be #defining anything with leading underscores and -// much less double leading underscores since that is always vendor -// specific. Change this to something like LL_FORCE_INLINE. -#ifdef __GNUC__ -#define __forceinline inline __attribute__((always_inline)) -#endif -__forceinline LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2) +LL_FORCE_INLINE LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2) { return LLColor3( col1.mV[0] / col2.mV[0], @@ -121,7 +114,7 @@ private: public: static F32 getInterpVal() { return sInterpVal; } static void setInterpVal(const F32 v) { sInterpVal = v; } - static BOOL doInterpolate() { return sInterpVal > 0.001; } + static BOOL doInterpolate() { return sInterpVal > 0.001f; } void bindTexture(BOOL curr = TRUE); @@ -292,7 +285,7 @@ public: }; -__forceinline LLColor3 refr_ind_calc(const LLColor3 &wave_length) +LL_FORCE_INLINE LLColor3 refr_ind_calc(const LLColor3 &wave_length) { LLColor3 refr_ind; for (S32 i = 0; i < 3; ++i) @@ -306,7 +299,7 @@ __forceinline LLColor3 refr_ind_calc(const LLColor3 &wave_length) } -__forceinline LLColor3 calc_air_sca_sea_level() +LL_FORCE_INLINE LLColor3 calc_air_sca_sea_level() { const static LLColor3 WAVE_LEN(675, 520, 445); const static LLColor3 refr_ind = refr_ind_calc(WAVE_LEN); diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index 759493504e..e524cc32fc 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -69,21 +69,21 @@ public: //============================================================================ LLVOSurfacePatch::LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLStaticViewerObject(id, LL_VO_SURFACE_PATCH, regionp) + : LLStaticViewerObject(id, LL_VO_SURFACE_PATCH, regionp), + mDirtiedPatch(FALSE), + mPool(NULL), + mBaseComp(0), + mPatchp(NULL), + mDirtyTexture(FALSE), + mDirtyTerrain(FALSE), + mLastNorthStride(0), + mLastEastStride(0), + mLastStride(0), + mLastLength(0) { // Terrain must draw during selection passes so it can block objects behind it. mbCanSelect = TRUE; - - mBaseComp = 0; setScale(LLVector3(16.f, 16.f, 16.f)); // Hack for setting scale for bounding boxes/visibility. - mPool = NULL; - mDirtiedPatch = FALSE; - mLastStride = 0; - mLastNorthStride = 0; - mLastEastStride = 0; - mLastLength = 0; - - mDirtyTerrain = TRUE; } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a42d447d5f..1090bf4210 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -257,60 +257,41 @@ void LLVOVolume::animateTextures() for (S32 i = start; i <= end; i++) { - LLQuaternion quat; - LLVector3 scale(1,1,1); - LLFace* facep = mDrawable->getFace(i); const LLTextureEntry* te = facep->getTextureEntry(); - LLMatrix4& tex_mat = facep->mTextureMatrix; if (!te) { continue; } + if (!(result & LLViewerTextureAnim::ROTATE)) { te->getRotation(&rot); } - - { - F32 axis = -1; - F32 s,t; - te->getScale(&s,&t); - if (s < 0) - { - axis = -axis; - } - if (t < 0) - { - axis = -axis; - } - quat.setQuat(rot, 0, 0, axis); - } - if (!(result & LLViewerTextureAnim::TRANSLATE)) { te->getOffset(&off_s,&off_t); } + if (!(result & LLViewerTextureAnim::SCALE)) + { + te->getScale(&scale_s, &scale_t); + } + LLVector3 scale(scale_s, scale_t, 1.f); LLVector3 trans(off_s+0.5f, off_t+0.5f, 0.f); - + LLQuaternion quat; + quat.setQuat(rot, 0, 0, -1.f); + + LLMatrix4& tex_mat = facep->mTextureMatrix; tex_mat.identity(); tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); tex_mat.rotate(quat); - if (!(result & LLViewerTextureAnim::SCALE)) - { - te->getScale(&scale_s, &scale_t); - } - - { - scale.setVec(scale_s, scale_t, 1.f); - LLMatrix4 mat; - mat.initAll(scale, LLQuaternion(), LLVector3()); - tex_mat *= mat; - } - + LLMatrix4 mat; + mat.initAll(scale, LLQuaternion(), LLVector3()); + tex_mat *= mat; + tex_mat.translate(trans); } } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 44ebb2503b..43c587ed92 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -181,6 +181,8 @@ LLPipeline::LLPipeline() : void LLPipeline::init() { LLMemType mt(LLMemType::MTYPE_PIPELINE); + + mInitialized = TRUE; stop_glerror(); @@ -1466,7 +1468,7 @@ void renderScriptedBeacons(LLDrawable* drawablep) && !vobj->getParent() && vobj->flagScripted()) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f)); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(1.f, 0.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); } } @@ -1478,7 +1480,7 @@ void renderPhysicalBeacons(LLDrawable* drawablep) && !vobj->getParent() && vobj->usePhysics()) { - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f)); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", LLColor4(0.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); } } @@ -1490,7 +1492,7 @@ void renderParticleBeacons(LLDrawable* drawablep) && vobj->isParticleSource()) { LLColor4 light_blue(0.5f, 0.5f, 1.f, 0.5f); - gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f)); + gObjectList.addDebugBeacon(vobj->getPositionAgent(), "", light_blue, LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); } } @@ -1711,7 +1713,7 @@ void LLPipeline::postSort(LLCamera& camera) LLVector3d pos_global = sourcep->getPositionGlobal(); LLVector3 pos = gAgent.getPosAgentFromGlobal(pos_global); //pos += LLVector3(0.f, 0.f, 0.2f); - gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f)); + gObjectList.addDebugBeacon(pos, "", LLColor4(1.f, 1.f, 0.f, 0.5f), LLColor4(1.f, 1.f, 1.f, 0.5f), gSavedSettings.getS32("DebugBeaconLineWidth")); } } @@ -1976,6 +1978,7 @@ void LLPipeline::renderGeom(LLCamera& camera) } poolp->endRenderPass(i); #ifndef LL_RELEASE_FOR_DOWNLOAD +#if LL_DEBUG_GL GLint depth; glGetIntegerv(GL_MODELVIEW_STACK_DEPTH, &depth); if (depth > 3) @@ -1986,6 +1989,7 @@ void LLPipeline::renderGeom(LLCamera& camera) LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); #endif +#endif } } else @@ -3874,14 +3878,14 @@ void LLPipeline::bindScreenToTexture() { LLGLEnable gl_texture_2d(GL_TEXTURE_2D); + GLint* viewport = (GLint*) gGLViewport; + GLuint resX = nhpo2(viewport[2]); + GLuint resY = nhpo2(viewport[3]); + if (mScreenTex == 0) { glGenTextures(1, &mScreenTex); glBindTexture(GL_TEXTURE_2D, mScreenTex); - GLint viewport[4]; - glGetIntegerv(GL_VIEWPORT, viewport); - GLuint resX = nhpo2(viewport[2]); - GLuint resY = nhpo2(viewport[3]); gImageList.updateMaxResidentTexMem(-1, resX*resY*3); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, resX, resY, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); @@ -3892,11 +3896,6 @@ void LLPipeline::bindScreenToTexture() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } - GLint viewport[4]; - glGetIntegerv(GL_VIEWPORT, viewport); - GLuint resX = nhpo2(viewport[2]); - GLuint resY = nhpo2(viewport[3]); - glBindTexture(GL_TEXTURE_2D, mScreenTex); GLint cResX; GLint cResY; @@ -4026,5 +4025,4 @@ void LLPipeline::renderBloom(GLuint source, GLuint dest, GLuint buffer, U32 res, glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); -} - +}
\ No newline at end of file diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 5baf01de51..f20731c749 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -364,6 +364,7 @@ public: void clearRenderMap(); + BOOL mInitialized; BOOL mVertexShadersEnabled; S32 mVertexShadersLoaded; // 0 = no, 1 = yes, -1 = failed |